; LLVM IR from stan-dev/math :: lib/tbb_2020.3/src/test (test_malloc_pure_c)

; 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"

@.str = external hidden unnamed_addr constant [90 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [92 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [15 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [89 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %8 = call i32 @atexit(ptr noundef @MyExit) #5
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %9

9:                                                ; preds = %37, %0
  %10 = load i32, ptr %4, align 4, !tbaa !5
  %11 = icmp sle i32 %10, 1
  br i1 %11, label %12, label %40

12:                                               ; preds = %9
  %13 = load i32, ptr %4, align 4, !tbaa !5
  %14 = icmp ne i32 %13, 0
  %15 = xor i1 %14, true
  %16 = zext i1 %15 to i32
  %17 = sext i32 %16 to i64
  %18 = call i32 @scalable_allocation_mode(i32 noundef 0, i64 noundef %17)
  %19 = icmp eq i32 0, %18
  br i1 %19, label %20, label %21

20:                                               ; preds = %12
  br label %22

21:                                               ; preds = %12
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 70, ptr noundef @__PRETTY_FUNCTION__.main) #6
  unreachable

22:                                               ; preds = %20
  %23 = call ptr @scalable_malloc(i64 noundef 10485760)
  store ptr %23, ptr %6, align 8, !tbaa !9
  %24 = load ptr, ptr %6, align 8, !tbaa !9
  %25 = icmp ne ptr %24, null
  br i1 %25, label %26, label %27

26:                                               ; preds = %22
  br label %28

27:                                               ; preds = %22
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 72, ptr noundef @__PRETTY_FUNCTION__.main) #6
  unreachable

28:                                               ; preds = %26
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = call i32 @scalable_allocation_mode(i32 noundef 0, i64 noundef %30)
  %32 = icmp eq i32 0, %31
  br i1 %32, label %33, label %34

33:                                               ; preds = %28
  br label %35

34:                                               ; preds = %28
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 74, ptr noundef @__PRETTY_FUNCTION__.main) #6
  unreachable

35:                                               ; preds = %33
  %36 = load ptr, ptr %6, align 8, !tbaa !9
  call void @scalable_free(ptr noundef %36)
  br label %37

37:                                               ; preds = %35
  %38 = load i32, ptr %4, align 4, !tbaa !5
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %4, align 4, !tbaa !5
  br label %9, !llvm.loop !11

40:                                               ; preds = %9
  store i64 0, ptr %2, align 8, !tbaa !13
  br label %41

41:                                               ; preds = %53, %40
  %42 = load i64, ptr %2, align 8, !tbaa !13
  %43 = icmp ule i64 %42, 65536
  br i1 %43, label %44, label %56

44:                                               ; preds = %41
  %45 = load i64, ptr %2, align 8, !tbaa !13
  %46 = call ptr @scalable_malloc(i64 noundef %45)
  store ptr %46, ptr %6, align 8, !tbaa !9
  %47 = load ptr, ptr %6, align 8, !tbaa !9
  %48 = icmp ne ptr %47, null
  br i1 %48, label %51, label %49

49:                                               ; preds = %44
  %50 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  br label %51

51:                                               ; preds = %49, %44
  %52 = load ptr, ptr %6, align 8, !tbaa !9
  call void @scalable_free(ptr noundef %52)
  br label %53

53:                                               ; preds = %51
  %54 = load i64, ptr %2, align 8, !tbaa !13
  %55 = add i64 %54, 1
  store i64 %55, ptr %2, align 8, !tbaa !13
  br label %41, !llvm.loop !15

56:                                               ; preds = %41
  store ptr null, ptr %7, align 8, !tbaa !9
  store ptr null, ptr %6, align 8, !tbaa !9
  store i64 1048576, ptr %2, align 8, !tbaa !13
  br label %57

57:                                               ; preds = %115, %56
  %58 = load ptr, ptr %6, align 8, !tbaa !9
  call void @scalable_free(ptr noundef %58)
  %59 = load ptr, ptr %7, align 8, !tbaa !9
  %60 = load i64, ptr %2, align 8, !tbaa !13
  %61 = call ptr @scalable_realloc(ptr noundef %59, i64 noundef %60)
  store ptr %61, ptr %6, align 8, !tbaa !9
  %62 = load i64, ptr %2, align 8, !tbaa !13
  %63 = call ptr @scalable_calloc(i64 noundef %62, i64 noundef 32)
  store ptr %63, ptr %7, align 8, !tbaa !9
  %64 = load ptr, ptr %7, align 8, !tbaa !9
  %65 = icmp ne ptr %64, null
  br i1 %65, label %66, label %107

66:                                               ; preds = %57
  %67 = load i64, ptr %2, align 8, !tbaa !13
  %68 = icmp ult i64 %67, 8
  br i1 %68, label %69, label %88

69:                                               ; preds = %66
  store i64 0, ptr %3, align 8, !tbaa !13
  br label %70

70:                                               ; preds = %84, %69
  %71 = load i64, ptr %3, align 8, !tbaa !13
  %72 = load i64, ptr %2, align 8, !tbaa !13
  %73 = icmp ult i64 %71, %72
  br i1 %73, label %74, label %87

74:                                               ; preds = %70
  %75 = load ptr, ptr %7, align 8, !tbaa !9
  %76 = load i64, ptr %3, align 8, !tbaa !13
  %77 = getelementptr inbounds i8, ptr %75, i64 %76
  %78 = load i8, ptr %77, align 1, !tbaa !16
  %79 = sext i8 %78 to i32
  %80 = icmp eq i32 0, %79
  br i1 %80, label %81, label %82

81:                                               ; preds = %74
  br label %83

82:                                               ; preds = %74
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 98, ptr noundef @__PRETTY_FUNCTION__.main) #6
  unreachable

83:                                               ; preds = %81
  br label %84

84:                                               ; preds = %83
  %85 = load i64, ptr %3, align 8, !tbaa !13
  %86 = add i64 %85, 1
  store i64 %86, ptr %3, align 8, !tbaa !13
  br label %70, !llvm.loop !17

87:                                               ; preds = %70
  br label %106

88:                                               ; preds = %66
  store i64 0, ptr %3, align 8, !tbaa !13
  br label %89

89:                                               ; preds = %102, %88
  %90 = load i64, ptr %3, align 8, !tbaa !13
  %91 = load i64, ptr %2, align 8, !tbaa !13
  %92 = icmp ult i64 %90, %91
  br i1 %92, label %93, label %105

93:                                               ; preds = %89
  %94 = load ptr, ptr %7, align 8, !tbaa !9
  %95 = load i64, ptr %3, align 8, !tbaa !13
  %96 = getelementptr inbounds i64, ptr %94, i64 %95
  %97 = load i64, ptr %96, align 8, !tbaa !13
  %98 = icmp eq i64 0, %97
  br i1 %98, label %99, label %100

99:                                               ; preds = %93
  br label %101

100:                                              ; preds = %93
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.1, i32 noundef 101, ptr noundef @__PRETTY_FUNCTION__.main) #6
  unreachable

101:                                              ; preds = %99
  br label %102

102:                                              ; preds = %101
  %103 = load i64, ptr %3, align 8, !tbaa !13
  %104 = add i64 %103, 8
  store i64 %104, ptr %3, align 8, !tbaa !13
  br label %89, !llvm.loop !18

105:                                              ; preds = %89
  br label %106

106:                                              ; preds = %105, %87
  br label %107

107:                                              ; preds = %106, %57
  %108 = load ptr, ptr %7, align 8, !tbaa !9
  call void @scalable_free(ptr noundef %108)
  %109 = load i64, ptr %2, align 8, !tbaa !13
  %110 = call ptr @scalable_malloc(i64 noundef %109)
  store ptr %110, ptr %7, align 8, !tbaa !9
  %111 = load i64, ptr %2, align 8, !tbaa !13
  %112 = icmp eq i64 %111, 0
  br i1 %112, label %113, label %114

