text
stringlengths
2.5k
419k
### Human: Refine the following lifted llvm ir, target datalayout = "e-m:e-p:64:64-i64:64-f80:128-n8:16:32:64-S128" define i64 @_GLOBAL_OFFSET_TABLE_.1(i64 %arg1) local_unnamed_addr { dec_label_pc_0: %0 = call i64 @CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_cpy_54d_badSink(i64 %arg1), !insn.addr !0 ret i64 %0, !insn.addr !1 } define i64 @CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_cpy_54c_goodG2BSink(i64 %arg1) local_unnamed_addr { dec_label_pc_1b: %0 = call i64 @CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_cpy_54d_goodG2BSink(i64 %arg1), !insn.addr !2 ret i64 %0, !insn.addr !3 } declare i64 @CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_cpy_54d_badSink(i64) local_unnamed_addr declare i64 @CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_cpy_54d_goodG2BSink(i64) local_unnamed_addr !0 = !{i64 19} !1 = !{i64 26} !2 = !{i64 46} !3 = !{i64 53} ### Assistant: ; Function Attrs: noinline nounwind optnone uwtable define dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_cpy_54c_badSink(i8* %data) #0 { entry: %data.addr = alloca i8*, align 8 store i8* %data, i8** %data.addr, align 8 %0 = load i8*, i8** %data.addr, align 8 call void @CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_cpy_54d_badSink(i8* %0) ret void } declare dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_cpy_54d_badSink(i8*) #1 ; Function Attrs: noinline nounwind optnone uwtable define dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_cpy_54c_goodG2BSink(i8* %data) #0 { entry: %data.addr = alloca i8*, align 8 store i8* %data, i8** %data.addr, align 8 %0 = load i8*, i8** %data.addr, align 8 call void @CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_cpy_54d_goodG2BSink(i8* %0) ret void } declare dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_cpy_54d_goodG2BSink(i8*) #1 attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } !llvm.module.flags = !{!0} !llvm.ident = !{!1} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{!"clang version 11.1.0"}
### Human: Refine the following lifted llvm ir, target datalayout = "e-m:e-p:64:64-i64:64-f80:128-n8:16:32:64-S128" @global_var_10 = constant [3 x i8] c"%(\00" @0 = external global i32 define i64 @_GLOBAL_OFFSET_TABLE_.1() local_unnamed_addr { dec_label_pc_0: %stack_var_-200 = alloca i64, align 8 %0 = call i64 @__readfsqword(i64 40), !insn.addr !0 %1 = ptrtoint i64* %stack_var_-200 to i64, !insn.addr !1 ret i64 %1, !insn.addr !2 } define i64 @function_35(i64 %arg1, i64 %arg2) local_unnamed_addr { dec_label_pc_35: %0 = alloca i64 %rax.0.reg2mem = alloca i64, !insn.addr !3 %1 = load i64, i64* %0 %2 = add i64 %1, -200, !insn.addr !3 %3 = inttoptr i64 %2 to i64*, !insn.addr !3 %4 = load i64, i64* %3, align 8, !insn.addr !3 %5 = inttoptr i64 %4 to i8*, !insn.addr !4 store i8 0, i8* %5, align 1, !insn.addr !4 %6 = add i64 %1, -192, !insn.addr !5 %7 = inttoptr i64 %6 to i64*, !insn.addr !6 %8 = inttoptr i64 %2 to i8**, !insn.addr !6 %9 = call i64 @_ZNSt7__cxx114listIPcSaIS1_EE9push_backERKS1_(i64* %7, i8** %8), !insn.addr !6 %10 = call i64 @_ZNSt7__cxx114listIPcSaIS1_EE9push_backERKS1_(i64* %7, i8** %8), !insn.addr !7 %11 = call i64 @_ZNSt7__cxx114listIPcSaIS1_EE9push_backERKS1_(i64* %7, i8** %8), !insn.addr !8 %12 = add i64 %1, -160, !insn.addr !9 %13 = inttoptr i64 %12 to i64*, !insn.addr !10 %14 = call i64 @_ZNSt7__cxx114listIPcSaIS1_EEC1ERKS3_(i64* %13, i64* %7), !insn.addr !10 %15 = call i64 @_ZN65CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_memcpy_737badSinkENSt7__cxx114listIPcSaIS2_EEE(i64 %12), !insn.addr !11 %16 = call i64 @_ZNSt7__cxx114listIPcSaIS1_EED1Ev(i64* %13), !insn.addr !12 %17 = call i64 @_ZNSt7__cxx114listIPcSaIS1_EED1Ev(i64* %7), !insn.addr !13 %18 = add i64 %1, -24, !insn.addr !14 %19 = inttoptr i64 %18 to i64*, !insn.addr !14 %20 = load i64, i64* %19, align 8, !insn.addr !14 %21 = call i64 @__readfsqword(i64 40), !insn.addr !15 %22 = icmp eq i64 %20, %21, !insn.addr !15 store i64 0, i64* %rax.0.reg2mem, !insn.addr !16 br i1 %22, label %dec_label_pc_118, label %dec_label_pc_113, !insn.addr !16 dec_label_pc_113: ; preds = %dec_label_pc_35 %23 = call i64 @__stack_chk_fail(), !insn.addr !17 store i64 %23, i64* %rax.0.reg2mem, !insn.addr !17 br label %dec_label_pc_118, !insn.addr !17 dec_label_pc_118: ; preds = %dec_label_pc_113, %dec_label_pc_35 %rax.0.reload = load i64, i64* %rax.0.reg2mem ret i64 %rax.0.reload, !insn.addr !18 } define i64 @_ZN65CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_memcpy_73L7goodG2BEv() local_unnamed_addr { dec_label_pc_122: %rax.0.reg2mem = alloca i64, !insn.addr !19 %stack_var_-168 = alloca i64, align 8 %stack_var_-208 = alloca i8*, align 8 %stack_var_-136 = alloca i64, align 8 %stack_var_-200 = alloca i64, align 8 %0 = call i64 @__readfsqword(i64 40), !insn.addr !20 %1 = call i64 @_ZNSt7__cxx114listIPcSaIS1_EEC1Ev(i64* nonnull %stack_var_-200), !insn.addr !21 %2 = bitcast i64* %stack_var_-136 to i8* store i8* %2, i8** %stack_var_-208, align 8, !insn.addr !22 store i8 0, i8* %2, align 8, !insn.addr !23 %3 = call i64 @_ZNSt7__cxx114listIPcSaIS1_EE9push_backERKS1_(i64* nonnull %stack_var_-200, i8** nonnull %stack_var_-208), !insn.addr !24 %4 = call i64 @_ZNSt7__cxx114listIPcSaIS1_EE9push_backERKS1_(i64* nonnull %stack_var_-200, i8** nonnull %stack_var_-208), !insn.addr !25 %5 = call i64 @_ZNSt7__cxx114listIPcSaIS1_EE9push_backERKS1_(i64* nonnull %stack_var_-200, i8** nonnull %stack_var_-208), !insn.addr !26 %6 = call i64 @_ZNSt7__cxx114listIPcSaIS1_EEC1ERKS3_(i64* nonnull %stack_var_-168, i64* nonnull %stack_var_-200), !insn.addr !27 %7 = ptrtoint i64* %stack_var_-168 to i64, !insn.addr !28 %8 = call i64 @_ZN65CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_memcpy_7311goodG2BSinkENSt7__cxx114listIPcSaIS2_EEE(i64 %7), !insn.addr !29 %9 = call i64 @_ZNSt7__cxx114listIPcSaIS1_EED1Ev(i64* nonnull %stack_var_-168), !insn.addr !30 %10 = call i64 @_ZNSt7__cxx114listIPcSaIS1_EED1Ev(i64* nonnull %stack_var_-200), !insn.addr !31 %11 = call i64 @__readfsqword(i64 40), !insn.addr !32 %12 = icmp eq i64 %0, %11, !insn.addr !32 store i64 0, i64* %rax.0.reg2mem, !insn.addr !33 br i1 %12, label %dec_label_pc_23a, label %dec_label_pc_235, !insn.addr !33 dec_label_pc_235: ; preds = %dec_label_pc_122 %13 = call i64 @__stack_chk_fail(), !insn.addr !34 store i64 %13, i64* %rax.0.reg2mem, !insn.addr !34 br label %dec_label_pc_23a, !insn.addr !34 dec_label_pc_23a: ; preds = %dec_label_pc_235, %dec_label_pc_122 %rax.0.reload = load i64, i64* %rax.0.reg2mem ret i64 %rax.0.reload, !insn.addr !35 } define i64 @_ZN65CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_memcpy_734goodEv() local_unnamed_addr { dec_label_pc_244: %0 = call i64 @_ZN65CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_memcpy_73L7goodG2BEv(), !insn.addr !36 ret i64 %0, !insn.addr !37 } define i64 @_ZnwmPv(i64 %arg1, i64* %arg2) local_unnamed_addr { dec_label_pc_250: %0 = ptrtoint i64* %arg2 to i64 ret i64 %0, !insn.addr !38 } define i64 @_ZNSt7__cxx114listIPcSaIS1_EED1Ev(i64* %result) local_unnamed_addr { dec_label_pc_264: %0 = call i64 @_ZNSt7__cxx1110_List_baseIPcSaIS1_EED1Ev(i64* %result), !insn.addr !39 ret i64 %0, !insn.addr !40 } define i64 @_ZNSt7__cxx114listIPcSaIS1_EEC1Ev(i64* %result) local_unnamed_addr { dec_label_pc_2da: %0 = call i64 @_ZNSt7__cxx1110_List_baseIPcSaIS1_EEC1Ev(i64* %result), !insn.addr !41 ret i64 %0, !insn.addr !42 } define i64 @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE10_List_implD1Ev(i64* %result) local_unnamed_addr { dec_label_pc_2f6: %0 = call i64 @_ZNSaISt10_List_nodeIPcEED1Ev(i64* %result), !insn.addr !43 ret i64 %0, !insn.addr !44 } define i64 @_ZNSt7__cxx1110_List_baseIPcSaIS1_EED1Ev(i64* %result) local_unnamed_addr { dec_label_pc_312: %0 = call i64 @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE8_M_clearEv(i64* %result), !insn.addr !45 %1 = call i64 @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE10_List_implD1Ev(i64* %result), !insn.addr !46 ret i64 %1, !insn.addr !47 } define i64 @_ZNSt7__cxx114listIPcSaIS1_EE9push_backERKS1_(i64* %result, i8** %arg2) local_unnamed_addr { dec_label_pc_33a: %0 = call i64 @_ZNSt7__cxx114listIPcSaIS1_EE3endEv(i64* %result), !insn.addr !48 %1 = ptrtoint i8** %arg2 to i64, !insn.addr !49 call void @_ZNSt7__cxx114listIPcSaIS1_EE9_M_insertIJRKS1_EEEvSt14_List_iteratorIS1_EDpOT_(i64* %result, i64 %0, i64 %1), !insn.addr !50 ret i64 ptrtoint (i32* @0 to i64), !insn.addr !51 } define i64 @_ZNSt7__cxx114listIPcSaIS1_EEC1ERKS3_(i64* %result, i64* %arg2) local_unnamed_addr { dec_label_pc_370: %rax.0.reg2mem = alloca i64, !insn.addr !52 %0 = ptrtoint i64* %result to i64 %stack_var_-33 = alloca i64, align 8 %1 = call i64 @__readfsqword(i64 40), !insn.addr !53 %2 = call i64 @_ZNKSt7__cxx1110_List_baseIPcSaIS1_EE21_M_get_Node_allocatorEv(i64* %arg2), !insn.addr !54 %3 = inttoptr i64 %2 to i64*, !insn.addr !55 %4 = call i64 @_ZN9__gnu_cxx14__alloc_traitsISaISt10_List_nodeIPcEEE17_S_select_on_copyERKS4_(i64* nonnull %stack_var_-33, i64* %3), !insn.addr !55 %5 = call i64 @_ZNSt7__cxx1110_List_baseIPcSaIS1_EEC1ERKSaISt10_List_nodeIS1_EE(i64* %result, i64* nonnull %stack_var_-33), !insn.addr !56 %6 = call i64 @_ZNSaISt10_List_nodeIPcEED1Ev(i64* nonnull %stack_var_-33), !insn.addr !57 %7 = call i64 @_ZNKSt7__cxx114listIPcSaIS1_EE3endEv(i64* %arg2), !insn.addr !58 %8 = call i64 @_ZNKSt7__cxx114listIPcSaIS1_EE5beginEv(i64* %arg2), !insn.addr !59 call void @_ZNSt7__cxx114listIPcSaIS1_EE22_M_initialize_dispatchISt20_List_const_iteratorIS1_EEEvT_S7_St12__false_type(i64 %0, i64 %8, i64 %7), !insn.addr !60 %9 = call i64 @__readfsqword(i64 40), !insn.addr !61 %10 = icmp eq i64 %1, %9, !insn.addr !61 store i64 0, i64* %rax.0.reg2mem, !insn.addr !62 br i1 %10, label %dec_label_pc_43a, label %dec_label_pc_435, !insn.addr !62 dec_label_pc_435: ; preds = %dec_label_pc_370 %11 = call i64 @__stack_chk_fail(), !insn.addr !63 store i64 %11, i64* %rax.0.reg2mem, !insn.addr !63 br label %dec_label_pc_43a, !insn.addr !63 dec_label_pc_43a: ; preds = %dec_label_pc_435, %dec_label_pc_370 %rax.0.reload = load i64, i64* %rax.0.reg2mem ret i64 %rax.0.reload, !insn.addr !64 } define i64 @_ZNSt7__cxx1110_List_baseIPcSaIS1_EEC1Ev(i64* %result) local_unnamed_addr { dec_label_pc_444: %0 = call i64 @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE10_List_implC1Ev(i64* %result), !insn.addr !65 %1 = call i64 @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE7_M_initEv(i64* %result), !insn.addr !66 ret i64 %1, !insn.addr !67 } define i64 @_ZNSaISt10_List_nodeIPcEED1Ev(i64* %result) local_unnamed_addr { dec_label_pc_46c: %0 = call i64 @_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEED1Ev(i64* %result), !insn.addr !68 ret i64 %0, !insn.addr !69 } define i64 @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE8_M_clearEv(i64* %result) local_unnamed_addr { dec_label_pc_4ff: %0 = ptrtoint i64* %result to i64 ret i64 %0, !insn.addr !70 } define i64 @_ZNSt7__cxx114listIPcSaIS1_EE3endEv(i64* %result) local_unnamed_addr { dec_label_pc_502: %rax.0.reg2mem = alloca i64, !insn.addr !71 %stack_var_-24 = alloca i64, align 8 %0 = call i64 @__readfsqword(i64 40), !insn.addr !72 %1 = call i64 @_ZNSt14_List_iteratorIPcEC1EPNSt8__detail15_List_node_baseE(i64* nonnull %stack_var_-24, i64* %result), !insn.addr !73 %2 = load i64, i64* %stack_var_-24, align 8, !insn.addr !74 %3 = call i64 @__readfsqword(i64 40), !insn.addr !75 %4 = icmp eq i64 %0, %3, !insn.addr !75 store i64 %2, i64* %rax.0.reg2mem, !insn.addr !76 br i1 %4, label %dec_label_pc_548, label %dec_label_pc_543, !insn.addr !76 dec_label_pc_543: ; preds = %dec_label_pc_502 %5 = call i64 @__stack_chk_fail(), !insn.addr !77 store i64 %5, i64* %rax.0.reg2mem, !insn.addr !77 br label %dec_label_pc_548, !insn.addr !77 dec_label_pc_548: ; preds = %dec_label_pc_543, %dec_label_pc_502 %rax.0.reload = load i64, i64* %rax.0.reg2mem ret i64 %rax.0.reload, !insn.addr !78 } define i8*** @_ZSt7forwardIRKPcEOT_RNSt16remove_referenceIS3_E4typeE(i64* %arg1) local_unnamed_addr { dec_label_pc_54a: %0 = bitcast i64* %arg1 to i8***, !insn.addr !79 ret i8*** %0, !insn.addr !79 } define void @_ZNSt7__cxx114listIPcSaIS1_EE9_M_insertIJRKS1_EEEvSt14_List_iteratorIS1_EDpOT_(i64* %result, i64 %arg2, i64 %arg3) local_unnamed_addr { dec_label_pc_558: %0 = inttoptr i64 %arg3 to i64*, !insn.addr !80 %1 = call i8*** @_ZSt7forwardIRKPcEOT_RNSt16remove_referenceIS3_E4typeE(i64* %0), !insn.addr !80 %2 = ptrtoint i8*** %1 to i64, !insn.addr !80 %3 = call i64* @_ZNSt7__cxx114listIPcSaIS1_EE14_M_create_nodeIJRKS1_EEEPSt10_List_nodeIS1_EDpOT_(i64* %result, i64 %2), !insn.addr !81 %4 = inttoptr i64 %arg2 to i64*, !insn.addr !82 %5 = call i64 @_ZNSt8__detail15_List_node_base7_M_hookEPS0_(i64* %3, i64* %4), !insn.addr !82 %6 = call i64 @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE11_M_inc_sizeEm(i64* %result, i64 1), !insn.addr !83 ret void, !insn.addr !84 } define i64 @_ZN9__gnu_cxx14__alloc_traitsISaISt10_List_nodeIPcEEE17_S_select_on_copyERKS4_(i64* %result, i64* %arg2) local_unnamed_addr { dec_label_pc_5b5: %rax.0.reg2mem = alloca i64, !insn.addr !85 %0 = ptrtoint i64* %result to i64 %1 = call i64 @__readfsqword(i64 40), !insn.addr !86 %2 = call i64 @_ZNSt16allocator_traitsISaISt10_List_nodeIPcEEE37select_on_container_copy_constructionERKS3_(i64* %result, i64* %arg2), !insn.addr !87 %3 = call i64 @__readfsqword(i64 40), !insn.addr !88 %4 = icmp eq i64 %1, %3, !insn.addr !88 store i64 %0, i64* %rax.0.reg2mem, !insn.addr !89 br i1 %4, label %dec_label_pc_5ff, label %dec_label_pc_5fa, !insn.addr !89 dec_label_pc_5fa: ; preds = %dec_label_pc_5b5 %5 = call i64 @__stack_chk_fail(), !insn.addr !90 store i64 %5, i64* %rax.0.reg2mem, !insn.addr !90 br label %dec_label_pc_5ff, !insn.addr !90 dec_label_pc_5ff: ; preds = %dec_label_pc_5fa, %dec_label_pc_5b5 %rax.0.reload = load i64, i64* %rax.0.reg2mem ret i64 %rax.0.reload, !insn.addr !91 } define i64 @_ZNKSt7__cxx1110_List_baseIPcSaIS1_EE21_M_get_Node_allocatorEv(i64* %result) local_unnamed_addr { dec_label_pc_602: %0 = ptrtoint i64* %result to i64 ret i64 %0, !insn.addr !92 } define i64 @_ZNSt7__cxx1110_List_baseIPcSaIS1_EEC1ERKSaISt10_List_nodeIS1_EE(i64* %result, i64* %arg2) local_unnamed_addr { dec_label_pc_610: %0 = call i64 @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE10_List_implC1ERKSaISt10_List_nodeIS1_EE(i64* %result, i64* %arg2), !insn.addr !93 %1 = call i64 @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE7_M_initEv(i64* %result), !insn.addr !94 ret i64 %1, !insn.addr !95 } define i64 @_ZNKSt7__cxx114listIPcSaIS1_EE5beginEv(i64* %result) local_unnamed_addr { dec_label_pc_642: %rax.0.reg2mem = alloca i64, !insn.addr !96 %stack_var_-24 = alloca i64, align 8 %0 = call i64 @__readfsqword(i64 40), !insn.addr !97 %1 = call i64 @_ZNSt20_List_const_iteratorIPcEC1EPKNSt8__detail15_List_node_baseE(i64* nonnull %stack_var_-24, i64* %result), !insn.addr !98 %2 = load i64, i64* %stack_var_-24, align 8, !insn.addr !99 %3 = call i64 @__readfsqword(i64 40), !insn.addr !100 %4 = icmp eq i64 %0, %3, !insn.addr !100 store i64 %2, i64* %rax.0.reg2mem, !insn.addr !101 br i1 %4, label %dec_label_pc_68b, label %dec_label_pc_686, !insn.addr !101 dec_label_pc_686: ; preds = %dec_label_pc_642 %5 = call i64 @__stack_chk_fail(), !insn.addr !102 store i64 %5, i64* %rax.0.reg2mem, !insn.addr !102 br label %dec_label_pc_68b, !insn.addr !102 dec_label_pc_68b: ; preds = %dec_label_pc_686, %dec_label_pc_642 %rax.0.reload = load i64, i64* %rax.0.reg2mem ret i64 %rax.0.reload, !insn.addr !103 } define i64 @_ZNKSt7__cxx114listIPcSaIS1_EE3endEv(i64* %result) local_unnamed_addr { dec_label_pc_68e: %rax.0.reg2mem = alloca i64, !insn.addr !104 %stack_var_-24 = alloca i64, align 8 %0 = call i64 @__readfsqword(i64 40), !insn.addr !105 %1 = call i64 @_ZNSt20_List_const_iteratorIPcEC1EPKNSt8__detail15_List_node_baseE(i64* nonnull %stack_var_-24, i64* %result), !insn.addr !106 %2 = load i64, i64* %stack_var_-24, align 8, !insn.addr !107 %3 = call i64 @__readfsqword(i64 40), !insn.addr !108 %4 = icmp eq i64 %0, %3, !insn.addr !108 store i64 %2, i64* %rax.0.reg2mem, !insn.addr !109 br i1 %4, label %dec_label_pc_6d4, label %dec_label_pc_6cf, !insn.addr !109 dec_label_pc_6cf: ; preds = %dec_label_pc_68e %5 = call i64 @__stack_chk_fail(), !insn.addr !110 store i64 %5, i64* %rax.0.reg2mem, !insn.addr !110 br label %dec_label_pc_6d4, !insn.addr !110 dec_label_pc_6d4: ; preds = %dec_label_pc_6cf, %dec_label_pc_68e %rax.0.reload = load i64, i64* %rax.0.reg2mem ret i64 %rax.0.reload, !insn.addr !111 } define void @_ZNSt7__cxx114listIPcSaIS1_EE22_M_initialize_dispatchISt20_List_const_iteratorIS1_EEEvT_S7_St12__false_type(i64 %arg1, i64 %arg2, i64 %arg3) local_unnamed_addr { dec_label_pc_6d6: %stack_var_-32 = alloca i64, align 8 %stack_var_-24 = alloca i64, align 8 store i64 %arg2, i64* %stack_var_-24, align 8, !insn.addr !112 store i64 %arg3, i64* %stack_var_-32, align 8, !insn.addr !113 %0 = call i64 @_ZNKSt20_List_const_iteratorIPcEneERKS1_(i64* nonnull %stack_var_-24, i64* nonnull %stack_var_-32), !insn.addr !114 %1 = trunc i64 %0 to i8, !insn.addr !115 %2 = icmp eq i8 %1, 0, !insn.addr !115 br i1 %2, label %dec_label_pc_72d, label %dec_label_pc_701.lr.ph, !insn.addr !116 dec_label_pc_701.lr.ph: ; preds = %dec_label_pc_6d6 %3 = inttoptr i64 %arg1 to i64* br label %dec_label_pc_701 dec_label_pc_701: ; preds = %dec_label_pc_701.lr.ph, %dec_label_pc_701 %4 = call i64 @_ZNKSt20_List_const_iteratorIPcEdeEv(i64* nonnull %stack_var_-24), !insn.addr !117 call void @_ZNSt7__cxx114listIPcSaIS1_EE12emplace_backIJRKS1_EEEvDpOT_(i64* %3, i64 %4), !insn.addr !118 %5 = call i64 @_ZNSt20_List_const_iteratorIPcEppEv(i64* nonnull %stack_var_-24), !insn.addr !119 %6 = call i64 @_ZNKSt20_List_const_iteratorIPcEneERKS1_(i64* nonnull %stack_var_-24, i64* nonnull %stack_var_-32), !insn.addr !114 %7 = trunc i64 %6 to i8, !insn.addr !115 %8 = icmp eq i8 %7, 0, !insn.addr !115 br i1 %8, label %dec_label_pc_72d, label %dec_label_pc_701, !insn.addr !116 dec_label_pc_72d: ; preds = %dec_label_pc_701, %dec_label_pc_6d6 ret void, !insn.addr !120 } define i64 @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE10_List_implC1Ev(i64* %result) local_unnamed_addr { dec_label_pc_730: %0 = ptrtoint i64* %result to i64 %1 = call i64 @_ZNSaISt10_List_nodeIPcEEC1Ev(i64* %result), !insn.addr !121 store i64 0, i64* %result, align 8, !insn.addr !122 %2 = add i64 %0, 8, !insn.addr !123 %3 = inttoptr i64 %2 to i64*, !insn.addr !123 store i64 0, i64* %3, align 8, !insn.addr !123 %4 = add i64 %0, ptrtoint ([3 x i8]* @global_var_10 to i64), !insn.addr !124 %5 = inttoptr i64 %4 to i64*, !insn.addr !124 store i64 0, i64* %5, align 8, !insn.addr !124 ret i64 %0, !insn.addr !125 } define i64 @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE7_M_initEv(i64* %result) local_unnamed_addr { dec_label_pc_766: %0 = ptrtoint i64* %result to i64 store i64 %0, i64* %result, align 8, !insn.addr !126 %1 = add i64 %0, 8, !insn.addr !127 %2 = inttoptr i64 %1 to i64*, !insn.addr !127 store i64 %0, i64* %2, align 8, !insn.addr !127 %3 = call i64 @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE11_M_set_sizeEm(i64* %result, i64 0), !insn.addr !128 ret i64 %3, !insn.addr !129 } define i64 @_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEED1Ev(i64* %result) local_unnamed_addr { dec_label_pc_79e: %0 = alloca i64 %1 = load i64, i64* %0 ret i64 %1, !insn.addr !130 } define i64 @_ZNSt10_List_nodeIPcE9_M_valptrEv(i64* %result) local_unnamed_addr { dec_label_pc_7aa: %0 = ptrtoint i64* %result to i64 %1 = add i64 %0, ptrtoint ([3 x i8]* @global_var_10 to i64), !insn.addr !131 %2 = inttoptr i64 %1 to i64*, !insn.addr !132 %3 = call i64 @_ZN9__gnu_cxx16__aligned_membufIPcE6_M_ptrEv(i64* %2), !insn.addr !132 ret i64 %3, !insn.addr !133 } define i64 @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE21_M_get_Node_allocatorEv(i64* %result) local_unnamed_addr { dec_label_pc_7c8: %0 = ptrtoint i64* %result to i64 ret i64 %0, !insn.addr !134 } define void @_ZNSt16allocator_traitsISaISt10_List_nodeIPcEEE7destroyIS1_EEvRS3_PT_(i64* %arg1, i8** %arg2) local_unnamed_addr { dec_label_pc_7d6: call void @_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEE7destroyIS2_EEvPT_(i64* %arg1, i8** %arg2), !insn.addr !135 ret void, !insn.addr !136 } define i64 @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE11_M_put_nodeEPSt10_List_nodeIS1_E(i64* %result, i64* %arg2) local_unnamed_addr { dec_label_pc_7fc: %0 = call i64 @_ZNSt16allocator_traitsISaISt10_List_nodeIPcEEE10deallocateERS3_PS2_m(i64* %result, i64* %arg2, i64 1), !insn.addr !137 ret i64 %0, !insn.addr !138 } define i64 @_ZNSt14_List_iteratorIPcEC1EPNSt8__detail15_List_node_baseE(i64* %result, i64* %arg2) local_unnamed_addr { dec_label_pc_828: %0 = ptrtoint i64* %arg2 to i64 %1 = ptrtoint i64* %result to i64 store i64 %0, i64* %result, align 8, !insn.addr !139 ret i64 %1, !insn.addr !140 } define i64* @_ZNSt7__cxx114listIPcSaIS1_EE14_M_create_nodeIJRKS1_EEEPSt10_List_nodeIS1_EDpOT_(i64* %result, i64 %arg2) local_unnamed_addr { dec_label_pc_842: %.pre-phi.reg2mem = alloca i64*, !insn.addr !141 %stack_var_-56 = alloca i64, align 8 %0 = call i64 @__readfsqword(i64 40), !insn.addr !142 %1 = call i64 @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE11_M_get_nodeEv(i64* %result), !insn.addr !143 %2 = call i64 @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE21_M_get_Node_allocatorEv(i64* %result), !insn.addr !144 %3 = inttoptr i64 %2 to i64*, !insn.addr !145 %4 = inttoptr i64 %1 to i64* %5 = call i64 @_ZNSt15__allocated_ptrISaISt10_List_nodeIPcEEEC1ERS3_PS2_(i64* nonnull %stack_var_-56, i64* %3, i64* %4), !insn.addr !145 %6 = inttoptr i64 %arg2 to i64*, !insn.addr !146 %7 = call i8*** @_ZSt7forwardIRKPcEOT_RNSt16remove_referenceIS3_E4typeE(i64* %6), !insn.addr !146 %8 = ptrtoint i8*** %7 to i64, !insn.addr !146 %9 = call i64 @_ZNSt10_List_nodeIPcE9_M_valptrEv(i64* %4), !insn.addr !147 %10 = inttoptr i64 %9 to i8**, !insn.addr !148 call void @_ZNSt16allocator_traitsISaISt10_List_nodeIPcEEE9constructIS1_JRKS1_EEEvRS3_PT_DpOT0_(i64* %3, i8** %10, i64 %8), !insn.addr !148 %11 = call i64 @_ZNSt15__allocated_ptrISaISt10_List_nodeIPcEEEaSEDn(i64* nonnull %stack_var_-56, i64 0), !insn.addr !149 %12 = call i64 @_ZNSt15__allocated_ptrISaISt10_List_nodeIPcEEED1Ev(i64* nonnull %stack_var_-56), !insn.addr !150 %13 = call i64 @__readfsqword(i64 40), !insn.addr !151 %14 = icmp eq i64 %0, %13, !insn.addr !151 store i64* %4, i64** %.pre-phi.reg2mem, !insn.addr !152 br i1 %14, label %dec_label_pc_91d, label %dec_label_pc_918, !insn.addr !152 dec_label_pc_918: ; preds = %dec_label_pc_842 %15 = call i64 @__stack_chk_fail(), !insn.addr !153 %.pre = inttoptr i64 %15 to i64*, !insn.addr !154 store i64* %.pre, i64** %.pre-phi.reg2mem, !insn.addr !153 br label %dec_label_pc_91d, !insn.addr !153 dec_label_pc_91d: ; preds = %dec_label_pc_918, %dec_label_pc_842 %.pre-phi.reload = load i64*, i64** %.pre-phi.reg2mem ret i64* %.pre-phi.reload, !insn.addr !154 } define i64 @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE11_M_inc_sizeEm(i64* %result, i64 %arg2) local_unnamed_addr { dec_label_pc_924: %0 = call i64 @_ZNSt10_List_nodeImE9_M_valptrEv(i64* %result), !insn.addr !155 %1 = inttoptr i64 %0 to i64*, !insn.addr !156 %2 = load i64, i64* %1, align 8, !insn.addr !156 %3 = add i64 %2, %arg2, !insn.addr !157 store i64 %3, i64* %1, align 8, !insn.addr !158 ret i64 %0, !insn.addr !159 } define i64 @_ZNSt16allocator_traitsISaISt10_List_nodeIPcEEE37select_on_container_copy_constructionERKS3_(i64* %result, i64* %arg2) local_unnamed_addr { dec_label_pc_950: %0 = ptrtoint i64* %result to i64 %1 = call i64 @_ZNSaISt10_List_nodeIPcEEC1ERKS2_(i64* %result, i64* %arg2), !insn.addr !160 ret i64 %0, !insn.addr !161 } define i64 @_ZNSaISt10_List_nodeIPcEEC1ERKS2_(i64* %result, i64* %arg2) local_unnamed_addr { dec_label_pc_97a: %0 = call i64 @_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEEC1ERKS4_(i64* %result, i64* %arg2), !insn.addr !162 ret i64 %0, !insn.addr !163 } define i64 @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE10_List_implC1ERKSaISt10_List_nodeIS1_EE(i64* %result, i64* %arg2) local_unnamed_addr { dec_label_pc_9a0: %0 = ptrtoint i64* %result to i64 %1 = call i64 @_ZNSaISt10_List_nodeIPcEEC1ERKS2_(i64* %result, i64* %arg2), !insn.addr !164 store i64 0, i64* %result, align 8, !insn.addr !165 %2 = add i64 %0, 8, !insn.addr !166 %3 = inttoptr i64 %2 to i64*, !insn.addr !166 store i64 0, i64* %3, align 8, !insn.addr !166 %4 = add i64 %0, ptrtoint ([3 x i8]* @global_var_10 to i64), !insn.addr !167 %5 = inttoptr i64 %4 to i64*, !insn.addr !167 store i64 0, i64* %5, align 8, !insn.addr !167 ret i64 %0, !insn.addr !168 } define i64 @_ZNSt20_List_const_iteratorIPcEC1EPKNSt8__detail15_List_node_baseE(i64* %result, i64* %arg2) local_unnamed_addr { dec_label_pc_9e2: %0 = ptrtoint i64* %arg2 to i64 %1 = ptrtoint i64* %result to i64 store i64 %0, i64* %result, align 8, !insn.addr !169 ret i64 %1, !insn.addr !170 } define i64 @_ZNKSt20_List_const_iteratorIPcEneERKS1_(i64* %result, i64* %arg2) local_unnamed_addr { dec_label_pc_9fc: %0 = ptrtoint i64* %arg2 to i64 %1 = icmp eq i64* %result, %arg2, !insn.addr !171 %2 = icmp eq i1 %1, false, !insn.addr !172 %3 = zext i1 %2 to i64, !insn.addr !172 %4 = and i64 %0, -256, !insn.addr !172 %5 = or i64 %4, %3, !insn.addr !172 ret i64 %5, !insn.addr !173 } define i64 @_ZNSt20_List_const_iteratorIPcEppEv(i64* %result) local_unnamed_addr { dec_label_pc_a1e: %0 = ptrtoint i64* %result to i64 store i64 %0, i64* %result, align 8, !insn.addr !174 ret i64 %0, !insn.addr !175 } define i64 @_ZNKSt20_List_const_iteratorIPcEdeEv(i64* %result) local_unnamed_addr { dec_label_pc_a3e: %0 = call i64 @_ZNKSt10_List_nodeIPcE9_M_valptrEv(i64* %result), !insn.addr !176 ret i64 %0, !insn.addr !177 } define void @_ZNSt7__cxx114listIPcSaIS1_EE12emplace_backIJRKS1_EEEvDpOT_(i64* %result, i64 %arg2) local_unnamed_addr { dec_label_pc_a5c: %0 = inttoptr i64 %arg2 to i64*, !insn.addr !178 %1 = call i8*** @_ZSt7forwardIRKPcEOT_RNSt16remove_referenceIS3_E4typeE(i64* %0), !insn.addr !178 %2 = ptrtoint i8*** %1 to i64, !insn.addr !178 %3 = call i64 @_ZNSt7__cxx114listIPcSaIS1_EE3endEv(i64* %result), !insn.addr !179 call void @_ZNSt7__cxx114listIPcSaIS1_EE9_M_insertIJRKS1_EEEvSt14_List_iteratorIS1_EDpOT_(i64* %result, i64 %3, i64 %2), !insn.addr !180 ret void, !insn.addr !181 } define i64 @_ZNSaISt10_List_nodeIPcEEC1Ev(i64* %result) local_unnamed_addr { dec_label_pc_aa6: %0 = call i64 @_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEEC1Ev(i64* %result), !insn.addr !182 ret i64 %0, !insn.addr !183 } define i64 @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE11_M_set_sizeEm(i64* %result, i64 %arg2) local_unnamed_addr { dec_label_pc_ac2: %0 = call i64 @_ZNSt10_List_nodeImE9_M_valptrEv(i64* %result), !insn.addr !184 %1 = inttoptr i64 %0 to i64*, !insn.addr !185 store i64 %arg2, i64* %1, align 8, !insn.addr !185 ret i64 %arg2, !insn.addr !186 } define i64 @_ZN9__gnu_cxx16__aligned_membufIPcE6_M_ptrEv(i64* %result) local_unnamed_addr { dec_label_pc_aec: %0 = call i64 @_ZN9__gnu_cxx16__aligned_membufIPcE7_M_addrEv(i64* %result), !insn.addr !187 ret i64 %0, !insn.addr !188 } define void @_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEE7destroyIS2_EEvPT_(i64* %result, i8** %arg2) local_unnamed_addr { dec_label_pc_b06: ret void, !insn.addr !189 } define i64 @_ZNSt16allocator_traitsISaISt10_List_nodeIPcEEE10deallocateERS3_PS2_m(i64* %arg1, i64* %arg2, i64 %arg3) local_unnamed_addr { dec_label_pc_b15: %0 = call i64 @_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEE10deallocateEPS3_m(i64* %arg1, i64* %arg2, i64 %arg3), !insn.addr !190 ret i64 %0, !insn.addr !191 } define i64 @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE11_M_get_nodeEv(i64* %result) local_unnamed_addr { dec_label_pc_b44: %0 = call i64 @_ZNSt16allocator_traitsISaISt10_List_nodeIPcEEE8allocateERS3_m(i64* %result, i64 1), !insn.addr !192 ret i64 %0, !insn.addr !193 } define i64 @_ZNSt15__allocated_ptrISaISt10_List_nodeIPcEEEC1ERS3_PS2_(i64* %result, i64* %arg2, i64* %arg3) local_unnamed_addr { dec_label_pc_b64: %0 = ptrtoint i64* %arg3 to i64 %1 = ptrtoint i64* %result to i64 %2 = call i64* @_ZSt11__addressofISaISt10_List_nodeIPcEEEPT_RS4_(i64* %arg2), !insn.addr !194 %3 = ptrtoint i64* %2 to i64, !insn.addr !194 store i64 %3, i64* %result, align 8, !insn.addr !195 %4 = add i64 %1, 8, !insn.addr !196 %5 = inttoptr i64 %4 to i64*, !insn.addr !196 store i64 %0, i64* %5, align 8, !insn.addr !196 ret i64 %1, !insn.addr !197 } define i64 @_ZNSt15__allocated_ptrISaISt10_List_nodeIPcEEED1Ev(i64* %result) local_unnamed_addr { dec_label_pc_b9e: %rax.0.reg2mem = alloca i64, !insn.addr !198 %0 = ptrtoint i64* %result to i64 %1 = add i64 %0, 8, !insn.addr !199 %2 = inttoptr i64 %1 to i64*, !insn.addr !199 %3 = load i64, i64* %2, align 8, !insn.addr !199 %4 = icmp eq i64 %3, 0, !insn.addr !200 store i64 0, i64* %rax.0.reg2mem, !insn.addr !201 br i1 %4, label %dec_label_pc_bd6, label %dec_label_pc_bb7, !insn.addr !201 dec_label_pc_bb7: ; preds = %dec_label_pc_b9e %5 = inttoptr i64 %3 to i64*, !insn.addr !202 %6 = call i64 @_ZNSt16allocator_traitsISaISt10_List_nodeIPcEEE10deallocateERS3_PS2_m(i64* %result, i64* %5, i64 1), !insn.addr !202 store i64 %6, i64* %rax.0.reg2mem, !insn.addr !202 br label %dec_label_pc_bd6, !insn.addr !202 dec_label_pc_bd6: ; preds = %dec_label_pc_bb7, %dec_label_pc_b9e %rax.0.reload = load i64, i64* %rax.0.reg2mem ret i64 %rax.0.reload, !insn.addr !203 } define void @_ZNSt16allocator_traitsISaISt10_List_nodeIPcEEE9constructIS1_JRKS1_EEEvRS3_PT_DpOT0_(i64* %arg1, i8** %arg2, i64 %arg3) local_unnamed_addr { dec_label_pc_bd9: %0 = inttoptr i64 %arg3 to i64*, !insn.addr !204 %1 = call i8*** @_ZSt7forwardIRKPcEOT_RNSt16remove_referenceIS3_E4typeE(i64* %0), !insn.addr !204 %2 = ptrtoint i8*** %1 to i64, !insn.addr !204 call void @_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEE9constructIS2_JRKS2_EEEvPT_DpOT0_(i64* %arg1, i8** %arg2, i64 %2), !insn.addr !205 ret void, !insn.addr !206 } define i64 @_ZNSt15__allocated_ptrISaISt10_List_nodeIPcEEEaSEDn(i64* %result, i64 %arg2) local_unnamed_addr { dec_label_pc_c12: %0 = ptrtoint i64* %result to i64 %1 = add i64 %0, 8, !insn.addr !207 %2 = inttoptr i64 %1 to i64*, !insn.addr !207 store i64 0, i64* %2, align 8, !insn.addr !207 ret i64 %0, !insn.addr !208 } define i64 @_ZNSt10_List_nodeImE9_M_valptrEv(i64* %result) local_unnamed_addr { dec_label_pc_c30: %0 = ptrtoint i64* %result to i64 %1 = add i64 %0, ptrtoint ([3 x i8]* @global_var_10 to i64), !insn.addr !209 %2 = inttoptr i64 %1 to i64*, !insn.addr !210 %3 = call i64 @_ZN9__gnu_cxx16__aligned_membufImE6_M_ptrEv(i64* %2), !insn.addr !210 ret i64 %3, !insn.addr !211 } define i64 @_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEEC1ERKS4_(i64* %result, i64* %arg2) local_unnamed_addr { dec_label_pc_c4e: %0 = alloca i64 %1 = load i64, i64* %0 ret i64 %1, !insn.addr !212 } define i64 @_ZNKSt10_List_nodeIPcE9_M_valptrEv(i64* %result) local_unnamed_addr { dec_label_pc_c5e: %0 = ptrtoint i64* %result to i64 %1 = add i64 %0, ptrtoint ([3 x i8]* @global_var_10 to i64), !insn.addr !213 %2 = inttoptr i64 %1 to i64*, !insn.addr !214 %3 = call i64 @_ZNK9__gnu_cxx16__aligned_membufIPcE6_M_ptrEv(i64* %2), !insn.addr !214 ret i64 %3, !insn.addr !215 } define i64 @_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEEC1Ev(i64* %result) local_unnamed_addr { dec_label_pc_c7c: %0 = alloca i64 %1 = load i64, i64* %0 ret i64 %1, !insn.addr !216 } define i64 @_ZN9__gnu_cxx16__aligned_membufIPcE7_M_addrEv(i64* %result) local_unnamed_addr { dec_label_pc_c88: %0 = ptrtoint i64* %result to i64 ret i64 %0, !insn.addr !217 } define i64 @_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEE10deallocateEPS3_m(i64* %result, i64* %arg2, i64 %arg3) local_unnamed_addr { dec_label_pc_c96: %0 = call i64 @_ZdlPv(i64* %arg2), !insn.addr !218 ret i64 %0, !insn.addr !219 } define i64 @_ZNSt16allocator_traitsISaISt10_List_nodeIPcEEE8allocateERS3_m(i64* %arg1, i64 %arg2) local_unnamed_addr { dec_label_pc_cb9: %0 = call i64 @_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEE8allocateEmPKv(i64* %arg1, i64 %arg2, i64* null), !insn.addr !220 ret i64 %0, !insn.addr !221 } define i64* @_ZSt11__addressofISaISt10_List_nodeIPcEEEPT_RS4_(i64* %arg1) local_unnamed_addr { dec_label_pc_ce3: ret i64* %arg1, !insn.addr !222 } define void @_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEE9constructIS2_JRKS2_EEEvPT_DpOT0_(i64* %result, i8** %arg2, i64 %arg3) local_unnamed_addr { dec_label_pc_cf2: %0 = inttoptr i64 %arg3 to i64*, !insn.addr !223 %1 = call i8*** @_ZSt7forwardIRKPcEOT_RNSt16remove_referenceIS3_E4typeE(i64* %0), !insn.addr !223 %2 = load i8**, i8*** %1, align 8, !insn.addr !224 %3 = bitcast i8** %arg2 to i64*, !insn.addr !225 %4 = call i64 @_ZnwmPv(i64 8, i64* %3), !insn.addr !225 %5 = icmp eq i64 %4, 0, !insn.addr !226 br i1 %5, label %dec_label_pc_d2f, label %dec_label_pc_d2c, !insn.addr !227 dec_label_pc_d2c: ; preds = %dec_label_pc_cf2 %6 = ptrtoint i8** %2 to i64, !insn.addr !224 %7 = inttoptr i64 %4 to i64*, !insn.addr !228 store i64 %6, i64* %7, align 8, !insn.addr !228 br label %dec_label_pc_d2f, !insn.addr !228 dec_label_pc_d2f: ; preds = %dec_label_pc_d2c, %dec_label_pc_cf2 ret void, !insn.addr !229 } define i64 @_ZN9__gnu_cxx16__aligned_membufImE6_M_ptrEv(i64* %result) local_unnamed_addr { dec_label_pc_d38: %0 = call i64 @_ZN9__gnu_cxx16__aligned_membufImE7_M_addrEv(i64* %result), !insn.addr !230 ret i64 %0, !insn.addr !231 } define i64 @_ZNK9__gnu_cxx16__aligned_membufIPcE6_M_ptrEv(i64* %result) local_unnamed_addr { dec_label_pc_d52: %0 = call i64 @_ZNK9__gnu_cxx16__aligned_membufIPcE7_M_addrEv(i64* %result), !insn.addr !232 ret i64 %0, !insn.addr !233 } define i64 @_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEE8allocateEmPKv(i64* %result, i64 %arg2, i64* %arg3) local_unnamed_addr { dec_label_pc_d6c: %0 = call i64 @_ZNK9__gnu_cxx13new_allocatorISt10_List_nodeIPcEE8max_sizeEv(i64* %result), !insn.addr !234 %1 = icmp uge i64 %0, %arg2 %2 = icmp ne i1 %1, true, !insn.addr !235 %3 = icmp eq i1 %2, false, !insn.addr !236 br i1 %3, label %dec_label_pc_d9c, label %dec_label_pc_d97, !insn.addr !237 dec_label_pc_d97: ; preds = %dec_label_pc_d6c %4 = call i64 @_ZSt17__throw_bad_allocv(), !insn.addr !238 br label %dec_label_pc_d9c, !insn.addr !238 dec_label_pc_d9c: ; preds = %dec_label_pc_d97, %dec_label_pc_d6c %5 = mul i64 %arg2, 24, !insn.addr !239 %6 = call i64 @_Znwm(i64 %5), !insn.addr !240 ret i64 %6, !insn.addr !241 } define i64 @_ZN9__gnu_cxx16__aligned_membufImE7_M_addrEv(i64* %result) local_unnamed_addr { dec_label_pc_db8: %0 = ptrtoint i64* %result to i64 ret i64 %0, !insn.addr !242 } define i64 @_ZNK9__gnu_cxx16__aligned_membufIPcE7_M_addrEv(i64* %result) local_unnamed_addr { dec_label_pc_dc6: %0 = ptrtoint i64* %result to i64 ret i64 %0, !insn.addr !243 } define i64 @_ZNK9__gnu_cxx13new_allocatorISt10_List_nodeIPcEE8max_sizeEv(i64* %result) local_unnamed_addr { dec_label_pc_dd4: ret i64 768614336404564650, !insn.addr !244 } declare i64 @_ZN65CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_memcpy_737badSinkENSt7__cxx114listIPcSaIS2_EEE(i64) local_unnamed_addr declare i64 @__stack_chk_fail() local_unnamed_addr declare i64 @_ZN65CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_memcpy_7311goodG2BSinkENSt7__cxx114listIPcSaIS2_EEE(i64) local_unnamed_addr declare i64 @_ZNSt8__detail15_List_node_base7_M_hookEPS0_(i64*, i64*) local_unnamed_addr declare i64 @_ZdlPv(i64*) local_unnamed_addr declare i64 @_ZSt17__throw_bad_allocv() local_unnamed_addr declare i64 @_Znwm(i64) local_unnamed_addr declare i64 @__readfsqword(i64) local_unnamed_addr !0 = !{i64 12} !1 = !{i64 27} !2 = !{i64 34} !3 = !{i64 53} !4 = !{i64 60} !5 = !{i64 70} !6 = !{i64 83} !7 = !{i64 108} !8 = !{i64 133} !9 = !{i64 145} !10 = !{i64 158} !11 = !{i64 173} !12 = !{i64 188} !13 = !{i64 203} !14 = !{i64 209} !15 = !{i64 213} !16 = !{i64 222} !17 = !{i64 275} !18 = !{i64 289} !19 = !{i64 290} !20 = !{i64 302} !21 = !{i64 327} !22 = !{i64 336} !23 = !{i64 350} !24 = !{i64 373} !25 = !{i64 398} !26 = !{i64 423} !27 = !{i64 448} !28 = !{i64 460} !29 = !{i64 463} !30 = !{i64 478} !31 = !{i64 493} !32 = !{i64 503} !33 = !{i64 512} !34 = !{i64 565} !35 = !{i64 579} !36 = !{i64 584} !37 = !{i64 591} !38 = !{i64 609} !39 = !{i64 631} !40 = !{i64 638} !41 = !{i64 749} !42 = !{i64 756} !43 = !{i64 777} !44 = !{i64 784} !45 = !{i64 805} !46 = !{i64 817} !47 = !{i64 824} !48 = !{i64 849} !49 = !{i64 857} !50 = !{i64 871} !51 = !{i64 878} !52 = !{i64 880} !53 = !{i64 899} !54 = !{i64 925} !55 = !{i64 943} !56 = !{i64 958} !57 = !{i64 970} !58 = !{i64 982} !59 = !{i64 997} !60 = !{i64 1024} !61 = !{i64 1038} !62 = !{i64 1047} !63 = !{i64 1077} !64 = !{i64 1090} !65 = !{i64 1111} !66 = !{i64 1123} !67 = !{i64 1130} !68 = !{i64 1151} !69 = !{i64 1158} !70 = !{i64 1281} !71 = !{i64 1282} !72 = !{i64 1294} !73 = !{i64 1323} !74 = !{i64 1328} !75 = !{i64 1336} !76 = !{i64 1345} !77 = !{i64 1347} !78 = !{i64 1353} !79 = !{i64 1367} !80 = !{i64 1395} !81 = !{i64 1413} !82 = !{i64 1436} !83 = !{i64 1453} !84 = !{i64 1460} !85 = !{i64 1461} !86 = !{i64 1477} !87 = !{i64 1506} !88 = !{i64 1519} !89 = !{i64 1528} !90 = !{i64 1530} !91 = !{i64 1536} !92 = !{i64 1551} !93 = !{i64 1582} !94 = !{i64 1594} !95 = !{i64 1601} !96 = !{i64 1602} !97 = !{i64 1614} !98 = !{i64 1646} !99 = !{i64 1651} !100 = !{i64 1659} !101 = !{i64 1668} !102 = !{i64 1670} !103 = !{i64 1676} !104 = !{i64 1678} !105 = !{i64 1690} !106 = !{i64 1719} !107 = !{i64 1724} !108 = !{i64 1732} !109 = !{i64 1741} !110 = !{i64 1743} !111 = !{i64 1749} !112 = !{i64 1762} !113 = !{i64 1766} !114 = !{i64 1784} !115 = !{i64 1789} !116 = !{i64 1791} !117 = !{i64 1800} !118 = !{i64 1818} !119 = !{i64 1830} !120 = !{i64 1839} !121 = !{i64 1859} !122 = !{i64 1868} !123 = !{i64 1875} !124 = !{i64 1883} !125 = !{i64 1893} !126 = !{i64 1914} !127 = !{i64 1925} !128 = !{i64 1941} !129 = !{i64 1948} !130 = !{i64 1960} !131 = !{i64 1978} !132 = !{i64 1985} !133 = !{i64 1991} !134 = !{i64 2005} !135 = !{i64 2036} !136 = !{i64 2043} !137 = !{i64 2079} !138 = !{i64 2086} !139 = !{i64 2108} !140 = !{i64 2113} !141 = !{i64 2114} !142 = !{i64 2131} !143 = !{i64 2153} !144 = !{i64 2169} !145 = !{i64 2196} !146 = !{i64 2208} !147 = !{i64 2223} !148 = !{i64 2244} !149 = !{i64 2261} !150 = !{i64 2277} !151 = !{i64 2289} !152 = !{i64 2298} !153 = !{i64 2328} !154 = !{i64 2339} !155 = !{i64 2363} !156 = !{i64 2368} !157 = !{i64 2375} !158 = !{i64 2378} !159 = !{i64 2383} !160 = !{i64 2414} !161 = !{i64 2424} !162 = !{i64 2456} !163 = !{i64 2463} !164 = !{i64 2494} !165 = !{i64 2503} !166 = !{i64 2510} !167 = !{i64 2518} !168 = !{i64 2528} !169 = !{i64 2550} !170 = !{i64 2555} !171 = !{i64 2582} !172 = !{i64 2585} !173 = !{i64 2589} !174 = !{i64 2612} !175 = !{i64 2620} !176 = !{i64 2644} !177 = !{i64 2650} !178 = !{i64 2676} !179 = !{i64 2691} !180 = !{i64 2712} !181 = !{i64 2724} !182 = !{i64 2745} !183 = !{i64 2752} !184 = !{i64 2777} !185 = !{i64 2789} !186 = !{i64 2794} !187 = !{i64 2815} !188 = !{i64 2821} !189 = !{i64 2836} !190 = !{i64 2875} !191 = !{i64 2882} !192 = !{i64 2908} !193 = !{i64 2914} !194 = !{i64 2943} !195 = !{i64 2955} !196 = !{i64 2966} !197 = !{i64 2972} !198 = !{i64 2974} !199 = !{i64 2990} !200 = !{i64 2994} !201 = !{i64 2997} !202 = !{i64 3025} !203 = !{i64 3032} !204 = !{i64 3060} !205 = !{i64 3082} !206 = !{i64 3089} !207 = !{i64 3106} !208 = !{i64 3119} !209 = !{i64 3136} !210 = !{i64 3143} !211 = !{i64 3149} !212 = !{i64 3164} !213 = !{i64 3182} !214 = !{i64 3189} !215 = !{i64 3195} !216 = !{i64 3206} !217 = !{i64 3221} !218 = !{i64 3249} !219 = !{i64 3256} !220 = !{i64 3292} !221 = !{i64 3298} !222 = !{i64 3312} !223 = !{i64 3342} !224 = !{i64 3347} !225 = !{i64 3362} !226 = !{i64 3367} !227 = !{i64 3370} !228 = !{i64 3372} !229 = !{i64 3382} !230 = !{i64 3403} !231 = !{i64 3409} !232 = !{i64 3429} !233 = !{i64 3435} !234 = !{i64 3463} !235 = !{i64 3472} !236 = !{i64 3475} !237 = !{i64 3477} !238 = !{i64 3479} !239 = !{i64 3497} !240 = !{i64 3504} !241 = !{i64 3510} !242 = !{i64 3525} !243 = !{i64 3539} !244 = !{i64 3559} ### Assistant: %"class.std::__cxx11::list" = type { %"class.std::__cxx11::_List_base" } %"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl" } %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" } %"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 } %"struct.std::__detail::_List_node_base" = type { %"struct.std::__detail::_List_node_base"*, %"struct.std::__detail::_List_node_base"* } %"struct.std::_List_iterator" = type { %"struct.std::__detail::_List_node_base"* } %"class.std::allocator" = type { i8 } %"struct.std::_List_const_iterator" = type { %"struct.std::__detail::_List_node_base"* } %"struct.std::__false_type" = type { i8 } %"class.__gnu_cxx::new_allocator" = type { i8 } %"struct.std::_List_node" = type { %"struct.std::__detail::_List_node_base", %"struct.__gnu_cxx::__aligned_membuf" } %"struct.__gnu_cxx::__aligned_membuf" = type { [8 x i8] } %"struct.std::__allocated_ptr" = type { %"class.std::allocator"*, %"struct.std::_List_node"* } $_ZNSt7__cxx114listIPcSaIS1_EEC2Ev = comdat any $_ZNSt7__cxx114listIPcSaIS1_EE9push_backERKS1_ = comdat any $_ZNSt7__cxx114listIPcSaIS1_EEC2ERKS3_ = comdat any $_ZNSt7__cxx114listIPcSaIS1_EED2Ev = comdat any $_ZNSt7__cxx1110_List_baseIPcSaIS1_EEC2Ev = comdat any $_ZNSt7__cxx1110_List_baseIPcSaIS1_EE10_List_implC2Ev = comdat any $_ZNSaISt10_List_nodeIPcEEC2Ev = comdat any $_ZNSt8__detail17_List_node_headerC2Ev = comdat any $_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEEC2Ev = comdat any $_ZNSt8__detail17_List_node_header7_M_initEv = comdat any $_ZNSt7__cxx1110_List_baseIPcSaIS1_EED2Ev = comdat any $_ZNSt7__cxx1110_List_baseIPcSaIS1_EE8_M_clearEv = comdat any $_ZNSt7__cxx1110_List_baseIPcSaIS1_EE10_List_implD2Ev = comdat any $_ZNSt10_List_nodeIPcE9_M_valptrEv = comdat any $__clang_call_terminate = comdat any $_ZNSt16allocator_traitsISaISt10_List_nodeIPcEEE7destroyIS1_EEvRS3_PT_ = comdat any $_ZNSt7__cxx1110_List_baseIPcSaIS1_EE21_M_get_Node_allocatorEv = comdat any $_ZNSt7__cxx1110_List_baseIPcSaIS1_EE11_M_put_nodeEPSt10_List_nodeIS1_E = comdat any $_ZN9__gnu_cxx16__aligned_membufIPcE6_M_ptrEv = comdat any $_ZN9__gnu_cxx16__aligned_membufIPcE7_M_addrEv = comdat any $_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEE7destroyIS2_EEvPT_ = comdat any $_ZNSt16allocator_traitsISaISt10_List_nodeIPcEEE10deallocateERS3_PS2_m = comdat any $_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEE10deallocateEPS3_m = comdat any $_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEED2Ev = comdat any $_ZNSt7__cxx114listIPcSaIS1_EE9_M_insertIJRKS1_EEEvSt14_List_iteratorIS1_EDpOT_ = comdat any $_ZNSt7__cxx114listIPcSaIS1_EE3endEv = comdat any $_ZNSt7__cxx114listIPcSaIS1_EE14_M_create_nodeIJRKS1_EEEPSt10_List_nodeIS1_EDpOT_ = comdat any $_ZSt7forwardIRKPcEOT_RNSt16remove_referenceIS3_E4typeE = comdat any $_ZNSt7__cxx1110_List_baseIPcSaIS1_EE11_M_inc_sizeEm = comdat any $_ZNSt7__cxx1110_List_baseIPcSaIS1_EE11_M_get_nodeEv = comdat any $_ZNSt15__allocated_ptrISaISt10_List_nodeIPcEEEC2ERS3_PS2_ = comdat any $_ZNSt16allocator_traitsISaISt10_List_nodeIPcEEE9constructIS1_JRKS1_EEEvRS3_PT_DpOT0_ = comdat any $_ZNSt15__allocated_ptrISaISt10_List_nodeIPcEEEaSEDn = comdat any $_ZNSt15__allocated_ptrISaISt10_List_nodeIPcEEED2Ev = comdat any $_ZNSt16allocator_traitsISaISt10_List_nodeIPcEEE8allocateERS3_m = comdat any $_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEE8allocateEmPKv = comdat any $_ZNK9__gnu_cxx13new_allocatorISt10_List_nodeIPcEE11_M_max_sizeEv = comdat any $_ZSt11__addressofISaISt10_List_nodeIPcEEEPT_RS4_ = comdat any $_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEE9constructIS2_JRKS2_EEEvPT_DpOT0_ = comdat any $_ZNSt14_List_iteratorIPcEC2EPNSt8__detail15_List_node_baseE = comdat any $_ZN9__gnu_cxx14__alloc_traitsISaISt10_List_nodeIPcEES3_E17_S_select_on_copyERKS4_ = comdat any $_ZNKSt7__cxx1110_List_baseIPcSaIS1_EE21_M_get_Node_allocatorEv = comdat any $_ZNSt7__cxx1110_List_baseIPcSaIS1_EEC2EOSaISt10_List_nodeIS1_EE = comdat any $_ZNSaISt10_List_nodeIPcEED2Ev = comdat any $_ZNSt7__cxx114listIPcSaIS1_EE22_M_initialize_dispatchISt20_List_const_iteratorIS1_EEEvT_S7_St12__false_type = comdat any $_ZNKSt7__cxx114listIPcSaIS1_EE5beginEv = comdat any $_ZNKSt7__cxx114listIPcSaIS1_EE3endEv = comdat any $_ZNSt16allocator_traitsISaISt10_List_nodeIPcEEE37select_on_container_copy_constructionERKS3_ = comdat any $_ZNSaISt10_List_nodeIPcEEC2ERKS2_ = comdat any $_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEEC2ERKS4_ = comdat any $_ZSt4moveIRSaISt10_List_nodeIPcEEEONSt16remove_referenceIT_E4typeEOS6_ = comdat any $_ZNSt7__cxx1110_List_baseIPcSaIS1_EE10_List_implC2EOSaISt10_List_nodeIS1_EE = comdat any $_ZStneRKSt20_List_const_iteratorIPcES3_ = comdat any $_ZNSt7__cxx114listIPcSaIS1_EE12emplace_backIJRKS1_EEEvDpOT_ = comdat any $_ZNKSt20_List_const_iteratorIPcEdeEv = comdat any $_ZNSt20_List_const_iteratorIPcEppEv = comdat any $_ZNKSt10_List_nodeIPcE9_M_valptrEv = comdat any $_ZNK9__gnu_cxx16__aligned_membufIPcE6_M_ptrEv = comdat any $_ZNK9__gnu_cxx16__aligned_membufIPcE7_M_addrEv = comdat any $_ZNSt20_List_const_iteratorIPcEC2EPKNSt8__detail15_List_node_baseE = comdat any ; Function Attrs: noinline optnone uwtable define dso_local void @_ZN65CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_memcpy_733badEv() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { entry: %data = alloca i8*, align 8 %dataList = alloca %"class.std::__cxx11::list", align 8 %dataBadBuffer = alloca [50 x i8], align 16 %dataGoodBuffer = alloca [100 x i8], align 16 %exn.slot = alloca i8*, align 8 %ehselector.slot = alloca i32, align 4 %agg.tmp = alloca %"class.std::__cxx11::list", align 8 call void @_ZNSt7__cxx114listIPcSaIS1_EEC2Ev(%"class.std::__cxx11::list"* %dataList) #8 %arraydecay = getelementptr inbounds [50 x i8], [50 x i8]* %dataBadBuffer, i64 0, i64 0 store i8* %arraydecay, i8** %data, align 8 %0 = load i8*, i8** %data, align 8 %arrayidx = getelementptr inbounds i8, i8* %0, i64 0 store i8 0, i8* %arrayidx, align 1 invoke void @_ZNSt7__cxx114listIPcSaIS1_EE9push_backERKS1_(%"class.std::__cxx11::list"* %dataList, i8** nonnull align 8 dereferenceable(8) %data) to label %invoke.cont unwind label %lpad invoke.cont: ; preds = %entry invoke void @_ZNSt7__cxx114listIPcSaIS1_EE9push_backERKS1_(%"class.std::__cxx11::list"* %dataList, i8** nonnull align 8 dereferenceable(8) %data) to label %invoke.cont1 unwind label %lpad invoke.cont1: ; preds = %invoke.cont invoke void @_ZNSt7__cxx114listIPcSaIS1_EE9push_backERKS1_(%"class.std::__cxx11::list"* %dataList, i8** nonnull align 8 dereferenceable(8) %data) to label %invoke.cont2 unwind label %lpad invoke.cont2: ; preds = %invoke.cont1 invoke void @_ZNSt7__cxx114listIPcSaIS1_EEC2ERKS3_(%"class.std::__cxx11::list"* %agg.tmp, %"class.std::__cxx11::list"* nonnull align 8 dereferenceable(24) %dataList) to label %invoke.cont3 unwind label %lpad invoke.cont3: ; preds = %invoke.cont2 invoke void @_ZN65CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_memcpy_737badSinkENSt7__cxx114listIPcSaIS2_EEE(%"class.std::__cxx11::list"* %agg.tmp) to label %invoke.cont5 unwind label %lpad4 invoke.cont5: ; preds = %invoke.cont3 call void @_ZNSt7__cxx114listIPcSaIS1_EED2Ev(%"class.std::__cxx11::list"* %agg.tmp) #8 call void @_ZNSt7__cxx114listIPcSaIS1_EED2Ev(%"class.std::__cxx11::list"* %dataList) #8 ret void lpad: ; preds = %invoke.cont2, %invoke.cont1, %invoke.cont, %entry %1 = landingpad { i8*, i32 } cleanup %2 = extractvalue { i8*, i32 } %1, 0 store i8* %2, i8** %exn.slot, align 8 %3 = extractvalue { i8*, i32 } %1, 1 store i32 %3, i32* %ehselector.slot, align 4 br label %ehcleanup lpad4: ; preds = %invoke.cont3 %4 = landingpad { i8*, i32 } cleanup %5 = extractvalue { i8*, i32 } %4, 0 store i8* %5, i8** %exn.slot, align 8 %6 = extractvalue { i8*, i32 } %4, 1 store i32 %6, i32* %ehselector.slot, align 4 call void @_ZNSt7__cxx114listIPcSaIS1_EED2Ev(%"class.std::__cxx11::list"* %agg.tmp) #8 br label %ehcleanup ehcleanup: ; preds = %lpad4, %lpad call void @_ZNSt7__cxx114listIPcSaIS1_EED2Ev(%"class.std::__cxx11::list"* %dataList) #8 br label %eh.resume eh.resume: ; preds = %ehcleanup %exn = load i8*, i8** %exn.slot, align 8 %sel = load i32, i32* %ehselector.slot, align 4 %lpad.val = insertvalue { i8*, i32 } undef, i8* %exn, 0 %lpad.val6 = insertvalue { i8*, i32 } %lpad.val, i32 %sel, 1 resume { i8*, i32 } %lpad.val6 } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local void @_ZNSt7__cxx114listIPcSaIS1_EEC2Ev(%"class.std::__cxx11::list"* %this) unnamed_addr #1 comdat align 2 { entry: %this.addr = alloca %"class.std::__cxx11::list"*, align 8 store %"class.std::__cxx11::list"* %this, %"class.std::__cxx11::list"** %this.addr, align 8 %this1 = load %"class.std::__cxx11::list"*, %"class.std::__cxx11::list"** %this.addr, align 8 %0 = bitcast %"class.std::__cxx11::list"* %this1 to %"class.std::__cxx11::_List_base"* call void @_ZNSt7__cxx1110_List_baseIPcSaIS1_EEC2Ev(%"class.std::__cxx11::_List_base"* %0) #8 ret void } ; Function Attrs: noinline optnone uwtable define linkonce_odr dso_local void @_ZNSt7__cxx114listIPcSaIS1_EE9push_backERKS1_(%"class.std::__cxx11::list"* %this, i8** nonnull align 8 dereferenceable(8) %__x) #0 comdat align 2 { entry: %this.addr = alloca %"class.std::__cxx11::list"*, align 8 %__x.addr = alloca i8**, align 8 %agg.tmp = alloca %"struct.std::_List_iterator", align 8 store %"class.std::__cxx11::list"* %this, %"class.std::__cxx11::list"** %this.addr, align 8 store i8** %__x, i8*** %__x.addr, align 8 %this1 = load %"class.std::__cxx11::list"*, %"class.std::__cxx11::list"** %this.addr, align 8 %call = call %"struct.std::__detail::_List_node_base"* @_ZNSt7__cxx114listIPcSaIS1_EE3endEv(%"class.std::__cxx11::list"* %this1) #8 %coerce.dive = getelementptr inbounds %"struct.std::_List_iterator", %"struct.std::_List_iterator"* %agg.tmp, i32 0, i32 0 store %"struct.std::__detail::_List_node_base"* %call, %"struct.std::__detail::_List_node_base"** %coerce.dive, align 8 %0 = load i8**, i8*** %__x.addr, align 8 %coerce.dive2 = getelementptr inbounds %"struct.std::_List_iterator", %"struct.std::_List_iterator"* %agg.tmp, i32 0, i32 0 %1 = load %"struct.std::__detail::_List_node_base"*, %"struct.std::__detail::_List_node_base"** %coerce.dive2, align 8 call void @_ZNSt7__cxx114listIPcSaIS1_EE9_M_insertIJRKS1_EEEvSt14_List_iteratorIS1_EDpOT_(%"class.std::__cxx11::list"* %this1, %"struct.std::__detail::_List_node_base"* %1, i8** nonnull align 8 dereferenceable(8) %0) ret void } declare dso_local i32 @__gxx_personality_v0(...) declare dso_local void @_ZN65CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_memcpy_737badSinkENSt7__cxx114listIPcSaIS2_EEE(%"class.std::__cxx11::list"*) #2 ; Function Attrs: noinline optnone uwtable define linkonce_odr dso_local void @_ZNSt7__cxx114listIPcSaIS1_EEC2ERKS3_(%"class.std::__cxx11::list"* %this, %"class.std::__cxx11::list"* nonnull align 8 dereferenceable(24) %__x) unnamed_addr #0 comdat align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { entry: %this.addr = alloca %"class.std::__cxx11::list"*, align 8 %__x.addr = alloca %"class.std::__cxx11::list"*, align 8 %ref.tmp = alloca %"class.std::allocator", align 1 %exn.slot = alloca i8*, align 8 %ehselector.slot = alloca i32, align 4 %agg.tmp = alloca %"struct.std::_List_const_iterator", align 8 %agg.tmp3 = alloca %"struct.std::_List_const_iterator", align 8 %agg.tmp6 = alloca %"struct.std::__false_type", align 1 store %"class.std::__cxx11::list"* %this, %"class.std::__cxx11::list"** %this.addr, align 8 store %"class.std::__cxx11::list"* %__x, %"class.std::__cxx11::list"** %__x.addr, align 8 %this1 = load %"class.std::__cxx11::list"*, %"class.std::__cxx11::list"** %this.addr, align 8 %0 = bitcast %"class.std::__cxx11::list"* %this1 to %"class.std::__cxx11::_List_base"* %1 = load %"class.std::__cxx11::list"*, %"class.std::__cxx11::list"** %__x.addr, align 8 %2 = bitcast %"class.std::__cxx11::list"* %1 to %"class.std::__cxx11::_List_base"* %call = call nonnull align 1 dereferenceable(1) %"class.std::allocator"* @_ZNKSt7__cxx1110_List_baseIPcSaIS1_EE21_M_get_Node_allocatorEv(%"class.std::__cxx11::_List_base"* %2) #8 call void @_ZN9__gnu_cxx14__alloc_traitsISaISt10_List_nodeIPcEES3_E17_S_select_on_copyERKS4_(%"class.std::allocator"* sret align 1 %ref.tmp, %"class.std::allocator"* nonnull align 1 dereferenceable(1) %call) invoke void @_ZNSt7__cxx1110_List_baseIPcSaIS1_EEC2EOSaISt10_List_nodeIS1_EE(%"class.std::__cxx11::_List_base"* %0, %"class.std::allocator"* nonnull align 1 dereferenceable(1) %ref.tmp) to label %invoke.cont unwind label %lpad invoke.cont: ; preds = %entry call void @_ZNSaISt10_List_nodeIPcEED2Ev(%"class.std::allocator"* %ref.tmp) #8 %3 = load %"class.std::__cxx11::list"*, %"class.std::__cxx11::list"** %__x.addr, align 8 %call2 = call %"struct.std::__detail::_List_node_base"* @_ZNKSt7__cxx114listIPcSaIS1_EE5beginEv(%"class.std::__cxx11::list"* %3) #8 %coerce.dive = getelementptr inbounds %"struct.std::_List_const_iterator", %"struct.std::_List_const_iterator"* %agg.tmp, i32 0, i32 0 store %"struct.std::__detail::_List_node_base"* %call2, %"struct.std::__detail::_List_node_base"** %coerce.dive, align 8 %4 = load %"class.std::__cxx11::list"*, %"class.std::__cxx11::list"** %__x.addr, align 8 %call4 = call %"struct.std::__detail::_List_node_base"* @_ZNKSt7__cxx114listIPcSaIS1_EE3endEv(%"class.std::__cxx11::list"* %4) #8 %coerce.dive5 = getelementptr inbounds %"struct.std::_List_const_iterator", %"struct.std::_List_const_iterator"* %agg.tmp3, i32 0, i32 0 store %"struct.std::__detail::_List_node_base"* %call4, %"struct.std::__detail::_List_node_base"** %coerce.dive5, align 8 %coerce.dive7 = getelementptr inbounds %"struct.std::_List_const_iterator", %"struct.std::_List_const_iterator"* %agg.tmp, i32 0, i32 0 %5 = load %"struct.std::__detail::_List_node_base"*, %"struct.std::__detail::_List_node_base"** %coerce.dive7, align 8 %coerce.dive8 = getelementptr inbounds %"struct.std::_List_const_iterator", %"struct.std::_List_const_iterator"* %agg.tmp3, i32 0, i32 0 %6 = load %"struct.std::__detail::_List_node_base"*, %"struct.std::__detail::_List_node_base"** %coerce.dive8, align 8 invoke void @_ZNSt7__cxx114listIPcSaIS1_EE22_M_initialize_dispatchISt20_List_const_iteratorIS1_EEEvT_S7_St12__false_type(%"class.std::__cxx11::list"* %this1, %"struct.std::__detail::_List_node_base"* %5, %"struct.std::__detail::_List_node_base"* %6) to label %invoke.cont10 unwind label %lpad9 invoke.cont10: ; preds = %invoke.cont ret void lpad: ; preds = %entry %7 = landingpad { i8*, i32 } cleanup %8 = extractvalue { i8*, i32 } %7, 0 store i8* %8, i8** %exn.slot, align 8 %9 = extractvalue { i8*, i32 } %7, 1 store i32 %9, i32* %ehselector.slot, align 4 call void @_ZNSaISt10_List_nodeIPcEED2Ev(%"class.std::allocator"* %ref.tmp) #8 br label %eh.resume lpad9: ; preds = %invoke.cont %10 = landingpad { i8*, i32 } cleanup %11 = extractvalue { i8*, i32 } %10, 0 store i8* %11, i8** %exn.slot, align 8 %12 = extractvalue { i8*, i32 } %10, 1 store i32 %12, i32* %ehselector.slot, align 4 %13 = bitcast %"class.std::__cxx11::list"* %this1 to %"class.std::__cxx11::_List_base"* call void @_ZNSt7__cxx1110_List_baseIPcSaIS1_EED2Ev(%"class.std::__cxx11::_List_base"* %13) #8 br label %eh.resume eh.resume: ; preds = %lpad9, %lpad %exn = load i8*, i8** %exn.slot, align 8 %sel = load i32, i32* %ehselector.slot, align 4 %lpad.val = insertvalue { i8*, i32 } undef, i8* %exn, 0 %lpad.val11 = insertvalue { i8*, i32 } %lpad.val, i32 %sel, 1 resume { i8*, i32 } %lpad.val11 } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local void @_ZNSt7__cxx114listIPcSaIS1_EED2Ev(%"class.std::__cxx11::list"* %this) unnamed_addr #1 comdat align 2 { entry: %this.addr = alloca %"class.std::__cxx11::list"*, align 8 store %"class.std::__cxx11::list"* %this, %"class.std::__cxx11::list"** %this.addr, align 8 %this1 = load %"class.std::__cxx11::list"*, %"class.std::__cxx11::list"** %this.addr, align 8 %0 = bitcast %"class.std::__cxx11::list"* %this1 to %"class.std::__cxx11::_List_base"* call void @_ZNSt7__cxx1110_List_baseIPcSaIS1_EED2Ev(%"class.std::__cxx11::_List_base"* %0) #8 ret void } ; Function Attrs: noinline optnone uwtable define dso_local void @_ZN65CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_memcpy_734goodEv() #0 { entry: call void @_ZN65CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_memcpy_73L7goodG2BEv() ret void } ; Function Attrs: noinline optnone uwtable define internal void @_ZN65CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_memcpy_73L7goodG2BEv() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { entry: %data = alloca i8*, align 8 %dataList = alloca %"class.std::__cxx11::list", align 8 %dataBadBuffer = alloca [50 x i8], align 16 %dataGoodBuffer = alloca [100 x i8], align 16 %exn.slot = alloca i8*, align 8 %ehselector.slot = alloca i32, align 4 %agg.tmp = alloca %"class.std::__cxx11::list", align 8 call void @_ZNSt7__cxx114listIPcSaIS1_EEC2Ev(%"class.std::__cxx11::list"* %dataList) #8 %arraydecay = getelementptr inbounds [100 x i8], [100 x i8]* %dataGoodBuffer, i64 0, i64 0 store i8* %arraydecay, i8** %data, align 8 %0 = load i8*, i8** %data, align 8 %arrayidx = getelementptr inbounds i8, i8* %0, i64 0 store i8 0, i8* %arrayidx, align 1 invoke void @_ZNSt7__cxx114listIPcSaIS1_EE9push_backERKS1_(%"class.std::__cxx11::list"* %dataList, i8** nonnull align 8 dereferenceable(8) %data) to label %invoke.cont unwind label %lpad invoke.cont: ; preds = %entry invoke void @_ZNSt7__cxx114listIPcSaIS1_EE9push_backERKS1_(%"class.std::__cxx11::list"* %dataList, i8** nonnull align 8 dereferenceable(8) %data) to label %invoke.cont1 unwind label %lpad invoke.cont1: ; preds = %invoke.cont invoke void @_ZNSt7__cxx114listIPcSaIS1_EE9push_backERKS1_(%"class.std::__cxx11::list"* %dataList, i8** nonnull align 8 dereferenceable(8) %data) to label %invoke.cont2 unwind label %lpad invoke.cont2: ; preds = %invoke.cont1 invoke void @_ZNSt7__cxx114listIPcSaIS1_EEC2ERKS3_(%"class.std::__cxx11::list"* %agg.tmp, %"class.std::__cxx11::list"* nonnull align 8 dereferenceable(24) %dataList) to label %invoke.cont3 unwind label %lpad invoke.cont3: ; preds = %invoke.cont2 invoke void @_ZN65CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_memcpy_7311goodG2BSinkENSt7__cxx114listIPcSaIS2_EEE(%"class.std::__cxx11::list"* %agg.tmp) to label %invoke.cont5 unwind label %lpad4 invoke.cont5: ; preds = %invoke.cont3 call void @_ZNSt7__cxx114listIPcSaIS1_EED2Ev(%"class.std::__cxx11::list"* %agg.tmp) #8 call void @_ZNSt7__cxx114listIPcSaIS1_EED2Ev(%"class.std::__cxx11::list"* %dataList) #8 ret void lpad: ; preds = %invoke.cont2, %invoke.cont1, %invoke.cont, %entry %1 = landingpad { i8*, i32 } cleanup %2 = extractvalue { i8*, i32 } %1, 0 store i8* %2, i8** %exn.slot, align 8 %3 = extractvalue { i8*, i32 } %1, 1 store i32 %3, i32* %ehselector.slot, align 4 br label %ehcleanup lpad4: ; preds = %invoke.cont3 %4 = landingpad { i8*, i32 } cleanup %5 = extractvalue { i8*, i32 } %4, 0 store i8* %5, i8** %exn.slot, align 8 %6 = extractvalue { i8*, i32 } %4, 1 store i32 %6, i32* %ehselector.slot, align 4 call void @_ZNSt7__cxx114listIPcSaIS1_EED2Ev(%"class.std::__cxx11::list"* %agg.tmp) #8 br label %ehcleanup ehcleanup: ; preds = %lpad4, %lpad call void @_ZNSt7__cxx114listIPcSaIS1_EED2Ev(%"class.std::__cxx11::list"* %dataList) #8 br label %eh.resume eh.resume: ; preds = %ehcleanup %exn = load i8*, i8** %exn.slot, align 8 %sel = load i32, i32* %ehselector.slot, align 4 %lpad.val = insertvalue { i8*, i32 } undef, i8* %exn, 0 %lpad.val6 = insertvalue { i8*, i32 } %lpad.val, i32 %sel, 1 resume { i8*, i32 } %lpad.val6 } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local void @_ZNSt7__cxx1110_List_baseIPcSaIS1_EEC2Ev(%"class.std::__cxx11::_List_base"* %this) unnamed_addr #1 comdat align 2 { entry: %this.addr = alloca %"class.std::__cxx11::_List_base"*, align 8 store %"class.std::__cxx11::_List_base"* %this, %"class.std::__cxx11::_List_base"** %this.addr, align 8 %this1 = load %"class.std::__cxx11::_List_base"*, %"class.std::__cxx11::_List_base"** %this.addr, align 8 %_M_impl = getelementptr inbounds %"class.std::__cxx11::_List_base", %"class.std::__cxx11::_List_base"* %this1, i32 0, i32 0 call void @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE10_List_implC2Ev(%"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"* %_M_impl) #8 ret void } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local void @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE10_List_implC2Ev(%"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"* %this) unnamed_addr #1 comdat align 2 { entry: %this.addr = alloca %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"*, align 8 store %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"* %this, %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"** %this.addr, align 8 %this1 = load %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"*, %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"** %this.addr, align 8 %0 = bitcast %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"* %this1 to %"class.std::allocator"* call void @_ZNSaISt10_List_nodeIPcEEC2Ev(%"class.std::allocator"* %0) #8 %_M_node = getelementptr inbounds %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl", %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"* %this1, i32 0, i32 0 call void @_ZNSt8__detail17_List_node_headerC2Ev(%"struct.std::__detail::_List_node_header"* %_M_node) #8 ret void } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local void @_ZNSaISt10_List_nodeIPcEEC2Ev(%"class.std::allocator"* %this) unnamed_addr #1 comdat align 2 { entry: %this.addr = alloca %"class.std::allocator"*, align 8 store %"class.std::allocator"* %this, %"class.std::allocator"** %this.addr, align 8 %this1 = load %"class.std::allocator"*, %"class.std::allocator"** %this.addr, align 8 %0 = bitcast %"class.std::allocator"* %this1 to %"class.__gnu_cxx::new_allocator"* call void @_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEEC2Ev(%"class.__gnu_cxx::new_allocator"* %0) #8 ret void } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local void @_ZNSt8__detail17_List_node_headerC2Ev(%"struct.std::__detail::_List_node_header"* %this) unnamed_addr #1 comdat align 2 { entry: %this.addr = alloca %"struct.std::__detail::_List_node_header"*, align 8 store %"struct.std::__detail::_List_node_header"* %this, %"struct.std::__detail::_List_node_header"** %this.addr, align 8 %this1 = load %"struct.std::__detail::_List_node_header"*, %"struct.std::__detail::_List_node_header"** %this.addr, align 8 %0 = bitcast %"struct.std::__detail::_List_node_header"* %this1 to %"struct.std::__detail::_List_node_base"* call void @_ZNSt8__detail17_List_node_header7_M_initEv(%"struct.std::__detail::_List_node_header"* %this1) #8 ret void } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local void @_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEEC2Ev(%"class.__gnu_cxx::new_allocator"* %this) unnamed_addr #1 comdat align 2 { entry: %this.addr = alloca %"class.__gnu_cxx::new_allocator"*, align 8 store %"class.__gnu_cxx::new_allocator"* %this, %"class.__gnu_cxx::new_allocator"** %this.addr, align 8 %this1 = load %"class.__gnu_cxx::new_allocator"*, %"class.__gnu_cxx::new_allocator"** %this.addr, align 8 ret void } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local void @_ZNSt8__detail17_List_node_header7_M_initEv(%"struct.std::__detail::_List_node_header"* %this) #1 comdat align 2 { entry: %this.addr = alloca %"struct.std::__detail::_List_node_header"*, align 8 store %"struct.std::__detail::_List_node_header"* %this, %"struct.std::__detail::_List_node_header"** %this.addr, align 8 %this1 = load %"struct.std::__detail::_List_node_header"*, %"struct.std::__detail::_List_node_header"** %this.addr, align 8 %0 = bitcast %"struct.std::__detail::_List_node_header"* %this1 to %"struct.std::__detail::_List_node_base"* %1 = bitcast %"struct.std::__detail::_List_node_header"* %this1 to %"struct.std::__detail::_List_node_base"* %_M_prev = getelementptr inbounds %"struct.std::__detail::_List_node_base", %"struct.std::__detail::_List_node_base"* %1, i32 0, i32 1 store %"struct.std::__detail::_List_node_base"* %0, %"struct.std::__detail::_List_node_base"** %_M_prev, align 8 %2 = bitcast %"struct.std::__detail::_List_node_header"* %this1 to %"struct.std::__detail::_List_node_base"* %_M_next = getelementptr inbounds %"struct.std::__detail::_List_node_base", %"struct.std::__detail::_List_node_base"* %2, i32 0, i32 0 store %"struct.std::__detail::_List_node_base"* %0, %"struct.std::__detail::_List_node_base"** %_M_next, align 8 %_M_size = getelementptr inbounds %"struct.std::__detail::_List_node_header", %"struct.std::__detail::_List_node_header"* %this1, i32 0, i32 1 store i64 0, i64* %_M_size, align 8 ret void } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local void @_ZNSt7__cxx1110_List_baseIPcSaIS1_EED2Ev(%"class.std::__cxx11::_List_base"* %this) unnamed_addr #1 comdat align 2 { entry: %this.addr = alloca %"class.std::__cxx11::_List_base"*, align 8 store %"class.std::__cxx11::_List_base"* %this, %"class.std::__cxx11::_List_base"** %this.addr, align 8 %this1 = load %"class.std::__cxx11::_List_base"*, %"class.std::__cxx11::_List_base"** %this.addr, align 8 call void @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE8_M_clearEv(%"class.std::__cxx11::_List_base"* %this1) #8 %_M_impl = getelementptr inbounds %"class.std::__cxx11::_List_base", %"class.std::__cxx11::_List_base"* %this1, i32 0, i32 0 call void @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE10_List_implD2Ev(%"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"* %_M_impl) #8 ret void } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local void @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE8_M_clearEv(%"class.std::__cxx11::_List_base"* %this) #1 comdat align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { entry: %this.addr = alloca %"class.std::__cxx11::_List_base"*, align 8 %__cur = alloca %"struct.std::__detail::_List_node_base"*, align 8 %__tmp = alloca %"struct.std::_List_node"*, align 8 %__val = alloca i8**, align 8 store %"class.std::__cxx11::_List_base"* %this, %"class.std::__cxx11::_List_base"** %this.addr, align 8 %this1 = load %"class.std::__cxx11::_List_base"*, %"class.std::__cxx11::_List_base"** %this.addr, align 8 %_M_impl = getelementptr inbounds %"class.std::__cxx11::_List_base", %"class.std::__cxx11::_List_base"* %this1, i32 0, i32 0 %_M_node = getelementptr inbounds %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl", %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"* %_M_impl, i32 0, i32 0 %0 = bitcast %"struct.std::__detail::_List_node_header"* %_M_node to %"struct.std::__detail::_List_node_base"* %_M_next = getelementptr inbounds %"struct.std::__detail::_List_node_base", %"struct.std::__detail::_List_node_base"* %0, i32 0, i32 0 %1 = load %"struct.std::__detail::_List_node_base"*, %"struct.std::__detail::_List_node_base"** %_M_next, align 8 store %"struct.std::__detail::_List_node_base"* %1, %"struct.std::__detail::_List_node_base"** %__cur, align 8 br label %while.cond while.cond: ; preds = %invoke.cont, %entry %2 = load %"struct.std::__detail::_List_node_base"*, %"struct.std::__detail::_List_node_base"** %__cur, align 8 %_M_impl2 = getelementptr inbounds %"class.std::__cxx11::_List_base", %"class.std::__cxx11::_List_base"* %this1, i32 0, i32 0 %_M_node3 = getelementptr inbounds %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl", %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"* %_M_impl2, i32 0, i32 0 %3 = bitcast %"struct.std::__detail::_List_node_header"* %_M_node3 to %"struct.std::__detail::_List_node_base"* %cmp = icmp ne %"struct.std::__detail::_List_node_base"* %2, %3 br i1 %cmp, label %while.body, label %while.end while.body: ; preds = %while.cond %4 = load %"struct.std::__detail::_List_node_base"*, %"struct.std::__detail::_List_node_base"** %__cur, align 8 %5 = bitcast %"struct.std::__detail::_List_node_base"* %4 to %"struct.std::_List_node"* store %"struct.std::_List_node"* %5, %"struct.std::_List_node"** %__tmp, align 8 %6 = load %"struct.std::_List_node"*, %"struct.std::_List_node"** %__tmp, align 8 %7 = bitcast %"struct.std::_List_node"* %6 to %"struct.std::__detail::_List_node_base"* %_M_next4 = getelementptr inbounds %"struct.std::__detail::_List_node_base", %"struct.std::__detail::_List_node_base"* %7, i32 0, i32 0 %8 = load %"struct.std::__detail::_List_node_base"*, %"struct.std::__detail::_List_node_base"** %_M_next4, align 8 store %"struct.std::__detail::_List_node_base"* %8, %"struct.std::__detail::_List_node_base"** %__cur, align 8 %9 = load %"struct.std::_List_node"*, %"struct.std::_List_node"** %__tmp, align 8 %call = invoke i8** @_ZNSt10_List_nodeIPcE9_M_valptrEv(%"struct.std::_List_node"* %9) to label %invoke.cont unwind label %terminate.lpad invoke.cont: ; preds = %while.body store i8** %call, i8*** %__val, align 8 %call5 = call nonnull align 1 dereferenceable(1) %"class.std::allocator"* @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE21_M_get_Node_allocatorEv(%"class.std::__cxx11::_List_base"* %this1) #8 %10 = load i8**, i8*** %__val, align 8 call void @_ZNSt16allocator_traitsISaISt10_List_nodeIPcEEE7destroyIS1_EEvRS3_PT_(%"class.std::allocator"* nonnull align 1 dereferenceable(1) %call5, i8** %10) #8 %11 = load %"struct.std::_List_node"*, %"struct.std::_List_node"** %__tmp, align 8 call void @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE11_M_put_nodeEPSt10_List_nodeIS1_E(%"class.std::__cxx11::_List_base"* %this1, %"struct.std::_List_node"* %11) #8 br label %while.cond while.end: ; preds = %while.cond ret void terminate.lpad: ; preds = %while.body %12 = landingpad { i8*, i32 } catch i8* null %13 = extractvalue { i8*, i32 } %12, 0 call void @__clang_call_terminate(i8* %13) #9 unreachable } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local void @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE10_List_implD2Ev(%"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"* %this) unnamed_addr #1 comdat align 2 { entry: %this.addr = alloca %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"*, align 8 store %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"* %this, %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"** %this.addr, align 8 %this1 = load %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"*, %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"** %this.addr, align 8 %0 = bitcast %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"* %this1 to %"class.std::allocator"* call void @_ZNSaISt10_List_nodeIPcEED2Ev(%"class.std::allocator"* %0) #8 ret void } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local i8** @_ZNSt10_List_nodeIPcE9_M_valptrEv(%"struct.std::_List_node"* %this) #1 comdat align 2 { entry: %this.addr = alloca %"struct.std::_List_node"*, align 8 store %"struct.std::_List_node"* %this, %"struct.std::_List_node"** %this.addr, align 8 %this1 = load %"struct.std::_List_node"*, %"struct.std::_List_node"** %this.addr, align 8 %_M_storage = getelementptr inbounds %"struct.std::_List_node", %"struct.std::_List_node"* %this1, i32 0, i32 1 %call = call i8** @_ZN9__gnu_cxx16__aligned_membufIPcE6_M_ptrEv(%"struct.__gnu_cxx::__aligned_membuf"* %_M_storage) #8 ret i8** %call } ; Function Attrs: noinline noreturn nounwind define linkonce_odr hidden void @__clang_call_terminate(i8* %0) #3 comdat { %2 = call i8* @__cxa_begin_catch(i8* %0) #8 call void @_ZSt9terminatev() #9 unreachable } declare dso_local i8* @__cxa_begin_catch(i8*) declare dso_local void @_ZSt9terminatev() ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local void @_ZNSt16allocator_traitsISaISt10_List_nodeIPcEEE7destroyIS1_EEvRS3_PT_(%"class.std::allocator"* nonnull align 1 dereferenceable(1) %__a, i8** %__p) #1 comdat align 2 { entry: %__a.addr = alloca %"class.std::allocator"*, align 8 %__p.addr = alloca i8**, align 8 store %"class.std::allocator"* %__a, %"class.std::allocator"** %__a.addr, align 8 store i8** %__p, i8*** %__p.addr, align 8 %0 = load %"class.std::allocator"*, %"class.std::allocator"** %__a.addr, align 8 %1 = bitcast %"class.std::allocator"* %0 to %"class.__gnu_cxx::new_allocator"* %2 = load i8**, i8*** %__p.addr, align 8 call void @_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEE7destroyIS2_EEvPT_(%"class.__gnu_cxx::new_allocator"* %1, i8** %2) #8 ret void } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local nonnull align 1 dereferenceable(1) %"class.std::allocator"* @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE21_M_get_Node_allocatorEv(%"class.std::__cxx11::_List_base"* %this) #1 comdat align 2 { entry: %this.addr = alloca %"class.std::__cxx11::_List_base"*, align 8 store %"class.std::__cxx11::_List_base"* %this, %"class.std::__cxx11::_List_base"** %this.addr, align 8 %this1 = load %"class.std::__cxx11::_List_base"*, %"class.std::__cxx11::_List_base"** %this.addr, align 8 %_M_impl = getelementptr inbounds %"class.std::__cxx11::_List_base", %"class.std::__cxx11::_List_base"* %this1, i32 0, i32 0 %0 = bitcast %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"* %_M_impl to %"class.std::allocator"* ret %"class.std::allocator"* %0 } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local void @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE11_M_put_nodeEPSt10_List_nodeIS1_E(%"class.std::__cxx11::_List_base"* %this, %"struct.std::_List_node"* %__p) #1 comdat align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { entry: %this.addr = alloca %"class.std::__cxx11::_List_base"*, align 8 %__p.addr = alloca %"struct.std::_List_node"*, align 8 store %"class.std::__cxx11::_List_base"* %this, %"class.std::__cxx11::_List_base"** %this.addr, align 8 store %"struct.std::_List_node"* %__p, %"struct.std::_List_node"** %__p.addr, align 8 %this1 = load %"class.std::__cxx11::_List_base"*, %"class.std::__cxx11::_List_base"** %this.addr, align 8 %_M_impl = getelementptr inbounds %"class.std::__cxx11::_List_base", %"class.std::__cxx11::_List_base"* %this1, i32 0, i32 0 %0 = bitcast %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"* %_M_impl to %"class.std::allocator"* %1 = load %"struct.std::_List_node"*, %"struct.std::_List_node"** %__p.addr, align 8 invoke void @_ZNSt16allocator_traitsISaISt10_List_nodeIPcEEE10deallocateERS3_PS2_m(%"class.std::allocator"* nonnull align 1 dereferenceable(1) %0, %"struct.std::_List_node"* %1, i64 1) to label %invoke.cont unwind label %terminate.lpad invoke.cont: ; preds = %entry ret void terminate.lpad: ; preds = %entry %2 = landingpad { i8*, i32 } catch i8* null %3 = extractvalue { i8*, i32 } %2, 0 call void @__clang_call_terminate(i8* %3) #9 unreachable } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local i8** @_ZN9__gnu_cxx16__aligned_membufIPcE6_M_ptrEv(%"struct.__gnu_cxx::__aligned_membuf"* %this) #1 comdat align 2 { entry: %this.addr = alloca %"struct.__gnu_cxx::__aligned_membuf"*, align 8 store %"struct.__gnu_cxx::__aligned_membuf"* %this, %"struct.__gnu_cxx::__aligned_membuf"** %this.addr, align 8 %this1 = load %"struct.__gnu_cxx::__aligned_membuf"*, %"struct.__gnu_cxx::__aligned_membuf"** %this.addr, align 8 %call = call i8* @_ZN9__gnu_cxx16__aligned_membufIPcE7_M_addrEv(%"struct.__gnu_cxx::__aligned_membuf"* %this1) #8 %0 = bitcast i8* %call to i8** ret i8** %0 } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local i8* @_ZN9__gnu_cxx16__aligned_membufIPcE7_M_addrEv(%"struct.__gnu_cxx::__aligned_membuf"* %this) #1 comdat align 2 { entry: %this.addr = alloca %"struct.__gnu_cxx::__aligned_membuf"*, align 8 store %"struct.__gnu_cxx::__aligned_membuf"* %this, %"struct.__gnu_cxx::__aligned_membuf"** %this.addr, align 8 %this1 = load %"struct.__gnu_cxx::__aligned_membuf"*, %"struct.__gnu_cxx::__aligned_membuf"** %this.addr, align 8 %_M_storage = getelementptr inbounds %"struct.__gnu_cxx::__aligned_membuf", %"struct.__gnu_cxx::__aligned_membuf"* %this1, i32 0, i32 0 %0 = bitcast [8 x i8]* %_M_storage to i8* ret i8* %0 } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local void @_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEE7destroyIS2_EEvPT_(%"class.__gnu_cxx::new_allocator"* %this, i8** %__p) #1 comdat align 2 { entry: %this.addr = alloca %"class.__gnu_cxx::new_allocator"*, align 8 %__p.addr = alloca i8**, align 8 store %"class.__gnu_cxx::new_allocator"* %this, %"class.__gnu_cxx::new_allocator"** %this.addr, align 8 store i8** %__p, i8*** %__p.addr, align 8 %this1 = load %"class.__gnu_cxx::new_allocator"*, %"class.__gnu_cxx::new_allocator"** %this.addr, align 8 ret void } ; Function Attrs: noinline optnone uwtable define linkonce_odr dso_local void @_ZNSt16allocator_traitsISaISt10_List_nodeIPcEEE10deallocateERS3_PS2_m(%"class.std::allocator"* nonnull align 1 dereferenceable(1) %__a, %"struct.std::_List_node"* %__p, i64 %__n) #0 comdat align 2 { entry: %__a.addr = alloca %"class.std::allocator"*, align 8 %__p.addr = alloca %"struct.std::_List_node"*, align 8 %__n.addr = alloca i64, align 8 store %"class.std::allocator"* %__a, %"class.std::allocator"** %__a.addr, align 8 store %"struct.std::_List_node"* %__p, %"struct.std::_List_node"** %__p.addr, align 8 store i64 %__n, i64* %__n.addr, align 8 %0 = load %"class.std::allocator"*, %"class.std::allocator"** %__a.addr, align 8 %1 = bitcast %"class.std::allocator"* %0 to %"class.__gnu_cxx::new_allocator"* %2 = load %"struct.std::_List_node"*, %"struct.std::_List_node"** %__p.addr, align 8 %3 = load i64, i64* %__n.addr, align 8 call void @_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEE10deallocateEPS3_m(%"class.__gnu_cxx::new_allocator"* %1, %"struct.std::_List_node"* %2, i64 %3) ret void } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local void @_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEE10deallocateEPS3_m(%"class.__gnu_cxx::new_allocator"* %this, %"struct.std::_List_node"* %__p, i64 %__t) #1 comdat align 2 { entry: %this.addr = alloca %"class.__gnu_cxx::new_allocator"*, align 8 %__p.addr = alloca %"struct.std::_List_node"*, align 8 %__t.addr = alloca i64, align 8 store %"class.__gnu_cxx::new_allocator"* %this, %"class.__gnu_cxx::new_allocator"** %this.addr, align 8 store %"struct.std::_List_node"* %__p, %"struct.std::_List_node"** %__p.addr, align 8 store i64 %__t, i64* %__t.addr, align 8 %this1 = load %"class.__gnu_cxx::new_allocator"*, %"class.__gnu_cxx::new_allocator"** %this.addr, align 8 %0 = load %"struct.std::_List_node"*, %"struct.std::_List_node"** %__p.addr, align 8 %1 = bitcast %"struct.std::_List_node"* %0 to i8* call void @_ZdlPv(i8* %1) #8 ret void } ; Function Attrs: nobuiltin nounwind declare dso_local void @_ZdlPv(i8*) #4 ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local void @_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEED2Ev(%"class.__gnu_cxx::new_allocator"* %this) unnamed_addr #1 comdat align 2 { entry: %this.addr = alloca %"class.__gnu_cxx::new_allocator"*, align 8 store %"class.__gnu_cxx::new_allocator"* %this, %"class.__gnu_cxx::new_allocator"** %this.addr, align 8 %this1 = load %"class.__gnu_cxx::new_allocator"*, %"class.__gnu_cxx::new_allocator"** %this.addr, align 8 ret void } declare dso_local void @_ZN65CWE121_Stack_Based_Buffer_Overflow__CWE805_char_declare_memcpy_7311goodG2BSinkENSt7__cxx114listIPcSaIS2_EEE(%"class.std::__cxx11::list"*) #2 ; Function Attrs: noinline optnone uwtable define linkonce_odr dso_local void @_ZNSt7__cxx114listIPcSaIS1_EE9_M_insertIJRKS1_EEEvSt14_List_iteratorIS1_EDpOT_(%"class.std::__cxx11::list"* %this, %"struct.std::__detail::_List_node_base"* %__position.coerce, i8** nonnull align 8 dereferenceable(8) %__args) #0 comdat align 2 { entry: %__position = alloca %"struct.std::_List_iterator", align 8 %this.addr = alloca %"class.std::__cxx11::list"*, align 8 %__args.addr = alloca i8**, align 8 %__tmp = alloca %"struct.std::_List_node"*, align 8 %coerce.dive = getelementptr inbounds %"struct.std::_List_iterator", %"struct.std::_List_iterator"* %__position, i32 0, i32 0 store %"struct.std::__detail::_List_node_base"* %__position.coerce, %"struct.std::__detail::_List_node_base"** %coerce.dive, align 8 store %"class.std::__cxx11::list"* %this, %"class.std::__cxx11::list"** %this.addr, align 8 store i8** %__args, i8*** %__args.addr, align 8 %this1 = load %"class.std::__cxx11::list"*, %"class.std::__cxx11::list"** %this.addr, align 8 %0 = load i8**, i8*** %__args.addr, align 8 %call = call nonnull align 8 dereferenceable(8) i8** @_ZSt7forwardIRKPcEOT_RNSt16remove_referenceIS3_E4typeE(i8** nonnull align 8 dereferenceable(8) %0) #8 %call2 = call %"struct.std::_List_node"* @_ZNSt7__cxx114listIPcSaIS1_EE14_M_create_nodeIJRKS1_EEEPSt10_List_nodeIS1_EDpOT_(%"class.std::__cxx11::list"* %this1, i8** nonnull align 8 dereferenceable(8) %call) store %"struct.std::_List_node"* %call2, %"struct.std::_List_node"** %__tmp, align 8 %1 = load %"struct.std::_List_node"*, %"struct.std::_List_node"** %__tmp, align 8 %2 = bitcast %"struct.std::_List_node"* %1 to %"struct.std::__detail::_List_node_base"* %_M_node = getelementptr inbounds %"struct.std::_List_iterator", %"struct.std::_List_iterator"* %__position, i32 0, i32 0 %3 = load %"struct.std::__detail::_List_node_base"*, %"struct.std::__detail::_List_node_base"** %_M_node, align 8 call void @_ZNSt8__detail15_List_node_base7_M_hookEPS0_(%"struct.std::__detail::_List_node_base"* %2, %"struct.std::__detail::_List_node_base"* %3) #8 %4 = bitcast %"class.std::__cxx11::list"* %this1 to %"class.std::__cxx11::_List_base"* call void @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE11_M_inc_sizeEm(%"class.std::__cxx11::_List_base"* %4, i64 1) ret void } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local %"struct.std::__detail::_List_node_base"* @_ZNSt7__cxx114listIPcSaIS1_EE3endEv(%"class.std::__cxx11::list"* %this) #1 comdat align 2 { entry: %retval = alloca %"struct.std::_List_iterator", align 8 %this.addr = alloca %"class.std::__cxx11::list"*, align 8 store %"class.std::__cxx11::list"* %this, %"class.std::__cxx11::list"** %this.addr, align 8 %this1 = load %"class.std::__cxx11::list"*, %"class.std::__cxx11::list"** %this.addr, align 8 %0 = bitcast %"class.std::__cxx11::list"* %this1 to %"class.std::__cxx11::_List_base"* %_M_impl = getelementptr inbounds %"class.std::__cxx11::_List_base", %"class.std::__cxx11::_List_base"* %0, i32 0, i32 0 %_M_node = getelementptr inbounds %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl", %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"* %_M_impl, i32 0, i32 0 %1 = bitcast %"struct.std::__detail::_List_node_header"* %_M_node to %"struct.std::__detail::_List_node_base"* call void @_ZNSt14_List_iteratorIPcEC2EPNSt8__detail15_List_node_baseE(%"struct.std::_List_iterator"* %retval, %"struct.std::__detail::_List_node_base"* %1) #8 %coerce.dive = getelementptr inbounds %"struct.std::_List_iterator", %"struct.std::_List_iterator"* %retval, i32 0, i32 0 %2 = load %"struct.std::__detail::_List_node_base"*, %"struct.std::__detail::_List_node_base"** %coerce.dive, align 8 ret %"struct.std::__detail::_List_node_base"* %2 } ; Function Attrs: noinline optnone uwtable define linkonce_odr dso_local %"struct.std::_List_node"* @_ZNSt7__cxx114listIPcSaIS1_EE14_M_create_nodeIJRKS1_EEEPSt10_List_nodeIS1_EDpOT_(%"class.std::__cxx11::list"* %this, i8** nonnull align 8 dereferenceable(8) %__args) #0 comdat align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { entry: %this.addr = alloca %"class.std::__cxx11::list"*, align 8 %__args.addr = alloca i8**, align 8 %__p = alloca %"struct.std::_List_node"*, align 8 %__alloc = alloca %"class.std::allocator"*, align 8 %__guard = alloca %"struct.std::__allocated_ptr", align 8 %exn.slot = alloca i8*, align 8 %ehselector.slot = alloca i32, align 4 store %"class.std::__cxx11::list"* %this, %"class.std::__cxx11::list"** %this.addr, align 8 store i8** %__args, i8*** %__args.addr, align 8 %this1 = load %"class.std::__cxx11::list"*, %"class.std::__cxx11::list"** %this.addr, align 8 %0 = bitcast %"class.std::__cxx11::list"* %this1 to %"class.std::__cxx11::_List_base"* %call = call %"struct.std::_List_node"* @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE11_M_get_nodeEv(%"class.std::__cxx11::_List_base"* %0) store %"struct.std::_List_node"* %call, %"struct.std::_List_node"** %__p, align 8 %1 = bitcast %"class.std::__cxx11::list"* %this1 to %"class.std::__cxx11::_List_base"* %call2 = call nonnull align 1 dereferenceable(1) %"class.std::allocator"* @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE21_M_get_Node_allocatorEv(%"class.std::__cxx11::_List_base"* %1) #8 store %"class.std::allocator"* %call2, %"class.std::allocator"** %__alloc, align 8 %2 = load %"class.std::allocator"*, %"class.std::allocator"** %__alloc, align 8 %3 = load %"struct.std::_List_node"*, %"struct.std::_List_node"** %__p, align 8 call void @_ZNSt15__allocated_ptrISaISt10_List_nodeIPcEEEC2ERS3_PS2_(%"struct.std::__allocated_ptr"* %__guard, %"class.std::allocator"* nonnull align 1 dereferenceable(1) %2, %"struct.std::_List_node"* %3) #8 %4 = load %"class.std::allocator"*, %"class.std::allocator"** %__alloc, align 8 %5 = load %"struct.std::_List_node"*, %"struct.std::_List_node"** %__p, align 8 %call3 = invoke i8** @_ZNSt10_List_nodeIPcE9_M_valptrEv(%"struct.std::_List_node"* %5) to label %invoke.cont unwind label %lpad invoke.cont: ; preds = %entry %6 = load i8**, i8*** %__args.addr, align 8 %call4 = call nonnull align 8 dereferenceable(8) i8** @_ZSt7forwardIRKPcEOT_RNSt16remove_referenceIS3_E4typeE(i8** nonnull align 8 dereferenceable(8) %6) #8 call void @_ZNSt16allocator_traitsISaISt10_List_nodeIPcEEE9constructIS1_JRKS1_EEEvRS3_PT_DpOT0_(%"class.std::allocator"* nonnull align 1 dereferenceable(1) %4, i8** %call3, i8** nonnull align 8 dereferenceable(8) %call4) #8 %call5 = call nonnull align 8 dereferenceable(16) %"struct.std::__allocated_ptr"* @_ZNSt15__allocated_ptrISaISt10_List_nodeIPcEEEaSEDn(%"struct.std::__allocated_ptr"* %__guard, i8* null) #8 %7 = load %"struct.std::_List_node"*, %"struct.std::_List_node"** %__p, align 8 call void @_ZNSt15__allocated_ptrISaISt10_List_nodeIPcEEED2Ev(%"struct.std::__allocated_ptr"* %__guard) #8 ret %"struct.std::_List_node"* %7 lpad: ; preds = %entry %8 = landingpad { i8*, i32 } cleanup %9 = extractvalue { i8*, i32 } %8, 0 store i8* %9, i8** %exn.slot, align 8 %10 = extractvalue { i8*, i32 } %8, 1 store i32 %10, i32* %ehselector.slot, align 4 call void @_ZNSt15__allocated_ptrISaISt10_List_nodeIPcEEED2Ev(%"struct.std::__allocated_ptr"* %__guard) #8 br label %eh.resume eh.resume: ; preds = %lpad %exn = load i8*, i8** %exn.slot, align 8 %sel = load i32, i32* %ehselector.slot, align 4 %lpad.val = insertvalue { i8*, i32 } undef, i8* %exn, 0 %lpad.val6 = insertvalue { i8*, i32 } %lpad.val, i32 %sel, 1 resume { i8*, i32 } %lpad.val6 } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local nonnull align 8 dereferenceable(8) i8** @_ZSt7forwardIRKPcEOT_RNSt16remove_referenceIS3_E4typeE(i8** nonnull align 8 dereferenceable(8) %__t) #1 comdat { entry: %__t.addr = alloca i8**, align 8 store i8** %__t, i8*** %__t.addr, align 8 %0 = load i8**, i8*** %__t.addr, align 8 ret i8** %0 } ; Function Attrs: nounwind declare dso_local void @_ZNSt8__detail15_List_node_base7_M_hookEPS0_(%"struct.std::__detail::_List_node_base"*, %"struct.std::__detail::_List_node_base"*) #5 ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local void @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE11_M_inc_sizeEm(%"class.std::__cxx11::_List_base"* %this, i64 %__n) #1 comdat align 2 { entry: %this.addr = alloca %"class.std::__cxx11::_List_base"*, align 8 %__n.addr = alloca i64, align 8 store %"class.std::__cxx11::_List_base"* %this, %"class.std::__cxx11::_List_base"** %this.addr, align 8 store i64 %__n, i64* %__n.addr, align 8 %this1 = load %"class.std::__cxx11::_List_base"*, %"class.std::__cxx11::_List_base"** %this.addr, align 8 %0 = load i64, i64* %__n.addr, align 8 %_M_impl = getelementptr inbounds %"class.std::__cxx11::_List_base", %"class.std::__cxx11::_List_base"* %this1, i32 0, i32 0 %_M_node = getelementptr inbounds %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl", %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"* %_M_impl, i32 0, i32 0 %_M_size = getelementptr inbounds %"struct.std::__detail::_List_node_header", %"struct.std::__detail::_List_node_header"* %_M_node, i32 0, i32 1 %1 = load i64, i64* %_M_size, align 8 %add = add i64 %1, %0 store i64 %add, i64* %_M_size, align 8 ret void } ; Function Attrs: noinline optnone uwtable define linkonce_odr dso_local %"struct.std::_List_node"* @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE11_M_get_nodeEv(%"class.std::__cxx11::_List_base"* %this) #0 comdat align 2 { entry: %this.addr = alloca %"class.std::__cxx11::_List_base"*, align 8 store %"class.std::__cxx11::_List_base"* %this, %"class.std::__cxx11::_List_base"** %this.addr, align 8 %this1 = load %"class.std::__cxx11::_List_base"*, %"class.std::__cxx11::_List_base"** %this.addr, align 8 %_M_impl = getelementptr inbounds %"class.std::__cxx11::_List_base", %"class.std::__cxx11::_List_base"* %this1, i32 0, i32 0 %0 = bitcast %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"* %_M_impl to %"class.std::allocator"* %call = call %"struct.std::_List_node"* @_ZNSt16allocator_traitsISaISt10_List_nodeIPcEEE8allocateERS3_m(%"class.std::allocator"* nonnull align 1 dereferenceable(1) %0, i64 1) ret %"struct.std::_List_node"* %call } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local void @_ZNSt15__allocated_ptrISaISt10_List_nodeIPcEEEC2ERS3_PS2_(%"struct.std::__allocated_ptr"* %this, %"class.std::allocator"* nonnull align 1 dereferenceable(1) %__a, %"struct.std::_List_node"* %__ptr) unnamed_addr #1 comdat align 2 { entry: %this.addr = alloca %"struct.std::__allocated_ptr"*, align 8 %__a.addr = alloca %"class.std::allocator"*, align 8 %__ptr.addr = alloca %"struct.std::_List_node"*, align 8 store %"struct.std::__allocated_ptr"* %this, %"struct.std::__allocated_ptr"** %this.addr, align 8 store %"class.std::allocator"* %__a, %"class.std::allocator"** %__a.addr, align 8 store %"struct.std::_List_node"* %__ptr, %"struct.std::_List_node"** %__ptr.addr, align 8 %this1 = load %"struct.std::__allocated_ptr"*, %"struct.std::__allocated_ptr"** %this.addr, align 8 %_M_alloc = getelementptr inbounds %"struct.std::__allocated_ptr", %"struct.std::__allocated_ptr"* %this1, i32 0, i32 0 %0 = load %"class.std::allocator"*, %"class.std::allocator"** %__a.addr, align 8 %call = call %"class.std::allocator"* @_ZSt11__addressofISaISt10_List_nodeIPcEEEPT_RS4_(%"class.std::allocator"* nonnull align 1 dereferenceable(1) %0) #8 store %"class.std::allocator"* %call, %"class.std::allocator"** %_M_alloc, align 8 %_M_ptr = getelementptr inbounds %"struct.std::__allocated_ptr", %"struct.std::__allocated_ptr"* %this1, i32 0, i32 1 %1 = load %"struct.std::_List_node"*, %"struct.std::_List_node"** %__ptr.addr, align 8 store %"struct.std::_List_node"* %1, %"struct.std::_List_node"** %_M_ptr, align 8 ret void } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local void @_ZNSt16allocator_traitsISaISt10_List_nodeIPcEEE9constructIS1_JRKS1_EEEvRS3_PT_DpOT0_(%"class.std::allocator"* nonnull align 1 dereferenceable(1) %__a, i8** %__p, i8** nonnull align 8 dereferenceable(8) %__args) #1 comdat align 2 { entry: %__a.addr = alloca %"class.std::allocator"*, align 8 %__p.addr = alloca i8**, align 8 %__args.addr = alloca i8**, align 8 store %"class.std::allocator"* %__a, %"class.std::allocator"** %__a.addr, align 8 store i8** %__p, i8*** %__p.addr, align 8 store i8** %__args, i8*** %__args.addr, align 8 %0 = load %"class.std::allocator"*, %"class.std::allocator"** %__a.addr, align 8 %1 = bitcast %"class.std::allocator"* %0 to %"class.__gnu_cxx::new_allocator"* %2 = load i8**, i8*** %__p.addr, align 8 %3 = load i8**, i8*** %__args.addr, align 8 %call = call nonnull align 8 dereferenceable(8) i8** @_ZSt7forwardIRKPcEOT_RNSt16remove_referenceIS3_E4typeE(i8** nonnull align 8 dereferenceable(8) %3) #8 call void @_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEE9constructIS2_JRKS2_EEEvPT_DpOT0_(%"class.__gnu_cxx::new_allocator"* %1, i8** %2, i8** nonnull align 8 dereferenceable(8) %call) #8 ret void } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local nonnull align 8 dereferenceable(16) %"struct.std::__allocated_ptr"* @_ZNSt15__allocated_ptrISaISt10_List_nodeIPcEEEaSEDn(%"struct.std::__allocated_ptr"* %this, i8* %0) #1 comdat align 2 { entry: %this.addr = alloca %"struct.std::__allocated_ptr"*, align 8 %.addr = alloca i8*, align 8 store %"struct.std::__allocated_ptr"* %this, %"struct.std::__allocated_ptr"** %this.addr, align 8 store i8* %0, i8** %.addr, align 8 %this1 = load %"struct.std::__allocated_ptr"*, %"struct.std::__allocated_ptr"** %this.addr, align 8 %_M_ptr = getelementptr inbounds %"struct.std::__allocated_ptr", %"struct.std::__allocated_ptr"* %this1, i32 0, i32 1 store %"struct.std::_List_node"* null, %"struct.std::_List_node"** %_M_ptr, align 8 ret %"struct.std::__allocated_ptr"* %this1 } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local void @_ZNSt15__allocated_ptrISaISt10_List_nodeIPcEEED2Ev(%"struct.std::__allocated_ptr"* %this) unnamed_addr #1 comdat align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { entry: %this.addr = alloca %"struct.std::__allocated_ptr"*, align 8 store %"struct.std::__allocated_ptr"* %this, %"struct.std::__allocated_ptr"** %this.addr, align 8 %this1 = load %"struct.std::__allocated_ptr"*, %"struct.std::__allocated_ptr"** %this.addr, align 8 %_M_ptr = getelementptr inbounds %"struct.std::__allocated_ptr", %"struct.std::__allocated_ptr"* %this1, i32 0, i32 1 %0 = load %"struct.std::_List_node"*, %"struct.std::_List_node"** %_M_ptr, align 8 %cmp = icmp ne %"struct.std::_List_node"* %0, null br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %_M_alloc = getelementptr inbounds %"struct.std::__allocated_ptr", %"struct.std::__allocated_ptr"* %this1, i32 0, i32 0 %1 = load %"class.std::allocator"*, %"class.std::allocator"** %_M_alloc, align 8 %_M_ptr2 = getelementptr inbounds %"struct.std::__allocated_ptr", %"struct.std::__allocated_ptr"* %this1, i32 0, i32 1 %2 = load %"struct.std::_List_node"*, %"struct.std::_List_node"** %_M_ptr2, align 8 invoke void @_ZNSt16allocator_traitsISaISt10_List_nodeIPcEEE10deallocateERS3_PS2_m(%"class.std::allocator"* nonnull align 1 dereferenceable(1) %1, %"struct.std::_List_node"* %2, i64 1) to label %invoke.cont unwind label %terminate.lpad invoke.cont: ; preds = %if.then br label %if.end if.end: ; preds = %invoke.cont, %entry ret void terminate.lpad: ; preds = %if.then %3 = landingpad { i8*, i32 } catch i8* null %4 = extractvalue { i8*, i32 } %3, 0 call void @__clang_call_terminate(i8* %4) #9 unreachable } ; Function Attrs: noinline optnone uwtable define linkonce_odr dso_local %"struct.std::_List_node"* @_ZNSt16allocator_traitsISaISt10_List_nodeIPcEEE8allocateERS3_m(%"class.std::allocator"* nonnull align 1 dereferenceable(1) %__a, i64 %__n) #0 comdat align 2 { entry: %__a.addr = alloca %"class.std::allocator"*, align 8 %__n.addr = alloca i64, align 8 store %"class.std::allocator"* %__a, %"class.std::allocator"** %__a.addr, align 8 store i64 %__n, i64* %__n.addr, align 8 %0 = load %"class.std::allocator"*, %"class.std::allocator"** %__a.addr, align 8 %1 = bitcast %"class.std::allocator"* %0 to %"class.__gnu_cxx::new_allocator"* %2 = load i64, i64* %__n.addr, align 8 %call = call %"struct.std::_List_node"* @_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEE8allocateEmPKv(%"class.__gnu_cxx::new_allocator"* %1, i64 %2, i8* null) ret %"struct.std::_List_node"* %call } ; Function Attrs: noinline optnone uwtable define linkonce_odr dso_local %"struct.std::_List_node"* @_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEE8allocateEmPKv(%"class.__gnu_cxx::new_allocator"* %this, i64 %__n, i8* %0) #0 comdat align 2 { entry: %this.addr = alloca %"class.__gnu_cxx::new_allocator"*, align 8 %__n.addr = alloca i64, align 8 %.addr = alloca i8*, align 8 store %"class.__gnu_cxx::new_allocator"* %this, %"class.__gnu_cxx::new_allocator"** %this.addr, align 8 store i64 %__n, i64* %__n.addr, align 8 store i8* %0, i8** %.addr, align 8 %this1 = load %"class.__gnu_cxx::new_allocator"*, %"class.__gnu_cxx::new_allocator"** %this.addr, align 8 %1 = load i64, i64* %__n.addr, align 8 %call = call i64 @_ZNK9__gnu_cxx13new_allocatorISt10_List_nodeIPcEE11_M_max_sizeEv(%"class.__gnu_cxx::new_allocator"* %this1) #8 %cmp = icmp ugt i64 %1, %call br i1 %cmp, label %if.then, label %if.end4 if.then: ; preds = %entry %2 = load i64, i64* %__n.addr, align 8 %cmp2 = icmp ugt i64 %2, 768614336404564650 br i1 %cmp2, label %if.then3, label %if.end if.then3: ; preds = %if.then call void @_ZSt28__throw_bad_array_new_lengthv() #10 unreachable if.end: ; preds = %if.then call void @_ZSt17__throw_bad_allocv() #10 unreachable if.end4: ; preds = %entry %3 = load i64, i64* %__n.addr, align 8 %mul = mul i64 %3, 24 %call5 = call noalias nonnull i8* @_Znwm(i64 %mul) #11 %4 = bitcast i8* %call5 to %"struct.std::_List_node"* ret %"struct.std::_List_node"* %4 } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local i64 @_ZNK9__gnu_cxx13new_allocatorISt10_List_nodeIPcEE11_M_max_sizeEv(%"class.__gnu_cxx::new_allocator"* %this) #1 comdat align 2 { entry: %this.addr = alloca %"class.__gnu_cxx::new_allocator"*, align 8 store %"class.__gnu_cxx::new_allocator"* %this, %"class.__gnu_cxx::new_allocator"** %this.addr, align 8 %this1 = load %"class.__gnu_cxx::new_allocator"*, %"class.__gnu_cxx::new_allocator"** %this.addr, align 8 ret i64 384307168202282325 } ; Function Attrs: noreturn declare dso_local void @_ZSt28__throw_bad_array_new_lengthv() #6 ; Function Attrs: noreturn declare dso_local void @_ZSt17__throw_bad_allocv() #6 ; Function Attrs: nobuiltin allocsize(0) declare dso_local nonnull i8* @_Znwm(i64) #7 ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local %"class.std::allocator"* @_ZSt11__addressofISaISt10_List_nodeIPcEEEPT_RS4_(%"class.std::allocator"* nonnull align 1 dereferenceable(1) %__r) #1 comdat { entry: %__r.addr = alloca %"class.std::allocator"*, align 8 store %"class.std::allocator"* %__r, %"class.std::allocator"** %__r.addr, align 8 %0 = load %"class.std::allocator"*, %"class.std::allocator"** %__r.addr, align 8 ret %"class.std::allocator"* %0 } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local void @_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEE9constructIS2_JRKS2_EEEvPT_DpOT0_(%"class.__gnu_cxx::new_allocator"* %this, i8** %__p, i8** nonnull align 8 dereferenceable(8) %__args) #1 comdat align 2 { entry: %this.addr = alloca %"class.__gnu_cxx::new_allocator"*, align 8 %__p.addr = alloca i8**, align 8 %__args.addr = alloca i8**, align 8 store %"class.__gnu_cxx::new_allocator"* %this, %"class.__gnu_cxx::new_allocator"** %this.addr, align 8 store i8** %__p, i8*** %__p.addr, align 8 store i8** %__args, i8*** %__args.addr, align 8 %this1 = load %"class.__gnu_cxx::new_allocator"*, %"class.__gnu_cxx::new_allocator"** %this.addr, align 8 %0 = load i8**, i8*** %__p.addr, align 8 %1 = bitcast i8** %0 to i8* %2 = bitcast i8* %1 to i8** %3 = load i8**, i8*** %__args.addr, align 8 %call = call nonnull align 8 dereferenceable(8) i8** @_ZSt7forwardIRKPcEOT_RNSt16remove_referenceIS3_E4typeE(i8** nonnull align 8 dereferenceable(8) %3) #8 %4 = load i8*, i8** %call, align 8 store i8* %4, i8** %2, align 8 ret void } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local void @_ZNSt14_List_iteratorIPcEC2EPNSt8__detail15_List_node_baseE(%"struct.std::_List_iterator"* %this, %"struct.std::__detail::_List_node_base"* %__x) unnamed_addr #1 comdat align 2 { entry: %this.addr = alloca %"struct.std::_List_iterator"*, align 8 %__x.addr = alloca %"struct.std::__detail::_List_node_base"*, align 8 store %"struct.std::_List_iterator"* %this, %"struct.std::_List_iterator"** %this.addr, align 8 store %"struct.std::__detail::_List_node_base"* %__x, %"struct.std::__detail::_List_node_base"** %__x.addr, align 8 %this1 = load %"struct.std::_List_iterator"*, %"struct.std::_List_iterator"** %this.addr, align 8 %_M_node = getelementptr inbounds %"struct.std::_List_iterator", %"struct.std::_List_iterator"* %this1, i32 0, i32 0 %0 = load %"struct.std::__detail::_List_node_base"*, %"struct.std::__detail::_List_node_base"** %__x.addr, align 8 store %"struct.std::__detail::_List_node_base"* %0, %"struct.std::__detail::_List_node_base"** %_M_node, align 8 ret void } ; Function Attrs: noinline optnone uwtable define linkonce_odr dso_local void @_ZN9__gnu_cxx14__alloc_traitsISaISt10_List_nodeIPcEES3_E17_S_select_on_copyERKS4_(%"class.std::allocator"* noalias sret align 1 %agg.result, %"class.std::allocator"* nonnull align 1 dereferenceable(1) %__a) #0 comdat align 2 { entry: %result.ptr = alloca i8*, align 8 %__a.addr = alloca %"class.std::allocator"*, align 8 %0 = bitcast %"class.std::allocator"* %agg.result to i8* store i8* %0, i8** %result.ptr, align 8 store %"class.std::allocator"* %__a, %"class.std::allocator"** %__a.addr, align 8 %1 = load %"class.std::allocator"*, %"class.std::allocator"** %__a.addr, align 8 call void @_ZNSt16allocator_traitsISaISt10_List_nodeIPcEEE37select_on_container_copy_constructionERKS3_(%"class.std::allocator"* sret align 1 %agg.result, %"class.std::allocator"* nonnull align 1 dereferenceable(1) %1) ret void } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local nonnull align 1 dereferenceable(1) %"class.std::allocator"* @_ZNKSt7__cxx1110_List_baseIPcSaIS1_EE21_M_get_Node_allocatorEv(%"class.std::__cxx11::_List_base"* %this) #1 comdat align 2 { entry: %this.addr = alloca %"class.std::__cxx11::_List_base"*, align 8 store %"class.std::__cxx11::_List_base"* %this, %"class.std::__cxx11::_List_base"** %this.addr, align 8 %this1 = load %"class.std::__cxx11::_List_base"*, %"class.std::__cxx11::_List_base"** %this.addr, align 8 %_M_impl = getelementptr inbounds %"class.std::__cxx11::_List_base", %"class.std::__cxx11::_List_base"* %this1, i32 0, i32 0 %0 = bitcast %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"* %_M_impl to %"class.std::allocator"* ret %"class.std::allocator"* %0 } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local void @_ZNSt7__cxx1110_List_baseIPcSaIS1_EEC2EOSaISt10_List_nodeIS1_EE(%"class.std::__cxx11::_List_base"* %this, %"class.std::allocator"* nonnull align 1 dereferenceable(1) %__a) unnamed_addr #1 comdat align 2 { entry: %this.addr = alloca %"class.std::__cxx11::_List_base"*, align 8 %__a.addr = alloca %"class.std::allocator"*, align 8 store %"class.std::__cxx11::_List_base"* %this, %"class.std::__cxx11::_List_base"** %this.addr, align 8 store %"class.std::allocator"* %__a, %"class.std::allocator"** %__a.addr, align 8 %this1 = load %"class.std::__cxx11::_List_base"*, %"class.std::__cxx11::_List_base"** %this.addr, align 8 %_M_impl = getelementptr inbounds %"class.std::__cxx11::_List_base", %"class.std::__cxx11::_List_base"* %this1, i32 0, i32 0 %0 = load %"class.std::allocator"*, %"class.std::allocator"** %__a.addr, align 8 %call = call nonnull align 1 dereferenceable(1) %"class.std::allocator"* @_ZSt4moveIRSaISt10_List_nodeIPcEEEONSt16remove_referenceIT_E4typeEOS6_(%"class.std::allocator"* nonnull align 1 dereferenceable(1) %0) #8 call void @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE10_List_implC2EOSaISt10_List_nodeIS1_EE(%"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"* %_M_impl, %"class.std::allocator"* nonnull align 1 dereferenceable(1) %call) #8 ret void } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local void @_ZNSaISt10_List_nodeIPcEED2Ev(%"class.std::allocator"* %this) unnamed_addr #1 comdat align 2 { entry: %this.addr = alloca %"class.std::allocator"*, align 8 store %"class.std::allocator"* %this, %"class.std::allocator"** %this.addr, align 8 %this1 = load %"class.std::allocator"*, %"class.std::allocator"** %this.addr, align 8 %0 = bitcast %"class.std::allocator"* %this1 to %"class.__gnu_cxx::new_allocator"* call void @_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEED2Ev(%"class.__gnu_cxx::new_allocator"* %0) #8 ret void } ; Function Attrs: noinline optnone uwtable define linkonce_odr dso_local void @_ZNSt7__cxx114listIPcSaIS1_EE22_M_initialize_dispatchISt20_List_const_iteratorIS1_EEEvT_S7_St12__false_type(%"class.std::__cxx11::list"* %this, %"struct.std::__detail::_List_node_base"* %__first.coerce, %"struct.std::__detail::_List_node_base"* %__last.coerce) #0 comdat align 2 { entry: %__first = alloca %"struct.std::_List_const_iterator", align 8 %__last = alloca %"struct.std::_List_const_iterator", align 8 %0 = alloca %"struct.std::__false_type", align 1 %this.addr = alloca %"class.std::__cxx11::list"*, align 8 %coerce.dive = getelementptr inbounds %"struct.std::_List_const_iterator", %"struct.std::_List_const_iterator"* %__first, i32 0, i32 0 store %"struct.std::__detail::_List_node_base"* %__first.coerce, %"struct.std::__detail::_List_node_base"** %coerce.dive, align 8 %coerce.dive1 = getelementptr inbounds %"struct.std::_List_const_iterator", %"struct.std::_List_const_iterator"* %__last, i32 0, i32 0 store %"struct.std::__detail::_List_node_base"* %__last.coerce, %"struct.std::__detail::_List_node_base"** %coerce.dive1, align 8 store %"class.std::__cxx11::list"* %this, %"class.std::__cxx11::list"** %this.addr, align 8 %this2 = load %"class.std::__cxx11::list"*, %"class.std::__cxx11::list"** %this.addr, align 8 br label %for.cond for.cond: ; preds = %for.inc, %entry %call = call zeroext i1 @_ZStneRKSt20_List_const_iteratorIPcES3_(%"struct.std::_List_const_iterator"* nonnull align 8 dereferenceable(8) %__first, %"struct.std::_List_const_iterator"* nonnull align 8 dereferenceable(8) %__last) #8 br i1 %call, label %for.body, label %for.end for.body: ; preds = %for.cond %call3 = call nonnull align 8 dereferenceable(8) i8** @_ZNKSt20_List_const_iteratorIPcEdeEv(%"struct.std::_List_const_iterator"* %__first) #8 call void @_ZNSt7__cxx114listIPcSaIS1_EE12emplace_backIJRKS1_EEEvDpOT_(%"class.std::__cxx11::list"* %this2, i8** nonnull align 8 dereferenceable(8) %call3) br label %for.inc for.inc: ; preds = %for.body %call4 = call nonnull align 8 dereferenceable(8) %"struct.std::_List_const_iterator"* @_ZNSt20_List_const_iteratorIPcEppEv(%"struct.std::_List_const_iterator"* %__first) #8 br label %for.cond for.end: ; preds = %for.cond ret void } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local %"struct.std::__detail::_List_node_base"* @_ZNKSt7__cxx114listIPcSaIS1_EE5beginEv(%"class.std::__cxx11::list"* %this) #1 comdat align 2 { entry: %retval = alloca %"struct.std::_List_const_iterator", align 8 %this.addr = alloca %"class.std::__cxx11::list"*, align 8 store %"class.std::__cxx11::list"* %this, %"class.std::__cxx11::list"** %this.addr, align 8 %this1 = load %"class.std::__cxx11::list"*, %"class.std::__cxx11::list"** %this.addr, align 8 %0 = bitcast %"class.std::__cxx11::list"* %this1 to %"class.std::__cxx11::_List_base"* %_M_impl = getelementptr inbounds %"class.std::__cxx11::_List_base", %"class.std::__cxx11::_List_base"* %0, i32 0, i32 0 %_M_node = getelementptr inbounds %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl", %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"* %_M_impl, i32 0, i32 0 %1 = bitcast %"struct.std::__detail::_List_node_header"* %_M_node to %"struct.std::__detail::_List_node_base"* %_M_next = getelementptr inbounds %"struct.std::__detail::_List_node_base", %"struct.std::__detail::_List_node_base"* %1, i32 0, i32 0 %2 = load %"struct.std::__detail::_List_node_base"*, %"struct.std::__detail::_List_node_base"** %_M_next, align 8 call void @_ZNSt20_List_const_iteratorIPcEC2EPKNSt8__detail15_List_node_baseE(%"struct.std::_List_const_iterator"* %retval, %"struct.std::__detail::_List_node_base"* %2) #8 %coerce.dive = getelementptr inbounds %"struct.std::_List_const_iterator", %"struct.std::_List_const_iterator"* %retval, i32 0, i32 0 %3 = load %"struct.std::__detail::_List_node_base"*, %"struct.std::__detail::_List_node_base"** %coerce.dive, align 8 ret %"struct.std::__detail::_List_node_base"* %3 } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local %"struct.std::__detail::_List_node_base"* @_ZNKSt7__cxx114listIPcSaIS1_EE3endEv(%"class.std::__cxx11::list"* %this) #1 comdat align 2 { entry: %retval = alloca %"struct.std::_List_const_iterator", align 8 %this.addr = alloca %"class.std::__cxx11::list"*, align 8 store %"class.std::__cxx11::list"* %this, %"class.std::__cxx11::list"** %this.addr, align 8 %this1 = load %"class.std::__cxx11::list"*, %"class.std::__cxx11::list"** %this.addr, align 8 %0 = bitcast %"class.std::__cxx11::list"* %this1 to %"class.std::__cxx11::_List_base"* %_M_impl = getelementptr inbounds %"class.std::__cxx11::_List_base", %"class.std::__cxx11::_List_base"* %0, i32 0, i32 0 %_M_node = getelementptr inbounds %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl", %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"* %_M_impl, i32 0, i32 0 %1 = bitcast %"struct.std::__detail::_List_node_header"* %_M_node to %"struct.std::__detail::_List_node_base"* call void @_ZNSt20_List_const_iteratorIPcEC2EPKNSt8__detail15_List_node_baseE(%"struct.std::_List_const_iterator"* %retval, %"struct.std::__detail::_List_node_base"* %1) #8 %coerce.dive = getelementptr inbounds %"struct.std::_List_const_iterator", %"struct.std::_List_const_iterator"* %retval, i32 0, i32 0 %2 = load %"struct.std::__detail::_List_node_base"*, %"struct.std::__detail::_List_node_base"** %coerce.dive, align 8 ret %"struct.std::__detail::_List_node_base"* %2 } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local void @_ZNSt16allocator_traitsISaISt10_List_nodeIPcEEE37select_on_container_copy_constructionERKS3_(%"class.std::allocator"* noalias sret align 1 %agg.result, %"class.std::allocator"* nonnull align 1 dereferenceable(1) %__rhs) #1 comdat align 2 { entry: %result.ptr = alloca i8*, align 8 %__rhs.addr = alloca %"class.std::allocator"*, align 8 %0 = bitcast %"class.std::allocator"* %agg.result to i8* store i8* %0, i8** %result.ptr, align 8 store %"class.std::allocator"* %__rhs, %"class.std::allocator"** %__rhs.addr, align 8 %1 = load %"class.std::allocator"*, %"class.std::allocator"** %__rhs.addr, align 8 call void @_ZNSaISt10_List_nodeIPcEEC2ERKS2_(%"class.std::allocator"* %agg.result, %"class.std::allocator"* nonnull align 1 dereferenceable(1) %1) #8 ret void } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local void @_ZNSaISt10_List_nodeIPcEEC2ERKS2_(%"class.std::allocator"* %this, %"class.std::allocator"* nonnull align 1 dereferenceable(1) %__a) unnamed_addr #1 comdat align 2 { entry: %this.addr = alloca %"class.std::allocator"*, align 8 %__a.addr = alloca %"class.std::allocator"*, align 8 store %"class.std::allocator"* %this, %"class.std::allocator"** %this.addr, align 8 store %"class.std::allocator"* %__a, %"class.std::allocator"** %__a.addr, align 8 %this1 = load %"class.std::allocator"*, %"class.std::allocator"** %this.addr, align 8 %0 = bitcast %"class.std::allocator"* %this1 to %"class.__gnu_cxx::new_allocator"* %1 = load %"class.std::allocator"*, %"class.std::allocator"** %__a.addr, align 8 %2 = bitcast %"class.std::allocator"* %1 to %"class.__gnu_cxx::new_allocator"* call void @_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEEC2ERKS4_(%"class.__gnu_cxx::new_allocator"* %0, %"class.__gnu_cxx::new_allocator"* nonnull align 1 dereferenceable(1) %2) #8 ret void } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local void @_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIPcEEC2ERKS4_(%"class.__gnu_cxx::new_allocator"* %this, %"class.__gnu_cxx::new_allocator"* nonnull align 1 dereferenceable(1) %0) unnamed_addr #1 comdat align 2 { entry: %this.addr = alloca %"class.__gnu_cxx::new_allocator"*, align 8 %.addr = alloca %"class.__gnu_cxx::new_allocator"*, align 8 store %"class.__gnu_cxx::new_allocator"* %this, %"class.__gnu_cxx::new_allocator"** %this.addr, align 8 store %"class.__gnu_cxx::new_allocator"* %0, %"class.__gnu_cxx::new_allocator"** %.addr, align 8 %this1 = load %"class.__gnu_cxx::new_allocator"*, %"class.__gnu_cxx::new_allocator"** %this.addr, align 8 ret void } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local nonnull align 1 dereferenceable(1) %"class.std::allocator"* @_ZSt4moveIRSaISt10_List_nodeIPcEEEONSt16remove_referenceIT_E4typeEOS6_(%"class.std::allocator"* nonnull align 1 dereferenceable(1) %__t) #1 comdat { entry: %__t.addr = alloca %"class.std::allocator"*, align 8 store %"class.std::allocator"* %__t, %"class.std::allocator"** %__t.addr, align 8 %0 = load %"class.std::allocator"*, %"class.std::allocator"** %__t.addr, align 8 ret %"class.std::allocator"* %0 } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local void @_ZNSt7__cxx1110_List_baseIPcSaIS1_EE10_List_implC2EOSaISt10_List_nodeIS1_EE(%"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"* %this, %"class.std::allocator"* nonnull align 1 dereferenceable(1) %__a) unnamed_addr #1 comdat align 2 { entry: %this.addr = alloca %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"*, align 8 %__a.addr = alloca %"class.std::allocator"*, align 8 store %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"* %this, %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"** %this.addr, align 8 store %"class.std::allocator"* %__a, %"class.std::allocator"** %__a.addr, align 8 %this1 = load %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"*, %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"** %this.addr, align 8 %0 = bitcast %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"* %this1 to %"class.std::allocator"* %1 = load %"class.std::allocator"*, %"class.std::allocator"** %__a.addr, align 8 %call = call nonnull align 1 dereferenceable(1) %"class.std::allocator"* @_ZSt4moveIRSaISt10_List_nodeIPcEEEONSt16remove_referenceIT_E4typeEOS6_(%"class.std::allocator"* nonnull align 1 dereferenceable(1) %1) #8 call void @_ZNSaISt10_List_nodeIPcEEC2ERKS2_(%"class.std::allocator"* %0, %"class.std::allocator"* nonnull align 1 dereferenceable(1) %call) #8 %_M_node = getelementptr inbounds %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl", %"struct.std::__cxx11::_List_base<char *, std::allocator<char *>>::_List_impl"* %this1, i32 0, i32 0 call void @_ZNSt8__detail17_List_node_headerC2Ev(%"struct.std::__detail::_List_node_header"* %_M_node) #8 ret void } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local zeroext i1 @_ZStneRKSt20_List_const_iteratorIPcES3_(%"struct.std::_List_const_iterator"* nonnull align 8 dereferenceable(8) %__x, %"struct.std::_List_const_iterator"* nonnull align 8 dereferenceable(8) %__y) #1 comdat { entry: %__x.addr = alloca %"struct.std::_List_const_iterator"*, align 8 %__y.addr = alloca %"struct.std::_List_const_iterator"*, align 8 store %"struct.std::_List_const_iterator"* %__x, %"struct.std::_List_const_iterator"** %__x.addr, align 8 store %"struct.std::_List_const_iterator"* %__y, %"struct.std::_List_const_iterator"** %__y.addr, align 8 %0 = load %"struct.std::_List_const_iterator"*, %"struct.std::_List_const_iterator"** %__x.addr, align 8 %_M_node = getelementptr inbounds %"struct.std::_List_const_iterator", %"struct.std::_List_const_iterator"* %0, i32 0, i32 0 %1 = load %"struct.std::__detail::_List_node_base"*, %"struct.std::__detail::_List_node_base"** %_M_node, align 8 %2 = load %"struct.std::_List_const_iterator"*, %"struct.std::_List_const_iterator"** %__y.addr, align 8 %_M_node1 = getelementptr inbounds %"struct.std::_List_const_iterator", %"struct.std::_List_const_iterator"* %2, i32 0, i32 0 %3 = load %"struct.std::__detail::_List_node_base"*, %"struct.std::__detail::_List_node_base"** %_M_node1, align 8 %cmp = icmp ne %"struct.std::__detail::_List_node_base"* %1, %3 ret i1 %cmp } ; Function Attrs: noinline optnone uwtable define linkonce_odr dso_local void @_ZNSt7__cxx114listIPcSaIS1_EE12emplace_backIJRKS1_EEEvDpOT_(%"class.std::__cxx11::list"* %this, i8** nonnull align 8 dereferenceable(8) %__args) #0 comdat align 2 { entry: %this.addr = alloca %"class.std::__cxx11::list"*, align 8 %__args.addr = alloca i8**, align 8 %agg.tmp = alloca %"struct.std::_List_iterator", align 8 store %"class.std::__cxx11::list"* %this, %"class.std::__cxx11::list"** %this.addr, align 8 store i8** %__args, i8*** %__args.addr, align 8 %this1 = load %"class.std::__cxx11::list"*, %"class.std::__cxx11::list"** %this.addr, align 8 %call = call %"struct.std::__detail::_List_node_base"* @_ZNSt7__cxx114listIPcSaIS1_EE3endEv(%"class.std::__cxx11::list"* %this1) #8 %coerce.dive = getelementptr inbounds %"struct.std::_List_iterator", %"struct.std::_List_iterator"* %agg.tmp, i32 0, i32 0 store %"struct.std::__detail::_List_node_base"* %call, %"struct.std::__detail::_List_node_base"** %coerce.dive, align 8 %0 = load i8**, i8*** %__args.addr, align 8 %call2 = call nonnull align 8 dereferenceable(8) i8** @_ZSt7forwardIRKPcEOT_RNSt16remove_referenceIS3_E4typeE(i8** nonnull align 8 dereferenceable(8) %0) #8 %coerce.dive3 = getelementptr inbounds %"struct.std::_List_iterator", %"struct.std::_List_iterator"* %agg.tmp, i32 0, i32 0 %1 = load %"struct.std::__detail::_List_node_base"*, %"struct.std::__detail::_List_node_base"** %coerce.dive3, align 8 call void @_ZNSt7__cxx114listIPcSaIS1_EE9_M_insertIJRKS1_EEEvSt14_List_iteratorIS1_EDpOT_(%"class.std::__cxx11::list"* %this1, %"struct.std::__detail::_List_node_base"* %1, i8** nonnull align 8 dereferenceable(8) %call2) ret void } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local nonnull align 8 dereferenceable(8) i8** @_ZNKSt20_List_const_iteratorIPcEdeEv(%"struct.std::_List_const_iterator"* %this) #1 comdat align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { entry: %this.addr = alloca %"struct.std::_List_const_iterator"*, align 8 store %"struct.std::_List_const_iterator"* %this, %"struct.std::_List_const_iterator"** %this.addr, align 8 %this1 = load %"struct.std::_List_const_iterator"*, %"struct.std::_List_const_iterator"** %this.addr, align 8 %_M_node = getelementptr inbounds %"struct.std::_List_const_iterator", %"struct.std::_List_const_iterator"* %this1, i32 0, i32 0 %0 = load %"struct.std::__detail::_List_node_base"*, %"struct.std::__detail::_List_node_base"** %_M_node, align 8 %1 = bitcast %"struct.std::__detail::_List_node_base"* %0 to %"struct.std::_List_node"* %call = invoke i8** @_ZNKSt10_List_nodeIPcE9_M_valptrEv(%"struct.std::_List_node"* %1) to label %invoke.cont unwind label %terminate.lpad invoke.cont: ; preds = %entry ret i8** %call terminate.lpad: ; preds = %entry %2 = landingpad { i8*, i32 } catch i8* null %3 = extractvalue { i8*, i32 } %2, 0 call void @__clang_call_terminate(i8* %3) #9 unreachable } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local nonnull align 8 dereferenceable(8) %"struct.std::_List_const_iterator"* @_ZNSt20_List_const_iteratorIPcEppEv(%"struct.std::_List_const_iterator"* %this) #1 comdat align 2 { entry: %this.addr = alloca %"struct.std::_List_const_iterator"*, align 8 store %"struct.std::_List_const_iterator"* %this, %"struct.std::_List_const_iterator"** %this.addr, align 8 %this1 = load %"struct.std::_List_const_iterator"*, %"struct.std::_List_const_iterator"** %this.addr, align 8 %_M_node = getelementptr inbounds %"struct.std::_List_const_iterator", %"struct.std::_List_const_iterator"* %this1, i32 0, i32 0 %0 = load %"struct.std::__detail::_List_node_base"*, %"struct.std::__detail::_List_node_base"** %_M_node, align 8 %_M_next = getelementptr inbounds %"struct.std::__detail::_List_node_base", %"struct.std::__detail::_List_node_base"* %0, i32 0, i32 0 %1 = load %"struct.std::__detail::_List_node_base"*, %"struct.std::__detail::_List_node_base"** %_M_next, align 8 %_M_node2 = getelementptr inbounds %"struct.std::_List_const_iterator", %"struct.std::_List_const_iterator"* %this1, i32 0, i32 0 store %"struct.std::__detail::_List_node_base"* %1, %"struct.std::__detail::_List_node_base"** %_M_node2, align 8 ret %"struct.std::_List_const_iterator"* %this1 } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local i8** @_ZNKSt10_List_nodeIPcE9_M_valptrEv(%"struct.std::_List_node"* %this) #1 comdat align 2 { entry: %this.addr = alloca %"struct.std::_List_node"*, align 8 store %"struct.std::_List_node"* %this, %"struct.std::_List_node"** %this.addr, align 8 %this1 = load %"struct.std::_List_node"*, %"struct.std::_List_node"** %this.addr, align 8 %_M_storage = getelementptr inbounds %"struct.std::_List_node", %"struct.std::_List_node"* %this1, i32 0, i32 1 %call = call i8** @_ZNK9__gnu_cxx16__aligned_membufIPcE6_M_ptrEv(%"struct.__gnu_cxx::__aligned_membuf"* %_M_storage) #8 ret i8** %call } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local i8** @_ZNK9__gnu_cxx16__aligned_membufIPcE6_M_ptrEv(%"struct.__gnu_cxx::__aligned_membuf"* %this) #1 comdat align 2 { entry: %this.addr = alloca %"struct.__gnu_cxx::__aligned_membuf"*, align 8 store %"struct.__gnu_cxx::__aligned_membuf"* %this, %"struct.__gnu_cxx::__aligned_membuf"** %this.addr, align 8 %this1 = load %"struct.__gnu_cxx::__aligned_membuf"*, %"struct.__gnu_cxx::__aligned_membuf"** %this.addr, align 8 %call = call i8* @_ZNK9__gnu_cxx16__aligned_membufIPcE7_M_addrEv(%"struct.__gnu_cxx::__aligned_membuf"* %this1) #8 %0 = bitcast i8* %call to i8** ret i8** %0 } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local i8* @_ZNK9__gnu_cxx16__aligned_membufIPcE7_M_addrEv(%"struct.__gnu_cxx::__aligned_membuf"* %this) #1 comdat align 2 { entry: %this.addr = alloca %"struct.__gnu_cxx::__aligned_membuf"*, align 8 store %"struct.__gnu_cxx::__aligned_membuf"* %this, %"struct.__gnu_cxx::__aligned_membuf"** %this.addr, align 8 %this1 = load %"struct.__gnu_cxx::__aligned_membuf"*, %"struct.__gnu_cxx::__aligned_membuf"** %this.addr, align 8 %_M_storage = getelementptr inbounds %"struct.__gnu_cxx::__aligned_membuf", %"struct.__gnu_cxx::__aligned_membuf"* %this1, i32 0, i32 0 %0 = bitcast [8 x i8]* %_M_storage to i8* ret i8* %0 } ; Function Attrs: noinline nounwind optnone uwtable define linkonce_odr dso_local void @_ZNSt20_List_const_iteratorIPcEC2EPKNSt8__detail15_List_node_baseE(%"struct.std::_List_const_iterator"* %this, %"struct.std::__detail::_List_node_base"* %__x) unnamed_addr #1 comdat align 2 { entry: %this.addr = alloca %"struct.std::_List_const_iterator"*, align 8 %__x.addr = alloca %"struct.std::__detail::_List_node_base"*, align 8 store %"struct.std::_List_const_iterator"* %this, %"struct.std::_List_const_iterator"** %this.addr, align 8 store %"struct.std::__detail::_List_node_base"* %__x, %"struct.std::__detail::_List_node_base"** %__x.addr, align 8 %this1 = load %"struct.std::_List_const_iterator"*, %"struct.std::_List_const_iterator"** %this.addr, align 8 %_M_node = getelementptr inbounds %"struct.std::_List_const_iterator", %"struct.std::_List_const_iterator"* %this1, i32 0, i32 0 %0 = load %"struct.std::__detail::_List_node_base"*, %"struct.std::__detail::_List_node_base"** %__x.addr, align 8 store %"struct.std::__detail::_List_node_base"* %0, %"struct.std::__detail::_List_node_base"** %_M_node, align 8 ret void } attributes #0 = { noinline optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } attributes #1 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } attributes #2 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } attributes #3 = { noinline noreturn nounwind } attributes #4 = { nobuiltin nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } attributes #5 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } attributes #6 = { noreturn "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } attributes #7 = { nobuiltin allocsize(0) "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } attributes #8 = { nounwind } attributes #9 = { noreturn nounwind } attributes #10 = { noreturn } attributes #11 = { allocsize(0) } !llvm.module.flags = !{!0} !llvm.ident = !{!1} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{!"clang version 11.1.0"}
### Human: Refine the following lifted llvm ir, target datalayout = "e-m:e-p:64:64-i64:64-f80:128-n8:16:32:64-S128" define i64 @_GLOBAL_OFFSET_TABLE_.1(i64 %arg1) local_unnamed_addr { dec_label_pc_0: %0 = call i64 @__readfsqword(i64 40), !insn.addr !0 ret i64 %arg1, !insn.addr !1 } define i64 @function_33() local_unnamed_addr { dec_label_pc_33: %0 = alloca i64 %rax.0.reg2mem = alloca i64, !insn.addr !2 %storemerge1.reg2mem = alloca i64, !insn.addr !2 %1 = load i64, i64* %0 %2 = add i64 %1, -832, !insn.addr !2 %3 = inttoptr i64 %2 to i64*, !insn.addr !2 store i64 0, i64* %3, align 8 %4 = add i64 %1, -816 %5 = add i64 %1, -812, !insn.addr !3 store i64 0, i64* %storemerge1.reg2mem br label %dec_label_pc_40 dec_label_pc_40: ; preds = %dec_label_pc_33, %dec_label_pc_40 %storemerge1.reload = load i64, i64* %storemerge1.reg2mem %6 = mul i64 %storemerge1.reload, 8, !insn.addr !4 %7 = add i64 %6, %4, !insn.addr !4 %8 = inttoptr i64 %7 to i32*, !insn.addr !4 store i32 0, i32* %8, align 4, !insn.addr !4 %9 = load i64, i64* %3, align 8, !insn.addr !5 %10 = mul i64 %9, 8, !insn.addr !3 %11 = add i64 %5, %10, !insn.addr !3 %12 = inttoptr i64 %11 to i32*, !insn.addr !3 store i32 0, i32* %12, align 4, !insn.addr !3 %13 = load i64, i64* %3, align 8, !insn.addr !6 %14 = add i64 %13, 1, !insn.addr !6 store i64 %14, i64* %3, align 8 %15 = icmp ult i64 %14, 100 store i64 %14, i64* %storemerge1.reg2mem, !insn.addr !7 br i1 %15, label %dec_label_pc_40, label %dec_label_pc_76, !insn.addr !7 dec_label_pc_76: ; preds = %dec_label_pc_40 %16 = add i64 %1, -824, !insn.addr !8 %17 = inttoptr i64 %16 to i64*, !insn.addr !8 %18 = load i64, i64* %17, align 8, !insn.addr !8 %19 = call i64 @memmove(i64 %18, i64 %4, i64 800, i64 %4), !insn.addr !9 %20 = load i64, i64* %17, align 8, !insn.addr !10 %21 = call i64 @printStructLine(i64 %20), !insn.addr !11 %22 = add i64 %1, -8, !insn.addr !12 %23 = inttoptr i64 %22 to i64*, !insn.addr !12 %24 = load i64, i64* %23, align 8, !insn.addr !12 %25 = call i64 @__readfsqword(i64 40), !insn.addr !13 %26 = icmp eq i64 %24, %25, !insn.addr !13 store i64 0, i64* %rax.0.reg2mem, !insn.addr !14 br i1 %26, label %dec_label_pc_b8, label %dec_label_pc_b3, !insn.addr !14 dec_label_pc_b3: ; preds = %dec_label_pc_76 %27 = call i64 @__stack_chk_fail(), !insn.addr !15 store i64 %27, i64* %rax.0.reg2mem, !insn.addr !15 br label %dec_label_pc_b8, !insn.addr !15 dec_label_pc_b8: ; preds = %dec_label_pc_b3, %dec_label_pc_76 %rax.0.reload = load i64, i64* %rax.0.reg2mem ret i64 %rax.0.reload, !insn.addr !16 } define i64 @CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_declare_memmove_66b_goodG2BSink(i64 %arg1) local_unnamed_addr { dec_label_pc_ba: %rax.0.reg2mem = alloca i64, !insn.addr !17 %storemerge1.reg2mem = alloca i64, !insn.addr !17 %stack_var_-824 = alloca i64, align 8 %stack_var_-8 = alloca i64, align 8 %0 = ptrtoint i64* %stack_var_-8 to i64, !insn.addr !18 %1 = call i64 @__readfsqword(i64 40), !insn.addr !19 %2 = add i64 %arg1, 16, !insn.addr !20 %3 = inttoptr i64 %2 to i64*, !insn.addr !20 %4 = load i64, i64* %3, align 8, !insn.addr !20 store i64 0, i64* %storemerge1.reg2mem br label %dec_label_pc_fa dec_label_pc_fa: ; preds = %dec_label_pc_fa, %dec_label_pc_ba %storemerge1.reload = load i64, i64* %storemerge1.reg2mem %5 = mul i64 %storemerge1.reload, 8, !insn.addr !21 %6 = add i64 %5, %0 %7 = add i64 %6, -816, !insn.addr !21 %8 = inttoptr i64 %7 to i32*, !insn.addr !21 store i32 0, i32* %8, align 8, !insn.addr !21 %9 = add i64 %6, -812, !insn.addr !22 %10 = inttoptr i64 %9 to i32*, !insn.addr !22 store i32 0, i32* %10, align 4, !insn.addr !22 %11 = add nuw nsw i64 %storemerge1.reload, 1, !insn.addr !23 %exitcond = icmp eq i64 %11, 100 store i64 %11, i64* %storemerge1.reg2mem, !insn.addr !24 br i1 %exitcond, label %dec_label_pc_130, label %dec_label_pc_fa, !insn.addr !24 dec_label_pc_130: ; preds = %dec_label_pc_fa %12 = ptrtoint i64* %stack_var_-824 to i64, !insn.addr !25 %13 = call i64 @memmove(i64 %4, i64 %12, i64 800, i64 %12), !insn.addr !26 %14 = call i64 @printStructLine(i64 %4), !insn.addr !27 %15 = call i64 @__readfsqword(i64 40), !insn.addr !28 %16 = icmp eq i64 %1, %15, !insn.addr !28 store i64 0, i64* %rax.0.reg2mem, !insn.addr !29 br i1 %16, label %dec_label_pc_172, label %dec_label_pc_16d, !insn.addr !29 dec_label_pc_16d: ; preds = %dec_label_pc_130 %17 = call i64 @__stack_chk_fail(), !insn.addr !30 store i64 %17, i64* %rax.0.reg2mem, !insn.addr !30 br label %dec_label_pc_172, !insn.addr !30 dec_label_pc_172: ; preds = %dec_label_pc_16d, %dec_label_pc_130 %rax.0.reload = load i64, i64* %rax.0.reg2mem ret i64 %rax.0.reload, !insn.addr !31 } declare i64 @memmove(i64, i64, i64, i64) local_unnamed_addr declare i64 @printStructLine(i64) local_unnamed_addr declare i64 @__stack_chk_fail() local_unnamed_addr declare i64 @__readfsqword(i64) local_unnamed_addr !0 = !{i64 18} !1 = !{i64 33} !2 = !{i64 51} !3 = !{i64 89} !4 = !{i64 71} !5 = !{i64 82} !6 = !{i64 100} !7 = !{i64 116} !8 = !{i64 125} !9 = !{i64 143} !10 = !{i64 148} !11 = !{i64 158} !12 = !{i64 164} !13 = !{i64 168} !14 = !{i64 177} !15 = !{i64 179} !16 = !{i64 185} !17 = !{i64 186} !18 = !{i64 187} !19 = !{i64 204} !20 = !{i64 226} !21 = !{i64 257} !22 = !{i64 275} !23 = !{i64 286} !24 = !{i64 302} !25 = !{i64 304} !26 = !{i64 329} !27 = !{i64 344} !28 = !{i64 354} !29 = !{i64 363} !30 = !{i64 365} !31 = !{i64 371} ### Assistant: %struct._twoIntsStruct = type { i32, i32 } ; Function Attrs: noinline nounwind optnone uwtable define dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_declare_memmove_66b_badSink(%struct._twoIntsStruct** %dataArray) #0 { entry: %dataArray.addr = alloca %struct._twoIntsStruct**, align 8 %data = alloca %struct._twoIntsStruct*, align 8 %source = alloca [100 x %struct._twoIntsStruct], align 16 %i = alloca i64, align 8 store %struct._twoIntsStruct** %dataArray, %struct._twoIntsStruct*** %dataArray.addr, align 8 %0 = load %struct._twoIntsStruct**, %struct._twoIntsStruct*** %dataArray.addr, align 8 %arrayidx = getelementptr inbounds %struct._twoIntsStruct*, %struct._twoIntsStruct** %0, i64 2 %1 = load %struct._twoIntsStruct*, %struct._twoIntsStruct** %arrayidx, align 8 store %struct._twoIntsStruct* %1, %struct._twoIntsStruct** %data, align 8 store i64 0, i64* %i, align 8 br label %for.cond for.cond: ; preds = %for.inc, %entry %2 = load i64, i64* %i, align 8 %cmp = icmp ult i64 %2, 100 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond %3 = load i64, i64* %i, align 8 %arrayidx1 = getelementptr inbounds [100 x %struct._twoIntsStruct], [100 x %struct._twoIntsStruct]* %source, i64 0, i64 %3 %intOne = getelementptr inbounds %struct._twoIntsStruct, %struct._twoIntsStruct* %arrayidx1, i32 0, i32 0 store i32 0, i32* %intOne, align 8 %4 = load i64, i64* %i, align 8 %arrayidx2 = getelementptr inbounds [100 x %struct._twoIntsStruct], [100 x %struct._twoIntsStruct]* %source, i64 0, i64 %4 %intTwo = getelementptr inbounds %struct._twoIntsStruct, %struct._twoIntsStruct* %arrayidx2, i32 0, i32 1 store i32 0, i32* %intTwo, align 4 br label %for.inc for.inc: ; preds = %for.body %5 = load i64, i64* %i, align 8 %inc = add i64 %5, 1 store i64 %inc, i64* %i, align 8 br label %for.cond for.end: ; preds = %for.cond %6 = load %struct._twoIntsStruct*, %struct._twoIntsStruct** %data, align 8 %7 = bitcast %struct._twoIntsStruct* %6 to i8* %arraydecay = getelementptr inbounds [100 x %struct._twoIntsStruct], [100 x %struct._twoIntsStruct]* %source, i64 0, i64 0 %8 = bitcast %struct._twoIntsStruct* %arraydecay to i8* call void @llvm.memmove.p0i8.p0i8.i64(i8* align 4 %7, i8* align 16 %8, i64 800, i1 false) %9 = load %struct._twoIntsStruct*, %struct._twoIntsStruct** %data, align 8 %arrayidx3 = getelementptr inbounds %struct._twoIntsStruct, %struct._twoIntsStruct* %9, i64 0 call void @printStructLine(%struct._twoIntsStruct* %arrayidx3) ret void } ; Function Attrs: argmemonly nounwind willreturn declare void @llvm.memmove.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i1 immarg) #1 declare dso_local void @printStructLine(%struct._twoIntsStruct*) #2 ; Function Attrs: noinline nounwind optnone uwtable define dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_declare_memmove_66b_goodG2BSink(%struct._twoIntsStruct** %dataArray) #0 { entry: %dataArray.addr = alloca %struct._twoIntsStruct**, align 8 %data = alloca %struct._twoIntsStruct*, align 8 %source = alloca [100 x %struct._twoIntsStruct], align 16 %i = alloca i64, align 8 store %struct._twoIntsStruct** %dataArray, %struct._twoIntsStruct*** %dataArray.addr, align 8 %0 = load %struct._twoIntsStruct**, %struct._twoIntsStruct*** %dataArray.addr, align 8 %arrayidx = getelementptr inbounds %struct._twoIntsStruct*, %struct._twoIntsStruct** %0, i64 2 %1 = load %struct._twoIntsStruct*, %struct._twoIntsStruct** %arrayidx, align 8 store %struct._twoIntsStruct* %1, %struct._twoIntsStruct** %data, align 8 store i64 0, i64* %i, align 8 br label %for.cond for.cond: ; preds = %for.inc, %entry %2 = load i64, i64* %i, align 8 %cmp = icmp ult i64 %2, 100 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond %3 = load i64, i64* %i, align 8 %arrayidx1 = getelementptr inbounds [100 x %struct._twoIntsStruct], [100 x %struct._twoIntsStruct]* %source, i64 0, i64 %3 %intOne = getelementptr inbounds %struct._twoIntsStruct, %struct._twoIntsStruct* %arrayidx1, i32 0, i32 0 store i32 0, i32* %intOne, align 8 %4 = load i64, i64* %i, align 8 %arrayidx2 = getelementptr inbounds [100 x %struct._twoIntsStruct], [100 x %struct._twoIntsStruct]* %source, i64 0, i64 %4 %intTwo = getelementptr inbounds %struct._twoIntsStruct, %struct._twoIntsStruct* %arrayidx2, i32 0, i32 1 store i32 0, i32* %intTwo, align 4 br label %for.inc for.inc: ; preds = %for.body %5 = load i64, i64* %i, align 8 %inc = add i64 %5, 1 store i64 %inc, i64* %i, align 8 br label %for.cond for.end: ; preds = %for.cond %6 = load %struct._twoIntsStruct*, %struct._twoIntsStruct** %data, align 8 %7 = bitcast %struct._twoIntsStruct* %6 to i8* %arraydecay = getelementptr inbounds [100 x %struct._twoIntsStruct], [100 x %struct._twoIntsStruct]* %source, i64 0, i64 0 %8 = bitcast %struct._twoIntsStruct* %arraydecay to i8* call void @llvm.memmove.p0i8.p0i8.i64(i8* align 4 %7, i8* align 16 %8, i64 800, i1 false) %9 = load %struct._twoIntsStruct*, %struct._twoIntsStruct** %data, align 8 %arrayidx3 = getelementptr inbounds %struct._twoIntsStruct, %struct._twoIntsStruct* %9, i64 0 call void @printStructLine(%struct._twoIntsStruct* %arrayidx3) ret void } attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } attributes #1 = { argmemonly nounwind willreturn } attributes #2 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } !llvm.module.flags = !{!0} !llvm.ident = !{!1} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{!"clang version 11.1.0"}
### Human: Refine the following lifted llvm ir, target datalayout = "e-m:e-p:64:64-i64:64-f80:128-n8:16:32:64-S128" define i64 @_GLOBAL_OFFSET_TABLE_.1(i64 %arg1) local_unnamed_addr { dec_label_pc_0: %0 = call i64 @__readfsqword(i64 40), !insn.addr !0 ret i64 %arg1, !insn.addr !1 } define i64 @function_30() local_unnamed_addr { dec_label_pc_30: %0 = alloca i64 %rax.0.reg2mem = alloca i64, !insn.addr !2 %storemerge2.reg2mem = alloca i64, !insn.addr !2 %.reg2mem = alloca i64, !insn.addr !2 %1 = load i64, i64* %0 %2 = add i64 %1, -112, !insn.addr !2 %3 = call i64 @memset(i64 %2, i64 67, i64 99), !insn.addr !3 %4 = add i64 %1, -13, !insn.addr !4 %5 = inttoptr i64 %4 to i8*, !insn.addr !4 store i8 0, i8* %5, align 1, !insn.addr !4 %6 = add i64 %1, -128, !insn.addr !5 %7 = inttoptr i64 %6 to i64*, !insn.addr !5 store i64 0, i64* %7, align 8 %8 = add i64 %1, -120 %9 = inttoptr i64 %8 to i64* %10 = load i64, i64* %9, align 8 store i64 %10, i64* %.reg2mem store i64 0, i64* %storemerge2.reg2mem br label %dec_label_pc_54 dec_label_pc_54: ; preds = %dec_label_pc_30, %dec_label_pc_54 %storemerge2.reload = load i64, i64* %storemerge2.reg2mem %.reload = load i64, i64* %.reg2mem %11 = add i64 %storemerge2.reload, %.reload, !insn.addr !6 %12 = add i64 %storemerge2.reload, %2, !insn.addr !7 %13 = inttoptr i64 %12 to i8*, !insn.addr !8 %14 = load i8, i8* %13, align 1, !insn.addr !8 %15 = inttoptr i64 %11 to i8*, !insn.addr !9 store i8 %14, i8* %15, align 1, !insn.addr !9 %16 = load i64, i64* %7, align 8, !insn.addr !10 %17 = add i64 %16, 1, !insn.addr !10 store i64 %17, i64* %7, align 8 %18 = icmp ult i64 %17, 100 %19 = load i64, i64* %9, align 8 store i64 %19, i64* %.reg2mem, !insn.addr !11 store i64 %17, i64* %storemerge2.reg2mem, !insn.addr !11 br i1 %18, label %dec_label_pc_54, label %dec_label_pc_7b, !insn.addr !11 dec_label_pc_7b: ; preds = %dec_label_pc_54 %20 = add i64 %19, 99, !insn.addr !12 %21 = inttoptr i64 %20 to i8*, !insn.addr !13 store i8 0, i8* %21, align 1, !insn.addr !13 %22 = load i64, i64* %9, align 8, !insn.addr !14 %23 = call i64 @printLine(i64 %22), !insn.addr !15 %24 = add i64 %1, -8, !insn.addr !16 %25 = inttoptr i64 %24 to i64*, !insn.addr !16 %26 = load i64, i64* %25, align 8, !insn.addr !16 %27 = call i64 @__readfsqword(i64 40), !insn.addr !17 %28 = icmp eq i64 %26, %27, !insn.addr !17 store i64 0, i64* %rax.0.reg2mem, !insn.addr !18 br i1 %28, label %dec_label_pc_a7, label %dec_label_pc_a2, !insn.addr !18 dec_label_pc_a2: ; preds = %dec_label_pc_7b %29 = call i64 @__stack_chk_fail(), !insn.addr !19 store i64 %29, i64* %rax.0.reg2mem, !insn.addr !19 br label %dec_label_pc_a7, !insn.addr !19 dec_label_pc_a7: ; preds = %dec_label_pc_a2, %dec_label_pc_7b %rax.0.reload = load i64, i64* %rax.0.reg2mem ret i64 %rax.0.reload, !insn.addr !20 } define i64 @CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_loop_66b_goodG2BSink(i64 %arg1) local_unnamed_addr { dec_label_pc_a9: %rax.0.reg2mem = alloca i64, !insn.addr !21 %storemerge1.reg2mem = alloca i64, !insn.addr !21 %stack_var_-120 = alloca i64, align 8 %0 = call i64 @__readfsqword(i64 40), !insn.addr !22 %1 = add i64 %arg1, 16, !insn.addr !23 %2 = inttoptr i64 %1 to i64*, !insn.addr !23 %3 = load i64, i64* %2, align 8, !insn.addr !23 %4 = ptrtoint i64* %stack_var_-120 to i64, !insn.addr !24 %5 = call i64 @memset(i64 %4, i64 67, i64 99), !insn.addr !25 store i64 0, i64* %storemerge1.reg2mem br label %dec_label_pc_fd dec_label_pc_fd: ; preds = %dec_label_pc_fd, %dec_label_pc_a9 %storemerge1.reload = load i64, i64* %storemerge1.reg2mem %6 = add i64 %storemerge1.reload, %3, !insn.addr !26 %7 = add i64 %storemerge1.reload, %4, !insn.addr !27 %8 = inttoptr i64 %7 to i8*, !insn.addr !28 %9 = load i8, i8* %8, align 1, !insn.addr !28 %10 = inttoptr i64 %6 to i8*, !insn.addr !29 store i8 %9, i8* %10, align 1, !insn.addr !29 %11 = add nuw nsw i64 %storemerge1.reload, 1, !insn.addr !30 %exitcond = icmp eq i64 %11, 100 store i64 %11, i64* %storemerge1.reg2mem, !insn.addr !31 br i1 %exitcond, label %dec_label_pc_124, label %dec_label_pc_fd, !insn.addr !31 dec_label_pc_124: ; preds = %dec_label_pc_fd %12 = add i64 %3, 99, !insn.addr !32 %13 = inttoptr i64 %12 to i8*, !insn.addr !33 store i8 0, i8* %13, align 1, !insn.addr !33 %14 = call i64 @printLine(i64 %3), !insn.addr !34 %15 = call i64 @__readfsqword(i64 40), !insn.addr !35 %16 = icmp eq i64 %0, %15, !insn.addr !35 store i64 0, i64* %rax.0.reg2mem, !insn.addr !36 br i1 %16, label %dec_label_pc_150, label %dec_label_pc_14b, !insn.addr !36 dec_label_pc_14b: ; preds = %dec_label_pc_124 %17 = call i64 @__stack_chk_fail(), !insn.addr !37 store i64 %17, i64* %rax.0.reg2mem, !insn.addr !37 br label %dec_label_pc_150, !insn.addr !37 dec_label_pc_150: ; preds = %dec_label_pc_14b, %dec_label_pc_124 %rax.0.reload = load i64, i64* %rax.0.reg2mem ret i64 %rax.0.reload, !insn.addr !38 } declare i64 @memset(i64, i64, i64) local_unnamed_addr declare i64 @printLine(i64) local_unnamed_addr declare i64 @__stack_chk_fail() local_unnamed_addr declare i64 @__readfsqword(i64) local_unnamed_addr !0 = !{i64 18} !1 = !{i64 33} !2 = !{i64 48} !3 = !{i64 65} !4 = !{i64 70} !5 = !{i64 74} !6 = !{i64 92} !7 = !{i64 103} !8 = !{i64 106} !9 = !{i64 109} !10 = !{i64 111} !11 = !{i64 121} !12 = !{i64 127} !13 = !{i64 131} !14 = !{i64 134} !15 = !{i64 141} !16 = !{i64 147} !17 = !{i64 151} !18 = !{i64 160} !19 = !{i64 162} !20 = !{i64 168} !21 = !{i64 169} !22 = !{i64 187} !23 = !{i64 209} !24 = !{i64 231} !25 = !{i64 234} !26 = !{i64 261} !27 = !{i64 272} !28 = !{i64 275} !29 = !{i64 278} !30 = !{i64 280} !31 = !{i64 290} !32 = !{i64 296} !33 = !{i64 300} !34 = !{i64 310} !35 = !{i64 320} !36 = !{i64 329} !37 = !{i64 331} !38 = !{i64 337} ### Assistant: ; Function Attrs: noinline nounwind optnone uwtable define dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_loop_66b_badSink(i8** %dataArray) #0 { entry: %dataArray.addr = alloca i8**, align 8 %data = alloca i8*, align 8 %i = alloca i64, align 8 %source = alloca [100 x i8], align 16 store i8** %dataArray, i8*** %dataArray.addr, align 8 %0 = load i8**, i8*** %dataArray.addr, align 8 %arrayidx = getelementptr inbounds i8*, i8** %0, i64 2 %1 = load i8*, i8** %arrayidx, align 8 store i8* %1, i8** %data, align 8 %arraydecay = getelementptr inbounds [100 x i8], [100 x i8]* %source, i64 0, i64 0 call void @llvm.memset.p0i8.i64(i8* align 16 %arraydecay, i8 67, i64 99, i1 false) %arrayidx1 = getelementptr inbounds [100 x i8], [100 x i8]* %source, i64 0, i64 99 store i8 0, i8* %arrayidx1, align 1 store i64 0, i64* %i, align 8 br label %for.cond for.cond: ; preds = %for.inc, %entry %2 = load i64, i64* %i, align 8 %cmp = icmp ult i64 %2, 100 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond %3 = load i64, i64* %i, align 8 %arrayidx2 = getelementptr inbounds [100 x i8], [100 x i8]* %source, i64 0, i64 %3 %4 = load i8, i8* %arrayidx2, align 1 %5 = load i8*, i8** %data, align 8 %6 = load i64, i64* %i, align 8 %arrayidx3 = getelementptr inbounds i8, i8* %5, i64 %6 store i8 %4, i8* %arrayidx3, align 1 br label %for.inc for.inc: ; preds = %for.body %7 = load i64, i64* %i, align 8 %inc = add i64 %7, 1 store i64 %inc, i64* %i, align 8 br label %for.cond for.end: ; preds = %for.cond %8 = load i8*, i8** %data, align 8 %arrayidx4 = getelementptr inbounds i8, i8* %8, i64 99 store i8 0, i8* %arrayidx4, align 1 %9 = load i8*, i8** %data, align 8 call void @printLine(i8* %9) ret void } ; Function Attrs: argmemonly nounwind willreturn writeonly declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #1 declare dso_local void @printLine(i8*) #2 ; Function Attrs: noinline nounwind optnone uwtable define dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_loop_66b_goodG2BSink(i8** %dataArray) #0 { entry: %dataArray.addr = alloca i8**, align 8 %data = alloca i8*, align 8 %i = alloca i64, align 8 %source = alloca [100 x i8], align 16 store i8** %dataArray, i8*** %dataArray.addr, align 8 %0 = load i8**, i8*** %dataArray.addr, align 8 %arrayidx = getelementptr inbounds i8*, i8** %0, i64 2 %1 = load i8*, i8** %arrayidx, align 8 store i8* %1, i8** %data, align 8 %arraydecay = getelementptr inbounds [100 x i8], [100 x i8]* %source, i64 0, i64 0 call void @llvm.memset.p0i8.i64(i8* align 16 %arraydecay, i8 67, i64 99, i1 false) %arrayidx1 = getelementptr inbounds [100 x i8], [100 x i8]* %source, i64 0, i64 99 store i8 0, i8* %arrayidx1, align 1 store i64 0, i64* %i, align 8 br label %for.cond for.cond: ; preds = %for.inc, %entry %2 = load i64, i64* %i, align 8 %cmp = icmp ult i64 %2, 100 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond %3 = load i64, i64* %i, align 8 %arrayidx2 = getelementptr inbounds [100 x i8], [100 x i8]* %source, i64 0, i64 %3 %4 = load i8, i8* %arrayidx2, align 1 %5 = load i8*, i8** %data, align 8 %6 = load i64, i64* %i, align 8 %arrayidx3 = getelementptr inbounds i8, i8* %5, i64 %6 store i8 %4, i8* %arrayidx3, align 1 br label %for.inc for.inc: ; preds = %for.body %7 = load i64, i64* %i, align 8 %inc = add i64 %7, 1 store i64 %inc, i64* %i, align 8 br label %for.cond for.end: ; preds = %for.cond %8 = load i8*, i8** %data, align 8 %arrayidx4 = getelementptr inbounds i8, i8* %8, i64 99 store i8 0, i8* %arrayidx4, align 1 %9 = load i8*, i8** %data, align 8 call void @printLine(i8* %9) ret void } attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } attributes #1 = { argmemonly nounwind willreturn writeonly } attributes #2 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } !llvm.module.flags = !{!0} !llvm.ident = !{!1} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{!"clang version 11.1.0"}
### Human: Refine the following lifted llvm ir, target datalayout = "e-m:e-p:64:64-i64:64-f80:128-n8:16:32:64-S128" define i64 @_GLOBAL_OFFSET_TABLE_.1() local_unnamed_addr { dec_label_pc_0: %stack_var_-27 = alloca i64, align 8 %0 = call i64 @__readfsqword(i64 40), !insn.addr !0 %1 = ptrtoint i64* %stack_var_-27 to i64, !insn.addr !1 ret i64 %1, !insn.addr !2 } define i64 @function_30() local_unnamed_addr { dec_label_pc_30: %0 = alloca i64 %.reg2mem = alloca i64, !insn.addr !3 %1 = load i64, i64* %0 %2 = load i64, i64* %0 %3 = trunc i64 %2 to i8 %4 = mul i8 %3, 2, !insn.addr !3 %5 = inttoptr i64 %2 to i8*, !insn.addr !3 store i8 %4, i8* %5, align 1, !insn.addr !3 %6 = add i64 %1, -8, !insn.addr !4 %7 = inttoptr i64 %6 to i64*, !insn.addr !4 %8 = load i64, i64* %7, align 8, !insn.addr !4 %9 = call i64 @__readfsqword(i64 40), !insn.addr !5 %10 = icmp eq i64 %9, %8, !insn.addr !5 store i64 0, i64* %.reg2mem, !insn.addr !6 br i1 %10, label %dec_label_pc_47, label %dec_label_pc_42, !insn.addr !6 dec_label_pc_42: ; preds = %dec_label_pc_30 %11 = call i64 @__stack_chk_fail(), !insn.addr !7 store i64 %11, i64* %.reg2mem, !insn.addr !7 br label %dec_label_pc_47, !insn.addr !7 dec_label_pc_47: ; preds = %dec_label_pc_42, %dec_label_pc_30 %.reload = load i64, i64* %.reg2mem, !insn.addr !8 ret i64 %.reload, !insn.addr !8 } define i64 @goodG2B() local_unnamed_addr { dec_label_pc_49: %rax.0.reg2mem = alloca i64, !insn.addr !9 %stack_var_-27 = alloca i64, align 8 %stack_var_-40 = alloca i8*, align 8 %0 = call i64 @__readfsqword(i64 40), !insn.addr !10 %1 = bitcast i64* %stack_var_-27 to i8* store i8* %1, i8** %stack_var_-40, align 8, !insn.addr !11 store i8 0, i8* %1, align 8, !insn.addr !12 %2 = bitcast i8** %stack_var_-40 to i64*, !insn.addr !13 %3 = call i64 @CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_ncpy_63b_goodG2BSink(i64* nonnull %2), !insn.addr !13 %4 = call i64 @__readfsqword(i64 40), !insn.addr !14 %5 = icmp eq i64 %0, %4, !insn.addr !14 store i64 0, i64* %rax.0.reg2mem, !insn.addr !15 br i1 %5, label %dec_label_pc_90, label %dec_label_pc_8b, !insn.addr !15 dec_label_pc_8b: ; preds = %dec_label_pc_49 %6 = call i64 @__stack_chk_fail(), !insn.addr !16 store i64 %6, i64* %rax.0.reg2mem, !insn.addr !16 br label %dec_label_pc_90, !insn.addr !16 dec_label_pc_90: ; preds = %dec_label_pc_8b, %dec_label_pc_49 %rax.0.reload = load i64, i64* %rax.0.reg2mem ret i64 %rax.0.reload, !insn.addr !17 } define i64 @CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_ncpy_63_good() local_unnamed_addr { dec_label_pc_92: %0 = call i64 @goodG2B(), !insn.addr !18 ret i64 %0, !insn.addr !19 } declare i64 @__stack_chk_fail() local_unnamed_addr declare i64 @CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_ncpy_63b_goodG2BSink(i64*) local_unnamed_addr declare i64 @__readfsqword(i64) local_unnamed_addr !0 = !{i64 8} !1 = !{i64 31} !2 = !{i64 35} !3 = !{i64 48} !4 = !{i64 51} !5 = !{i64 55} !6 = !{i64 64} !7 = !{i64 66} !8 = !{i64 72} !9 = !{i64 73} !10 = !{i64 81} !11 = !{i64 100} !12 = !{i64 108} !13 = !{i64 118} !14 = !{i64 128} !15 = !{i64 137} !16 = !{i64 139} !17 = !{i64 145} !18 = !{i64 155} !19 = !{i64 162} ### Assistant: ; Function Attrs: noinline nounwind optnone uwtable define dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_ncpy_63_bad() #0 { entry: %data = alloca i8*, align 8 %dataBadBuffer = alloca [10 x i8], align 1 %dataGoodBuffer = alloca [11 x i8], align 1 %arraydecay = getelementptr inbounds [10 x i8], [10 x i8]* %dataBadBuffer, i64 0, i64 0 store i8* %arraydecay, i8** %data, align 8 %0 = load i8*, i8** %data, align 8 %arrayidx = getelementptr inbounds i8, i8* %0, i64 0 store i8 0, i8* %arrayidx, align 1 call void @CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_ncpy_63b_badSink(i8** %data) ret void } declare dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_ncpy_63b_badSink(i8**) #1 ; Function Attrs: noinline nounwind optnone uwtable define dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_ncpy_63_good() #0 { entry: call void @goodG2B() ret void } ; Function Attrs: noinline nounwind optnone uwtable define internal void @goodG2B() #0 { entry: %data = alloca i8*, align 8 %dataBadBuffer = alloca [10 x i8], align 1 %dataGoodBuffer = alloca [11 x i8], align 1 %arraydecay = getelementptr inbounds [11 x i8], [11 x i8]* %dataGoodBuffer, i64 0, i64 0 store i8* %arraydecay, i8** %data, align 8 %0 = load i8*, i8** %data, align 8 %arrayidx = getelementptr inbounds i8, i8* %0, i64 0 store i8 0, i8* %arrayidx, align 1 call void @CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_ncpy_63b_goodG2BSink(i8** %data) ret void } declare dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE193_char_declare_ncpy_63b_goodG2BSink(i8**) #1 attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } !llvm.module.flags = !{!0} !llvm.ident = !{!1} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{!"clang version 11.1.0"}
### Human: Refine the following lifted llvm ir, target datalayout = "e-m:e-p:64:64-i64:64-f80:128-n8:16:32:64-S128" @global_var_f = constant [3 x i8] c"%(\00" @global_var_10 = external constant i128 define i64 @_GLOBAL_OFFSET_TABLE_.1() local_unnamed_addr { dec_label_pc_0: %0 = call i64 @__readfsqword(i64 40), !insn.addr !0 ret i64 sub (i64 ptrtoint (i128* @global_var_10 to i64), i64 1), !insn.addr !1 } define i64 @function_31(i64 %arg1, i64 %arg2, i64 %arg3) local_unnamed_addr { dec_label_pc_31: %0 = alloca i64 %.reg2mem = alloca i64, !insn.addr !2 %storemerge1.reg2mem = alloca i64, !insn.addr !2 %1 = load i64, i64* %0 %2 = load i64, i64* %0 %3 = load i64, i64* %0 %4 = trunc i64 %3 to i8 %5 = mul i8 %4, 2, !insn.addr !2 %6 = inttoptr i64 %3 to i8*, !insn.addr !2 store i8 %5, i8* %6, align 1, !insn.addr !2 %7 = udiv i64 %3, %arg2 %8 = mul i64 %7, ptrtoint (i128* @global_var_10 to i64), !insn.addr !3 %9 = sub i64 %2, %8, !insn.addr !4 %10 = add i64 %9, ptrtoint ([3 x i8]* @global_var_f to i64), !insn.addr !5 %11 = and i64 %10, -16, !insn.addr !6 %12 = add i64 %1, -840, !insn.addr !7 %13 = inttoptr i64 %12 to i64*, !insn.addr !7 store i64 %11, i64* %13, align 8, !insn.addr !7 %14 = add i64 %9, add (i64 ptrtoint ([3 x i8]* @global_var_f to i64), i64 sub (i64 0, i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 sub (i64 ptrtoint (i128* @global_var_10 to i64), i64 1), i64 815) to i128), i128 zext (i64 ptrtoint (i128* @global_var_10 to i64) to i128)) to i64) to i128), i128 ptrtoint (i128* @global_var_10 to i128)) to i64))), !insn.addr !8 %15 = and i64 %14, -16, !insn.addr !9 %16 = add i64 %1, -832, !insn.addr !10 %17 = inttoptr i64 %16 to i64*, !insn.addr !10 store i64 %15, i64* %17, align 8, !insn.addr !10 %18 = load i64, i64* %13, align 8, !insn.addr !11 %19 = add i64 %1, -824, !insn.addr !12 %20 = inttoptr i64 %19 to i64*, !insn.addr !12 store i64 %18, i64* %20, align 8, !insn.addr !12 %21 = add i64 %1, -816, !insn.addr !13 %22 = inttoptr i64 %21 to i8*, !insn.addr !14 call void @__asm_rep_stosq_memset(i8* %22, i64 0, i64 100), !insn.addr !14 %23 = add i64 %1, -848, !insn.addr !15 %24 = inttoptr i64 %23 to i64*, !insn.addr !15 store i64 0, i64* %24, align 8 store i64 0, i64* %storemerge1.reg2mem br label %dec_label_pc_bf dec_label_pc_bf: ; preds = %dec_label_pc_31, %dec_label_pc_bf %storemerge1.reload = load i64, i64* %storemerge1.reg2mem %25 = mul i64 %storemerge1.reload, 8, !insn.addr !16 %26 = load i64, i64* %20, align 8, !insn.addr !17 %27 = add i64 %26, %25, !insn.addr !18 %28 = add i64 %25, %21, !insn.addr !19 %29 = inttoptr i64 %28 to i64*, !insn.addr !19 %30 = load i64, i64* %29, align 8, !insn.addr !19 %31 = inttoptr i64 %27 to i64*, !insn.addr !20 store i64 %30, i64* %31, align 8, !insn.addr !20 %32 = load i64, i64* %24, align 8, !insn.addr !21 %33 = add i64 %32, 1, !insn.addr !21 store i64 %33, i64* %24, align 8 %34 = icmp ult i64 %33, 100 store i64 %33, i64* %storemerge1.reg2mem, !insn.addr !22 br i1 %34, label %dec_label_pc_bf, label %dec_label_pc_fc, !insn.addr !22 dec_label_pc_fc: ; preds = %dec_label_pc_bf %35 = load i64, i64* %20, align 8, !insn.addr !23 %36 = inttoptr i64 %35 to i64*, !insn.addr !24 %37 = load i64, i64* %36, align 8, !insn.addr !24 %38 = call i64 @printLongLongLine(i64 %37), !insn.addr !25 %39 = add i64 %1, -8, !insn.addr !26 %40 = inttoptr i64 %39 to i64*, !insn.addr !26 %41 = load i64, i64* %40, align 8, !insn.addr !26 %42 = call i64 @__readfsqword(i64 40), !insn.addr !27 %43 = icmp eq i64 %42, %41, !insn.addr !27 store i64 0, i64* %.reg2mem, !insn.addr !28 br i1 %43, label %dec_label_pc_123, label %dec_label_pc_11e, !insn.addr !28 dec_label_pc_11e: ; preds = %dec_label_pc_fc %44 = call i64 @__stack_chk_fail(), !insn.addr !29 store i64 %44, i64* %.reg2mem, !insn.addr !29 br label %dec_label_pc_123, !insn.addr !29 dec_label_pc_123: ; preds = %dec_label_pc_11e, %dec_label_pc_fc %.reload = load i64, i64* %.reg2mem, !insn.addr !30 ret i64 %.reload, !insn.addr !30 } define i64 @goodG2B1() local_unnamed_addr { dec_label_pc_125: %rax.0.reg2mem = alloca i64, !insn.addr !31 %storemerge1.reg2mem = alloca i64, !insn.addr !31 %stack_var_-824 = alloca i64, align 8 %stack_var_-856 = alloca i64, align 8 %stack_var_-8 = alloca i64, align 8 %0 = ptrtoint i64* %stack_var_-8 to i64, !insn.addr !32 %1 = ptrtoint i64* %stack_var_-856 to i64, !insn.addr !33 %2 = call i64 @__readfsqword(i64 40), !insn.addr !34 %3 = add i64 %1, add (i64 ptrtoint ([3 x i8]* @global_var_f to i64), i64 add (i64 sub (i64 0, i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 sub (i64 ptrtoint (i128* @global_var_10 to i64), i64 1), i64 815) to i128), i128 zext (i64 ptrtoint (i128* @global_var_10 to i64) to i128)) to i64) to i128), i128 ptrtoint (i128* @global_var_10 to i128)) to i64)), i64 sub (i64 0, i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 sub (i64 ptrtoint (i128* @global_var_10 to i64), i64 1), i64 415) to i128), i128 zext (i64 ptrtoint (i128* @global_var_10 to i64) to i128)) to i64) to i128), i128 ptrtoint (i128* @global_var_10 to i128)) to i64)))), !insn.addr !35 %4 = and i64 %3, -16, !insn.addr !36 %5 = bitcast i64* %stack_var_-824 to i8*, !insn.addr !37 call void @__asm_rep_stosq_memset(i8* nonnull %5, i64 0, i64 100), !insn.addr !37 store i64 0, i64* %stack_var_-856, align 8 %6 = add i64 %0, -816, !insn.addr !38 store i64 0, i64* %storemerge1.reg2mem br label %dec_label_pc_1e4 dec_label_pc_1e4: ; preds = %dec_label_pc_125, %dec_label_pc_1e4 %storemerge1.reload = load i64, i64* %storemerge1.reg2mem %7 = mul i64 %storemerge1.reload, 8, !insn.addr !39 %8 = add i64 %7, %4, !insn.addr !40 %9 = add i64 %6, %7, !insn.addr !38 %10 = inttoptr i64 %9 to i64*, !insn.addr !38 %11 = load i64, i64* %10, align 8, !insn.addr !38 %12 = inttoptr i64 %8 to i64*, !insn.addr !41 store i64 %11, i64* %12, align 8, !insn.addr !41 %13 = load i64, i64* %stack_var_-856, align 8, !insn.addr !42 %14 = add i64 %13, 1, !insn.addr !42 store i64 %14, i64* %stack_var_-856, align 8 %15 = icmp ult i64 %14, 100 store i64 %14, i64* %storemerge1.reg2mem, !insn.addr !43 br i1 %15, label %dec_label_pc_1e4, label %dec_label_pc_221, !insn.addr !43 dec_label_pc_221: ; preds = %dec_label_pc_1e4 %16 = inttoptr i64 %4 to i64*, !insn.addr !44 %17 = load i64, i64* %16, align 16, !insn.addr !44 %18 = call i64 @printLongLongLine(i64 %17), !insn.addr !45 %19 = call i64 @__readfsqword(i64 40), !insn.addr !46 %20 = icmp eq i64 %2, %19, !insn.addr !46 store i64 0, i64* %rax.0.reg2mem, !insn.addr !47 br i1 %20, label %dec_label_pc_248, label %dec_label_pc_243, !insn.addr !47 dec_label_pc_243: ; preds = %dec_label_pc_221 %21 = call i64 @__stack_chk_fail(), !insn.addr !48 store i64 %21, i64* %rax.0.reg2mem, !insn.addr !48 br label %dec_label_pc_248, !insn.addr !48 dec_label_pc_248: ; preds = %dec_label_pc_243, %dec_label_pc_221 %rax.0.reload = load i64, i64* %rax.0.reg2mem ret i64 %rax.0.reload, !insn.addr !49 } define i64 @goodG2B2() local_unnamed_addr { dec_label_pc_24a: %rax.0.reg2mem = alloca i64, !insn.addr !50 %storemerge1.reg2mem = alloca i64, !insn.addr !50 %stack_var_-824 = alloca i64, align 8 %stack_var_-856 = alloca i64, align 8 %stack_var_-8 = alloca i64, align 8 %0 = ptrtoint i64* %stack_var_-8 to i64, !insn.addr !51 %1 = ptrtoint i64* %stack_var_-856 to i64, !insn.addr !52 %2 = call i64 @__readfsqword(i64 40), !insn.addr !53 %3 = add i64 %1, add (i64 ptrtoint ([3 x i8]* @global_var_f to i64), i64 add (i64 sub (i64 0, i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 sub (i64 ptrtoint (i128* @global_var_10 to i64), i64 1), i64 815) to i128), i128 zext (i64 ptrtoint (i128* @global_var_10 to i64) to i128)) to i64) to i128), i128 ptrtoint (i128* @global_var_10 to i128)) to i64)), i64 sub (i64 0, i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 sub (i64 ptrtoint (i128* @global_var_10 to i64), i64 1), i64 415) to i128), i128 zext (i64 ptrtoint (i128* @global_var_10 to i64) to i128)) to i64) to i128), i128 ptrtoint (i128* @global_var_10 to i128)) to i64)))), !insn.addr !54 %4 = and i64 %3, -16, !insn.addr !55 %5 = bitcast i64* %stack_var_-824 to i8*, !insn.addr !56 call void @__asm_rep_stosq_memset(i8* nonnull %5, i64 0, i64 100), !insn.addr !56 store i64 0, i64* %stack_var_-856, align 8 %6 = add i64 %0, -816, !insn.addr !57 store i64 0, i64* %storemerge1.reg2mem br label %dec_label_pc_309 dec_label_pc_309: ; preds = %dec_label_pc_24a, %dec_label_pc_309 %storemerge1.reload = load i64, i64* %storemerge1.reg2mem %7 = mul i64 %storemerge1.reload, 8, !insn.addr !58 %8 = add i64 %7, %4, !insn.addr !59 %9 = add i64 %6, %7, !insn.addr !57 %10 = inttoptr i64 %9 to i64*, !insn.addr !57 %11 = load i64, i64* %10, align 8, !insn.addr !57 %12 = inttoptr i64 %8 to i64*, !insn.addr !60 store i64 %11, i64* %12, align 8, !insn.addr !60 %13 = load i64, i64* %stack_var_-856, align 8, !insn.addr !61 %14 = add i64 %13, 1, !insn.addr !61 store i64 %14, i64* %stack_var_-856, align 8 %15 = icmp ult i64 %14, 100 store i64 %14, i64* %storemerge1.reg2mem, !insn.addr !62 br i1 %15, label %dec_label_pc_309, label %dec_label_pc_346, !insn.addr !62 dec_label_pc_346: ; preds = %dec_label_pc_309 %16 = inttoptr i64 %4 to i64*, !insn.addr !63 %17 = load i64, i64* %16, align 16, !insn.addr !63 %18 = call i64 @printLongLongLine(i64 %17), !insn.addr !64 %19 = call i64 @__readfsqword(i64 40), !insn.addr !65 %20 = icmp eq i64 %2, %19, !insn.addr !65 store i64 0, i64* %rax.0.reg2mem, !insn.addr !66 br i1 %20, label %dec_label_pc_36d, label %dec_label_pc_368, !insn.addr !66 dec_label_pc_368: ; preds = %dec_label_pc_346 %21 = call i64 @__stack_chk_fail(), !insn.addr !67 store i64 %21, i64* %rax.0.reg2mem, !insn.addr !67 br label %dec_label_pc_36d, !insn.addr !67 dec_label_pc_36d: ; preds = %dec_label_pc_368, %dec_label_pc_346 %rax.0.reload = load i64, i64* %rax.0.reg2mem ret i64 %rax.0.reload, !insn.addr !68 } define i64 @CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_loop_15_good() local_unnamed_addr { dec_label_pc_36f: %0 = call i64 @goodG2B1(), !insn.addr !69 %1 = call i64 @goodG2B2(), !insn.addr !70 ret i64 %1, !insn.addr !71 } declare i64 @printLongLongLine(i64) local_unnamed_addr declare i64 @__stack_chk_fail() local_unnamed_addr declare void @__asm_rep_stosq_memset(i8*, i64, i64) local_unnamed_addr declare i64 @__readfsqword(i64) local_unnamed_addr !0 = !{i64 11} !1 = !{i64 31} !2 = !{i64 49} !3 = !{i64 54} !4 = !{i64 58} !5 = !{i64 64} !6 = !{i64 68} !7 = !{i64 76} !8 = !{i64 121} !9 = !{i64 125} !10 = !{i64 133} !11 = !{i64 140} !12 = !{i64 147} !13 = !{i64 155} !14 = !{i64 175} !15 = !{i64 178} !16 = !{i64 198} !17 = !{i64 206} !18 = !{i64 213} !19 = !{i64 223} !20 = !{i64 231} !21 = !{i64 234} !22 = !{i64 250} !23 = !{i64 252} !24 = !{i64 259} !25 = !{i64 265} !26 = !{i64 271} !27 = !{i64 275} !28 = !{i64 284} !29 = !{i64 286} !30 = !{i64 292} !31 = !{i64 293} !32 = !{i64 294} !33 = !{i64 297} !34 = !{i64 304} !35 = !{i64 414} !36 = !{i64 418} !37 = !{i64 468} !38 = !{i64 516} !39 = !{i64 491} !40 = !{i64 506} !41 = !{i64 524} !42 = !{i64 527} !43 = !{i64 543} !44 = !{i64 552} !45 = !{i64 558} !46 = !{i64 568} !47 = !{i64 577} !48 = !{i64 579} !49 = !{i64 585} !50 = !{i64 586} !51 = !{i64 587} !52 = !{i64 590} !53 = !{i64 597} !54 = !{i64 707} !55 = !{i64 711} !56 = !{i64 761} !57 = !{i64 809} !58 = !{i64 784} !59 = !{i64 799} !60 = !{i64 817} !61 = !{i64 820} !62 = !{i64 836} !63 = !{i64 845} !64 = !{i64 851} !65 = !{i64 861} !66 = !{i64 870} !67 = !{i64 872} !68 = !{i64 878} !69 = !{i64 888} !70 = !{i64 898} !71 = !{i64 905} ### Assistant: ; Function Attrs: noinline nounwind optnone uwtable define dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_loop_15_bad() #0 { entry: %data = alloca i64*, align 8 %dataBadBuffer = alloca i64*, align 8 %dataGoodBuffer = alloca i64*, align 8 %source = alloca [100 x i64], align 16 %i = alloca i64, align 8 %0 = alloca i8, i64 400, align 16 %1 = bitcast i8* %0 to i64* store i64* %1, i64** %dataBadBuffer, align 8 %2 = alloca i8, i64 800, align 16 %3 = bitcast i8* %2 to i64* store i64* %3, i64** %dataGoodBuffer, align 8 %4 = load i64*, i64** %dataBadBuffer, align 8 store i64* %4, i64** %data, align 8 %5 = bitcast [100 x i64]* %source to i8* call void @llvm.memset.p0i8.i64(i8* align 16 %5, i8 0, i64 800, i1 false) store i64 0, i64* %i, align 8 br label %for.cond for.cond: ; preds = %for.inc, %entry %6 = load i64, i64* %i, align 8 %cmp = icmp ult i64 %6, 100 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond %7 = load i64, i64* %i, align 8 %arrayidx = getelementptr inbounds [100 x i64], [100 x i64]* %source, i64 0, i64 %7 %8 = load i64, i64* %arrayidx, align 8 %9 = load i64*, i64** %data, align 8 %10 = load i64, i64* %i, align 8 %arrayidx1 = getelementptr inbounds i64, i64* %9, i64 %10 store i64 %8, i64* %arrayidx1, align 8 br label %for.inc for.inc: ; preds = %for.body %11 = load i64, i64* %i, align 8 %inc = add i64 %11, 1 store i64 %inc, i64* %i, align 8 br label %for.cond for.end: ; preds = %for.cond %12 = load i64*, i64** %data, align 8 %arrayidx2 = getelementptr inbounds i64, i64* %12, i64 0 %13 = load i64, i64* %arrayidx2, align 8 call void @printLongLongLine(i64 %13) ret void } ; Function Attrs: argmemonly nounwind willreturn writeonly declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #1 declare dso_local void @printLongLongLine(i64) #2 ; Function Attrs: noinline nounwind optnone uwtable define dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE805_int64_t_alloca_loop_15_good() #0 { entry: call void @goodG2B1() call void @goodG2B2() ret void } ; Function Attrs: noinline nounwind optnone uwtable define internal void @goodG2B1() #0 { entry: %data = alloca i64*, align 8 %dataBadBuffer = alloca i64*, align 8 %dataGoodBuffer = alloca i64*, align 8 %source = alloca [100 x i64], align 16 %i = alloca i64, align 8 %0 = alloca i8, i64 400, align 16 %1 = bitcast i8* %0 to i64* store i64* %1, i64** %dataBadBuffer, align 8 %2 = alloca i8, i64 800, align 16 %3 = bitcast i8* %2 to i64* store i64* %3, i64** %dataGoodBuffer, align 8 %4 = load i64*, i64** %dataGoodBuffer, align 8 store i64* %4, i64** %data, align 8 %5 = bitcast [100 x i64]* %source to i8* call void @llvm.memset.p0i8.i64(i8* align 16 %5, i8 0, i64 800, i1 false) store i64 0, i64* %i, align 8 br label %for.cond for.cond: ; preds = %for.inc, %entry %6 = load i64, i64* %i, align 8 %cmp = icmp ult i64 %6, 100 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond %7 = load i64, i64* %i, align 8 %arrayidx = getelementptr inbounds [100 x i64], [100 x i64]* %source, i64 0, i64 %7 %8 = load i64, i64* %arrayidx, align 8 %9 = load i64*, i64** %data, align 8 %10 = load i64, i64* %i, align 8 %arrayidx1 = getelementptr inbounds i64, i64* %9, i64 %10 store i64 %8, i64* %arrayidx1, align 8 br label %for.inc for.inc: ; preds = %for.body %11 = load i64, i64* %i, align 8 %inc = add i64 %11, 1 store i64 %inc, i64* %i, align 8 br label %for.cond for.end: ; preds = %for.cond %12 = load i64*, i64** %data, align 8 %arrayidx2 = getelementptr inbounds i64, i64* %12, i64 0 %13 = load i64, i64* %arrayidx2, align 8 call void @printLongLongLine(i64 %13) ret void } ; Function Attrs: noinline nounwind optnone uwtable define internal void @goodG2B2() #0 { entry: %data = alloca i64*, align 8 %dataBadBuffer = alloca i64*, align 8 %dataGoodBuffer = alloca i64*, align 8 %source = alloca [100 x i64], align 16 %i = alloca i64, align 8 %0 = alloca i8, i64 400, align 16 %1 = bitcast i8* %0 to i64* store i64* %1, i64** %dataBadBuffer, align 8 %2 = alloca i8, i64 800, align 16 %3 = bitcast i8* %2 to i64* store i64* %3, i64** %dataGoodBuffer, align 8 %4 = load i64*, i64** %dataGoodBuffer, align 8 store i64* %4, i64** %data, align 8 %5 = bitcast [100 x i64]* %source to i8* call void @llvm.memset.p0i8.i64(i8* align 16 %5, i8 0, i64 800, i1 false) store i64 0, i64* %i, align 8 br label %for.cond for.cond: ; preds = %for.inc, %entry %6 = load i64, i64* %i, align 8 %cmp = icmp ult i64 %6, 100 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond %7 = load i64, i64* %i, align 8 %arrayidx = getelementptr inbounds [100 x i64], [100 x i64]* %source, i64 0, i64 %7 %8 = load i64, i64* %arrayidx, align 8 %9 = load i64*, i64** %data, align 8 %10 = load i64, i64* %i, align 8 %arrayidx1 = getelementptr inbounds i64, i64* %9, i64 %10 store i64 %8, i64* %arrayidx1, align 8 br label %for.inc for.inc: ; preds = %for.body %11 = load i64, i64* %i, align 8 %inc = add i64 %11, 1 store i64 %inc, i64* %i, align 8 br label %for.cond for.end: ; preds = %for.cond %12 = load i64*, i64** %data, align 8 %arrayidx2 = getelementptr inbounds i64, i64* %12, i64 0 %13 = load i64, i64* %arrayidx2, align 8 call void @printLongLongLine(i64 %13) ret void } attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } attributes #1 = { argmemonly nounwind willreturn writeonly } attributes #2 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } !llvm.module.flags = !{!0} !llvm.ident = !{!1} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{!"clang version 11.1.0"}
### Human: Refine the following lifted llvm ir, target datalayout = "e-m:e-p:64:64-i64:64-f80:128-n8:16:32:64-S128" @global_var_f = constant [3 x i8] c"%(\00" @global_var_10 = external constant i128 define i64 @_GLOBAL_OFFSET_TABLE_.1() local_unnamed_addr { dec_label_pc_0: %0 = call i64 @__readfsqword(i64 40), !insn.addr !0 ret i64 add (i64 sub (i64 ptrtoint (i128* @global_var_10 to i64), i64 1), i64 65), !insn.addr !1 } define i64 @function_30(i64 %arg1, i64 %arg2, i64 %arg3, i64 %arg4) local_unnamed_addr { dec_label_pc_30: %0 = alloca i64 %rax.0.reg2mem = alloca i64, !insn.addr !2 %1 = load i64, i64* %0 %2 = load i64, i64* %0 %3 = load i64, i64* %0 %4 = add i64 %3, -9, !insn.addr !2 %5 = inttoptr i64 %4 to i8*, !insn.addr !2 %6 = load i8, i8* %5, align 1, !insn.addr !2 %7 = trunc i64 %arg4 to i8, !insn.addr !2 %8 = add i8 %6, %7, !insn.addr !2 store i8 %8, i8* %5, align 1, !insn.addr !2 %9 = call i64 @__asm_int1(), !insn.addr !3 %10 = mul i64 %9, ptrtoint (i128* @global_var_10 to i64), !insn.addr !4 %11 = sub i64 %2, %10, !insn.addr !5 %12 = add i64 %11, ptrtoint ([3 x i8]* @global_var_f to i64), !insn.addr !6 %13 = and i64 %12, -16, !insn.addr !7 %14 = add i64 %1, -136, !insn.addr !8 %15 = inttoptr i64 %14 to i64*, !insn.addr !8 store i64 %13, i64* %15, align 8, !insn.addr !8 %16 = add i64 %11, add (i64 ptrtoint ([3 x i8]* @global_var_f to i64), i64 sub (i64 0, i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 sub (i64 ptrtoint (i128* @global_var_10 to i64), i64 1), i64 115) to i128), i128 zext (i64 ptrtoint (i128* @global_var_10 to i64) to i128)) to i64) to i128), i128 ptrtoint (i128* @global_var_10 to i128)) to i64))), !insn.addr !9 %17 = and i64 %16, -16, !insn.addr !10 %18 = add i64 %1, -128, !insn.addr !11 %19 = inttoptr i64 %18 to i64*, !insn.addr !11 store i64 %17, i64* %19, align 8, !insn.addr !11 %20 = load i64, i64* %15, align 8, !insn.addr !12 %21 = add i64 %1, -120, !insn.addr !13 %22 = inttoptr i64 %21 to i64*, !insn.addr !13 store i64 %20, i64* %22, align 8, !insn.addr !13 %23 = inttoptr i64 %20 to i8*, !insn.addr !14 store i8 0, i8* %23, align 1, !insn.addr !14 %24 = add i64 %1, -112, !insn.addr !15 %25 = call i64 @memset(i64 %24, i64 67, i64 99, i64 %arg4), !insn.addr !16 %26 = add i64 %1, -13, !insn.addr !17 %27 = inttoptr i64 %26 to i8*, !insn.addr !17 store i8 0, i8* %27, align 1, !insn.addr !17 %28 = load i64, i64* %22, align 8, !insn.addr !18 %29 = call i64 @memmove(i64 %28, i64 %24, i64 100, i64 %24), !insn.addr !19 %30 = load i64, i64* %22, align 8, !insn.addr !20 %31 = add i64 %30, 99, !insn.addr !21 %32 = inttoptr i64 %31 to i8*, !insn.addr !22 store i8 0, i8* %32, align 1, !insn.addr !22 %33 = load i64, i64* %22, align 8, !insn.addr !23 %34 = call i64 @printLine(i64 %33), !insn.addr !24 %35 = add i64 %1, -8, !insn.addr !25 %36 = inttoptr i64 %35 to i64*, !insn.addr !25 %37 = load i64, i64* %36, align 8, !insn.addr !25 %38 = call i64 @__readfsqword(i64 40), !insn.addr !26 %39 = icmp eq i64 %37, %38, !insn.addr !26 store i64 0, i64* %rax.0.reg2mem, !insn.addr !27 br i1 %39, label %dec_label_pc_f6, label %dec_label_pc_f1, !insn.addr !27 dec_label_pc_f1: ; preds = %dec_label_pc_30 %40 = call i64 @__stack_chk_fail(), !insn.addr !28 store i64 %40, i64* %rax.0.reg2mem, !insn.addr !28 br label %dec_label_pc_f6, !insn.addr !28 dec_label_pc_f6: ; preds = %dec_label_pc_f1, %dec_label_pc_30 %rax.0.reload = load i64, i64* %rax.0.reg2mem ret i64 %rax.0.reload, !insn.addr !29 } define i64 @goodG2B() local_unnamed_addr { dec_label_pc_f8: %rax.0.reg2mem = alloca i64, !insn.addr !30 %stack_var_-120 = alloca i64, align 8 %stack_var_-152 = alloca i64, align 8 %0 = ptrtoint i64* %stack_var_-152 to i64, !insn.addr !31 %1 = call i64 @__readfsqword(i64 40), !insn.addr !32 %2 = add i64 %0, add (i64 ptrtoint ([3 x i8]* @global_var_f to i64), i64 add (i64 sub (i64 0, i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 sub (i64 ptrtoint (i128* @global_var_10 to i64), i64 1), i64 115) to i128), i128 zext (i64 ptrtoint (i128* @global_var_10 to i64) to i128)) to i64) to i128), i128 ptrtoint (i128* @global_var_10 to i128)) to i64)), i64 sub (i64 0, i64 trunc (i128 mul (i128 sext (i64 trunc (i128 udiv (i128 zext (i64 add (i64 sub (i64 ptrtoint (i128* @global_var_10 to i64), i64 1), i64 65) to i128), i128 zext (i64 ptrtoint (i128* @global_var_10 to i64) to i128)) to i64) to i128), i128 ptrtoint (i128* @global_var_10 to i128)) to i64)))), !insn.addr !33 %3 = and i64 %2, -16, !insn.addr !34 %4 = inttoptr i64 %3 to i8*, !insn.addr !35 store i8 0, i8* %4, align 16, !insn.addr !35 %5 = ptrtoint i64* %stack_var_-120 to i64, !insn.addr !36 %6 = call i64 @memset(i64 %5, i64 67, i64 99, i64 ptrtoint (i128* @global_var_10 to i64)), !insn.addr !37 %7 = call i64 @memmove(i64 %3, i64 %5, i64 100, i64 %5), !insn.addr !38 %8 = add i64 %3, 99, !insn.addr !39 %9 = inttoptr i64 %8 to i8*, !insn.addr !40 store i8 0, i8* %9, align 1, !insn.addr !40 %10 = call i64 @printLine(i64 %3), !insn.addr !41 %11 = call i64 @__readfsqword(i64 40), !insn.addr !42 %12 = icmp eq i64 %1, %11, !insn.addr !42 store i64 0, i64* %rax.0.reg2mem, !insn.addr !43 br i1 %12, label %dec_label_pc_1eb, label %dec_label_pc_1e6, !insn.addr !43 dec_label_pc_1e6: ; preds = %dec_label_pc_f8 %13 = call i64 @__stack_chk_fail(), !insn.addr !44 store i64 %13, i64* %rax.0.reg2mem, !insn.addr !44 br label %dec_label_pc_1eb, !insn.addr !44 dec_label_pc_1eb: ; preds = %dec_label_pc_1e6, %dec_label_pc_f8 %rax.0.reload = load i64, i64* %rax.0.reg2mem ret i64 %rax.0.reload, !insn.addr !45 } define i64 @CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_memmove_18_good() local_unnamed_addr { dec_label_pc_1ed: %0 = call i64 @goodG2B(), !insn.addr !46 ret i64 %0, !insn.addr !47 } declare i64 @memset(i64, i64, i64, i64) local_unnamed_addr declare i64 @memmove(i64, i64, i64, i64) local_unnamed_addr declare i64 @printLine(i64) local_unnamed_addr declare i64 @__stack_chk_fail() local_unnamed_addr declare i64 @__asm_int1() local_unnamed_addr declare i64 @__readfsqword(i64) local_unnamed_addr !0 = !{i64 11} !1 = !{i64 35} !2 = !{i64 48} !3 = !{i64 51} !4 = !{i64 52} !5 = !{i64 56} !6 = !{i64 62} !7 = !{i64 66} !8 = !{i64 74} !9 = !{i64 117} !10 = !{i64 121} !11 = !{i64 129} !12 = !{i64 134} !13 = !{i64 141} !14 = !{i64 149} !15 = !{i64 152} !16 = !{i64 169} !17 = !{i64 174} !18 = !{i64 182} !19 = !{i64 197} !20 = !{i64 202} !21 = !{i64 206} !22 = !{i64 210} !23 = !{i64 213} !24 = !{i64 220} !25 = !{i64 226} !26 = !{i64 230} !27 = !{i64 239} !28 = !{i64 241} !29 = !{i64 247} !30 = !{i64 248} !31 = !{i64 252} !32 = !{i64 259} !33 = !{i64 365} !34 = !{i64 369} !35 = !{i64 394} !36 = !{i64 411} !37 = !{i64 414} !38 = !{i64 442} !39 = !{i64 451} !40 = !{i64 455} !41 = !{i64 465} !42 = !{i64 475} !43 = !{i64 484} !44 = !{i64 486} !45 = !{i64 492} !46 = !{i64 502} !47 = !{i64 509} ### Assistant: ; Function Attrs: noinline nounwind optnone uwtable define dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_memmove_18_bad() #0 { entry: %data = alloca i8*, align 8 %dataBadBuffer = alloca i8*, align 8 %dataGoodBuffer = alloca i8*, align 8 %source1 = alloca [100 x i8], align 16 %0 = alloca i8, i64 50, align 16 store i8* %0, i8** %dataBadBuffer, align 8 %1 = alloca i8, i64 100, align 16 store i8* %1, i8** %dataGoodBuffer, align 8 br label %source source: ; preds = %entry %2 = load i8*, i8** %dataBadBuffer, align 8 store i8* %2, i8** %data, align 8 %3 = load i8*, i8** %data, align 8 %arrayidx = getelementptr inbounds i8, i8* %3, i64 0 store i8 0, i8* %arrayidx, align 1 %arraydecay = getelementptr inbounds [100 x i8], [100 x i8]* %source1, i64 0, i64 0 call void @llvm.memset.p0i8.i64(i8* align 16 %arraydecay, i8 67, i64 99, i1 false) %arrayidx2 = getelementptr inbounds [100 x i8], [100 x i8]* %source1, i64 0, i64 99 store i8 0, i8* %arrayidx2, align 1 %4 = load i8*, i8** %data, align 8 %arraydecay3 = getelementptr inbounds [100 x i8], [100 x i8]* %source1, i64 0, i64 0 call void @llvm.memmove.p0i8.p0i8.i64(i8* align 1 %4, i8* align 16 %arraydecay3, i64 100, i1 false) %5 = load i8*, i8** %data, align 8 %arrayidx4 = getelementptr inbounds i8, i8* %5, i64 99 store i8 0, i8* %arrayidx4, align 1 %6 = load i8*, i8** %data, align 8 call void @printLine(i8* %6) ret void } ; Function Attrs: argmemonly nounwind willreturn writeonly declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #1 ; Function Attrs: argmemonly nounwind willreturn declare void @llvm.memmove.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i1 immarg) #2 declare dso_local void @printLine(i8*) #3 ; Function Attrs: noinline nounwind optnone uwtable define dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE805_char_alloca_memmove_18_good() #0 { entry: call void @goodG2B() ret void } ; Function Attrs: noinline nounwind optnone uwtable define internal void @goodG2B() #0 { entry: %data = alloca i8*, align 8 %dataBadBuffer = alloca i8*, align 8 %dataGoodBuffer = alloca i8*, align 8 %source1 = alloca [100 x i8], align 16 %0 = alloca i8, i64 50, align 16 store i8* %0, i8** %dataBadBuffer, align 8 %1 = alloca i8, i64 100, align 16 store i8* %1, i8** %dataGoodBuffer, align 8 br label %source source: ; preds = %entry %2 = load i8*, i8** %dataGoodBuffer, align 8 store i8* %2, i8** %data, align 8 %3 = load i8*, i8** %data, align 8 %arrayidx = getelementptr inbounds i8, i8* %3, i64 0 store i8 0, i8* %arrayidx, align 1 %arraydecay = getelementptr inbounds [100 x i8], [100 x i8]* %source1, i64 0, i64 0 call void @llvm.memset.p0i8.i64(i8* align 16 %arraydecay, i8 67, i64 99, i1 false) %arrayidx2 = getelementptr inbounds [100 x i8], [100 x i8]* %source1, i64 0, i64 99 store i8 0, i8* %arrayidx2, align 1 %4 = load i8*, i8** %data, align 8 %arraydecay3 = getelementptr inbounds [100 x i8], [100 x i8]* %source1, i64 0, i64 0 call void @llvm.memmove.p0i8.p0i8.i64(i8* align 1 %4, i8* align 16 %arraydecay3, i64 100, i1 false) %5 = load i8*, i8** %data, align 8 %arrayidx4 = getelementptr inbounds i8, i8* %5, i64 99 store i8 0, i8* %arrayidx4, align 1 %6 = load i8*, i8** %data, align 8 call void @printLine(i8* %6) ret void } attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } attributes #1 = { argmemonly nounwind willreturn writeonly } attributes #2 = { argmemonly nounwind willreturn } attributes #3 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } !llvm.module.flags = !{!0} !llvm.ident = !{!1} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{!"clang version 11.1.0"}
### Human: Refine the following lifted llvm ir, target datalayout = "e-m:e-p:64:64-i64:64-f80:128-n8:16:32:64-S128" define i64 @_GLOBAL_OFFSET_TABLE_.1(i64 %arg1) local_unnamed_addr { dec_label_pc_0: %0 = call i64 @CWE121_Stack_Based_Buffer_Overflow__CWE131_memcpy_54c_badSink(i64 %arg1), !insn.addr !0 ret i64 %0, !insn.addr !1 } define i64 @CWE121_Stack_Based_Buffer_Overflow__CWE131_memcpy_54b_goodG2BSink(i64 %arg1) local_unnamed_addr { dec_label_pc_1b: %0 = call i64 @CWE121_Stack_Based_Buffer_Overflow__CWE131_memcpy_54c_goodG2BSink(i64 %arg1), !insn.addr !2 ret i64 %0, !insn.addr !3 } declare i64 @CWE121_Stack_Based_Buffer_Overflow__CWE131_memcpy_54c_badSink(i64) local_unnamed_addr declare i64 @CWE121_Stack_Based_Buffer_Overflow__CWE131_memcpy_54c_goodG2BSink(i64) local_unnamed_addr !0 = !{i64 19} !1 = !{i64 26} !2 = !{i64 46} !3 = !{i64 53} ### Assistant: ; Function Attrs: noinline nounwind optnone uwtable define dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE131_memcpy_54b_badSink(i32* %data) #0 { entry: %data.addr = alloca i32*, align 8 store i32* %data, i32** %data.addr, align 8 %0 = load i32*, i32** %data.addr, align 8 call void @CWE121_Stack_Based_Buffer_Overflow__CWE131_memcpy_54c_badSink(i32* %0) ret void } declare dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE131_memcpy_54c_badSink(i32*) #1 ; Function Attrs: noinline nounwind optnone uwtable define dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE131_memcpy_54b_goodG2BSink(i32* %data) #0 { entry: %data.addr = alloca i32*, align 8 store i32* %data, i32** %data.addr, align 8 %0 = load i32*, i32** %data.addr, align 8 call void @CWE121_Stack_Based_Buffer_Overflow__CWE131_memcpy_54c_goodG2BSink(i32* %0) ret void } declare dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE131_memcpy_54c_goodG2BSink(i32*) #1 attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } !llvm.module.flags = !{!0} !llvm.ident = !{!1} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{!"clang version 11.1.0"}
### Human: Refine the following lifted llvm ir, target datalayout = "e-m:e-p:64:64-i64:64-f80:128-n8:16:32:64-S128" define i64 @_GLOBAL_OFFSET_TABLE_.1(i64 %arg1) local_unnamed_addr { dec_label_pc_0: %0 = call i64 @CWE121_Stack_Based_Buffer_Overflow__CWE805_int_declare_loop_53c_badSink(i64 %arg1), !insn.addr !0 ret i64 %0, !insn.addr !1 } define i64 @CWE121_Stack_Based_Buffer_Overflow__CWE805_int_declare_loop_53b_goodG2BSink(i64 %arg1) local_unnamed_addr { dec_label_pc_1b: %0 = call i64 @CWE121_Stack_Based_Buffer_Overflow__CWE805_int_declare_loop_53c_goodG2BSink(i64 %arg1), !insn.addr !2 ret i64 %0, !insn.addr !3 } declare i64 @CWE121_Stack_Based_Buffer_Overflow__CWE805_int_declare_loop_53c_badSink(i64) local_unnamed_addr declare i64 @CWE121_Stack_Based_Buffer_Overflow__CWE805_int_declare_loop_53c_goodG2BSink(i64) local_unnamed_addr !0 = !{i64 19} !1 = !{i64 26} !2 = !{i64 46} !3 = !{i64 53} ### Assistant: ; Function Attrs: noinline nounwind optnone uwtable define dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE805_int_declare_loop_53b_badSink(i32* %data) #0 { entry: %data.addr = alloca i32*, align 8 store i32* %data, i32** %data.addr, align 8 %0 = load i32*, i32** %data.addr, align 8 call void @CWE121_Stack_Based_Buffer_Overflow__CWE805_int_declare_loop_53c_badSink(i32* %0) ret void } declare dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE805_int_declare_loop_53c_badSink(i32*) #1 ; Function Attrs: noinline nounwind optnone uwtable define dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE805_int_declare_loop_53b_goodG2BSink(i32* %data) #0 { entry: %data.addr = alloca i32*, align 8 store i32* %data, i32** %data.addr, align 8 %0 = load i32*, i32** %data.addr, align 8 call void @CWE121_Stack_Based_Buffer_Overflow__CWE805_int_declare_loop_53c_goodG2BSink(i32* %0) ret void } declare dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE805_int_declare_loop_53c_goodG2BSink(i32*) #1 attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } !llvm.module.flags = !{!0} !llvm.ident = !{!1} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{!"clang version 11.1.0"}
### Human: Refine the following lifted llvm ir, target datalayout = "e-m:e-p:64:64-i64:64-f80:128-n8:16:32:64-S128" @global_var_278 = local_unnamed_addr constant [11 x i32] %wide-string @global_var_280 = local_unnamed_addr constant [9 x i32] %wide-string @global_var_288 = local_unnamed_addr constant [7 x i32] %wide-string @global_var_290 = local_unnamed_addr constant [5 x i32] %wide-string @global_var_298 = local_unnamed_addr constant [3 x i32] %wide-string @global_var_2a0 = local_unnamed_addr constant i64 7597120955562852352 @global_var_2a4 = local_unnamed_addr constant [21 x i8] c"Benign, fixed string\00" define i64 @_GLOBAL_OFFSET_TABLE_.1() local_unnamed_addr { dec_label_pc_0: %stack_var_-120 = alloca i64, align 8 %0 = call i64 @__readfsqword(i64 40), !insn.addr !0 %1 = ptrtoint i64* %stack_var_-120 to i64, !insn.addr !1 ret i64 %1, !insn.addr !2 } define i64 @goodG2B1() local_unnamed_addr { dec_label_pc_c0: %rax.0.reg2mem = alloca i64, !insn.addr !3 %stack_var_-72 = alloca i32*, align 8 %stack_var_-120 = alloca i64, align 8 %0 = call i64 @__readfsqword(i64 40), !insn.addr !4 %1 = ptrtoint i64* %stack_var_-120 to i64, !insn.addr !5 %2 = bitcast i64* %stack_var_-120 to i32*, !insn.addr !6 store i32 0, i32* %2, align 8, !insn.addr !6 store i32* inttoptr (i64 279172874305 to i32*), i32** %stack_var_-72, align 8, !insn.addr !7 %3 = bitcast i32** %stack_var_-72 to i64*, !insn.addr !8 %4 = call i64 @wcslen(i64* nonnull %3), !insn.addr !8 %5 = mul i64 %4, 4, !insn.addr !9 %6 = add i64 %5, 4, !insn.addr !10 %7 = call i64 @memmove(i64 %1, i64* nonnull %3, i64 %6, i64* nonnull %3), !insn.addr !11 %8 = call i64 @printWLine(i64 %1), !insn.addr !12 %9 = call i64 @__readfsqword(i64 40), !insn.addr !13 %10 = icmp eq i64 %0, %9, !insn.addr !13 store i64 0, i64* %rax.0.reg2mem, !insn.addr !14 br i1 %10, label %dec_label_pc_18c, label %dec_label_pc_187, !insn.addr !14 dec_label_pc_187: ; preds = %dec_label_pc_c0 %11 = call i64 @__stack_chk_fail(), !insn.addr !15 store i64 %11, i64* %rax.0.reg2mem, !insn.addr !15 br label %dec_label_pc_18c, !insn.addr !15 dec_label_pc_18c: ; preds = %dec_label_pc_187, %dec_label_pc_c0 %rax.0.reload = load i64, i64* %rax.0.reg2mem ret i64 %rax.0.reload, !insn.addr !16 } define i64 @goodG2B2() local_unnamed_addr { dec_label_pc_18e: %rax.0.reg2mem = alloca i64, !insn.addr !17 %stack_var_-72 = alloca i32*, align 8 %stack_var_-120 = alloca i64, align 8 %0 = call i64 @__readfsqword(i64 40), !insn.addr !18 %1 = ptrtoint i64* %stack_var_-120 to i64, !insn.addr !19 %2 = bitcast i64* %stack_var_-120 to i32*, !insn.addr !20 store i32 0, i32* %2, align 8, !insn.addr !20 store i32* inttoptr (i64 279172874305 to i32*), i32** %stack_var_-72, align 8, !insn.addr !21 %3 = bitcast i32** %stack_var_-72 to i64*, !insn.addr !22 %4 = call i64 @wcslen(i64* nonnull %3), !insn.addr !22 %5 = mul i64 %4, 4, !insn.addr !23 %6 = add i64 %5, 4, !insn.addr !24 %7 = call i64 @memmove(i64 %1, i64* nonnull %3, i64 %6, i64* nonnull %3), !insn.addr !25 %8 = call i64 @printWLine(i64 %1), !insn.addr !26 %9 = call i64 @__readfsqword(i64 40), !insn.addr !27 %10 = icmp eq i64 %0, %9, !insn.addr !27 store i64 0, i64* %rax.0.reg2mem, !insn.addr !28 br i1 %10, label %dec_label_pc_24c, label %dec_label_pc_247, !insn.addr !28 dec_label_pc_247: ; preds = %dec_label_pc_18e %11 = call i64 @__stack_chk_fail(), !insn.addr !29 store i64 %11, i64* %rax.0.reg2mem, !insn.addr !29 br label %dec_label_pc_24c, !insn.addr !29 dec_label_pc_24c: ; preds = %dec_label_pc_247, %dec_label_pc_18e %rax.0.reload = load i64, i64* %rax.0.reg2mem ret i64 %rax.0.reload, !insn.addr !30 } define i64 @CWE121_Stack_Based_Buffer_Overflow__CWE193_wchar_t_declare_memmove_04_good() local_unnamed_addr { dec_label_pc_24e: %0 = call i64 @goodG2B1(), !insn.addr !31 %1 = call i64 @goodG2B2(), !insn.addr !32 ret i64 %1, !insn.addr !33 } declare i64 @wcslen(i64*) local_unnamed_addr declare i64 @memmove(i64, i64*, i64, i64*) local_unnamed_addr declare i64 @printWLine(i64) local_unnamed_addr declare i64 @__stack_chk_fail() local_unnamed_addr declare i64 @__readfsqword(i64) local_unnamed_addr !0 = !{i64 8} !1 = !{i64 32} !2 = !{i64 36} !3 = !{i64 192} !4 = !{i64 200} !5 = !{i64 242} !6 = !{i64 250} !7 = !{i64 270} !8 = !{i64 327} !9 = !{i64 332} !10 = !{i64 336} !11 = !{i64 358} !12 = !{i64 370} !13 = !{i64 380} !14 = !{i64 389} !15 = !{i64 391} !16 = !{i64 397} !17 = !{i64 398} !18 = !{i64 406} !19 = !{i64 434} !20 = !{i64 442} !21 = !{i64 462} !22 = !{i64 519} !23 = !{i64 524} !24 = !{i64 528} !25 = !{i64 550} !26 = !{i64 562} !27 = !{i64 572} !28 = !{i64 581} !29 = !{i64 583} !30 = !{i64 589} !31 = !{i64 599} !32 = !{i64 609} !33 = !{i64 616} ### Assistant: @__const.CWE121_Stack_Based_Buffer_Overflow__CWE193_wchar_t_declare_memmove_04_bad.source = private unnamed_addr constant [11 x i32] [i32 65, i32 65, i32 65, i32 65, i32 65, i32 65, i32 65, i32 65, i32 65, i32 65, i32 0], align 16 @__const.goodG2B1.source = private unnamed_addr constant [11 x i32] [i32 65, i32 65, i32 65, i32 65, i32 65, i32 65, i32 65, i32 65, i32 65, i32 65, i32 0], align 16 @__const.goodG2B2.source = private unnamed_addr constant [11 x i32] [i32 65, i32 65, i32 65, i32 65, i32 65, i32 65, i32 65, i32 65, i32 65, i32 65, i32 0], align 16 ; Function Attrs: noinline nounwind optnone uwtable define dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE193_wchar_t_declare_memmove_04_bad() #0 { entry: %data = alloca i32*, align 8 %dataBadBuffer = alloca [10 x i32], align 16 %dataGoodBuffer = alloca [11 x i32], align 16 %source = alloca [11 x i32], align 16 %arraydecay = getelementptr inbounds [10 x i32], [10 x i32]* %dataBadBuffer, i64 0, i64 0 store i32* %arraydecay, i32** %data, align 8 %0 = load i32*, i32** %data, align 8 %arrayidx = getelementptr inbounds i32, i32* %0, i64 0 store i32 0, i32* %arrayidx, align 4 %1 = bitcast [11 x i32]* %source to i8* call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 16 %1, i8* align 16 bitcast ([11 x i32]* @__const.CWE121_Stack_Based_Buffer_Overflow__CWE193_wchar_t_declare_memmove_04_bad.source to i8*), i64 44, i1 false) %2 = load i32*, i32** %data, align 8 %3 = bitcast i32* %2 to i8* %arraydecay1 = getelementptr inbounds [11 x i32], [11 x i32]* %source, i64 0, i64 0 %4 = bitcast i32* %arraydecay1 to i8* %arraydecay2 = getelementptr inbounds [11 x i32], [11 x i32]* %source, i64 0, i64 0 %call = call i64 @wcslen(i32* %arraydecay2) #4 %add = add i64 %call, 1 %mul = mul i64 %add, 4 call void @llvm.memmove.p0i8.p0i8.i64(i8* align 4 %3, i8* align 16 %4, i64 %mul, i1 false) %5 = load i32*, i32** %data, align 8 call void @printWLine(i32* %5) ret void } ; Function Attrs: argmemonly nounwind willreturn declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1 ; Function Attrs: nounwind readonly declare dso_local i64 @wcslen(i32*) #2 ; Function Attrs: argmemonly nounwind willreturn declare void @llvm.memmove.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i1 immarg) #1 declare dso_local void @printWLine(i32*) #3 ; Function Attrs: noinline nounwind optnone uwtable define dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE193_wchar_t_declare_memmove_04_good() #0 { entry: call void @goodG2B1() call void @goodG2B2() ret void } ; Function Attrs: noinline nounwind optnone uwtable define internal void @goodG2B1() #0 { entry: %data = alloca i32*, align 8 %dataBadBuffer = alloca [10 x i32], align 16 %dataGoodBuffer = alloca [11 x i32], align 16 %source = alloca [11 x i32], align 16 %arraydecay = getelementptr inbounds [11 x i32], [11 x i32]* %dataGoodBuffer, i64 0, i64 0 store i32* %arraydecay, i32** %data, align 8 %0 = load i32*, i32** %data, align 8 %arrayidx = getelementptr inbounds i32, i32* %0, i64 0 store i32 0, i32* %arrayidx, align 4 %1 = bitcast [11 x i32]* %source to i8* call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 16 %1, i8* align 16 bitcast ([11 x i32]* @__const.goodG2B1.source to i8*), i64 44, i1 false) %2 = load i32*, i32** %data, align 8 %3 = bitcast i32* %2 to i8* %arraydecay1 = getelementptr inbounds [11 x i32], [11 x i32]* %source, i64 0, i64 0 %4 = bitcast i32* %arraydecay1 to i8* %arraydecay2 = getelementptr inbounds [11 x i32], [11 x i32]* %source, i64 0, i64 0 %call = call i64 @wcslen(i32* %arraydecay2) #4 %add = add i64 %call, 1 %mul = mul i64 %add, 4 call void @llvm.memmove.p0i8.p0i8.i64(i8* align 4 %3, i8* align 16 %4, i64 %mul, i1 false) %5 = load i32*, i32** %data, align 8 call void @printWLine(i32* %5) ret void } ; Function Attrs: noinline nounwind optnone uwtable define internal void @goodG2B2() #0 { entry: %data = alloca i32*, align 8 %dataBadBuffer = alloca [10 x i32], align 16 %dataGoodBuffer = alloca [11 x i32], align 16 %source = alloca [11 x i32], align 16 %arraydecay = getelementptr inbounds [11 x i32], [11 x i32]* %dataGoodBuffer, i64 0, i64 0 store i32* %arraydecay, i32** %data, align 8 %0 = load i32*, i32** %data, align 8 %arrayidx = getelementptr inbounds i32, i32* %0, i64 0 store i32 0, i32* %arrayidx, align 4 %1 = bitcast [11 x i32]* %source to i8* call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 16 %1, i8* align 16 bitcast ([11 x i32]* @__const.goodG2B2.source to i8*), i64 44, i1 false) %2 = load i32*, i32** %data, align 8 %3 = bitcast i32* %2 to i8* %arraydecay1 = getelementptr inbounds [11 x i32], [11 x i32]* %source, i64 0, i64 0 %4 = bitcast i32* %arraydecay1 to i8* %arraydecay2 = getelementptr inbounds [11 x i32], [11 x i32]* %source, i64 0, i64 0 %call = call i64 @wcslen(i32* %arraydecay2) #4 %add = add i64 %call, 1 %mul = mul i64 %add, 4 call void @llvm.memmove.p0i8.p0i8.i64(i8* align 4 %3, i8* align 16 %4, i64 %mul, i1 false) %5 = load i32*, i32** %data, align 8 call void @printWLine(i32* %5) ret void } attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } attributes #1 = { argmemonly nounwind willreturn } attributes #2 = { nounwind readonly "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } attributes #3 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } attributes #4 = { nounwind readonly } !llvm.module.flags = !{!0} !llvm.ident = !{!1} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{!"clang version 11.1.0"}
### Human: Refine the following lifted llvm ir, target datalayout = "e-m:e-p:64:64-i64:64-f80:128-n8:16:32:64-S128" @global_var_67c = constant [10 x i8] c"127.0.0.1\00" @global_var_d = constant i64 -556888036579737560 @global_var_688 = constant [32 x i8] c"ERROR: Array index is negative.\00" @global_var_6a8 = local_unnamed_addr constant [21 x i8] c"Benign, fixed string\00" @global_var_6c0 = constant [36 x i8] c"ERROR: Array index is out-of-bounds\00" define i64 @_GLOBAL_OFFSET_TABLE_.1() local_unnamed_addr { dec_label_pc_0: %0 = call i64 @__readfsqword(i64 40), !insn.addr !0 ret i64 5, !insn.addr !1 } define i64 @function_33() local_unnamed_addr { dec_label_pc_33: %0 = alloca i64 %rax.0.reg2mem = alloca i64, !insn.addr !2 %storemerge1.reg2mem = alloca i32, !insn.addr !2 %1 = load i64, i64* %0 %2 = call i64 @socket(i64 2, i64 1, i64 6), !insn.addr !3 %3 = trunc i64 %2 to i32, !insn.addr !4 %4 = add i64 %1, -72, !insn.addr !4 %5 = inttoptr i64 %4 to i32*, !insn.addr !4 store i32 %3, i32* %5, align 4, !insn.addr !4 %6 = icmp eq i32 %3, -1, !insn.addr !5 %.pre = add i64 %1, -64 br i1 %6, label %dec_label_pc_108, label %dec_label_pc_54, !insn.addr !6 dec_label_pc_54: ; preds = %dec_label_pc_33 %7 = call i64 @memset(i64 %.pre, i64 0, i64 16), !insn.addr !7 %8 = inttoptr i64 %.pre to i16*, !insn.addr !8 store i16 2, i16* %8, align 2, !insn.addr !8 %9 = call i64 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @global_var_67c, i64 0, i64 0)), !insn.addr !9 %10 = trunc i64 %9 to i32, !insn.addr !10 %11 = add i64 %1, -60, !insn.addr !10 %12 = inttoptr i64 %11 to i32*, !insn.addr !10 store i32 %10, i32* %12, align 4, !insn.addr !10 %13 = call i64 @htons(i64 27015), !insn.addr !11 %14 = trunc i64 %13 to i16, !insn.addr !12 %15 = add i64 %1, -62, !insn.addr !12 %16 = inttoptr i64 %15 to i16*, !insn.addr !12 store i16 %14, i16* %16, align 2, !insn.addr !12 %17 = load i32, i32* %5, align 4, !insn.addr !13 %18 = zext i32 %17 to i64, !insn.addr !14 %19 = call i64 @connect(i64 %18, i64 %.pre, i64 16, i64 %.pre), !insn.addr !15 %20 = trunc i64 %19 to i32, !insn.addr !16 %21 = icmp eq i32 %20, -1, !insn.addr !16 br i1 %21, label %dec_label_pc_ee, label %dec_label_pc_a8, !insn.addr !17 dec_label_pc_a8: ; preds = %dec_label_pc_54 %22 = add i64 %1, -22, !insn.addr !18 %23 = load i32, i32* %5, align 4, !insn.addr !19 %24 = zext i32 %23 to i64, !insn.addr !20 %25 = call i64 @recv(i64 %24, i64 %22, i64* nonnull @global_var_d, i64 0), !insn.addr !21 %26 = trunc i64 %25 to i32, !insn.addr !22 %27 = add i64 %1, -68, !insn.addr !22 %28 = inttoptr i64 %27 to i32*, !insn.addr !22 store i32 %26, i32* %28, align 4, !insn.addr !22 switch i32 %26, label %dec_label_pc_cf [ i32 -1, label %dec_label_pc_ee i32 0, label %dec_label_pc_ee ] dec_label_pc_cf: ; preds = %dec_label_pc_a8 %sext = mul i64 %25, 4294967296 %29 = ashr exact i64 %sext, 32, !insn.addr !23 %30 = add i64 %29, %22, !insn.addr !24 %31 = inttoptr i64 %30 to i8*, !insn.addr !24 store i8 0, i8* %31, align 1, !insn.addr !24 %32 = call i64 @atoi(i64 %22), !insn.addr !25 %33 = trunc i64 %32 to i32, !insn.addr !26 %34 = add i64 %1, -80, !insn.addr !26 %35 = inttoptr i64 %34 to i32*, !insn.addr !26 store i32 %33, i32* %35, align 4, !insn.addr !26 br label %dec_label_pc_ee, !insn.addr !27 dec_label_pc_ee: ; preds = %dec_label_pc_a8, %dec_label_pc_a8, %dec_label_pc_54, %dec_label_pc_cf %.pr = load i32, i32* %5, align 4 %36 = icmp eq i32 %.pr, -1, !insn.addr !28 br i1 %36, label %dec_label_pc_108, label %dec_label_pc_f4, !insn.addr !29 dec_label_pc_f4: ; preds = %dec_label_pc_ee %37 = zext i32 %.pr to i64, !insn.addr !30 %38 = call i64 @close(i64 %37), !insn.addr !31 br label %dec_label_pc_108, !insn.addr !31 dec_label_pc_108: ; preds = %dec_label_pc_33, %dec_label_pc_ee, %dec_label_pc_f4 %39 = inttoptr i64 %.pre to i64*, !insn.addr !32 store i64 0, i64* %39, align 8, !insn.addr !32 %40 = add i64 %1, -56, !insn.addr !33 %41 = inttoptr i64 %40 to i64*, !insn.addr !33 store i64 0, i64* %41, align 8, !insn.addr !33 %42 = add i64 %1, -48, !insn.addr !34 %43 = inttoptr i64 %42 to i64*, !insn.addr !34 store i64 0, i64* %43, align 8, !insn.addr !34 %44 = add i64 %1, -40, !insn.addr !35 %45 = inttoptr i64 %44 to i64*, !insn.addr !35 store i64 0, i64* %45, align 8, !insn.addr !35 %46 = add i64 %1, -32, !insn.addr !36 %47 = inttoptr i64 %46 to i64*, !insn.addr !36 store i64 0, i64* %47, align 8, !insn.addr !36 %48 = add i64 %1, -80, !insn.addr !37 %49 = inttoptr i64 %48 to i32*, !insn.addr !37 %50 = load i32, i32* %49, align 4, !insn.addr !37 %51 = icmp slt i32 %50, 0, !insn.addr !37 br i1 %51, label %dec_label_pc_168, label %dec_label_pc_136, !insn.addr !38 dec_label_pc_136: ; preds = %dec_label_pc_108 %52 = sext i32 %50 to i64, !insn.addr !39 %53 = mul i64 %52, 4, !insn.addr !40 %54 = add i64 %53, %.pre, !insn.addr !40 %55 = inttoptr i64 %54 to i32*, !insn.addr !40 store i32 1, i32* %55, align 4, !insn.addr !40 %56 = add i64 %1, -76, !insn.addr !41 %57 = inttoptr i64 %56 to i32*, !insn.addr !41 store i32 0, i32* %57, align 4 store i32 0, i32* %storemerge1.reg2mem br label %dec_label_pc_14c dec_label_pc_14c: ; preds = %dec_label_pc_136, %dec_label_pc_14c %storemerge1.reload = load i32, i32* %storemerge1.reg2mem %58 = sext i32 %storemerge1.reload to i64, !insn.addr !42 %59 = mul i64 %58, 4, !insn.addr !43 %60 = add i64 %59, %.pre, !insn.addr !43 %61 = inttoptr i64 %60 to i32*, !insn.addr !43 %62 = load i32, i32* %61, align 4, !insn.addr !43 %63 = zext i32 %62 to i64, !insn.addr !44 %64 = call i64 @printIntLine(i64 %63), !insn.addr !45 %65 = load i32, i32* %57, align 4, !insn.addr !46 %66 = add i32 %65, 1, !insn.addr !46 store i32 %66, i32* %57, align 4 %67 = icmp slt i32 %66, 10, !insn.addr !47 store i32 %66, i32* %storemerge1.reg2mem, !insn.addr !47 br i1 %67, label %dec_label_pc_14c, label %dec_label_pc_174, !insn.addr !47 dec_label_pc_168: ; preds = %dec_label_pc_108 %68 = call i64 @printLine(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @global_var_688, i64 0, i64 0)), !insn.addr !48 br label %dec_label_pc_174, !insn.addr !48 dec_label_pc_174: ; preds = %dec_label_pc_14c, %dec_label_pc_168 %69 = add i64 %1, -8, !insn.addr !49 %70 = inttoptr i64 %69 to i64*, !insn.addr !49 %71 = load i64, i64* %70, align 8, !insn.addr !49 %72 = call i64 @__readfsqword(i64 40), !insn.addr !50 %73 = icmp eq i64 %71, %72, !insn.addr !50 store i64 0, i64* %rax.0.reg2mem, !insn.addr !51 br i1 %73, label %dec_label_pc_189, label %dec_label_pc_184, !insn.addr !51 dec_label_pc_184: ; preds = %dec_label_pc_174 %74 = call i64 @__stack_chk_fail(), !insn.addr !52 store i64 %74, i64* %rax.0.reg2mem, !insn.addr !52 br label %dec_label_pc_189, !insn.addr !52 dec_label_pc_189: ; preds = %dec_label_pc_184, %dec_label_pc_174 %rax.0.reload = load i64, i64* %rax.0.reg2mem ret i64 %rax.0.reload, !insn.addr !53 } define i64 @goodB2G1() local_unnamed_addr { dec_label_pc_18b: %rax.0.reg2mem = alloca i64, !insn.addr !54 %indvars.iv.reg2mem = alloca i64, !insn.addr !54 %stack_var_-30 = alloca i64, align 8 %stack_var_-72 = alloca i64, align 8 %stack_var_-8 = alloca i64, align 8 %0 = call i64 @__readfsqword(i64 40), !insn.addr !55 %1 = call i64 @socket(i64 2, i64 1, i64 6), !insn.addr !56 %2 = trunc i64 %1 to i32, !insn.addr !57 %3 = icmp eq i32 %2, -1, !insn.addr !58 br i1 %3, label %dec_label_pc_2a1.thread, label %dec_label_pc_1df, !insn.addr !59 dec_label_pc_2a1.thread: ; preds = %dec_label_pc_18b store i64 0, i64* %stack_var_-72, align 8, !insn.addr !60 br label %dec_label_pc_307 dec_label_pc_1df: ; preds = %dec_label_pc_18b %4 = ptrtoint i64* %stack_var_-72 to i64, !insn.addr !61 %5 = call i64 @memset(i64 %4, i64 0, i64 16), !insn.addr !62 store i64 2, i64* %stack_var_-72, align 8, !insn.addr !63 %6 = call i64 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @global_var_67c, i64 0, i64 0)), !insn.addr !64 %7 = call i64 @htons(i64 27015), !insn.addr !65 %8 = and i64 %1, 4294967295 %9 = call i64 @connect(i64 %8, i64 %4, i64 16, i64 %4), !insn.addr !66 %10 = trunc i64 %9 to i32, !insn.addr !67 %11 = icmp eq i32 %10, -1, !insn.addr !67 br i1 %11, label %dec_label_pc_2a1.thread8, label %dec_label_pc_233, !insn.addr !68 dec_label_pc_233: ; preds = %dec_label_pc_1df %12 = ptrtoint i64* %stack_var_-30 to i64, !insn.addr !69 %13 = call i64 @recv(i64 %8, i64 %12, i64* nonnull @global_var_d, i64 0), !insn.addr !70 %14 = trunc i64 %13 to i32, !insn.addr !71 %15 = add i32 %14, 1 %16 = icmp ult i32 %15, 2 br i1 %16, label %dec_label_pc_2a1.thread8, label %dec_label_pc_2a1, !insn.addr !72 dec_label_pc_2a1.thread8: ; preds = %dec_label_pc_233, %dec_label_pc_1df %17 = call i64 @close(i64 %8), !insn.addr !73 store i64 0, i64* %stack_var_-72, align 8, !insn.addr !60 br label %dec_label_pc_307 dec_label_pc_2a1: ; preds = %dec_label_pc_233 %18 = ptrtoint i64* %stack_var_-8 to i64, !insn.addr !74 %sext = mul i64 %13, 4294967296 %19 = ashr exact i64 %sext, 32, !insn.addr !75 %20 = add i64 %18, -22, !insn.addr !76 %21 = add i64 %20, %19, !insn.addr !76 %22 = inttoptr i64 %21 to i8*, !insn.addr !76 store i8 0, i8* %22, align 1, !insn.addr !76 %23 = call i64 @atoi(i64 %12), !insn.addr !77 %24 = trunc i64 %23 to i32, !insn.addr !78 %25 = call i64 @close(i64 %8), !insn.addr !73 store i64 0, i64* %stack_var_-72, align 8, !insn.addr !60 %26 = icmp ugt i32 %24, 9 br i1 %26, label %dec_label_pc_307, label %dec_label_pc_2d5, !insn.addr !79 dec_label_pc_2d5: ; preds = %dec_label_pc_2a1 %sext9 = mul i64 %23, 4294967296 %27 = ashr exact i64 %sext9, 30, !insn.addr !80 %28 = add i64 %18, -64, !insn.addr !80 %29 = add i64 %27, %28, !insn.addr !80 %30 = inttoptr i64 %29 to i32*, !insn.addr !80 store i32 1, i32* %30, align 4, !insn.addr !80 store i64 0, i64* %indvars.iv.reg2mem br label %dec_label_pc_2eb dec_label_pc_2eb: ; preds = %dec_label_pc_2eb, %dec_label_pc_2d5 %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem %31 = mul i64 %indvars.iv.reload, 4, !insn.addr !81 %32 = add i64 %31, %28, !insn.addr !81 %33 = inttoptr i64 %32 to i32*, !insn.addr !81 %34 = load i32, i32* %33, align 4, !insn.addr !81 %35 = zext i32 %34 to i64, !insn.addr !82 %36 = call i64 @printIntLine(i64 %35), !insn.addr !83 %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1 %exitcond = icmp eq i64 %indvars.iv.next, 10 store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem, !insn.addr !84 br i1 %exitcond, label %dec_label_pc_315, label %dec_label_pc_2eb, !insn.addr !84 dec_label_pc_307: ; preds = %dec_label_pc_2a1.thread8, %dec_label_pc_2a1.thread, %dec_label_pc_2a1 %37 = call i64 @printLine(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @global_var_6c0, i64 0, i64 0)), !insn.addr !85 br label %dec_label_pc_315, !insn.addr !86 dec_label_pc_315: ; preds = %dec_label_pc_2eb, %dec_label_pc_307 %38 = call i64 @__readfsqword(i64 40), !insn.addr !87 %39 = icmp eq i64 %0, %38, !insn.addr !87 store i64 0, i64* %rax.0.reg2mem, !insn.addr !88 br i1 %39, label %dec_label_pc_32a, label %dec_label_pc_325, !insn.addr !88 dec_label_pc_325: ; preds = %dec_label_pc_315 %40 = call i64 @__stack_chk_fail(), !insn.addr !89 store i64 %40, i64* %rax.0.reg2mem, !insn.addr !89 br label %dec_label_pc_32a, !insn.addr !89 dec_label_pc_32a: ; preds = %dec_label_pc_325, %dec_label_pc_315 %rax.0.reload = load i64, i64* %rax.0.reg2mem ret i64 %rax.0.reload, !insn.addr !90 } define i64 @goodB2G2() local_unnamed_addr { dec_label_pc_32c: %rax.0.reg2mem = alloca i64, !insn.addr !91 %indvars.iv.reg2mem = alloca i64, !insn.addr !91 %stack_var_-30 = alloca i64, align 8 %stack_var_-72 = alloca i64, align 8 %stack_var_-8 = alloca i64, align 8 %0 = call i64 @__readfsqword(i64 40), !insn.addr !92 %1 = call i64 @socket(i64 2, i64 1, i64 6), !insn.addr !93 %2 = trunc i64 %1 to i32, !insn.addr !94 %3 = icmp eq i32 %2, -1, !insn.addr !95 br i1 %3, label %dec_label_pc_434.thread, label %dec_label_pc_380, !insn.addr !96 dec_label_pc_434.thread: ; preds = %dec_label_pc_32c store i64 0, i64* %stack_var_-72, align 8, !insn.addr !97 br label %dec_label_pc_49a dec_label_pc_380: ; preds = %dec_label_pc_32c %4 = ptrtoint i64* %stack_var_-72 to i64, !insn.addr !98 %5 = call i64 @memset(i64 %4, i64 0, i64 16), !insn.addr !99 store i64 2, i64* %stack_var_-72, align 8, !insn.addr !100 %6 = call i64 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @global_var_67c, i64 0, i64 0)), !insn.addr !101 %7 = call i64 @htons(i64 27015), !insn.addr !102 %8 = and i64 %1, 4294967295 %9 = call i64 @connect(i64 %8, i64 %4, i64 16, i64 %4), !insn.addr !103 %10 = trunc i64 %9 to i32, !insn.addr !104 %11 = icmp eq i32 %10, -1, !insn.addr !104 br i1 %11, label %dec_label_pc_434.thread8, label %dec_label_pc_3d4, !insn.addr !105 dec_label_pc_3d4: ; preds = %dec_label_pc_380 %12 = ptrtoint i64* %stack_var_-30 to i64, !insn.addr !106 %13 = call i64 @recv(i64 %8, i64 %12, i64* nonnull @global_var_d, i64 0), !insn.addr !107 %14 = trunc i64 %13 to i32, !insn.addr !108 %15 = add i32 %14, 1 %16 = icmp ult i32 %15, 2 br i1 %16, label %dec_label_pc_434.thread8, label %dec_label_pc_434, !insn.addr !109 dec_label_pc_434.thread8: ; preds = %dec_label_pc_3d4, %dec_label_pc_380 %17 = call i64 @close(i64 %8), !insn.addr !110 store i64 0, i64* %stack_var_-72, align 8, !insn.addr !97 br label %dec_label_pc_49a dec_label_pc_434: ; preds = %dec_label_pc_3d4 %18 = ptrtoint i64* %stack_var_-8 to i64, !insn.addr !111 %sext = mul i64 %13, 4294967296 %19 = ashr exact i64 %sext, 32, !insn.addr !112 %20 = add i64 %18, -22, !insn.addr !113 %21 = add i64 %20, %19, !insn.addr !113 %22 = inttoptr i64 %21 to i8*, !insn.addr !113 store i8 0, i8* %22, align 1, !insn.addr !113 %23 = call i64 @atoi(i64 %12), !insn.addr !114 %24 = trunc i64 %23 to i32, !insn.addr !115 %25 = call i64 @close(i64 %8), !insn.addr !110 store i64 0, i64* %stack_var_-72, align 8, !insn.addr !97 %26 = icmp ugt i32 %24, 9 br i1 %26, label %dec_label_pc_49a, label %dec_label_pc_468, !insn.addr !116 dec_label_pc_468: ; preds = %dec_label_pc_434 %sext9 = mul i64 %23, 4294967296 %27 = ashr exact i64 %sext9, 30, !insn.addr !117 %28 = add i64 %18, -64, !insn.addr !117 %29 = add i64 %27, %28, !insn.addr !117 %30 = inttoptr i64 %29 to i32*, !insn.addr !117 store i32 1, i32* %30, align 4, !insn.addr !117 store i64 0, i64* %indvars.iv.reg2mem br label %dec_label_pc_47e dec_label_pc_47e: ; preds = %dec_label_pc_47e, %dec_label_pc_468 %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem %31 = mul i64 %indvars.iv.reload, 4, !insn.addr !118 %32 = add i64 %31, %28, !insn.addr !118 %33 = inttoptr i64 %32 to i32*, !insn.addr !118 %34 = load i32, i32* %33, align 4, !insn.addr !118 %35 = zext i32 %34 to i64, !insn.addr !119 %36 = call i64 @printIntLine(i64 %35), !insn.addr !120 %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1 %exitcond = icmp eq i64 %indvars.iv.next, 10 store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem, !insn.addr !121 br i1 %exitcond, label %dec_label_pc_4a8, label %dec_label_pc_47e, !insn.addr !121 dec_label_pc_49a: ; preds = %dec_label_pc_434.thread8, %dec_label_pc_434.thread, %dec_label_pc_434 %37 = call i64 @printLine(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @global_var_6c0, i64 0, i64 0)), !insn.addr !122 br label %dec_label_pc_4a8, !insn.addr !123 dec_label_pc_4a8: ; preds = %dec_label_pc_47e, %dec_label_pc_49a %38 = call i64 @__readfsqword(i64 40), !insn.addr !124 %39 = icmp eq i64 %0, %38, !insn.addr !124 store i64 0, i64* %rax.0.reg2mem, !insn.addr !125 br i1 %39, label %dec_label_pc_4bd, label %dec_label_pc_4b8, !insn.addr !125 dec_label_pc_4b8: ; preds = %dec_label_pc_4a8 %40 = call i64 @__stack_chk_fail(), !insn.addr !126 store i64 %40, i64* %rax.0.reg2mem, !insn.addr !126 br label %dec_label_pc_4bd, !insn.addr !126 dec_label_pc_4bd: ; preds = %dec_label_pc_4b8, %dec_label_pc_4a8 %rax.0.reload = load i64, i64* %rax.0.reg2mem ret i64 %rax.0.reload, !insn.addr !127 } define i64 @goodG2B1() local_unnamed_addr { dec_label_pc_4bf: %rax.0.reg2mem = alloca i64, !insn.addr !128 %indvars.iv.reg2mem = alloca i64, !insn.addr !128 %stack_var_-8 = alloca i64, align 8 %0 = ptrtoint i64* %stack_var_-8 to i64, !insn.addr !129 %1 = call i64 @__readfsqword(i64 40), !insn.addr !130 %2 = add i64 %0, -20, !insn.addr !131 %3 = inttoptr i64 %2 to i32*, !insn.addr !131 store i32 1, i32* %3, align 4, !insn.addr !131 %4 = add i64 %0, -48, !insn.addr !132 store i64 0, i64* %indvars.iv.reg2mem br label %dec_label_pc_54a dec_label_pc_54a: ; preds = %dec_label_pc_54a, %dec_label_pc_4bf %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem %5 = mul i64 %indvars.iv.reload, 4, !insn.addr !132 %6 = add i64 %4, %5, !insn.addr !132 %7 = inttoptr i64 %6 to i32*, !insn.addr !132 %8 = load i32, i32* %7, align 4, !insn.addr !132 %9 = zext i32 %8 to i64, !insn.addr !133 %10 = call i64 @printIntLine(i64 %9), !insn.addr !134 %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1 %exitcond = icmp eq i64 %indvars.iv.next, 10 store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem, !insn.addr !135 br i1 %exitcond, label %dec_label_pc_572, label %dec_label_pc_54a, !insn.addr !135 dec_label_pc_572: ; preds = %dec_label_pc_54a %11 = call i64 @__readfsqword(i64 40), !insn.addr !136 %12 = icmp eq i64 %1, %11, !insn.addr !136 store i64 0, i64* %rax.0.reg2mem, !insn.addr !137 br i1 %12, label %dec_label_pc_587, label %dec_label_pc_582, !insn.addr !137 dec_label_pc_582: ; preds = %dec_label_pc_572 %13 = call i64 @__stack_chk_fail(), !insn.addr !138 store i64 %13, i64* %rax.0.reg2mem, !insn.addr !138 br label %dec_label_pc_587, !insn.addr !138 dec_label_pc_587: ; preds = %dec_label_pc_582, %dec_label_pc_572 %rax.0.reload = load i64, i64* %rax.0.reg2mem ret i64 %rax.0.reload, !insn.addr !139 } define i64 @goodG2B2() local_unnamed_addr { dec_label_pc_589: %rax.0.reg2mem = alloca i64, !insn.addr !140 %indvars.iv.reg2mem = alloca i64, !insn.addr !140 %stack_var_-8 = alloca i64, align 8 %0 = ptrtoint i64* %stack_var_-8 to i64, !insn.addr !141 %1 = call i64 @__readfsqword(i64 40), !insn.addr !142 %2 = add i64 %0, -20, !insn.addr !143 %3 = inttoptr i64 %2 to i32*, !insn.addr !143 store i32 1, i32* %3, align 4, !insn.addr !143 %4 = add i64 %0, -48, !insn.addr !144 store i64 0, i64* %indvars.iv.reg2mem br label %dec_label_pc_606 dec_label_pc_606: ; preds = %dec_label_pc_606, %dec_label_pc_589 %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem %5 = mul i64 %indvars.iv.reload, 4, !insn.addr !144 %6 = add i64 %4, %5, !insn.addr !144 %7 = inttoptr i64 %6 to i32*, !insn.addr !144 %8 = load i32, i32* %7, align 4, !insn.addr !144 %9 = zext i32 %8 to i64, !insn.addr !145 %10 = call i64 @printIntLine(i64 %9), !insn.addr !146 %indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1 %exitcond = icmp eq i64 %indvars.iv.next, 10 store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem, !insn.addr !147 br i1 %exitcond, label %dec_label_pc_62e, label %dec_label_pc_606, !insn.addr !147 dec_label_pc_62e: ; preds = %dec_label_pc_606 %11 = call i64 @__readfsqword(i64 40), !insn.addr !148 %12 = icmp eq i64 %1, %11, !insn.addr !148 store i64 0, i64* %rax.0.reg2mem, !insn.addr !149 br i1 %12, label %dec_label_pc_643, label %dec_label_pc_63e, !insn.addr !149 dec_label_pc_63e: ; preds = %dec_label_pc_62e %13 = call i64 @__stack_chk_fail(), !insn.addr !150 store i64 %13, i64* %rax.0.reg2mem, !insn.addr !150 br label %dec_label_pc_643, !insn.addr !150 dec_label_pc_643: ; preds = %dec_label_pc_63e, %dec_label_pc_62e %rax.0.reload = load i64, i64* %rax.0.reg2mem ret i64 %rax.0.reload, !insn.addr !151 } define i64 @CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_06_good() local_unnamed_addr { dec_label_pc_645: %0 = call i64 @goodB2G1(), !insn.addr !152 %1 = call i64 @goodB2G2(), !insn.addr !153 %2 = call i64 @goodG2B1(), !insn.addr !154 %3 = call i64 @goodG2B2(), !insn.addr !155 ret i64 %3, !insn.addr !156 } declare i64 @socket(i64, i64, i64) local_unnamed_addr declare i64 @memset(i64, i64, i64) local_unnamed_addr declare i64 @inet_addr(i8*) local_unnamed_addr declare i64 @htons(i64) local_unnamed_addr declare i64 @connect(i64, i64, i64, i64) local_unnamed_addr declare i64 @recv(i64, i64, i64*, i64) local_unnamed_addr declare i64 @atoi(i64) local_unnamed_addr declare i64 @close(i64) local_unnamed_addr declare i64 @printIntLine(i64) local_unnamed_addr declare i64 @printLine(i8*) local_unnamed_addr declare i64 @__stack_chk_fail() local_unnamed_addr declare i64 @__readfsqword(i64) local_unnamed_addr !0 = !{i64 8} !1 = !{i64 35} !2 = !{i64 51} !3 = !{i64 66} !4 = !{i64 71} !5 = !{i64 74} !6 = !{i64 78} !7 = !{i64 101} !8 = !{i64 106} !9 = !{i64 119} !10 = !{i64 124} !11 = !{i64 132} !12 = !{i64 137} !13 = !{i64 145} !14 = !{i64 156} !15 = !{i64 158} !16 = !{i64 163} !17 = !{i64 166} !18 = !{i64 168} !19 = !{i64 172} !20 = !{i64 185} !21 = !{i64 187} !22 = !{i64 192} !23 = !{i64 210} !24 = !{i64 212} !25 = !{i64 224} !26 = !{i64 229} !27 = !{i64 232} !28 = !{i64 238} !29 = !{i64 242} !30 = !{i64 247} !31 = !{i64 249} !32 = !{i64 264} !33 = !{i64 272} !34 = !{i64 280} !35 = !{i64 288} !36 = !{i64 296} !37 = !{i64 304} !38 = !{i64 308} !39 = !{i64 313} !40 = !{i64 315} !41 = !{i64 323} !42 = !{i64 335} !43 = !{i64 337} !44 = !{i64 341} !45 = !{i64 343} !46 = !{i64 348} !47 = !{i64 356} !48 = !{i64 367} !49 = !{i64 373} !50 = !{i64 377} !51 = !{i64 386} !52 = !{i64 388} !53 = !{i64 394} !54 = !{i64 395} !55 = !{i64 403} !56 = !{i64 461} !57 = !{i64 466} !58 = !{i64 469} !59 = !{i64 473} !60 = !{i64 673} !61 = !{i64 493} !62 = !{i64 496} !63 = !{i64 501} !64 = !{i64 514} !65 = !{i64 527} !66 = !{i64 553} !67 = !{i64 558} !68 = !{i64 561} !69 = !{i64 563} !70 = !{i64 582} !71 = !{i64 587} !72 = !{i64 594} !73 = !{i64 644} !74 = !{i64 396} !75 = !{i64 605} !76 = !{i64 607} !77 = !{i64 619} !78 = !{i64 624} !79 = !{i64 717} !80 = !{i64 730} !81 = !{i64 752} !82 = !{i64 756} !83 = !{i64 758} !84 = !{i64 771} !85 = !{i64 782} !86 = !{i64 787} !87 = !{i64 794} !88 = !{i64 803} !89 = !{i64 805} !90 = !{i64 811} !91 = !{i64 812} !92 = !{i64 820} !93 = !{i64 878} !94 = !{i64 883} !95 = !{i64 886} !96 = !{i64 890} !97 = !{i64 1076} !98 = !{i64 910} !99 = !{i64 913} !100 = !{i64 918} !101 = !{i64 931} !102 = !{i64 944} !103 = !{i64 970} !104 = !{i64 975} !105 = !{i64 978} !106 = !{i64 980} !107 = !{i64 999} !108 = !{i64 1004} !109 = !{i64 1011} !110 = !{i64 1061} !111 = !{i64 813} !112 = !{i64 1022} !113 = !{i64 1024} !114 = !{i64 1036} !115 = !{i64 1041} !116 = !{i64 1120} !117 = !{i64 1133} !118 = !{i64 1155} !119 = !{i64 1159} !120 = !{i64 1161} !121 = !{i64 1174} !122 = !{i64 1185} !123 = !{i64 1190} !124 = !{i64 1197} !125 = !{i64 1206} !126 = !{i64 1208} !127 = !{i64 1214} !128 = !{i64 1215} !129 = !{i64 1216} !130 = !{i64 1223} !131 = !{i64 1337} !132 = !{i64 1359} !133 = !{i64 1363} !134 = !{i64 1365} !135 = !{i64 1378} !136 = !{i64 1399} !137 = !{i64 1408} !138 = !{i64 1410} !139 = !{i64 1416} !140 = !{i64 1417} !141 = !{i64 1418} !142 = !{i64 1425} !143 = !{i64 1525} !144 = !{i64 1547} !145 = !{i64 1551} !146 = !{i64 1553} !147 = !{i64 1566} !148 = !{i64 1587} !149 = !{i64 1596} !150 = !{i64 1598} !151 = !{i64 1604} !152 = !{i64 1614} !153 = !{i64 1624} !154 = !{i64 1634} !155 = !{i64 1644} !156 = !{i64 1651} ### Assistant: %struct.sockaddr_in = type { i16, i16, %struct.in_addr, [8 x i8] } %struct.in_addr = type { i32 } %struct.sockaddr = type { i16, [14 x i8] } @.str = private unnamed_addr constant [10 x i8] c"127.0.0.1\00", align 1 @.str.1 = private unnamed_addr constant [32 x i8] c"ERROR: Array index is negative.\00", align 1 @.str.2 = private unnamed_addr constant [36 x i8] c"ERROR: Array index is out-of-bounds\00", align 1 ; Function Attrs: noinline nounwind optnone uwtable define dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_06_bad() #0 { entry: %data = alloca i32, align 4 %recvResult = alloca i32, align 4 %service = alloca %struct.sockaddr_in, align 4 %connectSocket = alloca i32, align 4 %inputBuffer = alloca [14 x i8], align 1 %i = alloca i32, align 4 %buffer = alloca [10 x i32], align 16 store i32 -1, i32* %data, align 4 store i32 -1, i32* %connectSocket, align 4 br label %do.body do.body: ; preds = %entry %call = call i32 @socket(i32 2, i32 1, i32 6) #6 store i32 %call, i32* %connectSocket, align 4 %0 = load i32, i32* %connectSocket, align 4 %cmp = icmp eq i32 %0, -1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %do.body br label %do.end if.end: ; preds = %do.body %1 = bitcast %struct.sockaddr_in* %service to i8* call void @llvm.memset.p0i8.i64(i8* align 4 %1, i8 0, i64 16, i1 false) %sin_family = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %service, i32 0, i32 0 store i16 2, i16* %sin_family, align 4 %call1 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)) #6 %sin_addr = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %service, i32 0, i32 2 %s_addr = getelementptr inbounds %struct.in_addr, %struct.in_addr* %sin_addr, i32 0, i32 0 store i32 %call1, i32* %s_addr, align 4 %call2 = call zeroext i16 @htons(i16 zeroext 27015) #7 %sin_port = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %service, i32 0, i32 1 store i16 %call2, i16* %sin_port, align 2 %2 = load i32, i32* %connectSocket, align 4 %3 = bitcast %struct.sockaddr_in* %service to %struct.sockaddr* %call3 = call i32 @connect(i32 %2, %struct.sockaddr* %3, i32 16) %cmp4 = icmp eq i32 %call3, -1 br i1 %cmp4, label %if.then5, label %if.end6 if.then5: ; preds = %if.end br label %do.end if.end6: ; preds = %if.end %4 = load i32, i32* %connectSocket, align 4 %arraydecay = getelementptr inbounds [14 x i8], [14 x i8]* %inputBuffer, i64 0, i64 0 %call7 = call i64 @recv(i32 %4, i8* %arraydecay, i64 13, i32 0) %conv = trunc i64 %call7 to i32 store i32 %conv, i32* %recvResult, align 4 %5 = load i32, i32* %recvResult, align 4 %cmp8 = icmp eq i32 %5, -1 br i1 %cmp8, label %if.then12, label %lor.lhs.false lor.lhs.false: ; preds = %if.end6 %6 = load i32, i32* %recvResult, align 4 %cmp10 = icmp eq i32 %6, 0 br i1 %cmp10, label %if.then12, label %if.end13 if.then12: ; preds = %lor.lhs.false, %if.end6 br label %do.end if.end13: ; preds = %lor.lhs.false %7 = load i32, i32* %recvResult, align 4 %idxprom = sext i32 %7 to i64 %arrayidx = getelementptr inbounds [14 x i8], [14 x i8]* %inputBuffer, i64 0, i64 %idxprom store i8 0, i8* %arrayidx, align 1 %arraydecay14 = getelementptr inbounds [14 x i8], [14 x i8]* %inputBuffer, i64 0, i64 0 %call15 = call i32 @atoi(i8* %arraydecay14) #8 store i32 %call15, i32* %data, align 4 br label %do.end do.end: ; preds = %if.end13, %if.then12, %if.then5, %if.then %8 = load i32, i32* %connectSocket, align 4 %cmp16 = icmp ne i32 %8, -1 br i1 %cmp16, label %if.then18, label %if.end20 if.then18: ; preds = %do.end %9 = load i32, i32* %connectSocket, align 4 %call19 = call i32 @close(i32 %9) br label %if.end20 if.end20: ; preds = %if.then18, %do.end %10 = bitcast [10 x i32]* %buffer to i8* call void @llvm.memset.p0i8.i64(i8* align 16 %10, i8 0, i64 40, i1 false) %11 = load i32, i32* %data, align 4 %cmp21 = icmp sge i32 %11, 0 br i1 %cmp21, label %if.then23, label %if.else if.then23: ; preds = %if.end20 %12 = load i32, i32* %data, align 4 %idxprom24 = sext i32 %12 to i64 %arrayidx25 = getelementptr inbounds [10 x i32], [10 x i32]* %buffer, i64 0, i64 %idxprom24 store i32 1, i32* %arrayidx25, align 4 store i32 0, i32* %i, align 4 br label %for.cond for.cond: ; preds = %for.inc, %if.then23 %13 = load i32, i32* %i, align 4 %cmp26 = icmp slt i32 %13, 10 br i1 %cmp26, label %for.body, label %for.end for.body: ; preds = %for.cond %14 = load i32, i32* %i, align 4 %idxprom28 = sext i32 %14 to i64 %arrayidx29 = getelementptr inbounds [10 x i32], [10 x i32]* %buffer, i64 0, i64 %idxprom28 %15 = load i32, i32* %arrayidx29, align 4 call void @printIntLine(i32 %15) br label %for.inc for.inc: ; preds = %for.body %16 = load i32, i32* %i, align 4 %inc = add nsw i32 %16, 1 store i32 %inc, i32* %i, align 4 br label %for.cond for.end: ; preds = %for.cond br label %if.end30 if.else: ; preds = %if.end20 call void @printLine(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0)) br label %if.end30 if.end30: ; preds = %if.else, %for.end ret void } ; Function Attrs: nounwind declare dso_local i32 @socket(i32, i32, i32) #1 ; Function Attrs: argmemonly nounwind willreturn writeonly declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nounwind declare dso_local i32 @inet_addr(i8*) #1 ; Function Attrs: nounwind readnone declare dso_local zeroext i16 @htons(i16 zeroext) #3 declare dso_local i32 @connect(i32, %struct.sockaddr*, i32) #4 declare dso_local i64 @recv(i32, i8*, i64, i32) #4 ; Function Attrs: nounwind readonly declare dso_local i32 @atoi(i8*) #5 declare dso_local i32 @close(i32) #4 declare dso_local void @printIntLine(i32) #4 declare dso_local void @printLine(i8*) #4 ; Function Attrs: noinline nounwind optnone uwtable define dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_06_good() #0 { entry: call void @goodB2G1() call void @goodB2G2() call void @goodG2B1() call void @goodG2B2() ret void } ; Function Attrs: noinline nounwind optnone uwtable define internal void @goodB2G1() #0 { entry: %data = alloca i32, align 4 %recvResult = alloca i32, align 4 %service = alloca %struct.sockaddr_in, align 4 %connectSocket = alloca i32, align 4 %inputBuffer = alloca [14 x i8], align 1 %i = alloca i32, align 4 %buffer = alloca [10 x i32], align 16 store i32 -1, i32* %data, align 4 store i32 -1, i32* %connectSocket, align 4 br label %do.body do.body: ; preds = %entry %call = call i32 @socket(i32 2, i32 1, i32 6) #6 store i32 %call, i32* %connectSocket, align 4 %0 = load i32, i32* %connectSocket, align 4 %cmp = icmp eq i32 %0, -1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %do.body br label %do.end if.end: ; preds = %do.body %1 = bitcast %struct.sockaddr_in* %service to i8* call void @llvm.memset.p0i8.i64(i8* align 4 %1, i8 0, i64 16, i1 false) %sin_family = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %service, i32 0, i32 0 store i16 2, i16* %sin_family, align 4 %call1 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)) #6 %sin_addr = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %service, i32 0, i32 2 %s_addr = getelementptr inbounds %struct.in_addr, %struct.in_addr* %sin_addr, i32 0, i32 0 store i32 %call1, i32* %s_addr, align 4 %call2 = call zeroext i16 @htons(i16 zeroext 27015) #7 %sin_port = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %service, i32 0, i32 1 store i16 %call2, i16* %sin_port, align 2 %2 = load i32, i32* %connectSocket, align 4 %3 = bitcast %struct.sockaddr_in* %service to %struct.sockaddr* %call3 = call i32 @connect(i32 %2, %struct.sockaddr* %3, i32 16) %cmp4 = icmp eq i32 %call3, -1 br i1 %cmp4, label %if.then5, label %if.end6 if.then5: ; preds = %if.end br label %do.end if.end6: ; preds = %if.end %4 = load i32, i32* %connectSocket, align 4 %arraydecay = getelementptr inbounds [14 x i8], [14 x i8]* %inputBuffer, i64 0, i64 0 %call7 = call i64 @recv(i32 %4, i8* %arraydecay, i64 13, i32 0) %conv = trunc i64 %call7 to i32 store i32 %conv, i32* %recvResult, align 4 %5 = load i32, i32* %recvResult, align 4 %cmp8 = icmp eq i32 %5, -1 br i1 %cmp8, label %if.then12, label %lor.lhs.false lor.lhs.false: ; preds = %if.end6 %6 = load i32, i32* %recvResult, align 4 %cmp10 = icmp eq i32 %6, 0 br i1 %cmp10, label %if.then12, label %if.end13 if.then12: ; preds = %lor.lhs.false, %if.end6 br label %do.end if.end13: ; preds = %lor.lhs.false %7 = load i32, i32* %recvResult, align 4 %idxprom = sext i32 %7 to i64 %arrayidx = getelementptr inbounds [14 x i8], [14 x i8]* %inputBuffer, i64 0, i64 %idxprom store i8 0, i8* %arrayidx, align 1 %arraydecay14 = getelementptr inbounds [14 x i8], [14 x i8]* %inputBuffer, i64 0, i64 0 %call15 = call i32 @atoi(i8* %arraydecay14) #8 store i32 %call15, i32* %data, align 4 br label %do.end do.end: ; preds = %if.end13, %if.then12, %if.then5, %if.then %8 = load i32, i32* %connectSocket, align 4 %cmp16 = icmp ne i32 %8, -1 br i1 %cmp16, label %if.then18, label %if.end20 if.then18: ; preds = %do.end %9 = load i32, i32* %connectSocket, align 4 %call19 = call i32 @close(i32 %9) br label %if.end20 if.end20: ; preds = %if.then18, %do.end %10 = bitcast [10 x i32]* %buffer to i8* call void @llvm.memset.p0i8.i64(i8* align 16 %10, i8 0, i64 40, i1 false) %11 = load i32, i32* %data, align 4 %cmp21 = icmp sge i32 %11, 0 br i1 %cmp21, label %land.lhs.true, label %if.else land.lhs.true: ; preds = %if.end20 %12 = load i32, i32* %data, align 4 %cmp23 = icmp slt i32 %12, 10 br i1 %cmp23, label %if.then25, label %if.else if.then25: ; preds = %land.lhs.true %13 = load i32, i32* %data, align 4 %idxprom26 = sext i32 %13 to i64 %arrayidx27 = getelementptr inbounds [10 x i32], [10 x i32]* %buffer, i64 0, i64 %idxprom26 store i32 1, i32* %arrayidx27, align 4 store i32 0, i32* %i, align 4 br label %for.cond for.cond: ; preds = %for.inc, %if.then25 %14 = load i32, i32* %i, align 4 %cmp28 = icmp slt i32 %14, 10 br i1 %cmp28, label %for.body, label %for.end for.body: ; preds = %for.cond %15 = load i32, i32* %i, align 4 %idxprom30 = sext i32 %15 to i64 %arrayidx31 = getelementptr inbounds [10 x i32], [10 x i32]* %buffer, i64 0, i64 %idxprom30 %16 = load i32, i32* %arrayidx31, align 4 call void @printIntLine(i32 %16) br label %for.inc for.inc: ; preds = %for.body %17 = load i32, i32* %i, align 4 %inc = add nsw i32 %17, 1 store i32 %inc, i32* %i, align 4 br label %for.cond for.end: ; preds = %for.cond br label %if.end32 if.else: ; preds = %land.lhs.true, %if.end20 call void @printLine(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0)) br label %if.end32 if.end32: ; preds = %if.else, %for.end ret void } ; Function Attrs: noinline nounwind optnone uwtable define internal void @goodB2G2() #0 { entry: %data = alloca i32, align 4 %recvResult = alloca i32, align 4 %service = alloca %struct.sockaddr_in, align 4 %connectSocket = alloca i32, align 4 %inputBuffer = alloca [14 x i8], align 1 %i = alloca i32, align 4 %buffer = alloca [10 x i32], align 16 store i32 -1, i32* %data, align 4 store i32 -1, i32* %connectSocket, align 4 br label %do.body do.body: ; preds = %entry %call = call i32 @socket(i32 2, i32 1, i32 6) #6 store i32 %call, i32* %connectSocket, align 4 %0 = load i32, i32* %connectSocket, align 4 %cmp = icmp eq i32 %0, -1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %do.body br label %do.end if.end: ; preds = %do.body %1 = bitcast %struct.sockaddr_in* %service to i8* call void @llvm.memset.p0i8.i64(i8* align 4 %1, i8 0, i64 16, i1 false) %sin_family = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %service, i32 0, i32 0 store i16 2, i16* %sin_family, align 4 %call1 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)) #6 %sin_addr = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %service, i32 0, i32 2 %s_addr = getelementptr inbounds %struct.in_addr, %struct.in_addr* %sin_addr, i32 0, i32 0 store i32 %call1, i32* %s_addr, align 4 %call2 = call zeroext i16 @htons(i16 zeroext 27015) #7 %sin_port = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %service, i32 0, i32 1 store i16 %call2, i16* %sin_port, align 2 %2 = load i32, i32* %connectSocket, align 4 %3 = bitcast %struct.sockaddr_in* %service to %struct.sockaddr* %call3 = call i32 @connect(i32 %2, %struct.sockaddr* %3, i32 16) %cmp4 = icmp eq i32 %call3, -1 br i1 %cmp4, label %if.then5, label %if.end6 if.then5: ; preds = %if.end br label %do.end if.end6: ; preds = %if.end %4 = load i32, i32* %connectSocket, align 4 %arraydecay = getelementptr inbounds [14 x i8], [14 x i8]* %inputBuffer, i64 0, i64 0 %call7 = call i64 @recv(i32 %4, i8* %arraydecay, i64 13, i32 0) %conv = trunc i64 %call7 to i32 store i32 %conv, i32* %recvResult, align 4 %5 = load i32, i32* %recvResult, align 4 %cmp8 = icmp eq i32 %5, -1 br i1 %cmp8, label %if.then12, label %lor.lhs.false lor.lhs.false: ; preds = %if.end6 %6 = load i32, i32* %recvResult, align 4 %cmp10 = icmp eq i32 %6, 0 br i1 %cmp10, label %if.then12, label %if.end13 if.then12: ; preds = %lor.lhs.false, %if.end6 br label %do.end if.end13: ; preds = %lor.lhs.false %7 = load i32, i32* %recvResult, align 4 %idxprom = sext i32 %7 to i64 %arrayidx = getelementptr inbounds [14 x i8], [14 x i8]* %inputBuffer, i64 0, i64 %idxprom store i8 0, i8* %arrayidx, align 1 %arraydecay14 = getelementptr inbounds [14 x i8], [14 x i8]* %inputBuffer, i64 0, i64 0 %call15 = call i32 @atoi(i8* %arraydecay14) #8 store i32 %call15, i32* %data, align 4 br label %do.end do.end: ; preds = %if.end13, %if.then12, %if.then5, %if.then %8 = load i32, i32* %connectSocket, align 4 %cmp16 = icmp ne i32 %8, -1 br i1 %cmp16, label %if.then18, label %if.end20 if.then18: ; preds = %do.end %9 = load i32, i32* %connectSocket, align 4 %call19 = call i32 @close(i32 %9) br label %if.end20 if.end20: ; preds = %if.then18, %do.end %10 = bitcast [10 x i32]* %buffer to i8* call void @llvm.memset.p0i8.i64(i8* align 16 %10, i8 0, i64 40, i1 false) %11 = load i32, i32* %data, align 4 %cmp21 = icmp sge i32 %11, 0 br i1 %cmp21, label %land.lhs.true, label %if.else land.lhs.true: ; preds = %if.end20 %12 = load i32, i32* %data, align 4 %cmp23 = icmp slt i32 %12, 10 br i1 %cmp23, label %if.then25, label %if.else if.then25: ; preds = %land.lhs.true %13 = load i32, i32* %data, align 4 %idxprom26 = sext i32 %13 to i64 %arrayidx27 = getelementptr inbounds [10 x i32], [10 x i32]* %buffer, i64 0, i64 %idxprom26 store i32 1, i32* %arrayidx27, align 4 store i32 0, i32* %i, align 4 br label %for.cond for.cond: ; preds = %for.inc, %if.then25 %14 = load i32, i32* %i, align 4 %cmp28 = icmp slt i32 %14, 10 br i1 %cmp28, label %for.body, label %for.end for.body: ; preds = %for.cond %15 = load i32, i32* %i, align 4 %idxprom30 = sext i32 %15 to i64 %arrayidx31 = getelementptr inbounds [10 x i32], [10 x i32]* %buffer, i64 0, i64 %idxprom30 %16 = load i32, i32* %arrayidx31, align 4 call void @printIntLine(i32 %16) br label %for.inc for.inc: ; preds = %for.body %17 = load i32, i32* %i, align 4 %inc = add nsw i32 %17, 1 store i32 %inc, i32* %i, align 4 br label %for.cond for.end: ; preds = %for.cond br label %if.end32 if.else: ; preds = %land.lhs.true, %if.end20 call void @printLine(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0)) br label %if.end32 if.end32: ; preds = %if.else, %for.end ret void } ; Function Attrs: noinline nounwind optnone uwtable define internal void @goodG2B1() #0 { entry: %data = alloca i32, align 4 %i = alloca i32, align 4 %buffer = alloca [10 x i32], align 16 store i32 -1, i32* %data, align 4 store i32 7, i32* %data, align 4 %0 = bitcast [10 x i32]* %buffer to i8* call void @llvm.memset.p0i8.i64(i8* align 16 %0, i8 0, i64 40, i1 false) %1 = load i32, i32* %data, align 4 %cmp = icmp sge i32 %1, 0 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %2 = load i32, i32* %data, align 4 %idxprom = sext i32 %2 to i64 %arrayidx = getelementptr inbounds [10 x i32], [10 x i32]* %buffer, i64 0, i64 %idxprom store i32 1, i32* %arrayidx, align 4 store i32 0, i32* %i, align 4 br label %for.cond for.cond: ; preds = %for.inc, %if.then %3 = load i32, i32* %i, align 4 %cmp1 = icmp slt i32 %3, 10 br i1 %cmp1, label %for.body, label %for.end for.body: ; preds = %for.cond %4 = load i32, i32* %i, align 4 %idxprom2 = sext i32 %4 to i64 %arrayidx3 = getelementptr inbounds [10 x i32], [10 x i32]* %buffer, i64 0, i64 %idxprom2 %5 = load i32, i32* %arrayidx3, align 4 call void @printIntLine(i32 %5) br label %for.inc for.inc: ; preds = %for.body %6 = load i32, i32* %i, align 4 %inc = add nsw i32 %6, 1 store i32 %inc, i32* %i, align 4 br label %for.cond for.end: ; preds = %for.cond br label %if.end if.else: ; preds = %entry call void @printLine(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0)) br label %if.end if.end: ; preds = %if.else, %for.end ret void } ; Function Attrs: noinline nounwind optnone uwtable define internal void @goodG2B2() #0 { entry: %data = alloca i32, align 4 %i = alloca i32, align 4 %buffer = alloca [10 x i32], align 16 store i32 -1, i32* %data, align 4 store i32 7, i32* %data, align 4 %0 = bitcast [10 x i32]* %buffer to i8* call void @llvm.memset.p0i8.i64(i8* align 16 %0, i8 0, i64 40, i1 false) %1 = load i32, i32* %data, align 4 %cmp = icmp sge i32 %1, 0 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %2 = load i32, i32* %data, align 4 %idxprom = sext i32 %2 to i64 %arrayidx = getelementptr inbounds [10 x i32], [10 x i32]* %buffer, i64 0, i64 %idxprom store i32 1, i32* %arrayidx, align 4 store i32 0, i32* %i, align 4 br label %for.cond for.cond: ; preds = %for.inc, %if.then %3 = load i32, i32* %i, align 4 %cmp1 = icmp slt i32 %3, 10 br i1 %cmp1, label %for.body, label %for.end for.body: ; preds = %for.cond %4 = load i32, i32* %i, align 4 %idxprom2 = sext i32 %4 to i64 %arrayidx3 = getelementptr inbounds [10 x i32], [10 x i32]* %buffer, i64 0, i64 %idxprom2 %5 = load i32, i32* %arrayidx3, align 4 call void @printIntLine(i32 %5) br label %for.inc for.inc: ; preds = %for.body %6 = load i32, i32* %i, align 4 %inc = add nsw i32 %6, 1 store i32 %inc, i32* %i, align 4 br label %for.cond for.end: ; preds = %for.cond br label %if.end if.else: ; preds = %entry call void @printLine(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0)) br label %if.end if.end: ; preds = %if.else, %for.end ret void } attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } attributes #1 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } attributes #2 = { argmemonly nounwind willreturn writeonly } attributes #3 = { nounwind readnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } attributes #4 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } attributes #5 = { nounwind readonly "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } attributes #6 = { nounwind } attributes #7 = { nounwind readnone } attributes #8 = { nounwind readonly } !llvm.module.flags = !{!0} !llvm.ident = !{!1} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{!"clang version 11.1.0"}
### Human: Refine the following lifted llvm ir, target datalayout = "e-m:e-p:64:64-i64:64-f80:128-n8:16:32:64-S128" @global_var_f = local_unnamed_addr constant [3 x i8] c"%(\00" @global_var_280 = local_unnamed_addr constant i64 8826368164358 @global_var_1d6 = constant [21 x i8] c"Benign, fixed string\00" @global_var_2a8 = local_unnamed_addr global i32 0 define i64 @_GLOBAL_OFFSET_TABLE_.1() local_unnamed_addr { dec_label_pc_0: %0 = alloca i32* %rax.0.reg2mem = alloca i64, !insn.addr !0 %1 = load i32*, i32** %0 %stack_var_-424 = alloca i64, align 8 %2 = call i64 @__readfsqword(i64 40), !insn.addr !1 %3 = load i32, i32* @global_var_2a8, align 4, !insn.addr !2 %4 = icmp eq i32 %3, 5, !insn.addr !3 %5 = icmp eq i1 %4, false, !insn.addr !4 br i1 %5, label %dec_label_pc_33, label %dec_label_pc_25, !insn.addr !4 dec_label_pc_25: ; preds = %dec_label_pc_0 %6 = zext i32 %3 to i64, !insn.addr !2 ret i64 %6, !insn.addr !4 dec_label_pc_33: ; preds = %dec_label_pc_0 %7 = bitcast i64* %stack_var_-424 to i8*, !insn.addr !5 call void @__asm_rep_stosq_memset(i8* nonnull %7, i64 0, i64 50), !insn.addr !5 %8 = ptrtoint i32* %1 to i64, !insn.addr !6 %9 = call i64 @memmove(i64 %8, i64* nonnull %stack_var_-424, i64 400, i64* nonnull %stack_var_-424), !insn.addr !7 %10 = load i32, i32* %1, align 4, !insn.addr !8 %11 = zext i32 %10 to i64, !insn.addr !9 %12 = call i64 @printIntLine(i64 %11), !insn.addr !10 %13 = call i64 @__readfsqword(i64 40), !insn.addr !11 %14 = icmp eq i64 %2, %13, !insn.addr !11 store i64 0, i64* %rax.0.reg2mem, !insn.addr !12 br i1 %14, label %dec_label_pc_8d, label %dec_label_pc_88, !insn.addr !12 dec_label_pc_88: ; preds = %dec_label_pc_33 %15 = call i64 @__stack_chk_fail(), !insn.addr !13 store i64 %15, i64* %rax.0.reg2mem, !insn.addr !13 br label %dec_label_pc_8d, !insn.addr !13 dec_label_pc_8d: ; preds = %dec_label_pc_88, %dec_label_pc_33 %rax.0.reload = load i64, i64* %rax.0.reg2mem ret i64 %rax.0.reload, !insn.addr !14 } define i64 @goodG2B1() local_unnamed_addr { dec_label_pc_8f: %rax.0.reg2mem = alloca i64, !insn.addr !15 %stack_var_-832.0.reg2mem = alloca i32*, !insn.addr !15 %stack_var_-424 = alloca i64, align 8 %stack_var_-824 = alloca i64, align 8 %0 = call i64 @__readfsqword(i64 40), !insn.addr !16 %1 = load i32, i32* @global_var_2a8, align 4, !insn.addr !17 %2 = icmp eq i32 %1, 5, !insn.addr !18 br i1 %2, label %dec_label_pc_c2, label %dec_label_pc_b4, !insn.addr !19 dec_label_pc_b4: ; preds = %dec_label_pc_8f %3 = call i64 @printLine(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @global_var_1d6, i64 0, i64 0)), !insn.addr !20 br label %dec_label_pc_d0, !insn.addr !21 dec_label_pc_c2: ; preds = %dec_label_pc_8f %4 = bitcast i64* %stack_var_-824 to i32* store i32* %4, i32** %stack_var_-832.0.reg2mem, !insn.addr !22 br label %dec_label_pc_d0, !insn.addr !22 dec_label_pc_d0: ; preds = %dec_label_pc_c2, %dec_label_pc_b4 %stack_var_-832.0.reload = load i32*, i32** %stack_var_-832.0.reg2mem %5 = bitcast i64* %stack_var_-424 to i8*, !insn.addr !23 call void @__asm_rep_stosq_memset(i8* nonnull %5, i64 0, i64 50), !insn.addr !23 %6 = ptrtoint i32* %stack_var_-832.0.reload to i64, !insn.addr !24 %7 = call i64 @memmove(i64 %6, i64* nonnull %stack_var_-424, i64 400, i64* nonnull %stack_var_-424), !insn.addr !25 %8 = load i32, i32* %stack_var_-832.0.reload, align 4, !insn.addr !26 %9 = zext i32 %8 to i64, !insn.addr !27 %10 = call i64 @printIntLine(i64 %9), !insn.addr !28 %11 = call i64 @__readfsqword(i64 40), !insn.addr !29 %12 = icmp eq i64 %0, %11, !insn.addr !29 store i64 0, i64* %rax.0.reg2mem, !insn.addr !30 br i1 %12, label %dec_label_pc_12a, label %dec_label_pc_125, !insn.addr !30 dec_label_pc_125: ; preds = %dec_label_pc_d0 %13 = call i64 @__stack_chk_fail(), !insn.addr !31 store i64 %13, i64* %rax.0.reg2mem, !insn.addr !31 br label %dec_label_pc_12a, !insn.addr !31 dec_label_pc_12a: ; preds = %dec_label_pc_125, %dec_label_pc_d0 %rax.0.reload = load i64, i64* %rax.0.reg2mem ret i64 %rax.0.reload, !insn.addr !32 } define i64 @goodG2B2() local_unnamed_addr { dec_label_pc_12c: %0 = alloca i32* %rax.0.reg2mem = alloca i64, !insn.addr !33 %stack_var_-424 = alloca i64, align 8 %1 = load i32*, i32** %0 %stack_var_-824 = alloca i64, align 8 %2 = call i64 @__readfsqword(i64 40), !insn.addr !34 %3 = load i32, i32* @global_var_2a8, align 4, !insn.addr !35 %4 = icmp eq i32 %3, 5, !insn.addr !36 %5 = icmp eq i1 %4, false, !insn.addr !37 %6 = bitcast i64* %stack_var_-824 to i32* %spec.select = select i1 %5, i32* %1, i32* %6 %7 = bitcast i64* %stack_var_-424 to i8*, !insn.addr !38 call void @__asm_rep_stosq_memset(i8* nonnull %7, i64 0, i64 50), !insn.addr !38 %8 = ptrtoint i32* %spec.select to i64, !insn.addr !39 %9 = call i64 @memmove(i64 %8, i64* nonnull %stack_var_-424, i64 400, i64* nonnull %stack_var_-424), !insn.addr !40 %10 = load i32, i32* %spec.select, align 4, !insn.addr !41 %11 = zext i32 %10 to i64, !insn.addr !42 %12 = call i64 @printIntLine(i64 %11), !insn.addr !43 %13 = call i64 @__readfsqword(i64 40), !insn.addr !44 %14 = icmp eq i64 %2, %13, !insn.addr !44 store i64 0, i64* %rax.0.reg2mem, !insn.addr !45 br i1 %14, label %dec_label_pc_1b9, label %dec_label_pc_1b4, !insn.addr !45 dec_label_pc_1b4: ; preds = %dec_label_pc_12c %15 = call i64 @__stack_chk_fail(), !insn.addr !46 store i64 %15, i64* %rax.0.reg2mem, !insn.addr !46 br label %dec_label_pc_1b9, !insn.addr !46 dec_label_pc_1b9: ; preds = %dec_label_pc_1b4, %dec_label_pc_12c %rax.0.reload = load i64, i64* %rax.0.reg2mem ret i64 %rax.0.reload, !insn.addr !47 } define i64 @CWE121_Stack_Based_Buffer_Overflow__CWE805_int_declare_memmove_14_good() local_unnamed_addr { dec_label_pc_1bb: %0 = call i64 @goodG2B1(), !insn.addr !48 %1 = call i64 @goodG2B2(), !insn.addr !49 ret i64 %1, !insn.addr !50 } declare i64 @memmove(i64, i64*, i64, i64*) local_unnamed_addr declare i64 @printIntLine(i64) local_unnamed_addr declare i64 @__stack_chk_fail() local_unnamed_addr declare i64 @printLine(i8*) local_unnamed_addr declare void @__asm_rep_stosq_memset(i8*, i64, i64) local_unnamed_addr declare i64 @__readfsqword(i64) local_unnamed_addr !0 = !{i64 0} !1 = !{i64 11} !2 = !{i64 26} !3 = !{i64 32} !4 = !{i64 35} !5 = !{i64 71} !6 = !{i64 81} !7 = !{i64 99} !8 = !{i64 111} !9 = !{i64 113} !10 = !{i64 115} !11 = !{i64 125} !12 = !{i64 134} !13 = !{i64 136} !14 = !{i64 142} !15 = !{i64 143} !16 = !{i64 154} !17 = !{i64 169} !18 = !{i64 175} !19 = !{i64 178} !20 = !{i64 187} !21 = !{i64 192} !22 = !{i64 201} !23 = !{i64 228} !24 = !{i64 238} !25 = !{i64 256} !26 = !{i64 268} !27 = !{i64 270} !28 = !{i64 272} !29 = !{i64 282} !30 = !{i64 291} !31 = !{i64 293} !32 = !{i64 299} !33 = !{i64 300} !34 = !{i64 311} !35 = !{i64 326} !36 = !{i64 332} !37 = !{i64 335} !38 = !{i64 371} !39 = !{i64 381} !40 = !{i64 399} !41 = !{i64 411} !42 = !{i64 413} !43 = !{i64 415} !44 = !{i64 425} !45 = !{i64 434} !46 = !{i64 436} !47 = !{i64 442} !48 = !{i64 452} !49 = !{i64 462} !50 = !{i64 469} ### Assistant: @globalFive = external dso_local global i32, align 4 @.str = private unnamed_addr constant [21 x i8] c"Benign, fixed string\00", align 1 ; Function Attrs: noinline nounwind optnone uwtable define dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE805_int_declare_memmove_14_bad() #0 { entry: %data = alloca i32*, align 8 %dataBadBuffer = alloca [50 x i32], align 16 %dataGoodBuffer = alloca [100 x i32], align 16 %source = alloca [100 x i32], align 16 %0 = load i32, i32* @globalFive, align 4 %cmp = icmp eq i32 %0, 5 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %arraydecay = getelementptr inbounds [50 x i32], [50 x i32]* %dataBadBuffer, i64 0, i64 0 store i32* %arraydecay, i32** %data, align 8 br label %if.end if.end: ; preds = %if.then, %entry %1 = bitcast [100 x i32]* %source to i8* call void @llvm.memset.p0i8.i64(i8* align 16 %1, i8 0, i64 400, i1 false) %2 = load i32*, i32** %data, align 8 %3 = bitcast i32* %2 to i8* %arraydecay1 = getelementptr inbounds [100 x i32], [100 x i32]* %source, i64 0, i64 0 %4 = bitcast i32* %arraydecay1 to i8* call void @llvm.memmove.p0i8.p0i8.i64(i8* align 4 %3, i8* align 16 %4, i64 400, i1 false) %5 = load i32*, i32** %data, align 8 %arrayidx = getelementptr inbounds i32, i32* %5, i64 0 %6 = load i32, i32* %arrayidx, align 4 call void @printIntLine(i32 %6) ret void } ; Function Attrs: argmemonly nounwind willreturn writeonly declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #1 ; Function Attrs: argmemonly nounwind willreturn declare void @llvm.memmove.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i1 immarg) #2 declare dso_local void @printIntLine(i32) #3 ; Function Attrs: noinline nounwind optnone uwtable define dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE805_int_declare_memmove_14_good() #0 { entry: call void @goodG2B1() call void @goodG2B2() ret void } ; Function Attrs: noinline nounwind optnone uwtable define internal void @goodG2B1() #0 { entry: %data = alloca i32*, align 8 %dataBadBuffer = alloca [50 x i32], align 16 %dataGoodBuffer = alloca [100 x i32], align 16 %source = alloca [100 x i32], align 16 %0 = load i32, i32* @globalFive, align 4 %cmp = icmp ne i32 %0, 5 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry call void @printLine(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0)) br label %if.end if.else: ; preds = %entry %arraydecay = getelementptr inbounds [100 x i32], [100 x i32]* %dataGoodBuffer, i64 0, i64 0 store i32* %arraydecay, i32** %data, align 8 br label %if.end if.end: ; preds = %if.else, %if.then %1 = bitcast [100 x i32]* %source to i8* call void @llvm.memset.p0i8.i64(i8* align 16 %1, i8 0, i64 400, i1 false) %2 = load i32*, i32** %data, align 8 %3 = bitcast i32* %2 to i8* %arraydecay1 = getelementptr inbounds [100 x i32], [100 x i32]* %source, i64 0, i64 0 %4 = bitcast i32* %arraydecay1 to i8* call void @llvm.memmove.p0i8.p0i8.i64(i8* align 4 %3, i8* align 16 %4, i64 400, i1 false) %5 = load i32*, i32** %data, align 8 %arrayidx = getelementptr inbounds i32, i32* %5, i64 0 %6 = load i32, i32* %arrayidx, align 4 call void @printIntLine(i32 %6) ret void } declare dso_local void @printLine(i8*) #3 ; Function Attrs: noinline nounwind optnone uwtable define internal void @goodG2B2() #0 { entry: %data = alloca i32*, align 8 %dataBadBuffer = alloca [50 x i32], align 16 %dataGoodBuffer = alloca [100 x i32], align 16 %source = alloca [100 x i32], align 16 %0 = load i32, i32* @globalFive, align 4 %cmp = icmp eq i32 %0, 5 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %arraydecay = getelementptr inbounds [100 x i32], [100 x i32]* %dataGoodBuffer, i64 0, i64 0 store i32* %arraydecay, i32** %data, align 8 br label %if.end if.end: ; preds = %if.then, %entry %1 = bitcast [100 x i32]* %source to i8* call void @llvm.memset.p0i8.i64(i8* align 16 %1, i8 0, i64 400, i1 false) %2 = load i32*, i32** %data, align 8 %3 = bitcast i32* %2 to i8* %arraydecay1 = getelementptr inbounds [100 x i32], [100 x i32]* %source, i64 0, i64 0 %4 = bitcast i32* %arraydecay1 to i8* call void @llvm.memmove.p0i8.p0i8.i64(i8* align 4 %3, i8* align 16 %4, i64 400, i1 false) %5 = load i32*, i32** %data, align 8 %arrayidx = getelementptr inbounds i32, i32* %5, i64 0 %6 = load i32, i32* %arrayidx, align 4 call void @printIntLine(i32 %6) ret void } attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } attributes #1 = { argmemonly nounwind willreturn writeonly } attributes #2 = { argmemonly nounwind willreturn } attributes #3 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } !llvm.module.flags = !{!0} !llvm.ident = !{!1} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{!"clang version 11.1.0"}
### Human: Refine the following lifted llvm ir, target datalayout = "e-m:e-p:64:64-i64:64-f80:128-n8:16:32:64-S128" define i64 @_GLOBAL_OFFSET_TABLE_.1(i64 %arg1) local_unnamed_addr { dec_label_pc_0: %0 = and i64 %arg1, 4294967295, !insn.addr !0 %1 = call i64 @CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_54e_badSink(i64 %0), !insn.addr !1 ret i64 %1, !insn.addr !2 } define i64 @CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_54d_goodG2BSink(i64 %arg1) local_unnamed_addr { dec_label_pc_18: %0 = and i64 %arg1, 4294967295, !insn.addr !3 %1 = call i64 @CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_54e_goodG2BSink(i64 %0), !insn.addr !4 ret i64 %1, !insn.addr !5 } define i64 @CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_54d_goodB2GSink(i64 %arg1) local_unnamed_addr { dec_label_pc_30: %0 = and i64 %arg1, 4294967295, !insn.addr !6 %1 = call i64 @CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_54e_goodB2GSink(i64 %0), !insn.addr !7 ret i64 %1, !insn.addr !8 } declare i64 @CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_54e_badSink(i64) local_unnamed_addr declare i64 @CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_54e_goodG2BSink(i64) local_unnamed_addr declare i64 @CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_54e_goodB2GSink(i64) local_unnamed_addr !0 = !{i64 14} !1 = !{i64 16} !2 = !{i64 23} !3 = !{i64 38} !4 = !{i64 40} !5 = !{i64 47} !6 = !{i64 62} !7 = !{i64 64} !8 = !{i64 71} ### Assistant: ; Function Attrs: noinline nounwind optnone uwtable define dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_54d_badSink(i32 %data) #0 { entry: %data.addr = alloca i32, align 4 store i32 %data, i32* %data.addr, align 4 %0 = load i32, i32* %data.addr, align 4 call void @CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_54e_badSink(i32 %0) ret void } declare dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_54e_badSink(i32) #1 ; Function Attrs: noinline nounwind optnone uwtable define dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_54d_goodG2BSink(i32 %data) #0 { entry: %data.addr = alloca i32, align 4 store i32 %data, i32* %data.addr, align 4 %0 = load i32, i32* %data.addr, align 4 call void @CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_54e_goodG2BSink(i32 %0) ret void } declare dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_54e_goodG2BSink(i32) #1 ; Function Attrs: noinline nounwind optnone uwtable define dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_54d_goodB2GSink(i32 %data) #0 { entry: %data.addr = alloca i32, align 4 store i32 %data, i32* %data.addr, align 4 %0 = load i32, i32* %data.addr, align 4 call void @CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_54e_goodB2GSink(i32 %0) ret void } declare dso_local void @CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_54e_goodB2GSink(i32) #1 attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } !llvm.module.flags = !{!0} !llvm.ident = !{!1} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{!"clang version 11.1.0"}