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

; 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.ECL_JH_WState = type { ptr, ptr, ptr, i8, i8 }
%struct.ECL_JH_RState = type { ptr, ptr, ptr, i8, i8 }

@.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 nounwind uwtable
declare dso_local void @_ZN13ntest_for_ecl8TestBase4skipEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 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 void @ECL_JH_WInit(ptr noundef, ptr noundef, i32 noundef, i32 noundef) #1

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

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

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

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

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

; 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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN14test_number_E311runInternalERSoi(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 %struct.ECL_JH_WState, align 8
  %9 = alloca %struct.ECL_JH_RState, align 8
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i32, align 4
  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
  %20 = load ptr, ptr %4, align 8
  %21 = load i32, ptr %6, align 4, !tbaa !9
  %22 = icmp sle i32 %21, -1
  br i1 %22, label %23, label %24

23:                                               ; preds = %3
  call void @_ZN13ntest_for_ecl8TestBase4skipEv(ptr noundef nonnull align 8 dereferenceable(32) %20)
  br label %146

24:                                               ; preds = %3
  call void @_ZN13ntest_for_ecl10ntest_noopEv()
  %25 = 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 32, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  store i64 0, ptr %11, align 8, !tbaa !11
  br label %26

26:                                               ; preds = %37, %24
  %27 = load i64, ptr %11, align 8, !tbaa !11
  %28 = icmp ult i64 %27, 2147483647
  br i1 %28, label %30, label %29

29:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %42

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

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

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

56:                                               ; preds = %141, %42
  %57 = load i32, ptr %15, align 4, !tbaa !9
  %58 = load i32, ptr %14, align 4, !tbaa !9
  %59 = icmp slt i32 %57, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %56
  store i32 5, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %144

61:                                               ; preds = %56
  %62 = load ptr, ptr %13, align 8, !tbaa !5
  %63 = load i32, ptr %12, align 4, !tbaa !9
  call void @ECL_JH_WInit(ptr noundef %8, ptr noundef %62, i32 noundef %63, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  store i64 0, ptr %17, align 8, !tbaa !11
  br label %64

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

67:                                               ; preds = %64
  store i32 8, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %76

68:                                               ; preds = %64
  %69 = load i64, ptr %17, align 8, !tbaa !11
  %70 = trunc i64 %69 to i32
  call void @ECL_JH_Write_E3(ptr noundef %8, i32 noundef %70)
  br label %71

71:                                               ; preds = %68
  %72 = load i64, ptr %17, align 8, !tbaa !11
  %73 = mul i64 %72, 128
  %74 = udiv i64 %73, 127
  %75 = add i64 %74, 1
  store i64 %75, ptr %17, align 8, !tbaa !11
  br label %64, !llvm.loop !15

76:                                               ; preds = %67
  %77 = getelementptr inbounds %struct.ECL_JH_WState, ptr %8, i32 0, i32 4
  %78 = load i8, ptr %77, align 1, !tbaa !16
  %79 = icmp ne i8 %78, 0
  %80 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %20, i1 noundef zeroext %79)
  %81 = load ptr, ptr %13, align 8, !tbaa !5
  %82 = load i32, ptr %12, align 4, !tbaa !9
  call void @ECL_JH_RInit(ptr noundef %9, ptr noundef %81, i32 noundef %82, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  store i64 0, ptr %18, align 8, !tbaa !11
  br label %83

83:                                               ; preds = %111, %76
  %84 = load i64, ptr %18, align 8, !tbaa !11
  %85 = icmp ult i64 %84, 2147483647
  br i1 %85, label %87, label %86

86:                                               ; preds = %83
  store i32 11, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %116

87:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %88 = call i32 @ECL_JH_Read_E3(ptr noundef %9)
  store i32 %88, ptr %19, align 4, !tbaa !9
  %89 = load i64, ptr %18, align 8, !tbaa !11
  %90 = trunc i64 %89 to i32
  %91 = load i32, ptr %19, align 4, !tbaa !9
  %92 = icmp ne i32 %90, %91
  br i1 %92, label %93, label %108

93:                                               ; preds = %87
  %94 = call noundef zeroext i1 @_ZNK13ntest_for_ecl8TestBase11hasntFailedEv(ptr noundef nonnull align 8 dereferenceable(32) %20)
  br i1 %94, label %95, label %106

95:                                               ; preds = %93
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %96, ptr noundef @.str.26)
  %98 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) %97, ptr noundef @_ZSt3hexRSt8ios_base)
  %99 = load i64, ptr %18, align 8, !tbaa !11
  %100 = trunc i64 %99 to i32
  %101 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8) %98, i32 noundef %100)
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %101, ptr noundef @.str.27)
  %103 = load i32, ptr %19, align 4, !tbaa !9
  %104 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8) %102, i32 noundef %103)
  %105 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %104, ptr noundef @.str.28)
  br label %106

106:                                              ; preds = %95, %93
  %107 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %20, i1 noundef zeroext false)
  br label %110

108:                                              ; preds = %87
  %109 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %20, i1 noundef zeroext true)
  br label %110

110:                                              ; preds = %108, %106
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %111

111:                                              ; preds = %110
  %112 = load i64, ptr %18, align 8, !tbaa !11
  %113 = mul i64 %112, 128
  %114 = udiv i64 %113, 127
  %115 = add i64 %114, 1
  store i64 %115, ptr %18, align 8, !tbaa !11
  br label %83, !llvm.loop !18

116:                                              ; preds = %86
  %117 = getelementptr inbounds %struct.ECL_JH_RState, ptr %9, i32 0, i32 4
  %118 = load i8, ptr %117, align 1, !tbaa !19
  %119 = icmp ne i8 %118, 0
  %120 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %20, i1 noundef zeroext %119)
  %121 = getelementptr inbounds %struct.ECL_JH_WState, ptr %8, i32 0, i32 0
  %122 = load ptr, ptr %121, align 8, !tbaa !21
  %123 = getelementptr inbounds %struct.ECL_JH_RState, ptr %9, i32 0, i32 0
  %124 = load ptr, ptr %123, align 8, !tbaa !22
  %125 = icmp eq ptr %122, %124
  %126 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %20, i1 noundef zeroext %125)
  %127 = getelementptr inbounds %struct.ECL_JH_WState, ptr %8, i32 0, i32 1
  %128 = load ptr, ptr %127, align 8, !tbaa !23
  %129 = getelementptr inbounds %struct.ECL_JH_RState, ptr %9, i32 0, i32 1
  %130 = load ptr, ptr %129, align 8, !tbaa !24
  %131 = icmp eq ptr %128, %130
  %132 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %20, i1 noundef zeroext %131)
  %133 = getelementptr inbounds %struct.ECL_JH_WState, ptr %8, i32 0, i32 3
  %134 = load i8, ptr %133, align 8, !tbaa !25
  %135 = zext i8 %134 to i32
  %136 = getelementptr inbounds %struct.ECL_JH_RState, ptr %9, i32 0, i32 3
  %137 = load i8, ptr %136, align 8, !tbaa !26
  %138 = zext i8 %137 to i32
  %139 = icmp eq i32 %135, %138
  %140 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %20, i1 noundef zeroext %139)
  br label %141

141:                                              ; preds = %116
  %142 = load i32, ptr %15, align 4, !tbaa !9
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %15, align 4, !tbaa !9
  br label %56, !llvm.loop !27

144:                                              ; preds = %60
  %145 = load ptr, ptr %13, align 8, !tbaa !5
  call void @free(ptr noundef %145) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %146

146:                                              ; preds = %144, %23
  ret void
}

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 = !{!17, !7, i64 25}
!17 = !{!"_ZTS13ECL_JH_WState", !6, i64 0, !6, i64 8, !6, i64 16, !7, i64 24, !7, i64 25}
!18 = distinct !{!18, !14}
!19 = !{!20, !7, i64 25}
!20 = !{!"_ZTS13ECL_JH_RState", !6, i64 0, !6, i64 8, !6, i64 16, !7, i64 24, !7, i64 25}
!21 = !{!17, !6, i64 0}
!22 = !{!20, !6, i64 0}
!23 = !{!17, !6, i64 8}
!24 = !{!20, !6, i64 8}
!25 = !{!17, !7, i64 24}
!26 = !{!20, !7, i64 24}
!27 = distinct !{!27, !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"

%struct.ECL_JH_WState = type { ptr, ptr, ptr, i8, i8 }
%struct.ECL_JH_RState = type { ptr, ptr, ptr, i8, i8 }

@.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 nounwind uwtable
declare dso_local void @_ZN13ntest_for_ecl8TestBase4skipEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 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 void @ECL_JH_WInit(ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local zeroext i8 @ECL_Evaluate_E3(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: 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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN14test_number_E311runInternalERSoi(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 %struct.ECL_JH_WState, align 8
  %5 = alloca %struct.ECL_JH_RState, align 8
  %6 = icmp slt i32 %2, 0
  br i1 %6, label %7, label %8

7:                                                ; preds = %3
  tail call void @_ZN13ntest_for_ecl8TestBase4skipEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  br label %81

8:                                                ; preds = %3
  tail call void @_ZN13ntest_for_ecl10ntest_noopEv()
  tail call void @_ZN13ntest_for_ecl10ntest_noopEv()
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #7
  br label %26

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

.lr.ph:                                           ; preds = %9
  %19 = getelementptr inbounds i8, ptr %4, i64 25
  %20 = getelementptr inbounds i8, ptr %5, i64 25
  %21 = getelementptr inbounds i8, ptr %4, i64 8
  %22 = getelementptr inbounds i8, ptr %5, i64 8
  %23 = getelementptr inbounds i8, ptr %4, i64 24
  %24 = getelementptr inbounds i8, ptr %5, i64 24
  %25 = add i32 %17, 1
  br label %35

26:                                               ; preds = %8, %26
  %.036 = phi i32 [ 0, %8 ], [ %30, %26 ]
  %.03135 = phi i64 [ 0, %8 ], [ %33, %26 ]
  %27 = trunc nuw nsw i64 %.03135 to i32
  %28 = tail call zeroext i8 @ECL_Evaluate_E3(i32 noundef %27)
  %29 = zext i8 %28 to i32
  %30 = add i32 %.036, %29
  %31 = shl nuw nsw i64 %.03135, 7
  %32 = udiv i64 %31, 127
  %33 = add nuw nsw i64 %32, 1
  %34 = icmp ult i64 %.03135, 2130706431
  br i1 %34, label %26, label %9, !llvm.loop !5

._crit_edge:                                      ; preds = %46, %9
  call void @free(ptr noundef %13) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #7
  br label %81

35:                                               ; preds = %.lr.ph, %46
  %.03039 = phi i32 [ 0, %.lr.ph ], [ %62, %46 ]
  call void @ECL_JH_WInit(ptr noundef nonnull %4, ptr noundef %13, i32 noundef %11, i32 noundef 0)
  br label %40

36:                                               ; preds = %40
  %37 = load i8, ptr %19, align 1, !tbaa !7
  %38 = icmp ne i8 %37, 0
  %39 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %0, i1 noundef zeroext %38)
  call void @ECL_JH_RInit(ptr noundef nonnull %5, ptr noundef %13, i32 noundef %11, i32 noundef 0)
  br label %63

40:                                               ; preds = %35, %40
  %.02937 = phi i64 [ 0, %35 ], [ %44, %40 ]
  %41 = trunc nuw nsw i64 %.02937 to i32
  call void @ECL_JH_Write_E3(ptr noundef nonnull %4, i32 noundef %41)
  %42 = shl nuw nsw i64 %.02937, 7
  %43 = udiv i64 %42, 127
  %44 = add nuw nsw i64 %43, 1
  %45 = icmp ult i64 %.02937, 2130706431
  br i1 %45, label %40, label %36, !llvm.loop !12

46:                                               ; preds = %75
  %47 = load i8, ptr %20, align 1, !tbaa !13
  %48 = icmp ne i8 %47, 0
  %49 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %0, i1 noundef zeroext %48)
  %50 = load ptr, ptr %4, align 8, !tbaa !15
  %51 = load ptr, ptr %5, align 8, !tbaa !16
  %52 = icmp eq ptr %50, %51
  %53 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %0, i1 noundef zeroext %52)
  %54 = load ptr, ptr %21, align 8, !tbaa !17
  %55 = load ptr, ptr %22, align 8, !tbaa !18
  %56 = icmp eq ptr %54, %55
  %57 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %0, i1 noundef zeroext %56)
  %58 = load i8, ptr %23, align 8, !tbaa !19
  %59 = load i8, ptr %24, align 8, !tbaa !20
  %60 = icmp eq i8 %58, %59
  %61 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %0, i1 noundef zeroext %60)
  %62 = add nuw i32 %.03039, 1
  %exitcond = icmp eq i32 %.03039, %25
  br i1 %exitcond, label %._crit_edge, label %35, !llvm.loop !21

63:                                               ; preds = %36, %75
  %.02838 = phi i64 [ 0, %36 ], [ %79, %75 ]
  %64 = call i32 @ECL_JH_Read_E3(ptr noundef nonnull %5)
  %65 = trunc nuw nsw i64 %.02838 to i32
  %.not = icmp eq i32 %64, %65
  br i1 %.not, label %75, label %66

66:                                               ; preds = %63
  %67 = call noundef zeroext i1 @_ZNK13ntest_for_ecl8TestBase11hasntFailedEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  br i1 %67, label %68, label %75

68:                                               ; preds = %66
  %69 = 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)
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) %69, ptr noundef nonnull @_ZSt3hexRSt8ios_base)
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8) %70, i32 noundef %65)
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %71, ptr noundef nonnull @.str.27)
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8) %72, i32 noundef %64)
  %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.28)
  br label %75

75:                                               ; preds = %63, %66, %68
  %76 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %0, i1 noundef zeroext %.not)
  %77 = shl nuw nsw i64 %.02838, 7
  %78 = udiv i64 %77, 127
  %79 = add nuw nsw i64 %78, 1
  %80 = icmp ult i64 %.02838, 2130706431
  br i1 %80, label %63, label %46, !llvm.loop !22

81:                                               ; preds = %._crit_edge, %7
  ret void
}

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 }
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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !10, i64 25}
!8 = !{!"_ZTS13ECL_JH_WState", !9, i64 0, !9, i64 8, !9, i64 16, !10, i64 24, !10, i64 25}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = distinct !{!12, !6}
!13 = !{!14, !10, i64 25}
!14 = !{!"_ZTS13ECL_JH_RState", !9, i64 0, !9, i64 8, !9, i64 16, !10, i64 24, !10, i64 25}
!15 = !{!8, !9, i64 0}
!16 = !{!14, !9, i64 0}
!17 = !{!8, !9, i64 8}
!18 = !{!14, !9, i64 8}
!19 = !{!8, !10, i64 24}
!20 = !{!14, !10, i64 24}
!21 = distinct !{!21, !6}
!22 = distinct !{!22, !6}


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