; 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.15 = external hidden unnamed_addr constant [35 x i8], align 1
@test2.arr = external hidden constant [10 x i64], align 16
@.str.19 = external hidden unnamed_addr constant [31 x i8], align 1
@__PRETTY_FUNCTION__.test2 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [37 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 @test2() #3 {
  %1 = alloca ptr, align 8
  %2 = alloca %struct.sc_heap, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %2) #4
  %6 = call zeroext i1 @sc_heap_init(ptr noundef %2, i64 noundef 0)
  %7 = zext i1 %6 to i32
  %8 = icmp eq i32 %7, 1
  br i1 %8, label %9, label %10

9:                                                ; preds = %0
  br label %11

10:                                               ; preds = %0
  call void @__assert_fail(ptr noundef @.str.19, ptr noundef @.str.9, i32 noundef 105, ptr noundef @__PRETTY_FUNCTION__.test2) #5
  unreachable

11:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %54, %11
  %13 = load i32, ptr %3, align 4, !tbaa !5
  %14 = icmp slt i32 %13, 1000
  br i1 %14, label %16, label %15

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

16:                                               ; preds = %12
  %17 = load i32, ptr %3, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = load i32, ptr %3, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = inttoptr i64 %20 to ptr
  %22 = call zeroext i1 @sc_heap_add(ptr noundef %2, i64 noundef %18, ptr noundef %21)
  %23 = zext i1 %22 to i32
  %24 = icmp eq i32 %23, 1
  br i1 %24, label %25, label %26

25:                                               ; preds = %16
  br label %27

26:                                               ; preds = %16
  call void @__assert_fail(ptr noundef @.str.13, ptr noundef @.str.9, i32 noundef 108, ptr noundef @__PRETTY_FUNCTION__.test2) #5
  unreachable

27:                                               ; preds = %25
  %28 = call ptr @sc_heap_pop(ptr noundef %2)
  store ptr %28, ptr %1, align 8, !tbaa !9
  %29 = load ptr, ptr %1, align 8, !tbaa !9
  %30 = icmp ne ptr %29, null
  br i1 %30, label %31, label %32

31:                                               ; preds = %27
  br label %33

32:                                               ; preds = %27
  call void @__assert_fail(ptr noundef @.str.14, ptr noundef @.str.9, i32 noundef 110, ptr noundef @__PRETTY_FUNCTION__.test2) #5
  unreachable

33:                                               ; preds = %31
  %34 = load ptr, ptr %1, align 8, !tbaa !9
  %35 = getelementptr inbounds %struct.sc_heap_data, ptr %34, i32 0, i32 0
  %36 = load i64, ptr %35, align 8, !tbaa !11
  %37 = load ptr, ptr %1, align 8, !tbaa !9
  %38 = getelementptr inbounds %struct.sc_heap_data, ptr %37, i32 0, i32 1
  %39 = load ptr, ptr %38, align 8, !tbaa !14
  %40 = ptrtoint ptr %39 to i64
  %41 = icmp eq i64 %36, %40
  br i1 %41, label %42, label %43

42:                                               ; preds = %33
  br label %44

43:                                               ; preds = %33
  call void @__assert_fail(ptr noundef @.str.15, ptr noundef @.str.9, i32 noundef 111, ptr noundef @__PRETTY_FUNCTION__.test2) #5
  unreachable

44:                                               ; preds = %42
  %45 = load ptr, ptr %1, align 8, !tbaa !9
  %46 = getelementptr inbounds %struct.sc_heap_data, ptr %45, i32 0, i32 0
  %47 = load i64, ptr %46, align 8, !tbaa !11
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = icmp eq i64 %47, %49
  br i1 %50, label %51, label %52

51:                                               ; preds = %44
  br label %53

52:                                               ; preds = %44
  call void @__assert_fail(ptr noundef @.str.20, ptr noundef @.str.9, i32 noundef 112, ptr noundef @__PRETTY_FUNCTION__.test2) #5
  unreachable

53:                                               ; preds = %51
  br label %54

54:                                               ; preds = %53
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %3, align 4, !tbaa !5
  br label %12, !llvm.loop !15

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

58:                                               ; preds = %80, %57
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = icmp slt i32 %59, 10
  br i1 %60, label %62, label %61

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

