; LLVM IR from tezc/sc :: heap (heap_test)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.sc_heap = type { i64, i64, ptr }
%struct.sc_heap_data = type { i64, ptr }

@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [58 x i8], align 1
@__PRETTY_FUNCTION__.test1 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [35 x i8], align 1
@__const.test1.arr = external hidden unnamed_addr constant [10 x i64], align 16
@.str.16 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

declare zeroext i1 @sc_heap_init(ptr noundef, i64 noundef) #2

declare zeroext i1 @sc_heap_add(ptr noundef, i64 noundef, ptr noundef) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare ptr @sc_heap_pop(ptr noundef) #2

declare void @sc_heap_term(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @test1() #3 {
  %1 = alloca %struct.sc_heap, align 8
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca [10 x i64], align 16
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 24, ptr %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  %7 = call zeroext i1 @sc_heap_init(ptr noundef %1, i64 noundef 0)
  %8 = call zeroext i1 @sc_heap_add(ptr noundef %1, i64 noundef 100, ptr noundef @.str.7)
  %9 = call ptr @sc_heap_pop(ptr noundef %1)
  store ptr %9, ptr %2, align 8, !tbaa !5
  %10 = load ptr, ptr %2, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.sc_heap_data, ptr %10, i32 0, i32 0
  %12 = load i64, ptr %11, align 8, !tbaa !9
  %13 = icmp eq i64 %12, 100
  br i1 %13, label %14, label %15

14:                                               ; preds = %0
  br label %16

15:                                               ; preds = %0
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.9, i32 noundef 62, ptr noundef @__PRETTY_FUNCTION__.test1) #7
  unreachable

16:                                               ; preds = %14
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.sc_heap_data, ptr %17, i32 0, i32 1
  %19 = load ptr, ptr %18, align 8, !tbaa !12
  %20 = call i32 @strcmp(ptr noundef @.str.7, ptr noundef %19) #8
  %21 = icmp eq i32 %20, 0
  br i1 %21, label %22, label %23

22:                                               ; preds = %16
  br label %24

23:                                               ; preds = %16
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str.9, i32 noundef 63, ptr noundef @__PRETTY_FUNCTION__.test1) #7
  unreachable

24:                                               ; preds = %22
  call void @sc_heap_term(ptr noundef %1)
  %25 = call zeroext i1 @sc_heap_add(ptr noundef %1, i64 noundef 100, ptr noundef @.str.7)
  %26 = call ptr @sc_heap_pop(ptr noundef %1)
  store ptr %26, ptr %2, align 8, !tbaa !5
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.sc_heap_data, ptr %27, i32 0, i32 0
  %29 = load i64, ptr %28, align 8, !tbaa !9
  %30 = icmp eq i64 %29, 100
  br i1 %30, label %31, label %32

31:                                               ; preds = %24
  br label %33

32:                                               ; preds = %24
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.9, i32 noundef 68, ptr noundef @__PRETTY_FUNCTION__.test1) #7
  unreachable

33:                                               ; preds = %31
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.sc_heap_data, ptr %34, i32 0, i32 1
  %36 = load ptr, ptr %35, align 8, !tbaa !12
  %37 = call i32 @strcmp(ptr noundef @.str.7, ptr noundef %36) #8
  %38 = icmp eq i32 %37, 0
  br i1 %38, label %39, label %40

39:                                               ; preds = %33
  br label %41

40:                                               ; preds = %33
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str.9, i32 noundef 69, ptr noundef @__PRETTY_FUNCTION__.test1) #7
  unreachable

41:                                               ; preds = %39
  call void @sc_heap_term(ptr noundef %1)
  %42 = call zeroext i1 @sc_heap_init(ptr noundef %1, i64 noundef 9223372036854775807)
  %43 = zext i1 %42 to i32
  %44 = icmp eq i32 %43, 0
  br i1 %44, label %45, label %46

