; LLVM IR from tsotchke/quantum_rng :: src (quantum_rng_cli)

; 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.options_t = type { i8, %union.anon, i64, i32, i8, ptr }
%union.anon = type { %struct.anon }
%struct.anon = type { i64, i64 }
%struct.anon.0 = type { i64, i64 }

@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@stderr = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [34 x i8], align 1
@stdout = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [11 x i8], align 1

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

21:                                               ; preds = %2
  %22 = load i32, ptr %7, align 4, !tbaa !5
  %23 = icmp sgt i32 %22, 0
  %24 = zext i1 %23 to i64
  %25 = select i1 %23, i32 0, i32 1
  store i32 %25, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %225

26:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %27 = call noalias ptr @fopen(ptr noundef @.str, ptr noundef @.str.1)
  store ptr %27, ptr %11, align 8, !tbaa !9
  %28 = load ptr, ptr %11, align 8, !tbaa !9
  %29 = icmp ne ptr %28, null
  br i1 %29, label %30, label %35

30:                                               ; preds = %26
  %31 = getelementptr inbounds [32 x i8], ptr %10, i64 0, i64 0
  %32 = load ptr, ptr %11, align 8, !tbaa !9
  %33 = call i64 @fread(ptr noundef %31, i64 noundef 1, i64 noundef 32, ptr noundef %32)
  %34 = icmp ne i64 %33, 32
  br i1 %34, label %35, label %44

35:                                               ; preds = %30, %26
  %36 = load ptr, ptr @stderr, align 8, !tbaa !9
  %37 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %36, ptr noundef @.str.2) #5
  %38 = load ptr, ptr %11, align 8, !tbaa !9
  %39 = icmp ne ptr %38, null
  br i1 %39, label %40, label %43

40:                                               ; preds = %35
  %41 = load ptr, ptr %11, align 8, !tbaa !9
  %42 = call i32 @fclose(ptr noundef %41)
  br label %43

43:                                               ; preds = %40, %35
  store i32 1, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %224

44:                                               ; preds = %30
  %45 = load ptr, ptr %11, align 8, !tbaa !9
  %46 = call i32 @fclose(ptr noundef %45)
  %47 = getelementptr inbounds [32 x i8], ptr %10, i64 0, i64 0
  %48 = call i32 @qrng_init(ptr noundef %9, ptr noundef %47, i64 noundef 32)
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %50, label %53

50:                                               ; preds = %44
  %51 = load ptr, ptr @stderr, align 8, !tbaa !9
  %52 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %51, ptr noundef @.str.3) #5
  store i32 1, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %224

53:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %54 = load ptr, ptr @stdout, align 8, !tbaa !9
  store ptr %54, ptr %12, align 8, !tbaa !9
  %55 = getelementptr inbounds %struct.options_t, ptr %6, i32 0, i32 5
  %56 = load ptr, ptr %55, align 8, !tbaa !11
  %57 = icmp ne ptr %56, null
  br i1 %57, label %58, label %71

58:                                               ; preds = %53
  %59 = getelementptr inbounds %struct.options_t, ptr %6, i32 0, i32 5
  %60 = load ptr, ptr %59, align 8, !tbaa !11
  %61 = call noalias ptr @fopen(ptr noundef %60, ptr noundef @.str.4)
  store ptr %61, ptr %12, align 8, !tbaa !9
  %62 = load ptr, ptr %12, align 8, !tbaa !9
  %63 = icmp ne ptr %62, null
  br i1 %63, label %70, label %64

64:                                               ; preds = %58
  %65 = load ptr, ptr @stderr, align 8, !tbaa !9
  %66 = getelementptr inbounds %struct.options_t, ptr %6, i32 0, i32 5
  %67 = load ptr, ptr %66, align 8, !tbaa !11
  %68 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %65, ptr noundef @.str.5, ptr noundef %67) #5
  %69 = load ptr, ptr %9, align 8, !tbaa !9
  call void @qrng_free(ptr noundef %69)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %223

70:                                               ; preds = %58
  br label %71

71:                                               ; preds = %70, %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store ptr null, ptr %13, align 8, !tbaa !9
  %72 = getelementptr inbounds %struct.options_t, ptr %6, i32 0, i32 4
  %73 = load i8, ptr %72, align 4, !tbaa !15, !range !16, !noundef !17
  %74 = trunc i8 %73 to i1
  br i1 %74, label %75, label %94

75:                                               ; preds = %71
  %76 = getelementptr inbounds %struct.options_t, ptr %6, i32 0, i32 2
  %77 = load i64, ptr %76, align 8, !tbaa !18
  %78 = mul i64 %77, 8
  %79 = call noalias ptr @malloc(i64 noundef %78) #6
  store ptr %79, ptr %13, align 8, !tbaa !9
  %80 = load ptr, ptr %13, align 8, !tbaa !9
  %81 = icmp ne ptr %80, null
  br i1 %81, label %93, label %82

82:                                               ; preds = %75
  %83 = load ptr, ptr @stderr, align 8, !tbaa !9
  %84 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %83, ptr noundef @.str.6) #5
  %85 = load ptr, ptr %12, align 8, !tbaa !9
  %86 = load ptr, ptr @stdout, align 8, !tbaa !9
  %87 = icmp ne ptr %85, %86
  br i1 %87, label %88, label %91

88:                                               ; preds = %82
  %89 = load ptr, ptr %12, align 8, !tbaa !9
  %90 = call i32 @fclose(ptr noundef %89)
  br label %91

91:                                               ; preds = %88, %82
  %92 = load ptr, ptr %9, align 8, !tbaa !9
  call void @qrng_free(ptr noundef %92)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %222

93:                                               ; preds = %75
  br label %94

94:                                               ; preds = %93, %71
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store i64 0, ptr %14, align 8, !tbaa !19
  br label %95

95:                                               ; preds = %199, %94
  %96 = load i64, ptr %14, align 8, !tbaa !19
  %97 = getelementptr inbounds %struct.options_t, ptr %6, i32 0, i32 2
  %98 = load i64, ptr %97, align 8, !tbaa !18
  %99 = icmp ult i64 %96, %98
  br i1 %99, label %101, label %100

100:                                              ; preds = %95
  store i32 2, ptr %8, align 4
  br label %202

101:                                              ; preds = %95
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %102 = getelementptr inbounds %struct.options_t, ptr %6, i32 0, i32 0
  %103 = load i8, ptr %102, align 8, !tbaa !20, !range !16, !noundef !17
  %104 = trunc i8 %103 to i1
  br i1 %104, label %105, label %117

105:                                              ; preds = %101
  %106 = load ptr, ptr %9, align 8, !tbaa !9
  %107 = getelementptr inbounds %struct.options_t, ptr %6, i32 0, i32 1
  %108 = getelementptr inbounds %struct.anon.0, ptr %107, i32 0, i32 0
  %109 = load i64, ptr %108, align 8, !tbaa !21
  %110 = trunc i64 %109 to i32
  %111 = getelementptr inbounds %struct.options_t, ptr %6, i32 0, i32 1
  %112 = getelementptr inbounds %struct.anon.0, ptr %111, i32 0, i32 1
  %113 = load i64, ptr %112, align 8, !tbaa !21
  %114 = trunc i64 %113 to i32
  %115 = call i32 @qrng_range32(ptr noundef %106, i32 noundef %110, i32 noundef %114)
  %116 = sext i32 %115 to i64
  store i64 %116, ptr %15, align 8, !tbaa !19
  br label %126

117:                                              ; preds = %101
  %118 = load ptr, ptr %9, align 8, !tbaa !9
  %119 = getelementptr inbounds %struct.options_t, ptr %6, i32 0, i32 1
  %120 = getelementptr inbounds %struct.anon, ptr %119, i32 0, i32 0
  %121 = load i64, ptr %120, align 8, !tbaa !21
  %122 = getelementptr inbounds %struct.options_t, ptr %6, i32 0, i32 1
  %123 = getelementptr inbounds %struct.anon, ptr %122, i32 0, i32 1
  %124 = load i64, ptr %123, align 8, !tbaa !21
  %125 = call i64 @qrng_range64(ptr noundef %118, i64 noundef %121, i64 noundef %124)
  store i64 %125, ptr %15, align 8, !tbaa !19
  br label %126

126:                                              ; preds = %117, %105
  %127 = getelementptr inbounds %struct.options_t, ptr %6, i32 0, i32 0
  %128 = load i8, ptr %127, align 8, !tbaa !20, !range !16, !noundef !17
  %129 = trunc i8 %128 to i1
  br i1 %129, label %130, label %136

130:                                              ; preds = %126
  %131 = load i64, ptr %15, align 8, !tbaa !19
  %132 = getelementptr inbounds %struct.options_t, ptr %6, i32 0, i32 1
  %133 = getelementptr inbounds %struct.anon.0, ptr %132, i32 0, i32 1
  %134 = load i64, ptr %133, align 8, !tbaa !21
  %135 = icmp sgt i64 %131, %134
  br i1 %135, label %146, label %136

136:                                              ; preds = %130, %126
  %137 = getelementptr inbounds %struct.options_t, ptr %6, i32 0, i32 0
  %138 = load i8, ptr %137, align 8, !tbaa !20, !range !16, !noundef !17
  %139 = trunc i8 %138 to i1
  br i1 %139, label %163, label %140

140:                                              ; preds = %136
  %141 = load i64, ptr %15, align 8, !tbaa !19
  %142 = getelementptr inbounds %struct.options_t, ptr %6, i32 0, i32 1
  %143 = getelementptr inbounds %struct.anon, ptr %142, i32 0, i32 1
  %144 = load i64, ptr %143, align 8, !tbaa !21
  %145 = icmp ugt i64 %141, %144
  br i1 %145, label %146, label %163

146:                                              ; preds = %140, %130
  %147 = load ptr, ptr @stderr, align 8, !tbaa !9
  %148 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %147, ptr noundef @.str.7) #5
  %149 = getelementptr inbounds %struct.options_t, ptr %6, i32 0, i32 4
  %150 = load i8, ptr %149, align 4, !tbaa !15, !range !16, !noundef !17
  %151 = trunc i8 %150 to i1
  br i1 %151, label %152, label %154

152:                                              ; preds = %146
  %153 = load ptr, ptr %13, align 8, !tbaa !9
  call void @free(ptr noundef %153) #5
  br label %154

154:                                              ; preds = %152, %146
  %155 = load ptr, ptr %12, align 8, !tbaa !9
  %156 = load ptr, ptr @stdout, align 8, !tbaa !9
  %157 = icmp ne ptr %155, %156
  br i1 %157, label %158, label %161

158:                                              ; preds = %154
  %159 = load ptr, ptr %12, align 8, !tbaa !9
  %160 = call i32 @fclose(ptr noundef %159)
  br label %161

161:                                              ; preds = %158, %154
  %162 = load ptr, ptr %9, align 8, !tbaa !9
  call void @qrng_free(ptr noundef %162)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %196

163:                                              ; preds = %140, %136
  %164 = getelementptr inbounds %struct.options_t, ptr %6, i32 0, i32 4
  %165 = load i8, ptr %164, align 4, !tbaa !15, !range !16, !noundef !17
  %166 = trunc i8 %165 to i1
  br i1 %166, label %167, label %172

167:                                              ; preds = %163
  %168 = load i64, ptr %15, align 8, !tbaa !19
  %169 = load ptr, ptr %13, align 8, !tbaa !9
  %170 = load i64, ptr %14, align 8, !tbaa !19
  %171 = getelementptr inbounds i64, ptr %169, i64 %170
  store i64 %168, ptr %171, align 8, !tbaa !19
  br label %172

172:                                              ; preds = %167, %163
  %173 = getelementptr inbounds %struct.options_t, ptr %6, i32 0, i32 3
  %174 = load i32, ptr %173, align 8, !tbaa !22
  switch i32 %174, label %195 [
    i32 0, label %175
    i32 1, label %188
    i32 2, label %192
  ]

175:                                              ; preds = %172
  %176 = getelementptr inbounds %struct.options_t, ptr %6, i32 0, i32 0
  %177 = load i8, ptr %176, align 8, !tbaa !20, !range !16, !noundef !17
  %178 = trunc i8 %177 to i1
  br i1 %178, label %179, label %183

179:                                              ; preds = %175
  %180 = load ptr, ptr %12, align 8, !tbaa !9
  %181 = load i64, ptr %15, align 8, !tbaa !19
  %182 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %180, ptr noundef @.str.8, i64 noundef %181) #5
  br label %187

183:                                              ; preds = %175
  %184 = load ptr, ptr %12, align 8, !tbaa !9
  %185 = load i64, ptr %15, align 8, !tbaa !19
  %186 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %184, ptr noundef @.str.9, i64 noundef %185) #5
  br label %187

187:                                              ; preds = %183, %179
  br label %195

188:                                              ; preds = %172
  %189 = load ptr, ptr %12, align 8, !tbaa !9
  %190 = load i64, ptr %15, align 8, !tbaa !19
  %191 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %189, ptr noundef @.str.10, i64 noundef %190) #5
  br label %195

192:                                              ; preds = %172
  %193 = load ptr, ptr %12, align 8, !tbaa !9
  %194 = load i64, ptr %15, align 8, !tbaa !19
  call void @print_binary(ptr noundef %193, i64 noundef %194, ptr noundef %6)
  br label %195

195:                                              ; preds = %192, %188, %187, %172
  store i32 0, ptr %8, align 4
  br label %196

196:                                              ; preds = %195, %161
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  %197 = load i32, ptr %8, align 4
  switch i32 %197, label %202 [
    i32 0, label %198
  ]

198:                                              ; preds = %196
  br label %199

199:                                              ; preds = %198
  %200 = load i64, ptr %14, align 8, !tbaa !19
  %201 = add i64 %200, 1
  store i64 %201, ptr %14, align 8, !tbaa !19
  br label %95, !llvm.loop !23

202:                                              ; preds = %196, %100
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  %203 = load i32, ptr %8, align 4
  switch i32 %203, label %222 [
    i32 2, label %204
  ]

204:                                              ; preds = %202
  %205 = getelementptr inbounds %struct.options_t, ptr %6, i32 0, i32 4
  %206 = load i8, ptr %205, align 4, !tbaa !15, !range !16, !noundef !17
  %207 = trunc i8 %206 to i1
  br i1 %207, label %208, label %213

208:                                              ; preds = %204
  %209 = load ptr, ptr %13, align 8, !tbaa !9
  %210 = getelementptr inbounds %struct.options_t, ptr %6, i32 0, i32 2
  %211 = load i64, ptr %210, align 8, !tbaa !18
  call void @analyze_numbers(ptr noundef %209, i64 noundef %211, ptr noundef %6)
  %212 = load ptr, ptr %13, align 8, !tbaa !9
  call void @free(ptr noundef %212) #5
  br label %213

213:                                              ; preds = %208, %204
  %214 = load ptr, ptr %12, align 8, !tbaa !9
  %215 = load ptr, ptr @stdout, align 8, !tbaa !9
  %216 = icmp ne ptr %214, %215
  br i1 %216, label %217, label %220

217:                                              ; preds = %213
  %218 = load ptr, ptr %12, align 8, !tbaa !9
  %219 = call i32 @fclose(ptr noundef %218)
  br label %220

220:                                              ; preds = %217, %213
  %221 = load ptr, ptr %9, align 8, !tbaa !9
  call void @qrng_free(ptr noundef %221)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %222

222:                                              ; preds = %220, %202, %91
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %223

223:                                              ; preds = %222, %64
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %224

224:                                              ; preds = %223, %50, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %225

225:                                              ; preds = %224, %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %6) #5
  %226 = load i32, ptr %3, align 4
  ret i32 %226
}

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

; Function Attrs: nounwind uwtable
declare hidden i32 @parse_options(i32 noundef, ptr noundef, ptr noundef) #0

declare noalias ptr @fopen(ptr noundef, ptr noundef) #2

declare i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #2

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

declare i32 @fclose(ptr noundef) #2

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

declare void @qrng_free(ptr noundef) #2

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

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

declare i64 @qrng_range64(ptr noundef, i64 noundef, i64 noundef) #2

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

; Function Attrs: nounwind uwtable
declare hidden void @print_binary(ptr noundef, i64 noundef, ptr noundef) #0

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

; Function Attrs: nounwind uwtable
declare hidden void @analyze_numbers(ptr noundef, i64 noundef, ptr noundef) #0

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 = { 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 #5 = { nounwind }
attributes #6 = { 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 = !{!"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 = !{!12, !10, i64 40}
!12 = !{!"", !13, i64 0, !7, i64 8, !14, i64 24, !6, i64 32, !13, i64 36, !10, i64 40}
!13 = !{!"_Bool", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!12, !13, i64 36}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!12, !14, i64 24}
!19 = !{!14, !14, i64 0}
!20 = !{!12, !13, i64 0}
!21 = !{!7, !7, i64 0}
!22 = !{!12, !6, i64 32}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


; 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.options_t = type { i8, %union.anon, i64, i32, i8, ptr }
%union.anon = type { %struct.anon }
%struct.anon = type { i64, i64 }

@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [34 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [11 x i8], align 1

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

7:                                                ; preds = %2
  %8 = icmp slt i32 %6, 1
  %9 = zext i1 %8 to i32
  br label %118

10:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #6
  %11 = call noalias ptr @fopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1)
  %.not50 = icmp eq ptr %11, null
  br i1 %.not50, label %.critedge, label %12

12:                                               ; preds = %10
  %13 = call i64 @fread(ptr noundef nonnull %5, i64 noundef 1, i64 noundef 32, ptr noundef nonnull %11)
  %.not51 = icmp eq i64 %13, 32
  br i1 %.not51, label %20, label %14

14:                                               ; preds = %12
  %15 = load ptr, ptr @stderr, align 8, !tbaa !5
  %16 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef nonnull @.str.2) #7
  %17 = call i32 @fclose(ptr noundef nonnull %11)
  br label %117

.critedge:                                        ; preds = %10
  %18 = load ptr, ptr @stderr, align 8, !tbaa !5
  %19 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %18, ptr noundef nonnull @.str.2) #7
  br label %117

20:                                               ; preds = %12
  %21 = call i32 @fclose(ptr noundef nonnull %11)
  %22 = call i32 @qrng_init(ptr noundef nonnull %4, ptr noundef nonnull %5, i64 noundef 32) #6
  %.not52 = icmp eq i32 %22, 0
  br i1 %.not52, label %26, label %23

23:                                               ; preds = %20
  %24 = load ptr, ptr @stderr, align 8, !tbaa !5
  %25 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.3) #7
  br label %117

26:                                               ; preds = %20
  %27 = load ptr, ptr @stdout, align 8, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %3, i64 40
  %29 = load ptr, ptr %28, align 8, !tbaa !9
  %.not53 = icmp eq ptr %29, null
  br i1 %.not53, label %37, label %30

30:                                               ; preds = %26
  %31 = call noalias ptr @fopen(ptr noundef nonnull %29, ptr noundef nonnull @.str.4)
  %.not54 = icmp eq ptr %31, null
  br i1 %.not54, label %32, label %37

32:                                               ; preds = %30
  %33 = load ptr, ptr @stderr, align 8, !tbaa !5
  %34 = load ptr, ptr %28, align 8, !tbaa !9
  %35 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %33, ptr noundef nonnull @.str.5, ptr noundef %34) #7
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  call void @qrng_free(ptr noundef %36) #6
  br label %117

37:                                               ; preds = %30, %26
  %.040 = phi ptr [ %31, %30 ], [ %27, %26 ]
  %38 = getelementptr inbounds i8, ptr %3, i64 36
  %39 = load i8, ptr %38, align 4, !tbaa !14, !range !15, !noundef !16
  %40 = trunc nuw i8 %39 to i1
  %41 = getelementptr inbounds i8, ptr %3, i64 24
  %42 = load i64, ptr %41, align 8, !tbaa !17
  br i1 %40, label %43, label %._crit_edge76

43:                                               ; preds = %37
  %44 = shl i64 %42, 3
  %45 = call noalias ptr @malloc(i64 noundef %44) #8
  %.not55 = icmp eq ptr %45, null
  br i1 %.not55, label %46, label %._crit_edge76

46:                                               ; preds = %43
  %47 = load ptr, ptr @stderr, align 8, !tbaa !5
  %48 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef nonnull @.str.6) #7
  %49 = load ptr, ptr @stdout, align 8, !tbaa !5
  %.not56 = icmp eq ptr %.040, %49
  br i1 %.not56, label %52, label %50

50:                                               ; preds = %46
  %51 = call i32 @fclose(ptr noundef %.040)
  br label %52

52:                                               ; preds = %50, %46
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  call void @qrng_free(ptr noundef %53) #6
  br label %117

._crit_edge76:                                    ; preds = %37, %43
  %.039 = phi ptr [ %45, %43 ], [ null, %37 ]
  %54 = getelementptr inbounds i8, ptr %3, i64 24
  %.not5874.not = icmp eq i64 %42, 0
  br i1 %.not5874.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %._crit_edge76
  %55 = getelementptr inbounds i8, ptr %3, i64 8
  %56 = getelementptr inbounds i8, ptr %3, i64 16
  %57 = getelementptr inbounds i8, ptr %3, i64 32
  br label %58

58:                                               ; preds = %.lr.ph, %104
  %.03875 = phi i64 [ 0, %.lr.ph ], [ %105, %104 ]
  %59 = load i8, ptr %3, align 8, !tbaa !18, !range !15, !noundef !16
  %60 = trunc nuw i8 %59 to i1
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = load i64, ptr %55, align 8, !tbaa !19
  br i1 %60, label %63, label %69

63:                                               ; preds = %58
  %64 = trunc i64 %62 to i32
  %65 = load i64, ptr %56, align 8, !tbaa !19
  %66 = trunc i64 %65 to i32
  %67 = call i32 @qrng_range32(ptr noundef %61, i32 noundef %64, i32 noundef %66) #6
  %68 = sext i32 %67 to i64
  br label %72

69:                                               ; preds = %58
  %70 = load i64, ptr %56, align 8, !tbaa !19
  %71 = call i64 @qrng_range64(ptr noundef %61, i64 noundef %62, i64 noundef %70) #6
  br label %72

72:                                               ; preds = %69, %63
  %.0 = phi i64 [ %68, %63 ], [ %71, %69 ]
  %73 = load i8, ptr %3, align 8, !tbaa !18, !range !15, !noundef !16
  %74 = trunc nuw i8 %73 to i1
  %75 = load i64, ptr %56, align 8
  %76 = icmp sle i64 %.0, %75
  %77 = icmp ule i64 %.0, %75
  %or.cond72 = select i1 %74, i1 %76, i1 %77
  br i1 %or.cond72, label %88, label %78

78:                                               ; preds = %72
  %79 = load ptr, ptr @stderr, align 8, !tbaa !5
  %80 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %79, ptr noundef nonnull @.str.7) #7
  %81 = load i8, ptr %38, align 4, !tbaa !14, !range !15, !noundef !16
  %82 = trunc nuw i8 %81 to i1
  br i1 %82, label %83, label %84

83:                                               ; preds = %78
  call void @free(ptr noundef %.039) #6
  br label %84

84:                                               ; preds = %83, %78
  %85 = load ptr, ptr @stdout, align 8, !tbaa !5
  %.not57 = icmp eq ptr %.040, %85
  br i1 %.not57, label %.thread69, label %86

86:                                               ; preds = %84
  %87 = call i32 @fclose(ptr noundef %.040)
  br label %.thread69

88:                                               ; preds = %72
  %89 = load i8, ptr %38, align 4, !tbaa !14, !range !15, !noundef !16
  %90 = trunc nuw i8 %89 to i1
  br i1 %90, label %91, label %93

91:                                               ; preds = %88
  %92 = getelementptr inbounds i64, ptr %.039, i64 %.03875
  store i64 %.0, ptr %92, align 8, !tbaa !20
  br label %93

93:                                               ; preds = %91, %88
  %94 = load i32, ptr %57, align 8, !tbaa !21
  switch i32 %94, label %104 [
    i32 0, label %95
    i32 1, label %100
    i32 2, label %102
  ]

95:                                               ; preds = %93
  br i1 %74, label %96, label %98

96:                                               ; preds = %95
  %97 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %.040, ptr noundef nonnull @.str.8, i64 noundef %.0) #6
  br label %104

98:                                               ; preds = %95
  %99 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %.040, ptr noundef nonnull @.str.9, i64 noundef %.0) #6
  br label %104

100:                                              ; preds = %93
  %101 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %.040, ptr noundef nonnull @.str.10, i64 noundef %.0) #6
  br label %104

102:                                              ; preds = %93
  call void @print_binary(ptr noundef %.040, i64 noundef %.0, ptr noundef nonnull %3)
  br label %104

.thread69:                                        ; preds = %86, %84
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  call void @qrng_free(ptr noundef %103) #6
  br label %117

104:                                              ; preds = %96, %98, %102, %100, %93
  %105 = add nuw i64 %.03875, 1
  %106 = load i64, ptr %54, align 8, !tbaa !17
  %.not58 = icmp ult i64 %105, %106
  br i1 %.not58, label %58, label %._crit_edge.loopexit, !llvm.loop !22

._crit_edge.loopexit:                             ; preds = %104
  %.pre77 = load i8, ptr %38, align 4, !tbaa !14, !range !15
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %._crit_edge76
  %107 = phi i64 [ %106, %._crit_edge.loopexit ], [ 0, %._crit_edge76 ]
  %108 = phi i8 [ %.pre77, %._crit_edge.loopexit ], [ %39, %._crit_edge76 ]
  %109 = trunc nuw i8 %108 to i1
  br i1 %109, label %110, label %111

110:                                              ; preds = %._crit_edge
  call void @analyze_numbers(ptr noundef %.039, i64 noundef %107, ptr noundef nonnull %3)
  call void @free(ptr noundef %.039) #6
  br label %111

111:                                              ; preds = %110, %._crit_edge
  %112 = load ptr, ptr @stdout, align 8, !tbaa !5
  %.not59 = icmp eq ptr %.040, %112
  br i1 %.not59, label %115, label %113

113:                                              ; preds = %111
  %114 = call i32 @fclose(ptr noundef %.040)
  br label %115

115:                                              ; preds = %113, %111
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  call void @qrng_free(ptr noundef %116) #6
  br label %117

117:                                              ; preds = %.thread69, %32, %115, %52, %14, %.critedge, %23
  %.5 = phi i32 [ 1, %23 ], [ 1, %.critedge ], [ 1, %14 ], [ 1, %32 ], [ 0, %115 ], [ 1, %52 ], [ 1, %.thread69 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br label %118

118:                                              ; preds = %117, %7
  %.6 = phi i32 [ %9, %7 ], [ %.5, %117 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #6
  ret i32 %.6
}

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

; Function Attrs: nounwind uwtable
declare hidden i32 @parse_options(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #2

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

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #2

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

declare void @qrng_free(ptr noundef) local_unnamed_addr #3

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

declare i32 @qrng_range32(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

declare i64 @qrng_range64(ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
declare hidden void @print_binary(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare hidden void @analyze_numbers(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

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 = { 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 #3 = { "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 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 #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 }
attributes #7 = { cold 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, !6, i64 40}
!10 = !{!"", !11, i64 0, !7, i64 8, !12, i64 24, !13, i64 32, !11, i64 36, !6, i64 40}
!11 = !{!"_Bool", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!10, !11, i64 36}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!10, !12, i64 24}
!18 = !{!10, !11, i64 0}
!19 = !{!7, !7, i64 0}
!20 = !{!12, !12, i64 0}
!21 = !{!10, !13, i64 32}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}


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