62:                                               ; preds = %58
  %63 = load i32, ptr %4, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [10 x i64], ptr @test2.arr, i64 0, i64 %64
  %66 = load i64, ptr %65, align 8, !tbaa !17
  %67 = sub nsw i64 0, %66
  %68 = load i32, ptr %4, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [10 x i64], ptr @test2.arr, i64 0, i64 %69
  %71 = load i64, ptr %70, align 8, !tbaa !17
  %72 = mul nsw i64 %71, 2
  %73 = inttoptr i64 %72 to ptr
  %74 = call zeroext i1 @sc_heap_add(ptr noundef %2, i64 noundef %67, ptr noundef %73)
  %75 = zext i1 %74 to i32
  %76 = icmp eq i32 %75, 1
  br i1 %76, label %77, label %78

77:                                               ; preds = %62
  br label %79

78:                                               ; preds = %62
  call void @__assert_fail(ptr noundef @.str.21, ptr noundef @.str.9, i32 noundef 117, ptr noundef @__PRETTY_FUNCTION__.test2) #5
  unreachable

79:                                               ; preds = %77
  br label %80

80:                                               ; preds = %79
  %81 = load i32, ptr %4, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %4, align 4, !tbaa !5
  br label %58, !llvm.loop !18

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

84:                                               ; preds = %118, %83
  %85 = load i32, ptr %5, align 4, !tbaa !5
  %86 = icmp slt i32 %85, 10
  br i1 %86, label %88, label %87

87:                                               ; preds = %84
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %121

88:                                               ; preds = %84
  %89 = call ptr @sc_heap_pop(ptr noundef %2)
  store ptr %89, ptr %1, align 8, !tbaa !9
  %90 = load ptr, ptr %1, align 8, !tbaa !9
  %91 = icmp ne ptr %90, null
  br i1 %91, label %92, label %93

92:                                               ; preds = %88
  br label %94

93:                                               ; preds = %88
  call void @__assert_fail(ptr noundef @.str.14, ptr noundef @.str.9, i32 noundef 122, ptr noundef @__PRETTY_FUNCTION__.test2) #5
  unreachable

94:                                               ; preds = %92
  %95 = load ptr, ptr %1, align 8, !tbaa !9
  %96 = getelementptr inbounds %struct.sc_heap_data, ptr %95, i32 0, i32 0
  %97 = load i64, ptr %96, align 8, !tbaa !11
  %98 = sub nsw i64 0, %97
  %99 = load i32, ptr %5, align 4, !tbaa !5
  %100 = sub nsw i32 9, %99
  %101 = sext i32 %100 to i64
  %102 = icmp eq i64 %98, %101
  br i1 %102, label %103, label %104

103:                                              ; preds = %94
  br label %105

104:                                              ; preds = %94
  call void @__assert_fail(ptr noundef @.str.22, ptr noundef @.str.9, i32 noundef 123, ptr noundef @__PRETTY_FUNCTION__.test2) #5
  unreachable

105:                                              ; preds = %103
  %106 = load ptr, ptr %1, align 8, !tbaa !9
  %107 = getelementptr inbounds %struct.sc_heap_data, ptr %106, i32 0, i32 1
  %108 = load ptr, ptr %107, align 8, !tbaa !14
  %109 = ptrtoint ptr %108 to i64
  %110 = load i32, ptr %5, align 4, !tbaa !5
  %111 = sub nsw i32 9, %110
  %112 = mul nsw i32 %111, 2
  %113 = sext i32 %112 to i64
  %114 = icmp eq i64 %109, %113
  br i1 %114, label %115, label %116

115:                                              ; preds = %105
  br label %117

116:                                              ; preds = %105
  call void @__assert_fail(ptr noundef @.str.23, ptr noundef @.str.9, i32 noundef 124, ptr noundef @__PRETTY_FUNCTION__.test2) #5
  unreachable

117:                                              ; preds = %115
  br label %118

