; LLVM IR from lemire/testingRNG :: cpp-prng-bench/micro-bench2.ll (Z4doitv)

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

%"class.std::linear_congruential_engine" = type { i64 }

@.str = external hidden unnamed_addr constant [57 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z4doitv() #0 {
  %1 = alloca %"class.std::linear_congruential_engine", align 8
  %2 = alloca i64, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca [10000 x i64], align 16
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca double, align 8
  %18 = alloca i32, align 4
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #2
  call void @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEC2Em(ptr noundef nonnull align 8 dereferenceable(8) %1, i64 noundef 3405705229)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #2
  store i64 0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #2
  store i32 10000, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #2
  store i32 100000, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 80000, ptr %5) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #2
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %21

21:                                               ; preds = %47, %0
  %22 = load i32, ptr %6, align 4, !tbaa !9
  %23 = icmp slt i32 %22, 10000
  br i1 %23, label %25, label %24

24:                                               ; preds = %21
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #2
  br label %50

25:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #2
  %26 = call i64 @llvm.x86.rdtsc()
  store i64 %26, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #2
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %27

27:                                               ; preds = %36, %25
  %28 = load i32, ptr %9, align 4, !tbaa !9
  %29 = icmp slt i32 %28, 100000
  br i1 %29, label %31, label %30

30:                                               ; preds = %27
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #2
  br label %39

31:                                               ; preds = %27
  %32 = load i64, ptr %2, align 8, !tbaa !5
  %33 = add i64 %32, 1
  store i64 %33, ptr %2, align 8, !tbaa !5
  %34 = load i64, ptr %2, align 8, !tbaa !5
  %35 = call i64 asm "# Do nothing", "=r,0,~{dirflag},~{fpsr},~{flags}"(i64 %34) #9, !srcloc !11
  store i64 %35, ptr %2, align 8, !tbaa !5
  br label %36

36:                                               ; preds = %31
  %37 = load i32, ptr %9, align 4, !tbaa !9
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %9, align 4, !tbaa !9
  br label %27, !llvm.loop !12

39:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #2
  %40 = call i64 @llvm.x86.rdtsc()
  store i64 %40, ptr %10, align 8, !tbaa !5
  %41 = load i64, ptr %10, align 8, !tbaa !5
  %42 = load i64, ptr %8, align 8, !tbaa !5
  %43 = sub i64 %41, %42
  %44 = load i32, ptr %6, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [10000 x i64], ptr %5, i64 0, i64 %45
  store i64 %43, ptr %46, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #2
  br label %47

47:                                               ; preds = %39
  %48 = load i32, ptr %6, align 4, !tbaa !9
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %6, align 4, !tbaa !9
  br label %21, !llvm.loop !14

50:                                               ; preds = %24
  %51 = call noundef ptr @_ZSt5beginImLm10000EEPT_RAT0__S0_(ptr noundef nonnull align 8 dereferenceable(80000) %5) #2
  %52 = call noundef ptr @_ZSt3endImLm10000EEPT_RAT0__S0_(ptr noundef nonnull align 8 dereferenceable(80000) %5) #2
  call void @_ZSt4sortIPmEvT_S1_(ptr noundef %51, ptr noundef %52)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #2
  %53 = getelementptr inbounds [10000 x i64], ptr %5, i64 0, i64 1000
  %54 = load i64, ptr %53, align 16, !tbaa !5
  store i64 %54, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #2
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %55

55:                                               ; preds = %80, %50
  %56 = load i32, ptr %12, align 4, !tbaa !9
  %57 = icmp slt i32 %56, 10000
  br i1 %57, label %59, label %58

58:                                               ; preds = %55
  store i32 8, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #2
  br label %83

59:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #2
  %60 = call i64 @llvm.x86.rdtsc()
  store i64 %60, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #2
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %61

61:                                               ; preds = %69, %59
  %62 = load i32, ptr %14, align 4, !tbaa !9
  %63 = icmp slt i32 %62, 100000
  br i1 %63, label %65, label %64

64:                                               ; preds = %61
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #2
  br label %72

65:                                               ; preds = %61
  %66 = call noundef i64 @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEclEv(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %67 = load i64, ptr %2, align 8, !tbaa !5
  %68 = add i64 %67, %66
  store i64 %68, ptr %2, align 8, !tbaa !5
  br label %69

69:                                               ; preds = %65
  %70 = load i32, ptr %14, align 4, !tbaa !9
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %14, align 4, !tbaa !9
  br label %61, !llvm.loop !15

72:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #2
  %73 = call i64 @llvm.x86.rdtsc()
  store i64 %73, ptr %15, align 8, !tbaa !5
  %74 = load i64, ptr %15, align 8, !tbaa !5
  %75 = load i64, ptr %13, align 8, !tbaa !5
  %76 = sub i64 %74, %75
  %77 = load i32, ptr %12, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [10000 x i64], ptr %5, i64 0, i64 %78
  store i64 %76, ptr %79, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #2
  br label %80

80:                                               ; preds = %72
  %81 = load i32, ptr %12, align 4, !tbaa !9
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %12, align 4, !tbaa !9
  br label %55, !llvm.loop !16

83:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #2
  %84 = call noundef i64 @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EE3maxEv()
  %85 = call noundef i64 @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EE3minEv()
  %86 = sub i64 %84, %85
  %87 = add i64 %86, 1
  store i64 %87, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #2
  %88 = load i64, ptr %16, align 8, !tbaa !5
  %89 = icmp ne i64 %88, 0
  br i1 %89, label %90, label %94

90:                                               ; preds = %83
  %91 = load i64, ptr %16, align 8, !tbaa !5
  %92 = uitofp i64 %91 to double
  %93 = call double @log2(double noundef %92) #2
  br label %95

94:                                               ; preds = %83
  br label %95

95:                                               ; preds = %94, %90
  %96 = phi double [ %93, %90 ], [ 6.400000e+01, %94 ]
  store double %96, ptr %17, align 8, !tbaa !17
  %97 = load double, ptr %17, align 8, !tbaa !17
  %98 = call i32 (ptr, ...) @printf(ptr noundef @.str, i64 noundef 8, double noundef %97)
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #2
  %99 = load double, ptr %17, align 8, !tbaa !17
  %100 = call double @llvm.ceil.f64(double %99)
  %101 = fptosi double %100 to i32
  store i32 %101, ptr %18, align 4, !tbaa !9
  %102 = load i64, ptr %16, align 8, !tbaa !5
  %103 = icmp ugt i64 %102, 0
  br i1 %103, label %104, label %117

104:                                              ; preds = %95
  %105 = load double, ptr %17, align 8, !tbaa !17
  %106 = load i32, ptr %18, align 4, !tbaa !9
  %107 = sitofp i32 %106 to double
  %108 = fcmp une double %105, %107
  br i1 %108, label %109, label %117

109:                                              ; preds = %104
  %110 = load i32, ptr %18, align 4, !tbaa !9
  %111 = load i32, ptr %18, align 4, !tbaa !9
  %112 = zext i32 %111 to i64
  %113 = shl i64 1, %112
  %114 = load i64, ptr %16, align 8, !tbaa !5
  %115 = sub i64 %113, %114
  %116 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %110, i64 noundef %115)
  br label %120

117:                                              ; preds = %104, %95
  %118 = load i32, ptr %18, align 4, !tbaa !9
  %119 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %118)
  br label %120

120:                                              ; preds = %117, %109
  %121 = call noundef ptr @_ZSt5beginImLm10000EEPT_RAT0__S0_(ptr noundef nonnull align 8 dereferenceable(80000) %5) #2
  %122 = call noundef ptr @_ZSt3endImLm10000EEPT_RAT0__S0_(ptr noundef nonnull align 8 dereferenceable(80000) %5) #2
  call void @_ZSt4sortIPmEvT_S1_(ptr noundef %121, ptr noundef %122)
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #2
  %123 = getelementptr inbounds [10000 x i64], ptr %5, i64 0, i64 1000
  %124 = load i64, ptr %123, align 16, !tbaa !5
  store i64 %124, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #2
  %125 = load i64, ptr %19, align 8, !tbaa !5
  %126 = load i64, ptr %11, align 8, !tbaa !5
  %127 = sub i64 %125, %126
  store i64 %127, ptr %20, align 8, !tbaa !5
  %128 = load i64, ptr %20, align 8, !tbaa !5
  %129 = uitofp i64 %128 to double
  %130 = fdiv double %129, 1.000000e+05
  %131 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, double noundef %130)
  %132 = load i64, ptr %2, align 8, !tbaa !5
  %133 = lshr i64 %132, 1
  %134 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i64 noundef %133)
  %135 = load i64, ptr %20, align 8, !tbaa !5
  %136 = load i64, ptr %11, align 8, !tbaa !5
  %137 = load i64, ptr %19, align 8, !tbaa !5
  %138 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i64 noundef %135, i64 noundef %136, i64 noundef %137)
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #2
  call void @llvm.lifetime.end.p0(i64 80000, ptr %5) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #2
  ret void
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEC2Em(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) unnamed_addr #0 align 2

; Function Attrs: nounwind
declare i64 @llvm.x86.rdtsc() #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPmEvT_S1_(ptr noundef, ptr noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZSt5beginImLm10000EEPT_RAT0__S0_(ptr noundef nonnull align 8 dereferenceable(80000)) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZSt3endImLm10000EEPT_RAT0__S0_(ptr noundef nonnull align 8 dereferenceable(80000)) #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEclEv(ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EE3maxEv() #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EE3minEv() #5 align 2

; Function Attrs: nounwind
declare double @log2(double noundef) #6

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #8

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind }
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 = { 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 #5 = { 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 "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 = { "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 #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind memory(none) }

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


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

%"class.std::linear_congruential_engine" = type { i64 }

@.str = external hidden unnamed_addr constant [57 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z4doitv() local_unnamed_addr #0 {
  %1 = alloca %"class.std::linear_congruential_engine", align 8
  %2 = alloca [10000 x i64], align 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #2
  call void @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEC2Em(ptr noundef nonnull align 8 dereferenceable(8) %1, i64 noundef 3405705229)
  call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %2) #2
  br label %8

3:                                                ; preds = %10
  %4 = call noundef ptr @_ZSt5beginImLm10000EEPT_RAT0__S0_(ptr noundef nonnull align 8 dereferenceable(80000) %2) #2
  %5 = call noundef ptr @_ZSt3endImLm10000EEPT_RAT0__S0_(ptr noundef nonnull align 8 dereferenceable(80000) %2) #2
  call void @_ZSt4sortIPmEvT_S1_(ptr noundef %4, ptr noundef %5)
  %6 = getelementptr inbounds i8, ptr %2, i64 8000
  %7 = load i64, ptr %6, align 16, !tbaa !5
  br label %23

8:                                                ; preds = %0, %10
  %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %10 ]
  %.045 = phi i64 [ 0, %0 ], [ %16, %10 ]
  %9 = call i64 @llvm.x86.rdtsc()
  br label %14

10:                                               ; preds = %14
  %11 = call i64 @llvm.x86.rdtsc()
  %12 = sub i64 %11, %9
  %13 = getelementptr inbounds [10000 x i64], ptr %2, i64 0, i64 %indvars.iv
  store i64 %12, ptr %13, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond52.not = icmp eq i64 %indvars.iv.next, 10000
  br i1 %exitcond52.not, label %3, label %8, !llvm.loop !9

14:                                               ; preds = %8, %14
  %.143 = phi i64 [ %.045, %8 ], [ %16, %14 ]
  %.03542 = phi i32 [ 0, %8 ], [ %17, %14 ]
  %15 = add i64 %.143, 1
  %16 = call i64 asm "# Do nothing", "=r,0,~{dirflag},~{fpsr},~{flags}"(i64 %15) #9, !srcloc !11
  %17 = add nuw nsw i32 %.03542, 1
  %exitcond.not = icmp eq i32 %17, 100000
  br i1 %exitcond.not, label %10, label %14, !llvm.loop !12

18:                                               ; preds = %25
  %19 = call noundef i64 @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EE3maxEv()
  %20 = call noundef i64 @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EE3minEv()
  %21 = sub i64 %19, %20
  %22 = add i64 %21, 1
  %.not = icmp eq i64 %22, 0
  br i1 %.not, label %36, label %33

23:                                               ; preds = %3, %25
  %indvars.iv54 = phi i64 [ 0, %3 ], [ %indvars.iv.next55, %25 ]
  %.249 = phi i64 [ %16, %3 ], [ %31, %25 ]
  %24 = call i64 @llvm.x86.rdtsc()
  br label %29

25:                                               ; preds = %29
  %26 = call i64 @llvm.x86.rdtsc()
  %27 = sub i64 %26, %24
  %28 = getelementptr inbounds [10000 x i64], ptr %2, i64 0, i64 %indvars.iv54
  store i64 %27, ptr %28, align 8, !tbaa !5
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %exitcond57.not = icmp eq i64 %indvars.iv.next55, 10000
  br i1 %exitcond57.not, label %18, label %23, !llvm.loop !13

29:                                               ; preds = %23, %29
  %.347 = phi i64 [ %.249, %23 ], [ %31, %29 ]
  %.03746 = phi i32 [ 0, %23 ], [ %32, %29 ]
  %30 = call noundef i64 @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEclEv(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %31 = add i64 %30, %.347
  %32 = add nuw nsw i32 %.03746, 1
  %exitcond53.not = icmp eq i32 %32, 100000
  br i1 %exitcond53.not, label %25, label %29, !llvm.loop !14

33:                                               ; preds = %18
  %34 = uitofp i64 %22 to double
  %35 = call double @log2(double noundef %34) #2
  br label %36

36:                                               ; preds = %18, %33
  %37 = phi double [ %35, %33 ], [ 6.400000e+01, %18 ]
  %38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef 8, double noundef %37)
  %39 = call double @llvm.ceil.f64(double %37)
  %40 = fptosi double %39 to i32
  %.not40 = icmp ne i64 %22, 0
  %41 = sitofp i32 %40 to double
  %42 = fcmp une double %37, %41
  %or.cond = select i1 %.not40, i1 %42, i1 false
  br i1 %or.cond, label %43, label %48

43:                                               ; preds = %36
  %44 = zext nneg i32 %40 to i64
  %45 = shl nuw i64 1, %44
  %46 = sub i64 %45, %22
  %47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %40, i64 noundef %46)
  br label %50

48:                                               ; preds = %36
  %49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %40)
  br label %50

50:                                               ; preds = %48, %43
  %51 = call noundef ptr @_ZSt5beginImLm10000EEPT_RAT0__S0_(ptr noundef nonnull align 8 dereferenceable(80000) %2) #2
  %52 = call noundef ptr @_ZSt3endImLm10000EEPT_RAT0__S0_(ptr noundef nonnull align 8 dereferenceable(80000) %2) #2
  call void @_ZSt4sortIPmEvT_S1_(ptr noundef %51, ptr noundef %52)
  %53 = load i64, ptr %6, align 16, !tbaa !5
  %54 = sub i64 %53, %7
  %55 = uitofp i64 %54 to double
  %56 = fdiv double %55, 1.000000e+05
  %57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %56)
  %58 = lshr i64 %31, 1
  %59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %58)
  %60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i64 noundef %54, i64 noundef %7, i64 noundef %53)
  call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %2) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #2
  ret void
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEC2Em(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) unnamed_addr #0 align 2

; Function Attrs: nounwind
declare i64 @llvm.x86.rdtsc() #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPmEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZSt5beginImLm10000EEPT_RAT0__S0_(ptr noundef nonnull align 8 dereferenceable(80000)) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZSt3endImLm10000EEPT_RAT0__S0_(ptr noundef nonnull align 8 dereferenceable(80000)) local_unnamed_addr #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EE3maxEv() local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EE3minEv() local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @log2(double noundef) local_unnamed_addr #6

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #8

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind }
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 = { 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 #5 = { 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 memory(write) "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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind memory(none) }

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


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