; LLVM IR from guanzhi/GmSSL :: tools (rand)

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

@stdout = external global ptr, align 8
@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [14 x i8], align 1
@options = external hidden global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @rand_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 i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca [2048 x i8], align 16
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca i32, 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 4, ptr %6) #7
  store i32 1, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %18 = load ptr, ptr %5, align 8, !tbaa !9
  %19 = getelementptr inbounds ptr, ptr %18, i64 0
  %20 = load ptr, ptr %19, align 8, !tbaa !9
  store ptr %20, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  store ptr null, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %21 = load ptr, ptr @stdout, align 8, !tbaa !9
  store ptr %21, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 2048, ptr %14) #7
  %22 = load i32, ptr %4, align 4, !tbaa !5
  %23 = add nsw i32 %22, -1
  store i32 %23, ptr %4, align 4, !tbaa !5
  %24 = load ptr, ptr %5, align 8, !tbaa !9
  %25 = getelementptr inbounds ptr, ptr %24, i32 1
  store ptr %25, ptr %5, align 8, !tbaa !9
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = icmp slt i32 %26, 1
  br i1 %27, label %28, label %33

28:                                               ; preds = %2
  %29 = load ptr, ptr @stderr, align 8, !tbaa !9
  %30 = load ptr, ptr %7, align 8, !tbaa !9
  %31 = load ptr, ptr @options, align 8, !tbaa !9
  %32 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %29, ptr noundef @.str, ptr noundef %30, ptr noundef %31) #7
  store i32 1, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %245

33:                                               ; preds = %2
  br label %34

34:                                               ; preds = %132, %33
  %35 = load i32, ptr %4, align 4, !tbaa !5
  %36 = icmp sgt i32 %35, 0
  br i1 %36, label %37, label %137

37:                                               ; preds = %34
  %38 = load ptr, ptr %5, align 8, !tbaa !9
  %39 = load ptr, ptr %38, align 8, !tbaa !9
  %40 = call i32 @strcmp(ptr noundef %39, ptr noundef @.str.1) #8
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %46, label %42

42:                                               ; preds = %37
  %43 = load ptr, ptr %7, align 8, !tbaa !9
  %44 = load ptr, ptr @options, align 8, !tbaa !9
  %45 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef %43, ptr noundef %44)
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %233

46:                                               ; preds = %37
  %47 = load ptr, ptr %5, align 8, !tbaa !9
  %48 = load ptr, ptr %47, align 8, !tbaa !9
  %49 = call i32 @strcmp(ptr noundef %48, ptr noundef @.str.2) #8
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %52, label %51

51:                                               ; preds = %46
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %131

52:                                               ; preds = %46
  %53 = load ptr, ptr %5, align 8, !tbaa !9
  %54 = load ptr, ptr %53, align 8, !tbaa !9
  %55 = call i32 @strcmp(ptr noundef %54, ptr noundef @.str.3) #8
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %58, label %57

57:                                               ; preds = %52
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %130

58:                                               ; preds = %52
  %59 = load ptr, ptr %5, align 8, !tbaa !9
  %60 = load ptr, ptr %59, align 8, !tbaa !9
  %61 = call i32 @strcmp(ptr noundef %60, ptr noundef @.str.4) #8
  %62 = icmp ne i32 %61, 0
  br i1 %62, label %64, label %63

63:                                               ; preds = %58
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %129

64:                                               ; preds = %58
  %65 = load ptr, ptr %5, align 8, !tbaa !9
  %66 = load ptr, ptr %65, align 8, !tbaa !9
  %67 = call i32 @strcmp(ptr noundef %66, ptr noundef @.str.5) #8
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %89, label %69

69:                                               ; preds = %64
  %70 = load i32, ptr %4, align 4, !tbaa !5
  %71 = add nsw i32 %70, -1
  store i32 %71, ptr %4, align 4, !tbaa !5
  %72 = icmp slt i32 %71, 1
  br i1 %72, label %73, label %74

73:                                               ; preds = %69
  br label %121

74:                                               ; preds = %69
  %75 = load ptr, ptr %5, align 8, !tbaa !9
  %76 = getelementptr inbounds ptr, ptr %75, i32 1
  store ptr %76, ptr %5, align 8, !tbaa !9
  %77 = load ptr, ptr %76, align 8, !tbaa !9
  %78 = call i32 @atoi(ptr noundef %77) #8
  store i32 %78, ptr %11, align 4, !tbaa !5
  %79 = load i32, ptr %11, align 4, !tbaa !5
  %80 = icmp slt i32 %79, 1
  br i1 %80, label %84, label %81

81:                                               ; preds = %74
  %82 = load i32, ptr %11, align 4, !tbaa !5
  %83 = icmp sgt i32 %82, 2147483647
  br i1 %83, label %84, label %88

84:                                               ; preds = %81, %74
  %85 = load ptr, ptr @stderr, align 8, !tbaa !9
  %86 = load ptr, ptr %7, align 8, !tbaa !9
  %87 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %85, ptr noundef @.str.6, ptr noundef %86) #7
  br label %233

88:                                               ; preds = %81
  br label %128

89:                                               ; preds = %64
  %90 = load ptr, ptr %5, align 8, !tbaa !9
  %91 = load ptr, ptr %90, align 8, !tbaa !9
  %92 = call i32 @strcmp(ptr noundef %91, ptr noundef @.str.7) #8
  %93 = icmp ne i32 %92, 0
  br i1 %93, label %115, label %94

94:                                               ; preds = %89
  %95 = load i32, ptr %4, align 4, !tbaa !5
  %96 = add nsw i32 %95, -1
  store i32 %96, ptr %4, align 4, !tbaa !5
  %97 = icmp slt i32 %96, 1
  br i1 %97, label %98, label %99

98:                                               ; preds = %94
  br label %121

99:                                               ; preds = %94
  %100 = load ptr, ptr %5, align 8, !tbaa !9
  %101 = getelementptr inbounds ptr, ptr %100, i32 1
  store ptr %101, ptr %5, align 8, !tbaa !9
  %102 = load ptr, ptr %101, align 8, !tbaa !9
  store ptr %102, ptr %12, align 8, !tbaa !9
  %103 = load ptr, ptr %12, align 8, !tbaa !9
  %104 = call noalias ptr @fopen(ptr noundef %103, ptr noundef @.str.8)
  store ptr %104, ptr %13, align 8, !tbaa !9
  %105 = icmp ne ptr %104, null
  br i1 %105, label %114, label %106

106:                                              ; preds = %99
  %107 = load ptr, ptr @stderr, align 8, !tbaa !9
  %108 = load ptr, ptr %7, align 8, !tbaa !9
  %109 = load ptr, ptr %12, align 8, !tbaa !9
  %110 = call ptr @__errno_location() #9
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = call ptr @strerror(i32 noundef %111) #7
  %113 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %107, ptr noundef @.str.9, ptr noundef %108, ptr noundef %109, ptr noundef %112) #7
  br label %233

114:                                              ; preds = %99
  br label %127

115:                                              ; preds = %89
  %116 = load ptr, ptr @stderr, align 8, !tbaa !9
  %117 = load ptr, ptr %7, align 8, !tbaa !9
  %118 = load ptr, ptr %5, align 8, !tbaa !9
  %119 = load ptr, ptr %118, align 8, !tbaa !9
  %120 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %116, ptr noundef @.str.10, ptr noundef %117, ptr noundef %119) #7
  br label %233

121:                                              ; preds = %98, %73
  %122 = load ptr, ptr @stderr, align 8, !tbaa !9
  %123 = load ptr, ptr %7, align 8, !tbaa !9
  %124 = load ptr, ptr %5, align 8, !tbaa !9
  %125 = load ptr, ptr %124, align 8, !tbaa !9
  %126 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %122, ptr noundef @.str.11, ptr noundef %123, ptr noundef %125) #7
  br label %233

127:                                              ; preds = %114
  br label %128

128:                                              ; preds = %127, %88
  br label %129

129:                                              ; preds = %128, %63
  br label %130

130:                                              ; preds = %129, %57
  br label %131

131:                                              ; preds = %130, %51
  br label %132

132:                                              ; preds = %131
  %133 = load i32, ptr %4, align 4, !tbaa !5
  %134 = add nsw i32 %133, -1
  store i32 %134, ptr %4, align 4, !tbaa !5
  %135 = load ptr, ptr %5, align 8, !tbaa !9
  %136 = getelementptr inbounds ptr, ptr %135, i32 1
  store ptr %136, ptr %5, align 8, !tbaa !9
  br label %34, !llvm.loop !11

137:                                              ; preds = %34
  %138 = load i32, ptr %11, align 4, !tbaa !5
  %139 = icmp ne i32 %138, 0
  br i1 %139, label %144, label %140

140:                                              ; preds = %137
  %141 = load ptr, ptr @stderr, align 8, !tbaa !9
  %142 = load ptr, ptr %7, align 8, !tbaa !9
  %143 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %141, ptr noundef @.str.12, ptr noundef %142) #7
  br label %233