118:                                              ; preds = %117
  %119 = load i32, ptr %5, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %5, align 4, !tbaa !5
  br label %84, !llvm.loop !19

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

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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"sc_heap_data", !13, i64 0, !10, i64 8}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !10, i64 8}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!13, !13, 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.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.15 = external hidden unnamed_addr constant [35 x i8], align 1
@test2.arr = external hidden local_unnamed_addr constant [10 x i64], align 16
@.str.19 = external hidden unnamed_addr constant [31 x i8], align 1
@__PRETTY_FUNCTION__.test2 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [37 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 @test2() local_unnamed_addr #3 {
  %1 = alloca %struct.sc_heap, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #4
  %2 = call zeroext i1 @sc_heap_init(ptr noundef nonnull %1, i64 noundef 0) #4
  br i1 %2, label %.preheader26, label %3

3:                                                ; preds = %0
  call void @__assert_fail(ptr noundef nonnull @.str.19, ptr noundef nonnull @.str.9, i32 noundef 105, ptr noundef nonnull @__PRETTY_FUNCTION__.test2) #5
  unreachable

4:                                                ; preds = %23
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 1000
  br i1 %exitcond.not, label %.preheader25.preheader, label %.preheader26, !llvm.loop !5

.preheader25.preheader:                           ; preds = %4
  %5 = load i64, ptr @test2.arr, align 16, !tbaa !7
  %6 = sub nsw i64 0, %5
  %7 = shl nsw i64 %5, 1
  %8 = inttoptr i64 %7 to ptr
  %9 = call zeroext i1 @sc_heap_add(ptr noundef nonnull %1, i64 noundef %6, ptr noundef %8) #4
  br i1 %9, label %.preheader25.1, label %72

.preheader26:                                     ; preds = %0, %4
  %indvars.iv = phi i64 [ %indvars.iv.next, %4 ], [ 0, %0 ]
  %10 = inttoptr i64 %indvars.iv to ptr
  %11 = call zeroext i1 @sc_heap_add(ptr noundef nonnull %1, i64 noundef %indvars.iv, ptr noundef %10) #4
  br i1 %11, label %13, label %12

12:                                               ; preds = %.preheader26
  call void @__assert_fail(ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.9, i32 noundef 108, ptr noundef nonnull @__PRETTY_FUNCTION__.test2) #5
  unreachable

13:                                               ; preds = %.preheader26
  %14 = call ptr @sc_heap_pop(ptr noundef nonnull %1) #4
  %.not24 = icmp eq ptr %14, null
  br i1 %.not24, label %15, label %16

15:                                               ; preds = %13
  call void @__assert_fail(ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.9, i32 noundef 110, ptr noundef nonnull @__PRETTY_FUNCTION__.test2) #5
  unreachable

16:                                               ; preds = %13
  %17 = load i64, ptr %14, align 8, !tbaa !11
  %18 = getelementptr inbounds i8, ptr %14, i64 8
  %19 = load ptr, ptr %18, align 8, !tbaa !14
  %20 = ptrtoint ptr %19 to i64
  %21 = icmp eq i64 %17, %20
  br i1 %21, label %23, label %22

22:                                               ; preds = %16
  call void @__assert_fail(ptr noundef nonnull @.str.15, ptr noundef nonnull @.str.9, i32 noundef 111, ptr noundef nonnull @__PRETTY_FUNCTION__.test2) #5
  unreachable

23:                                               ; preds = %16
  %24 = icmp eq i64 %17, %indvars.iv
  br i1 %24, label %4, label %25

25:                                               ; preds = %23
  call void @__assert_fail(ptr noundef nonnull @.str.20, ptr noundef nonnull @.str.9, i32 noundef 112, ptr noundef nonnull @__PRETTY_FUNCTION__.test2) #5
  unreachable

.preheader25.1:                                   ; preds = %.preheader25.preheader
  %26 = load i64, ptr getelementptr inbounds (i8, ptr @test2.arr, i64 8), align 8, !tbaa !7
  %27 = sub nsw i64 0, %26
  %28 = shl nsw i64 %26, 1
  %29 = inttoptr i64 %28 to ptr
  %30 = call zeroext i1 @sc_heap_add(ptr noundef nonnull %1, i64 noundef %27, ptr noundef %29) #4
  br i1 %30, label %.preheader25.2, label %72

.preheader25.2:                                   ; preds = %.preheader25.1
  %31 = load i64, ptr getelementptr inbounds (i8, ptr @test2.arr, i64 16), align 16, !tbaa !7
  %32 = sub nsw i64 0, %31
  %33 = shl nsw i64 %31, 1
  %34 = inttoptr i64 %33 to ptr
  %35 = call zeroext i1 @sc_heap_add(ptr noundef nonnull %1, i64 noundef %32, ptr noundef %34) #4
  br i1 %35, label %.preheader25.3, label %72

.preheader25.3:                                   ; preds = %.preheader25.2
  %36 = load i64, ptr getelementptr inbounds (i8, ptr @test2.arr, i64 24), align 8, !tbaa !7
  %37 = sub nsw i64 0, %36
  %38 = shl nsw i64 %36, 1
  %39 = inttoptr i64 %38 to ptr
  %40 = call zeroext i1 @sc_heap_add(ptr noundef nonnull %1, i64 noundef %37, ptr noundef %39) #4
  br i1 %40, label %.preheader25.4, label %72

.preheader25.4:                                   ; preds = %.preheader25.3
  %41 = load i64, ptr getelementptr inbounds (i8, ptr @test2.arr, i64 32), align 16, !tbaa !7
  %42 = sub nsw i64 0, %41
  %43 = shl nsw i64 %41, 1
  %44 = inttoptr i64 %43 to ptr
  %45 = call zeroext i1 @sc_heap_add(ptr noundef nonnull %1, i64 noundef %42, ptr noundef %44) #4
  br i1 %45, label %.preheader25.5, label %72

.preheader25.5:                                   ; preds = %.preheader25.4
  %46 = load i64, ptr getelementptr inbounds (i8, ptr @test2.arr, i64 40), align 8, !tbaa !7
  %47 = sub nsw i64 0, %46
  %48 = shl nsw i64 %46, 1
  %49 = inttoptr i64 %48 to ptr
  %50 = call zeroext i1 @sc_heap_add(ptr noundef nonnull %1, i64 noundef %47, ptr noundef %49) #4
  br i1 %50, label %.preheader25.6, label %72

.preheader25.6:                                   ; preds = %.preheader25.5
  %51 = load i64, ptr getelementptr inbounds (i8, ptr @test2.arr, i64 48), align 16, !tbaa !7
  %52 = sub nsw i64 0, %51
  %53 = shl nsw i64 %51, 1
  %54 = inttoptr i64 %53 to ptr
  %55 = call zeroext i1 @sc_heap_add(ptr noundef nonnull %1, i64 noundef %52, ptr noundef %54) #4
  br i1 %55, label %.preheader25.7, label %72

.preheader25.7:                                   ; preds = %.preheader25.6
  %56 = load i64, ptr getelementptr inbounds (i8, ptr @test2.arr, i64 56), align 8, !tbaa !7
  %57 = sub nsw i64 0, %56
  %58 = shl nsw i64 %56, 1
  %59 = inttoptr i64 %58 to ptr
  %60 = call zeroext i1 @sc_heap_add(ptr noundef nonnull %1, i64 noundef %57, ptr noundef %59) #4
  br i1 %60, label %.preheader25.8, label %72

.preheader25.8:                                   ; preds = %.preheader25.7
  %61 = load i64, ptr getelementptr inbounds (i8, ptr @test2.arr, i64 64), align 16, !tbaa !7
  %62 = sub nsw i64 0, %61
  %63 = shl nsw i64 %61, 1
  %64 = inttoptr i64 %63 to ptr
  %65 = call zeroext i1 @sc_heap_add(ptr noundef nonnull %1, i64 noundef %62, ptr noundef %64) #4
  br i1 %65, label %.preheader25.9, label %72

.preheader25.9:                                   ; preds = %.preheader25.8
  %66 = load i64, ptr getelementptr inbounds (i8, ptr @test2.arr, i64 72), align 8, !tbaa !7
  %67 = sub nsw i64 0, %66
  %68 = shl nsw i64 %66, 1
  %69 = inttoptr i64 %68 to ptr
  %70 = call zeroext i1 @sc_heap_add(ptr noundef nonnull %1, i64 noundef %67, ptr noundef %69) #4
  br i1 %70, label %.preheader.preheader, label %72

.preheader.preheader:                             ; preds = %.preheader25.9
  %71 = call ptr @sc_heap_pop(ptr noundef nonnull %1) #4
  %.not = icmp eq ptr %71, null
  br i1 %.not, label %146, label %147

72:                                               ; preds = %.preheader25.9, %.preheader25.8, %.preheader25.7, %.preheader25.6, %.preheader25.5, %.preheader25.4, %.preheader25.3, %.preheader25.2, %.preheader25.1, %.preheader25.preheader
  call void @__assert_fail(ptr noundef nonnull @.str.21, ptr noundef nonnull @.str.9, i32 noundef 117, ptr noundef nonnull @__PRETTY_FUNCTION__.test2) #5
  unreachable

.preheader.1:                                     ; preds = %151
  %73 = call ptr @sc_heap_pop(ptr noundef nonnull %1) #4
  %.not.1 = icmp eq ptr %73, null
  br i1 %.not.1, label %146, label %74

74:                                               ; preds = %.preheader.1
  %75 = load i64, ptr %73, align 8, !tbaa !11
  %76 = icmp eq i64 %75, -8
  br i1 %76, label %77, label %150

77:                                               ; preds = %74
  %78 = getelementptr inbounds i8, ptr %73, i64 8
  %79 = load ptr, ptr %78, align 8, !tbaa !14
  %80 = icmp eq ptr %79, inttoptr (i64 16 to ptr)
  br i1 %80, label %.preheader.2, label %155

.preheader.2:                                     ; preds = %77
  %81 = call ptr @sc_heap_pop(ptr noundef nonnull %1) #4
  %.not.2 = icmp eq ptr %81, null
  br i1 %.not.2, label %146, label %82

82:                                               ; preds = %.preheader.2
  %83 = load i64, ptr %81, align 8, !tbaa !11
  %84 = icmp eq i64 %83, -7
  br i1 %84, label %85, label %150

85:                                               ; preds = %82
  %86 = getelementptr inbounds i8, ptr %81, i64 8
  %87 = load ptr, ptr %86, align 8, !tbaa !14
  %88 = icmp eq ptr %87, inttoptr (i64 14 to ptr)
  br i1 %88, label %.preheader.3, label %155

.preheader.3:                                     ; preds = %85
  %89 = call ptr @sc_heap_pop(ptr noundef nonnull %1) #4
  %.not.3 = icmp eq ptr %89, null
  br i1 %.not.3, label %146, label %90

90:                                               ; preds = %.preheader.3
  %91 = load i64, ptr %89, align 8, !tbaa !11
  %92 = icmp eq i64 %91, -6
  br i1 %92, label %93, label %150

93:                                               ; preds = %90
  %94 = getelementptr inbounds i8, ptr %89, i64 8
  %95 = load ptr, ptr %94, align 8, !tbaa !14
  %96 = icmp eq ptr %95, inttoptr (i64 12 to ptr)
  br i1 %96, label %.preheader.4, label %155

.preheader.4:                                     ; preds = %93
  %97 = call ptr @sc_heap_pop(ptr noundef nonnull %1) #4
  %.not.4 = icmp eq ptr %97, null
  br i1 %.not.4, label %146, label %98

98:                                               ; preds = %.preheader.4
  %99 = load i64, ptr %97, align 8, !tbaa !11
  %100 = icmp eq i64 %99, -5
  br i1 %100, label %101, label %150

101:                                              ; preds = %98
  %102 = getelementptr inbounds i8, ptr %97, i64 8
  %103 = load ptr, ptr %102, align 8, !tbaa !14
  %104 = icmp eq ptr %103, inttoptr (i64 10 to ptr)
  br i1 %104, label %.preheader.5, label %155

.preheader.5:                                     ; preds = %101
  %105 = call ptr @sc_heap_pop(ptr noundef nonnull %1) #4
  %.not.5 = icmp eq ptr %105, null
  br i1 %.not.5, label %146, label %106

106:                                              ; preds = %.preheader.5
  %107 = load i64, ptr %105, align 8, !tbaa !11
  %108 = icmp eq i64 %107, -4
  br i1 %108, label %109, label %150

109:                                              ; preds = %106
  %110 = getelementptr inbounds i8, ptr %105, i64 8
  %111 = load ptr, ptr %110, align 8, !tbaa !14
  %112 = icmp eq ptr %111, inttoptr (i64 8 to ptr)
  br i1 %112, label %.preheader.6, label %155

.preheader.6:                                     ; preds = %109
  %113 = call ptr @sc_heap_pop(ptr noundef nonnull %1) #4
  %.not.6 = icmp eq ptr %113, null
  br i1 %.not.6, label %146, label %114

114:                                              ; preds = %.preheader.6
  %115 = load i64, ptr %113, align 8, !tbaa !11
  %116 = icmp eq i64 %115, -3
  br i1 %116, label %117, label %150

117:                                              ; preds = %114
  %118 = getelementptr inbounds i8, ptr %113, i64 8
  %119 = load ptr, ptr %118, align 8, !tbaa !14
  %120 = icmp eq ptr %119, inttoptr (i64 6 to ptr)
  br i1 %120, label %.preheader.7, label %155

.preheader.7:                                     ; preds = %117
  %121 = call ptr @sc_heap_pop(ptr noundef nonnull %1) #4
  %.not.7 = icmp eq ptr %121, null
  br i1 %.not.7, label %146, label %122

122:                                              ; preds = %.preheader.7
  %123 = load i64, ptr %121, align 8, !tbaa !11
  %124 = icmp eq i64 %123, -2
  br i1 %124, label %125, label %150

125:                                              ; preds = %122
  %126 = getelementptr inbounds i8, ptr %121, i64 8
  %127 = load ptr, ptr %126, align 8, !tbaa !14
  %128 = icmp eq ptr %127, inttoptr (i64 4 to ptr)
  br i1 %128, label %.preheader.8, label %155

.preheader.8:                                     ; preds = %125
  %129 = call ptr @sc_heap_pop(ptr noundef nonnull %1) #4
  %.not.8 = icmp eq ptr %129, null
  br i1 %.not.8, label %146, label %130

130:                                              ; preds = %.preheader.8
  %131 = load i64, ptr %129, align 8, !tbaa !11
  %132 = icmp eq i64 %131, -1
  br i1 %132, label %133, label %150

133:                                              ; preds = %130
  %134 = getelementptr inbounds i8, ptr %129, i64 8
  %135 = load ptr, ptr %134, align 8, !tbaa !14
  %136 = icmp eq ptr %135, inttoptr (i64 2 to ptr)
  br i1 %136, label %.preheader.9, label %155

.preheader.9:                                     ; preds = %133
  %137 = call ptr @sc_heap_pop(ptr noundef nonnull %1) #4
  %.not.9 = icmp eq ptr %137, null
  br i1 %.not.9, label %146, label %138

138:                                              ; preds = %.preheader.9
  %139 = load i64, ptr %137, align 8, !tbaa !11
  %140 = icmp eq i64 %139, 0
  br i1 %140, label %141, label %150

141:                                              ; preds = %138
  %142 = getelementptr inbounds i8, ptr %137, i64 8
  %143 = load ptr, ptr %142, align 8, !tbaa !14
  %144 = icmp eq ptr %143, null
  br i1 %144, label %145, label %155

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

146:                                              ; 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 122, ptr noundef nonnull @__PRETTY_FUNCTION__.test2) #5
  unreachable