45:                                               ; preds = %41
  br label %47

46:                                               ; preds = %41
  call void @__assert_fail(ptr noundef @.str.11, ptr noundef @.str.9, i32 noundef 72, ptr noundef @__PRETTY_FUNCTION__.test1) #7
  unreachable

47:                                               ; preds = %45
  %48 = call zeroext i1 @sc_heap_init(ptr noundef %1, i64 noundef 3)
  %49 = zext i1 %48 to i32
  %50 = icmp eq i32 %49, 1
  br i1 %50, label %51, label %52

51:                                               ; preds = %47
  br label %53

52:                                               ; preds = %47
  call void @__assert_fail(ptr noundef @.str.12, ptr noundef @.str.9, i32 noundef 73, ptr noundef @__PRETTY_FUNCTION__.test1) #7
  unreachable

53:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !13
  br label %54

54:                                               ; preds = %87, %53
  %55 = load i32, ptr %3, align 4, !tbaa !13
  %56 = icmp slt i32 %55, 1000
  br i1 %56, label %58, label %57

57:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %90

58:                                               ; preds = %54
  %59 = load i32, ptr %3, align 4, !tbaa !13
  %60 = sext i32 %59 to i64
  %61 = load i32, ptr %3, align 4, !tbaa !13
  %62 = sext i32 %61 to i64
  %63 = inttoptr i64 %62 to ptr
  %64 = call zeroext i1 @sc_heap_add(ptr noundef %1, i64 noundef %60, ptr noundef %63)
  %65 = zext i1 %64 to i32
  %66 = icmp eq i32 %65, 1
  br i1 %66, label %67, label %68

67:                                               ; preds = %58
  br label %69

68:                                               ; preds = %58
  call void @__assert_fail(ptr noundef @.str.13, ptr noundef @.str.9, i32 noundef 76, ptr noundef @__PRETTY_FUNCTION__.test1) #7
  unreachable

69:                                               ; preds = %67
  %70 = call ptr @sc_heap_pop(ptr noundef %1)
  store ptr %70, ptr %2, align 8, !tbaa !5
  %71 = load ptr, ptr %2, align 8, !tbaa !5
  %72 = icmp ne ptr %71, null
  br i1 %72, label %73, label %74

73:                                               ; preds = %69
  br label %75

74:                                               ; preds = %69
  call void @__assert_fail(ptr noundef @.str.14, ptr noundef @.str.9, i32 noundef 78, ptr noundef @__PRETTY_FUNCTION__.test1) #7
  unreachable

75:                                               ; preds = %73
  %76 = load ptr, ptr %2, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.sc_heap_data, ptr %76, i32 0, i32 0
  %78 = load i64, ptr %77, align 8, !tbaa !9
  %79 = load ptr, ptr %2, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.sc_heap_data, ptr %79, i32 0, i32 1
  %81 = load ptr, ptr %80, align 8, !tbaa !12
  %82 = ptrtoint ptr %81 to i64
  %83 = icmp eq i64 %78, %82
  br i1 %83, label %84, label %85

84:                                               ; preds = %75
  br label %86

85:                                               ; preds = %75
  call void @__assert_fail(ptr noundef @.str.15, ptr noundef @.str.9, i32 noundef 79, ptr noundef @__PRETTY_FUNCTION__.test1) #7
  unreachable

86:                                               ; preds = %84
  br label %87

87:                                               ; preds = %86
  %88 = load i32, ptr %3, align 4, !tbaa !13
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %3, align 4, !tbaa !13
  br label %54, !llvm.loop !15

90:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 80, ptr %4) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %4, ptr align 16 @__const.test1.arr, i64 80, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !13
  br label %91

91:                                               ; preds = %112, %90
  %92 = load i32, ptr %5, align 4, !tbaa !13
  %93 = icmp slt i32 %92, 10
  br i1 %93, label %95, label %94

94:                                               ; preds = %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %115

95:                                               ; preds = %91
  %96 = load i32, ptr %5, align 4, !tbaa !13
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [10 x i64], ptr %4, i64 0, i64 %97
  %99 = load i64, ptr %98, align 8, !tbaa !17
  %100 = load i32, ptr %5, align 4, !tbaa !13
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [10 x i64], ptr %4, i64 0, i64 %101
  %103 = load i64, ptr %102, align 8, !tbaa !17
  %104 = mul nsw i64 %103, 2
  %105 = inttoptr i64 %104 to ptr
  %106 = call zeroext i1 @sc_heap_add(ptr noundef %1, i64 noundef %99, ptr noundef %105)
  %107 = zext i1 %106 to i32
  %108 = icmp eq i32 %107, 1
  br i1 %108, label %109, label %110

109:                                              ; preds = %95
  br label %111

110:                                              ; preds = %95
  call void @__assert_fail(ptr noundef @.str.16, ptr noundef @.str.9, i32 noundef 86, ptr noundef @__PRETTY_FUNCTION__.test1) #7
  unreachable

111:                                              ; preds = %109
  br label %112

112:                                              ; preds = %111
  %113 = load i32, ptr %5, align 4, !tbaa !13
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %5, align 4, !tbaa !13
  br label %91, !llvm.loop !18

115:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !13
  br label %116

116:                                              ; preds = %147, %115
  %117 = load i32, ptr %6, align 4, !tbaa !13
  %118 = icmp slt i32 %117, 10
  br i1 %118, label %120, label %119

119:                                              ; preds = %116
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %150

120:                                              ; preds = %116
  %121 = call ptr @sc_heap_pop(ptr noundef %1)
  store ptr %121, ptr %2, align 8, !tbaa !5
  %122 = load ptr, ptr %2, align 8, !tbaa !5
  %123 = icmp ne ptr %122, null
  br i1 %123, label %124, label %125

124:                                              ; preds = %120
  br label %126

125:                                              ; preds = %120
  call void @__assert_fail(ptr noundef @.str.14, ptr noundef @.str.9, i32 noundef 91, ptr noundef @__PRETTY_FUNCTION__.test1) #7
  unreachable

126:                                              ; preds = %124
  %127 = load ptr, ptr %2, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.sc_heap_data, ptr %127, i32 0, i32 0
  %129 = load i64, ptr %128, align 8, !tbaa !9
  %130 = load i32, ptr %6, align 4, !tbaa !13
  %131 = sext i32 %130 to i64
  %132 = icmp eq i64 %129, %131
  br i1 %132, label %133, label %134

133:                                              ; preds = %126
  br label %135

134:                                              ; preds = %126
  call void @__assert_fail(ptr noundef @.str.17, ptr noundef @.str.9, i32 noundef 92, ptr noundef @__PRETTY_FUNCTION__.test1) #7
  unreachable

135:                                              ; preds = %133
  %136 = load ptr, ptr %2, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.sc_heap_data, ptr %136, i32 0, i32 1
  %138 = load ptr, ptr %137, align 8, !tbaa !12
  %139 = ptrtoint ptr %138 to i64
  %140 = load i32, ptr %6, align 4, !tbaa !13
  %141 = mul nsw i32 %140, 2
  %142 = sext i32 %141 to i64
  %143 = icmp eq i64 %139, %142
  br i1 %143, label %144, label %145

144:                                              ; preds = %135
  br label %146

145:                                              ; preds = %135
  call void @__assert_fail(ptr noundef @.str.18, ptr noundef @.str.9, i32 noundef 93, ptr noundef @__PRETTY_FUNCTION__.test1) #7
  unreachable

146:                                              ; preds = %144
  br label %147

147:                                              ; preds = %146
  %148 = load i32, ptr %6, align 4, !tbaa !13
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %6, align 4, !tbaa !13
  br label %116, !llvm.loop !19

150:                                              ; preds = %119
  call void @sc_heap_term(ptr noundef %1)
  call void @llvm.lifetime.end.p0(i64 80, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %1) #6
  ret void
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }
attributes #7 = { noreturn nounwind }
attributes #8 = { nounwind willreturn memory(read) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"sc_heap_data", !11, i64 0, !6, i64 8}
!11 = !{!"long", !7, i64 0}
!12 = !{!10, !6, i64 8}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!11, !11, i64 0}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.sc_heap = type { i64, i64, ptr }

@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [58 x i8], align 1
@__PRETTY_FUNCTION__.test1 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [35 x i8], align 1
@__const.test1.arr = external hidden unnamed_addr constant [10 x i64], align 16
@.str.16 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

declare zeroext i1 @sc_heap_init(ptr noundef, i64 noundef) local_unnamed_addr #1

declare zeroext i1 @sc_heap_add(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare ptr @sc_heap_pop(ptr noundef) local_unnamed_addr #1

declare void @sc_heap_term(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @test1() local_unnamed_addr #2 {
  %1 = alloca %struct.sc_heap, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #5
  %2 = call zeroext i1 @sc_heap_init(ptr noundef nonnull %1, i64 noundef 0) #5
  %3 = call zeroext i1 @sc_heap_add(ptr noundef nonnull %1, i64 noundef 100, ptr noundef nonnull @.str.7) #5
  %4 = call ptr @sc_heap_pop(ptr noundef nonnull %1) #5
  %5 = load i64, ptr %4, align 8, !tbaa !5
  %6 = icmp eq i64 %5, 100
  br i1 %6, label %8, label %7

7:                                                ; preds = %0
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.9, i32 noundef 62, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #6
  unreachable

8:                                                ; preds = %0
  %9 = getelementptr inbounds i8, ptr %4, i64 8
  %10 = load ptr, ptr %9, align 8, !tbaa !11
  %11 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) @.str.7, ptr noundef nonnull dereferenceable(1) %10) #7
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %14, label %13

13:                                               ; preds = %8
  call void @__assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.9, i32 noundef 63, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #6
  unreachable

14:                                               ; preds = %8
  call void @sc_heap_term(ptr noundef nonnull %1) #5
  %15 = call zeroext i1 @sc_heap_add(ptr noundef nonnull %1, i64 noundef 100, ptr noundef nonnull @.str.7) #5
  %16 = call ptr @sc_heap_pop(ptr noundef nonnull %1) #5
  %17 = load i64, ptr %16, align 8, !tbaa !5
  %18 = icmp eq i64 %17, 100
  br i1 %18, label %20, label %19

19:                                               ; preds = %14
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.9, i32 noundef 68, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #6
  unreachable

20:                                               ; preds = %14
  %21 = getelementptr inbounds i8, ptr %16, i64 8
  %22 = load ptr, ptr %21, align 8, !tbaa !11
  %23 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) @.str.7, ptr noundef nonnull dereferenceable(1) %22) #7
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %26, label %25

25:                                               ; preds = %20
  call void @__assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.9, i32 noundef 69, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #6
  unreachable

26:                                               ; preds = %20
  call void @sc_heap_term(ptr noundef nonnull %1) #5
  %27 = call zeroext i1 @sc_heap_init(ptr noundef nonnull %1, i64 noundef 9223372036854775807) #5
  br i1 %27, label %28, label %29

