; LLVM IR from Sonryle/JoePhys :: testbed/dependencies/GLFW/tests (events)

; 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.GLFWvidmode = type { i32, i32, i32, i32, i32, i32 }
%struct.Slot = type { ptr, i32, i32 }

@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@optarg = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [20 x i8], align 1
@stdout = external global ptr, align 8

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @gladLoadGL(ptr noundef) #1

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

18:                                               ; preds = %2
  call void @exit(i32 noundef 1) #7
  unreachable

19:                                               ; preds = %2
  %20 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  %21 = call ptr @glfwSetMonitorCallback(ptr noundef @monitor_callback)
  %22 = call ptr @glfwSetJoystickCallback(ptr noundef @joystick_callback)
  br label %23

23:                                               ; preds = %38, %19
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = load ptr, ptr %5, align 8, !tbaa !9
  %26 = call i32 @getopt(i32 noundef %24, ptr noundef %25, ptr noundef @.str.2)
  store i32 %26, ptr %8, align 4, !tbaa !5
  %27 = icmp ne i32 %26, -1
  br i1 %27, label %28, label %39

28:                                               ; preds = %23
  %29 = load i32, ptr %8, align 4, !tbaa !5
  switch i32 %29, label %37 [
    i32 104, label %30
    i32 102, label %31
    i32 110, label %33
  ]

30:                                               ; preds = %28
  call void @usage()
  call void @exit(i32 noundef 0) #7
  unreachable

31:                                               ; preds = %28
  %32 = call ptr @glfwGetPrimaryMonitor()
  store ptr %32, ptr %7, align 8, !tbaa !9
  br label %38

33:                                               ; preds = %28
  %34 = load ptr, ptr @optarg, align 8, !tbaa !9
  %35 = call i64 @strtoul(ptr noundef %34, ptr noundef null, i32 noundef 10) #6
  %36 = trunc i64 %35 to i32
  store i32 %36, ptr %12, align 4, !tbaa !5
  br label %38

37:                                               ; preds = %28
  call void @usage()
  call void @exit(i32 noundef 1) #7
  unreachable

38:                                               ; preds = %33, %31
  br label %23, !llvm.loop !11

39:                                               ; preds = %23
  %40 = load ptr, ptr %7, align 8, !tbaa !9
  %41 = icmp ne ptr %40, null
  br i1 %41, label %42, label %63

42:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %43 = load ptr, ptr %7, align 8, !tbaa !9
  %44 = call ptr @glfwGetVideoMode(ptr noundef %43)
  store ptr %44, ptr %13, align 8, !tbaa !9
  %45 = load ptr, ptr %13, align 8, !tbaa !9
  %46 = getelementptr inbounds %struct.GLFWvidmode, ptr %45, i32 0, i32 5
  %47 = load i32, ptr %46, align 4, !tbaa !13
  call void @glfwWindowHint(i32 noundef 135183, i32 noundef %47)
  %48 = load ptr, ptr %13, align 8, !tbaa !9
  %49 = getelementptr inbounds %struct.GLFWvidmode, ptr %48, i32 0, i32 2
  %50 = load i32, ptr %49, align 4, !tbaa !15
  call void @glfwWindowHint(i32 noundef 135169, i32 noundef %50)
  %51 = load ptr, ptr %13, align 8, !tbaa !9
  %52 = getelementptr inbounds %struct.GLFWvidmode, ptr %51, i32 0, i32 3
  %53 = load i32, ptr %52, align 4, !tbaa !16
  call void @glfwWindowHint(i32 noundef 135170, i32 noundef %53)
  %54 = load ptr, ptr %13, align 8, !tbaa !9
  %55 = getelementptr inbounds %struct.GLFWvidmode, ptr %54, i32 0, i32 4
  %56 = load i32, ptr %55, align 4, !tbaa !17
  call void @glfwWindowHint(i32 noundef 135171, i32 noundef %56)
  %57 = load ptr, ptr %13, align 8, !tbaa !9
  %58 = getelementptr inbounds %struct.GLFWvidmode, ptr %57, i32 0, i32 0
  %59 = load i32, ptr %58, align 4, !tbaa !18
  store i32 %59, ptr %10, align 4, !tbaa !5
  %60 = load ptr, ptr %13, align 8, !tbaa !9
  %61 = getelementptr inbounds %struct.GLFWvidmode, ptr %60, i32 0, i32 1
  %62 = load i32, ptr %61, align 4, !tbaa !19
  store i32 %62, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %64

63:                                               ; preds = %39
  store i32 640, ptr %10, align 4, !tbaa !5
  store i32 480, ptr %11, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %63, %42
  %65 = load i32, ptr %12, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = call noalias ptr @calloc(i64 noundef %66, i64 noundef 16) #8
  store ptr %67, ptr %6, align 8, !tbaa !9
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %273, %64
  %69 = load i32, ptr %9, align 4, !tbaa !5
  %70 = load i32, ptr %12, align 4, !tbaa !5
  %71 = icmp slt i32 %69, %70
  br i1 %71, label %72, label %276

72:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 128, ptr %14) #6
  %73 = load ptr, ptr %6, align 8, !tbaa !9
  %74 = load i32, ptr %9, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds %struct.Slot, ptr %73, i64 %75
  %77 = getelementptr inbounds %struct.Slot, ptr %76, i32 0, i32 2
  store i32 1, ptr %77, align 4, !tbaa !20
  %78 = load i32, ptr %9, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  %80 = load ptr, ptr %6, align 8, !tbaa !9
  %81 = load i32, ptr %9, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds %struct.Slot, ptr %80, i64 %82
  %84 = getelementptr inbounds %struct.Slot, ptr %83, i32 0, i32 1
  store i32 %79, ptr %84, align 8, !tbaa !22
  %85 = getelementptr inbounds [128 x i8], ptr %14, i64 0, i64 0
  %86 = load ptr, ptr %6, align 8, !tbaa !9
  %87 = load i32, ptr %9, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds %struct.Slot, ptr %86, i64 %88
  %90 = getelementptr inbounds %struct.Slot, ptr %89, i32 0, i32 1
  %91 = load i32, ptr %90, align 8, !tbaa !22
  %92 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %85, i64 noundef 128, ptr noundef @.str.3, i32 noundef %91) #6
  %93 = load ptr, ptr %7, align 8, !tbaa !9
  %94 = icmp ne ptr %93, null
  br i1 %94, label %95, label %107

95:                                               ; preds = %72
  %96 = load ptr, ptr %6, align 8, !tbaa !9
  %97 = load i32, ptr %9, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds %struct.Slot, ptr %96, i64 %98
  %100 = getelementptr inbounds %struct.Slot, ptr %99, i32 0, i32 1
  %101 = load i32, ptr %100, align 8, !tbaa !22
  %102 = load i32, ptr %10, align 4, !tbaa !5
  %103 = load i32, ptr %11, align 4, !tbaa !5
  %104 = load ptr, ptr %7, align 8, !tbaa !9
  %105 = call ptr @glfwGetMonitorName(ptr noundef %104)
  %106 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %101, i32 noundef %102, i32 noundef %103, ptr noundef %105)
  br label %117

107:                                              ; preds = %72
  %108 = load ptr, ptr %6, align 8, !tbaa !9
  %109 = load i32, ptr %9, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds %struct.Slot, ptr %108, i64 %110
  %112 = getelementptr inbounds %struct.Slot, ptr %111, i32 0, i32 1
  %113 = load i32, ptr %112, align 8, !tbaa !22
  %114 = load i32, ptr %10, align 4, !tbaa !5
  %115 = load i32, ptr %11, align 4, !tbaa !5
  %116 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %113, i32 noundef %114, i32 noundef %115)
  br label %117

117:                                              ; preds = %107, %95
  %118 = load i32, ptr %10, align 4, !tbaa !5
  %119 = load i32, ptr %11, align 4, !tbaa !5
  %120 = getelementptr inbounds [128 x i8], ptr %14, i64 0, i64 0
  %121 = load ptr, ptr %7, align 8, !tbaa !9
  %122 = call ptr @glfwCreateWindow(i32 noundef %118, i32 noundef %119, ptr noundef %120, ptr noundef %121, ptr noundef null)
  %123 = load ptr, ptr %6, align 8, !tbaa !9
  %124 = load i32, ptr %9, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds %struct.Slot, ptr %123, i64 %125
  %127 = getelementptr inbounds %struct.Slot, ptr %126, i32 0, i32 0
  store ptr %122, ptr %127, align 8, !tbaa !23
  %128 = load ptr, ptr %6, align 8, !tbaa !9
  %129 = load i32, ptr %9, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds %struct.Slot, ptr %128, i64 %130
  %132 = getelementptr inbounds %struct.Slot, ptr %131, i32 0, i32 0
  %133 = load ptr, ptr %132, align 8, !tbaa !23
  %134 = icmp ne ptr %133, null
  br i1 %134, label %137, label %135

135:                                              ; preds = %117
  %136 = load ptr, ptr %6, align 8, !tbaa !9
  call void @free(ptr noundef %136) #6
  call void @glfwTerminate()
  call void @exit(i32 noundef 1) #7
  unreachable

