Skip to content

Instantly share code, notes, and snippets.

@kivikakk
Created December 24, 2020 01:50
Show Gist options
  • Save kivikakk/61f642785dc6b5b94c9f894d7195f77e to your computer and use it in GitHub Desktop.
Save kivikakk/61f642785dc6b5b94c9f894d7195f77e to your computer and use it in GitHub Desktop.
; Function Attrs: nobuiltin nounwind sspstrong
define internal fastcc i16 @main.0(%std.builtin.StackTrace* nonnull %0) unnamed_addr #1 !dbg !1611 {
Entry:
%StackGuardSlot = alloca i8*, align 8
%1 = call i8* @llvm.stackguard()
call void @llvm.stackprotector(i8* %1, i8** %StackGuardSlot)
%result = alloca i16, align 2
%sub_var = alloca %S, align 8
%2 = alloca %S, align 8
call void @llvm.dbg.declare(metadata %S* bitcast ({ { { i32, [4 x i8] }, i1, [7 x i8] } }* @59 to %S*), metadata !1615, metadata !DIExpression()), !dbg
!1630
call fastcc void @inspect(%S* @60), !dbg !1631
call fastcc void @inspect(%S* @61), !dbg !1632
%3 = bitcast %S* %sub_var to i8*, !dbg !1633
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %3, i8* align 8 bitcast ({ { { i32, [4 x i8] }, i1, [7 x i8] } }* @62 to i8*), i64 16, i1 false), !dbg !1633
call void @llvm.dbg.declare(metadata %S* %sub_var, metadata !1629, metadata !DIExpression()), !dbg !1633
%4 = getelementptr inbounds %S, %S* %2, i32 0, i32 0, !dbg !1634
%5 = getelementptr inbounds %U, %U* %4, i32 0, i32 1, !dbg !1635
store i1 true, i1* %5, align 1, !dbg !1635
%6 = getelementptr inbounds %U, %U* %4, i32 0, i32 0, !dbg !1635
store %S* %sub_var, %S** %6, align 8, !dbg !1636
call fastcc void @inspect(%S* %2), !dbg !1637
store i1 true, i1* getelementptr inbounds (%"struct:21:17", %"struct:21:17"* @63, i32 0, i32 0, i32 1), align 1, !dbg !1638
store %S* %sub_var, %S** getelementptr inbounds (%"struct:21:17", %"struct:21:17"* @63, i32 0, i32 0, i32 0), align 8, !dbg !1639
call fastcc void @inspect(%S* @64), !dbg !1640
store i16 0, i16* %result, align 2, !dbg !1641
%7 = call i8* @llvm.stackguard()
%8 = load volatile i8*, i8** %StackGuardSlot, align 8
%9 = icmp eq i8* %7, %8
br i1 %9, label %SP_return, label %CallStackCheckFailBlk, !prof !1417
SP_return: ; preds = %Entry
ret i16 0, !dbg !1642
CallStackCheckFailBlk: ; preds = %Entry
call void @__stack_chk_fail(), !dbg !1643
unreachable, !dbg !1643
}
; Function Attrs: nobuiltin nounwind sspstrong
define internal fastcc i16 @main.0(%std.builtin.StackTrace* nonnull %0) unnamed_addr #1 !dbg !1611 {
Entry:
%StackGuardSlot = alloca i8*, align 8
%1 = call i8* @llvm.stackguard()
call void @llvm.stackprotector(i8* %1, i8** %StackGuardSlot)
%result = alloca i16, align 2
%sub_var = alloca %S, align 8
%2 = alloca %S, align 8
%3 = alloca %S, align 8
call void @llvm.dbg.declare(metadata %S* bitcast ({ { { i32, [4 x i8] }, i1, [7 x i8] } }* @59 to %S*), metadata !1615, metadata !DIExpression()), !dbg
!1630
call fastcc void @inspect(%S* @60), !dbg !1631
call fastcc void @inspect(%S* @61), !dbg !1632
%4 = bitcast %S* %sub_var to i8*, !dbg !1633
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %4, i8* align 8 bitcast ({ { { i32, [4 x i8] }, i1, [7 x i8] } }* @62 to i8*), i64 16, i1 false), !dbg !1633
call void @llvm.dbg.declare(metadata %S* %sub_var, metadata !1629, metadata !DIExpression()), !dbg !1633
%5 = getelementptr inbounds %S, %S* %2, i32 0, i32 0, !dbg !1634
%6 = getelementptr inbounds %U, %U* %5, i32 0, i32 1, !dbg !1635
store i1 true, i1* %6, align 1, !dbg !1635
%7 = getelementptr inbounds %U, %U* %5, i32 0, i32 0, !dbg !1635
store %S* %sub_var, %S** %7, align 8, !dbg !1636
call fastcc void @inspect(%S* %2), !dbg !1637
%8 = getelementptr inbounds %S, %S* %3, i32 0, i32 0, !dbg !1638
%9 = getelementptr inbounds %U, %U* %8, i32 0, i32 1, !dbg !1639
store i1 true, i1* %9, align 1, !dbg !1639
%10 = getelementptr inbounds %U, %U* %8, i32 0, i32 0, !dbg !1639
store %S* %sub_var, %S** %10, align 8, !dbg !1640
call fastcc void @inspect(%S* %3), !dbg !1641
store i16 0, i16* %result, align 2, !dbg !1642
%11 = call i8* @llvm.stackguard()
%12 = load volatile i8*, i8** %StackGuardSlot, align 8
%13 = icmp eq i8* %11, %12
br i1 %13, label %SP_return, label %CallStackCheckFailBlk, !prof !1417
SP_return: ; preds = %Entry
ret i16 0, !dbg !1643
CallStackCheckFailBlk: ; preds = %Entry
call void @__stack_chk_fail(), !dbg !1644
unreachable, !dbg !1644
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment