; 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.9 = external hidden unnamed_addr constant [58 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.17 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [31 x i8], align 1
@__PRETTY_FUNCTION__.test3 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [25 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

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

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

; 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) #1

declare void @sc_heap_term(ptr noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local void @test3() #3 {
  %1 = alloca [100 x i32], align 16
  %2 = alloca ptr, align 8
  %3 = alloca %struct.sc_heap, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 400, ptr %1) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #4
  %9 = call zeroext i1 @sc_heap_init(ptr noundef %3, i64 noundef 2)
  %10 = zext i1 %9 to i32
  %11 = icmp eq i32 %10, 1
  br i1 %11, label %12, label %13

12:                                               ; preds = %0
  br label %14

13:                                               ; preds = %0
  call void @__assert_fail(ptr noundef @.str.24, ptr noundef @.str.9, i32 noundef 136, ptr noundef @__PRETTY_FUNCTION__.test3) #5
  unreachable

14:                                               ; preds = %12
  %15 = call zeroext i1 @sc_heap_add(ptr noundef %3, i64 noundef 9, ptr noundef inttoptr (i64 9 to ptr))
  %16 = zext i1 %15 to i32
  %17 = icmp eq i32 %16, 1
  br i1 %17, label %18, label %19

18:                                               ; preds = %14
  br label %20

19:                                               ; preds = %14
  call void @__assert_fail(ptr noundef @.str.25, ptr noundef @.str.9, i32 noundef 137, ptr noundef @__PRETTY_FUNCTION__.test3) #5
  unreachable

20:                                               ; preds = %18
  %21 = call ptr @sc_heap_peek(ptr noundef %3)
  store ptr %21, ptr %2, align 8, !tbaa !5
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = icmp ne ptr %22, null
  br i1 %23, label %24, label %25

24:                                               ; preds = %20
  br label %26

25:                                               ; preds = %20
  call void @__assert_fail(ptr noundef @.str.14, ptr noundef @.str.9, i32 noundef 140, ptr noundef @__PRETTY_FUNCTION__.test3) #5
  unreachable

26:                                               ; preds = %24
  %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, 9
  br i1 %30, label %31, label %32

31:                                               ; preds = %26
  br label %33

32:                                               ; preds = %26
  call void @__assert_fail(ptr noundef @.str.26, ptr noundef @.str.9, i32 noundef 141, ptr noundef @__PRETTY_FUNCTION__.test3) #5
  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 = icmp eq ptr %36, inttoptr (i64 9 to ptr)
  br i1 %37, label %38, label %39

38:                                               ; preds = %33
  br label %40

39:                                               ; preds = %33
  call void @__assert_fail(ptr noundef @.str.27, ptr noundef @.str.9, i32 noundef 142, ptr noundef @__PRETTY_FUNCTION__.test3) #5
  unreachable

40:                                               ; preds = %38
  %41 = call ptr @sc_heap_pop(ptr noundef %3)
  store ptr %41, ptr %2, align 8, !tbaa !5
  %42 = load ptr, ptr %2, align 8, !tbaa !5
  %43 = icmp ne ptr %42, null
  br i1 %43, label %44, label %45

44:                                               ; preds = %40
  br label %46

45:                                               ; preds = %40
  call void @__assert_fail(ptr noundef @.str.14, ptr noundef @.str.9, i32 noundef 145, ptr noundef @__PRETTY_FUNCTION__.test3) #5
  unreachable

46:                                               ; preds = %44
  %47 = load ptr, ptr %2, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.sc_heap_data, ptr %47, i32 0, i32 0
  %49 = load i64, ptr %48, align 8, !tbaa !9
  %50 = icmp eq i64 %49, 9
  br i1 %50, label %51, label %52

51:                                               ; preds = %46
  br label %53

52:                                               ; preds = %46
  call void @__assert_fail(ptr noundef @.str.26, ptr noundef @.str.9, i32 noundef 146, ptr noundef @__PRETTY_FUNCTION__.test3) #5
  unreachable

53:                                               ; preds = %51
  %54 = load ptr, ptr %2, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.sc_heap_data, ptr %54, i32 0, i32 1
  %56 = load ptr, ptr %55, align 8, !tbaa !12
  %57 = icmp eq ptr %56, inttoptr (i64 9 to ptr)
  br i1 %57, label %58, label %59

58:                                               ; preds = %53
  br label %60

59:                                               ; preds = %53
  call void @__assert_fail(ptr noundef @.str.27, ptr noundef @.str.9, i32 noundef 147, ptr noundef @__PRETTY_FUNCTION__.test3) #5
  unreachable

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

61:                                               ; preds = %70, %60
  %62 = load i32, ptr %4, align 4, !tbaa !13
  %63 = icmp slt i32 %62, 100
  br i1 %63, label %65, label %64

64:                                               ; preds = %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %73

65:                                               ; preds = %61
  %66 = load i32, ptr %4, align 4, !tbaa !13
  %67 = load i32, ptr %4, align 4, !tbaa !13
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [100 x i32], ptr %1, i64 0, i64 %68
  store i32 %66, ptr %69, align 4, !tbaa !13
  br label %70

70:                                               ; preds = %65
  %71 = load i32, ptr %4, align 4, !tbaa !13
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %4, align 4, !tbaa !13
  br label %61, !llvm.loop !15

73:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !13
  br label %74

74:                                               ; preds = %98, %73
  %75 = load i32, ptr %5, align 4, !tbaa !13
  %76 = icmp slt i32 %75, 100
  br i1 %76, label %78, label %77

77:                                               ; preds = %74
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %101

78:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %79 = load i32, ptr %5, align 4, !tbaa !13
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [100 x i32], ptr %1, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !13
  store i32 %82, ptr %6, align 4, !tbaa !13
  %83 = load i32, ptr %5, align 4, !tbaa !13
  %84 = mul nsw i32 %83, 15
  %85 = srem i32 %84, 100
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [100 x i32], ptr %1, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !13
  %89 = load i32, ptr %5, align 4, !tbaa !13
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [100 x i32], ptr %1, i64 0, i64 %90
  store i32 %88, ptr %91, align 4, !tbaa !13
  %92 = load i32, ptr %6, align 4, !tbaa !13
  %93 = load i32, ptr %5, align 4, !tbaa !13
  %94 = mul nsw i32 %93, 15
  %95 = srem i32 %94, 100
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [100 x i32], ptr %1, i64 0, i64 %96
  store i32 %92, ptr %97, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %98

98:                                               ; preds = %78
  %99 = load i32, ptr %5, align 4, !tbaa !13
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %5, align 4, !tbaa !13
  br label %74, !llvm.loop !17

101:                                              ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !13
  br label %102

102:                                              ; preds = %118, %101
  %103 = load i32, ptr %7, align 4, !tbaa !13
  %104 = icmp slt i32 %103, 100
  br i1 %104, label %106, label %105

105:                                              ; preds = %102
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %121

106:                                              ; preds = %102
  %107 = load i32, ptr %7, align 4, !tbaa !13
  %108 = sext i32 %107 to i64
  %109 = load i32, ptr %7, align 4, !tbaa !13
  %110 = sext i32 %109 to i64
  %111 = inttoptr i64 %110 to ptr
  %112 = call zeroext i1 @sc_heap_add(ptr noundef %3, i64 noundef %108, ptr noundef %111)
  %113 = zext i1 %112 to i32
  %114 = icmp eq i32 %113, 1
  br i1 %114, label %115, label %116

115:                                              ; preds = %106
  br label %117

116:                                              ; preds = %106
  call void @__assert_fail(ptr noundef @.str.13, ptr noundef @.str.9, i32 noundef 160, ptr noundef @__PRETTY_FUNCTION__.test3) #5
  unreachable

117:                                              ; preds = %115
  br label %118

118:                                              ; preds = %117
  %119 = load i32, ptr %7, align 4, !tbaa !13
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %7, align 4, !tbaa !13
  br label %102, !llvm.loop !18

121:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !13
  br label %122

122:                                              ; preds = %152, %121
  %123 = load i32, ptr %8, align 4, !tbaa !13
  %124 = icmp slt i32 %123, 100
  br i1 %124, label %126, label %125

125:                                              ; preds = %122
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %155

126:                                              ; preds = %122
  %127 = call ptr @sc_heap_pop(ptr noundef %3)
  store ptr %127, ptr %2, align 8, !tbaa !5
  %128 = load ptr, ptr %2, align 8, !tbaa !5
  %129 = icmp ne ptr %128, null
  br i1 %129, label %130, label %131

130:                                              ; preds = %126
  br label %132

131:                                              ; preds = %126
  call void @__assert_fail(ptr noundef @.str.14, ptr noundef @.str.9, i32 noundef 165, ptr noundef @__PRETTY_FUNCTION__.test3) #5
  unreachable

132:                                              ; preds = %130
  %133 = load ptr, ptr %2, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.sc_heap_data, ptr %133, i32 0, i32 0
  %135 = load i64, ptr %134, align 8, !tbaa !9
  %136 = load i32, ptr %8, align 4, !tbaa !13
  %137 = sext i32 %136 to i64
  %138 = icmp eq i64 %135, %137
  br i1 %138, label %139, label %140

139:                                              ; preds = %132
  br label %141

140:                                              ; preds = %132
  call void @__assert_fail(ptr noundef @.str.17, ptr noundef @.str.9, i32 noundef 166, ptr noundef @__PRETTY_FUNCTION__.test3) #5
  unreachable

141:                                              ; preds = %139
  %142 = load ptr, ptr %2, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.sc_heap_data, ptr %142, i32 0, i32 1
  %144 = load ptr, ptr %143, align 8, !tbaa !12
  %145 = load i32, ptr %8, align 4, !tbaa !13
  %146 = sext i32 %145 to i64
  %147 = inttoptr i64 %146 to ptr
  %148 = icmp eq ptr %144, %147
  br i1 %148, label %149, label %150

149:                                              ; preds = %141
  br label %151

150:                                              ; preds = %141
  call void @__assert_fail(ptr noundef @.str.28, ptr noundef @.str.9, i32 noundef 167, ptr noundef @__PRETTY_FUNCTION__.test3) #5
  unreachable

151:                                              ; preds = %149
  br label %152

152:                                              ; preds = %151
  %153 = load i32, ptr %8, align 4, !tbaa !13
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %8, align 4, !tbaa !13
  br label %122, !llvm.loop !19

155:                                              ; preds = %125
  %156 = call ptr @sc_heap_peek(ptr noundef %3)
  %157 = icmp eq ptr %156, null
  br i1 %157, label %158, label %159

158:                                              ; preds = %155
  br label %160

159:                                              ; preds = %155
  call void @__assert_fail(ptr noundef @.str.29, ptr noundef @.str.9, i32 noundef 170, ptr noundef @__PRETTY_FUNCTION__.test3) #5
  unreachable

160:                                              ; preds = %158
  %161 = call ptr @sc_heap_pop(ptr noundef %3)
  %162 = icmp eq ptr %161, null
  br i1 %162, label %163, label %164

163:                                              ; preds = %160
  br label %165

164:                                              ; preds = %160
  call void @__assert_fail(ptr noundef @.str.30, ptr noundef @.str.9, i32 noundef 171, ptr noundef @__PRETTY_FUNCTION__.test3) #5
  unreachable

165:                                              ; preds = %163
  %166 = call i64 @sc_heap_size(ptr noundef %3)
  %167 = icmp eq i64 %166, 0
  br i1 %167, label %168, label %169

168:                                              ; preds = %165
  br label %170

169:                                              ; preds = %165
  call void @__assert_fail(ptr noundef @.str.31, ptr noundef @.str.9, i32 noundef 173, ptr noundef @__PRETTY_FUNCTION__.test3) #5
  unreachable

170:                                              ; preds = %168
  %171 = call zeroext i1 @sc_heap_add(ptr noundef %3, i64 noundef 1, ptr noundef null)
  %172 = zext i1 %171 to i32
  %173 = icmp eq i32 %172, 1
  br i1 %173, label %174, label %175

174:                                              ; preds = %170
  br label %176

175:                                              ; preds = %170
  call void @__assert_fail(ptr noundef @.str.32, ptr noundef @.str.9, i32 noundef 174, ptr noundef @__PRETTY_FUNCTION__.test3) #5
  unreachable

176:                                              ; preds = %174
  %177 = call i64 @sc_heap_size(ptr noundef %3)
  %178 = icmp eq i64 %177, 1
  br i1 %178, label %179, label %180

179:                                              ; preds = %176
  br label %181

180:                                              ; preds = %176
  call void @__assert_fail(ptr noundef @.str.33, ptr noundef @.str.9, i32 noundef 175, ptr noundef @__PRETTY_FUNCTION__.test3) #5
  unreachable

181:                                              ; preds = %179
  call void @sc_heap_clear(ptr noundef %3)
  %182 = call i64 @sc_heap_size(ptr noundef %3)
  %183 = icmp eq i64 %182, 0
  br i1 %183, label %184, label %185

184:                                              ; preds = %181
  br label %186

185:                                              ; preds = %181
  call void @__assert_fail(ptr noundef @.str.31, ptr noundef @.str.9, i32 noundef 177, ptr noundef @__PRETTY_FUNCTION__.test3) #5
  unreachable

186:                                              ; preds = %184
  %187 = call zeroext i1 @sc_heap_add(ptr noundef %3, i64 noundef 1, ptr noundef null)
  %188 = zext i1 %187 to i32
  %189 = icmp eq i32 %188, 1
  br i1 %189, label %190, label %191

190:                                              ; preds = %186
  br label %192

191:                                              ; preds = %186
  call void @__assert_fail(ptr noundef @.str.32, ptr noundef @.str.9, i32 noundef 178, ptr noundef @__PRETTY_FUNCTION__.test3) #5
  unreachable

192:                                              ; preds = %190
  %193 = call i64 @sc_heap_size(ptr noundef %3)
  %194 = icmp eq i64 %193, 1
  br i1 %194, label %195, label %196

195:                                              ; preds = %192
  br label %197

196:                                              ; preds = %192
  call void @__assert_fail(ptr noundef @.str.33, ptr noundef @.str.9, i32 noundef 179, ptr noundef @__PRETTY_FUNCTION__.test3) #5
  unreachable

197:                                              ; preds = %195
  call void @sc_heap_term(ptr noundef %3)
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 400, ptr %1) #4
  ret void
}

declare ptr @sc_heap_peek(ptr noundef) #1

declare i64 @sc_heap_size(ptr noundef) #1

declare void @sc_heap_clear(ptr noundef) #1

attributes #0 = { 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 = { 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 #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 = { nounwind }
attributes #5 = { noreturn nounwind }

!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 = distinct !{!17, !16}
!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.9 = external hidden unnamed_addr constant [58 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.17 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [31 x i8], align 1
@__PRETTY_FUNCTION__.test3 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [25 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @test3() local_unnamed_addr #3 {
  %1 = alloca [100 x i32], align 16
  %2 = alloca %struct.sc_heap, align 8
  call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #4
  %3 = call zeroext i1 @sc_heap_init(ptr noundef nonnull %2, i64 noundef 2) #4
  br i1 %3, label %5, label %4

4:                                                ; preds = %0
  call void @__assert_fail(ptr noundef nonnull @.str.24, ptr noundef nonnull @.str.9, i32 noundef 136, ptr noundef nonnull @__PRETTY_FUNCTION__.test3) #5
  unreachable

5:                                                ; preds = %0
  %6 = call zeroext i1 @sc_heap_add(ptr noundef nonnull %2, i64 noundef 9, ptr noundef nonnull inttoptr (i64 9 to ptr)) #4
  br i1 %6, label %8, label %7

7:                                                ; preds = %5
  call void @__assert_fail(ptr noundef nonnull @.str.25, ptr noundef nonnull @.str.9, i32 noundef 137, ptr noundef nonnull @__PRETTY_FUNCTION__.test3) #5
  unreachable

8:                                                ; preds = %5
  %9 = call ptr @sc_heap_peek(ptr noundef nonnull %2) #4
  %.not = icmp eq ptr %9, null
  br i1 %.not, label %10, label %11

10:                                               ; preds = %8
  call void @__assert_fail(ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.9, i32 noundef 140, ptr noundef nonnull @__PRETTY_FUNCTION__.test3) #5
  unreachable

11:                                               ; preds = %8
  %12 = load i64, ptr %9, align 8, !tbaa !5
  %13 = icmp eq i64 %12, 9
  br i1 %13, label %15, label %14

14:                                               ; preds = %11
  call void @__assert_fail(ptr noundef nonnull @.str.26, ptr noundef nonnull @.str.9, i32 noundef 141, ptr noundef nonnull @__PRETTY_FUNCTION__.test3) #5
  unreachable

15:                                               ; preds = %11
  %16 = getelementptr inbounds i8, ptr %9, i64 8
  %17 = load ptr, ptr %16, align 8, !tbaa !11
  %18 = icmp eq ptr %17, inttoptr (i64 9 to ptr)
  br i1 %18, label %20, label %19

19:                                               ; preds = %15
  call void @__assert_fail(ptr noundef nonnull @.str.27, ptr noundef nonnull @.str.9, i32 noundef 142, ptr noundef nonnull @__PRETTY_FUNCTION__.test3) #5
  unreachable

20:                                               ; preds = %15
  %21 = call ptr @sc_heap_pop(ptr noundef nonnull %2) #4
  %.not34 = icmp eq ptr %21, null
  br i1 %.not34, label %22, label %23

22:                                               ; preds = %20
  call void @__assert_fail(ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.9, i32 noundef 145, ptr noundef nonnull @__PRETTY_FUNCTION__.test3) #5
  unreachable

23:                                               ; preds = %20
  %24 = load i64, ptr %21, align 8, !tbaa !5
  %25 = icmp eq i64 %24, 9
  br i1 %25, label %27, label %26

26:                                               ; preds = %23
  call void @__assert_fail(ptr noundef nonnull @.str.26, ptr noundef nonnull @.str.9, i32 noundef 146, ptr noundef nonnull @__PRETTY_FUNCTION__.test3) #5
  unreachable

27:                                               ; preds = %23
  %28 = getelementptr inbounds i8, ptr %21, i64 8
  %29 = load ptr, ptr %28, align 8, !tbaa !11
  %30 = icmp eq ptr %29, inttoptr (i64 9 to ptr)
  br i1 %30, label %vector.body, label %58

vector.body:                                      ; preds = %27
  %31 = getelementptr inbounds i8, ptr %1, i64 16
  store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, ptr %1, align 16, !tbaa !12
  store <4 x i32> <i32 4, i32 5, i32 6, i32 7>, ptr %31, align 16, !tbaa !12
  %32 = getelementptr inbounds i8, ptr %1, i64 32
  %33 = getelementptr inbounds i8, ptr %1, i64 48
  store <4 x i32> <i32 8, i32 9, i32 10, i32 11>, ptr %32, align 16, !tbaa !12
  store <4 x i32> <i32 12, i32 13, i32 14, i32 15>, ptr %33, align 16, !tbaa !12
  %34 = getelementptr inbounds i8, ptr %1, i64 64
  %35 = getelementptr inbounds i8, ptr %1, i64 80
  store <4 x i32> <i32 16, i32 17, i32 18, i32 19>, ptr %34, align 16, !tbaa !12
  store <4 x i32> <i32 20, i32 21, i32 22, i32 23>, ptr %35, align 16, !tbaa !12
  %36 = getelementptr inbounds i8, ptr %1, i64 96
  %37 = getelementptr inbounds i8, ptr %1, i64 112
  store <4 x i32> <i32 24, i32 25, i32 26, i32 27>, ptr %36, align 16, !tbaa !12
  store <4 x i32> <i32 28, i32 29, i32 30, i32 31>, ptr %37, align 16, !tbaa !12
  %38 = getelementptr inbounds i8, ptr %1, i64 128
  %39 = getelementptr inbounds i8, ptr %1, i64 144
  store <4 x i32> <i32 32, i32 33, i32 34, i32 35>, ptr %38, align 16, !tbaa !12
  store <4 x i32> <i32 36, i32 37, i32 38, i32 39>, ptr %39, align 16, !tbaa !12
  %40 = getelementptr inbounds i8, ptr %1, i64 160
  %41 = getelementptr inbounds i8, ptr %1, i64 176
  store <4 x i32> <i32 40, i32 41, i32 42, i32 43>, ptr %40, align 16, !tbaa !12
  store <4 x i32> <i32 44, i32 45, i32 46, i32 47>, ptr %41, align 16, !tbaa !12
  %42 = getelementptr inbounds i8, ptr %1, i64 192
  %43 = getelementptr inbounds i8, ptr %1, i64 208
  store <4 x i32> <i32 48, i32 49, i32 50, i32 51>, ptr %42, align 16, !tbaa !12
  store <4 x i32> <i32 52, i32 53, i32 54, i32 55>, ptr %43, align 16, !tbaa !12
  %44 = getelementptr inbounds i8, ptr %1, i64 224
  %45 = getelementptr inbounds i8, ptr %1, i64 240
  store <4 x i32> <i32 56, i32 57, i32 58, i32 59>, ptr %44, align 16, !tbaa !12
  store <4 x i32> <i32 60, i32 61, i32 62, i32 63>, ptr %45, align 16, !tbaa !12
  %46 = getelementptr inbounds i8, ptr %1, i64 256
  %47 = getelementptr inbounds i8, ptr %1, i64 272
  store <4 x i32> <i32 64, i32 65, i32 66, i32 67>, ptr %46, align 16, !tbaa !12
  store <4 x i32> <i32 68, i32 69, i32 70, i32 71>, ptr %47, align 16, !tbaa !12
  %48 = getelementptr inbounds i8, ptr %1, i64 288
  %49 = getelementptr inbounds i8, ptr %1, i64 304
  store <4 x i32> <i32 72, i32 73, i32 74, i32 75>, ptr %48, align 16, !tbaa !12
  store <4 x i32> <i32 76, i32 77, i32 78, i32 79>, ptr %49, align 16, !tbaa !12
  %50 = getelementptr inbounds i8, ptr %1, i64 320
  %51 = getelementptr inbounds i8, ptr %1, i64 336
  store <4 x i32> <i32 80, i32 81, i32 82, i32 83>, ptr %50, align 16, !tbaa !12
  store <4 x i32> <i32 84, i32 85, i32 86, i32 87>, ptr %51, align 16, !tbaa !12
  %52 = getelementptr inbounds i8, ptr %1, i64 352
  %53 = getelementptr inbounds i8, ptr %1, i64 368
  store <4 x i32> <i32 88, i32 89, i32 90, i32 91>, ptr %52, align 16, !tbaa !12
  store <4 x i32> <i32 92, i32 93, i32 94, i32 95>, ptr %53, align 16, !tbaa !12
  %54 = getelementptr inbounds i8, ptr %1, i64 384
  store i32 96, ptr %54, align 16, !tbaa !12
  %55 = getelementptr inbounds i8, ptr %1, i64 388
  store i32 97, ptr %55, align 4, !tbaa !12
  %56 = getelementptr inbounds i8, ptr %1, i64 392
  store i32 98, ptr %56, align 8, !tbaa !12
  %57 = getelementptr inbounds i8, ptr %1, i64 396
  store i32 99, ptr %57, align 4, !tbaa !12
  br label %.preheader37

58:                                               ; preds = %27
  call void @__assert_fail(ptr noundef nonnull @.str.27, ptr noundef nonnull @.str.9, i32 noundef 147, ptr noundef nonnull @__PRETTY_FUNCTION__.test3) #5
  unreachable

.preheader37:                                     ; preds = %.preheader37, %vector.body
  %indvars.iv44 = phi i64 [ 0, %vector.body ], [ %indvars.iv.next45.1, %.preheader37 ]
  %59 = getelementptr inbounds [100 x i32], ptr %1, i64 0, i64 %indvars.iv44
  %60 = load i32, ptr %59, align 8, !tbaa !12
  %61 = trunc i64 %indvars.iv44 to i16
  %.lhs.trunc = mul nuw nsw i16 %61, 15
  %62 = urem i16 %.lhs.trunc, 100
  %63 = zext nneg i16 %62 to i64
  %64 = getelementptr inbounds [100 x i32], ptr %1, i64 0, i64 %63
  %65 = load i32, ptr %64, align 8, !tbaa !12
  store i32 %65, ptr %59, align 8, !tbaa !12
  store i32 %60, ptr %64, align 8, !tbaa !12
  %indvars.iv.next45 = or disjoint i64 %indvars.iv44, 1
  %66 = getelementptr inbounds [100 x i32], ptr %1, i64 0, i64 %indvars.iv.next45
  %67 = load i32, ptr %66, align 4, !tbaa !12
  %68 = trunc i64 %indvars.iv.next45 to i16
  %.lhs.trunc.1 = mul nuw nsw i16 %68, 15
  %69 = urem i16 %.lhs.trunc.1, 100
  %70 = zext nneg i16 %69 to i64
  %71 = getelementptr inbounds [100 x i32], ptr %1, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !12
  store i32 %72, ptr %66, align 4, !tbaa !12
  store i32 %67, ptr %71, align 4, !tbaa !12
  %indvars.iv.next45.1 = add nuw nsw i64 %indvars.iv44, 2
  %exitcond47.not.1 = icmp eq i64 %indvars.iv.next45.1, 100
  br i1 %exitcond47.not.1, label %.preheader36, label %.preheader37, !llvm.loop !14

73:                                               ; preds = %.preheader36
  %indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1
  %exitcond51.not = icmp eq i64 %indvars.iv.next49, 100
  br i1 %exitcond51.not, label %.preheader, label %.preheader36, !llvm.loop !16

.preheader36:                                     ; preds = %.preheader37, %73
  %indvars.iv48 = phi i64 [ %indvars.iv.next49, %73 ], [ 0, %.preheader37 ]
  %74 = inttoptr i64 %indvars.iv48 to ptr
  %75 = call zeroext i1 @sc_heap_add(ptr noundef nonnull %2, i64 noundef %indvars.iv48, ptr noundef %74) #4
  br i1 %75, label %73, label %76

76:                                               ; preds = %.preheader36
  call void @__assert_fail(ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.9, i32 noundef 160, ptr noundef nonnull @__PRETTY_FUNCTION__.test3) #5
  unreachable

77:                                               ; preds = %87
  %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
  %exitcond55.not = icmp eq i64 %indvars.iv.next53, 100
  br i1 %exitcond55.not, label %78, label %.preheader, !llvm.loop !17

78:                                               ; preds = %77
  %79 = call ptr @sc_heap_peek(ptr noundef nonnull %2) #4
  %80 = icmp eq ptr %79, null
  br i1 %80, label %94, label %93

.preheader:                                       ; preds = %73, %77
  %indvars.iv52 = phi i64 [ %indvars.iv.next53, %77 ], [ 0, %73 ]
  %81 = call ptr @sc_heap_pop(ptr noundef nonnull %2) #4
  %.not35 = icmp eq ptr %81, null
  br i1 %.not35, label %82, label %83

82:                                               ; preds = %.preheader
  call void @__assert_fail(ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.9, i32 noundef 165, ptr noundef nonnull @__PRETTY_FUNCTION__.test3) #5
  unreachable

83:                                               ; preds = %.preheader
  %84 = load i64, ptr %81, align 8, !tbaa !5
  %85 = icmp eq i64 %84, %indvars.iv52
  br i1 %85, label %87, label %86

86:                                               ; preds = %83
  call void @__assert_fail(ptr noundef nonnull @.str.17, ptr noundef nonnull @.str.9, i32 noundef 166, ptr noundef nonnull @__PRETTY_FUNCTION__.test3) #5
  unreachable

87:                                               ; preds = %83
  %88 = getelementptr inbounds i8, ptr %81, i64 8
  %89 = load ptr, ptr %88, align 8, !tbaa !11
  %90 = inttoptr i64 %indvars.iv52 to ptr
  %91 = icmp eq ptr %89, %90
  br i1 %91, label %77, label %92

92:                                               ; preds = %87
  call void @__assert_fail(ptr noundef nonnull @.str.28, ptr noundef nonnull @.str.9, i32 noundef 167, ptr noundef nonnull @__PRETTY_FUNCTION__.test3) #5
  unreachable

93:                                               ; preds = %78
  call void @__assert_fail(ptr noundef nonnull @.str.29, ptr noundef nonnull @.str.9, i32 noundef 170, ptr noundef nonnull @__PRETTY_FUNCTION__.test3) #5
  unreachable

94:                                               ; preds = %78
  %95 = call ptr @sc_heap_pop(ptr noundef nonnull %2) #4
  %96 = icmp eq ptr %95, null
  br i1 %96, label %98, label %97

97:                                               ; preds = %94
  call void @__assert_fail(ptr noundef nonnull @.str.30, ptr noundef nonnull @.str.9, i32 noundef 171, ptr noundef nonnull @__PRETTY_FUNCTION__.test3) #5
  unreachable

98:                                               ; preds = %94
  %99 = call i64 @sc_heap_size(ptr noundef nonnull %2) #4
  %100 = icmp eq i64 %99, 0
  br i1 %100, label %102, label %101

101:                                              ; preds = %98
  call void @__assert_fail(ptr noundef nonnull @.str.31, ptr noundef nonnull @.str.9, i32 noundef 173, ptr noundef nonnull @__PRETTY_FUNCTION__.test3) #5
  unreachable

102:                                              ; preds = %98
  %103 = call zeroext i1 @sc_heap_add(ptr noundef nonnull %2, i64 noundef 1, ptr noundef null) #4
  br i1 %103, label %105, label %104

104:                                              ; preds = %102
  call void @__assert_fail(ptr noundef nonnull @.str.32, ptr noundef nonnull @.str.9, i32 noundef 174, ptr noundef nonnull @__PRETTY_FUNCTION__.test3) #5
  unreachable

105:                                              ; preds = %102
  %106 = call i64 @sc_heap_size(ptr noundef nonnull %2) #4
  %107 = icmp eq i64 %106, 1
  br i1 %107, label %109, label %108

108:                                              ; preds = %105
  call void @__assert_fail(ptr noundef nonnull @.str.33, ptr noundef nonnull @.str.9, i32 noundef 175, ptr noundef nonnull @__PRETTY_FUNCTION__.test3) #5
  unreachable

109:                                              ; preds = %105
  call void @sc_heap_clear(ptr noundef nonnull %2) #4
  %110 = call i64 @sc_heap_size(ptr noundef nonnull %2) #4
  %111 = icmp eq i64 %110, 0
  br i1 %111, label %113, label %112

112:                                              ; preds = %109
  call void @__assert_fail(ptr noundef nonnull @.str.31, ptr noundef nonnull @.str.9, i32 noundef 177, ptr noundef nonnull @__PRETTY_FUNCTION__.test3) #5
  unreachable

113:                                              ; preds = %109
  %114 = call zeroext i1 @sc_heap_add(ptr noundef nonnull %2, i64 noundef 1, ptr noundef null) #4
  br i1 %114, label %116, label %115

115:                                              ; preds = %113
  call void @__assert_fail(ptr noundef nonnull @.str.32, ptr noundef nonnull @.str.9, i32 noundef 178, ptr noundef nonnull @__PRETTY_FUNCTION__.test3) #5
  unreachable

116:                                              ; preds = %113
  %117 = call i64 @sc_heap_size(ptr noundef nonnull %2) #4
  %118 = icmp eq i64 %117, 1
  br i1 %118, label %120, label %119

119:                                              ; preds = %116
  call void @__assert_fail(ptr noundef nonnull @.str.33, ptr noundef nonnull @.str.9, i32 noundef 179, ptr noundef nonnull @__PRETTY_FUNCTION__.test3) #5
  unreachable

120:                                              ; preds = %116
  call void @sc_heap_term(ptr noundef nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %1) #4
  ret void
}

declare ptr @sc_heap_peek(ptr noundef) local_unnamed_addr #1

declare i64 @sc_heap_size(ptr noundef) local_unnamed_addr #1

declare void @sc_heap_clear(ptr noundef) local_unnamed_addr #1

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 = { 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 #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 = { nounwind }
attributes #5 = { noreturn nounwind }

!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 = !{!13, !13, i64 0}
!13 = !{!"int", !8, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}


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