113:                                              ; preds = %107
  br label %118

114:                                              ; preds = %107
  br label %115

115:                                              ; preds = %114
  %116 = load i64, ptr %2, align 8, !tbaa !13
  %117 = udiv i64 %116, 2
  store i64 %117, ptr %2, align 8, !tbaa !13
  br label %57

118:                                              ; preds = %113
  store i64 1, ptr %2, align 8, !tbaa !13
  br label %119

119:                                              ; preds = %129, %118
  %120 = load i64, ptr %2, align 8, !tbaa !13
  %121 = icmp ult i64 %120, 1048576
  br i1 %121, label %122, label %132

122:                                              ; preds = %119
  %123 = load ptr, ptr %6, align 8, !tbaa !9
  call void @scalable_free(ptr noundef %123)
  %124 = load ptr, ptr %7, align 8, !tbaa !9
  %125 = load i64, ptr %2, align 8, !tbaa !13
  %126 = call ptr @scalable_realloc(ptr noundef %124, i64 noundef %125)
  store ptr %126, ptr %6, align 8, !tbaa !9
  %127 = load i64, ptr %2, align 8, !tbaa !13
  %128 = call ptr @scalable_malloc(i64 noundef %127)
  store ptr %128, ptr %7, align 8, !tbaa !9
  br label %129

129:                                              ; preds = %122
  %130 = load i64, ptr %2, align 8, !tbaa !13
  %131 = mul i64 %130, 2
  store i64 %131, ptr %2, align 8, !tbaa !13
  br label %119, !llvm.loop !19

132:                                              ; preds = %119
  %133 = load ptr, ptr %6, align 8, !tbaa !9
  call void @scalable_free(ptr noundef %133)
  %134 = load ptr, ptr %7, align 8, !tbaa !9
  call void @scalable_free(ptr noundef %134)
  %135 = call i32 @scalable_allocation_command(i32 noundef 0, ptr noundef null)
  store i32 %135, ptr %5, align 4, !tbaa !5
  %136 = load i32, ptr %5, align 4, !tbaa !5
  %137 = icmp eq i32 %136, 0
  br i1 %137, label %138, label %139

138:                                              ; preds = %132
  br label %140

139:                                              ; preds = %132
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.1, i32 noundef 117, ptr noundef @__PRETTY_FUNCTION__.main) #6
  unreachable

140:                                              ; preds = %138
  %141 = call i32 @scalable_allocation_command(i32 noundef 1, ptr noundef null)
  store i32 %141, ptr %5, align 4, !tbaa !5
  %142 = load i32, ptr %5, align 4, !tbaa !5
  %143 = icmp eq i32 %142, 4
  br i1 %143, label %144, label %145

144:                                              ; preds = %140
  br label %146

145:                                              ; preds = %140
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.1, i32 noundef 120, ptr noundef @__PRETTY_FUNCTION__.main) #6
  unreachable

146:                                              ; preds = %144
  %147 = call i32 @scalable_allocation_command(i32 noundef 1, ptr noundef inttoptr (i64 1 to ptr))
  store i32 %147, ptr %5, align 4, !tbaa !5
  %148 = load i32, ptr %5, align 4, !tbaa !5
  %149 = icmp eq i32 %148, 1
  br i1 %149, label %150, label %151

150:                                              ; preds = %146
  br label %152

151:                                              ; preds = %146
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.1, i32 noundef 124, ptr noundef @__PRETTY_FUNCTION__.main) #6
  unreachable

152:                                              ; preds = %150
  %153 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  ret i32 0
}

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

