; LLVM IR from DiTo97/gol :: src/cpu (gol)

; 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.option = type { ptr, i32, ptr, i32 }
%struct.life = type { i32, i32, i32, double, i32, ptr, ptr, ptr, ptr }

@stdout = external global ptr, align 8
@.str.39 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [37 x i8], align 1
@short_opts = external hidden global ptr, align 8
@long_opts = external hidden constant [9 x %struct.option], align 16
@optarg = external global ptr, align 8
@.str.42 = external hidden unnamed_addr constant [40 x i8], align 1

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

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

declare i32 @fflush(ptr noundef) #1

declare i32 @usleep(i32 noundef) #1

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

declare void @perror(ptr noundef) #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @show_usage() #3

; Function Attrs: nounwind uwtable
declare dso_local void @load_defaults(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @parse_seed(ptr noundef) #3

; Function Attrs: nounwind
declare i64 @strtol(ptr noundef, ptr noundef, i32 noundef) #4

; Function Attrs: nounwind uwtable
define dso_local void @parse_args(ptr noundef %0, i32 noundef %1, ptr noundef %2) #3 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca i8, align 1
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !9
  store i32 1, ptr %9, align 4, !tbaa !9
  br label %15

15:                                               ; preds = %40, %3
  %16 = load i32, ptr %9, align 4, !tbaa !9
  %17 = load i32, ptr %5, align 4, !tbaa !9
  %18 = icmp slt i32 %16, %17
  br i1 %18, label %19, label %43

19:                                               ; preds = %15
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = load i32, ptr %9, align 4, !tbaa !9
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds ptr, ptr %20, i64 %22
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  %25 = call ptr @strstr(ptr noundef %24, ptr noundef @.str.39) #7
  %26 = icmp ne ptr %25, null
  br i1 %26, label %27, label %28

27:                                               ; preds = %19
  call void @show_usage()
  br label %28

28:                                               ; preds = %27, %19
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = load i32, ptr %9, align 4, !tbaa !9
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds ptr, ptr %29, i64 %31
  %33 = load ptr, ptr %32, align 8, !tbaa !5
  %34 = call ptr @strchr(ptr noundef %33, i32 noundef 45) #7
  %35 = icmp ne ptr %34, null
  br i1 %35, label %36, label %39

36:                                               ; preds = %28
  %37 = load i32, ptr %10, align 4, !tbaa !9
  %38 = add i32 %37, 1
  store i32 %38, ptr %10, align 4, !tbaa !9
  br label %39

39:                                               ; preds = %36, %28
  br label %40

40:                                               ; preds = %39
  %41 = load i32, ptr %9, align 4, !tbaa !9
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %9, align 4, !tbaa !9
  br label %15, !llvm.loop !11

43:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %44 = load i32, ptr %5, align 4, !tbaa !9
  %45 = sub nsw i32 %44, 1
  store i32 %45, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %46 = load i32, ptr %11, align 4, !tbaa !9
  %47 = load i32, ptr %10, align 4, !tbaa !9
  %48 = sub i32 %46, %47
  store i32 %48, ptr %12, align 4, !tbaa !9
  %49 = load i32, ptr %12, align 4, !tbaa !9
  %50 = load i32, ptr %10, align 4, !tbaa !9
  %51 = icmp ne i32 %49, %50
  br i1 %51, label %52, label %57

52:                                               ; preds = %43
  %53 = load i32, ptr %12, align 4, !tbaa !9
  %54 = load i32, ptr %11, align 4, !tbaa !9
  %55 = icmp ne i32 %53, %54
  br i1 %55, label %56, label %57

56:                                               ; preds = %52
  call void @perror(ptr noundef @.str.40)
  call void @exit(i32 noundef 1) #8
  unreachable

57:                                               ; preds = %52, %43
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  call void @load_defaults(ptr noundef %58)
  %59 = load i32, ptr %10, align 4, !tbaa !9
  %60 = icmp ugt i32 %59, 0
  br i1 %60, label %61, label %116

61:                                               ; preds = %57
  %62 = call i32 (ptr, ...) @printf(ptr noundef @.str.41)
  %63 = load ptr, ptr @stdout, align 8, !tbaa !5
  %64 = call i32 @fflush(ptr noundef %63)
  %65 = call i32 @usleep(i32 noundef 100000)
  br label %66

66:                                               ; preds = %114, %61
  %67 = load i32, ptr %5, align 4, !tbaa !9
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = load ptr, ptr @short_opts, align 8, !tbaa !5
  %70 = call i32 @getopt_long(i32 noundef %67, ptr noundef %68, ptr noundef %69, ptr noundef @long_opts, ptr noundef %8) #6
  store i32 %70, ptr %7, align 4, !tbaa !9
  %71 = load i32, ptr %7, align 4, !tbaa !9
  %72 = icmp eq i32 %71, -1
  br i1 %72, label %73, label %74

73:                                               ; preds = %66
  br label %115

74:                                               ; preds = %66
  %75 = load i32, ptr %7, align 4, !tbaa !9
  switch i32 %75, label %113 [
    i32 99, label %76
    i32 114, label %82
    i32 116, label %88
    i32 115, label %94
    i32 105, label %99
    i32 111, label %103
    i32 112, label %107
    i32 63, label %112
  ]

76:                                               ; preds = %74
  %77 = load ptr, ptr @optarg, align 8, !tbaa !5
  %78 = call i64 @strtol(ptr noundef %77, ptr noundef null, i32 noundef 10) #6
  %79 = trunc i64 %78 to i32
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.life, ptr %80, i32 0, i32 0
  store i32 %79, ptr %81, align 8, !tbaa !13
  br label %114

82:                                               ; preds = %74
  %83 = load ptr, ptr @optarg, align 8, !tbaa !5
  %84 = call i64 @strtol(ptr noundef %83, ptr noundef null, i32 noundef 10) #6
  %85 = trunc i64 %84 to i32
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.life, ptr %86, i32 0, i32 1
  store i32 %85, ptr %87, align 4, !tbaa !16
  br label %114

88:                                               ; preds = %74
  %89 = load ptr, ptr @optarg, align 8, !tbaa !5
  %90 = call i64 @strtol(ptr noundef %89, ptr noundef null, i32 noundef 10) #6
  %91 = trunc i64 %90 to i32
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.life, ptr %92, i32 0, i32 2
  store i32 %91, ptr %93, align 8, !tbaa !17
  br label %114

94:                                               ; preds = %74
  %95 = load ptr, ptr @optarg, align 8, !tbaa !5
  %96 = call i32 @parse_seed(ptr noundef %95)
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.life, ptr %97, i32 0, i32 4
  store i32 %96, ptr %98, align 8, !tbaa !18
  br label %114

99:                                               ; preds = %74
  %100 = load ptr, ptr @optarg, align 8, !tbaa !5
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.life, ptr %101, i32 0, i32 7
  store ptr %100, ptr %102, align 8, !tbaa !19
  br label %114

103:                                              ; preds = %74
  %104 = load ptr, ptr @optarg, align 8, !tbaa !5
  %105 = load ptr, ptr %4, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.life, ptr %105, i32 0, i32 8
  store ptr %104, ptr %106, align 8, !tbaa !20
  br label %114

107:                                              ; preds = %74
  %108 = load ptr, ptr @optarg, align 8, !tbaa !5
  %109 = call double @strtod(ptr noundef %108, ptr noundef null) #6
  %110 = load ptr, ptr %4, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.life, ptr %110, i32 0, i32 3
  store double %109, ptr %111, align 8, !tbaa !21
  br label %114

112:                                              ; preds = %74
  br label %113

113:                                              ; preds = %112, %74
  call void @show_usage()
  br label %114

114:                                              ; preds = %113, %107, %103, %99, %94, %88, %82, %76
  br label %66

115:                                              ; preds = %73
  br label %246

116:                                              ; preds = %57
  %117 = call i32 (ptr, ...) @printf(ptr noundef @.str.42)
  %118 = load ptr, ptr @stdout, align 8, !tbaa !5
  %119 = call i32 @fflush(ptr noundef %118)
  %120 = call i32 @usleep(i32 noundef 100000)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #6
  %121 = load i32, ptr %11, align 4, !tbaa !9
  %122 = icmp sgt i32 %121, 1
  br i1 %122, label %123, label %245

123:                                              ; preds = %116
  %124 = load ptr, ptr %6, align 8, !tbaa !5
  %125 = getelementptr inbounds ptr, ptr %124, i64 1
  %126 = load ptr, ptr %125, align 8, !tbaa !5
  %127 = call i64 @strtol(ptr noundef %126, ptr noundef null, i32 noundef 10) #6
  store i64 %127, ptr %13, align 8, !tbaa !22
  %128 = load i64, ptr %13, align 8, !tbaa !22
  %129 = icmp ne i64 %128, 0
  %130 = zext i1 %129 to i64
  %131 = select i1 %129, i32 1, i32 0
  %132 = icmp ne i32 %131, 0
  %133 = zext i1 %132 to i8
  store i8 %133, ptr %14, align 1, !tbaa !24
  %134 = load i32, ptr %5, align 4, !tbaa !9
  %135 = icmp sgt i32 %134, 1
  br i1 %135, label %136, label %151

136:                                              ; preds = %123
  %137 = load i8, ptr %14, align 1, !tbaa !24, !range !26, !noundef !27
  %138 = trunc i8 %137 to i1
  br i1 %138, label %139, label %144

139:                                              ; preds = %136
  %140 = load i64, ptr %13, align 8, !tbaa !22
  %141 = trunc i64 %140 to i32
  %142 = load ptr, ptr %4, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.life, ptr %142, i32 0, i32 0
  store i32 %141, ptr %143, align 8, !tbaa !13
  br label %150

144:                                              ; preds = %136
  %145 = load ptr, ptr %6, align 8, !tbaa !5
  %146 = getelementptr inbounds ptr, ptr %145, i64 1
  %147 = load ptr, ptr %146, align 8, !tbaa !5
  %148 = load ptr, ptr %4, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.life, ptr %148, i32 0, i32 7
  store ptr %147, ptr %149, align 8, !tbaa !19
  br label %150

150:                                              ; preds = %144, %139
  br label %151

151:                                              ; preds = %150, %123
  %152 = load i32, ptr %5, align 4, !tbaa !9
  %153 = icmp sgt i32 %152, 2
  br i1 %153, label %154, label %174

154:                                              ; preds = %151
  %155 = load i8, ptr %14, align 1, !tbaa !24, !range !26, !noundef !27
  %156 = trunc i8 %155 to i1
  br i1 %156, label %157, label %165

157:                                              ; preds = %154
  %158 = load ptr, ptr %6, align 8, !tbaa !5
  %159 = getelementptr inbounds ptr, ptr %158, i64 2
  %160 = load ptr, ptr %159, align 8, !tbaa !5
  %161 = call i64 @strtol(ptr noundef %160, ptr noundef null, i32 noundef 10) #6
  %162 = trunc i64 %161 to i32
  %163 = load ptr, ptr %4, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.life, ptr %163, i32 0, i32 1
  store i32 %162, ptr %164, align 4, !tbaa !16
  br label %173

165:                                              ; preds = %154
  %166 = load ptr, ptr %6, align 8, !tbaa !5
  %167 = getelementptr inbounds ptr, ptr %166, i64 2
  %168 = load ptr, ptr %167, align 8, !tbaa !5
  %169 = call i64 @strtol(ptr noundef %168, ptr noundef null, i32 noundef 10) #6
  %170 = trunc i64 %169 to i32
  %171 = load ptr, ptr %4, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.life, ptr %171, i32 0, i32 2
  store i32 %170, ptr %172, align 8, !tbaa !17
  br label %173

173:                                              ; preds = %165, %157
  br label %174

174:                                              ; preds = %173, %151
  %175 = load i32, ptr %5, align 4, !tbaa !9
  %176 = icmp sgt i32 %175, 3
  br i1 %176, label %177, label %195

177:                                              ; preds = %174
  %178 = load i8, ptr %14, align 1, !tbaa !24, !range !26, !noundef !27
  %179 = trunc i8 %178 to i1
  br i1 %179, label %180, label %188

180:                                              ; preds = %177
  %181 = load ptr, ptr %6, align 8, !tbaa !5
  %182 = getelementptr inbounds ptr, ptr %181, i64 3
  %183 = load ptr, ptr %182, align 8, !tbaa !5
  %184 = call i64 @strtol(ptr noundef %183, ptr noundef null, i32 noundef 10) #6
  %185 = trunc i64 %184 to i32
  %186 = load ptr, ptr %4, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.life, ptr %186, i32 0, i32 2
  store i32 %185, ptr %187, align 8, !tbaa !17
  br label %194

188:                                              ; preds = %177
  %189 = load ptr, ptr %6, align 8, !tbaa !5
  %190 = getelementptr inbounds ptr, ptr %189, i64 3
  %191 = load ptr, ptr %190, align 8, !tbaa !5
  %192 = load ptr, ptr %4, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.life, ptr %192, i32 0, i32 8
  store ptr %191, ptr %193, align 8, !tbaa !20
  br label %194

194:                                              ; preds = %188, %180
  br label %195

195:                                              ; preds = %194, %174
  %196 = load i32, ptr %5, align 4, !tbaa !9
  %197 = icmp sgt i32 %196, 4
  br i1 %197, label %198, label %208

198:                                              ; preds = %195
  %199 = load i8, ptr %14, align 1, !tbaa !24, !range !26, !noundef !27
  %200 = trunc i8 %199 to i1
  br i1 %200, label %201, label %207

201:                                              ; preds = %198
  %202 = load ptr, ptr %6, align 8, !tbaa !5
  %203 = getelementptr inbounds ptr, ptr %202, i64 4
  %204 = load ptr, ptr %203, align 8, !tbaa !5
  %205 = load ptr, ptr %4, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.life, ptr %205, i32 0, i32 8
  store ptr %204, ptr %206, align 8, !tbaa !20
  br label %207

207:                                              ; preds = %201, %198
  br label %208

208:                                              ; preds = %207, %195
  %209 = load i32, ptr %5, align 4, !tbaa !9
  %210 = icmp sgt i32 %209, 5
  br i1 %210, label %211, label %222

211:                                              ; preds = %208
  %212 = load i8, ptr %14, align 1, !tbaa !24, !range !26, !noundef !27
  %213 = trunc i8 %212 to i1
  br i1 %213, label %214, label %221

214:                                              ; preds = %211
  %215 = load ptr, ptr %6, align 8, !tbaa !5
  %216 = getelementptr inbounds ptr, ptr %215, i64 5
  %217 = load ptr, ptr %216, align 8, !tbaa !5
  %218 = call i32 @parse_seed(ptr noundef %217)
  %219 = load ptr, ptr %4, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.life, ptr %219, i32 0, i32 4
  store i32 %218, ptr %220, align 8, !tbaa !18
  br label %221

221:                                              ; preds = %214, %211
  br label %222

222:                                              ; preds = %221, %208
  %223 = load i32, ptr %5, align 4, !tbaa !9
  %224 = icmp sgt i32 %223, 6
  br i1 %224, label %225, label %236

225:                                              ; preds = %222
  %226 = load i8, ptr %14, align 1, !tbaa !24, !range !26, !noundef !27
  %227 = trunc i8 %226 to i1
  br i1 %227, label %228, label %235

228:                                              ; preds = %225
  %229 = load ptr, ptr %6, align 8, !tbaa !5
  %230 = getelementptr inbounds ptr, ptr %229, i64 6
  %231 = load ptr, ptr %230, align 8, !tbaa !5
  %232 = call double @strtod(ptr noundef %231, ptr noundef null) #6
  %233 = load ptr, ptr %4, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct.life, ptr %233, i32 0, i32 3
  store double %232, ptr %234, align 8, !tbaa !21
  br label %235

235:                                              ; preds = %228, %225
  br label %236

236:                                              ; preds = %235, %222
  %237 = load i32, ptr %5, align 4, !tbaa !9
  %238 = icmp sgt i32 %237, 7
  br i1 %238, label %239, label %240

239:                                              ; preds = %236
  br label %240

240:                                              ; preds = %239, %236
  %241 = load i32, ptr %5, align 4, !tbaa !9
  %242 = icmp sgt i32 %241, 8
  br i1 %242, label %243, label %244

243:                                              ; preds = %240
  br label %244

244:                                              ; preds = %243, %240
  br label %245

245:                                              ; preds = %244, %116
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %246

246:                                              ; preds = %245, %115
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  ret void
}

; Function Attrs: nounwind willreturn memory(read)
declare ptr @strstr(ptr noundef, ptr noundef) #5

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

; Function Attrs: nounwind
declare i32 @getopt_long(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #4

; Function Attrs: nounwind
declare double @strtod(ptr noundef, ptr noundef) #4

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

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

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


; 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.option = type { ptr, i32, ptr, i32 }

@stdout = external local_unnamed_addr global ptr, align 8
@.str.39 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [37 x i8], align 1
@short_opts = external hidden local_unnamed_addr global ptr, align 8
@long_opts = external hidden constant [9 x %struct.option], align 16
@optarg = external local_unnamed_addr global ptr, align 8
@.str.42 = external hidden unnamed_addr constant [40 x i8], align 1

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

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

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

declare i32 @usleep(i32 noundef) local_unnamed_addr #2

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

; Function Attrs: nofree nounwind
declare void @perror(ptr nocapture noundef readonly) local_unnamed_addr #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local void @show_usage() local_unnamed_addr #4

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @parse_seed(ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nofree nounwind willreturn
declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
define dso_local void @parse_args(ptr noundef %0, i32 noundef %1, ptr noundef %2) local_unnamed_addr #4 {
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  store i32 0, ptr %4, align 4, !tbaa !5
  %5 = icmp sgt i32 %1, 1
  br i1 %5, label %.lr.ph.preheader, label %.thread

.thread:                                          ; preds = %3
  tail call void @load_defaults(ptr noundef %0)
  br label %55

.lr.ph.preheader:                                 ; preds = %3
  %wide.trip.count = zext nneg i32 %1 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %10
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %10 ]
  %.06288 = phi i32 [ 0, %.lr.ph.preheader ], [ %spec.select, %10 ]
  %6 = getelementptr inbounds ptr, ptr %2, i64 %indvars.iv
  %7 = load ptr, ptr %6, align 8, !tbaa !9
  %8 = tail call ptr @strstr(ptr noundef nonnull dereferenceable(1) %7, ptr noundef nonnull dereferenceable(1) @.str.39) #9
  %.not71 = icmp eq ptr %8, null
  br i1 %.not71, label %10, label %9

9:                                                ; preds = %.lr.ph
  tail call void @show_usage()
  %.pre = load ptr, ptr %6, align 8, !tbaa !9
  br label %10

10:                                               ; preds = %9, %.lr.ph
  %11 = phi ptr [ %.pre, %9 ], [ %7, %.lr.ph ]
  %12 = tail call ptr @strchr(ptr noundef nonnull dereferenceable(1) %11, i32 noundef 45) #9
  %.not72 = icmp ne ptr %12, null
  %13 = zext i1 %.not72 to i32
  %spec.select = add i32 %.06288, %13
  %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 %._crit_edge, label %.lr.ph, !llvm.loop !11

._crit_edge:                                      ; preds = %10
  %14 = xor i32 %spec.select, -1
  %15 = add i32 %14, %1
  %.not = icmp eq i32 %15, %spec.select
  %.not67 = icmp eq i32 %spec.select, 0
  %or.cond = or i1 %.not67, %.not
  br i1 %or.cond, label %17, label %16

16:                                               ; preds = %._crit_edge
  tail call void @perror(ptr noundef nonnull @.str.40) #10
  tail call void @exit(i32 noundef 1) #11
  unreachable

17:                                               ; preds = %._crit_edge
  tail call void @load_defaults(ptr noundef %0)
  br i1 %.not67, label %55, label %18

18:                                               ; preds = %17
  %19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.41)
  %20 = load ptr, ptr @stdout, align 8, !tbaa !9
  %21 = tail call i32 @fflush(ptr noundef %20)
  %22 = tail call i32 @usleep(i32 noundef 100000) #8
  %23 = getelementptr inbounds i8, ptr %0, i64 16
  %24 = getelementptr inbounds i8, ptr %0, i64 56
  %25 = getelementptr inbounds i8, ptr %0, i64 48
  %26 = getelementptr inbounds i8, ptr %0, i64 24
  %27 = getelementptr inbounds i8, ptr %0, i64 8
  %28 = getelementptr inbounds i8, ptr %0, i64 4
  br label %29

29:                                               ; preds = %.backedge, %18
  %30 = load ptr, ptr @short_opts, align 8, !tbaa !9
  %31 = call i32 @getopt_long(i32 noundef %1, ptr noundef %2, ptr noundef %30, ptr noundef nonnull @long_opts, ptr noundef nonnull %4) #8
  switch i32 %31, label %54 [
    i32 -1, label %.thread81.thread.thread
    i32 99, label %32
    i32 114, label %36
    i32 116, label %40
    i32 115, label %44
    i32 105, label %47
    i32 111, label %49
    i32 112, label %51
  ]

32:                                               ; preds = %29
  %33 = load ptr, ptr @optarg, align 8, !tbaa !9
  %34 = call i64 @strtol(ptr nocapture noundef %33, ptr noundef null, i32 noundef 10) #8
  %35 = trunc i64 %34 to i32
  store i32 %35, ptr %0, align 8, !tbaa !13
  br label %.backedge

36:                                               ; preds = %29
  %37 = load ptr, ptr @optarg, align 8, !tbaa !9
  %38 = call i64 @strtol(ptr nocapture noundef %37, ptr noundef null, i32 noundef 10) #8
  %39 = trunc i64 %38 to i32
  store i32 %39, ptr %28, align 4, !tbaa !16
  br label %.backedge