144:                                              ; preds = %137
  br label %145

145:                                              ; preds = %225, %144
  %146 = load i32, ptr %11, align 4, !tbaa !5
  %147 = icmp sgt i32 %146, 0
  br i1 %147, label %148, label %226

148:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %149 = load i32, ptr %11, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = icmp ult i64 %150, 2048
  br i1 %151, label %152, label %155

152:                                              ; preds = %148
  %153 = load i32, ptr %11, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  br label %156

155:                                              ; preds = %148
  br label %156

156:                                              ; preds = %155, %152
  %157 = phi i64 [ %154, %152 ], [ 2048, %155 ]
  store i64 %157, ptr %16, align 8, !tbaa !13
  %158 = load i32, ptr %9, align 4, !tbaa !5
  %159 = icmp ne i32 %158, 0
  br i1 %159, label %160, label %164

160:                                              ; preds = %156
  %161 = load ptr, ptr @stderr, align 8, !tbaa !9
  %162 = load ptr, ptr %7, align 8, !tbaa !9
  %163 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %161, ptr noundef @.str.13, ptr noundef %162) #7
  br label %182

164:                                              ; preds = %156
  %165 = load i32, ptr %10, align 4, !tbaa !5
  %166 = icmp ne i32 %165, 0
  br i1 %166, label %167, label %171

167:                                              ; preds = %164
  %168 = load ptr, ptr @stderr, align 8, !tbaa !9
  %169 = load ptr, ptr %7, align 8, !tbaa !9
  %170 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %168, ptr noundef @.str.14, ptr noundef %169) #7
  br label %181

171:                                              ; preds = %164
  %172 = getelementptr inbounds [2048 x i8], ptr %14, i64 0, i64 0
  %173 = load i64, ptr %16, align 8, !tbaa !13
  %174 = call i32 @rand_bytes(ptr noundef %172, i64 noundef %173)
  %175 = icmp ne i32 %174, 1
  br i1 %175, label %176, label %180

176:                                              ; preds = %171
  %177 = load ptr, ptr @stderr, align 8, !tbaa !9
  %178 = load ptr, ptr %7, align 8, !tbaa !9
  %179 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %177, ptr noundef @.str.15, ptr noundef %178) #7
  store i32 4, ptr %15, align 4
  br label %223

180:                                              ; preds = %171
  br label %181

181:                                              ; preds = %180, %167
  br label %182

182:                                              ; preds = %181, %160
  %183 = load i32, ptr %8, align 4, !tbaa !5
  %184 = icmp ne i32 %183, 0
  br i1 %184, label %185, label %203

185:                                              ; preds = %182
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %186

186:                                              ; preds = %199, %185
  %187 = load i32, ptr %17, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = load i64, ptr %16, align 8, !tbaa !13
  %190 = icmp ult i64 %188, %189
  br i1 %190, label %191, label %202

191:                                              ; preds = %186
  %192 = load ptr, ptr %13, align 8, !tbaa !9
  %193 = load i32, ptr %17, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [2048 x i8], ptr %14, i64 0, i64 %194
  %196 = load i8, ptr %195, align 1, !tbaa !15
  %197 = zext i8 %196 to i32
  %198 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %192, ptr noundef @.str.16, i32 noundef %197) #7
  br label %199

199:                                              ; preds = %191
  %200 = load i32, ptr %17, align 4, !tbaa !5
  %201 = add nsw i32 %200, 1
  store i32 %201, ptr %17, align 4, !tbaa !5
  br label %186, !llvm.loop !16

202:                                              ; preds = %186
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %218

203:                                              ; preds = %182
  %204 = getelementptr inbounds [2048 x i8], ptr %14, i64 0, i64 0
  %205 = load i64, ptr %16, align 8, !tbaa !13
  %206 = load ptr, ptr %13, align 8, !tbaa !9
  %207 = call i64 @fwrite(ptr noundef %204, i64 noundef 1, i64 noundef %205, ptr noundef %206)
  %208 = load i64, ptr %16, align 8, !tbaa !13
  %209 = icmp ne i64 %207, %208
  br i1 %209, label %210, label %217

210:                                              ; preds = %203
  %211 = load ptr, ptr @stderr, align 8, !tbaa !9
  %212 = load ptr, ptr %7, align 8, !tbaa !9
  %213 = call ptr @__errno_location() #9
  %214 = load i32, ptr %213, align 4, !tbaa !5
  %215 = call ptr @strerror(i32 noundef %214) #7
  %216 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %211, ptr noundef @.str.17, ptr noundef %212, ptr noundef %215) #7
  store i32 4, ptr %15, align 4
  br label %223

217:                                              ; preds = %203
  br label %218

218:                                              ; preds = %217, %202
  %219 = load i64, ptr %16, align 8, !tbaa !13
  %220 = trunc i64 %219 to i32
  %221 = load i32, ptr %11, align 4, !tbaa !5
  %222 = sub nsw i32 %221, %220
  store i32 %222, ptr %11, align 4, !tbaa !5
  store i32 0, ptr %15, align 4
  br label %223

223:                                              ; preds = %218, %210, %176
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  %224 = load i32, ptr %15, align 4
  switch i32 %224, label %245 [
    i32 0, label %225
    i32 4, label %233
  ]

225:                                              ; preds = %223
  br label %145, !llvm.loop !17

226:                                              ; preds = %145
  %227 = load i32, ptr %8, align 4, !tbaa !5
  %228 = icmp ne i32 %227, 0
  br i1 %228, label %229, label %232

229:                                              ; preds = %226
  %230 = load ptr, ptr %13, align 8, !tbaa !9
  %231 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %230, ptr noundef @.str.18) #7
  br label %232

232:                                              ; preds = %229, %226
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %233

233:                                              ; preds = %232, %223, %140, %121, %115, %106, %84, %42
  %234 = getelementptr inbounds [2048 x i8], ptr %14, i64 0, i64 0
  call void @gmssl_secure_clear(ptr noundef %234, i64 noundef 2048)
  %235 = load ptr, ptr %12, align 8, !tbaa !9
  %236 = icmp ne ptr %235, null
  br i1 %236, label %237, label %243

237:                                              ; preds = %233
  %238 = load ptr, ptr %13, align 8, !tbaa !9
  %239 = icmp ne ptr %238, null
  br i1 %239, label %240, label %243

240:                                              ; preds = %237
  %241 = load ptr, ptr %13, align 8, !tbaa !9
  %242 = call i32 @fclose(ptr noundef %241)
  br label %243

243:                                              ; preds = %240, %237, %233
  %244 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %244, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %245

245:                                              ; preds = %243, %223, %28
  call void @llvm.lifetime.end.p0(i64 2048, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  %246 = load i32, ptr %3, align 4
  ret i32 %246
}

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

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #3

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

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #5

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

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) #2

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #6

declare i32 @rand_bytes(ptr noundef, i64 noundef) #4

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

declare i64 @fwrite(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #4

declare void @gmssl_secure_clear(ptr noundef, i64 noundef) #4

declare i32 @fclose(ptr noundef) #4

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 = { 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 = { nounwind willreturn memory(read) "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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint nounwind willreturn memory(read) 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 willreturn memory(none) "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 willreturn memory(read) }
attributes #9 = { nounwind willreturn 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 = !{!"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 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !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"

@stdout = external local_unnamed_addr global ptr, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [14 x i8], align 1
@options = external hidden local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @rand_main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca [2048 x i8], align 16
  %4 = load ptr, ptr %1, align 8, !tbaa !5
  %5 = load ptr, ptr @stdout, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %3) #9
  %6 = icmp slt i32 %0, 2
  br i1 %6, label %7, label %.preheader107

7:                                                ; preds = %2
  %8 = load ptr, ptr @stderr, align 8, !tbaa !5
  %9 = load ptr, ptr @options, align 8, !tbaa !5
  %10 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str, ptr noundef %4, ptr noundef %9) #10
  br label %129

.preheader107:                                    ; preds = %2, %56
  %.064152 = phi ptr [ %.1, %56 ], [ %5, %2 ]
  %.065151 = phi ptr [ %.166, %56 ], [ null, %2 ]
  %.068150 = phi i32 [ %.169, %56 ], [ 0, %2 ]
  %.071149 = phi i32 [ %.172, %56 ], [ 0, %2 ]
  %.073148 = phi i32 [ %.174, %56 ], [ 0, %2 ]
  %.075147 = phi i32 [ %.176, %56 ], [ 0, %2 ]
  %.077.in146 = phi i32 [ %.178, %56 ], [ %0, %2 ]
  %.pn145 = phi ptr [ %.181, %56 ], [ %1, %2 ]
  %.080153 = getelementptr inbounds i8, ptr %.pn145, i64 8
  %.077154 = add nsw i32 %.077.in146, -1
  %11 = load ptr, ptr %.080153, align 8, !tbaa !5
  %12 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %11, ptr noundef nonnull dereferenceable(1) @.str.1) #11
  %.not95 = icmp eq i32 %12, 0
  br i1 %.not95, label %13, label %16

13:                                               ; preds = %.preheader107
  %14 = load ptr, ptr @options, align 8, !tbaa !5
  %15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef %4, ptr noundef %14)
  br label %.thread

16:                                               ; preds = %.preheader107
  %17 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %11, ptr noundef nonnull dereferenceable(1) @.str.2) #11
  %.not96 = icmp eq i32 %17, 0
  br i1 %.not96, label %56, label %18

18:                                               ; preds = %16
  %19 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %11, ptr noundef nonnull dereferenceable(1) @.str.3) #11
  %.not97 = icmp eq i32 %19, 0
  br i1 %.not97, label %56, label %20

20:                                               ; preds = %18
  %21 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %11, ptr noundef nonnull dereferenceable(1) @.str.4) #11
  %.not98 = icmp eq i32 %21, 0
  br i1 %.not98, label %56, label %22

22:                                               ; preds = %20
  %23 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %11, ptr noundef nonnull dereferenceable(1) @.str.5) #11
  %.not99 = icmp eq i32 %23, 0
  br i1 %.not99, label %24, label %35

24:                                               ; preds = %22
  %25 = icmp eq i32 %.077.in146, 2
  br i1 %25, label %53, label %26

26:                                               ; preds = %24
  %27 = add nsw i32 %.077.in146, -2
  %28 = getelementptr inbounds i8, ptr %.pn145, i64 16
  %29 = load ptr, ptr %28, align 8, !tbaa !5
  %30 = tail call i32 @atoi(ptr nocapture noundef %29) #11
  %31 = icmp slt i32 %30, 1
  br i1 %31, label %32, label %56

32:                                               ; preds = %26
  %33 = load ptr, ptr @stderr, align 8, !tbaa !5
  %34 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %33, ptr noundef nonnull @.str.6, ptr noundef %4) #10
  br label %.thread

35:                                               ; preds = %22
  %36 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %11, ptr noundef nonnull dereferenceable(1) @.str.7) #11
  %.not100 = icmp eq i32 %36, 0
  br i1 %.not100, label %37, label %50

37:                                               ; preds = %35
  %38 = icmp eq i32 %.077.in146, 2
  br i1 %38, label %53, label %39

39:                                               ; preds = %37
  %40 = add nsw i32 %.077.in146, -2
  %41 = getelementptr inbounds i8, ptr %.pn145, i64 16
  %42 = load ptr, ptr %41, align 8, !tbaa !5
  %43 = tail call noalias ptr @fopen(ptr noundef %42, ptr noundef nonnull @.str.8)
  %.not101 = icmp eq ptr %43, null
  br i1 %.not101, label %44, label %56

44:                                               ; preds = %39
  %45 = load ptr, ptr @stderr, align 8, !tbaa !5
  %46 = tail call ptr @__errno_location() #12
  %47 = load i32, ptr %46, align 4, !tbaa !9
  %48 = tail call ptr @strerror(i32 noundef %47) #9
  %49 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef nonnull @.str.9, ptr noundef %4, ptr noundef %42, ptr noundef %48) #10
  br label %.thread

50:                                               ; preds = %35
  %51 = load ptr, ptr @stderr, align 8, !tbaa !5
  %52 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %51, ptr noundef nonnull @.str.10, ptr noundef %4, ptr noundef %11) #10
  br label %.thread

53:                                               ; preds = %37, %24
  %54 = load ptr, ptr @stderr, align 8, !tbaa !5
  %55 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %54, ptr noundef nonnull @.str.11, ptr noundef %4, ptr noundef %11) #10
  br label %.thread

56:                                               ; preds = %20, %18, %16, %39, %26
  %.181 = phi ptr [ %41, %39 ], [ %28, %26 ], [ %.080153, %16 ], [ %.080153, %18 ], [ %.080153, %20 ]
  %.178 = phi i32 [ %40, %39 ], [ %27, %26 ], [ %.077154, %16 ], [ %.077154, %18 ], [ %.077154, %20 ]
  %.176 = phi i32 [ %.075147, %39 ], [ %.075147, %26 ], [ 1, %16 ], [ %.075147, %18 ], [ %.075147, %20 ]
  %.174 = phi i32 [ %.073148, %39 ], [ %.073148, %26 ], [ %.073148, %16 ], [ 1, %18 ], [ %.073148, %20 ]
  %.172 = phi i32 [ %.071149, %39 ], [ %.071149, %26 ], [ %.071149, %16 ], [ %.071149, %18 ], [ 1, %20 ]
  %.169 = phi i32 [ %.068150, %39 ], [ %30, %26 ], [ %.068150, %16 ], [ %.068150, %18 ], [ %.068150, %20 ]
  %.166 = phi ptr [ %42, %39 ], [ %.065151, %26 ], [ %.065151, %16 ], [ %.065151, %18 ], [ %.065151, %20 ]
  %.1 = phi ptr [ %43, %39 ], [ %.064152, %26 ], [ %.064152, %16 ], [ %.064152, %18 ], [ %.064152, %20 ]
  %57 = icmp sgt i32 %.178, 1
  br i1 %57, label %.preheader107, label %58, !llvm.loop !11

58:                                               ; preds = %56
  %.not = icmp eq i32 %.169, 0
  br i1 %.not, label %103, label %.preheader106

.preheader106:                                    ; preds = %58
  %59 = icmp sgt i32 %.169, 0
  br i1 %59, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader106
  %.not90 = icmp eq i32 %.174, 0
  %.not91 = icmp eq i32 %.172, 0
  %.not93 = icmp eq i32 %.176, 0
  br i1 %.not90, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph
  br i1 %.not93, label %.lr.ph.split.us.split.us, label %.lr.ph.split.us.split

.lr.ph.split.us.split.us:                         ; preds = %.lr.ph.split.us
  br i1 %.not91, label %.lr.ph.split.us.split.us.split.us, label %.lr.ph.split.us.split.us.split

.lr.ph.split.us.split.us.split.us:                ; preds = %.lr.ph.split.us.split.us, %65
  %.270156.us.us.us = phi i32 [ %66, %65 ], [ %.169, %.lr.ph.split.us.split.us ]
  %60 = call i32 @llvm.umin.i32(i32 %.270156.us.us.us, i32 2048)
  %61 = zext nneg i32 %60 to i64
  %62 = call i32 @rand_bytes(ptr noundef nonnull %3, i64 noundef %61) #9
  %.not92.us.us.us = icmp eq i32 %62, 1
  br i1 %.not92.us.us.us, label %63, label %.split.us

63:                                               ; preds = %.lr.ph.split.us.split.us.split.us
  %64 = call i64 @fwrite(ptr noundef nonnull %3, i64 noundef 1, i64 noundef %61, ptr noundef %.1)
  %.not94.us.us.us = icmp eq i64 %64, %61
  br i1 %.not94.us.us.us, label %65, label %.split158.us

65:                                               ; preds = %63
  %66 = sub nsw i32 %.270156.us.us.us, %60
  %67 = icmp sgt i32 %66, 0
  br i1 %67, label %.lr.ph.split.us.split.us.split.us, label %._crit_edge

.lr.ph.split.us.split.us.split:                   ; preds = %.lr.ph.split.us.split.us, %73
  %.270156.us.us = phi i32 [ %74, %73 ], [ %.169, %.lr.ph.split.us.split.us ]
  %68 = tail call i32 @llvm.umin.i32(i32 %.270156.us.us, i32 2048)
  %69 = zext nneg i32 %68 to i64
  %70 = load ptr, ptr @stderr, align 8, !tbaa !5
  %71 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %70, ptr noundef nonnull @.str.14, ptr noundef %4) #10
  %72 = call i64 @fwrite(ptr noundef nonnull %3, i64 noundef 1, i64 noundef %69, ptr noundef %.1)
  %.not94.us.us = icmp eq i64 %72, %69
  br i1 %.not94.us.us, label %73, label %.split158.us

73:                                               ; preds = %.lr.ph.split.us.split.us.split
  %74 = sub nsw i32 %.270156.us.us, %68
  %75 = icmp sgt i32 %74, 0
  br i1 %75, label %.lr.ph.split.us.split.us.split, label %._crit_edge

.lr.ph.split.us.split:                            ; preds = %.lr.ph.split.us
  br i1 %.not91, label %.lr.ph.split.us.split.split.us, label %.preheader.us

.lr.ph.split.us.split.split.us:                   ; preds = %.lr.ph.split.us.split, %.loopexit.us.us
  %.270156.us.us162 = phi i32 [ %83, %.loopexit.us.us ], [ %.169, %.lr.ph.split.us.split ]
  %76 = call i32 @llvm.umin.i32(i32 %.270156.us.us162, i32 2048)
  %77 = zext nneg i32 %76 to i64
  %78 = call i32 @rand_bytes(ptr noundef nonnull %3, i64 noundef %77) #9
  %.not92.us.us163 = icmp eq i32 %78, 1
  br i1 %.not92.us.us163, label %.preheader.us.us.preheader, label %.split.us

.preheader.us.us.preheader:                       ; preds = %.lr.ph.split.us.split.split.us
  %wide.trip.count199 = zext nneg i32 %76 to i64
  br label %.preheader.us.us

.preheader.us.us:                                 ; preds = %.preheader.us.us.preheader, %.preheader.us.us
  %indvars.iv195 = phi i64 [ 0, %.preheader.us.us.preheader ], [ %indvars.iv.next196, %.preheader.us.us ]
  %79 = getelementptr inbounds [2048 x i8], ptr %3, i64 0, i64 %indvars.iv195
  %80 = load i8, ptr %79, align 1, !tbaa !13
  %81 = zext i8 %80 to i32
  %82 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %.1, ptr noundef nonnull @.str.16, i32 noundef %81) #9
  %indvars.iv.next196 = add nuw nsw i64 %indvars.iv195, 1
  %exitcond200.not = icmp eq i64 %indvars.iv.next196, %wide.trip.count199
  br i1 %exitcond200.not, label %.loopexit.us.us, label %.preheader.us.us, !llvm.loop !14

.loopexit.us.us:                                  ; preds = %.preheader.us.us
  %83 = sub nsw i32 %.270156.us.us162, %76
  %84 = icmp sgt i32 %83, 0
  br i1 %84, label %.lr.ph.split.us.split.split.us, label %._crit_edge

.preheader.us:                                    ; preds = %.lr.ph.split.us.split, %.loopexit.us
  %.270156.us = phi i32 [ %93, %.loopexit.us ], [ %.169, %.lr.ph.split.us.split ]
  %85 = tail call i32 @llvm.umin.i32(i32 %.270156.us, i32 2048)
  %86 = load ptr, ptr @stderr, align 8, !tbaa !5
  %87 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %86, ptr noundef nonnull @.str.14, ptr noundef %4) #10
  %wide.trip.count193 = zext nneg i32 %85 to i64
  br label %88

88:                                               ; preds = %.preheader.us, %88
  %indvars.iv189 = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next190, %88 ]
  %89 = getelementptr inbounds [2048 x i8], ptr %3, i64 0, i64 %indvars.iv189
  %90 = load i8, ptr %89, align 1, !tbaa !13
  %91 = zext i8 %90 to i32
  %92 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %.1, ptr noundef nonnull @.str.16, i32 noundef %91) #9
  %indvars.iv.next190 = add nuw nsw i64 %indvars.iv189, 1
  %exitcond194.not = icmp eq i64 %indvars.iv.next190, %wide.trip.count193
  br i1 %exitcond194.not, label %.loopexit.us, label %88, !llvm.loop !14

.loopexit.us:                                     ; preds = %88
  %93 = sub nsw i32 %.270156.us, %85
  %94 = icmp sgt i32 %93, 0
  br i1 %94, label %.preheader.us, label %._crit_edge

.lr.ph.split:                                     ; preds = %.lr.ph
  br i1 %.not93, label %.lr.ph.split.split.us, label %.preheader

.lr.ph.split.split.us:                            ; preds = %.lr.ph.split, %100
  %.270156.us159 = phi i32 [ %101, %100 ], [ %.169, %.lr.ph.split ]
  %95 = tail call i32 @llvm.umin.i32(i32 %.270156.us159, i32 2048)
  %96 = zext nneg i32 %95 to i64
  %97 = load ptr, ptr @stderr, align 8, !tbaa !5
  %98 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %97, ptr noundef nonnull @.str.13, ptr noundef %4) #10
  %99 = call i64 @fwrite(ptr noundef nonnull %3, i64 noundef 1, i64 noundef %96, ptr noundef %.1)
  %.not94.us160 = icmp eq i64 %99, %96
  br i1 %.not94.us160, label %100, label %.split158.us

100:                                              ; preds = %.lr.ph.split.split.us
  %101 = sub nsw i32 %.270156.us159, %95
  %102 = icmp sgt i32 %101, 0
  br i1 %102, label %.lr.ph.split.split.us, label %._crit_edge

103:                                              ; preds = %58
  %104 = load ptr, ptr @stderr, align 8, !tbaa !5
  %105 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %104, ptr noundef nonnull @.str.12, ptr noundef %4) #10
  br label %.thread

