; LLVM IR from NongMindHouse/MasterNongMind :: mm-ga-pretty (main)

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

@CODE_LENGTH = external dso_local global i32, align 4
@COLORS = external dso_local global i32, align 4
@MAX_GUESS = external dso_local global i32, align 4
@POPULATION_LENGTH = external dso_local global i32, align 4
@MAX_GEN = external dso_local global i32, align 4
@MUTATION_RATE = external dso_local global float, align 4
@FANCY_MODE = external dso_local global i32, align 4
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @PrintCode(ptr noundef) #0

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

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

; 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 dso_local i32 @CheckDuplicate(ptr noundef, ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @EvaluateGuess(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3

; Function Attrs: nounwind
declare i32 @rand() #4

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

; Function Attrs: nounwind uwtable
declare dso_local void @PrintGuessData(ptr noundef) #0

; 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 i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  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 4, ptr %6) #6
  %25 = load i32, ptr %4, align 4, !tbaa !5
  %26 = icmp eq i32 %25, 9
  br i1 %26, label %27, label %63

27:                                               ; preds = %2
  %28 = load ptr, ptr %5, align 8, !tbaa !9
  %29 = getelementptr inbounds ptr, ptr %28, i64 1
  %30 = load ptr, ptr %29, align 8, !tbaa !9
  %31 = call i32 @atoi(ptr noundef %30) #7
  store i32 %31, ptr %6, align 4, !tbaa !5
  %32 = load ptr, ptr %5, align 8, !tbaa !9
  %33 = getelementptr inbounds ptr, ptr %32, i64 2
  %34 = load ptr, ptr %33, align 8, !tbaa !9
  %35 = call i32 @atoi(ptr noundef %34) #7
  store i32 %35, ptr @CODE_LENGTH, align 4, !tbaa !5
  %36 = load ptr, ptr %5, align 8, !tbaa !9
  %37 = getelementptr inbounds ptr, ptr %36, i64 3
  %38 = load ptr, ptr %37, align 8, !tbaa !9
  %39 = call i32 @atoi(ptr noundef %38) #7
  store i32 %39, ptr @COLORS, align 4, !tbaa !5
  %40 = load ptr, ptr %5, align 8, !tbaa !9
  %41 = getelementptr inbounds ptr, ptr %40, i64 4
  %42 = load ptr, ptr %41, align 8, !tbaa !9
  %43 = call i32 @atoi(ptr noundef %42) #7
  store i32 %43, ptr @MAX_GUESS, align 4, !tbaa !5
  %44 = load ptr, ptr %5, align 8, !tbaa !9
  %45 = getelementptr inbounds ptr, ptr %44, i64 5
  %46 = load ptr, ptr %45, align 8, !tbaa !9
  %47 = call i32 @atoi(ptr noundef %46) #7
  store i32 %47, ptr @POPULATION_LENGTH, align 4, !tbaa !5
  %48 = load ptr, ptr %5, align 8, !tbaa !9
  %49 = getelementptr inbounds ptr, ptr %48, i64 6
  %50 = load ptr, ptr %49, align 8, !tbaa !9
  %51 = call i32 @atoi(ptr noundef %50) #7
  store i32 %51, ptr @MAX_GEN, align 4, !tbaa !5
  %52 = load ptr, ptr %5, align 8, !tbaa !9
  %53 = getelementptr inbounds ptr, ptr %52, i64 7
  %54 = load ptr, ptr %53, align 8, !tbaa !9
  %55 = call double @atof(ptr noundef %54) #7
  %56 = fptrunc double %55 to float
  store float %56, ptr @MUTATION_RATE, align 4, !tbaa !11
  %57 = load ptr, ptr %5, align 8, !tbaa !9
  %58 = getelementptr inbounds ptr, ptr %57, i64 8
  %59 = load ptr, ptr %58, align 8, !tbaa !9
  %60 = call double @atof(ptr noundef %59) #7
  %61 = fptosi double %60 to i32
  store i32 %61, ptr @FANCY_MODE, align 4, !tbaa !5
  %62 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  br label %63

63:                                               ; preds = %27, %2
  %64 = load i32, ptr %6, align 4, !tbaa !5
  %65 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, i32 noundef %64)
  %66 = load i32, ptr @CODE_LENGTH, align 4, !tbaa !5
  %67 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %66)
  %68 = load i32, ptr @COLORS, align 4, !tbaa !5
  %69 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, i32 noundef %68)
  %70 = load i32, ptr @POPULATION_LENGTH, align 4, !tbaa !5
  %71 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, i32 noundef %70)
  %72 = load i32, ptr @MAX_GEN, align 4, !tbaa !5
  %73 = call i32 (ptr, ...) @printf(ptr noundef @.str.11, i32 noundef %72)
  %74 = load float, ptr @MUTATION_RATE, align 4, !tbaa !11
  %75 = fpext float %74 to double
  %76 = call i32 (ptr, ...) @printf(ptr noundef @.str.12, double noundef %75)
  %77 = load i32, ptr @CODE_LENGTH, align 4, !tbaa !5
  %78 = zext i32 %77 to i64
  %79 = call ptr @llvm.stacksave.p0()
  store ptr %79, ptr %7, align 8
  %80 = alloca i32, i64 %78, align 16
  store i64 %78, ptr %8, align 8
  %81 = load i32, ptr @MAX_GUESS, align 4, !tbaa !5
  %82 = zext i32 %81 to i64
  %83 = load i32, ptr @CODE_LENGTH, align 4, !tbaa !5
  %84 = add nsw i32 %83, 2
  %85 = zext i32 %84 to i64
  %86 = mul nuw i64 %82, %85
  %87 = alloca i32, i64 %86, align 16
  store i64 %82, ptr %9, align 8
  store i64 %85, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %112, %63
  %89 = load i32, ptr %13, align 4, !tbaa !5
  %90 = load i32, ptr @MAX_GUESS, align 4, !tbaa !5
  %91 = icmp slt i32 %89, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %88
  store i32 2, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %115

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

94:                                               ; preds = %108, %93
  %95 = load i32, ptr %15, align 4, !tbaa !5
  %96 = load i32, ptr @CODE_LENGTH, align 4, !tbaa !5
  %97 = add nsw i32 %96, 2
  %98 = icmp slt i32 %95, %97
  br i1 %98, label %100, label %99

99:                                               ; preds = %94
  store i32 5, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %111

100:                                              ; preds = %94
  %101 = load i32, ptr %13, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = mul nsw i64 %102, %85
  %104 = getelementptr inbounds i32, ptr %87, i64 %103
  %105 = load i32, ptr %15, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds i32, ptr %104, i64 %106
  store i32 0, ptr %107, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %100
  %109 = load i32, ptr %15, align 4, !tbaa !5
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %15, align 4, !tbaa !5
  br label %94, !llvm.loop !13

111:                                              ; preds = %99
  br label %112

112:                                              ; preds = %111
  %113 = load i32, ptr %13, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %13, align 4, !tbaa !5
  br label %88, !llvm.loop !15

115:                                              ; preds = %92
  %116 = load i32, ptr %6, align 4, !tbaa !5
  call void @srand(i32 noundef %116) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %117

117:                                              ; preds = %129, %115
  %118 = load i32, ptr %16, align 4, !tbaa !5
  %119 = load i32, ptr @CODE_LENGTH, align 4, !tbaa !5
  %120 = icmp slt i32 %118, %119
  br i1 %120, label %122, label %121

121:                                              ; preds = %117
  store i32 8, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %132

122:                                              ; preds = %117
  %123 = call i32 @rand() #6
  %124 = load i32, ptr @COLORS, align 4, !tbaa !5
  %125 = srem i32 %123, %124
  %126 = load i32, ptr %16, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds i32, ptr %80, i64 %127
  store i32 %125, ptr %128, align 4, !tbaa !5
  br label %129

129:                                              ; preds = %122
  %130 = load i32, ptr %16, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %16, align 4, !tbaa !5
  br label %117, !llvm.loop !16

132:                                              ; preds = %121
  %133 = call i32 (ptr, ...) @printf(ptr noundef @.str.13)
  call void @PrintCode(ptr noundef %80)
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %134

134:                                              ; preds = %148, %132
  %135 = load i32, ptr %17, align 4, !tbaa !5
  %136 = load i32, ptr @CODE_LENGTH, align 4, !tbaa !5
  %137 = icmp slt i32 %135, %136
  br i1 %137, label %139, label %138

138:                                              ; preds = %134
  store i32 11, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %151

139:                                              ; preds = %134
  %140 = call i32 @rand() #6
  %141 = load i32, ptr @COLORS, align 4, !tbaa !5
  %142 = srem i32 %140, %141
  %143 = mul nsw i64 0, %85
  %144 = getelementptr inbounds i32, ptr %87, i64 %143
  %145 = load i32, ptr %17, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds i32, ptr %144, i64 %146
  store i32 %142, ptr %147, align 4, !tbaa !5
  br label %148

148:                                              ; preds = %139
  %149 = load i32, ptr %17, align 4, !tbaa !5
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %17, align 4, !tbaa !5
  br label %134, !llvm.loop !17

151:                                              ; preds = %138
  %152 = mul nsw i64 0, %85
  %153 = getelementptr inbounds i32, ptr %87, i64 %152
  %154 = mul nsw i64 0, %85
  %155 = getelementptr inbounds i32, ptr %87, i64 %154
  %156 = load i32, ptr @CODE_LENGTH, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds i32, ptr %155, i64 %157
  %159 = mul nsw i64 0, %85
  %160 = getelementptr inbounds i32, ptr %87, i64 %159
  %161 = load i32, ptr @CODE_LENGTH, align 4, !tbaa !5
  %162 = add nsw i32 %161, 1
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds i32, ptr %160, i64 %163
  call void @EvaluateGuess(ptr noundef %153, ptr noundef %80, ptr noundef %158, ptr noundef %164)
  %165 = call i32 (ptr, ...) @printf(ptr noundef @.str.14)
  %166 = mul nsw i64 0, %85
  %167 = getelementptr inbounds i32, ptr %87, i64 %166
  call void @PrintGuessData(ptr noundef %167)
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 1, ptr %18, align 4, !tbaa !5
  br label %168

168:                                              ; preds = %283, %151
  %169 = load i32, ptr %11, align 4, !tbaa !5
  %170 = load i32, ptr @CODE_LENGTH, align 4, !tbaa !5
  %171 = icmp ne i32 %169, %170
  br i1 %171, label %172, label %176

172:                                              ; preds = %168
  %173 = load i32, ptr %18, align 4, !tbaa !5
  %174 = load i32, ptr @MAX_GUESS, align 4, !tbaa !5
  %175 = icmp slt i32 %173, %174
  br label %176

176:                                              ; preds = %172, %168
  %177 = phi i1 [ false, %168 ], [ %175, %172 ]
  br i1 %177, label %178, label %284

178:                                              ; preds = %176
  %179 = load i32, ptr @POPULATION_LENGTH, align 4, !tbaa !5
  %180 = mul nsw i32 %179, 2
  %181 = zext i32 %180 to i64
  %182 = load i32, ptr @CODE_LENGTH, align 4, !tbaa !5
  %183 = add nsw i32 %182, 1
  %184 = zext i32 %183 to i64
  %185 = call ptr @llvm.stacksave.p0()
  store ptr %185, ptr %19, align 8
  %186 = mul nuw i64 %181, %184
  %187 = alloca i32, i64 %186, align 16
  store i64 %181, ptr %20, align 8
  store i64 %184, ptr %21, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  %188 = load i32, ptr %18, align 4, !tbaa !5
  %189 = load i32, ptr @POPULATION_LENGTH, align 4, !tbaa !5
  %190 = call i32 @GeneticEvolution(ptr noundef %187, ptr noundef %87, i32 noundef %188, i32 noundef %189)
  store i32 %190, ptr %22, align 4, !tbaa !5
  %191 = load i32, ptr @FANCY_MODE, align 4, !tbaa !5
  %192 = icmp eq i32 %191, 1
  br i1 %192, label %193, label %195

193:                                              ; preds = %178
  %194 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  br label %195

195:                                              ; preds = %193, %178
  %196 = load i32, ptr %22, align 4, !tbaa !5
  %197 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, i32 noundef %196)
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %198

198:                                              ; preds = %206, %195
  %199 = load i32, ptr %23, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = mul nsw i64 %200, %184
  %202 = getelementptr inbounds i32, ptr %187, i64 %201
  %203 = load i32, ptr %18, align 4, !tbaa !5
  %204 = call i32 @CheckDuplicate(ptr noundef %202, ptr noundef %87, i32 noundef %203)
  %205 = icmp ne i32 %204, 0
  br i1 %205, label %206, label %209

206:                                              ; preds = %198
  %207 = load i32, ptr %23, align 4, !tbaa !5
  %208 = add nsw i32 %207, 1
  store i32 %208, ptr %23, align 4, !tbaa !5
  br label %198, !llvm.loop !18

209:                                              ; preds = %198
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  store i32 0, ptr %24, align 4, !tbaa !5
  br label %210

210:                                              ; preds = %231, %209
  %211 = load i32, ptr %24, align 4, !tbaa !5
  %212 = load i32, ptr @CODE_LENGTH, align 4, !tbaa !5
  %213 = icmp slt i32 %211, %212
  br i1 %213, label %215, label %214

214:                                              ; preds = %210
  store i32 18, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  br label %234

215:                                              ; preds = %210
  %216 = load i32, ptr %23, align 4, !tbaa !5
  %217 = sext i32 %216 to i64
  %218 = mul nsw i64 %217, %184
  %219 = getelementptr inbounds i32, ptr %187, i64 %218
  %220 = load i32, ptr %24, align 4, !tbaa !5
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds i32, ptr %219, i64 %221
  %223 = load i32, ptr %222, align 4, !tbaa !5
  %224 = load i32, ptr %18, align 4, !tbaa !5
  %225 = sext i32 %224 to i64
  %226 = mul nsw i64 %225, %85
  %227 = getelementptr inbounds i32, ptr %87, i64 %226
  %228 = load i32, ptr %24, align 4, !tbaa !5
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds i32, ptr %227, i64 %229
  store i32 %223, ptr %230, align 4, !tbaa !5
  br label %231

231:                                              ; preds = %215
  %232 = load i32, ptr %24, align 4, !tbaa !5
  %233 = add nsw i32 %232, 1
  store i32 %233, ptr %24, align 4, !tbaa !5
  br label %210, !llvm.loop !19

234:                                              ; preds = %214
  %235 = load i32, ptr %18, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = mul nsw i64 %236, %85
  %238 = getelementptr inbounds i32, ptr %87, i64 %237
  %239 = load i32, ptr %18, align 4, !tbaa !5
  %240 = sext i32 %239 to i64
  %241 = mul nsw i64 %240, %85
  %242 = getelementptr inbounds i32, ptr %87, i64 %241
  %243 = load i32, ptr @CODE_LENGTH, align 4, !tbaa !5
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds i32, ptr %242, i64 %244
  %246 = load i32, ptr %18, align 4, !tbaa !5
  %247 = sext i32 %246 to i64
  %248 = mul nsw i64 %247, %85
  %249 = getelementptr inbounds i32, ptr %87, i64 %248
  %250 = load i32, ptr @CODE_LENGTH, align 4, !tbaa !5
  %251 = add nsw i32 %250, 1
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds i32, ptr %249, i64 %252
  call void @EvaluateGuess(ptr noundef %238, ptr noundef %80, ptr noundef %245, ptr noundef %253)
  %254 = load i32, ptr %18, align 4, !tbaa !5
  %255 = sext i32 %254 to i64
  %256 = mul nsw i64 %255, %85
  %257 = getelementptr inbounds i32, ptr %87, i64 %256
  call void @PrintGuessData(ptr noundef %257)
  %258 = load i32, ptr %18, align 4, !tbaa !5
  %259 = sext i32 %258 to i64
  %260 = mul nsw i64 %259, %85
  %261 = getelementptr inbounds i32, ptr %87, i64 %260
  %262 = load i32, ptr @CODE_LENGTH, align 4, !tbaa !5
  %263 = sext i32 %262 to i64
  %264 = getelementptr inbounds i32, ptr %261, i64 %263
  %265 = load i32, ptr %264, align 4, !tbaa !5
  %266 = load i32, ptr @CODE_LENGTH, align 4, !tbaa !5
  %267 = icmp eq i32 %265, %266
  br i1 %267, label %268, label %277

268:                                              ; preds = %234
  %269 = call i32 (ptr, ...) @printf(ptr noundef @.str.16)
  %270 = load i32, ptr %18, align 4, !tbaa !5
  %271 = sext i32 %270 to i64
  %272 = mul nsw i64 %271, %85
  %273 = getelementptr inbounds i32, ptr %87, i64 %272
  call void @PrintCode(ptr noundef %273)
  %274 = load i32, ptr %18, align 4, !tbaa !5
  %275 = add nsw i32 %274, 1
  %276 = call i32 (ptr, ...) @printf(ptr noundef @.str.17, i32 noundef %275)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %280

277:                                              ; preds = %234
  %278 = load i32, ptr %18, align 4, !tbaa !5
  %279 = add nsw i32 %278, 1
  store i32 %279, ptr %18, align 4, !tbaa !5
  store i32 0, ptr %14, align 4
  br label %280

280:                                              ; preds = %277, %268
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  %281 = load ptr, ptr %19, align 8
  call void @llvm.stackrestore.p0(ptr %281)
  %282 = load i32, ptr %14, align 4
  switch i32 %282, label %286 [
    i32 0, label %283
  ]

283:                                              ; preds = %280
  br label %168, !llvm.loop !20

284:                                              ; preds = %176
  %285 = call i32 (ptr, ...) @printf(ptr noundef @.str.18)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %286

286:                                              ; preds = %284, %280
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  %287 = load ptr, ptr %7, align 8
  call void @llvm.stackrestore.p0(ptr %287)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %288 = load i32, ptr %3, align 4
  ret i32 %288
}

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

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

; Function Attrs: nounwind
declare void @srand(i32 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn }
attributes #4 = { 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 #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 }
attributes #7 = { nounwind willreturn memory(read) }

!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, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}


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

@CODE_LENGTH = external dso_local local_unnamed_addr global i32, align 4
@COLORS = external dso_local local_unnamed_addr global i32, align 4
@MAX_GUESS = external dso_local local_unnamed_addr global i32, align 4
@POPULATION_LENGTH = external dso_local local_unnamed_addr global i32, align 4
@MAX_GEN = external dso_local local_unnamed_addr global i32, align 4
@MUTATION_RATE = external dso_local local_unnamed_addr global float, align 4
@FANCY_MODE = external dso_local local_unnamed_addr global i32, align 4
@.str.6 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [16 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @EvaluateGuess(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = icmp eq i32 %0, 9
  br i1 %3, label %4, label %32

4:                                                ; preds = %2
  %5 = getelementptr inbounds i8, ptr %1, i64 8
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = tail call i32 @atoi(ptr nocapture noundef %6) #6
  %8 = getelementptr inbounds i8, ptr %1, i64 16
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = tail call i32 @atoi(ptr nocapture noundef %9) #6
  store i32 %10, ptr @CODE_LENGTH, align 4, !tbaa !9
  %11 = getelementptr inbounds i8, ptr %1, i64 24
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = tail call i32 @atoi(ptr nocapture noundef %12) #6
  store i32 %13, ptr @COLORS, align 4, !tbaa !9
  %14 = getelementptr inbounds i8, ptr %1, i64 32
  %15 = load ptr, ptr %14, align 8, !tbaa !5
  %16 = tail call i32 @atoi(ptr nocapture noundef %15) #6
  store i32 %16, ptr @MAX_GUESS, align 4, !tbaa !9
  %17 = getelementptr inbounds i8, ptr %1, i64 40
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  %19 = tail call i32 @atoi(ptr nocapture noundef %18) #6
  store i32 %19, ptr @POPULATION_LENGTH, align 4, !tbaa !9
  %20 = getelementptr inbounds i8, ptr %1, i64 48
  %21 = load ptr, ptr %20, align 8, !tbaa !5
  %22 = tail call i32 @atoi(ptr nocapture noundef %21) #6
  store i32 %22, ptr @MAX_GEN, align 4, !tbaa !9
  %23 = getelementptr inbounds i8, ptr %1, i64 56
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  %25 = tail call double @atof(ptr noundef %24) #6
  %26 = fptrunc double %25 to float
  store float %26, ptr @MUTATION_RATE, align 4, !tbaa !11
  %27 = getelementptr inbounds i8, ptr %1, i64 64
  %28 = load ptr, ptr %27, align 8, !tbaa !5
  %29 = tail call double @atof(ptr noundef %28) #6
  %30 = fptosi double %29 to i32
  store i32 %30, ptr @FANCY_MODE, align 4, !tbaa !9
  %31 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  br label %32

32:                                               ; preds = %4, %2
  %.049 = phi i32 [ %7, %4 ], [ undef, %2 ]
  %33 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %.049)
  %34 = load i32, ptr @CODE_LENGTH, align 4, !tbaa !9
  %35 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %34)
  %36 = load i32, ptr @COLORS, align 4, !tbaa !9
  %37 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef %36)
  %38 = load i32, ptr @POPULATION_LENGTH, align 4, !tbaa !9
  %39 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i32 noundef %38)
  %40 = load i32, ptr @MAX_GEN, align 4, !tbaa !9
  %41 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %40)
  %42 = load float, ptr @MUTATION_RATE, align 4, !tbaa !11
  %43 = fpext float %42 to double
  %44 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, double noundef %43)
  %45 = load i32, ptr @CODE_LENGTH, align 4, !tbaa !9
  %46 = zext i32 %45 to i64
  %47 = alloca i32, i64 %46, align 16
  %48 = load i32, ptr @MAX_GUESS, align 4, !tbaa !9
  %49 = zext i32 %48 to i64
  %50 = add i32 %45, 2
  %51 = zext i32 %50 to i64
  %52 = mul nuw i64 %49, %51
  %53 = alloca i32, i64 %52, align 16
  %54 = icmp sgt i32 %48, 0
  %55 = icmp sgt i32 %45, -2
  %or.cond = select i1 %54, i1 %55, i1 false
  br i1 %or.cond, label %.preheader.us.preheader, label %._crit_edge61

.preheader.us.preheader:                          ; preds = %32
  %56 = shl nuw nsw i64 %51, 2
  %smax = tail call i32 @llvm.smax.i32(i32 %50, i32 1)
  %57 = zext nneg i32 %smax to i64
  %58 = shl nuw nsw i64 %57, 2
  %xtraiter = and i64 %49, 7
  %59 = icmp ult i32 %48, 8
  br i1 %59, label %._crit_edge61.loopexit.unr-lcssa, label %.preheader.us.preheader.new

.preheader.us.preheader.new:                      ; preds = %.preheader.us.preheader
  %unroll_iter = and i64 %49, 2147483640
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us, %.preheader.us.preheader.new
  %indvar = phi i64 [ 0, %.preheader.us.preheader.new ], [ %indvar.next.7, %.preheader.us ]
  %niter = phi i64 [ 0, %.preheader.us.preheader.new ], [ %niter.next.7, %.preheader.us ]
  %60 = mul nuw nsw i64 %56, %indvar
  %scevgep = getelementptr i8, ptr %53, i64 %60
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %scevgep, i8 0, i64 %58, i1 false), !tbaa !9
  %indvar.next = or disjoint i64 %indvar, 1
  %61 = mul nuw nsw i64 %56, %indvar.next
  %scevgep.1 = getelementptr i8, ptr %53, i64 %61
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %scevgep.1, i8 0, i64 %58, i1 false), !tbaa !9
  %indvar.next.1 = or disjoint i64 %indvar, 2
  %62 = mul nuw nsw i64 %56, %indvar.next.1
  %scevgep.2 = getelementptr i8, ptr %53, i64 %62
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %scevgep.2, i8 0, i64 %58, i1 false), !tbaa !9
  %indvar.next.2 = or disjoint i64 %indvar, 3
  %63 = mul nuw nsw i64 %56, %indvar.next.2
  %scevgep.3 = getelementptr i8, ptr %53, i64 %63
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %scevgep.3, i8 0, i64 %58, i1 false), !tbaa !9
  %indvar.next.3 = or disjoint i64 %indvar, 4
  %64 = mul nuw nsw i64 %56, %indvar.next.3
  %scevgep.4 = getelementptr i8, ptr %53, i64 %64
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %scevgep.4, i8 0, i64 %58, i1 false), !tbaa !9
  %indvar.next.4 = or disjoint i64 %indvar, 5
  %65 = mul nuw nsw i64 %56, %indvar.next.4
  %scevgep.5 = getelementptr i8, ptr %53, i64 %65
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %scevgep.5, i8 0, i64 %58, i1 false), !tbaa !9
  %indvar.next.5 = or disjoint i64 %indvar, 6
  %66 = mul nuw nsw i64 %56, %indvar.next.5
  %scevgep.6 = getelementptr i8, ptr %53, i64 %66
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %scevgep.6, i8 0, i64 %58, i1 false), !tbaa !9
  %indvar.next.6 = or disjoint i64 %indvar, 7
  %67 = mul nuw nsw i64 %56, %indvar.next.6
  %scevgep.7 = getelementptr i8, ptr %53, i64 %67
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %scevgep.7, i8 0, i64 %58, i1 false), !tbaa !9
  %indvar.next.7 = add nuw nsw i64 %indvar, 8
  %niter.next.7 = add i64 %niter, 8
  %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
  br i1 %niter.ncmp.7, label %._crit_edge61.loopexit.unr-lcssa, label %.preheader.us, !llvm.loop !13

._crit_edge61.loopexit.unr-lcssa:                 ; preds = %.preheader.us, %.preheader.us.preheader
  %indvar.unr = phi i64 [ 0, %.preheader.us.preheader ], [ %indvar.next.7, %.preheader.us ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge61, label %.preheader.us.epil

.preheader.us.epil:                               ; preds = %._crit_edge61.loopexit.unr-lcssa, %.preheader.us.epil
  %indvar.epil = phi i64 [ %indvar.next.epil, %.preheader.us.epil ], [ %indvar.unr, %._crit_edge61.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.preheader.us.epil ], [ 0, %._crit_edge61.loopexit.unr-lcssa ]
  %68 = mul nuw nsw i64 %56, %indvar.epil
  %scevgep.epil = getelementptr i8, ptr %53, i64 %68
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %scevgep.epil, i8 0, i64 %58, i1 false), !tbaa !9
  %indvar.next.epil = add nuw nsw i64 %indvar.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge61, label %.preheader.us.epil, !llvm.loop !15

._crit_edge61:                                    ; preds = %._crit_edge61.loopexit.unr-lcssa, %.preheader.us.epil, %32
  tail call void @srand(i32 noundef %.049) #7
  %69 = load i32, ptr @CODE_LENGTH, align 4, !tbaa !9
  %70 = icmp sgt i32 %69, 0
  br i1 %70, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %._crit_edge61
  %71 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  call void @PrintCode(ptr noundef nonnull %47)
  %72 = load i32, ptr @CODE_LENGTH, align 4, !tbaa !9
  %73 = icmp sgt i32 %72, 0
  br i1 %73, label %.lr.ph65, label %._crit_edge.._crit_edge66_crit_edge

._crit_edge.._crit_edge66_crit_edge:              ; preds = %._crit_edge
  %.pre = sext i32 %72 to i64
  br label %._crit_edge66

.lr.ph:                                           ; preds = %._crit_edge61, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %._crit_edge61 ]
  %74 = tail call i32 @rand() #7
  %75 = load i32, ptr @COLORS, align 4, !tbaa !9
  %76 = srem i32 %74, %75
  %77 = getelementptr inbounds i32, ptr %47, i64 %indvars.iv
  store i32 %76, ptr %77, align 4, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %78 = load i32, ptr @CODE_LENGTH, align 4, !tbaa !9
  %79 = sext i32 %78 to i64
  %80 = icmp slt i64 %indvars.iv.next, %79
  br i1 %80, label %.lr.ph, label %._crit_edge, !llvm.loop !17

._crit_edge66:                                    ; preds = %.lr.ph65, %._crit_edge.._crit_edge66_crit_edge
  %.pre-phi = phi i64 [ %.pre, %._crit_edge.._crit_edge66_crit_edge ], [ %90, %.lr.ph65 ]
  %81 = getelementptr inbounds i32, ptr %53, i64 %.pre-phi
  %82 = getelementptr i8, ptr %81, i64 4
  call void @EvaluateGuess(ptr noundef nonnull %53, ptr noundef nonnull %47, ptr noundef nonnull %81, ptr noundef %82)
  %83 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14)
  call void @PrintGuessData(ptr noundef nonnull %53)
  %84 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.18)
  ret i32 0

.lr.ph65:                                         ; preds = %._crit_edge, %.lr.ph65
  %indvars.iv72 = phi i64 [ %indvars.iv.next73, %.lr.ph65 ], [ 0, %._crit_edge ]
  %85 = call i32 @rand() #7
  %86 = load i32, ptr @COLORS, align 4, !tbaa !9
  %87 = srem i32 %85, %86
  %88 = getelementptr inbounds i32, ptr %53, i64 %indvars.iv72
  store i32 %87, ptr %88, align 4, !tbaa !9
  %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
  %89 = load i32, ptr @CODE_LENGTH, align 4, !tbaa !9
  %90 = sext i32 %89 to i64
  %91 = icmp slt i64 %indvars.iv.next73, %90
  br i1 %91, label %.lr.ph65, label %._crit_edge66, !llvm.loop !18
}

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

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare double @atof(ptr nocapture noundef nonnull) local_unnamed_addr #3

; Function Attrs: nounwind
declare void @srand(i32 noundef) local_unnamed_addr #2

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.unroll.disable"}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}


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