147:                                              ; preds = %.preheader.preheader
  %148 = load i64, ptr %71, align 8, !tbaa !11
  %149 = icmp eq i64 %148, -9
  br i1 %149, label %151, label %150

150:                                              ; preds = %138, %130, %122, %114, %106, %98, %90, %82, %74, %147
  call void @__assert_fail(ptr noundef nonnull @.str.22, ptr noundef nonnull @.str.9, i32 noundef 123, ptr noundef nonnull @__PRETTY_FUNCTION__.test2) #5
  unreachable

151:                                              ; preds = %147
  %152 = getelementptr inbounds i8, ptr %71, i64 8
  %153 = load ptr, ptr %152, align 8, !tbaa !14
  %154 = icmp eq ptr %153, inttoptr (i64 18 to ptr)
  br i1 %154, label %.preheader.1, label %155

155:                                              ; preds = %141, %133, %125, %117, %109, %101, %93, %85, %77, %151
  call void @__assert_fail(ptr noundef nonnull @.str.23, ptr noundef nonnull @.str.9, i32 noundef 124, ptr noundef nonnull @__PRETTY_FUNCTION__.test2) #5
  unreachable
}

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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"long", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!12, !8, i64 0}
!12 = !{!"sc_heap_data", !8, i64 0, !13, i64 8}
!13 = !{!"any pointer", !9, i64 0}
!14 = !{!12, !13, i64 8}


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