.preheader:                                       ; preds = %.lr.ph.split, %.loopexit
  %.270156 = phi i32 [ %121, %.loopexit ], [ %.169, %.lr.ph.split ]
  %106 = tail call i32 @llvm.umin.i32(i32 %.270156, i32 2048)
  %107 = load ptr, ptr @stderr, align 8, !tbaa !5
  %108 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %107, ptr noundef nonnull @.str.13, ptr noundef %4) #10
  %wide.trip.count = zext nneg i32 %106 to i64
  br label %111

.split.us:                                        ; preds = %.lr.ph.split.us.split.split.us, %.lr.ph.split.us.split.us.split.us
  %109 = load ptr, ptr @stderr, align 8, !tbaa !5
  %110 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %109, ptr noundef nonnull @.str.15, ptr noundef %4) #10
  br label %.thread

111:                                              ; preds = %.preheader, %111
  %indvars.iv = phi i64 [ 0, %.preheader ], [ %indvars.iv.next, %111 ]
  %112 = getelementptr inbounds [2048 x i8], ptr %3, i64 0, i64 %indvars.iv
  %113 = load i8, ptr %112, align 1, !tbaa !13
  %114 = zext i8 %113 to i32
  %115 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %.1, ptr noundef nonnull @.str.16, i32 noundef %114) #9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit, label %111, !llvm.loop !14

.split158.us:                                     ; preds = %.lr.ph.split.split.us, %.lr.ph.split.us.split.us.split, %63
  %116 = load ptr, ptr @stderr, align 8, !tbaa !5
  %117 = tail call ptr @__errno_location() #12
  %118 = load i32, ptr %117, align 4, !tbaa !9
  %119 = call ptr @strerror(i32 noundef %118) #9
  %120 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %116, ptr noundef nonnull @.str.17, ptr noundef %4, ptr noundef %119) #10
  br label %.thread

.loopexit:                                        ; preds = %111
  %121 = sub nsw i32 %.270156, %106
  %122 = icmp sgt i32 %121, 0
  br i1 %122, label %.preheader, label %._crit_edge

._crit_edge:                                      ; preds = %.loopexit, %100, %.loopexit.us, %.loopexit.us.us, %73, %65, %.preheader106
  %.not89 = icmp eq i32 %.176, 0
  br i1 %.not89, label %.thread, label %123

123:                                              ; preds = %._crit_edge
  %124 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %.1, ptr noundef nonnull @.str.18) #9
  br label %.thread

.thread:                                          ; preds = %.split.us, %.split158.us, %._crit_edge, %123, %103, %53, %50, %44, %32, %13
  %.079 = phi i32 [ 1, %50 ], [ 1, %53 ], [ 1, %44 ], [ 1, %32 ], [ 0, %13 ], [ 1, %103 ], [ 0, %123 ], [ 0, %._crit_edge ], [ 1, %.split158.us ], [ 1, %.split.us ]
  %.267 = phi ptr [ %.065151, %50 ], [ %.065151, %53 ], [ %42, %44 ], [ %.065151, %32 ], [ %.065151, %13 ], [ %.166, %103 ], [ %.166, %123 ], [ %.166, %._crit_edge ], [ %.166, %.split158.us ], [ %.166, %.split.us ]
  %.2 = phi ptr [ %.064152, %50 ], [ %.064152, %53 ], [ null, %44 ], [ %.064152, %32 ], [ %.064152, %13 ], [ %.1, %103 ], [ %.1, %123 ], [ %.1, %._crit_edge ], [ %.1, %.split158.us ], [ %.1, %.split.us ]
  call void @gmssl_secure_clear(ptr noundef nonnull %3, i64 noundef 2048) #9
  %125 = icmp ne ptr %.267, null
  %126 = icmp ne ptr %.2, null
  %or.cond3 = select i1 %125, i1 %126, i1 false
  br i1 %or.cond3, label %127, label %129

127:                                              ; preds = %.thread
  %128 = call i32 @fclose(ptr noundef nonnull %.2)
  br label %129

129:                                              ; preds = %.thread, %127, %7
  %.062 = phi i32 [ 1, %7 ], [ %.079, %127 ], [ %.079, %.thread ]
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %3) #9
  ret i32 %.062
}

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #4

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

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #6

declare i32 @rand_bytes(ptr noundef, i64 noundef) local_unnamed_addr #7

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

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

declare void @gmssl_secure_clear(ptr noundef, i64 noundef) local_unnamed_addr #7

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #8

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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 nofree nounwind willreturn memory(read) 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 = { 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 #6 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 }
attributes #10 = { cold nounwind }
attributes #11 = { nounwind willreturn memory(read) }
attributes #12 = { nounwind willreturn 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 = !{!"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"}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !12}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass