; LLVM IR from mrbid/CSGO_TENSOR_TRIGGER :: GOBOT15 (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"

%union._XEvent = type { [24 x i64] }
%struct.XWindowAttributes = type { i32, i32, i32, i32, i32, i32, ptr, i64, i32, i32, i32, i32, i64, i64, i32, i64, i32, i32, i64, i64, i64, i32, ptr }
%struct.anon = type { ptr, ptr, i32, i32, i32, i32, ptr, i64, i64, i64, i32, ptr, i32, i32, i32, i32, i32, ptr, i32, i32, ptr, ptr, i32, i64, i64, ptr, ptr, ptr, ptr, i32, ptr, ptr, ptr, i32, i32, ptr, i64, i64, i32, i32, ptr, ptr, i32, ptr }
%struct.Screen = type { ptr, ptr, i64, i32, i32, i32, i32, i32, ptr, i32, ptr, ptr, i64, i64, i64, i32, i32, i32, i32, i64 }
%struct.XButtonEvent = type { i32, i64, i32, ptr, i64, i64, i64, i64, i32, i32, i32, i32, i32, i32, i32 }

@x = external dso_local global i32, align 4
@y = external dso_local global i32, align 4
@twin = external dso_local global i64, align 8
@gc = external dso_local global ptr, align 8
@pgmbytes = external dso_local global [784 x i8], align 16
@sps = external dso_local global i32, align 4
@enable = external dso_local global i32, align 4
@sample_capture = external dso_local global i32, align 4
@crosshair = external dso_local global i32, align 4
@hotkeys = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [20 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [24 x i8], align 1
@d = external dso_local global ptr, align 8
@.str.31 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [24 x i8], align 1
@si = external dso_local global i32, align 4
@.str.33 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [4 x i8], align 1
@main.st = external hidden global i64, align 8
@.str.37 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [5 x i8], align 1
@targets_dir = external dso_local global [256 x i8], align 16
@.str.43 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [7 x i8], align 1
@main.scd = external hidden global i64, align 8
@.str.46 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local float @processModel() #0

; Function Attrs: nounwind
declare i32 @remove(ptr noundef) #1

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

; Function Attrs: nounwind uwtable
declare dso_local void @processScanArea(i64 noundef) #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @microtime() #0

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @key_is_pressed(i64 noundef) #0

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

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #1

declare i32 @sleep(i32 noundef) #4

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

; Function Attrs: nounwind uwtable
declare dso_local void @reprint() #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 %union._XEvent, align 8
  %7 = alloca i32, align 4
  %8 = alloca %struct.XWindowAttributes, align 8
  %9 = alloca ptr, align 8
  %10 = alloca [32 x i8], align 16
  %11 = alloca float, align 4
  %12 = alloca i32, align 4
  %13 = alloca float, align 4
  %14 = alloca [32 x i8], align 16
  %15 = 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
  %16 = call i64 @time(ptr noundef null) #5
  %17 = trunc i64 %16 to i32
  call void @srand(i32 noundef %17) #5
  %18 = call i32 @remove(ptr noundef @.str) #5
  %19 = call i32 @remove(ptr noundef @.str.2) #5
  call void @reprint()
  %20 = call ptr @XOpenDisplay(ptr noundef @.str.31)
  store ptr %20, ptr @d, align 8, !tbaa !9
  %21 = load ptr, ptr @d, align 8, !tbaa !9
  %22 = icmp eq ptr %21, null
  br i1 %22, label %23, label %25

23:                                               ; preds = %2
  %24 = call i32 (ptr, ...) @printf(ptr noundef @.str.32)
  ret i32 0

25:                                               ; preds = %2
  %26 = load ptr, ptr @d, align 8, !tbaa !9
  %27 = call i32 @XDefaultScreen(ptr noundef %26)
  store i32 %27, ptr @si, align 4, !tbaa !5
  %28 = load ptr, ptr @d, align 8, !tbaa !9
  %29 = getelementptr inbounds %struct.anon, ptr %28, i32 0, i32 35
  %30 = load ptr, ptr %29, align 8, !tbaa !11
  %31 = load i32, ptr @si, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds %struct.Screen, ptr %30, i64 %32
  %34 = getelementptr inbounds %struct.Screen, ptr %33, i32 0, i32 11
  %35 = load ptr, ptr %34, align 8, !tbaa !14
  store ptr %35, ptr @gc, align 8, !tbaa !9
  %36 = load ptr, ptr @d, align 8, !tbaa !9
  %37 = call i64 @findWindow(ptr noundef %36, i64 noundef 0, ptr noundef @.str.33)
  store i64 %37, ptr @twin, align 8, !tbaa !16
  %38 = load i64, ptr @twin, align 8, !tbaa !16
  %39 = icmp ne i64 %38, 0
  br i1 %39, label %40, label %41

40:                                               ; preds = %25
  call void @reprint()
  br label %41

41:                                               ; preds = %40, %25
  call void @llvm.lifetime.start.p0(i64 192, ptr %6) #5
  call void @llvm.memset.p0.i64(ptr align 8 %6, i8 0, i64 192, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %346, %58, %41
  br label %43

43:                                               ; preds = %42
  %44 = call i32 @usleep(i32 noundef 1000)
  %45 = call i32 @key_is_pressed(i64 noundef 65507)
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %47, label %81

47:                                               ; preds = %43
  %48 = call i32 @key_is_pressed(i64 noundef 65513)
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %50, label %81

50:                                               ; preds = %47
  %51 = load i32, ptr @enable, align 4, !tbaa !5
  %52 = icmp eq i32 %51, 0
  br i1 %52, label %53, label %78

53:                                               ; preds = %50
  %54 = load ptr, ptr @d, align 8, !tbaa !9
  %55 = call i64 @findWindow(ptr noundef %54, i64 noundef 0, ptr noundef @.str.33)
  store i64 %55, ptr @twin, align 8, !tbaa !16
  %56 = load i64, ptr @twin, align 8, !tbaa !16
  %57 = icmp eq i64 %56, 0
  br i1 %57, label %58, label %61

58:                                               ; preds = %53
  %59 = call i32 (ptr, ...) @printf(ptr noundef @.str.34)
  %60 = call i32 @sleep(i32 noundef 1)
  br label %42

61:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 136, ptr %8) #5
  %62 = load ptr, ptr @d, align 8, !tbaa !9
  %63 = load i64, ptr @twin, align 8, !tbaa !16
  %64 = call i32 @XGetWindowAttributes(ptr noundef %62, i64 noundef %63, ptr noundef %8)
  %65 = getelementptr inbounds %struct.XWindowAttributes, ptr %8, i32 0, i32 2
  %66 = load i32, ptr %65, align 8, !tbaa !17
  %67 = sdiv i32 %66, 2
  store i32 %67, ptr @x, align 4, !tbaa !5
  %68 = getelementptr inbounds %struct.XWindowAttributes, ptr %8, i32 0, i32 3
  %69 = load i32, ptr %68, align 4, !tbaa !19
  %70 = sdiv i32 %69, 2
  store i32 %70, ptr @y, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %6, i8 0, i64 192, i1 false)
  store i32 4, ptr %6, align 8, !tbaa !20
  %71 = getelementptr inbounds %struct.XButtonEvent, ptr %6, i32 0, i32 13
  store i32 1, ptr %71, align 4, !tbaa !20
  %72 = getelementptr inbounds %struct.XButtonEvent, ptr %6, i32 0, i32 14
  store i32 1, ptr %72, align 8, !tbaa !20
  %73 = load i64, ptr @twin, align 8, !tbaa !16
  %74 = getelementptr inbounds %struct.XButtonEvent, ptr %6, i32 0, i32 6
  store i64 %73, ptr %74, align 8, !tbaa !20
  %75 = load i64, ptr @twin, align 8, !tbaa !16
  %76 = getelementptr inbounds %struct.XButtonEvent, ptr %6, i32 0, i32 4
  store i64 %75, ptr %76, align 8, !tbaa !20
  store i32 1, ptr @enable, align 4, !tbaa !5
  %77 = call i32 @usleep(i32 noundef 100000)
  call void @reprint()
  call void @speakS(ptr noundef @.str.35)
  call void @llvm.lifetime.end.p0(i64 136, ptr %8) #5
  br label %80

78:                                               ; preds = %50
  store i32 0, ptr @enable, align 4, !tbaa !5
  %79 = call i32 @usleep(i32 noundef 100000)
  call void @reprint()
  call void @speakS(ptr noundef @.str.36)
  br label %80

80:                                               ; preds = %78, %61
  br label %81

81:                                               ; preds = %80, %47, %43
  %82 = load i32, ptr @enable, align 4, !tbaa !5
  %83 = icmp eq i32 %82, 1
  br i1 %83, label %84, label %346

84:                                               ; preds = %81
  %85 = call i64 @microtime()
  %86 = load i64, ptr @main.st, align 8, !tbaa !16
  %87 = sub i64 %85, %86
  %88 = icmp uge i64 %87, 1000000
  br i1 %88, label %89, label %97

89:                                               ; preds = %84
  %90 = call i32 @key_is_pressed(i64 noundef 72)
  %91 = icmp ne i32 %90, 0
  br i1 %91, label %92, label %95

92:                                               ; preds = %89
  %93 = load i32, ptr @sps, align 4, !tbaa !5
  %94 = call i32 (ptr, ...) @printf(ptr noundef @.str.37, i32 noundef %93)
  br label %95

95:                                               ; preds = %92, %89
  store i32 0, ptr @sps, align 4, !tbaa !5
  %96 = call i64 @microtime()
  store i64 %96, ptr @main.st, align 8, !tbaa !16
  br label %97

97:                                               ; preds = %95, %84
  %98 = call i32 @key_is_pressed(i64 noundef 65508)
  %99 = icmp ne i32 %98, 0
  br i1 %99, label %100, label %111

100:                                              ; preds = %97
  %101 = call i32 @key_is_pressed(i64 noundef 65514)
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %103, label %111

103:                                              ; preds = %100
  %104 = load i32, ptr @hotkeys, align 4, !tbaa !5
  %105 = icmp eq i32 %104, 0
  br i1 %105, label %106, label %108

106:                                              ; preds = %103
  store i32 1, ptr @hotkeys, align 4, !tbaa !5
  %107 = call i32 @usleep(i32 noundef 100000)
  call void @reprint()
  call void @speakS(ptr noundef @.str.38)
  br label %110

108:                                              ; preds = %103
  store i32 0, ptr @hotkeys, align 4, !tbaa !5
  %109 = call i32 @usleep(i32 noundef 100000)
  call void @reprint()
  call void @speakS(ptr noundef @.str.39)
  br label %110

110:                                              ; preds = %108, %106
  br label %111

111:                                              ; preds = %110, %100, %97
  %112 = load i32, ptr @hotkeys, align 4, !tbaa !5
  %113 = icmp eq i32 %112, 1
  br i1 %113, label %114, label %161

114:                                              ; preds = %111
  %115 = call i32 @key_is_pressed(i64 noundef 80)
  %116 = icmp ne i32 %115, 0
  br i1 %116, label %117, label %125

117:                                              ; preds = %114
  %118 = load i32, ptr @crosshair, align 4, !tbaa !5
  %119 = icmp eq i32 %118, 0
  br i1 %119, label %120, label %122

120:                                              ; preds = %117
  store i32 1, ptr @crosshair, align 4, !tbaa !5
  %121 = call i32 @usleep(i32 noundef 100000)
  call void @reprint()
  call void @speakS(ptr noundef @.str.40)
  br label %124

122:                                              ; preds = %117
  store i32 0, ptr @crosshair, align 4, !tbaa !5
  %123 = call i32 @usleep(i32 noundef 100000)
  call void @reprint()
  call void @speakS(ptr noundef @.str.41)
  br label %124

124:                                              ; preds = %122, %120
  br label %125

125:                                              ; preds = %124, %114
  %126 = call i32 @key_is_pressed(i64 noundef 76)
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %128, label %140

128:                                              ; preds = %125
  %129 = load i32, ptr @sample_capture, align 4, !tbaa !5
  %130 = icmp eq i32 %129, 0
  br i1 %130, label %131, label %137

131:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %132 = call ptr @getenv(ptr noundef @.str.42) #5
  store ptr %132, ptr %9, align 8, !tbaa !9
  %133 = load ptr, ptr %9, align 8, !tbaa !9
  %134 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef @targets_dir, ptr noundef @.str.43, ptr noundef %133) #5
  %135 = call i32 @mkdir(ptr noundef @targets_dir, i32 noundef 511) #5
  store i32 1, ptr @sample_capture, align 4, !tbaa !5
  %136 = call i32 @usleep(i32 noundef 100000)
  call void @reprint()
  call void @speakS(ptr noundef @.str.44)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %139

137:                                              ; preds = %128
  store i32 0, ptr @sample_capture, align 4, !tbaa !5
  %138 = call i32 @usleep(i32 noundef 100000)
  call void @reprint()
  call void @speakS(ptr noundef @.str.45)
  br label %139

139:                                              ; preds = %137, %131
  br label %140

140:                                              ; preds = %139, %125
  %141 = load i32, ptr @sample_capture, align 4, !tbaa !5
  %142 = icmp eq i32 %141, 1
  br i1 %142, label %143, label %160

143:                                              ; preds = %140
  %144 = call i32 @key_is_pressed(i64 noundef 69)
  %145 = icmp ne i32 %144, 0
  br i1 %145, label %146, label %160

146:                                              ; preds = %143
  %147 = call i64 @microtime()
  %148 = load i64, ptr @main.scd, align 8, !tbaa !16
  %149 = icmp ugt i64 %147, %148
  br i1 %149, label %150, label %160

150:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #5
  %151 = getelementptr inbounds [32 x i8], ptr %10, i64 0, i64 0
  %152 = call i32 @rand() #5
  %153 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %151, ptr noundef @.str.46, ptr noundef @targets_dir, i32 noundef %152) #5
  %154 = load i64, ptr @twin, align 8, !tbaa !16
  call void @processScanArea(i64 noundef %154)
  %155 = getelementptr inbounds [32 x i8], ptr %10, i64 0, i64 0
  call void @writePGM(ptr noundef %155, ptr noundef @pgmbytes)
  %156 = getelementptr inbounds [32 x i8], ptr %10, i64 0, i64 0
  %157 = call i32 (ptr, ...) @printf(ptr noundef @.str.47, ptr noundef %156)
  %158 = call i64 @microtime()
  %159 = add i64 %158, 350000
  store i64 %159, ptr @main.scd, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #5
  br label %160

160:                                              ; preds = %150, %146, %143, %140
  br label %161

161:                                              ; preds = %160, %111
  %162 = load i32, ptr @hotkeys, align 4, !tbaa !5
  %163 = icmp eq i32 %162, 1
  br i1 %163, label %164, label %250

164:                                              ; preds = %161
  %165 = call i32 @key_is_pressed(i64 noundef 71)
  %166 = icmp ne i32 %165, 0
  br i1 %166, label %167, label %250

167:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %168 = call float @processModel()
  store float %168, ptr %11, align 4, !tbaa !21
  %169 = load float, ptr %11, align 4, !tbaa !21
  %170 = fcmp ogt float %169, 0.000000e+00
  br i1 %170, label %171, label %249

171:                                              ; preds = %167
  %172 = load float, ptr %11, align 4, !tbaa !21
  %173 = fcmp ogt float %172, 0x3FECCCCCC0000000
  br i1 %173, label %174, label %208

174:                                              ; preds = %171
  %175 = load float, ptr %11, align 4, !tbaa !21
  %176 = fpext float %175 to double
  %177 = call i32 (ptr, ...) @printf(ptr noundef @.str.48, double noundef %176)
  %178 = load ptr, ptr @d, align 8, !tbaa !9
  %179 = load ptr, ptr @gc, align 8, !tbaa !9
  %180 = call i32 @XSetForeground(ptr noundef %178, ptr noundef %179, i64 noundef 65280)
  %181 = load ptr, ptr @d, align 8, !tbaa !9
  %182 = getelementptr inbounds %struct.XButtonEvent, ptr %6, i32 0, i32 4
  %183 = load i64, ptr %182, align 8, !tbaa !20
  %184 = load ptr, ptr @gc, align 8, !tbaa !9
  %185 = load i32, ptr @x, align 4, !tbaa !5
  %186 = sub i32 %185, 14
  %187 = sub i32 %186, 1
  %188 = load i32, ptr @y, align 4, !tbaa !5
  %189 = sub i32 %188, 14
  %190 = sub i32 %189, 1
  %191 = call i32 @XDrawRectangle(ptr noundef %181, i64 noundef %183, ptr noundef %184, i32 noundef %187, i32 noundef %190, i32 noundef 30, i32 noundef 30)
  %192 = load ptr, ptr @d, align 8, !tbaa !9
  %193 = load ptr, ptr @gc, align 8, !tbaa !9
  %194 = call i32 @XSetForeground(ptr noundef %192, ptr noundef %193, i64 noundef 0)
  %195 = load ptr, ptr @d, align 8, !tbaa !9
  %196 = getelementptr inbounds %struct.XButtonEvent, ptr %6, i32 0, i32 4
  %197 = load i64, ptr %196, align 8, !tbaa !20
  %198 = load ptr, ptr @gc, align 8, !tbaa !9
  %199 = load i32, ptr @x, align 4, !tbaa !5
  %200 = sub i32 %199, 14
  %201 = sub i32 %200, 2
  %202 = load i32, ptr @y, align 4, !tbaa !5
  %203 = sub i32 %202, 14
  %204 = sub i32 %203, 2
  %205 = call i32 @XDrawRectangle(ptr noundef %195, i64 noundef %197, ptr noundef %198, i32 noundef %201, i32 noundef %204, i32 noundef 32, i32 noundef 32)
  %206 = load ptr, ptr @d, align 8, !tbaa !9
  %207 = call i32 @XFlush(ptr noundef %206)
  br label %248

208:                                              ; preds = %171
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %209 = load float, ptr %11, align 4, !tbaa !21
  %210 = fsub float 1.000000e+00, %209
  %211 = fmul float %210, 2.550000e+02
  %212 = fptoui float %211 to i32
  store i32 %212, ptr %12, align 4, !tbaa !5
  %213 = load i32, ptr %12, align 4, !tbaa !5
  %214 = load i32, ptr %12, align 4, !tbaa !5
  %215 = load float, ptr %11, align 4, !tbaa !21
  %216 = fpext float %215 to double
  %217 = call i32 (ptr, ...) @printf(ptr noundef @.str.49, i32 noundef %213, i32 noundef %214, double noundef %216)
  %218 = load ptr, ptr @d, align 8, !tbaa !9
  %219 = load ptr, ptr @gc, align 8, !tbaa !9
  %220 = call i32 @XSetForeground(ptr noundef %218, ptr noundef %219, i64 noundef 16711680)
  %221 = load ptr, ptr @d, align 8, !tbaa !9
  %222 = getelementptr inbounds %struct.XButtonEvent, ptr %6, i32 0, i32 4
  %223 = load i64, ptr %222, align 8, !tbaa !20
  %224 = load ptr, ptr @gc, align 8, !tbaa !9
  %225 = load i32, ptr @x, align 4, !tbaa !5
  %226 = sub i32 %225, 14
  %227 = sub i32 %226, 1
  %228 = load i32, ptr @y, align 4, !tbaa !5
  %229 = sub i32 %228, 14
  %230 = sub i32 %229, 1
  %231 = call i32 @XDrawRectangle(ptr noundef %221, i64 noundef %223, ptr noundef %224, i32 noundef %227, i32 noundef %230, i32 noundef 30, i32 noundef 30)
  %232 = load ptr, ptr @d, align 8, !tbaa !9
  %233 = load ptr, ptr @gc, align 8, !tbaa !9
  %234 = call i32 @XSetForeground(ptr noundef %232, ptr noundef %233, i64 noundef 0)
  %235 = load ptr, ptr @d, align 8, !tbaa !9
  %236 = getelementptr inbounds %struct.XButtonEvent, ptr %6, i32 0, i32 4
  %237 = load i64, ptr %236, align 8, !tbaa !20
  %238 = load ptr, ptr @gc, align 8, !tbaa !9
  %239 = load i32, ptr @x, align 4, !tbaa !5
  %240 = sub i32 %239, 14
  %241 = sub i32 %240, 2
  %242 = load i32, ptr @y, align 4, !tbaa !5
  %243 = sub i32 %242, 14
  %244 = sub i32 %243, 2
  %245 = call i32 @XDrawRectangle(ptr noundef %235, i64 noundef %237, ptr noundef %238, i32 noundef %241, i32 noundef %244, i32 noundef 32, i32 noundef 32)
  %246 = load ptr, ptr @d, align 8, !tbaa !9
  %247 = call i32 @XFlush(ptr noundef %246)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %248

248:                                              ; preds = %208, %174
  br label %249

249:                                              ; preds = %248, %167
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %345

250:                                              ; preds = %164, %161
  %251 = load i32, ptr @crosshair, align 4, !tbaa !5
  %252 = icmp eq i32 %251, 1
  br i1 %252, label %253, label %284

253:                                              ; preds = %250
  %254 = load ptr, ptr @d, align 8, !tbaa !9
  %255 = load ptr, ptr @gc, align 8, !tbaa !9
  %256 = call i32 @XSetForeground(ptr noundef %254, ptr noundef %255, i64 noundef 65280)
  %257 = load ptr, ptr @d, align 8, !tbaa !9
  %258 = getelementptr inbounds %struct.XButtonEvent, ptr %6, i32 0, i32 4
  %259 = load i64, ptr %258, align 8, !tbaa !20
  %260 = load ptr, ptr @gc, align 8, !tbaa !9
  %261 = load i32, ptr @x, align 4, !tbaa !5
  %262 = sub i32 %261, 14
  %263 = sub i32 %262, 1
  %264 = load i32, ptr @y, align 4, !tbaa !5
  %265 = sub i32 %264, 14
  %266 = sub i32 %265, 1
  %267 = call i32 @XDrawRectangle(ptr noundef %257, i64 noundef %259, ptr noundef %260, i32 noundef %263, i32 noundef %266, i32 noundef 30, i32 noundef 30)
  %268 = load ptr, ptr @d, align 8, !tbaa !9
  %269 = load ptr, ptr @gc, align 8, !tbaa !9
  %270 = call i32 @XSetForeground(ptr noundef %268, ptr noundef %269, i64 noundef 0)
  %271 = load ptr, ptr @d, align 8, !tbaa !9
  %272 = getelementptr inbounds %struct.XButtonEvent, ptr %6, i32 0, i32 4
  %273 = load i64, ptr %272, align 8, !tbaa !20
  %274 = load ptr, ptr @gc, align 8, !tbaa !9
  %275 = load i32, ptr @x, align 4, !tbaa !5
  %276 = sub i32 %275, 14
  %277 = sub i32 %276, 2
  %278 = load i32, ptr @y, align 4, !tbaa !5
  %279 = sub i32 %278, 14
  %280 = sub i32 %279, 2
  %281 = call i32 @XDrawRectangle(ptr noundef %271, i64 noundef %273, ptr noundef %274, i32 noundef %277, i32 noundef %280, i32 noundef 32, i32 noundef 32)
  %282 = load ptr, ptr @d, align 8, !tbaa !9
  %283 = call i32 @XFlush(ptr noundef %282)
  br label %284

284:                                              ; preds = %253, %250
  %285 = call i32 @key_is_pressed(i64 noundef 87)
  %286 = icmp eq i32 %285, 0
  br i1 %286, label %287, label %344

287:                                              ; preds = %284
  %288 = call i32 @key_is_pressed(i64 noundef 65)
  %289 = icmp eq i32 %288, 0
  br i1 %289, label %290, label %344

290:                                              ; preds = %287
  %291 = call i32 @key_is_pressed(i64 noundef 83)
  %292 = icmp eq i32 %291, 0
  br i1 %292, label %293, label %344

293:                                              ; preds = %290
  %294 = call i32 @key_is_pressed(i64 noundef 68)
  %295 = icmp eq i32 %294, 0
  br i1 %295, label %296, label %344

296:                                              ; preds = %293
  %297 = call i32 @key_is_pressed(i64 noundef 65505)
  %298 = icmp eq i32 %297, 0
  br i1 %298, label %299, label %344

299:                                              ; preds = %296
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %300 = call float @processModel()
  store float %300, ptr %13, align 4, !tbaa !21
  %301 = load float, ptr %13, align 4, !tbaa !21
  %302 = fcmp ogt float %301, 0x3FECCCCCC0000000
  br i1 %302, label %303, label %342

303:                                              ; preds = %299
  %304 = load i32, ptr %7, align 4, !tbaa !5
  %305 = add i32 %304, 1
  store i32 %305, ptr %7, align 4, !tbaa !5
  %306 = load i32, ptr %7, align 4, !tbaa !5
  %307 = icmp ugt i32 %306, 0
  br i1 %307, label %308, label %341

308:                                              ; preds = %303
  %309 = load i32, ptr @sample_capture, align 4, !tbaa !5
  %310 = icmp eq i32 %309, 1
  br i1 %310, label %311, label %318

311:                                              ; preds = %308
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #5
  %312 = getelementptr inbounds [32 x i8], ptr %14, i64 0, i64 0
  %313 = call i32 @rand() #5
  %314 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %312, ptr noundef @.str.46, ptr noundef @targets_dir, i32 noundef %313) #5
  %315 = getelementptr inbounds [32 x i8], ptr %14, i64 0, i64 0
  call void @writePGM(ptr noundef %315, ptr noundef @pgmbytes)
  %316 = getelementptr inbounds [32 x i8], ptr %14, i64 0, i64 0
  %317 = call i32 (ptr, ...) @printf(ptr noundef @.str.50, ptr noundef %316)
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #5
  br label %318

318:                                              ; preds = %311, %308
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %319

319:                                              ; preds = %336, %318
  %320 = load i32, ptr %15, align 4, !tbaa !5
  %321 = icmp slt i32 %320, 1
  br i1 %321, label %323, label %322

322:                                              ; preds = %319
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %339

323:                                              ; preds = %319
  store i32 4, ptr %6, align 8, !tbaa !20
  %324 = getelementptr inbounds %struct.XButtonEvent, ptr %6, i32 0, i32 12
  store i32 0, ptr %324, align 8, !tbaa !20
  %325 = load ptr, ptr @d, align 8, !tbaa !9
  %326 = call i32 @XSendEvent(ptr noundef %325, i64 noundef 0, i32 noundef 1, i64 noundef 4095, ptr noundef %6)
  %327 = load ptr, ptr @d, align 8, !tbaa !9
  %328 = call i32 @XFlush(ptr noundef %327)
  %329 = call i32 @usleep(i32 noundef 100000)
  store i32 5, ptr %6, align 8, !tbaa !20
  %330 = getelementptr inbounds %struct.XButtonEvent, ptr %6, i32 0, i32 12
  store i32 256, ptr %330, align 8, !tbaa !20
  %331 = load ptr, ptr @d, align 8, !tbaa !9
  %332 = call i32 @XSendEvent(ptr noundef %331, i64 noundef 0, i32 noundef 1, i64 noundef 4095, ptr noundef %6)
  %333 = load ptr, ptr @d, align 8, !tbaa !9
  %334 = call i32 @XFlush(ptr noundef %333)
  %335 = call i32 @usleep(i32 noundef 30000)
  br label %336

336:                                              ; preds = %323
  %337 = load i32, ptr %15, align 4, !tbaa !5
  %338 = add nsw i32 %337, 1
  store i32 %338, ptr %15, align 4, !tbaa !5
  br label %319, !llvm.loop !23

339:                                              ; preds = %322
  %340 = call i32 @usleep(i32 noundef 100000)
  br label %341

341:                                              ; preds = %339, %303
  br label %343

342:                                              ; preds = %299
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %343

343:                                              ; preds = %342, %341
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %344

344:                                              ; preds = %343, %296, %293, %290, %287, %284
  br label %345

345:                                              ; preds = %344, %249
  br label %346

346:                                              ; preds = %345, %81
  br label %42
}

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

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #1

declare ptr @XOpenDisplay(ptr noundef) #4

declare i32 @XDefaultScreen(ptr noundef) #4

declare i32 @usleep(i32 noundef) #4

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

; Function Attrs: nounwind
declare ptr @getenv(ptr noundef) #1

; Function Attrs: nounwind
declare i32 @mkdir(ptr noundef, i32 noundef) #1

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

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

declare i32 @XFlush(ptr noundef) #4

declare i32 @XSendEvent(ptr noundef, i64 noundef, i32 noundef, i64 noundef, 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 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 = !{!12, !10, i64 232}
!12 = !{!"", !10, i64 0, !10, i64 8, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !10, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !6, i64 64, !10, i64 72, !6, i64 80, !6, i64 84, !6, i64 88, !6, i64 92, !6, i64 96, !10, i64 104, !6, i64 112, !6, i64 116, !10, i64 120, !10, i64 128, !6, i64 136, !13, i64 144, !13, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !6, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !6, i64 224, !6, i64 228, !10, i64 232, !13, i64 240, !13, i64 248, !6, i64 256, !6, i64 260, !10, i64 264, !10, i64 272, !6, i64 280, !10, i64 288}
!13 = !{!"long", !7, i64 0}
!14 = !{!15, !10, i64 72}
!15 = !{!"", !10, i64 0, !10, i64 8, !13, i64 16, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !6, i64 40, !10, i64 48, !6, i64 56, !10, i64 64, !10, i64 72, !13, i64 80, !13, i64 88, !13, i64 96, !6, i64 104, !6, i64 108, !6, i64 112, !6, i64 116, !13, i64 120}
!16 = !{!13, !13, i64 0}
!17 = !{!18, !6, i64 8}
!18 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !10, i64 24, !13, i64 32, !6, i64 40, !6, i64 44, !6, i64 48, !6, i64 52, !13, i64 56, !13, i64 64, !6, i64 72, !13, i64 80, !6, i64 88, !6, i64 92, !13, i64 96, !13, i64 104, !13, i64 112, !6, i64 120, !10, i64 128}
!19 = !{!18, !6, i64 12}
!20 = !{!7, !7, i64 0}
!21 = !{!22, !22, i64 0}
!22 = !{!"float", !7, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%union._XEvent = type { [24 x i64] }
%struct.XWindowAttributes = type { i32, i32, i32, i32, i32, i32, ptr, i64, i32, i32, i32, i32, i64, i64, i32, i64, i32, i32, i64, i64, i64, i32, ptr }
%struct.Screen = type { ptr, ptr, i64, i32, i32, i32, i32, i32, ptr, i32, ptr, ptr, i64, i64, i64, i32, i32, i32, i32, i64 }

@x = external dso_local local_unnamed_addr global i32, align 4
@y = external dso_local local_unnamed_addr global i32, align 4
@twin = external dso_local local_unnamed_addr global i64, align 8
@gc = external dso_local local_unnamed_addr global ptr, align 8
@pgmbytes = external dso_local global [784 x i8], align 16
@sps = external dso_local local_unnamed_addr global i32, align 4
@enable = external dso_local local_unnamed_addr global i32, align 4
@sample_capture = external dso_local local_unnamed_addr global i32, align 4
@crosshair = external dso_local local_unnamed_addr global i32, align 4
@hotkeys = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [20 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [24 x i8], align 1
@d = external dso_local local_unnamed_addr global ptr, align 8
@.str.31 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [24 x i8], align 1
@si = external dso_local local_unnamed_addr global i32, align 4
@.str.33 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [4 x i8], align 1
@main.st = external hidden local_unnamed_addr global i64, align 8
@.str.37 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [5 x i8], align 1
@targets_dir = external dso_local global [256 x i8], align 16
@.str.43 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [7 x i8], align 1
@main.scd = external hidden local_unnamed_addr global i64, align 8
@.str.46 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local float @processModel() local_unnamed_addr #0

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @microtime() local_unnamed_addr #0

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @key_is_pressed(i64 noundef) local_unnamed_addr #0

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

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

declare i32 @sleep(i32 noundef) local_unnamed_addr #5

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

; Function Attrs: nounwind uwtable
declare dso_local void @reprint() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = alloca %union._XEvent, align 8
  %4 = alloca %struct.XWindowAttributes, align 8
  %5 = alloca [32 x i8], align 16
  %6 = alloca [32 x i8], align 16
  %7 = tail call i64 @time(ptr noundef null) #7
  %8 = trunc i64 %7 to i32
  tail call void @srand(i32 noundef %8) #7
  %9 = tail call i32 @remove(ptr noundef nonnull @.str) #7
  %10 = tail call i32 @remove(ptr noundef nonnull @.str.2) #7
  tail call void @reprint()
  %11 = tail call ptr @XOpenDisplay(ptr noundef nonnull @.str.31) #7
  store ptr %11, ptr @d, align 8, !tbaa !5
  %12 = icmp eq ptr %11, null
  br i1 %12, label %13, label %15

13:                                               ; preds = %2
  %14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.32)
  ret i32 0

15:                                               ; preds = %2
  %16 = tail call i32 @XDefaultScreen(ptr noundef nonnull %11) #7
  store i32 %16, ptr @si, align 4, !tbaa !9
  %17 = load ptr, ptr @d, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %17, i64 232
  %19 = load ptr, ptr %18, align 8, !tbaa !11
  %20 = sext i32 %16 to i64
  %21 = getelementptr inbounds %struct.Screen, ptr %19, i64 %20, i32 11
  %22 = load ptr, ptr %21, align 8, !tbaa !14
  store ptr %22, ptr @gc, align 8, !tbaa !5
  %23 = tail call i64 @findWindow(ptr noundef %17, i64 noundef 0, ptr noundef nonnull @.str.33)
  store i64 %23, ptr @twin, align 8, !tbaa !16
  %.not = icmp eq i64 %23, 0
  br i1 %.not, label %25, label %24

24:                                               ; preds = %15
  tail call void @reprint()
  br label %25

25:                                               ; preds = %24, %15
  call void @llvm.lifetime.start.p0(i64 192, ptr nonnull %3) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(192) %3, i8 0, i64 192, i1 false)
  %26 = getelementptr inbounds i8, ptr %4, i64 8
  %27 = getelementptr inbounds i8, ptr %4, i64 12
  %28 = getelementptr inbounds i8, ptr %3, i64 84
  %29 = getelementptr inbounds i8, ptr %3, i64 88
  %30 = getelementptr inbounds i8, ptr %3, i64 48
  %31 = getelementptr inbounds i8, ptr %3, i64 32
  %32 = getelementptr inbounds i8, ptr %3, i64 80
  br label %.outer

.outer:                                           ; preds = %.outer.backedge, %25
  %.012.ph = phi i32 [ 0, %25 ], [ %.012.ph.be, %.outer.backedge ]
  %33 = call i32 @usleep(i32 noundef 1000) #7
  %34 = call i32 @key_is_pressed(i64 noundef 65507)
  %.not1727 = icmp eq i32 %34, 0
  br i1 %.not1727, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.outer, %43
  %35 = call i32 @key_is_pressed(i64 noundef 65513)
  %.not18 = icmp eq i32 %35, 0
  br i1 %.not18, label %.loopexit, label %36

36:                                               ; preds = %.lr.ph
  %37 = load i32, ptr @enable, align 4, !tbaa !9
  %38 = icmp eq i32 %37, 0
  br i1 %38, label %39, label %57

39:                                               ; preds = %36
  %40 = load ptr, ptr @d, align 8, !tbaa !5
  %41 = call i64 @findWindow(ptr noundef %40, i64 noundef 0, ptr noundef nonnull @.str.33)
  store i64 %41, ptr @twin, align 8, !tbaa !16
  %42 = icmp eq i64 %41, 0
  br i1 %42, label %43, label %48

43:                                               ; preds = %39
  %44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.34)
  %45 = call i32 @sleep(i32 noundef 1) #7
  %46 = call i32 @usleep(i32 noundef 1000) #7
  %47 = call i32 @key_is_pressed(i64 noundef 65507)
  %.not17 = icmp eq i32 %47, 0
  br i1 %.not17, label %.loopexit, label %.lr.ph

48:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 136, ptr nonnull %4) #7
  %49 = load ptr, ptr @d, align 8, !tbaa !5
  %50 = call i32 @XGetWindowAttributes(ptr noundef %49, i64 noundef %41, ptr noundef nonnull %4) #7
  %51 = load i32, ptr %26, align 8, !tbaa !17
  %52 = sdiv i32 %51, 2
  store i32 %52, ptr @x, align 4, !tbaa !9
  %53 = load i32, ptr %27, align 4, !tbaa !19
  %54 = sdiv i32 %53, 2
  store i32 %54, ptr @y, align 4, !tbaa !9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(192) %3, i8 0, i64 192, i1 false)
  store i32 4, ptr %3, align 8, !tbaa !20
  store i32 1, ptr %28, align 4, !tbaa !20
  store i32 1, ptr %29, align 8, !tbaa !20
  %55 = load i64, ptr @twin, align 8, !tbaa !16
  store i64 %55, ptr %30, align 8, !tbaa !20
  store i64 %55, ptr %31, align 8, !tbaa !20
  store i32 1, ptr @enable, align 4, !tbaa !9
  %56 = call i32 @usleep(i32 noundef 100000) #7
  call void @reprint()
  call void @speakS(ptr noundef nonnull @.str.35)
  call void @llvm.lifetime.end.p0(i64 136, ptr nonnull %4) #7
  br label %.loopexit

57:                                               ; preds = %36
  store i32 0, ptr @enable, align 4, !tbaa !9
  %58 = call i32 @usleep(i32 noundef 100000) #7
  call void @reprint()
  call void @speakS(ptr noundef nonnull @.str.36)
  br label %.loopexit

.loopexit:                                        ; preds = %43, %.lr.ph, %.outer, %48, %57
  %59 = load i32, ptr @enable, align 4, !tbaa !9
  %60 = icmp eq i32 %59, 1
  br i1 %60, label %61, label %.outer.backedge

61:                                               ; preds = %.loopexit
  %62 = call i64 @microtime()
  %63 = load i64, ptr @main.st, align 8, !tbaa !16
  %64 = sub i64 %62, %63
  %65 = icmp ugt i64 %64, 999999
  br i1 %65, label %66, label %73

66:                                               ; preds = %61
  %67 = call i32 @key_is_pressed(i64 noundef 72)
  %.not19 = icmp eq i32 %67, 0
  br i1 %.not19, label %71, label %68

68:                                               ; preds = %66
  %69 = load i32, ptr @sps, align 4, !tbaa !9
  %70 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.37, i32 noundef %69)
  br label %71

71:                                               ; preds = %68, %66
  store i32 0, ptr @sps, align 4, !tbaa !9
  %72 = call i64 @microtime()
  store i64 %72, ptr @main.st, align 8, !tbaa !16
  br label %73

73:                                               ; preds = %71, %61
  %74 = call i32 @key_is_pressed(i64 noundef 65508)
  %.not20 = icmp eq i32 %74, 0
  br i1 %.not20, label %80, label %75

75:                                               ; preds = %73
  %76 = call i32 @key_is_pressed(i64 noundef 65514)
  %.not21 = icmp eq i32 %76, 0
  br i1 %.not21, label %80, label %.sink.split

.sink.split:                                      ; preds = %75
  %77 = load i32, ptr @hotkeys, align 4, !tbaa !9
  %78 = icmp eq i32 %77, 0
  %. = zext i1 %78 to i32
  %.str.38..str.39 = select i1 %78, ptr @.str.38, ptr @.str.39
  store i32 %., ptr @hotkeys, align 4, !tbaa !9
  %79 = call i32 @usleep(i32 noundef 100000) #7
  call void @reprint()
  call void @speakS(ptr noundef nonnull %.str.38..str.39)
  br label %80

80:                                               ; preds = %.sink.split, %75, %73
  %81 = load i32, ptr @hotkeys, align 4, !tbaa !9
  %82 = icmp eq i32 %81, 1
  br i1 %82, label %83, label %.thread

83:                                               ; preds = %80
  %84 = call i32 @key_is_pressed(i64 noundef 80)
  %.not22 = icmp eq i32 %84, 0
  br i1 %.not22, label %88, label %.sink.split29

.sink.split29:                                    ; preds = %83
  %85 = load i32, ptr @crosshair, align 4, !tbaa !9
  %86 = icmp eq i32 %85, 0
  %.33 = zext i1 %86 to i32
  %.str.40..str.41 = select i1 %86, ptr @.str.40, ptr @.str.41
  store i32 %.33, ptr @crosshair, align 4, !tbaa !9
  %87 = call i32 @usleep(i32 noundef 100000) #7
  call void @reprint()
  call void @speakS(ptr noundef nonnull %.str.40..str.41)
  br label %88

88:                                               ; preds = %.sink.split29, %83
  %89 = call i32 @key_is_pressed(i64 noundef 76)
  %.not23 = icmp eq i32 %89, 0
  br i1 %.not23, label %98, label %90

90:                                               ; preds = %88
  %91 = load i32, ptr @sample_capture, align 4, !tbaa !9
  %92 = icmp eq i32 %91, 0
  br i1 %92, label %93, label %.sink.split31

93:                                               ; preds = %90
  %94 = call ptr @getenv(ptr noundef nonnull @.str.42) #7
  %95 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) @targets_dir, ptr noundef nonnull dereferenceable(1) @.str.43, ptr noundef %94) #7
  %96 = call i32 @mkdir(ptr noundef nonnull @targets_dir, i32 noundef 511) #7
  br label %.sink.split31

.sink.split31:                                    ; preds = %90, %93
  %.sink32 = phi i32 [ 1, %93 ], [ 0, %90 ]
  %.str.44.sink = phi ptr [ @.str.44, %93 ], [ @.str.45, %90 ]
  store i32 %.sink32, ptr @sample_capture, align 4, !tbaa !9
  %97 = call i32 @usleep(i32 noundef 100000) #7
  call void @reprint()
  call void @speakS(ptr noundef nonnull %.str.44.sink)
  br label %98

98:                                               ; preds = %.sink.split31, %88
  %99 = load i32, ptr @sample_capture, align 4, !tbaa !9
  %100 = icmp eq i32 %99, 1
  br i1 %100, label %101, label %114

101:                                              ; preds = %98
  %102 = call i32 @key_is_pressed(i64 noundef 69)
  %.not24 = icmp eq i32 %102, 0
  br i1 %.not24, label %114, label %103

103:                                              ; preds = %101
  %104 = call i64 @microtime()
  %105 = load i64, ptr @main.scd, align 8, !tbaa !16
  %106 = icmp ugt i64 %104, %105
  br i1 %106, label %107, label %114

107:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #7
  %108 = call i32 @rand() #7
  %109 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) @.str.46, ptr noundef nonnull @targets_dir, i32 noundef %108) #7
  %110 = load i64, ptr @twin, align 8, !tbaa !16
  call void @processScanArea(i64 noundef %110)
  call void @writePGM(ptr noundef nonnull %5, ptr noundef nonnull @pgmbytes)
  %111 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.47, ptr noundef nonnull %5)
  %112 = call i64 @microtime()
  %113 = add i64 %112, 350000
  store i64 %113, ptr @main.scd, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #7
  br label %114

114:                                              ; preds = %98, %101, %103, %107
  %.pr = load i32, ptr @hotkeys, align 4, !tbaa !9
  %115 = icmp eq i32 %.pr, 1
  br i1 %115, label %116, label %.thread

116:                                              ; preds = %114
  %117 = call i32 @key_is_pressed(i64 noundef 71)
  %.not25 = icmp eq i32 %117, 0
  br i1 %.not25, label %.thread, label %118

118:                                              ; preds = %116
  %119 = call float @processModel()
  %120 = fcmp ogt float %119, 0.000000e+00
  br i1 %120, label %121, label %.outer.backedge

121:                                              ; preds = %118
  %122 = fcmp ogt float %119, 0x3FECCCCCC0000000
  br i1 %122, label %123, label %150

123:                                              ; preds = %121
  %124 = fpext float %119 to double
  %125 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.48, double noundef %124)
  %126 = load ptr, ptr @d, align 8, !tbaa !5
  %127 = load ptr, ptr @gc, align 8, !tbaa !5
  %128 = call i32 @XSetForeground(ptr noundef %126, ptr noundef %127, i64 noundef 65280) #7
  %129 = load ptr, ptr @d, align 8, !tbaa !5
  %130 = load i64, ptr %31, align 8, !tbaa !20
  %131 = load ptr, ptr @gc, align 8, !tbaa !5
  %132 = load i32, ptr @x, align 4, !tbaa !9
  %133 = add i32 %132, -15
  %134 = load i32, ptr @y, align 4, !tbaa !9
  %135 = add i32 %134, -15
  %136 = call i32 @XDrawRectangle(ptr noundef %129, i64 noundef %130, ptr noundef %131, i32 noundef %133, i32 noundef %135, i32 noundef 30, i32 noundef 30) #7
  %137 = load ptr, ptr @d, align 8, !tbaa !5
  %138 = load ptr, ptr @gc, align 8, !tbaa !5
  %139 = call i32 @XSetForeground(ptr noundef %137, ptr noundef %138, i64 noundef 0) #7
  %140 = load ptr, ptr @d, align 8, !tbaa !5
  %141 = load i64, ptr %31, align 8, !tbaa !20
  %142 = load ptr, ptr @gc, align 8, !tbaa !5
  %143 = load i32, ptr @x, align 4, !tbaa !9
  %144 = add i32 %143, -16
  %145 = load i32, ptr @y, align 4, !tbaa !9
  %146 = add i32 %145, -16
  %147 = call i32 @XDrawRectangle(ptr noundef %140, i64 noundef %141, ptr noundef %142, i32 noundef %144, i32 noundef %146, i32 noundef 32, i32 noundef 32) #7
  %148 = load ptr, ptr @d, align 8, !tbaa !5
  %149 = call i32 @XFlush(ptr noundef %148) #7
  br label %.outer.backedge

150:                                              ; preds = %121
  %151 = fsub float 1.000000e+00, %119
  %152 = fmul float %151, 2.550000e+02
  %153 = fptoui float %152 to i32
  %154 = fpext float %119 to double
  %155 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.49, i32 noundef %153, i32 noundef %153, double noundef %154)
  %156 = load ptr, ptr @d, align 8, !tbaa !5
  %157 = load ptr, ptr @gc, align 8, !tbaa !5
  %158 = call i32 @XSetForeground(ptr noundef %156, ptr noundef %157, i64 noundef 16711680) #7
  %159 = load ptr, ptr @d, align 8, !tbaa !5
  %160 = load i64, ptr %31, align 8, !tbaa !20
  %161 = load ptr, ptr @gc, align 8, !tbaa !5
  %162 = load i32, ptr @x, align 4, !tbaa !9
  %163 = add i32 %162, -15
  %164 = load i32, ptr @y, align 4, !tbaa !9
  %165 = add i32 %164, -15
  %166 = call i32 @XDrawRectangle(ptr noundef %159, i64 noundef %160, ptr noundef %161, i32 noundef %163, i32 noundef %165, i32 noundef 30, i32 noundef 30) #7
  %167 = load ptr, ptr @d, align 8, !tbaa !5
  %168 = load ptr, ptr @gc, align 8, !tbaa !5
  %169 = call i32 @XSetForeground(ptr noundef %167, ptr noundef %168, i64 noundef 0) #7
  %170 = load ptr, ptr @d, align 8, !tbaa !5
  %171 = load i64, ptr %31, align 8, !tbaa !20
  %172 = load ptr, ptr @gc, align 8, !tbaa !5
  %173 = load i32, ptr @x, align 4, !tbaa !9
  %174 = add i32 %173, -16
  %175 = load i32, ptr @y, align 4, !tbaa !9
  %176 = add i32 %175, -16
  %177 = call i32 @XDrawRectangle(ptr noundef %170, i64 noundef %171, ptr noundef %172, i32 noundef %174, i32 noundef %176, i32 noundef 32, i32 noundef 32) #7
  %178 = load ptr, ptr @d, align 8, !tbaa !5
  %179 = call i32 @XFlush(ptr noundef %178) #7
  br label %.outer.backedge

.thread:                                          ; preds = %80, %116, %114
  %180 = load i32, ptr @crosshair, align 4, !tbaa !9
  %181 = icmp eq i32 %180, 1
  br i1 %181, label %182, label %207

182:                                              ; preds = %.thread
  %183 = load ptr, ptr @d, align 8, !tbaa !5
  %184 = load ptr, ptr @gc, align 8, !tbaa !5
  %185 = call i32 @XSetForeground(ptr noundef %183, ptr noundef %184, i64 noundef 65280) #7
  %186 = load ptr, ptr @d, align 8, !tbaa !5
  %187 = load i64, ptr %31, align 8, !tbaa !20
  %188 = load ptr, ptr @gc, align 8, !tbaa !5
  %189 = load i32, ptr @x, align 4, !tbaa !9
  %190 = add i32 %189, -15
  %191 = load i32, ptr @y, align 4, !tbaa !9
  %192 = add i32 %191, -15
  %193 = call i32 @XDrawRectangle(ptr noundef %186, i64 noundef %187, ptr noundef %188, i32 noundef %190, i32 noundef %192, i32 noundef 30, i32 noundef 30) #7
  %194 = load ptr, ptr @d, align 8, !tbaa !5
  %195 = load ptr, ptr @gc, align 8, !tbaa !5
  %196 = call i32 @XSetForeground(ptr noundef %194, ptr noundef %195, i64 noundef 0) #7
  %197 = load ptr, ptr @d, align 8, !tbaa !5
  %198 = load i64, ptr %31, align 8, !tbaa !20
  %199 = load ptr, ptr @gc, align 8, !tbaa !5
  %200 = load i32, ptr @x, align 4, !tbaa !9
  %201 = add i32 %200, -16
  %202 = load i32, ptr @y, align 4, !tbaa !9
  %203 = add i32 %202, -16
  %204 = call i32 @XDrawRectangle(ptr noundef %197, i64 noundef %198, ptr noundef %199, i32 noundef %201, i32 noundef %203, i32 noundef 32, i32 noundef 32) #7
  %205 = load ptr, ptr @d, align 8, !tbaa !5
  %206 = call i32 @XFlush(ptr noundef %205) #7
  br label %207

207:                                              ; preds = %182, %.thread
  %208 = call i32 @key_is_pressed(i64 noundef 87)
  %209 = icmp eq i32 %208, 0
  br i1 %209, label %210, label %.outer.backedge

210:                                              ; preds = %207
  %211 = call i32 @key_is_pressed(i64 noundef 65)
  %212 = icmp eq i32 %211, 0
  br i1 %212, label %213, label %.outer.backedge

213:                                              ; preds = %210
  %214 = call i32 @key_is_pressed(i64 noundef 83)
  %215 = icmp eq i32 %214, 0
  br i1 %215, label %216, label %.outer.backedge

216:                                              ; preds = %213
  %217 = call i32 @key_is_pressed(i64 noundef 68)
  %218 = icmp eq i32 %217, 0
  br i1 %218, label %219, label %.outer.backedge

219:                                              ; preds = %216
  %220 = call i32 @key_is_pressed(i64 noundef 65505)
  %221 = icmp eq i32 %220, 0
  br i1 %221, label %222, label %.outer.backedge

222:                                              ; preds = %219
  %223 = call float @processModel()
  %224 = fcmp ogt float %223, 0x3FECCCCCC0000000
  br i1 %224, label %225, label %.outer.backedge

225:                                              ; preds = %222
  %226 = add i32 %.012.ph, 1
  %.not26 = icmp eq i32 %226, 0
  br i1 %.not26, label %.outer.backedge, label %227

227:                                              ; preds = %225
  %228 = load i32, ptr @sample_capture, align 4, !tbaa !9
  %229 = icmp eq i32 %228, 1
  br i1 %229, label %230, label %.critedge

230:                                              ; preds = %227
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #7
  %231 = call i32 @rand() #7
  %232 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %6, ptr noundef nonnull dereferenceable(1) @.str.46, ptr noundef nonnull @targets_dir, i32 noundef %231) #7
  call void @writePGM(ptr noundef nonnull %6, ptr noundef nonnull @pgmbytes)
  %233 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.50, ptr noundef nonnull %6)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #7
  br label %.critedge

.critedge:                                        ; preds = %230, %227
  store i32 4, ptr %3, align 8, !tbaa !20
  store i32 0, ptr %32, align 8, !tbaa !20
  %234 = load ptr, ptr @d, align 8, !tbaa !5
  %235 = call i32 @XSendEvent(ptr noundef %234, i64 noundef 0, i32 noundef 1, i64 noundef 4095, ptr noundef nonnull %3) #7
  %236 = load ptr, ptr @d, align 8, !tbaa !5
  %237 = call i32 @XFlush(ptr noundef %236) #7
  %238 = call i32 @usleep(i32 noundef 100000) #7
  store i32 5, ptr %3, align 8, !tbaa !20
  store i32 256, ptr %32, align 8, !tbaa !20
  %239 = load ptr, ptr @d, align 8, !tbaa !5
  %240 = call i32 @XSendEvent(ptr noundef %239, i64 noundef 0, i32 noundef 1, i64 noundef 4095, ptr noundef nonnull %3) #7
  %241 = load ptr, ptr @d, align 8, !tbaa !5
  %242 = call i32 @XFlush(ptr noundef %241) #7
  %243 = call i32 @usleep(i32 noundef 30000) #7
  %244 = call i32 @usleep(i32 noundef 100000) #7
  br label %.outer.backedge

.outer.backedge:                                  ; preds = %.critedge, %225, %222, %118, %150, %123, %219, %216, %213, %210, %207, %.loopexit
  %.012.ph.be = phi i32 [ %.012.ph, %219 ], [ %.012.ph, %216 ], [ %.012.ph, %213 ], [ %.012.ph, %210 ], [ %.012.ph, %207 ], [ %.012.ph, %.loopexit ], [ %.012.ph, %123 ], [ %.012.ph, %150 ], [ %.012.ph, %118 ], [ %226, %.critedge ], [ 0, %225 ], [ 0, %222 ]
  br label %.outer
}

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

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #4

declare ptr @XOpenDisplay(ptr noundef) local_unnamed_addr #5

declare i32 @XDefaultScreen(ptr noundef) local_unnamed_addr #5

declare i32 @usleep(i32 noundef) local_unnamed_addr #5

declare i32 @XGetWindowAttributes(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: nofree nounwind memory(read)
declare noundef ptr @getenv(ptr nocapture noundef) local_unnamed_addr #6

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

declare i32 @XSetForeground(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #5

declare i32 @XDrawRectangle(ptr noundef, i64 noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #5

declare i32 @XFlush(ptr noundef) local_unnamed_addr #5

declare i32 @XSendEvent(ptr noundef, i64 noundef, i32 noundef, i64 noundef, ptr noundef) local_unnamed_addr #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { "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 = { nofree nounwind 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 #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, !6, i64 232}
!12 = !{!"", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !6, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !10, i64 64, !6, i64 72, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !6, i64 104, !10, i64 112, !10, i64 116, !6, i64 120, !6, i64 128, !10, i64 136, !13, i64 144, !13, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !10, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !10, i64 224, !10, i64 228, !6, i64 232, !13, i64 240, !13, i64 248, !10, i64 256, !10, i64 260, !6, i64 264, !6, i64 272, !10, i64 280, !6, i64 288}
!13 = !{!"long", !7, i64 0}
!14 = !{!15, !6, i64 72}
!15 = !{!"", !6, i64 0, !6, i64 8, !13, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !6, i64 48, !10, i64 56, !6, i64 64, !6, i64 72, !13, i64 80, !13, i64 88, !13, i64 96, !10, i64 104, !10, i64 108, !10, i64 112, !10, i64 116, !13, i64 120}
!16 = !{!13, !13, i64 0}
!17 = !{!18, !10, i64 8}
!18 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !6, i64 24, !13, i64 32, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !13, i64 56, !13, i64 64, !10, i64 72, !13, i64 80, !10, i64 88, !10, i64 92, !13, i64 96, !13, i64 104, !13, i64 112, !10, i64 120, !6, i64 128}
!19 = !{!18, !10, i64 12}
!20 = !{!7, !7, i64 0}


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