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

; 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 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_E2(ptr noundef, i32 noundef) #1

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

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

22:                                               ; preds = %33, %3
  %23 = load i64, ptr %11, align 8, !tbaa !11
  %24 = icmp ult i64 %23, 2147483647
  br i1 %24, label %26, label %25

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

26:                                               ; preds = %22
  %27 = load i64, ptr %11, align 8, !tbaa !11
  %28 = trunc i64 %27 to i32
  %29 = call zeroext i8 @ECL_Evaluate_E2(i32 noundef %28)
  %30 = zext i8 %29 to i32
  %31 = load i32, ptr %10, align 4, !tbaa !9
  %32 = add i32 %31, %30
  store i32 %32, ptr %10, align 4, !tbaa !9
  br label %33

33:                                               ; preds = %26
  %34 = load i64, ptr %11, align 8, !tbaa !11
  %35 = mul i64 %34, 128
  %36 = udiv i64 %35, 127
  %37 = add i64 %36, 1
  store i64 %37, ptr %11, align 8, !tbaa !11
  br label %22, !llvm.loop !13

38:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %39 = load i32, ptr %10, align 4, !tbaa !9
  %40 = udiv i32 %39, 8
  %41 = add i32 %40, 1
  store i32 %41, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %42 = load i32, ptr %12, align 4, !tbaa !9
  %43 = zext i32 %42 to i64
  %44 = call noalias ptr @malloc(i64 noundef %43) #8
  store ptr %44, ptr %13, align 8, !tbaa !5
  %45 = load ptr, ptr %13, align 8, !tbaa !5
  %46 = icmp ne ptr %45, null
  %47 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %20, i1 noundef zeroext %46)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %48 = load i32, ptr %6, align 4, !tbaa !9
  %49 = add nsw i32 %48, 10
  %50 = call noundef i32 @_ZN13ntest_for_ecl8TestBase12BoundVMinMaxEiii(i32 noundef %49, i32 noundef 0, i32 noundef 1010)
  %51 = add nsw i32 %50, 2
  store i32 %51, 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 %52

52:                                               ; preds = %137, %38
  %53 = load i32, ptr %15, align 4, !tbaa !9
  %54 = load i32, ptr %14, align 4, !tbaa !9
  %55 = icmp slt i32 %53, %54
  br i1 %55, label %57, label %56

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

57:                                               ; preds = %52
  %58 = load ptr, ptr %13, align 8, !tbaa !5
  %59 = load i32, ptr %12, align 4, !tbaa !9
  call void @ECL_JH_WInit(ptr noundef %8, ptr noundef %58, i32 noundef %59, 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 %60

60:                                               ; preds = %67, %57
  %61 = load i64, ptr %17, align 8, !tbaa !11
  %62 = icmp ult i64 %61, 2147483647
  br i1 %62, label %64, label %63

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

64:                                               ; preds = %60
  %65 = load i64, ptr %17, align 8, !tbaa !11
  %66 = trunc i64 %65 to i32
  call void @ECL_JH_Write_E2(ptr noundef %8, i32 noundef %66)
  br label %67

67:                                               ; preds = %64
  %68 = load i64, ptr %17, align 8, !tbaa !11
  %69 = mul i64 %68, 128
  %70 = udiv i64 %69, 127
  %71 = add i64 %70, 1
  store i64 %71, ptr %17, align 8, !tbaa !11
  br label %60, !llvm.loop !15

72:                                               ; preds = %63
  %73 = getelementptr inbounds %struct.ECL_JH_WState, ptr %8, i32 0, i32 4
  %74 = load i8, ptr %73, align 1, !tbaa !16
  %75 = icmp ne i8 %74, 0
  %76 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %20, i1 noundef zeroext %75)
  %77 = load ptr, ptr %13, align 8, !tbaa !5
  %78 = load i32, ptr %12, align 4, !tbaa !9
  call void @ECL_JH_RInit(ptr noundef %9, ptr noundef %77, i32 noundef %78, 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 %79

79:                                               ; preds = %107, %72
  %80 = load i64, ptr %18, align 8, !tbaa !11
  %81 = icmp ult i64 %80, 2147483647
  br i1 %81, label %83, label %82

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

83:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %84 = call i32 @ECL_JH_Read_E2(ptr noundef %9)
  store i32 %84, ptr %19, align 4, !tbaa !9
  %85 = load i64, ptr %18, align 8, !tbaa !11
  %86 = trunc i64 %85 to i32
  %87 = load i32, ptr %19, align 4, !tbaa !9
  %88 = icmp ne i32 %86, %87
  br i1 %88, label %89, label %104

89:                                               ; preds = %83
  %90 = call noundef zeroext i1 @_ZNK13ntest_for_ecl8TestBase11hasntFailedEv(ptr noundef nonnull align 8 dereferenceable(32) %20)
  br i1 %90, label %91, label %102

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

102:                                              ; preds = %91, %89
  %103 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %20, i1 noundef zeroext false)
  br label %106

104:                                              ; preds = %83
  %105 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %20, i1 noundef zeroext true)
  br label %106

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

107:                                              ; preds = %106
  %108 = load i64, ptr %18, align 8, !tbaa !11
  %109 = mul i64 %108, 128
  %110 = udiv i64 %109, 127
  %111 = add i64 %110, 1
  store i64 %111, ptr %18, align 8, !tbaa !11
  br label %79, !llvm.loop !18

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

137:                                              ; preds = %112
  %138 = load i32, ptr %15, align 4, !tbaa !9
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %15, align 4, !tbaa !9
  br label %52, !llvm.loop !27

140:                                              ; preds = %56
  %141 = load ptr, ptr %13, align 8, !tbaa !5
  call void @free(ptr noundef %141) #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
  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 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_E2(ptr noundef, i32 noundef) local_unnamed_addr #1

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

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

6:                                                ; preds = %23
  %7 = lshr i32 %27, 3
  %8 = add nuw nsw i32 %7, 1
  %9 = zext nneg i32 %8 to i64
  %10 = tail call noalias ptr @malloc(i64 noundef %9) #8
  %11 = icmp ne ptr %10, 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 %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %6
  %16 = getelementptr inbounds i8, ptr %4, i64 25
  %17 = getelementptr inbounds i8, ptr %5, i64 25
  %18 = getelementptr inbounds i8, ptr %4, i64 8
  %19 = getelementptr inbounds i8, ptr %5, i64 8
  %20 = getelementptr inbounds i8, ptr %4, i64 24
  %21 = getelementptr inbounds i8, ptr %5, i64 24
  %22 = add i32 %14, 1
  br label %32

23:                                               ; preds = %3, %23
  %.034 = phi i32 [ 0, %3 ], [ %27, %23 ]
  %.03033 = phi i64 [ 0, %3 ], [ %30, %23 ]
  %24 = trunc nuw nsw i64 %.03033 to i32
  %25 = tail call zeroext i8 @ECL_Evaluate_E2(i32 noundef %24)
  %26 = zext i8 %25 to i32
  %27 = add i32 %.034, %26
  %28 = shl nuw nsw i64 %.03033, 7
  %29 = udiv i64 %28, 127
  %30 = add nuw nsw i64 %29, 1
  %31 = icmp ult i64 %.03033, 2130706431
  br i1 %31, label %23, label %6, !llvm.loop !5

._crit_edge:                                      ; preds = %43, %6
  call void @free(ptr noundef %10) #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
  ret void

32:                                               ; preds = %.lr.ph, %43
  %.02937 = phi i32 [ 0, %.lr.ph ], [ %59, %43 ]
  call void @ECL_JH_WInit(ptr noundef nonnull %4, ptr noundef %10, i32 noundef %8, i32 noundef 0)
  br label %37

33:                                               ; preds = %37
  %34 = load i8, ptr %16, align 1, !tbaa !7
  %35 = icmp ne i8 %34, 0
  %36 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %0, i1 noundef zeroext %35)
  call void @ECL_JH_RInit(ptr noundef nonnull %5, ptr noundef %10, i32 noundef %8, i32 noundef 0)
  br label %60

37:                                               ; preds = %32, %37
  %.02835 = phi i64 [ 0, %32 ], [ %41, %37 ]
  %38 = trunc nuw nsw i64 %.02835 to i32
  call void @ECL_JH_Write_E2(ptr noundef nonnull %4, i32 noundef %38)
  %39 = shl nuw nsw i64 %.02835, 7
  %40 = udiv i64 %39, 127
  %41 = add nuw nsw i64 %40, 1
  %42 = icmp ult i64 %.02835, 2130706431
  br i1 %42, label %37, label %33, !llvm.loop !12

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

60:                                               ; preds = %33, %72
  %.02736 = phi i64 [ 0, %33 ], [ %76, %72 ]
  %61 = call i32 @ECL_JH_Read_E2(ptr noundef nonnull %5)
  %62 = trunc nuw nsw i64 %.02736 to i32
  %.not = icmp eq i32 %61, %62
  br i1 %.not, label %72, label %63

63:                                               ; preds = %60
  %64 = call noundef zeroext i1 @_ZNK13ntest_for_ecl8TestBase11hasntFailedEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  br i1 %64, label %65, label %72

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

72:                                               ; preds = %60, %63, %65
  %73 = call noundef zeroext i1 @_ZN13ntest_for_ecl8TestBase7approveEb(ptr noundef nonnull align 8 dereferenceable(32) %0, i1 noundef zeroext %.not)
  %74 = shl nuw nsw i64 %.02736, 7
  %75 = udiv i64 %74, 127
  %76 = add nuw nsw i64 %75, 1
  %77 = icmp ult i64 %.02736, 2130706431
  br i1 %77, label %60, label %43, !llvm.loop !22
}

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