40:                                               ; preds = %29
  %41 = load ptr, ptr @optarg, align 8, !tbaa !9
  %42 = call i64 @strtol(ptr nocapture noundef %41, ptr noundef null, i32 noundef 10) #8
  %43 = trunc i64 %42 to i32
  store i32 %43, ptr %27, align 8, !tbaa !17
  br label %.backedge

44:                                               ; preds = %29
  %45 = load ptr, ptr @optarg, align 8, !tbaa !9
  %46 = call i32 @parse_seed(ptr noundef %45)
  store i32 %46, ptr %26, align 8, !tbaa !18
  br label %.backedge

47:                                               ; preds = %29
  %48 = load ptr, ptr @optarg, align 8, !tbaa !9
  store ptr %48, ptr %25, align 8, !tbaa !19
  br label %.backedge

49:                                               ; preds = %29
  %50 = load ptr, ptr @optarg, align 8, !tbaa !9
  store ptr %50, ptr %24, align 8, !tbaa !20
  br label %.backedge

51:                                               ; preds = %29
  %52 = load ptr, ptr @optarg, align 8, !tbaa !9
  %53 = call double @strtod(ptr nocapture noundef %52, ptr noundef null) #8
  store double %53, ptr %23, align 8, !tbaa !21
  br label %.backedge

54:                                               ; preds = %29
  call void @show_usage()
  br label %.backedge

.backedge:                                        ; preds = %54, %51, %49, %47, %44, %40, %36, %32
  br label %29

55:                                               ; preds = %.thread, %17
  %56 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.42)
  %57 = load ptr, ptr @stdout, align 8, !tbaa !9
  %58 = tail call i32 @fflush(ptr noundef %57)
  %59 = tail call i32 @usleep(i32 noundef 100000) #8
  %60 = icmp sgt i32 %1, 2
  br i1 %60, label %61, label %.thread81.thread.thread

61:                                               ; preds = %55
  %62 = getelementptr inbounds i8, ptr %2, i64 8
  %63 = load ptr, ptr %62, align 8, !tbaa !9
  %64 = tail call i64 @strtol(ptr nocapture noundef %63, ptr noundef null, i32 noundef 10) #8
  %.not69 = icmp eq i64 %64, 0
  br i1 %.not69, label %65, label %.thread78

65:                                               ; preds = %61
  %66 = load ptr, ptr %62, align 8, !tbaa !9
  %67 = getelementptr inbounds i8, ptr %0, i64 48
  store ptr %66, ptr %67, align 8, !tbaa !19
  %68 = getelementptr inbounds i8, ptr %2, i64 16
  %69 = load ptr, ptr %68, align 8, !tbaa !9
  %70 = tail call i64 @strtol(ptr nocapture noundef %69, ptr noundef null, i32 noundef 10) #8
  %71 = trunc i64 %70 to i32
  %72 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 %71, ptr %72, align 8, !tbaa !17
  %.not70 = icmp eq i32 %1, 3
  br i1 %.not70, label %.thread81.thread.thread, label %79

.thread78:                                        ; preds = %61
  %73 = trunc i64 %64 to i32
  store i32 %73, ptr %0, align 8, !tbaa !13
  %74 = getelementptr inbounds i8, ptr %2, i64 16
  %75 = load ptr, ptr %74, align 8, !tbaa !9
  %76 = tail call i64 @strtol(ptr nocapture noundef %75, ptr noundef null, i32 noundef 10) #8
  %77 = trunc i64 %76 to i32
  %78 = getelementptr inbounds i8, ptr %0, i64 4
  store i32 %77, ptr %78, align 4, !tbaa !16
  %.not7079 = icmp eq i32 %1, 3
  br i1 %.not7079, label %.thread81.thread.thread, label %.thread80

79:                                               ; preds = %65
  %80 = getelementptr inbounds i8, ptr %2, i64 24
  %81 = load ptr, ptr %80, align 8, !tbaa !9
  %82 = getelementptr inbounds i8, ptr %0, i64 56
  store ptr %81, ptr %82, align 8, !tbaa !20
  br label %.thread81.thread.thread

.thread80:                                        ; preds = %.thread78
  %83 = getelementptr inbounds i8, ptr %2, i64 24
  %84 = load ptr, ptr %83, align 8, !tbaa !9
  %85 = tail call i64 @strtol(ptr nocapture noundef %84, ptr noundef null, i32 noundef 10) #8
  %86 = trunc i64 %85 to i32
  %87 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 %86, ptr %87, align 8, !tbaa !17
  %88 = icmp ult i32 %1, 5
  br i1 %88, label %.thread81.thread.thread, label %.thread81

.thread81:                                        ; preds = %.thread80
  %89 = getelementptr inbounds i8, ptr %2, i64 32
  %90 = load ptr, ptr %89, align 8, !tbaa !9
  %91 = getelementptr inbounds i8, ptr %0, i64 56
  store ptr %90, ptr %91, align 8, !tbaa !20
  %92 = icmp eq i32 %1, 5
  br i1 %92, label %.thread81.thread.thread, label %.thread81.thread

.thread81.thread:                                 ; preds = %.thread81
  %93 = getelementptr inbounds i8, ptr %2, i64 40
  %94 = load ptr, ptr %93, align 8, !tbaa !9
  %95 = tail call i32 @parse_seed(ptr noundef %94)
  %96 = getelementptr inbounds i8, ptr %0, i64 24
  store i32 %95, ptr %96, align 8, !tbaa !18
  %97 = icmp ult i32 %1, 7
  br i1 %97, label %.thread81.thread.thread, label %98

98:                                               ; preds = %.thread81.thread
  %99 = getelementptr inbounds i8, ptr %2, i64 48
  %100 = load ptr, ptr %99, align 8, !tbaa !9
  %101 = tail call double @strtod(ptr nocapture noundef %100, ptr noundef null) #8
  %102 = getelementptr inbounds i8, ptr %0, i64 16
  store double %101, ptr %102, align 8, !tbaa !21
  br label %.thread81.thread.thread

.thread81.thread.thread:                          ; preds = %29, %.thread80, %.thread81, %79, %65, %.thread78, %55, %.thread81.thread, %98
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  ret void
}

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

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

; Function Attrs: nounwind
declare i32 @getopt_long(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #7

; Function Attrs: mustprogress nofree nounwind willreturn
declare double @strtod(ptr noundef readonly, ptr nocapture noundef) local_unnamed_addr #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { noreturn 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 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 = { mustprogress nofree nounwind willreturn "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 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 #7 = { 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 #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(read) }
attributes #10 = { cold }
attributes #11 = { noreturn nounwind }

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

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


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