28:                                               ; preds = %26
  call void @__assert_fail(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.9, i32 noundef 72, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #6
  unreachable

29:                                               ; preds = %26
  %30 = call zeroext i1 @sc_heap_init(ptr noundef nonnull %1, i64 noundef 3) #5
  br i1 %30, label %.preheader27, label %31

31:                                               ; preds = %29
  call void @__assert_fail(ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.9, i32 noundef 73, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #6
  unreachable

32:                                               ; preds = %43
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 1000
  br i1 %exitcond.not, label %.preheader26.preheader, label %.preheader27, !llvm.loop !12

.preheader26.preheader:                           ; preds = %32
  %33 = load i64, ptr @__const.test1.arr, align 16, !tbaa !14
  %34 = shl nsw i64 %33, 1
  %35 = inttoptr i64 %34 to ptr
  %36 = call zeroext i1 @sc_heap_add(ptr noundef nonnull %1, i64 noundef %33, ptr noundef %35) #5
  br i1 %36, label %.preheader26.1, label %87

.preheader27:                                     ; preds = %29, %32
  %indvars.iv = phi i64 [ %indvars.iv.next, %32 ], [ 0, %29 ]
  %37 = inttoptr i64 %indvars.iv to ptr
  %38 = call zeroext i1 @sc_heap_add(ptr noundef nonnull %1, i64 noundef %indvars.iv, ptr noundef %37) #5
  br i1 %38, label %40, label %39

39:                                               ; preds = %.preheader27
  call void @__assert_fail(ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.9, i32 noundef 76, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #6
  unreachable

40:                                               ; preds = %.preheader27
  %41 = call ptr @sc_heap_pop(ptr noundef nonnull %1) #5
  %.not25 = icmp eq ptr %41, null
  br i1 %.not25, label %42, label %43

42:                                               ; preds = %40
  call void @__assert_fail(ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.9, i32 noundef 78, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #6
  unreachable

43:                                               ; preds = %40
  %44 = load i64, ptr %41, align 8, !tbaa !5
  %45 = getelementptr inbounds i8, ptr %41, i64 8
  %46 = load ptr, ptr %45, align 8, !tbaa !11
  %47 = ptrtoint ptr %46 to i64
  %48 = icmp eq i64 %44, %47
  br i1 %48, label %32, label %49

49:                                               ; preds = %43
  call void @__assert_fail(ptr noundef nonnull @.str.15, ptr noundef nonnull @.str.9, i32 noundef 79, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #6
  unreachable

.preheader26.1:                                   ; preds = %.preheader26.preheader
  %50 = load i64, ptr getelementptr inbounds (i8, ptr @__const.test1.arr, i64 8), align 8, !tbaa !14
  %51 = shl nsw i64 %50, 1
  %52 = inttoptr i64 %51 to ptr
  %53 = call zeroext i1 @sc_heap_add(ptr noundef nonnull %1, i64 noundef %50, ptr noundef %52) #5
  br i1 %53, label %.preheader26.2, label %87

.preheader26.2:                                   ; preds = %.preheader26.1
  %54 = load i64, ptr getelementptr inbounds (i8, ptr @__const.test1.arr, i64 16), align 16, !tbaa !14
  %55 = shl nsw i64 %54, 1
  %56 = inttoptr i64 %55 to ptr
  %57 = call zeroext i1 @sc_heap_add(ptr noundef nonnull %1, i64 noundef %54, ptr noundef %56) #5
  br i1 %57, label %.preheader26.3, label %87

.preheader26.3:                                   ; preds = %.preheader26.2
  %58 = load i64, ptr getelementptr inbounds (i8, ptr @__const.test1.arr, i64 24), align 8, !tbaa !14
  %59 = shl nsw i64 %58, 1
  %60 = inttoptr i64 %59 to ptr
  %61 = call zeroext i1 @sc_heap_add(ptr noundef nonnull %1, i64 noundef %58, ptr noundef %60) #5
  br i1 %61, label %.preheader26.4, label %87

.preheader26.4:                                   ; preds = %.preheader26.3
  %62 = load i64, ptr getelementptr inbounds (i8, ptr @__const.test1.arr, i64 32), align 16, !tbaa !14
  %63 = shl nsw i64 %62, 1
  %64 = inttoptr i64 %63 to ptr
  %65 = call zeroext i1 @sc_heap_add(ptr noundef nonnull %1, i64 noundef %62, ptr noundef %64) #5
  br i1 %65, label %.preheader26.5, label %87

.preheader26.5:                                   ; preds = %.preheader26.4
  %66 = load i64, ptr getelementptr inbounds (i8, ptr @__const.test1.arr, i64 40), align 8, !tbaa !14
  %67 = shl nsw i64 %66, 1
  %68 = inttoptr i64 %67 to ptr
  %69 = call zeroext i1 @sc_heap_add(ptr noundef nonnull %1, i64 noundef %66, ptr noundef %68) #5
  br i1 %69, label %.preheader26.6, label %87

.preheader26.6:                                   ; preds = %.preheader26.5
  %70 = load i64, ptr getelementptr inbounds (i8, ptr @__const.test1.arr, i64 48), align 16, !tbaa !14
  %71 = shl nsw i64 %70, 1
  %72 = inttoptr i64 %71 to ptr
  %73 = call zeroext i1 @sc_heap_add(ptr noundef nonnull %1, i64 noundef %70, ptr noundef %72) #5
  br i1 %73, label %.preheader26.7, label %87

.preheader26.7:                                   ; preds = %.preheader26.6
  %74 = load i64, ptr getelementptr inbounds (i8, ptr @__const.test1.arr, i64 56), align 8, !tbaa !14
  %75 = shl nsw i64 %74, 1
  %76 = inttoptr i64 %75 to ptr
  %77 = call zeroext i1 @sc_heap_add(ptr noundef nonnull %1, i64 noundef %74, ptr noundef %76) #5
  br i1 %77, label %.preheader26.8, label %87

.preheader26.8:                                   ; preds = %.preheader26.7
  %78 = load i64, ptr getelementptr inbounds (i8, ptr @__const.test1.arr, i64 64), align 16, !tbaa !14
  %79 = shl nsw i64 %78, 1
  %80 = inttoptr i64 %79 to ptr
  %81 = call zeroext i1 @sc_heap_add(ptr noundef nonnull %1, i64 noundef %78, ptr noundef %80) #5
  br i1 %81, label %.preheader26.9, label %87

.preheader26.9:                                   ; preds = %.preheader26.8
  %82 = load i64, ptr getelementptr inbounds (i8, ptr @__const.test1.arr, i64 72), align 8, !tbaa !14
  %83 = shl nsw i64 %82, 1
  %84 = inttoptr i64 %83 to ptr
  %85 = call zeroext i1 @sc_heap_add(ptr noundef nonnull %1, i64 noundef %82, ptr noundef %84) #5
  br i1 %85, label %.preheader.preheader, label %87

.preheader.preheader:                             ; preds = %.preheader26.9
  %86 = call ptr @sc_heap_pop(ptr noundef nonnull %1) #5
  %.not = icmp eq ptr %86, null
  br i1 %.not, label %161, label %162

87:                                               ; preds = %.preheader26.9, %.preheader26.8, %.preheader26.7, %.preheader26.6, %.preheader26.5, %.preheader26.4, %.preheader26.3, %.preheader26.2, %.preheader26.1, %.preheader26.preheader
  call void @__assert_fail(ptr noundef nonnull @.str.16, ptr noundef nonnull @.str.9, i32 noundef 86, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #6
  unreachable

.preheader.1:                                     ; preds = %166
  %88 = call ptr @sc_heap_pop(ptr noundef nonnull %1) #5
  %.not.1 = icmp eq ptr %88, null
  br i1 %.not.1, label %161, label %89

89:                                               ; preds = %.preheader.1
  %90 = load i64, ptr %88, align 8, !tbaa !5
  %91 = icmp eq i64 %90, 1
  br i1 %91, label %92, label %165

92:                                               ; preds = %89
  %93 = getelementptr inbounds i8, ptr %88, i64 8
  %94 = load ptr, ptr %93, align 8, !tbaa !11
  %95 = icmp eq ptr %94, inttoptr (i64 2 to ptr)
  br i1 %95, label %.preheader.2, label %170

.preheader.2:                                     ; preds = %92
  %96 = call ptr @sc_heap_pop(ptr noundef nonnull %1) #5
  %.not.2 = icmp eq ptr %96, null
  br i1 %.not.2, label %161, label %97

97:                                               ; preds = %.preheader.2
  %98 = load i64, ptr %96, align 8, !tbaa !5
  %99 = icmp eq i64 %98, 2
  br i1 %99, label %100, label %165

100:                                              ; preds = %97
  %101 = getelementptr inbounds i8, ptr %96, i64 8
  %102 = load ptr, ptr %101, align 8, !tbaa !11
  %103 = icmp eq ptr %102, inttoptr (i64 4 to ptr)
  br i1 %103, label %.preheader.3, label %170

.preheader.3:                                     ; preds = %100
  %104 = call ptr @sc_heap_pop(ptr noundef nonnull %1) #5
  %.not.3 = icmp eq ptr %104, null
  br i1 %.not.3, label %161, label %105

105:                                              ; preds = %.preheader.3
  %106 = load i64, ptr %104, align 8, !tbaa !5
  %107 = icmp eq i64 %106, 3
  br i1 %107, label %108, label %165

108:                                              ; preds = %105
  %109 = getelementptr inbounds i8, ptr %104, i64 8
  %110 = load ptr, ptr %109, align 8, !tbaa !11
  %111 = icmp eq ptr %110, inttoptr (i64 6 to ptr)
  br i1 %111, label %.preheader.4, label %170

.preheader.4:                                     ; preds = %108
  %112 = call ptr @sc_heap_pop(ptr noundef nonnull %1) #5
  %.not.4 = icmp eq ptr %112, null
  br i1 %.not.4, label %161, label %113

113:                                              ; preds = %.preheader.4
  %114 = load i64, ptr %112, align 8, !tbaa !5
  %115 = icmp eq i64 %114, 4
  br i1 %115, label %116, label %165

116:                                              ; preds = %113
  %117 = getelementptr inbounds i8, ptr %112, i64 8
  %118 = load ptr, ptr %117, align 8, !tbaa !11
  %119 = icmp eq ptr %118, inttoptr (i64 8 to ptr)
  br i1 %119, label %.preheader.5, label %170

.preheader.5:                                     ; preds = %116
  %120 = call ptr @sc_heap_pop(ptr noundef nonnull %1) #5
  %.not.5 = icmp eq ptr %120, null
  br i1 %.not.5, label %161, label %121

121:                                              ; preds = %.preheader.5
  %122 = load i64, ptr %120, align 8, !tbaa !5
  %123 = icmp eq i64 %122, 5
  br i1 %123, label %124, label %165

124:                                              ; preds = %121
  %125 = getelementptr inbounds i8, ptr %120, i64 8
  %126 = load ptr, ptr %125, align 8, !tbaa !11
  %127 = icmp eq ptr %126, inttoptr (i64 10 to ptr)
  br i1 %127, label %.preheader.6, label %170

.preheader.6:                                     ; preds = %124
  %128 = call ptr @sc_heap_pop(ptr noundef nonnull %1) #5
  %.not.6 = icmp eq ptr %128, null
  br i1 %.not.6, label %161, label %129

129:                                              ; preds = %.preheader.6
  %130 = load i64, ptr %128, align 8, !tbaa !5
  %131 = icmp eq i64 %130, 6
  br i1 %131, label %132, label %165

132:                                              ; preds = %129
  %133 = getelementptr inbounds i8, ptr %128, i64 8
  %134 = load ptr, ptr %133, align 8, !tbaa !11
  %135 = icmp eq ptr %134, inttoptr (i64 12 to ptr)
  br i1 %135, label %.preheader.7, label %170

.preheader.7:                                     ; preds = %132
  %136 = call ptr @sc_heap_pop(ptr noundef nonnull %1) #5
  %.not.7 = icmp eq ptr %136, null
  br i1 %.not.7, label %161, label %137

137:                                              ; preds = %.preheader.7
  %138 = load i64, ptr %136, align 8, !tbaa !5
  %139 = icmp eq i64 %138, 7
  br i1 %139, label %140, label %165

140:                                              ; preds = %137
  %141 = getelementptr inbounds i8, ptr %136, i64 8
  %142 = load ptr, ptr %141, align 8, !tbaa !11
  %143 = icmp eq ptr %142, inttoptr (i64 14 to ptr)
  br i1 %143, label %.preheader.8, label %170

.preheader.8:                                     ; preds = %140
  %144 = call ptr @sc_heap_pop(ptr noundef nonnull %1) #5
  %.not.8 = icmp eq ptr %144, null
  br i1 %.not.8, label %161, label %145

145:                                              ; preds = %.preheader.8
  %146 = load i64, ptr %144, align 8, !tbaa !5
  %147 = icmp eq i64 %146, 8
  br i1 %147, label %148, label %165

148:                                              ; preds = %145
  %149 = getelementptr inbounds i8, ptr %144, i64 8
  %150 = load ptr, ptr %149, align 8, !tbaa !11
  %151 = icmp eq ptr %150, inttoptr (i64 16 to ptr)
  br i1 %151, label %.preheader.9, label %170

.preheader.9:                                     ; preds = %148
  %152 = call ptr @sc_heap_pop(ptr noundef nonnull %1) #5
  %.not.9 = icmp eq ptr %152, null
  br i1 %.not.9, label %161, label %153

153:                                              ; preds = %.preheader.9
  %154 = load i64, ptr %152, align 8, !tbaa !5
  %155 = icmp eq i64 %154, 9
  br i1 %155, label %156, label %165

156:                                              ; preds = %153
  %157 = getelementptr inbounds i8, ptr %152, i64 8
  %158 = load ptr, ptr %157, align 8, !tbaa !11
  %159 = icmp eq ptr %158, inttoptr (i64 18 to ptr)
  br i1 %159, label %160, label %170

160:                                              ; preds = %156
  call void @sc_heap_term(ptr noundef nonnull %1) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #5
  ret void

161:                                              ; preds = %.preheader.9, %.preheader.8, %.preheader.7, %.preheader.6, %.preheader.5, %.preheader.4, %.preheader.3, %.preheader.2, %.preheader.1, %.preheader.preheader
  call void @__assert_fail(ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.9, i32 noundef 91, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #6
  unreachable

162:                                              ; preds = %.preheader.preheader
  %163 = load i64, ptr %86, align 8, !tbaa !5
  %164 = icmp eq i64 %163, 0
  br i1 %164, label %166, label %165

165:                                              ; preds = %153, %145, %137, %129, %121, %113, %105, %97, %89, %162
  call void @__assert_fail(ptr noundef nonnull @.str.17, ptr noundef nonnull @.str.9, i32 noundef 92, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #6
  unreachable

166:                                              ; preds = %162
  %167 = getelementptr inbounds i8, ptr %86, i64 8
  %168 = load ptr, ptr %167, align 8, !tbaa !11
  %169 = icmp eq ptr %168, null
  br i1 %169, label %.preheader.1, label %170

170:                                              ; preds = %156, %148, %140, %132, %124, %116, %108, %100, %92, %166
  call void @__assert_fail(ptr noundef nonnull @.str.18, ptr noundef nonnull @.str.9, i32 noundef 93, ptr noundef nonnull @__PRETTY_FUNCTION__.test1) #6
  unreachable
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { noreturn nounwind }
attributes #7 = { nounwind willreturn memory(read) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"sc_heap_data", !7, i64 0, !10, i64 8}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !10, i64 8}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!7, !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass