; LLVM IR from Nonoum/ECL :: tests/tests.ll (ZN22test_number_E7_helpers11runInternalERSoi)

; 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.26 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [2 x i8], align 1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK13ntest_for_ecl8TestBase11hasntFailedEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN13ntest_for_ecl8TestBase12BoundVMinMaxEiii(i32 noundef, i32 noundef, i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32), i1 noundef zeroext) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @ECL_Helper_WriteE7(ptr noundef, i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @ECL_Helper_ReadE7(ptr noundef, i32 noundef, ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local zeroext i8 @ECL_Evaluate_E7(i32 noundef) #1

; Function Attrs: nounwind
declare void @free(ptr noundef) #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN22test_number_E7_helpers11runInternalERSoi(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef %2) unnamed_addr #2 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i64, align 8
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  %23 = load ptr, ptr %4, align 8
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN13ntest_for_ecl10ntest_noopEv()
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  store i64 2147483647, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  store i64 0, ptr %9, align 8, !tbaa !11
  br label %25

25:                                               ; preds = %36, %3
  %26 = load i64, ptr %9, align 8, !tbaa !11
  %27 = icmp ult i64 %26, 2147483647
  br i1 %27, label %29, label %28

28:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %41

29:                                               ; preds = %25
  %30 = load i64, ptr %9, align 8, !tbaa !11
  %31 = trunc i64 %30 to i32
  %32 = call zeroext i8 @ECL_Evaluate_E7(i32 noundef %31)
  %33 = zext i8 %32 to i32
  %34 = load i32, ptr %8, align 4, !tbaa !9
  %35 = add i32 %34, %33
  store i32 %35, ptr %8, align 4, !tbaa !9
  br label %36

36:                                               ; preds = %29
  %37 = load i64, ptr %9, align 8, !tbaa !11
  %38 = mul i64 %37, 128
  %39 = udiv i64 %38, 127
  %40 = add i64 %39, 1
  store i64 %40, ptr %9, align 8, !tbaa !11
  br label %25, !llvm.loop !13

41:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %42 = load i32, ptr %8, align 4, !tbaa !9
  %43 = udiv i32 %42, 8
  %44 = add i32 %43, 1
  store i32 %44, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %45 = load i32, ptr %10, align 4, !tbaa !9
  %46 = zext i32 %45 to i64
  %47 = call noalias ptr @malloc(i64 noundef %46) #8
  store ptr %47, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %48 = load ptr, ptr %11, align 8, !tbaa !5
  %49 = load i32, ptr %10, align 4, !tbaa !9
  %50 = zext i32 %49 to i64
  %51 = getelementptr inbounds i8, ptr %48, i64 %50
  store ptr %51, ptr %12, align 8, !tbaa !5
  %52 = load ptr, ptr %11, align 8, !tbaa !5
  %53 = icmp ne ptr %52, null
  %54 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %23, i1 noundef zeroext %53)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %55 = load i32, ptr %6, align 4, !tbaa !9
  %56 = add nsw i32 %55, 10
  %57 = call noundef i32 @_ZN13ntest_for_ecl8TestBase12BoundVMinMaxEiii(i32 noundef %56, i32 noundef 0, i32 noundef 1010)
  %58 = add nsw i32 %57, 2
  store i32 %58, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %59

59:                                               ; preds = %165, %41
  %60 = load i32, ptr %14, align 4, !tbaa !9
  %61 = load i32, ptr %13, align 4, !tbaa !9
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %64, label %63

63:                                               ; preds = %59
  store i32 5, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %168

64:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %65 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %65, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  store i64 0, ptr %17, align 8, !tbaa !11
  br label %66

66:                                               ; preds = %84, %64
  %67 = load i64, ptr %17, align 8, !tbaa !11
  %68 = icmp ult i64 %67, 2147483647
  br i1 %68, label %70, label %69

69:                                               ; preds = %66
  store i32 8, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %89

70:                                               ; preds = %66
  %71 = load ptr, ptr %16, align 8, !tbaa !5
  %72 = load ptr, ptr %12, align 8, !tbaa !5
  %73 = load ptr, ptr %16, align 8, !tbaa !5
  %74 = ptrtoint ptr %72 to i64
  %75 = ptrtoint ptr %73 to i64
  %76 = sub i64 %74, %75
  %77 = trunc i64 %76 to i32
  %78 = load i64, ptr %17, align 8, !tbaa !11
  %79 = trunc i64 %78 to i32
  %80 = call ptr @ECL_Helper_WriteE7(ptr noundef %71, i32 noundef %77, i32 noundef %79)
  store ptr %80, ptr %16, align 8, !tbaa !5
  %81 = load ptr, ptr %16, align 8, !tbaa !5
  %82 = icmp ne ptr %81, null
  %83 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %23, i1 noundef zeroext %82)
  br label %84

84:                                               ; preds = %70
  %85 = load i64, ptr %17, align 8, !tbaa !11
  %86 = mul i64 %85, 128
  %87 = udiv i64 %86, 127
  %88 = add i64 %87, 1
  store i64 %88, ptr %17, align 8, !tbaa !11
  br label %66, !llvm.loop !15

89:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %90 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %90, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %91 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %91, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  store i64 0, ptr %20, align 8, !tbaa !11
  br label %92

92:                                               ; preds = %130, %89
  %93 = load i64, ptr %20, align 8, !tbaa !11
  %94 = icmp ult i64 %93, 2147483647
  br i1 %94, label %96, label %95

95:                                               ; preds = %92
  store i32 11, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %135

96:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 0, ptr %21, align 4, !tbaa !9
  %97 = load ptr, ptr %19, align 8, !tbaa !5
  %98 = load ptr, ptr %12, align 8, !tbaa !5
  %99 = load ptr, ptr %19, align 8, !tbaa !5
  %100 = ptrtoint ptr %98 to i64
  %101 = ptrtoint ptr %99 to i64
  %102 = sub i64 %100, %101
  %103 = trunc i64 %102 to i32
  %104 = call ptr @ECL_Helper_ReadE7(ptr noundef %97, i32 noundef %103, ptr noundef %21)
  store ptr %104, ptr %19, align 8, !tbaa !5
  %105 = load ptr, ptr %19, align 8, !tbaa !5
  %106 = icmp ne ptr %105, null
  %107 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %23, i1 noundef zeroext %106)
  %108 = load i64, ptr %20, align 8, !tbaa !11
  %109 = trunc i64 %108 to i32
  %110 = load i32, ptr %21, align 4, !tbaa !9
  %111 = icmp ne i32 %109, %110
  br i1 %111, label %112, label %127

112:                                              ; preds = %96
  %113 = call noundef zeroext i1 @_ZNK13ntest_for_ecl8TestBase11hasntFailedEv(ptr noundef nonnull align 8 dereferenceable(32) %23)
  br i1 %113, label %114, label %125

114:                                              ; preds = %112
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %115, ptr noundef @.str.26)
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) %116, ptr noundef @_ZSt3hexRSt8ios_base)
  %118 = load i64, ptr %20, align 8, !tbaa !11
  %119 = trunc i64 %118 to i32
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8) %117, i32 noundef %119)
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %120, ptr noundef @.str.27)
  %122 = load i32, ptr %21, align 4, !tbaa !9
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8) %121, i32 noundef %122)
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %123, ptr noundef @.str.28)
  br label %125

125:                                              ; preds = %114, %112
  %126 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %23, i1 noundef zeroext false)
  br label %129

127:                                              ; preds = %96
  %128 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %23, i1 noundef zeroext true)
  br label %129

129:                                              ; preds = %127, %125
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %130

130:                                              ; preds = %129
  %131 = load i64, ptr %20, align 8, !tbaa !11
  %132 = mul i64 %131, 128
  %133 = udiv i64 %132, 127
  %134 = add i64 %133, 1
  store i64 %134, ptr %20, align 8, !tbaa !11
  br label %92, !llvm.loop !16

135:                                              ; preds = %95
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %136 = load ptr, ptr %19, align 8, !tbaa !5
  store ptr %136, ptr %22, align 8, !tbaa !5
  %137 = load ptr, ptr %18, align 8, !tbaa !5
  %138 = load ptr, ptr %12, align 8, !tbaa !5
  %139 = icmp ule ptr %137, %138
  %140 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %23, i1 noundef zeroext %139)
  %141 = load ptr, ptr %18, align 8, !tbaa !5
  %142 = ptrtoint ptr %141 to i64
  %143 = load ptr, ptr %22, align 8, !tbaa !5
  %144 = ptrtoint ptr %143 to i64
  %145 = icmp ne i64 %142, %144
  br i1 %145, label %146, label %162

146:                                              ; preds = %135
  %147 = call noundef zeroext i1 @_ZNK13ntest_for_ecl8TestBase11hasntFailedEv(ptr noundef nonnull align 8 dereferenceable(32) %23)
  br i1 %147, label %148, label %160

148:                                              ; preds = %146
  %149 = load ptr, ptr %5, align 8, !tbaa !5
  %150 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %149, ptr noundef @.str.26)
  %151 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) %150, ptr noundef @_ZSt3hexRSt8ios_base)
  %152 = load ptr, ptr %18, align 8, !tbaa !5
  %153 = ptrtoint ptr %152 to i64
  %154 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %151, i64 noundef %153)
  %155 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %154, ptr noundef @.str.27)
  %156 = load ptr, ptr %22, align 8, !tbaa !5
  %157 = ptrtoint ptr %156 to i64
  %158 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %155, i64 noundef %157)
  %159 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %158, ptr noundef @.str.28)
  br label %160

160:                                              ; preds = %148, %146
  %161 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %23, i1 noundef zeroext false)
  br label %164

162:                                              ; preds = %135
  %163 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %23, i1 noundef zeroext true)
  br label %164

164:                                              ; preds = %162, %160
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %165

165:                                              ; preds = %164
  %166 = load i32, ptr %14, align 4, !tbaa !9
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %14, align 4, !tbaa !9
  br label %59, !llvm.loop !17

168:                                              ; preds = %63
  %169 = load ptr, ptr %11, align 8, !tbaa !5
  call void @free(ptr noundef %169) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN13ntest_for_ecl10ntest_noopEv() #5

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(216) ptr @_ZSt3hexRSt8ios_base(ptr noundef nonnull align 8 dereferenceable(216)) #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #2 align 2

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

!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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}


; 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.26 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [2 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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK13ntest_for_ecl8TestBase11hasntFailedEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN13ntest_for_ecl8TestBase12BoundVMinMaxEiii(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32), i1 noundef zeroext) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @ECL_Helper_WriteE7(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @ECL_Helper_ReadE7(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local zeroext i8 @ECL_Evaluate_E7(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN22test_number_E7_helpers11runInternalERSoi(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef %2) unnamed_addr #2 align 2 {
  %4 = alloca i32, align 4
  tail call void @_ZN13ntest_for_ecl10ntest_noopEv()
  br label %18

5:                                                ; preds = %18
  %6 = lshr i32 %22, 3
  %7 = add nuw nsw i32 %6, 1
  %8 = zext nneg i32 %7 to i64
  %9 = tail call noalias ptr @malloc(i64 noundef %8) #7
  %10 = getelementptr inbounds i8, ptr %9, i64 %8
  %11 = icmp ne ptr %9, null
  %12 = tail call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %0, i1 noundef zeroext %11)
  %13 = add nsw i32 %2, 10
  %14 = tail call noundef i32 @_ZN13ntest_for_ecl8TestBase12BoundVMinMaxEiii(i32 noundef %13, i32 noundef 0, i32 noundef 1010)
  %15 = icmp sgt i32 %14, -2
  br i1 %15, label %.preheader52.lr.ph, label %._crit_edge

.preheader52.lr.ph:                               ; preds = %5
  %16 = ptrtoint ptr %10 to i64
  %17 = add i32 %14, 1
  br label %.preheader52

18:                                               ; preds = %3, %18
  %.054 = phi i32 [ 0, %3 ], [ %22, %18 ]
  %.04453 = phi i64 [ 0, %3 ], [ %25, %18 ]
  %19 = trunc nuw nsw i64 %.04453 to i32
  %20 = tail call zeroext i8 @ECL_Evaluate_E7(i32 noundef %19)
  %21 = zext i8 %20 to i32
  %22 = add i32 %.054, %21
  %23 = shl nuw nsw i64 %.04453, 7
  %24 = udiv i64 %23, 127
  %25 = add nuw nsw i64 %24, 1
  %26 = icmp ult i64 %.04453, 2130706431
  br i1 %26, label %18, label %5, !llvm.loop !5

.preheader52:                                     ; preds = %.preheader52.lr.ph, %77
  %.04759 = phi i32 [ 0, %.preheader52.lr.ph ], [ %79, %77 ]
  br label %27

._crit_edge:                                      ; preds = %77, %5
  call void @free(ptr noundef %9) #8
  ret void

27:                                               ; preds = %.preheader52, %27
  %.04556 = phi i64 [ 0, %.preheader52 ], [ %37, %27 ]
  %.04655 = phi ptr [ %9, %.preheader52 ], [ %32, %27 ]
  %28 = ptrtoint ptr %.04655 to i64
  %29 = sub i64 %16, %28
  %30 = trunc i64 %29 to i32
  %31 = trunc nuw nsw i64 %.04556 to i32
  %32 = call ptr @ECL_Helper_WriteE7(ptr noundef %.04655, i32 noundef %30, i32 noundef %31)
  %33 = icmp ne ptr %32, null
  %34 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %0, i1 noundef zeroext %33)
  %35 = shl nuw nsw i64 %.04556, 7
  %36 = udiv i64 %35, 127
  %37 = add nuw nsw i64 %36, 1
  %38 = icmp ult i64 %.04556, 2130706431
  br i1 %38, label %27, label %.preheader, !llvm.loop !7

39:                                               ; preds = %62
  %40 = icmp ule ptr %32, %10
  %41 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %0, i1 noundef zeroext %40)
  %42 = ptrtoint ptr %32 to i64
  %43 = ptrtoint ptr %47 to i64
  %.not = icmp eq ptr %32, %47
  br i1 %.not, label %77, label %68

.preheader:                                       ; preds = %27, %62
  %.04258 = phi i64 [ %66, %62 ], [ 0, %27 ]
  %.04357 = phi ptr [ %47, %62 ], [ %9, %27 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  store i32 0, ptr %4, align 4, !tbaa !8
  %44 = ptrtoint ptr %.04357 to i64
  %45 = sub i64 %16, %44
  %46 = trunc i64 %45 to i32
  %47 = call ptr @ECL_Helper_ReadE7(ptr noundef %.04357, i32 noundef %46, ptr noundef nonnull %4)
  %48 = icmp ne ptr %47, null
  %49 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %0, i1 noundef zeroext %48)
  %50 = trunc nuw nsw i64 %.04258 to i32
  %51 = load i32, ptr %4, align 4, !tbaa !8
  %.not51 = icmp eq i32 %51, %50
  br i1 %.not51, label %62, label %52

52:                                               ; preds = %.preheader
  %53 = call noundef zeroext i1 @_ZNK13ntest_for_ecl8TestBase11hasntFailedEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  br i1 %53, label %54, label %62

54:                                               ; preds = %52
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull @.str.26)
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) %55, ptr noundef nonnull @_ZSt3hexRSt8ios_base)
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8) %56, i32 noundef %50)
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %57, ptr noundef nonnull @.str.27)
  %59 = load i32, ptr %4, align 4, !tbaa !8
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8) %58, i32 noundef %59)
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %60, ptr noundef nonnull @.str.28)
  br label %62

62:                                               ; preds = %.preheader, %52, %54
  %63 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %0, i1 noundef zeroext %.not51)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  %64 = shl nuw nsw i64 %.04258, 7
  %65 = udiv i64 %64, 127
  %66 = add nuw nsw i64 %65, 1
  %67 = icmp ult i64 %.04258, 2130706431
  br i1 %67, label %.preheader, label %39, !llvm.loop !12

68:                                               ; preds = %39
  %69 = call noundef zeroext i1 @_ZNK13ntest_for_ecl8TestBase11hasntFailedEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  br i1 %69, label %70, label %77

70:                                               ; preds = %68
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull @.str.26)
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) %71, ptr noundef nonnull @_ZSt3hexRSt8ios_base)
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %72, i64 noundef %42)
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %73, ptr noundef nonnull @.str.27)
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %74, i64 noundef %43)
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %75, ptr noundef nonnull @.str.28)
  br label %77

77:                                               ; preds = %39, %68, %70
  %78 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %0, i1 noundef zeroext %.not)
  %79 = add nuw i32 %.04759, 1
  %exitcond = icmp eq i32 %.04759, %17
  br i1 %exitcond, label %._crit_edge, label %.preheader52, !llvm.loop !13
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN13ntest_for_ecl10ntest_noopEv() local_unnamed_addr #5

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(216) ptr @_ZSt3hexRSt8ios_base(ptr noundef nonnull align 8 dereferenceable(216)) #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #2 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress 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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { inlinehint mustprogress 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 #6 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #7 = { nounwind allocsize(0) }
attributes #8 = { 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 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = distinct !{!12, !6}
!13 = distinct !{!13, !6}


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