137:                                              ; preds = %117
  %138 = load ptr, ptr %6, align 8, !tbaa !9
  %139 = load i32, ptr %9, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds %struct.Slot, ptr %138, i64 %140
  %142 = getelementptr inbounds %struct.Slot, ptr %141, i32 0, i32 0
  %143 = load ptr, ptr %142, align 8, !tbaa !23
  %144 = load ptr, ptr %6, align 8, !tbaa !9
  %145 = load i32, ptr %9, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds %struct.Slot, ptr %144, i64 %146
  call void @glfwSetWindowUserPointer(ptr noundef %143, ptr noundef %147)
  %148 = load ptr, ptr %6, align 8, !tbaa !9
  %149 = load i32, ptr %9, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds %struct.Slot, ptr %148, i64 %150
  %152 = getelementptr inbounds %struct.Slot, ptr %151, i32 0, i32 0
  %153 = load ptr, ptr %152, align 8, !tbaa !23
  %154 = call ptr @glfwSetWindowPosCallback(ptr noundef %153, ptr noundef @window_pos_callback)
  %155 = load ptr, ptr %6, align 8, !tbaa !9
  %156 = load i32, ptr %9, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds %struct.Slot, ptr %155, i64 %157
  %159 = getelementptr inbounds %struct.Slot, ptr %158, i32 0, i32 0
  %160 = load ptr, ptr %159, align 8, !tbaa !23
  %161 = call ptr @glfwSetWindowSizeCallback(ptr noundef %160, ptr noundef @window_size_callback)
  %162 = load ptr, ptr %6, align 8, !tbaa !9
  %163 = load i32, ptr %9, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds %struct.Slot, ptr %162, i64 %164
  %166 = getelementptr inbounds %struct.Slot, ptr %165, i32 0, i32 0
  %167 = load ptr, ptr %166, align 8, !tbaa !23
  %168 = call ptr @glfwSetFramebufferSizeCallback(ptr noundef %167, ptr noundef @framebuffer_size_callback)
  %169 = load ptr, ptr %6, align 8, !tbaa !9
  %170 = load i32, ptr %9, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds %struct.Slot, ptr %169, i64 %171
  %173 = getelementptr inbounds %struct.Slot, ptr %172, i32 0, i32 0
  %174 = load ptr, ptr %173, align 8, !tbaa !23
  %175 = call ptr @glfwSetWindowContentScaleCallback(ptr noundef %174, ptr noundef @window_content_scale_callback)
  %176 = load ptr, ptr %6, align 8, !tbaa !9
  %177 = load i32, ptr %9, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds %struct.Slot, ptr %176, i64 %178
  %180 = getelementptr inbounds %struct.Slot, ptr %179, i32 0, i32 0
  %181 = load ptr, ptr %180, align 8, !tbaa !23
  %182 = call ptr @glfwSetWindowCloseCallback(ptr noundef %181, ptr noundef @window_close_callback)
  %183 = load ptr, ptr %6, align 8, !tbaa !9
  %184 = load i32, ptr %9, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds %struct.Slot, ptr %183, i64 %185
  %187 = getelementptr inbounds %struct.Slot, ptr %186, i32 0, i32 0
  %188 = load ptr, ptr %187, align 8, !tbaa !23
  %189 = call ptr @glfwSetWindowRefreshCallback(ptr noundef %188, ptr noundef @window_refresh_callback)
  %190 = load ptr, ptr %6, align 8, !tbaa !9
  %191 = load i32, ptr %9, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds %struct.Slot, ptr %190, i64 %192
  %194 = getelementptr inbounds %struct.Slot, ptr %193, i32 0, i32 0
  %195 = load ptr, ptr %194, align 8, !tbaa !23
  %196 = call ptr @glfwSetWindowFocusCallback(ptr noundef %195, ptr noundef @window_focus_callback)
  %197 = load ptr, ptr %6, align 8, !tbaa !9
  %198 = load i32, ptr %9, align 4, !tbaa !5
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds %struct.Slot, ptr %197, i64 %199
  %201 = getelementptr inbounds %struct.Slot, ptr %200, i32 0, i32 0
  %202 = load ptr, ptr %201, align 8, !tbaa !23
  %203 = call ptr @glfwSetWindowIconifyCallback(ptr noundef %202, ptr noundef @window_iconify_callback)
  %204 = load ptr, ptr %6, align 8, !tbaa !9
  %205 = load i32, ptr %9, align 4, !tbaa !5
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds %struct.Slot, ptr %204, i64 %206
  %208 = getelementptr inbounds %struct.Slot, ptr %207, i32 0, i32 0
  %209 = load ptr, ptr %208, align 8, !tbaa !23
  %210 = call ptr @glfwSetWindowMaximizeCallback(ptr noundef %209, ptr noundef @window_maximize_callback)
  %211 = load ptr, ptr %6, align 8, !tbaa !9
  %212 = load i32, ptr %9, align 4, !tbaa !5
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds %struct.Slot, ptr %211, i64 %213
  %215 = getelementptr inbounds %struct.Slot, ptr %214, i32 0, i32 0
  %216 = load ptr, ptr %215, align 8, !tbaa !23
  %217 = call ptr @glfwSetMouseButtonCallback(ptr noundef %216, ptr noundef @mouse_button_callback)
  %218 = load ptr, ptr %6, align 8, !tbaa !9
  %219 = load i32, ptr %9, align 4, !tbaa !5
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds %struct.Slot, ptr %218, i64 %220
  %222 = getelementptr inbounds %struct.Slot, ptr %221, i32 0, i32 0
  %223 = load ptr, ptr %222, align 8, !tbaa !23
  %224 = call ptr @glfwSetCursorPosCallback(ptr noundef %223, ptr noundef @cursor_position_callback)
  %225 = load ptr, ptr %6, align 8, !tbaa !9
  %226 = load i32, ptr %9, align 4, !tbaa !5
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds %struct.Slot, ptr %225, i64 %227
  %229 = getelementptr inbounds %struct.Slot, ptr %228, i32 0, i32 0
  %230 = load ptr, ptr %229, align 8, !tbaa !23
  %231 = call ptr @glfwSetCursorEnterCallback(ptr noundef %230, ptr noundef @cursor_enter_callback)
  %232 = load ptr, ptr %6, align 8, !tbaa !9
  %233 = load i32, ptr %9, align 4, !tbaa !5
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds %struct.Slot, ptr %232, i64 %234
  %236 = getelementptr inbounds %struct.Slot, ptr %235, i32 0, i32 0
  %237 = load ptr, ptr %236, align 8, !tbaa !23
  %238 = call ptr @glfwSetScrollCallback(ptr noundef %237, ptr noundef @scroll_callback)
  %239 = load ptr, ptr %6, align 8, !tbaa !9
  %240 = load i32, ptr %9, align 4, !tbaa !5
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds %struct.Slot, ptr %239, i64 %241
  %243 = getelementptr inbounds %struct.Slot, ptr %242, i32 0, i32 0
  %244 = load ptr, ptr %243, align 8, !tbaa !23
  %245 = call ptr @glfwSetKeyCallback(ptr noundef %244, ptr noundef @key_callback)
  %246 = load ptr, ptr %6, align 8, !tbaa !9
  %247 = load i32, ptr %9, align 4, !tbaa !5
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds %struct.Slot, ptr %246, i64 %248
  %250 = getelementptr inbounds %struct.Slot, ptr %249, i32 0, i32 0
  %251 = load ptr, ptr %250, align 8, !tbaa !23
  %252 = call ptr @glfwSetCharCallback(ptr noundef %251, ptr noundef @char_callback)
  %253 = load ptr, ptr %6, align 8, !tbaa !9
  %254 = load i32, ptr %9, align 4, !tbaa !5
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds %struct.Slot, ptr %253, i64 %255
  %257 = getelementptr inbounds %struct.Slot, ptr %256, i32 0, i32 0
  %258 = load ptr, ptr %257, align 8, !tbaa !23
  %259 = call ptr @glfwSetDropCallback(ptr noundef %258, ptr noundef @drop_callback)
  %260 = load ptr, ptr %6, align 8, !tbaa !9
  %261 = load i32, ptr %9, align 4, !tbaa !5
  %262 = sext i32 %261 to i64
  %263 = getelementptr inbounds %struct.Slot, ptr %260, i64 %262
  %264 = getelementptr inbounds %struct.Slot, ptr %263, i32 0, i32 0
  %265 = load ptr, ptr %264, align 8, !tbaa !23
  call void @glfwMakeContextCurrent(ptr noundef %265)
  %266 = call i32 @gladLoadGL(ptr noundef @glfwGetProcAddress)
  %267 = load ptr, ptr %6, align 8, !tbaa !9
  %268 = load i32, ptr %9, align 4, !tbaa !5
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds %struct.Slot, ptr %267, i64 %269
  %271 = getelementptr inbounds %struct.Slot, ptr %270, i32 0, i32 0
  %272 = load ptr, ptr %271, align 8, !tbaa !23
  call void @glfwSwapBuffers(ptr noundef %272)
  call void @llvm.lifetime.end.p0(i64 128, ptr %14) #6
  br label %273

273:                                              ; preds = %137
  %274 = load i32, ptr %9, align 4, !tbaa !5
  %275 = add nsw i32 %274, 1
  store i32 %275, ptr %9, align 4, !tbaa !5
  br label %68, !llvm.loop !24

276:                                              ; preds = %68
  %277 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  br label %278

278:                                              ; preds = %302, %276
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %279

279:                                              ; preds = %294, %278
  %280 = load i32, ptr %9, align 4, !tbaa !5
  %281 = load i32, ptr %12, align 4, !tbaa !5
  %282 = icmp slt i32 %280, %281
  br i1 %282, label %283, label %297

283:                                              ; preds = %279
  %284 = load ptr, ptr %6, align 8, !tbaa !9
  %285 = load i32, ptr %9, align 4, !tbaa !5
  %286 = sext i32 %285 to i64
  %287 = getelementptr inbounds %struct.Slot, ptr %284, i64 %286
  %288 = getelementptr inbounds %struct.Slot, ptr %287, i32 0, i32 0
  %289 = load ptr, ptr %288, align 8, !tbaa !23
  %290 = call i32 @glfwWindowShouldClose(ptr noundef %289)
  %291 = icmp ne i32 %290, 0
  br i1 %291, label %292, label %293

292:                                              ; preds = %283
  br label %297

293:                                              ; preds = %283
  br label %294

294:                                              ; preds = %293
  %295 = load i32, ptr %9, align 4, !tbaa !5
  %296 = add nsw i32 %295, 1
  store i32 %296, ptr %9, align 4, !tbaa !5
  br label %279, !llvm.loop !25

297:                                              ; preds = %292, %279
  %298 = load i32, ptr %9, align 4, !tbaa !5
  %299 = load i32, ptr %12, align 4, !tbaa !5
  %300 = icmp slt i32 %298, %299
  br i1 %300, label %301, label %302

301:                                              ; preds = %297
  br label %305

302:                                              ; preds = %297
  call void @glfwWaitEvents()
  %303 = load ptr, ptr @stdout, align 8, !tbaa !9
  %304 = call i32 @fflush(ptr noundef %303)
  br label %278

305:                                              ; preds = %301
  %306 = load ptr, ptr %6, align 8, !tbaa !9
  call void @free(ptr noundef %306) #6
  call void @glfwTerminate()
  call void @exit(i32 noundef 0) #7
  unreachable
}

declare ptr @glfwSetErrorCallback(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @error_callback(i32 noundef, ptr noundef) #1

declare i32 @glfwInit() #2

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

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

declare ptr @glfwSetMonitorCallback(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @monitor_callback(ptr noundef, i32 noundef) #1

declare ptr @glfwSetJoystickCallback(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @joystick_callback(i32 noundef, i32 noundef) #1

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

; Function Attrs: nounwind uwtable
declare hidden void @usage() #1

declare ptr @glfwGetPrimaryMonitor() #2

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

declare ptr @glfwGetVideoMode(ptr noundef) #2

declare void @glfwWindowHint(i32 noundef, i32 noundef) #2

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #5

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

declare ptr @glfwGetMonitorName(ptr noundef) #2

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

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

declare void @glfwTerminate() #2

declare void @glfwSetWindowUserPointer(ptr noundef, ptr noundef) #2

declare ptr @glfwSetWindowPosCallback(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @window_pos_callback(ptr noundef, i32 noundef, i32 noundef) #1

declare ptr @glfwSetWindowSizeCallback(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @window_size_callback(ptr noundef, i32 noundef, i32 noundef) #1

declare ptr @glfwSetFramebufferSizeCallback(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @framebuffer_size_callback(ptr noundef, i32 noundef, i32 noundef) #1

declare ptr @glfwSetWindowContentScaleCallback(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @window_content_scale_callback(ptr noundef, float noundef, float noundef) #1

declare ptr @glfwSetWindowCloseCallback(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @window_close_callback(ptr noundef) #1

declare ptr @glfwSetWindowRefreshCallback(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @window_refresh_callback(ptr noundef) #1

declare ptr @glfwSetWindowFocusCallback(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @window_focus_callback(ptr noundef, i32 noundef) #1

declare ptr @glfwSetWindowIconifyCallback(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @window_iconify_callback(ptr noundef, i32 noundef) #1

declare ptr @glfwSetWindowMaximizeCallback(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @window_maximize_callback(ptr noundef, i32 noundef) #1

declare ptr @glfwSetMouseButtonCallback(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @mouse_button_callback(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #1

declare ptr @glfwSetCursorPosCallback(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @cursor_position_callback(ptr noundef, double noundef, double noundef) #1

declare ptr @glfwSetCursorEnterCallback(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @cursor_enter_callback(ptr noundef, i32 noundef) #1

declare ptr @glfwSetScrollCallback(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @scroll_callback(ptr noundef, double noundef, double noundef) #1

declare ptr @glfwSetKeyCallback(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @key_callback(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #1

declare ptr @glfwSetCharCallback(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @char_callback(ptr noundef, i32 noundef) #1

declare ptr @glfwSetDropCallback(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @drop_callback(ptr noundef, i32 noundef, ptr noundef) #1

declare void @glfwMakeContextCurrent(ptr noundef) #2

declare ptr @glfwGetProcAddress(ptr noundef) #2

declare void @glfwSwapBuffers(ptr noundef) #2

declare i32 @glfwWindowShouldClose(ptr noundef) #2

declare void @glfwWaitEvents() #2

declare i32 @fflush(ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 "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 allocsize(0,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 #6 = { nounwind }
attributes #7 = { noreturn nounwind }
attributes #8 = { nounwind allocsize(0,1) }

!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 20}
!14 = !{!"GLFWvidmode", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20}
!15 = !{!14, !6, i64 8}
!16 = !{!14, !6, i64 12}
!17 = !{!14, !6, i64 16}
!18 = !{!14, !6, i64 0}
!19 = !{!14, !6, i64 4}
!20 = !{!21, !6, i64 12}
!21 = !{!"", !10, i64 0, !6, i64 8, !6, i64 12}
!22 = !{!21, !6, i64 8}
!23 = !{!21, !10, i64 0}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}


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

%struct.Slot = type { ptr, i32, i32 }

@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@optarg = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [20 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8

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

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

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

; Function Attrs: noreturn nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca [128 x i8], align 16
  %4 = tail call ptr @glfwSetErrorCallback(ptr noundef nonnull @error_callback) #9
  %5 = tail call i32 @glfwInit() #9
  %.not = icmp eq i32 %5, 0
  br i1 %.not, label %6, label %7

6:                                                ; preds = %2
  tail call void @exit(i32 noundef 1) #10
  unreachable

7:                                                ; preds = %2
  %8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %9 = tail call ptr @glfwSetMonitorCallback(ptr noundef nonnull @monitor_callback) #9
  %10 = tail call ptr @glfwSetJoystickCallback(ptr noundef nonnull @joystick_callback) #9
  br label %.outer

.outer:                                           ; preds = %16, %7
  %.087.ph = phi i32 [ %19, %16 ], [ 1, %7 ]
  %.0.ph = phi ptr [ %.0, %16 ], [ null, %7 ]
  br label %11

11:                                               ; preds = %.outer, %14
  %.0 = phi ptr [ %15, %14 ], [ %.0.ph, %.outer ]
  %12 = tail call i32 @getopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str.2) #9
  switch i32 %12, label %20 [
    i32 -1, label %21
    i32 104, label %13
    i32 102, label %14
    i32 110, label %16
  ]

13:                                               ; preds = %11
  tail call void @usage()
  tail call void @exit(i32 noundef 0) #10
  unreachable

14:                                               ; preds = %11
  %15 = tail call ptr @glfwGetPrimaryMonitor() #9
  br label %11, !llvm.loop !5

16:                                               ; preds = %11
  %17 = load ptr, ptr @optarg, align 8, !tbaa !7
  %18 = tail call i64 @strtoul(ptr nocapture noundef %17, ptr noundef null, i32 noundef 10) #9
  %19 = trunc i64 %18 to i32
  br label %.outer, !llvm.loop !5

20:                                               ; preds = %11
  tail call void @usage()
  tail call void @exit(i32 noundef 1) #10
  unreachable

21:                                               ; preds = %11
  %.not96 = icmp eq ptr %.0, null
  br i1 %.not96, label %35, label %22

22:                                               ; preds = %21
  %23 = tail call ptr @glfwGetVideoMode(ptr noundef nonnull %.0) #9
  %24 = getelementptr inbounds i8, ptr %23, i64 20
  %25 = load i32, ptr %24, align 4, !tbaa !11
  tail call void @glfwWindowHint(i32 noundef 135183, i32 noundef %25) #9
  %26 = getelementptr inbounds i8, ptr %23, i64 8
  %27 = load i32, ptr %26, align 4, !tbaa !14
  tail call void @glfwWindowHint(i32 noundef 135169, i32 noundef %27) #9
  %28 = getelementptr inbounds i8, ptr %23, i64 12
  %29 = load i32, ptr %28, align 4, !tbaa !15
  tail call void @glfwWindowHint(i32 noundef 135170, i32 noundef %29) #9
  %30 = getelementptr inbounds i8, ptr %23, i64 16
  %31 = load i32, ptr %30, align 4, !tbaa !16
  tail call void @glfwWindowHint(i32 noundef 135171, i32 noundef %31) #9
  %32 = load i32, ptr %23, align 4, !tbaa !17
  %33 = getelementptr inbounds i8, ptr %23, i64 4
  %34 = load i32, ptr %33, align 4, !tbaa !18
  br label %35

35:                                               ; preds = %21, %22
  %.090 = phi i32 [ %32, %22 ], [ 640, %21 ]
  %.089 = phi i32 [ %34, %22 ], [ 480, %21 ]
  %36 = sext i32 %.087.ph to i64
  %37 = tail call noalias ptr @calloc(i64 noundef %36, i64 noundef 16) #11
  %38 = icmp sgt i32 %.087.ph, 0
  br i1 %38, label %.lr.ph.preheader, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %35
  %39 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  br label %.critedge.preheader

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

.lr.ph:                                           ; preds = %.lr.ph.preheader, %54
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %54 ]
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %3) #9
  %40 = getelementptr inbounds %struct.Slot, ptr %37, i64 %indvars.iv
  %41 = getelementptr inbounds i8, ptr %40, i64 12
  store i32 1, ptr %41, align 4, !tbaa !19
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %42 = getelementptr inbounds i8, ptr %40, i64 8
  %43 = trunc nuw nsw i64 %indvars.iv.next to i32
  store i32 %43, ptr %42, align 8, !tbaa !21
  %44 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %3, i64 noundef 128, ptr noundef nonnull @.str.3, i32 noundef %43) #9
  %45 = load i32, ptr %42, align 8, !tbaa !21
  br i1 %.not96, label %49, label %46

46:                                               ; preds = %.lr.ph
  %47 = call ptr @glfwGetMonitorName(ptr noundef nonnull %.0) #9
  %48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %45, i32 noundef %.090, i32 noundef %.089, ptr noundef %47)
  br label %51

49:                                               ; preds = %.lr.ph
  %50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %45, i32 noundef %.090, i32 noundef %.089)
  br label %51

51:                                               ; preds = %49, %46
  %52 = call ptr @glfwCreateWindow(i32 noundef %.090, i32 noundef %.089, ptr noundef nonnull %3, ptr noundef %.0, ptr noundef null) #9
  store ptr %52, ptr %40, align 8, !tbaa !22
  %.not98 = icmp eq ptr %52, null
  br i1 %.not98, label %53, label %54

53:                                               ; preds = %51
  call void @free(ptr noundef nonnull %37) #9
  call void @glfwTerminate() #9
  call void @exit(i32 noundef 1) #10
  unreachable

54:                                               ; preds = %51
  call void @glfwSetWindowUserPointer(ptr noundef nonnull %52, ptr noundef nonnull %40) #9
  %55 = load ptr, ptr %40, align 8, !tbaa !22
  %56 = call ptr @glfwSetWindowPosCallback(ptr noundef %55, ptr noundef nonnull @window_pos_callback) #9
  %57 = load ptr, ptr %40, align 8, !tbaa !22
  %58 = call ptr @glfwSetWindowSizeCallback(ptr noundef %57, ptr noundef nonnull @window_size_callback) #9
  %59 = load ptr, ptr %40, align 8, !tbaa !22
  %60 = call ptr @glfwSetFramebufferSizeCallback(ptr noundef %59, ptr noundef nonnull @framebuffer_size_callback) #9
  %61 = load ptr, ptr %40, align 8, !tbaa !22
  %62 = call ptr @glfwSetWindowContentScaleCallback(ptr noundef %61, ptr noundef nonnull @window_content_scale_callback) #9
  %63 = load ptr, ptr %40, align 8, !tbaa !22
  %64 = call ptr @glfwSetWindowCloseCallback(ptr noundef %63, ptr noundef nonnull @window_close_callback) #9
  %65 = load ptr, ptr %40, align 8, !tbaa !22
  %66 = call ptr @glfwSetWindowRefreshCallback(ptr noundef %65, ptr noundef nonnull @window_refresh_callback) #9
  %67 = load ptr, ptr %40, align 8, !tbaa !22
  %68 = call ptr @glfwSetWindowFocusCallback(ptr noundef %67, ptr noundef nonnull @window_focus_callback) #9
  %69 = load ptr, ptr %40, align 8, !tbaa !22
  %70 = call ptr @glfwSetWindowIconifyCallback(ptr noundef %69, ptr noundef nonnull @window_iconify_callback) #9
  %71 = load ptr, ptr %40, align 8, !tbaa !22
  %72 = call ptr @glfwSetWindowMaximizeCallback(ptr noundef %71, ptr noundef nonnull @window_maximize_callback) #9
  %73 = load ptr, ptr %40, align 8, !tbaa !22
  %74 = call ptr @glfwSetMouseButtonCallback(ptr noundef %73, ptr noundef nonnull @mouse_button_callback) #9
  %75 = load ptr, ptr %40, align 8, !tbaa !22
  %76 = call ptr @glfwSetCursorPosCallback(ptr noundef %75, ptr noundef nonnull @cursor_position_callback) #9
  %77 = load ptr, ptr %40, align 8, !tbaa !22
  %78 = call ptr @glfwSetCursorEnterCallback(ptr noundef %77, ptr noundef nonnull @cursor_enter_callback) #9
  %79 = load ptr, ptr %40, align 8, !tbaa !22
  %80 = call ptr @glfwSetScrollCallback(ptr noundef %79, ptr noundef nonnull @scroll_callback) #9
  %81 = load ptr, ptr %40, align 8, !tbaa !22
  %82 = call ptr @glfwSetKeyCallback(ptr noundef %81, ptr noundef nonnull @key_callback) #9
  %83 = load ptr, ptr %40, align 8, !tbaa !22
  %84 = call ptr @glfwSetCharCallback(ptr noundef %83, ptr noundef nonnull @char_callback) #9
  %85 = load ptr, ptr %40, align 8, !tbaa !22
  %86 = call ptr @glfwSetDropCallback(ptr noundef %85, ptr noundef nonnull @drop_callback) #9
  %87 = load ptr, ptr %40, align 8, !tbaa !22
  call void @glfwMakeContextCurrent(ptr noundef %87) #9
  %88 = call i32 @gladLoadGL(ptr noundef nonnull @glfwGetProcAddress)
  %89 = load ptr, ptr %40, align 8, !tbaa !22
  call void @glfwSwapBuffers(ptr noundef %89) #9
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %3) #9
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !23

._crit_edge:                                      ; preds = %54
  %90 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  br i1 %38, label %.lr.ph106.us.preheader, label %.critedge.preheader

.critedge.preheader:                              ; preds = %._crit_edge.thread, %._crit_edge
  br label %.critedge

.lr.ph106.us.preheader:                           ; preds = %._crit_edge
  %wide.trip.count117 = zext nneg i32 %.087.ph to i64
  br label %.lr.ph106.us

91:                                               ; preds = %.lr.ph106.us
  %indvars.iv.next115 = add nuw nsw i64 %indvars.iv114, 1
  %exitcond118.not = icmp eq i64 %indvars.iv.next115, %wide.trip.count117
  br i1 %exitcond118.not, label %..critedge_crit_edge.us, label %.lr.ph106.us.backedge

.lr.ph106.us.backedge:                            ; preds = %91, %..critedge_crit_edge.us
  %indvars.iv114.be = phi i64 [ %indvars.iv.next115, %91 ], [ 0, %..critedge_crit_edge.us ]
  br label %.lr.ph106.us, !llvm.loop !24

.lr.ph106.us:                                     ; preds = %.lr.ph106.us.backedge, %.lr.ph106.us.preheader
  %indvars.iv114 = phi i64 [ 0, %.lr.ph106.us.preheader ], [ %indvars.iv114.be, %.lr.ph106.us.backedge ]
  %92 = getelementptr inbounds %struct.Slot, ptr %37, i64 %indvars.iv114
  %93 = load ptr, ptr %92, align 8, !tbaa !22
  %94 = call i32 @glfwWindowShouldClose(ptr noundef %93) #9
  %.not97.us = icmp eq i32 %94, 0
  br i1 %.not97.us, label %91, label %.split108.us

..critedge_crit_edge.us:                          ; preds = %91
  call void @glfwWaitEvents() #9
  %95 = load ptr, ptr @stdout, align 8, !tbaa !7
  %96 = call i32 @fflush(ptr noundef %95)
  br label %.lr.ph106.us.backedge

.critedge:                                        ; preds = %.critedge.preheader, %.critedge
  call void @glfwWaitEvents() #9
  %97 = load ptr, ptr @stdout, align 8, !tbaa !7
  %98 = call i32 @fflush(ptr noundef %97)
  br label %.critedge

.split108.us:                                     ; preds = %.lr.ph106.us
  call void @free(ptr noundef nonnull %37) #9
  call void @glfwTerminate() #9
  call void @exit(i32 noundef 0) #10
  unreachable
}

declare ptr @glfwSetErrorCallback(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @error_callback(i32 noundef, ptr noundef) #1

declare i32 @glfwInit() local_unnamed_addr #3

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

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

declare ptr @glfwSetMonitorCallback(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @monitor_callback(ptr noundef, i32 noundef) #1

declare ptr @glfwSetJoystickCallback(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @joystick_callback(i32 noundef, i32 noundef) #1

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

; Function Attrs: nounwind uwtable
declare hidden void @usage() local_unnamed_addr #1

declare ptr @glfwGetPrimaryMonitor() local_unnamed_addr #3

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

declare ptr @glfwGetVideoMode(ptr noundef) local_unnamed_addr #3

declare void @glfwWindowHint(i32 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #7

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

declare ptr @glfwGetMonitorName(ptr noundef) local_unnamed_addr #3

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

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

declare void @glfwTerminate() local_unnamed_addr #3

declare void @glfwSetWindowUserPointer(ptr noundef, ptr noundef) local_unnamed_addr #3

declare ptr @glfwSetWindowPosCallback(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @window_pos_callback(ptr noundef, i32 noundef, i32 noundef) #1

declare ptr @glfwSetWindowSizeCallback(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @window_size_callback(ptr noundef, i32 noundef, i32 noundef) #1

declare ptr @glfwSetFramebufferSizeCallback(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @framebuffer_size_callback(ptr noundef, i32 noundef, i32 noundef) #1

declare ptr @glfwSetWindowContentScaleCallback(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @window_content_scale_callback(ptr noundef, float noundef, float noundef) #1

declare ptr @glfwSetWindowCloseCallback(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @window_close_callback(ptr noundef) #1

declare ptr @glfwSetWindowRefreshCallback(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @window_refresh_callback(ptr noundef) #1

declare ptr @glfwSetWindowFocusCallback(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @window_focus_callback(ptr noundef, i32 noundef) #1

declare ptr @glfwSetWindowIconifyCallback(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @window_iconify_callback(ptr noundef, i32 noundef) #1

declare ptr @glfwSetWindowMaximizeCallback(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @window_maximize_callback(ptr noundef, i32 noundef) #1

declare ptr @glfwSetMouseButtonCallback(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @mouse_button_callback(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #1

declare ptr @glfwSetCursorPosCallback(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @cursor_position_callback(ptr noundef, double noundef, double noundef) #1

declare ptr @glfwSetCursorEnterCallback(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @cursor_enter_callback(ptr noundef, i32 noundef) #1

declare ptr @glfwSetScrollCallback(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @scroll_callback(ptr noundef, double noundef, double noundef) #1

declare ptr @glfwSetKeyCallback(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @key_callback(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #1

declare ptr @glfwSetCharCallback(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @char_callback(ptr noundef, i32 noundef) #1

declare ptr @glfwSetDropCallback(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @drop_callback(ptr noundef, i32 noundef, ptr noundef) #1

declare void @glfwMakeContextCurrent(ptr noundef) local_unnamed_addr #3

declare ptr @glfwGetProcAddress(ptr noundef) #3

declare void @glfwSwapBuffers(ptr noundef) local_unnamed_addr #3

declare i32 @glfwWindowShouldClose(ptr noundef) local_unnamed_addr #3

declare void @glfwWaitEvents() local_unnamed_addr #3

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { noreturn 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 #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { 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 #6 = { 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 #7 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nounwind }
attributes #10 = { noreturn nounwind }
attributes #11 = { nounwind allocsize(0,1) }

!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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!12, !13, i64 20}
!12 = !{!"GLFWvidmode", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!13 = !{!"int", !9, i64 0}
!14 = !{!12, !13, i64 8}
!15 = !{!12, !13, i64 12}
!16 = !{!12, !13, i64 16}
!17 = !{!12, !13, i64 0}
!18 = !{!12, !13, i64 4}
!19 = !{!20, !13, i64 12}
!20 = !{!"", !8, i64 0, !13, i64 8, !13, i64 12}
!21 = !{!20, !13, i64 8}
!22 = !{!20, !8, i64 0}
!23 = distinct !{!23, !6}
!24 = distinct !{!24, !6}


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