; LLVM IR from tsotchke/quantum_rng :: tests (quantum_stats)

; 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.quantum_metrics_t = type { double, double, double, double, double, double, double }

; 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: nounwind uwtable
declare dso_local double @analyze_superposition(ptr noundef) #1

declare i64 @qrng_uint64(ptr noundef) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.ctpop.i64(i64) #3

; Function Attrs: nounwind uwtable
declare dso_local double @measure_decoherence(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local double @analyze_interference(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @analyze_quantum_properties(ptr dead_on_unwind noalias writable sret(%struct.quantum_metrics_t) align 8 %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca double, align 8
  %7 = alloca i32, align 4
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca double, align 8
  %14 = alloca i32, align 4
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  store ptr %1, ptr %3, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %0, i8 0, i64 56, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  %19 = call noalias ptr @malloc(i64 noundef 800000) #8
  store ptr %19, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %20

20:                                               ; preds = %31, %2
  %21 = load i32, ptr %5, align 4, !tbaa !9
  %22 = icmp slt i32 %21, 100000
  br i1 %22, label %24, label %23

23:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %34

24:                                               ; preds = %20
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = call i64 @qrng_uint64(ptr noundef %25)
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = load i32, ptr %5, align 4, !tbaa !9
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds i64, ptr %27, i64 %29
  store i64 %26, ptr %30, align 8, !tbaa !11
  br label %31

31:                                               ; preds = %24
  %32 = load i32, ptr %5, align 4, !tbaa !9
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %5, align 4, !tbaa !9
  br label %20, !llvm.loop !13

34:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store double 0.000000e+00, ptr %6, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 1, ptr %7, align 4, !tbaa !9
  br label %35

35:                                               ; preds = %61, %34
  %36 = load i32, ptr %7, align 4, !tbaa !9
  %37 = icmp slt i32 %36, 100000
  br i1 %37, label %39, label %38

38:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %64

39:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = load i32, ptr %7, align 4, !tbaa !9
  %42 = sub nsw i32 %41, 1
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds i64, ptr %40, i64 %43
  %45 = load i64, ptr %44, align 8, !tbaa !11
  %46 = and i64 %45, 4294967295
  %47 = uitofp i64 %46 to double
  %48 = fdiv double %47, 0x41F0000000000000
  store double %48, ptr %8, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = load i32, ptr %7, align 4, !tbaa !9
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds i64, ptr %49, i64 %51
  %53 = load i64, ptr %52, align 8, !tbaa !11
  %54 = and i64 %53, 4294967295
  %55 = uitofp i64 %54 to double
  %56 = fdiv double %55, 0x41F0000000000000
  store double %56, ptr %9, align 8, !tbaa !15
  %57 = load double, ptr %8, align 8, !tbaa !15
  %58 = load double, ptr %9, align 8, !tbaa !15
  %59 = load double, ptr %6, align 8, !tbaa !15
  %60 = call double @llvm.fmuladd.f64(double %57, double %58, double %59)
  store double %60, ptr %6, align 8, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %61

61:                                               ; preds = %39
  %62 = load i32, ptr %7, align 4, !tbaa !9
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %7, align 4, !tbaa !9
  br label %35, !llvm.loop !17

64:                                               ; preds = %38
  %65 = load double, ptr %6, align 8, !tbaa !15
  %66 = fdiv double %65, 9.999900e+04
  %67 = getelementptr inbounds %struct.quantum_metrics_t, ptr %0, i32 0, i32 0
  store double %66, ptr %67, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store double 0.000000e+00, ptr %10, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %68

68:                                               ; preds = %110, %64
  %69 = load i32, ptr %11, align 4, !tbaa !9
  %70 = icmp slt i32 %69, 99900
  br i1 %70, label %72, label %71

71:                                               ; preds = %68
  store i32 8, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %113

72:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  store double 0.000000e+00, ptr %13, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %73

73:                                               ; preds = %102, %72
  %74 = load i32, ptr %14, align 4, !tbaa !9
  %75 = icmp slt i32 %74, 100
  br i1 %75, label %77, label %76

76:                                               ; preds = %73
  store i32 11, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %105

77:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = load i32, ptr %11, align 4, !tbaa !9
  %80 = load i32, ptr %14, align 4, !tbaa !9
  %81 = add nsw i32 %79, %80
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds i64, ptr %78, i64 %82
  %84 = load i64, ptr %83, align 8, !tbaa !11
  %85 = load ptr, ptr %4, align 8, !tbaa !5
  %86 = load i32, ptr %11, align 4, !tbaa !9
  %87 = load i32, ptr %14, align 4, !tbaa !9
  %88 = add nsw i32 %86, %87
  %89 = add nsw i32 %88, 1
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds i64, ptr %85, i64 %90
  %92 = load i64, ptr %91, align 8, !tbaa !11
  %93 = xor i64 %84, %92
  store i64 %93, ptr %15, align 8, !tbaa !11
  %94 = load i64, ptr %15, align 8, !tbaa !11
  %95 = call i64 @llvm.ctpop.i64(i64 %94)
  %96 = trunc i64 %95 to i32
  %97 = sitofp i32 %96 to double
  %98 = fdiv double %97, 6.400000e+01
  %99 = call double @log2(double noundef %98) #7
  %100 = load double, ptr %13, align 8, !tbaa !15
  %101 = fsub double %100, %99
  store double %101, ptr %13, align 8, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %102

102:                                              ; preds = %77
  %103 = load i32, ptr %14, align 4, !tbaa !9
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %14, align 4, !tbaa !9
  br label %73, !llvm.loop !20

105:                                              ; preds = %76
  %106 = load double, ptr %13, align 8, !tbaa !15
  %107 = fdiv double %106, 1.000000e+02
  %108 = load double, ptr %10, align 8, !tbaa !15
  %109 = fadd double %108, %107
  store double %109, ptr %10, align 8, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %110

110:                                              ; preds = %105
  %111 = load i32, ptr %11, align 4, !tbaa !9
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %11, align 4, !tbaa !9
  br label %68, !llvm.loop !21

113:                                              ; preds = %71
  %114 = load double, ptr %10, align 8, !tbaa !15
  %115 = fdiv double %114, 9.990000e+04
  %116 = getelementptr inbounds %struct.quantum_metrics_t, ptr %0, i32 0, i32 1
  store double %115, ptr %116, align 8, !tbaa !22
  %117 = getelementptr inbounds %struct.quantum_metrics_t, ptr %0, i32 0, i32 2
  store double 0.000000e+00, ptr %117, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %118

118:                                              ; preds = %137, %113
  %119 = load i32, ptr %16, align 4, !tbaa !9
  %120 = icmp slt i32 %119, 100
  br i1 %120, label %122, label %121

121:                                              ; preds = %118
  store i32 14, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %140

122:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %123 = load ptr, ptr %3, align 8, !tbaa !5
  %124 = call i64 @qrng_uint64(ptr noundef %123)
  store i64 %124, ptr %17, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %125 = load ptr, ptr %3, align 8, !tbaa !5
  %126 = call i64 @qrng_uint64(ptr noundef %125)
  store i64 %126, ptr %18, align 8, !tbaa !11
  %127 = load i64, ptr %17, align 8, !tbaa !11
  %128 = load i64, ptr %18, align 8, !tbaa !11
  %129 = xor i64 %127, %128
  %130 = call i64 @llvm.ctpop.i64(i64 %129)
  %131 = trunc i64 %130 to i32
  %132 = sitofp i32 %131 to double
  %133 = fdiv double %132, 6.400000e+01
  %134 = getelementptr inbounds %struct.quantum_metrics_t, ptr %0, i32 0, i32 2
  %135 = load double, ptr %134, align 8, !tbaa !23
  %136 = fadd double %135, %133
  store double %136, ptr %134, align 8, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %137

137:                                              ; preds = %122
  %138 = load i32, ptr %16, align 4, !tbaa !9
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %16, align 4, !tbaa !9
  br label %118, !llvm.loop !24

140:                                              ; preds = %121
  %141 = getelementptr inbounds %struct.quantum_metrics_t, ptr %0, i32 0, i32 2
  %142 = load double, ptr %141, align 8, !tbaa !23
  %143 = fdiv double %142, 1.000000e+02
  store double %143, ptr %141, align 8, !tbaa !23
  %144 = load ptr, ptr %3, align 8, !tbaa !5
  %145 = call double @analyze_superposition(ptr noundef %144)
  %146 = getelementptr inbounds %struct.quantum_metrics_t, ptr %0, i32 0, i32 3
  store double %145, ptr %146, align 8, !tbaa !25
  %147 = load ptr, ptr %3, align 8, !tbaa !5
  %148 = call double @analyze_interference(ptr noundef %147)
  %149 = getelementptr inbounds %struct.quantum_metrics_t, ptr %0, i32 0, i32 4
  store double %148, ptr %149, align 8, !tbaa !26
  %150 = load ptr, ptr %4, align 8, !tbaa !5
  %151 = call double @calculate_entropy(ptr noundef %150, i64 noundef 100000)
  %152 = getelementptr inbounds %struct.quantum_metrics_t, ptr %0, i32 0, i32 5
  store double %151, ptr %152, align 8, !tbaa !27
  %153 = load ptr, ptr %3, align 8, !tbaa !5
  %154 = call double @measure_decoherence(ptr noundef %153)
  %155 = getelementptr inbounds %struct.quantum_metrics_t, ptr %0, i32 0, i32 6
  store double %154, ptr %155, align 8, !tbaa !28
  %156 = load ptr, ptr %4, align 8, !tbaa !5
  call void @free(ptr noundef %156) #7
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  ret void
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

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

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

declare double @calculate_entropy(ptr noundef, i64 noundef) #2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 #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 = { 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/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 = !{!16, !16, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = distinct !{!17, !14}
!18 = !{!19, !16, i64 0}
!19 = !{!"", !16, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !16, i64 32, !16, i64 40, !16, i64 48}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}
!22 = !{!19, !16, i64 8}
!23 = !{!19, !16, i64 16}
!24 = distinct !{!24, !14}
!25 = !{!19, !16, i64 24}
!26 = !{!19, !16, i64 32}
!27 = !{!19, !16, i64 40}
!28 = !{!19, !16, i64 48}


; 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.quantum_metrics_t = type { double, double, double, double, double, double, double }

; Function Attrs: nounwind uwtable
declare dso_local double @analyze_superposition(ptr noundef) local_unnamed_addr #0

declare i64 @qrng_uint64(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.ctpop.i64(i64) #2

; Function Attrs: nounwind uwtable
declare dso_local double @measure_decoherence(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local double @analyze_interference(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @analyze_quantum_properties(ptr dead_on_unwind noalias nocapture writable writeonly sret(%struct.quantum_metrics_t) align 8 %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = tail call noalias dereferenceable_or_null(800000) ptr @malloc(i64 noundef 800000) #6
  br label %4

4:                                                ; preds = %2, %4
  %indvars.iv = phi i64 [ 0, %2 ], [ %indvars.iv.next, %4 ]
  %5 = tail call i64 @qrng_uint64(ptr noundef %1) #7
  %6 = getelementptr inbounds i64, ptr %3, i64 %indvars.iv
  store i64 %5, ptr %6, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 100000
  br i1 %exitcond.not, label %.preheader47, label %4, !llvm.loop !9

7:                                                ; preds = %.preheader47
  %8 = fdiv double %19, 9.999900e+04
  store double %8, ptr %0, align 8, !tbaa !11
  br label %.preheader

.preheader47:                                     ; preds = %4, %.preheader47.1
  %indvars.iv60 = phi i64 [ %indvars.iv.next61.1, %.preheader47.1 ], [ 1, %4 ]
  %.04050 = phi double [ %28, %.preheader47.1 ], [ 0.000000e+00, %4 ]
  %9 = getelementptr i64, ptr %3, i64 %indvars.iv60
  %10 = getelementptr i8, ptr %9, i64 -8
  %11 = load i64, ptr %10, align 8, !tbaa !5
  %12 = and i64 %11, 4294967295
  %13 = uitofp nneg i64 %12 to double
  %14 = fmul double %13, 0x3DF0000000000000
  %15 = load i64, ptr %9, align 8, !tbaa !5
  %16 = and i64 %15, 4294967295
  %17 = uitofp nneg i64 %16 to double
  %18 = fmul double %17, 0x3DF0000000000000
  %19 = tail call double @llvm.fmuladd.f64(double %14, double %18, double %.04050)
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %exitcond63.not = icmp eq i64 %indvars.iv.next61, 100000
  br i1 %exitcond63.not, label %7, label %.preheader47.1, !llvm.loop !14

.preheader47.1:                                   ; preds = %.preheader47
  %20 = getelementptr i64, ptr %3, i64 %indvars.iv.next61
  %21 = and i64 %15, 4294967295
  %22 = uitofp nneg i64 %21 to double
  %23 = fmul double %22, 0x3DF0000000000000
  %24 = load i64, ptr %20, align 8, !tbaa !5
  %25 = and i64 %24, 4294967295
  %26 = uitofp nneg i64 %25 to double
  %27 = fmul double %26, 0x3DF0000000000000
  %28 = tail call double @llvm.fmuladd.f64(double %23, double %27, double %19)
  %indvars.iv.next61.1 = add nuw nsw i64 %indvars.iv60, 2
  br label %.preheader47

.preheader:                                       ; preds = %7, %32
  %indvars.iv68 = phi i64 [ 0, %7 ], [ %indvars.iv.next69, %32 ]
  %.04653 = phi double [ 0.000000e+00, %7 ], [ %34, %32 ]
  %invariant.gep = getelementptr inbounds i64, ptr %3, i64 %indvars.iv68
  br label %35

29:                                               ; preds = %32
  %30 = fdiv double %34, 9.990000e+04
  %31 = getelementptr inbounds i8, ptr %0, i64 8
  store double %30, ptr %31, align 8, !tbaa !15
  br label %57

32:                                               ; preds = %35
  %33 = fdiv double %45, 1.000000e+02
  %34 = fadd double %.04653, %33
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %exitcond71.not = icmp eq i64 %indvars.iv.next69, 99900
  br i1 %exitcond71.not, label %29, label %.preheader, !llvm.loop !16

35:                                               ; preds = %.preheader, %35
  %indvars.iv64 = phi i64 [ 0, %.preheader ], [ %indvars.iv.next65, %35 ]
  %.04451 = phi double [ 0.000000e+00, %.preheader ], [ %45, %35 ]
  %gep = getelementptr inbounds i64, ptr %invariant.gep, i64 %indvars.iv64
  %36 = load i64, ptr %gep, align 8, !tbaa !5
  %37 = getelementptr inbounds i8, ptr %gep, i64 8
  %38 = load i64, ptr %37, align 8, !tbaa !5
  %39 = xor i64 %38, %36
  %40 = tail call range(i64 0, 65) i64 @llvm.ctpop.i64(i64 %39)
  %41 = trunc nuw nsw i64 %40 to i32
  %42 = uitofp nneg i32 %41 to double
  %43 = fmul double %42, 1.562500e-02
  %44 = tail call double @log2(double noundef %43) #7
  %45 = fsub double %.04451, %44
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %exitcond67.not = icmp eq i64 %indvars.iv.next65, 100
  br i1 %exitcond67.not, label %32, label %35, !llvm.loop !17

46:                                               ; preds = %57
  %47 = getelementptr inbounds i8, ptr %0, i64 16
  %48 = fdiv double %66, 1.000000e+02
  store double %48, ptr %47, align 8, !tbaa !18
  %49 = tail call double @analyze_superposition(ptr noundef %1)
  %50 = getelementptr inbounds i8, ptr %0, i64 24
  store double %49, ptr %50, align 8, !tbaa !19
  %51 = tail call double @analyze_interference(ptr noundef %1)
  %52 = getelementptr inbounds i8, ptr %0, i64 32
  store double %51, ptr %52, align 8, !tbaa !20
  %53 = tail call double @calculate_entropy(ptr noundef %3, i64 noundef 100000) #7
  %54 = getelementptr inbounds i8, ptr %0, i64 40
  store double %53, ptr %54, align 8, !tbaa !21
  %55 = tail call double @measure_decoherence(ptr noundef %1)
  %56 = getelementptr inbounds i8, ptr %0, i64 48
  store double %55, ptr %56, align 8, !tbaa !22
  tail call void @free(ptr noundef %3) #7
  ret void

57:                                               ; preds = %29, %57
  %.04155 = phi i32 [ 0, %29 ], [ %67, %57 ]
  %58 = phi double [ 0.000000e+00, %29 ], [ %66, %57 ]
  %59 = tail call i64 @qrng_uint64(ptr noundef %1) #7
  %60 = tail call i64 @qrng_uint64(ptr noundef %1) #7
  %61 = xor i64 %60, %59
  %62 = tail call range(i64 0, 65) i64 @llvm.ctpop.i64(i64 %61)
  %63 = trunc nuw nsw i64 %62 to i32
  %64 = uitofp nneg i32 %63 to double
  %65 = fmul double %64, 1.562500e-02
  %66 = fadd double %58, %65
  %67 = add nuw nsw i32 %.04155, 1
  %exitcond72.not = icmp eq i32 %67, 100
  br i1 %exitcond72.not, label %46, label %57, !llvm.loop !23
}

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

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

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

declare double @calculate_entropy(ptr noundef, i64 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 #5

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !13, i64 0}
!12 = !{!"", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48}
!13 = !{!"double", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = !{!12, !13, i64 8}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = !{!12, !13, i64 16}
!19 = !{!12, !13, i64 24}
!20 = !{!12, !13, i64 32}
!21 = !{!12, !13, i64 40}
!22 = !{!12, !13, i64 48}
!23 = distinct !{!23, !10}


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