; Function Attrs: nounwind
declare i32 @atexit(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @MyExit() #0

declare i32 @scalable_allocation_mode(i32 noundef, i64 noundef) #3

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

declare ptr @scalable_malloc(i64 noundef) #3

declare void @scalable_free(ptr noundef) #3

declare i32 @printf(ptr noundef, ...) #3

declare ptr @scalable_realloc(ptr noundef, i64 noundef) #3

declare ptr @scalable_calloc(i64 noundef, i64 noundef) #3

declare i32 @scalable_allocation_command(i32 noundef, ptr noundef) #3

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = { "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 }
attributes #6 = { 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = distinct !{!15, !12}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}


; 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"

@.str = external hidden unnamed_addr constant [90 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [92 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [15 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [89 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call i32 @atexit(ptr noundef nonnull @MyExit) #4
  %2 = tail call i32 @scalable_allocation_mode(i32 noundef 0, i64 noundef 1) #4
  %3 = icmp eq i32 %2, 0
  br i1 %3, label %5, label %4

4:                                                ; preds = %12, %0
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 70, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #5
  unreachable

5:                                                ; preds = %0
  %6 = tail call ptr @scalable_malloc(i64 noundef 10485760) #4
  %.not52 = icmp eq ptr %6, null
  br i1 %.not52, label %7, label %8

7:                                                ; preds = %15, %5
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 72, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #5
  unreachable

8:                                                ; preds = %5
  %9 = tail call i32 @scalable_allocation_mode(i32 noundef 0, i64 noundef 0) #4
  %10 = icmp eq i32 %9, 0
  br i1 %10, label %12, label %11

11:                                               ; preds = %17, %8
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 74, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #5
  unreachable

12:                                               ; preds = %8
  tail call void @scalable_free(ptr noundef nonnull %6) #4
  %13 = tail call i32 @scalable_allocation_mode(i32 noundef 0, i64 noundef 0) #4
  %14 = icmp eq i32 %13, 0
  br i1 %14, label %15, label %4

15:                                               ; preds = %12
  %16 = tail call ptr @scalable_malloc(i64 noundef 10485760) #4
  %.not52.1 = icmp eq ptr %16, null
  br i1 %.not52.1, label %7, label %17

17:                                               ; preds = %15
  %18 = tail call i32 @scalable_allocation_mode(i32 noundef 0, i64 noundef 1) #4
  %19 = icmp eq i32 %18, 0
  br i1 %19, label %.preheader57.preheader, label %11

.preheader57.preheader:                           ; preds = %17
  tail call void @scalable_free(ptr noundef nonnull %16) #4
  br label %.preheader57

.preheader57:                                     ; preds = %.preheader57.preheader, %23
  %.04662 = phi i64 [ %24, %23 ], [ 0, %.preheader57.preheader ]
  %20 = tail call ptr @scalable_malloc(i64 noundef %.04662) #4
  %.not50 = icmp eq ptr %20, null
  br i1 %.not50, label %21, label %23

21:                                               ; preds = %.preheader57
  %22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  br label %23

23:                                               ; preds = %21, %.preheader57
  tail call void @scalable_free(ptr noundef %20) #4
  %24 = add nuw nsw i64 %.04662, 1
  %exitcond.not = icmp eq i64 %24, 65537
  br i1 %exitcond.not, label %.preheader56, label %.preheader57, !llvm.loop !5

.preheader56:                                     ; preds = %23, %.loopexit
  %.147 = phi i64 [ %65, %.loopexit ], [ 1048576, %23 ]
  %.041 = phi ptr [ %25, %.loopexit ], [ null, %23 ]
  %.0 = phi ptr [ %63, %.loopexit ], [ null, %23 ]
  tail call void @scalable_free(ptr noundef %.041) #4
  %25 = tail call ptr @scalable_realloc(ptr noundef %.0, i64 noundef %.147) #4
  %26 = tail call ptr @scalable_calloc(i64 noundef %.147, i64 noundef 32) #4
  %.not = icmp eq ptr %26, null
  br i1 %.not, label %.loopexit, label %27

27:                                               ; preds = %.preheader56
  %28 = icmp ult i64 %.147, 8
  br i1 %28, label %.preheader53, label %.preheader54

.preheader53:                                     ; preds = %27
  %.not68 = icmp eq i64 %.147, 0
  br i1 %.not68, label %.loopexit, label %.lr.ph

29:                                               ; preds = %.lr.ph
  %exitcond76.not = icmp eq i64 %.147, 1
  br i1 %exitcond76.not, label %.loopexit, label %.lr.ph.1, !llvm.loop !7

.lr.ph.1:                                         ; preds = %29
  %30 = getelementptr inbounds i8, ptr %26, i64 1
  %31 = load i8, ptr %30, align 1, !tbaa !8
  %32 = icmp eq i8 %31, 0
  br i1 %32, label %33, label %55

33:                                               ; preds = %.lr.ph.1
  %exitcond76.not.1 = icmp eq i64 %.147, 2
  br i1 %exitcond76.not.1, label %.loopexit, label %.lr.ph.2, !llvm.loop !7

.lr.ph.2:                                         ; preds = %33
  %34 = getelementptr inbounds i8, ptr %26, i64 2
  %35 = load i8, ptr %34, align 1, !tbaa !8
  %36 = icmp eq i8 %35, 0
  br i1 %36, label %37, label %55

37:                                               ; preds = %.lr.ph.2
  %exitcond76.not.2 = icmp eq i64 %.147, 3
  br i1 %exitcond76.not.2, label %.loopexit, label %.lr.ph.3, !llvm.loop !7

.lr.ph.3:                                         ; preds = %37
  %38 = getelementptr inbounds i8, ptr %26, i64 3
  %39 = load i8, ptr %38, align 1, !tbaa !8
  %40 = icmp eq i8 %39, 0
  br i1 %40, label %41, label %55

41:                                               ; preds = %.lr.ph.3
  %exitcond76.not.3 = icmp eq i64 %.147, 4
  br i1 %exitcond76.not.3, label %.loopexit, label %.lr.ph.4, !llvm.loop !7

.lr.ph.4:                                         ; preds = %41
  %42 = getelementptr inbounds i8, ptr %26, i64 4
  %43 = load i8, ptr %42, align 1, !tbaa !8
  %44 = icmp eq i8 %43, 0
  br i1 %44, label %45, label %55

45:                                               ; preds = %.lr.ph.4
  %exitcond76.not.4 = icmp eq i64 %.147, 5
  br i1 %exitcond76.not.4, label %.loopexit, label %.lr.ph.5, !llvm.loop !7

.lr.ph.5:                                         ; preds = %45
  %46 = getelementptr inbounds i8, ptr %26, i64 5
  %47 = load i8, ptr %46, align 1, !tbaa !8
  %48 = icmp eq i8 %47, 0
  br i1 %48, label %49, label %55

49:                                               ; preds = %.lr.ph.5
  %exitcond76.not.5 = icmp eq i64 %.147, 6
  br i1 %exitcond76.not.5, label %.loopexit, label %.lr.ph.6, !llvm.loop !7

.lr.ph.6:                                         ; preds = %49
  %50 = getelementptr inbounds i8, ptr %26, i64 6
  %51 = load i8, ptr %50, align 1, !tbaa !8
  %52 = icmp eq i8 %51, 0
  br i1 %52, label %.loopexit, label %55

.lr.ph:                                           ; preds = %.preheader53
  %53 = load i8, ptr %26, align 1, !tbaa !8
  %54 = icmp eq i8 %53, 0
  br i1 %54, label %29, label %55

55:                                               ; preds = %.lr.ph.6, %.lr.ph.5, %.lr.ph.4, %.lr.ph.3, %.lr.ph.2, %.lr.ph.1, %.lr.ph
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 98, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #5
  unreachable

56:                                               ; preds = %.preheader54
  %57 = add nuw nsw i64 %.14563, 8
  %58 = icmp ult i64 %57, %.147
  br i1 %58, label %.preheader54, label %.loopexit, !llvm.loop !11

.preheader54:                                     ; preds = %27, %56
  %.14563 = phi i64 [ %57, %56 ], [ 0, %27 ]
  %59 = getelementptr inbounds i64, ptr %26, i64 %.14563
  %60 = load i64, ptr %59, align 8, !tbaa !12
  %61 = icmp eq i64 %60, 0
  br i1 %61, label %56, label %62

62:                                               ; preds = %.preheader54
  tail call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.1, i32 noundef 101, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #5
  unreachable

.loopexit:                                        ; preds = %56, %29, %33, %37, %41, %45, %49, %.lr.ph.6, %.preheader53, %.preheader56
  tail call void @scalable_free(ptr noundef %26) #4
  %63 = tail call ptr @scalable_malloc(i64 noundef %.147) #4
  %64 = icmp eq i64 %.147, 0
  %65 = lshr i64 %.147, 1
  br i1 %64, label %.preheader.preheader, label %.preheader56

.preheader.preheader:                             ; preds = %.loopexit
  tail call void @scalable_free(ptr noundef %25) #4
  %66 = tail call ptr @scalable_realloc(ptr noundef %63, i64 noundef 1) #4
  %67 = tail call ptr @scalable_malloc(i64 noundef 1) #4
  tail call void @scalable_free(ptr noundef %66) #4
  %68 = tail call ptr @scalable_realloc(ptr noundef %67, i64 noundef 2) #4
  %69 = tail call ptr @scalable_malloc(i64 noundef 2) #4
  tail call void @scalable_free(ptr noundef %68) #4
  %70 = tail call ptr @scalable_realloc(ptr noundef %69, i64 noundef 4) #4
  %71 = tail call ptr @scalable_malloc(i64 noundef 4) #4
  tail call void @scalable_free(ptr noundef %70) #4
  %72 = tail call ptr @scalable_realloc(ptr noundef %71, i64 noundef 8) #4
  %73 = tail call ptr @scalable_malloc(i64 noundef 8) #4
  tail call void @scalable_free(ptr noundef %72) #4
  %74 = tail call ptr @scalable_realloc(ptr noundef %73, i64 noundef 16) #4
  %75 = tail call ptr @scalable_malloc(i64 noundef 16) #4
  tail call void @scalable_free(ptr noundef %74) #4
  %76 = tail call ptr @scalable_realloc(ptr noundef %75, i64 noundef 32) #4
  %77 = tail call ptr @scalable_malloc(i64 noundef 32) #4
  tail call void @scalable_free(ptr noundef %76) #4
  %78 = tail call ptr @scalable_realloc(ptr noundef %77, i64 noundef 64) #4
  %79 = tail call ptr @scalable_malloc(i64 noundef 64) #4
  tail call void @scalable_free(ptr noundef %78) #4
  %80 = tail call ptr @scalable_realloc(ptr noundef %79, i64 noundef 128) #4
  %81 = tail call ptr @scalable_malloc(i64 noundef 128) #4
  tail call void @scalable_free(ptr noundef %80) #4
  %82 = tail call ptr @scalable_realloc(ptr noundef %81, i64 noundef 256) #4
  %83 = tail call ptr @scalable_malloc(i64 noundef 256) #4
  tail call void @scalable_free(ptr noundef %82) #4
  %84 = tail call ptr @scalable_realloc(ptr noundef %83, i64 noundef 512) #4
  %85 = tail call ptr @scalable_malloc(i64 noundef 512) #4
  tail call void @scalable_free(ptr noundef %84) #4
  %86 = tail call ptr @scalable_realloc(ptr noundef %85, i64 noundef 1024) #4
  %87 = tail call ptr @scalable_malloc(i64 noundef 1024) #4
  tail call void @scalable_free(ptr noundef %86) #4
  %88 = tail call ptr @scalable_realloc(ptr noundef %87, i64 noundef 2048) #4
  %89 = tail call ptr @scalable_malloc(i64 noundef 2048) #4
  tail call void @scalable_free(ptr noundef %88) #4
  %90 = tail call ptr @scalable_realloc(ptr noundef %89, i64 noundef 4096) #4
  %91 = tail call ptr @scalable_malloc(i64 noundef 4096) #4
  tail call void @scalable_free(ptr noundef %90) #4
  %92 = tail call ptr @scalable_realloc(ptr noundef %91, i64 noundef 8192) #4
  %93 = tail call ptr @scalable_malloc(i64 noundef 8192) #4
  tail call void @scalable_free(ptr noundef %92) #4
  %94 = tail call ptr @scalable_realloc(ptr noundef %93, i64 noundef 16384) #4
  %95 = tail call ptr @scalable_malloc(i64 noundef 16384) #4
  tail call void @scalable_free(ptr noundef %94) #4
  %96 = tail call ptr @scalable_realloc(ptr noundef %95, i64 noundef 32768) #4
  %97 = tail call ptr @scalable_malloc(i64 noundef 32768) #4
  tail call void @scalable_free(ptr noundef %96) #4
  %98 = tail call ptr @scalable_realloc(ptr noundef %97, i64 noundef 65536) #4
  %99 = tail call ptr @scalable_malloc(i64 noundef 65536) #4
  tail call void @scalable_free(ptr noundef %98) #4
  %100 = tail call ptr @scalable_realloc(ptr noundef %99, i64 noundef 131072) #4
  %101 = tail call ptr @scalable_malloc(i64 noundef 131072) #4
  tail call void @scalable_free(ptr noundef %100) #4
  %102 = tail call ptr @scalable_realloc(ptr noundef %101, i64 noundef 262144) #4
  %103 = tail call ptr @scalable_malloc(i64 noundef 262144) #4
  tail call void @scalable_free(ptr noundef %102) #4
  %104 = tail call ptr @scalable_realloc(ptr noundef %103, i64 noundef 524288) #4
  %105 = tail call ptr @scalable_malloc(i64 noundef 524288) #4
  tail call void @scalable_free(ptr noundef %104) #4
  tail call void @scalable_free(ptr noundef %105) #4
  %106 = tail call i32 @scalable_allocation_command(i32 noundef 0, ptr noundef null) #4
  %107 = icmp eq i32 %106, 0
  br i1 %107, label %109, label %108

108:                                              ; preds = %.preheader.preheader
  tail call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.1, i32 noundef 117, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #5
  unreachable

109:                                              ; preds = %.preheader.preheader
  %110 = tail call i32 @scalable_allocation_command(i32 noundef 1, ptr noundef null) #4
  %111 = icmp eq i32 %110, 4
  br i1 %111, label %113, label %112

112:                                              ; preds = %109
  tail call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.1, i32 noundef 120, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #5
  unreachable

113:                                              ; preds = %109
  %114 = tail call i32 @scalable_allocation_command(i32 noundef 1, ptr noundef nonnull inttoptr (i64 1 to ptr)) #4
  %115 = icmp eq i32 %114, 1
  br i1 %115, label %117, label %116

116:                                              ; preds = %113
  tail call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.1, i32 noundef 124, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #5
  unreachable

117:                                              ; preds = %113
  %118 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  ret i32 0
}

; Function Attrs: nofree nounwind
declare i32 @atexit(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @MyExit() #0

declare i32 @scalable_allocation_mode(i32 noundef, i64 noundef) local_unnamed_addr #2

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

declare ptr @scalable_malloc(i64 noundef) local_unnamed_addr #2

declare void @scalable_free(ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

declare ptr @scalable_realloc(ptr noundef, i64 noundef) local_unnamed_addr #2

declare ptr @scalable_calloc(i64 noundef, i64 noundef) local_unnamed_addr #2

declare i32 @scalable_allocation_command(i32 noundef, ptr noundef) local_unnamed_addr #2

attributes #0 = { 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 #1 = { nofree 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 #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 = { 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 = { 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 = distinct !{!7, !6}
!8 = !{!9, !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !9, i64 0}


; Effective O3 passes: GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass