; LLVM IR from unitreerobotics/kinect_teleoperate :: src/extern/glfw/src/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 = %279, %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 %282

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

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

282:                                              ; preds = %68
  %283 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  br label %284

284:                                              ; preds = %308, %282
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %285

285:                                              ; preds = %300, %284
  %286 = load i32, ptr %9, align 4, !tbaa !5
  %287 = load i32, ptr %12, align 4, !tbaa !5
  %288 = icmp slt i32 %286, %287
  br i1 %288, label %289, label %303

289:                                              ; preds = %285
  %290 = load ptr, ptr %6, align 8, !tbaa !9
  %291 = load i32, ptr %9, align 4, !tbaa !5
  %292 = sext i32 %291 to i64
  %293 = getelementptr inbounds %struct.Slot, ptr %290, i64 %292
  %294 = getelementptr inbounds %struct.Slot, ptr %293, i32 0, i32 0
  %295 = load ptr, ptr %294, align 8, !tbaa !23
  %296 = call i32 @glfwWindowShouldClose(ptr noundef %295)
  %297 = icmp ne i32 %296, 0
  br i1 %297, label %298, label %299

298:                                              ; preds = %289
  br label %303

299:                                              ; preds = %289
  br label %300

300:                                              ; preds = %299
  %301 = load i32, ptr %9, align 4, !tbaa !5
  %302 = add nsw i32 %301, 1
  store i32 %302, ptr %9, align 4, !tbaa !5
  br label %285, !llvm.loop !25

303:                                              ; preds = %298, %285
  %304 = load i32, ptr %9, align 4, !tbaa !5
  %305 = load i32, ptr %12, align 4, !tbaa !5
  %306 = icmp slt i32 %304, %305
  br i1 %306, label %307, label %308

307:                                              ; preds = %303
  br label %311

308:                                              ; preds = %303
  call void @glfwWaitEvents()
  %309 = load ptr, ptr @stdout, align 8, !tbaa !9
  %310 = call i32 @fflush(ptr noundef %309)
  br label %284

311:                                              ; preds = %307
  %312 = load ptr, ptr %6, align 8, !tbaa !9
  call void @free(ptr noundef %312) #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 @glfwSetInputMode(ptr noundef, i32 noundef, i32 noundef) #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
  %.089.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
  %.not98 = icmp eq ptr %.0, null
  br i1 %.not98, 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
  %.092 = phi i32 [ %32, %22 ], [ 640, %21 ]
  %.091 = phi i32 [ %34, %22 ], [ 480, %21 ]
  %36 = sext i32 %.089.ph to i64
  %37 = tail call noalias ptr @calloc(i64 noundef %36, i64 noundef 16) #11
  %38 = icmp sgt i32 %.089.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 %.089.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 %.not98, 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 %.092, i32 noundef %.091, 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 %.092, i32 noundef %.091)
  br label %51

51:                                               ; preds = %49, %46
  %52 = call ptr @glfwCreateWindow(i32 noundef %.092, i32 noundef %.091, ptr noundef nonnull %3, ptr noundef %.0, ptr noundef null) #9
  store ptr %52, ptr %40, align 8, !tbaa !22
  %.not100 = icmp eq ptr %52, null
  br i1 %.not100, 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 @glfwSetInputMode(ptr noundef nonnull %52, i32 noundef 208902, i32 noundef 1) #9
  %55 = load ptr, ptr %40, align 8, !tbaa !22
  call void @glfwSetWindowUserPointer(ptr noundef %55, ptr noundef nonnull %40) #9
  %56 = load ptr, ptr %40, align 8, !tbaa !22
  %57 = call ptr @glfwSetWindowPosCallback(ptr noundef %56, ptr noundef nonnull @window_pos_callback) #9
  %58 = load ptr, ptr %40, align 8, !tbaa !22
  %59 = call ptr @glfwSetWindowSizeCallback(ptr noundef %58, ptr noundef nonnull @window_size_callback) #9
  %60 = load ptr, ptr %40, align 8, !tbaa !22
  %61 = call ptr @glfwSetFramebufferSizeCallback(ptr noundef %60, ptr noundef nonnull @framebuffer_size_callback) #9
  %62 = load ptr, ptr %40, align 8, !tbaa !22
  %63 = call ptr @glfwSetWindowContentScaleCallback(ptr noundef %62, ptr noundef nonnull @window_content_scale_callback) #9
  %64 = load ptr, ptr %40, align 8, !tbaa !22
  %65 = call ptr @glfwSetWindowCloseCallback(ptr noundef %64, ptr noundef nonnull @window_close_callback) #9
  %66 = load ptr, ptr %40, align 8, !tbaa !22
  %67 = call ptr @glfwSetWindowRefreshCallback(ptr noundef %66, ptr noundef nonnull @window_refresh_callback) #9
  %68 = load ptr, ptr %40, align 8, !tbaa !22
  %69 = call ptr @glfwSetWindowFocusCallback(ptr noundef %68, ptr noundef nonnull @window_focus_callback) #9
  %70 = load ptr, ptr %40, align 8, !tbaa !22
  %71 = call ptr @glfwSetWindowIconifyCallback(ptr noundef %70, ptr noundef nonnull @window_iconify_callback) #9
  %72 = load ptr, ptr %40, align 8, !tbaa !22
  %73 = call ptr @glfwSetWindowMaximizeCallback(ptr noundef %72, ptr noundef nonnull @window_maximize_callback) #9
  %74 = load ptr, ptr %40, align 8, !tbaa !22
  %75 = call ptr @glfwSetMouseButtonCallback(ptr noundef %74, ptr noundef nonnull @mouse_button_callback) #9
  %76 = load ptr, ptr %40, align 8, !tbaa !22
  %77 = call ptr @glfwSetCursorPosCallback(ptr noundef %76, ptr noundef nonnull @cursor_position_callback) #9
  %78 = load ptr, ptr %40, align 8, !tbaa !22
  %79 = call ptr @glfwSetCursorEnterCallback(ptr noundef %78, ptr noundef nonnull @cursor_enter_callback) #9
  %80 = load ptr, ptr %40, align 8, !tbaa !22
  %81 = call ptr @glfwSetScrollCallback(ptr noundef %80, ptr noundef nonnull @scroll_callback) #9
  %82 = load ptr, ptr %40, align 8, !tbaa !22
  %83 = call ptr @glfwSetKeyCallback(ptr noundef %82, ptr noundef nonnull @key_callback) #9
  %84 = load ptr, ptr %40, align 8, !tbaa !22
  %85 = call ptr @glfwSetCharCallback(ptr noundef %84, ptr noundef nonnull @char_callback) #9
  %86 = load ptr, ptr %40, align 8, !tbaa !22
  %87 = call ptr @glfwSetDropCallback(ptr noundef %86, ptr noundef nonnull @drop_callback) #9
  %88 = load ptr, ptr %40, align 8, !tbaa !22
  call void @glfwMakeContextCurrent(ptr noundef %88) #9
  %89 = call i32 @gladLoadGL(ptr noundef nonnull @glfwGetProcAddress)
  %90 = load ptr, ptr %40, align 8, !tbaa !22
  call void @glfwSwapBuffers(ptr noundef %90) #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
  %91 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  br i1 %38, label %.lr.ph108.us.preheader, label %.critedge.preheader

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

.lr.ph108.us.preheader:                           ; preds = %._crit_edge
  %wide.trip.count119 = zext nneg i32 %.089.ph to i64
  br label %.lr.ph108.us

92:                                               ; preds = %.lr.ph108.us
  %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
  %exitcond120.not = icmp eq i64 %indvars.iv.next117, %wide.trip.count119
  br i1 %exitcond120.not, label %..critedge_crit_edge.us, label %.lr.ph108.us.backedge

.lr.ph108.us.backedge:                            ; preds = %92, %..critedge_crit_edge.us
  %indvars.iv116.be = phi i64 [ %indvars.iv.next117, %92 ], [ 0, %..critedge_crit_edge.us ]
  br label %.lr.ph108.us, !llvm.loop !24

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

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

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

.split110.us:                                     ; preds = %.lr.ph108.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 @glfwSetInputMode(ptr noundef, i32 noundef, i32 noundef) 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