; LLVM IR from tsotchke/quantum_rng :: examples/games (quantum_dice_demo)

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

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [31 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca [10 x i32], align 16
  %10 = alloca i32, align 4
  %11 = alloca [6 x i32], align 16
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %15 = call i32 @qrng_init(ptr noundef %2, ptr noundef null, i64 noundef 0)
  store i32 %15, ptr %3, align 4, !tbaa !5
  %16 = load i32, ptr %3, align 4, !tbaa !5
  %17 = icmp ne i32 %16, 0
  br i1 %17, label %18, label %23

18:                                               ; preds = %0
  %19 = load ptr, ptr @stderr, align 8, !tbaa !9
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = call ptr @qrng_error_string(i32 noundef %20)
  %22 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %19, ptr noundef @.str, ptr noundef %21) #5
  store i32 1, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %134

23:                                               ; preds = %0
  %24 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %25 = load ptr, ptr %2, align 8, !tbaa !9
  %26 = call ptr @quantum_dice_create(ptr noundef %25, i32 noundef 6)
  store ptr %26, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %27 = load ptr, ptr %2, align 8, !tbaa !9
  %28 = call ptr @quantum_dice_create(ptr noundef %27, i32 noundef 20)
  store ptr %28, ptr %6, align 8, !tbaa !9
  %29 = load ptr, ptr %5, align 8, !tbaa !9
  %30 = icmp ne ptr %29, null
  br i1 %30, label %31, label %34

31:                                               ; preds = %23
  %32 = load ptr, ptr %6, align 8, !tbaa !9
  %33 = icmp ne ptr %32, null
  br i1 %33, label %38, label %34

34:                                               ; preds = %31, %23
  %35 = load ptr, ptr @stderr, align 8, !tbaa !9
  %36 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef @.str.2) #5
  %37 = load ptr, ptr %2, align 8, !tbaa !9
  call void @qrng_free(ptr noundef %37)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %133

38:                                               ; preds = %31
  %39 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %48, %38
  %41 = load i32, ptr %7, align 4, !tbaa !5
  %42 = icmp slt i32 %41, 5
  br i1 %42, label %44, label %43

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

44:                                               ; preds = %40
  %45 = load ptr, ptr %5, align 8, !tbaa !9
  %46 = call i32 @quantum_dice_roll(ptr noundef %45)
  %47 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %46)
  br label %48

48:                                               ; preds = %44
  %49 = load i32, ptr %7, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %7, align 4, !tbaa !5
  br label %40, !llvm.loop !11

51:                                               ; preds = %43
  %52 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  %53 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %62, %51
  %55 = load i32, ptr %8, align 4, !tbaa !5
  %56 = icmp slt i32 %55, 5
  br i1 %56, label %58, label %57

57:                                               ; preds = %54
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %65

58:                                               ; preds = %54
  %59 = load ptr, ptr %6, align 8, !tbaa !9
  %60 = call i32 @quantum_dice_roll(ptr noundef %59)
  %61 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %60)
  br label %62

62:                                               ; preds = %58
  %63 = load i32, ptr %8, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %8, align 4, !tbaa !5
  br label %54, !llvm.loop !13

65:                                               ; preds = %57
  %66 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  %67 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  call void @llvm.lifetime.start.p0(i64 40, ptr %9) #5
  %68 = load ptr, ptr %5, align 8, !tbaa !9
  %69 = getelementptr inbounds [10 x i32], ptr %9, i64 0, i64 0
  %70 = call i32 @quantum_dice_batch_roll(ptr noundef %68, ptr noundef %69, i32 noundef 10)
  %71 = icmp eq i32 %70, 0
  br i1 %71, label %72, label %88

72:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %83, %72
  %74 = load i32, ptr %10, align 4, !tbaa !5
  %75 = icmp slt i32 %74, 10
  br i1 %75, label %77, label %76

76:                                               ; preds = %73
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %86

77:                                               ; preds = %73
  %78 = load i32, ptr %10, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [10 x i32], ptr %9, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %81)
  br label %83

83:                                               ; preds = %77
  %84 = load i32, ptr %10, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %10, align 4, !tbaa !5
  br label %73, !llvm.loop !14

86:                                               ; preds = %76
  %87 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  br label %88

88:                                               ; preds = %86, %65
  %89 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #5
  call void @llvm.memset.p0.i64(ptr align 16 %11, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %103, %88
  %91 = load i32, ptr %12, align 4, !tbaa !5
  %92 = icmp slt i32 %91, 1000
  br i1 %92, label %94, label %93

93:                                               ; preds = %90
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %106

94:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %95 = load ptr, ptr %5, align 8, !tbaa !9
  %96 = call i32 @quantum_dice_roll(ptr noundef %95)
  store i32 %96, ptr %13, align 4, !tbaa !5
  %97 = load i32, ptr %13, align 4, !tbaa !5
  %98 = sub nsw i32 %97, 1
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [6 x i32], ptr %11, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %100, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %103

103:                                              ; preds = %94
  %104 = load i32, ptr %12, align 4, !tbaa !5
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %12, align 4, !tbaa !5
  br label %90, !llvm.loop !15

106:                                              ; preds = %93
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %107

107:                                              ; preds = %125, %106
  %108 = load i32, ptr %14, align 4, !tbaa !5
  %109 = icmp slt i32 %108, 6
  br i1 %109, label %111, label %110

110:                                              ; preds = %107
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %128

111:                                              ; preds = %107
  %112 = load i32, ptr %14, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  %114 = load i32, ptr %14, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [6 x i32], ptr %11, i64 0, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = load i32, ptr %14, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [6 x i32], ptr %11, i64 0, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = sitofp i32 %121 to double
  %123 = fdiv double %122, 1.000000e+01
  %124 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, i32 noundef %113, i32 noundef %117, double noundef %123)
  br label %125

125:                                              ; preds = %111
  %126 = load i32, ptr %14, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %14, align 4, !tbaa !5
  br label %107, !llvm.loop !16

128:                                              ; preds = %110
  %129 = load ptr, ptr %5, align 8, !tbaa !9
  call void @quantum_dice_free(ptr noundef %129)
  %130 = load ptr, ptr %6, align 8, !tbaa !9
  call void @quantum_dice_free(ptr noundef %130)
  %131 = load ptr, ptr %2, align 8, !tbaa !9
  call void @qrng_free(ptr noundef %131)
  %132 = call i32 (ptr, ...) @printf(ptr noundef @.str.11)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %9) #5
  br label %133

133:                                              ; preds = %128, %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %134

134:                                              ; preds = %133, %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %135 = load i32, ptr %1, align 4
  ret i32 %135
}

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

declare i32 @qrng_init(ptr noundef, ptr noundef, i64 noundef) #2

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #3

declare ptr @qrng_error_string(i32 noundef) #2

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

declare ptr @quantum_dice_create(ptr noundef, i32 noundef) #2

declare void @qrng_free(ptr noundef) #2

declare i32 @quantum_dice_roll(ptr noundef) #2

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

declare i32 @quantum_dice_batch_roll(ptr noundef, ptr noundef, i32 noundef) #2

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

declare void @quantum_dice_free(ptr noundef) #2

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


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

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [31 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main() local_unnamed_addr #0 {
  %1 = alloca ptr, align 8
  %2 = alloca [10 x i32], align 16
  %3 = alloca [6 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  %4 = call i32 @qrng_init(ptr noundef nonnull %1, ptr noundef null, i64 noundef 0) #5
  %.not = icmp eq i32 %4, 0
  br i1 %.not, label %9, label %5

5:                                                ; preds = %0
  %6 = load ptr, ptr @stderr, align 8, !tbaa !5
  %7 = call ptr @qrng_error_string(i32 noundef %4) #5
  %8 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %6, ptr noundef nonnull @.str, ptr noundef %7) #6
  br label %120

9:                                                ; preds = %0
  %10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %11 = load ptr, ptr %1, align 8, !tbaa !5
  %12 = call ptr @quantum_dice_create(ptr noundef %11, i32 noundef 6) #5
  %13 = load ptr, ptr %1, align 8, !tbaa !5
  %14 = call ptr @quantum_dice_create(ptr noundef %13, i32 noundef 20) #5
  %15 = icmp ne ptr %12, null
  %16 = icmp ne ptr %14, null
  %or.cond = select i1 %15, i1 %16, i1 false
  br i1 %or.cond, label %21, label %17

17:                                               ; preds = %9
  %18 = load ptr, ptr @stderr, align 8, !tbaa !5
  %19 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %18, ptr noundef nonnull @.str.2) #6
  %20 = load ptr, ptr %1, align 8, !tbaa !5
  call void @qrng_free(ptr noundef %20) #5
  br label %120

21:                                               ; preds = %9
  %22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %23 = call i32 @quantum_dice_roll(ptr noundef nonnull %12) #5
  %24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %23)
  %25 = call i32 @quantum_dice_roll(ptr noundef nonnull %12) #5
  %26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %25)
  %27 = call i32 @quantum_dice_roll(ptr noundef nonnull %12) #5
  %28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %27)
  %29 = call i32 @quantum_dice_roll(ptr noundef nonnull %12) #5
  %30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %29)
  %31 = call i32 @quantum_dice_roll(ptr noundef nonnull %12) #5
  %32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %31)
  %33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  %34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %35 = call i32 @quantum_dice_roll(ptr noundef nonnull %14) #5
  %36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %35)
  %37 = call i32 @quantum_dice_roll(ptr noundef nonnull %14) #5
  %38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %37)
  %39 = call i32 @quantum_dice_roll(ptr noundef nonnull %14) #5
  %40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %39)
  %41 = call i32 @quantum_dice_roll(ptr noundef nonnull %14) #5
  %42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %41)
  %43 = call i32 @quantum_dice_roll(ptr noundef nonnull %14) #5
  %44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %43)
  %45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  %46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %2) #5
  %47 = call i32 @quantum_dice_batch_roll(ptr noundef nonnull %12, ptr noundef nonnull %2, i32 noundef 10) #5
  %48 = icmp eq i32 %47, 0
  br i1 %48, label %.preheader34.preheader, label %79

.preheader34.preheader:                           ; preds = %21
  %49 = load i32, ptr %2, align 16, !tbaa !9
  %50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %49)
  %51 = getelementptr inbounds i8, ptr %2, i64 4
  %52 = load i32, ptr %51, align 4, !tbaa !9
  %53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %52)
  %54 = getelementptr inbounds i8, ptr %2, i64 8
  %55 = load i32, ptr %54, align 8, !tbaa !9
  %56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %55)
  %57 = getelementptr inbounds i8, ptr %2, i64 12
  %58 = load i32, ptr %57, align 4, !tbaa !9
  %59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %58)
  %60 = getelementptr inbounds i8, ptr %2, i64 16
  %61 = load i32, ptr %60, align 16, !tbaa !9
  %62 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %61)
  %63 = getelementptr inbounds i8, ptr %2, i64 20
  %64 = load i32, ptr %63, align 4, !tbaa !9
  %65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %64)
  %66 = getelementptr inbounds i8, ptr %2, i64 24
  %67 = load i32, ptr %66, align 8, !tbaa !9
  %68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %67)
  %69 = getelementptr inbounds i8, ptr %2, i64 28
  %70 = load i32, ptr %69, align 4, !tbaa !9
  %71 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %70)
  %72 = getelementptr inbounds i8, ptr %2, i64 32
  %73 = load i32, ptr %72, align 16, !tbaa !9
  %74 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %73)
  %75 = getelementptr inbounds i8, ptr %2, i64 36
  %76 = load i32, ptr %75, align 4, !tbaa !9
  %77 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %76)
  %78 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  br label %79

79:                                               ; preds = %.preheader34.preheader, %21
  %80 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(24) %3, i8 0, i64 24, i1 false)
  br label %81

81:                                               ; preds = %79, %81
  %.02738 = phi i32 [ 0, %79 ], [ %88, %81 ]
  %82 = call i32 @quantum_dice_roll(ptr noundef nonnull %12) #5
  %83 = add nsw i32 %82, -1
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [6 x i32], ptr %3, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !9
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %85, align 4, !tbaa !9
  %88 = add nuw nsw i32 %.02738, 1
  %exitcond.not = icmp eq i32 %88, 1000
  br i1 %exitcond.not, label %.preheader.preheader, label %81, !llvm.loop !11

.preheader.preheader:                             ; preds = %81
  %89 = load i32, ptr %3, align 16, !tbaa !9
  %90 = sitofp i32 %89 to double
  %91 = fdiv double %90, 1.000000e+01
  %92 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i32 noundef 1, i32 noundef %89, double noundef %91)
  %93 = getelementptr inbounds i8, ptr %3, i64 4
  %94 = load i32, ptr %93, align 4, !tbaa !9
  %95 = sitofp i32 %94 to double
  %96 = fdiv double %95, 1.000000e+01
  %97 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i32 noundef 2, i32 noundef %94, double noundef %96)
  %98 = getelementptr inbounds i8, ptr %3, i64 8
  %99 = load i32, ptr %98, align 8, !tbaa !9
  %100 = sitofp i32 %99 to double
  %101 = fdiv double %100, 1.000000e+01
  %102 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i32 noundef 3, i32 noundef %99, double noundef %101)
  %103 = getelementptr inbounds i8, ptr %3, i64 12
  %104 = load i32, ptr %103, align 4, !tbaa !9
  %105 = sitofp i32 %104 to double
  %106 = fdiv double %105, 1.000000e+01
  %107 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i32 noundef 4, i32 noundef %104, double noundef %106)
  %108 = getelementptr inbounds i8, ptr %3, i64 16
  %109 = load i32, ptr %108, align 16, !tbaa !9
  %110 = sitofp i32 %109 to double
  %111 = fdiv double %110, 1.000000e+01
  %112 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i32 noundef 5, i32 noundef %109, double noundef %111)
  %113 = getelementptr inbounds i8, ptr %3, i64 20
  %114 = load i32, ptr %113, align 4, !tbaa !9
  %115 = sitofp i32 %114 to double
  %116 = fdiv double %115, 1.000000e+01
  %117 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i32 noundef 6, i32 noundef %114, double noundef %116)
  call void @quantum_dice_free(ptr noundef nonnull %12) #5
  call void @quantum_dice_free(ptr noundef nonnull %14) #5
  %118 = load ptr, ptr %1, align 8, !tbaa !5
  call void @qrng_free(ptr noundef %118) #5
  %119 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %2) #5
  br label %120

120:                                              ; preds = %17, %.preheader.preheader, %5
  %.1 = phi i32 [ 1, %5 ], [ 0, %.preheader.preheader ], [ 1, %17 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  ret i32 %.1
}

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

declare i32 @qrng_init(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

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

declare ptr @qrng_error_string(i32 noundef) local_unnamed_addr #2

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

declare ptr @quantum_dice_create(ptr noundef, i32 noundef) local_unnamed_addr #2

declare void @qrng_free(ptr noundef) local_unnamed_addr #2

declare i32 @quantum_dice_roll(ptr noundef) local_unnamed_addr #2

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

declare i32 @quantum_dice_batch_roll(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

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

declare void @quantum_dice_free(ptr noundef) local_unnamed_addr #2

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
attributes #6 = { cold 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 = !{!"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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,LoopSimplifyPass,SROAPass,SimplifyCFGPass