; LLVM IR from unitreerobotics/kinect_teleoperate :: src/extern/glfw/src/tests (joysticks)

; 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.nk_rect = type { float, float, float, float }
%struct.GLFWgamepadstate = type { [15 x i8], [6 x float] }

@glad_glClear = external dso_local global ptr, align 8
@joysticks = external hidden global [16 x i32], align 16
@.str.140 = external hidden unnamed_addr constant [14 x i8], align 1
@window = external hidden global ptr, align 8
@joystick_count = external hidden global i32, align 4
@.str.141 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.142 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.143 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.144 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.145 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.146 = external hidden unnamed_addr constant [3 x i8], align 1
@__const.main.names = external hidden unnamed_addr constant [11 x ptr], align 16
@.str.158 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.159 = external hidden unnamed_addr constant [32 x i8], align 1

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

; 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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: nounwind uwtable
declare dso_local { <2 x float>, <2 x float> } @nk_rect(float noundef, float noundef, float noundef, float noundef) #1

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @nk_begin(ptr noundef, ptr noundef, <2 x float>, <2 x float>, i32 noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local void @nk_end(ptr noundef) #1

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

; Function Attrs: nounwind uwtable
declare dso_local void @nk_layout_row_dynamic(ptr noundef, float noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @nk_labelf(ptr noundef, i32 noundef, ptr noundef, ...) #1

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local float @nk_slide_float(ptr noundef, float noundef, float noundef, float noundef, float noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @nk_glfw3_render(i32 noundef) #1

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

; Function Attrs: nounwind uwtable
declare dso_local void @nk_glfw3_font_stash_begin(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @nk_glfw3_font_stash_end() #1

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

declare void @glfwGetWindowSize(ptr noundef, ptr noundef, ptr noundef) #5

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #4 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %struct.nk_rect, align 4
  %10 = alloca %struct.nk_rect, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca %struct.GLFWgamepadstate, align 4
  %19 = alloca [16 x i8], align 16
  %20 = alloca i32, align 4
  %21 = alloca [11 x ptr], align 16
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  call void @llvm.memset.p0.i64(ptr align 16 @joysticks, i8 0, i64 64, i1 false)
  %22 = call ptr @glfwSetErrorCallback(ptr noundef @error_callback)
  %23 = call i32 @glfwInit()
  %24 = icmp ne i32 %23, 0
  br i1 %24, label %26, label %25

25:                                               ; preds = %0
  call void @exit(i32 noundef 1) #9
  unreachable

26:                                               ; preds = %0
  call void @glfwWindowHint(i32 noundef 139276, i32 noundef 1)
  call void @glfwWindowHint(i32 noundef 151553, i32 noundef 1)
  %27 = call ptr @glfwCreateWindow(i32 noundef 800, i32 noundef 600, ptr noundef @.str.140, ptr noundef null, ptr noundef null)
  store ptr %27, ptr @window, align 8, !tbaa !9
  %28 = load ptr, ptr @window, align 8, !tbaa !9
  %29 = icmp ne ptr %28, null
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  call void @glfwTerminate()
  call void @exit(i32 noundef 1) #9
  unreachable

31:                                               ; preds = %26
  %32 = load ptr, ptr @window, align 8, !tbaa !9
  call void @glfwMakeContextCurrent(ptr noundef %32)
  %33 = call i32 @gladLoadGL(ptr noundef @glfwGetProcAddress)
  call void @glfwSwapInterval(i32 noundef 1)
  %34 = load ptr, ptr @window, align 8, !tbaa !9
  %35 = call ptr @nk_glfw3_init(ptr noundef %34, i32 noundef 1)
  store ptr %35, ptr %4, align 8, !tbaa !9
  call void @nk_glfw3_font_stash_begin(ptr noundef %5)
  call void @nk_glfw3_font_stash_end()
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %50, %31
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = icmp sle i32 %37, 15
  br i1 %38, label %39, label %53

39:                                               ; preds = %36
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = call i32 @glfwJoystickPresent(i32 noundef %40)
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %43, label %49

43:                                               ; preds = %39
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = load i32, ptr @joystick_count, align 4, !tbaa !5
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr @joystick_count, align 4, !tbaa !5
  %47 = sext i32 %45 to i64
  %48 = getelementptr inbounds [16 x i32], ptr @joysticks, i64 0, i64 %47
  store i32 %44, ptr %48, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %43, %39
  br label %50

50:                                               ; preds = %49
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %2, align 4, !tbaa !5
  br label %36, !llvm.loop !11

53:                                               ; preds = %36
  %54 = call ptr @glfwSetJoystickCallback(ptr noundef @joystick_callback)
  %55 = load ptr, ptr @window, align 8, !tbaa !9
  %56 = call ptr @glfwSetDropCallback(ptr noundef %55, ptr noundef @drop_callback)
  br label %57

57:                                               ; preds = %329, %53
  %58 = load ptr, ptr @window, align 8, !tbaa !9
  %59 = call i32 @glfwWindowShouldClose(ptr noundef %58)
  %60 = icmp ne i32 %59, 0
  %61 = xor i1 %60, true
  br i1 %61, label %62, label %331

62:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  %63 = load ptr, ptr @window, align 8, !tbaa !9
  call void @glfwGetWindowSize(ptr noundef %63, ptr noundef %7, ptr noundef %8)
  %64 = load ptr, ptr @glad_glClear, align 8, !tbaa !9
  call void %64(i32 noundef 16384)
  call void @nk_glfw3_new_frame()
  %65 = load ptr, ptr %4, align 8, !tbaa !9
  %66 = load i32, ptr %7, align 4, !tbaa !5
  %67 = sitofp i32 %66 to float
  %68 = fsub float %67, 2.000000e+02
  %69 = load i32, ptr %8, align 4, !tbaa !5
  %70 = sitofp i32 %69 to float
  %71 = call { <2 x float>, <2 x float> } @nk_rect(float noundef %68, float noundef 0.000000e+00, float noundef 2.000000e+02, float noundef %70)
  %72 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %9, i32 0, i32 0
  %73 = extractvalue { <2 x float>, <2 x float> } %71, 0
  store <2 x float> %73, ptr %72, align 4
  %74 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %9, i32 0, i32 1
  %75 = extractvalue { <2 x float>, <2 x float> } %71, 1
  store <2 x float> %75, ptr %74, align 4
  %76 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %9, i32 0, i32 0
  %77 = load <2 x float>, ptr %76, align 4
  %78 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %9, i32 0, i32 1
  %79 = load <2 x float>, ptr %78, align 4
  %80 = call i32 @nk_begin(ptr noundef %65, ptr noundef @.str.141, <2 x float> %77, <2 x float> %79, i32 noundef 80)
  %81 = icmp ne i32 %80, 0
  br i1 %81, label %82, label %117

82:                                               ; preds = %62
  %83 = load ptr, ptr %4, align 8, !tbaa !9
  call void @nk_layout_row_dynamic(ptr noundef %83, float noundef 3.000000e+01, i32 noundef 1)
  %84 = load ptr, ptr %4, align 8, !tbaa !9
  %85 = call i32 @nk_checkbox_label(ptr noundef %84, ptr noundef @.str.142, ptr noundef %3)
  %86 = load i32, ptr @joystick_count, align 4, !tbaa !5
  %87 = icmp ne i32 %86, 0
  br i1 %87, label %88, label %114

88:                                               ; preds = %82
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %110, %88
  %90 = load i32, ptr %6, align 4, !tbaa !5
  %91 = load i32, ptr @joystick_count, align 4, !tbaa !5
  %92 = icmp slt i32 %90, %91
  br i1 %92, label %93, label %113

93:                                               ; preds = %89
  %94 = load ptr, ptr %4, align 8, !tbaa !9
  %95 = load i32, ptr %6, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [16 x i32], ptr @joysticks, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = call ptr @joystick_label(i32 noundef %98)
  %100 = call i32 @nk_button_label(ptr noundef %94, ptr noundef %99)
  %101 = icmp ne i32 %100, 0
  br i1 %101, label %102, label %109

102:                                              ; preds = %93
  %103 = load ptr, ptr %4, align 8, !tbaa !9
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [16 x i32], ptr @joysticks, i64 0, i64 %105
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = call ptr @joystick_label(i32 noundef %107)
  call void @nk_window_set_focus(ptr noundef %103, ptr noundef %108)
  br label %109

109:                                              ; preds = %102, %93
  br label %110

110:                                              ; preds = %109
  %111 = load i32, ptr %6, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %6, align 4, !tbaa !5
  br label %89, !llvm.loop !13

113:                                              ; preds = %89
  br label %116

114:                                              ; preds = %82
  %115 = load ptr, ptr %4, align 8, !tbaa !9
  call void @nk_label(ptr noundef %115, ptr noundef @.str.143, i32 noundef 17)
  br label %116

116:                                              ; preds = %114, %113
  br label %117

117:                                              ; preds = %116, %62
  %118 = load ptr, ptr %4, align 8, !tbaa !9
  call void @nk_end(ptr noundef %118)
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %119

119:                                              ; preds = %326, %117
  %120 = load i32, ptr %6, align 4, !tbaa !5
  %121 = load i32, ptr @joystick_count, align 4, !tbaa !5
  %122 = icmp slt i32 %120, %121
  br i1 %122, label %123, label %329

123:                                              ; preds = %119
  %124 = load ptr, ptr %4, align 8, !tbaa !9
  %125 = load i32, ptr %6, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [16 x i32], ptr @joysticks, i64 0, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %129 = call ptr @joystick_label(i32 noundef %128)
  %130 = load i32, ptr %6, align 4, !tbaa !5
  %131 = sitofp i32 %130 to float
  %132 = fmul float %131, 2.000000e+01
  %133 = load i32, ptr %6, align 4, !tbaa !5
  %134 = sitofp i32 %133 to float
  %135 = fmul float %134, 2.000000e+01
  %136 = call { <2 x float>, <2 x float> } @nk_rect(float noundef %132, float noundef %135, float noundef 5.500000e+02, float noundef 5.700000e+02)
  %137 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %10, i32 0, i32 0
  %138 = extractvalue { <2 x float>, <2 x float> } %136, 0
  store <2 x float> %138, ptr %137, align 4
  %139 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %10, i32 0, i32 1
  %140 = extractvalue { <2 x float>, <2 x float> } %136, 1
  store <2 x float> %140, ptr %139, align 4
  %141 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %10, i32 0, i32 0
  %142 = load <2 x float>, ptr %141, align 4
  %143 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %10, i32 0, i32 1
  %144 = load <2 x float>, ptr %143, align 4
  %145 = call i32 @nk_begin(ptr noundef %124, ptr noundef %129, <2 x float> %142, <2 x float> %144, i32 noundef 87)
  %146 = icmp ne i32 %145, 0
  br i1 %146, label %147, label %324

147:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.start.p0(i64 40, ptr %18) #8
  %148 = load ptr, ptr %4, align 8, !tbaa !9
  call void @nk_layout_row_dynamic(ptr noundef %148, float noundef 3.000000e+01, i32 noundef 1)
  %149 = load ptr, ptr %4, align 8, !tbaa !9
  %150 = load i32, ptr %6, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [16 x i32], ptr @joysticks, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = call ptr @glfwGetJoystickGUID(i32 noundef %153)
  call void (ptr, i32, ptr, ...) @nk_labelf(ptr noundef %149, i32 noundef 17, ptr noundef @.str.144, ptr noundef %154)
  %155 = load ptr, ptr %4, align 8, !tbaa !9
  call void @nk_label(ptr noundef %155, ptr noundef @.str.145, i32 noundef 17)
  %156 = load i32, ptr %6, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [16 x i32], ptr @joysticks, i64 0, i64 %157
  %159 = load i32, ptr %158, align 4, !tbaa !5
  %160 = call ptr @glfwGetJoystickAxes(i32 noundef %159, ptr noundef %12)
  store ptr %160, ptr %15, align 8, !tbaa !9
  %161 = load i32, ptr %6, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [16 x i32], ptr @joysticks, i64 0, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = call ptr @glfwGetJoystickButtons(i32 noundef %164, ptr noundef %13)
  store ptr %165, ptr %16, align 8, !tbaa !9
  %166 = load i32, ptr %6, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [16 x i32], ptr @joysticks, i64 0, i64 %167
  %169 = load i32, ptr %168, align 4, !tbaa !5
  %170 = call ptr @glfwGetJoystickHats(i32 noundef %169, ptr noundef %14)
  store ptr %170, ptr %17, align 8, !tbaa !9
  %171 = load i32, ptr %3, align 4, !tbaa !5
  %172 = icmp ne i32 %171, 0
  br i1 %172, label %178, label %173

173:                                              ; preds = %147
  %174 = load i32, ptr %14, align 4, !tbaa !5
  %175 = mul nsw i32 %174, 4
  %176 = load i32, ptr %13, align 4, !tbaa !5
  %177 = sub nsw i32 %176, %175
  store i32 %177, ptr %13, align 4, !tbaa !5
  br label %178

178:                                              ; preds = %173, %147
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %179

179:                                              ; preds = %191, %178
  %180 = load i32, ptr %11, align 4, !tbaa !5
  %181 = load i32, ptr %12, align 4, !tbaa !5
  %182 = icmp slt i32 %180, %181
  br i1 %182, label %183, label %194

183:                                              ; preds = %179
  %184 = load ptr, ptr %4, align 8, !tbaa !9
  %185 = load ptr, ptr %15, align 8, !tbaa !9
  %186 = load i32, ptr %11, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds float, ptr %185, i64 %187
  %189 = load float, ptr %188, align 4, !tbaa !14
  %190 = call float @nk_slide_float(ptr noundef %184, float noundef -1.000000e+00, float noundef %189, float noundef 1.000000e+00, float noundef 0x3FB99999A0000000)
  br label %191

191:                                              ; preds = %183
  %192 = load i32, ptr %11, align 4, !tbaa !5
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %11, align 4, !tbaa !5
  br label %179, !llvm.loop !16

194:                                              ; preds = %179
  %195 = load ptr, ptr %4, align 8, !tbaa !9
  call void @nk_layout_row_dynamic(ptr noundef %195, float noundef 3.000000e+01, i32 noundef 12)
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %196

196:                                              ; preds = %214, %194
  %197 = load i32, ptr %11, align 4, !tbaa !5
  %198 = load i32, ptr %13, align 4, !tbaa !5
  %199 = icmp slt i32 %197, %198
  br i1 %199, label %200, label %217

200:                                              ; preds = %196
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #8
  %201 = getelementptr inbounds [16 x i8], ptr %19, i64 0, i64 0
  %202 = load i32, ptr %11, align 4, !tbaa !5
  %203 = add nsw i32 %202, 1
  %204 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %201, i64 noundef 16, ptr noundef @.str.146, i32 noundef %203) #8
  %205 = load ptr, ptr %4, align 8, !tbaa !9
  %206 = getelementptr inbounds [16 x i8], ptr %19, i64 0, i64 0
  %207 = load ptr, ptr %16, align 8, !tbaa !9
  %208 = load i32, ptr %11, align 4, !tbaa !5
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds i8, ptr %207, i64 %209
  %211 = load i8, ptr %210, align 1, !tbaa !17
  %212 = zext i8 %211 to i32
  %213 = call i32 @nk_select_label(ptr noundef %205, ptr noundef %206, i32 noundef 18, i32 noundef %212)
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #8
  br label %214

214:                                              ; preds = %200
  %215 = load i32, ptr %11, align 4, !tbaa !5
  %216 = add nsw i32 %215, 1
  store i32 %216, ptr %11, align 4, !tbaa !5
  br label %196, !llvm.loop !18

217:                                              ; preds = %196
  %218 = load ptr, ptr %4, align 8, !tbaa !9
  call void @nk_layout_row_dynamic(ptr noundef %218, float noundef 3.000000e+01, i32 noundef 8)
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %219

219:                                              ; preds = %230, %217
  %220 = load i32, ptr %11, align 4, !tbaa !5
  %221 = load i32, ptr %14, align 4, !tbaa !5
  %222 = icmp slt i32 %220, %221
  br i1 %222, label %223, label %233

223:                                              ; preds = %219
  %224 = load ptr, ptr %4, align 8, !tbaa !9
  %225 = load ptr, ptr %17, align 8, !tbaa !9
  %226 = load i32, ptr %11, align 4, !tbaa !5
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds i8, ptr %225, i64 %227
  %229 = load i8, ptr %228, align 1, !tbaa !17
  call void @hat_widget(ptr noundef %224, i8 noundef zeroext %229)
  br label %230

230:                                              ; preds = %223
  %231 = load i32, ptr %11, align 4, !tbaa !5
  %232 = add nsw i32 %231, 1
  store i32 %232, ptr %11, align 4, !tbaa !5
  br label %219, !llvm.loop !19

233:                                              ; preds = %219
  %234 = load ptr, ptr %4, align 8, !tbaa !9
  call void @nk_layout_row_dynamic(ptr noundef %234, float noundef 3.000000e+01, i32 noundef 1)
  %235 = load i32, ptr %6, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [16 x i32], ptr @joysticks, i64 0, i64 %236
  %238 = load i32, ptr %237, align 4, !tbaa !5
  %239 = call i32 @glfwGetGamepadState(i32 noundef %238, ptr noundef %18)
  %240 = icmp ne i32 %239, 0
  br i1 %240, label %241, label %321

241:                                              ; preds = %233
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  store i32 0, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 88, ptr %21) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %21, ptr align 16 @__const.main.names, i64 88, i1 false)
  %242 = load ptr, ptr %4, align 8, !tbaa !9
  %243 = load i32, ptr %6, align 4, !tbaa !5
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds [16 x i32], ptr @joysticks, i64 0, i64 %244
  %246 = load i32, ptr %245, align 4, !tbaa !5
  %247 = call ptr @glfwGetGamepadName(i32 noundef %246)
  call void (ptr, i32, ptr, ...) @nk_labelf(ptr noundef %242, i32 noundef 17, ptr noundef @.str.158, ptr noundef %247)
  %248 = load ptr, ptr %4, align 8, !tbaa !9
  call void @nk_layout_row_dynamic(ptr noundef %248, float noundef 3.000000e+01, i32 noundef 2)
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %249

249:                                              ; preds = %260, %241
  %250 = load i32, ptr %11, align 4, !tbaa !5
  %251 = icmp sle i32 %250, 5
  br i1 %251, label %252, label %263

252:                                              ; preds = %249
  %253 = load ptr, ptr %4, align 8, !tbaa !9
  %254 = getelementptr inbounds %struct.GLFWgamepadstate, ptr %18, i32 0, i32 1
  %255 = load i32, ptr %11, align 4, !tbaa !5
  %256 = sext i32 %255 to i64
  %257 = getelementptr inbounds [6 x float], ptr %254, i64 0, i64 %256
  %258 = load float, ptr %257, align 4, !tbaa !14
  %259 = call float @nk_slide_float(ptr noundef %253, float noundef -1.000000e+00, float noundef %258, float noundef 1.000000e+00, float noundef 0x3FB99999A0000000)
  br label %260

260:                                              ; preds = %252
  %261 = load i32, ptr %11, align 4, !tbaa !5
  %262 = add nsw i32 %261, 1
  store i32 %262, ptr %11, align 4, !tbaa !5
  br label %249, !llvm.loop !20

263:                                              ; preds = %249
  %264 = load ptr, ptr %4, align 8, !tbaa !9
  call void @nk_layout_row_dynamic(ptr noundef %264, float noundef 3.000000e+01, i32 noundef 11)
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %265

265:                                              ; preds = %281, %263
  %266 = load i32, ptr %11, align 4, !tbaa !5
  %267 = icmp sle i32 %266, 10
  br i1 %267, label %268, label %284

268:                                              ; preds = %265
  %269 = load ptr, ptr %4, align 8, !tbaa !9
  %270 = load i32, ptr %11, align 4, !tbaa !5
  %271 = sext i32 %270 to i64
  %272 = getelementptr inbounds [11 x ptr], ptr %21, i64 0, i64 %271
  %273 = load ptr, ptr %272, align 8, !tbaa !9
  %274 = getelementptr inbounds %struct.GLFWgamepadstate, ptr %18, i32 0, i32 0
  %275 = load i32, ptr %11, align 4, !tbaa !5
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds [15 x i8], ptr %274, i64 0, i64 %276
  %278 = load i8, ptr %277, align 1, !tbaa !17
  %279 = zext i8 %278 to i32
  %280 = call i32 @nk_select_label(ptr noundef %269, ptr noundef %273, i32 noundef 18, i32 noundef %279)
  br label %281

281:                                              ; preds = %268
  %282 = load i32, ptr %11, align 4, !tbaa !5
  %283 = add nsw i32 %282, 1
  store i32 %283, ptr %11, align 4, !tbaa !5
  br label %265, !llvm.loop !21

284:                                              ; preds = %265
  %285 = getelementptr inbounds %struct.GLFWgamepadstate, ptr %18, i32 0, i32 0
  %286 = getelementptr inbounds [15 x i8], ptr %285, i64 0, i64 11
  %287 = load i8, ptr %286, align 1, !tbaa !17
  %288 = icmp ne i8 %287, 0
  br i1 %288, label %289, label %292

289:                                              ; preds = %284
  %290 = load i32, ptr %20, align 4, !tbaa !5
  %291 = or i32 %290, 1
  store i32 %291, ptr %20, align 4, !tbaa !5
  br label %292

292:                                              ; preds = %289, %284
  %293 = getelementptr inbounds %struct.GLFWgamepadstate, ptr %18, i32 0, i32 0
  %294 = getelementptr inbounds [15 x i8], ptr %293, i64 0, i64 12
  %295 = load i8, ptr %294, align 4, !tbaa !17
  %296 = icmp ne i8 %295, 0
  br i1 %296, label %297, label %300

297:                                              ; preds = %292
  %298 = load i32, ptr %20, align 4, !tbaa !5
  %299 = or i32 %298, 2
  store i32 %299, ptr %20, align 4, !tbaa !5
  br label %300

300:                                              ; preds = %297, %292
  %301 = getelementptr inbounds %struct.GLFWgamepadstate, ptr %18, i32 0, i32 0
  %302 = getelementptr inbounds [15 x i8], ptr %301, i64 0, i64 13
  %303 = load i8, ptr %302, align 1, !tbaa !17
  %304 = icmp ne i8 %303, 0
  br i1 %304, label %305, label %308

305:                                              ; preds = %300
  %306 = load i32, ptr %20, align 4, !tbaa !5
  %307 = or i32 %306, 4
  store i32 %307, ptr %20, align 4, !tbaa !5
  br label %308

308:                                              ; preds = %305, %300
  %309 = getelementptr inbounds %struct.GLFWgamepadstate, ptr %18, i32 0, i32 0
  %310 = getelementptr inbounds [15 x i8], ptr %309, i64 0, i64 14
  %311 = load i8, ptr %310, align 2, !tbaa !17
  %312 = icmp ne i8 %311, 0
  br i1 %312, label %313, label %316

313:                                              ; preds = %308
  %314 = load i32, ptr %20, align 4, !tbaa !5
  %315 = or i32 %314, 8
  store i32 %315, ptr %20, align 4, !tbaa !5
  br label %316

316:                                              ; preds = %313, %308
  %317 = load ptr, ptr %4, align 8, !tbaa !9
  call void @nk_layout_row_dynamic(ptr noundef %317, float noundef 3.000000e+01, i32 noundef 8)
  %318 = load ptr, ptr %4, align 8, !tbaa !9
  %319 = load i32, ptr %20, align 4, !tbaa !5
  %320 = trunc i32 %319 to i8
  call void @hat_widget(ptr noundef %318, i8 noundef zeroext %320)
  call void @llvm.lifetime.end.p0(i64 88, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  br label %323

321:                                              ; preds = %233
  %322 = load ptr, ptr %4, align 8, !tbaa !9
  call void @nk_label(ptr noundef %322, ptr noundef @.str.159, i32 noundef 17)
  br label %323

323:                                              ; preds = %321, %316
  call void @llvm.lifetime.end.p0(i64 40, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %324

324:                                              ; preds = %323, %123
  %325 = load ptr, ptr %4, align 8, !tbaa !9
  call void @nk_end(ptr noundef %325)
  br label %326

326:                                              ; preds = %324
  %327 = load i32, ptr %6, align 4, !tbaa !5
  %328 = add nsw i32 %327, 1
  store i32 %328, ptr %6, align 4, !tbaa !5
  br label %119, !llvm.loop !22

329:                                              ; preds = %119
  call void @nk_glfw3_render(i32 noundef 1)
  %330 = load ptr, ptr @window, align 8, !tbaa !9
  call void @glfwSwapBuffers(ptr noundef %330)
  call void @glfwPollEvents()
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  br label %57, !llvm.loop !23

331:                                              ; preds = %57
  call void @glfwTerminate()
  call void @exit(i32 noundef 0) #9
  unreachable
}

declare ptr @glfwSetErrorCallback(ptr noundef) #5

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

declare i32 @glfwInit() #5

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

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

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

declare void @glfwTerminate() #5

declare void @glfwMakeContextCurrent(ptr noundef) #5

declare ptr @glfwGetProcAddress(ptr noundef) #5

declare void @glfwSwapInterval(i32 noundef) #5

declare i32 @glfwJoystickPresent(i32 noundef) #5

declare ptr @glfwSetJoystickCallback(ptr noundef) #5

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

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

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

declare i32 @glfwWindowShouldClose(ptr noundef) #5

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

declare ptr @glfwGetJoystickGUID(i32 noundef) #5

declare ptr @glfwGetJoystickAxes(i32 noundef, ptr noundef) #5

declare ptr @glfwGetJoystickButtons(i32 noundef, ptr noundef) #5

declare ptr @glfwGetJoystickHats(i32 noundef, ptr noundef) #5

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

; Function Attrs: nounwind uwtable
declare hidden void @hat_widget(ptr noundef, i8 noundef zeroext) #4

declare i32 @glfwGetGamepadState(i32 noundef, ptr noundef) #5

declare ptr @glfwGetGamepadName(i32 noundef) #5

declare void @glfwSwapBuffers(ptr noundef) #5

declare void @glfwPollEvents() #5

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = distinct !{!16, !12}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !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.GLFWgamepadstate = type { [15 x i8], [6 x float] }

@glad_glClear = external dso_local local_unnamed_addr global ptr, align 8
@joysticks = external hidden local_unnamed_addr global [16 x i32], align 16
@.str.140 = external hidden unnamed_addr constant [14 x i8], align 1
@window = external hidden local_unnamed_addr global ptr, align 8
@joystick_count = external hidden local_unnamed_addr global i32, align 4
@.str.141 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.142 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.143 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.144 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.145 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.146 = external hidden unnamed_addr constant [3 x i8], align 1
@__const.main.names = external hidden unnamed_addr constant [11 x ptr], align 16
@.str.158 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.159 = external hidden unnamed_addr constant [32 x i8], align 1

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

; Function Attrs: 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: nounwind uwtable
declare dso_local { <2 x float>, <2 x float> } @nk_rect(float noundef, float noundef, float noundef, float noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @nk_begin(ptr noundef, ptr noundef, <2 x float>, <2 x float>, i32 noundef) local_unnamed_addr #3

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @nk_layout_row_dynamic(ptr noundef, float noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @nk_labelf(ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #1

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local float @nk_slide_float(ptr noundef, float noundef, float noundef, float noundef, float noundef) local_unnamed_addr #1

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @nk_glfw3_font_stash_end() local_unnamed_addr #1

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

declare void @glfwGetWindowSize(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: noreturn nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #5 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %struct.GLFWgamepadstate, align 4
  %9 = alloca [16 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  store i32 0, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) @joysticks, i8 0, i64 64, i1 false)
  %10 = tail call ptr @glfwSetErrorCallback(ptr noundef nonnull @error_callback) #8
  %11 = tail call i32 @glfwInit() #8
  %.not = icmp eq i32 %11, 0
  br i1 %.not, label %12, label %13

12:                                               ; preds = %0
  tail call void @exit(i32 noundef 1) #9
  unreachable

13:                                               ; preds = %0
  tail call void @glfwWindowHint(i32 noundef 139276, i32 noundef 1) #8
  tail call void @glfwWindowHint(i32 noundef 151553, i32 noundef 1) #8
  %14 = tail call ptr @glfwCreateWindow(i32 noundef 800, i32 noundef 600, ptr noundef nonnull @.str.140, ptr noundef null, ptr noundef null) #8
  store ptr %14, ptr @window, align 8, !tbaa !9
  %.not79 = icmp eq ptr %14, null
  br i1 %.not79, label %15, label %16

15:                                               ; preds = %13
  tail call void @glfwTerminate() #8
  tail call void @exit(i32 noundef 1) #9
  unreachable

16:                                               ; preds = %13
  tail call void @glfwMakeContextCurrent(ptr noundef nonnull %14) #8
  %17 = tail call i32 @gladLoadGL(ptr noundef nonnull @glfwGetProcAddress)
  tail call void @glfwSwapInterval(i32 noundef 1) #8
  %18 = load ptr, ptr @window, align 8, !tbaa !9
  %19 = tail call ptr @nk_glfw3_init(ptr noundef %18, i32 noundef 1)
  call void @nk_glfw3_font_stash_begin(ptr noundef nonnull %2)
  call void @nk_glfw3_font_stash_end()
  %20 = call i32 @glfwJoystickPresent(i32 noundef 0) #8
  %.not91 = icmp eq i32 %20, 0
  br i1 %.not91, label %26, label %21

21:                                               ; preds = %16
  %22 = load i32, ptr @joystick_count, align 4, !tbaa !5
  %23 = add nsw i32 %22, 1
  store i32 %23, ptr @joystick_count, align 4, !tbaa !5
  %24 = sext i32 %22 to i64
  %25 = getelementptr inbounds [16 x i32], ptr @joysticks, i64 0, i64 %24
  store i32 0, ptr %25, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %16, %21
  %27 = call i32 @glfwJoystickPresent(i32 noundef 1) #8
  %.not91.1 = icmp eq i32 %27, 0
  br i1 %.not91.1, label %33, label %28

28:                                               ; preds = %26
  %29 = load i32, ptr @joystick_count, align 4, !tbaa !5
  %30 = add nsw i32 %29, 1
  store i32 %30, ptr @joystick_count, align 4, !tbaa !5
  %31 = sext i32 %29 to i64
  %32 = getelementptr inbounds [16 x i32], ptr @joysticks, i64 0, i64 %31
  store i32 1, ptr %32, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %28, %26
  %34 = call i32 @glfwJoystickPresent(i32 noundef 2) #8
  %.not91.2 = icmp eq i32 %34, 0
  br i1 %.not91.2, label %40, label %35

35:                                               ; preds = %33
  %36 = load i32, ptr @joystick_count, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr @joystick_count, align 4, !tbaa !5
  %38 = sext i32 %36 to i64
  %39 = getelementptr inbounds [16 x i32], ptr @joysticks, i64 0, i64 %38
  store i32 2, ptr %39, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %35, %33
  %41 = call i32 @glfwJoystickPresent(i32 noundef 3) #8
  %.not91.3 = icmp eq i32 %41, 0
  br i1 %.not91.3, label %47, label %42

42:                                               ; preds = %40
  %43 = load i32, ptr @joystick_count, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr @joystick_count, align 4, !tbaa !5
  %45 = sext i32 %43 to i64
  %46 = getelementptr inbounds [16 x i32], ptr @joysticks, i64 0, i64 %45
  store i32 3, ptr %46, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %42, %40
  %48 = call i32 @glfwJoystickPresent(i32 noundef 4) #8
  %.not91.4 = icmp eq i32 %48, 0
  br i1 %.not91.4, label %54, label %49

49:                                               ; preds = %47
  %50 = load i32, ptr @joystick_count, align 4, !tbaa !5
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr @joystick_count, align 4, !tbaa !5
  %52 = sext i32 %50 to i64
  %53 = getelementptr inbounds [16 x i32], ptr @joysticks, i64 0, i64 %52
  store i32 4, ptr %53, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %49, %47
  %55 = call i32 @glfwJoystickPresent(i32 noundef 5) #8
  %.not91.5 = icmp eq i32 %55, 0
  br i1 %.not91.5, label %61, label %56

56:                                               ; preds = %54
  %57 = load i32, ptr @joystick_count, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr @joystick_count, align 4, !tbaa !5
  %59 = sext i32 %57 to i64
  %60 = getelementptr inbounds [16 x i32], ptr @joysticks, i64 0, i64 %59
  store i32 5, ptr %60, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %56, %54
  %62 = call i32 @glfwJoystickPresent(i32 noundef 6) #8
  %.not91.6 = icmp eq i32 %62, 0
  br i1 %.not91.6, label %68, label %63

63:                                               ; preds = %61
  %64 = load i32, ptr @joystick_count, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr @joystick_count, align 4, !tbaa !5
  %66 = sext i32 %64 to i64
  %67 = getelementptr inbounds [16 x i32], ptr @joysticks, i64 0, i64 %66
  store i32 6, ptr %67, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %63, %61
  %69 = call i32 @glfwJoystickPresent(i32 noundef 7) #8
  %.not91.7 = icmp eq i32 %69, 0
  br i1 %.not91.7, label %75, label %70

70:                                               ; preds = %68
  %71 = load i32, ptr @joystick_count, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr @joystick_count, align 4, !tbaa !5
  %73 = sext i32 %71 to i64
  %74 = getelementptr inbounds [16 x i32], ptr @joysticks, i64 0, i64 %73
  store i32 7, ptr %74, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %70, %68
  %76 = call i32 @glfwJoystickPresent(i32 noundef 8) #8
  %.not91.8 = icmp eq i32 %76, 0
  br i1 %.not91.8, label %82, label %77

77:                                               ; preds = %75
  %78 = load i32, ptr @joystick_count, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr @joystick_count, align 4, !tbaa !5
  %80 = sext i32 %78 to i64
  %81 = getelementptr inbounds [16 x i32], ptr @joysticks, i64 0, i64 %80
  store i32 8, ptr %81, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %77, %75
  %83 = call i32 @glfwJoystickPresent(i32 noundef 9) #8
  %.not91.9 = icmp eq i32 %83, 0
  br i1 %.not91.9, label %89, label %84

84:                                               ; preds = %82
  %85 = load i32, ptr @joystick_count, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr @joystick_count, align 4, !tbaa !5
  %87 = sext i32 %85 to i64
  %88 = getelementptr inbounds [16 x i32], ptr @joysticks, i64 0, i64 %87
  store i32 9, ptr %88, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %84, %82
  %90 = call i32 @glfwJoystickPresent(i32 noundef 10) #8
  %.not91.10 = icmp eq i32 %90, 0
  br i1 %.not91.10, label %96, label %91

91:                                               ; preds = %89
  %92 = load i32, ptr @joystick_count, align 4, !tbaa !5
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr @joystick_count, align 4, !tbaa !5
  %94 = sext i32 %92 to i64
  %95 = getelementptr inbounds [16 x i32], ptr @joysticks, i64 0, i64 %94
  store i32 10, ptr %95, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %91, %89
  %97 = call i32 @glfwJoystickPresent(i32 noundef 11) #8
  %.not91.11 = icmp eq i32 %97, 0
  br i1 %.not91.11, label %103, label %98

98:                                               ; preds = %96
  %99 = load i32, ptr @joystick_count, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr @joystick_count, align 4, !tbaa !5
  %101 = sext i32 %99 to i64
  %102 = getelementptr inbounds [16 x i32], ptr @joysticks, i64 0, i64 %101
  store i32 11, ptr %102, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %98, %96
  %104 = call i32 @glfwJoystickPresent(i32 noundef 12) #8
  %.not91.12 = icmp eq i32 %104, 0
  br i1 %.not91.12, label %110, label %105

105:                                              ; preds = %103
  %106 = load i32, ptr @joystick_count, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr @joystick_count, align 4, !tbaa !5
  %108 = sext i32 %106 to i64
  %109 = getelementptr inbounds [16 x i32], ptr @joysticks, i64 0, i64 %108
  store i32 12, ptr %109, align 4, !tbaa !5
  br label %110

110:                                              ; preds = %105, %103
  %111 = call i32 @glfwJoystickPresent(i32 noundef 13) #8
  %.not91.13 = icmp eq i32 %111, 0
  br i1 %.not91.13, label %117, label %112

112:                                              ; preds = %110
  %113 = load i32, ptr @joystick_count, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr @joystick_count, align 4, !tbaa !5
  %115 = sext i32 %113 to i64
  %116 = getelementptr inbounds [16 x i32], ptr @joysticks, i64 0, i64 %115
  store i32 13, ptr %116, align 4, !tbaa !5
  br label %117

117:                                              ; preds = %112, %110
  %118 = call i32 @glfwJoystickPresent(i32 noundef 14) #8
  %.not91.14 = icmp eq i32 %118, 0
  br i1 %.not91.14, label %124, label %119

119:                                              ; preds = %117
  %120 = load i32, ptr @joystick_count, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr @joystick_count, align 4, !tbaa !5
  %122 = sext i32 %120 to i64
  %123 = getelementptr inbounds [16 x i32], ptr @joysticks, i64 0, i64 %122
  store i32 14, ptr %123, align 4, !tbaa !5
  br label %124

124:                                              ; preds = %119, %117
  %125 = call i32 @glfwJoystickPresent(i32 noundef 15) #8
  %.not91.15 = icmp eq i32 %125, 0
  br i1 %.not91.15, label %131, label %126

126:                                              ; preds = %124
  %127 = load i32, ptr @joystick_count, align 4, !tbaa !5
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr @joystick_count, align 4, !tbaa !5
  %129 = sext i32 %127 to i64
  %130 = getelementptr inbounds [16 x i32], ptr @joysticks, i64 0, i64 %129
  store i32 15, ptr %130, align 4, !tbaa !5
  br label %131

131:                                              ; preds = %126, %124
  %132 = call ptr @glfwSetJoystickCallback(ptr noundef nonnull @joystick_callback) #8
  %133 = load ptr, ptr @window, align 8, !tbaa !9
  %134 = call ptr @glfwSetDropCallback(ptr noundef %133, ptr noundef nonnull @drop_callback) #8
  %135 = load ptr, ptr @window, align 8, !tbaa !9
  %136 = call i32 @glfwWindowShouldClose(ptr noundef %135) #8
  %.not80110 = icmp eq i32 %136, 0
  br i1 %.not80110, label %.lr.ph112, label %._crit_edge113

.lr.ph112:                                        ; preds = %131
  %137 = getelementptr inbounds i8, ptr %8, i64 16
  %138 = getelementptr inbounds i8, ptr %8, i64 11
  %139 = getelementptr inbounds i8, ptr %8, i64 12
  %140 = getelementptr inbounds i8, ptr %8, i64 13
  %141 = getelementptr inbounds i8, ptr %8, i64 14
  %142 = getelementptr inbounds i8, ptr %8, i64 20
  %143 = getelementptr inbounds i8, ptr %8, i64 24
  %144 = getelementptr inbounds i8, ptr %8, i64 28
  %145 = getelementptr inbounds i8, ptr %8, i64 32
  %146 = getelementptr inbounds i8, ptr %8, i64 36
  %147 = load ptr, ptr @__const.main.names, align 16
  %148 = load ptr, ptr getelementptr inbounds (i8, ptr @__const.main.names, i64 8), align 8
  %149 = getelementptr inbounds i8, ptr %8, i64 1
  %150 = load ptr, ptr getelementptr inbounds (i8, ptr @__const.main.names, i64 16), align 16
  %151 = getelementptr inbounds i8, ptr %8, i64 2
  %152 = load ptr, ptr getelementptr inbounds (i8, ptr @__const.main.names, i64 24), align 8
  %153 = getelementptr inbounds i8, ptr %8, i64 3
  %154 = load ptr, ptr getelementptr inbounds (i8, ptr @__const.main.names, i64 32), align 16
  %155 = getelementptr inbounds i8, ptr %8, i64 4
  %156 = load ptr, ptr getelementptr inbounds (i8, ptr @__const.main.names, i64 40), align 8
  %157 = getelementptr inbounds i8, ptr %8, i64 5
  %158 = load ptr, ptr getelementptr inbounds (i8, ptr @__const.main.names, i64 48), align 16
  %159 = getelementptr inbounds i8, ptr %8, i64 6
  %160 = load ptr, ptr getelementptr inbounds (i8, ptr @__const.main.names, i64 56), align 8
  %161 = getelementptr inbounds i8, ptr %8, i64 7
  %162 = load ptr, ptr getelementptr inbounds (i8, ptr @__const.main.names, i64 64), align 16
  %163 = getelementptr inbounds i8, ptr %8, i64 8
  %164 = load ptr, ptr getelementptr inbounds (i8, ptr @__const.main.names, i64 72), align 8
  %165 = getelementptr inbounds i8, ptr %8, i64 9
  %166 = load ptr, ptr getelementptr inbounds (i8, ptr @__const.main.names, i64 80), align 16
  %167 = getelementptr inbounds i8, ptr %8, i64 10
  br label %168

168:                                              ; preds = %.lr.ph112, %._crit_edge109
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  %169 = load ptr, ptr @window, align 8, !tbaa !9
  call void @glfwGetWindowSize(ptr noundef %169, ptr noundef nonnull %3, ptr noundef nonnull %4) #8
  %170 = load ptr, ptr @glad_glClear, align 8, !tbaa !9
  call void %170(i32 noundef 16384) #8
  call void @nk_glfw3_new_frame()
  %171 = load i32, ptr %3, align 4, !tbaa !5
  %172 = sitofp i32 %171 to float
  %173 = fadd float %172, -2.000000e+02
  %174 = load i32, ptr %4, align 4, !tbaa !5
  %175 = sitofp i32 %174 to float
  %176 = call { <2 x float>, <2 x float> } @nk_rect(float noundef %173, float noundef 0.000000e+00, float noundef 2.000000e+02, float noundef %175)
  %177 = extractvalue { <2 x float>, <2 x float> } %176, 0
  %178 = extractvalue { <2 x float>, <2 x float> } %176, 1
  %179 = call i32 @nk_begin(ptr noundef %19, ptr noundef nonnull @.str.141, <2 x float> %177, <2 x float> %178, i32 noundef 80)
  %.not81 = icmp eq i32 %179, 0
  br i1 %.not81, label %.loopexit, label %180

180:                                              ; preds = %168
  call void @nk_layout_row_dynamic(ptr noundef %19, float noundef 3.000000e+01, i32 noundef 1)
  %181 = call i32 @nk_checkbox_label(ptr noundef %19, ptr noundef nonnull @.str.142, ptr noundef nonnull %1)
  %182 = load i32, ptr @joystick_count, align 4, !tbaa !5
  %.not82 = icmp eq i32 %182, 0
  br i1 %.not82, label %195, label %.preheader

.preheader:                                       ; preds = %180
  %183 = icmp sgt i32 %182, 0
  br i1 %183, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %.preheader, %191
  %indvars.iv = phi i64 [ %indvars.iv.next, %191 ], [ 0, %.preheader ]
  %184 = getelementptr inbounds [16 x i32], ptr @joysticks, i64 0, i64 %indvars.iv
  %185 = load i32, ptr %184, align 4, !tbaa !5
  %186 = call ptr @joystick_label(i32 noundef %185)
  %187 = call i32 @nk_button_label(ptr noundef %19, ptr noundef %186)
  %.not90 = icmp eq i32 %187, 0
  br i1 %.not90, label %191, label %188

188:                                              ; preds = %.lr.ph
  %189 = load i32, ptr %184, align 4, !tbaa !5
  %190 = call ptr @joystick_label(i32 noundef %189)
  call void @nk_window_set_focus(ptr noundef %19, ptr noundef %190)
  br label %191

191:                                              ; preds = %.lr.ph, %188
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %192 = load i32, ptr @joystick_count, align 4, !tbaa !5
  %193 = sext i32 %192 to i64
  %194 = icmp slt i64 %indvars.iv.next, %193
  br i1 %194, label %.lr.ph, label %.loopexit, !llvm.loop !11

195:                                              ; preds = %180
  call void @nk_label(ptr noundef %19, ptr noundef nonnull @.str.143, i32 noundef 17)
  br label %.loopexit

.loopexit:                                        ; preds = %191, %.preheader, %195, %168
  call void @nk_end(ptr noundef %19)
  %196 = load i32, ptr @joystick_count, align 4, !tbaa !5
  %197 = icmp sgt i32 %196, 0
  br i1 %197, label %.lr.ph108, label %._crit_edge109

.lr.ph108:                                        ; preds = %.loopexit, %309
  %indvars.iv130 = phi i64 [ %indvars.iv.next131, %309 ], [ 0, %.loopexit ]
  %198 = getelementptr inbounds [16 x i32], ptr @joysticks, i64 0, i64 %indvars.iv130
  %199 = load i32, ptr %198, align 4, !tbaa !5
  %200 = call ptr @joystick_label(i32 noundef %199)
  %201 = trunc nuw nsw i64 %indvars.iv130 to i32
  %202 = uitofp nneg i32 %201 to float
  %203 = fmul float %202, 2.000000e+01
  %204 = call { <2 x float>, <2 x float> } @nk_rect(float noundef %203, float noundef %203, float noundef 5.500000e+02, float noundef 5.700000e+02)
  %205 = extractvalue { <2 x float>, <2 x float> } %204, 0
  %206 = extractvalue { <2 x float>, <2 x float> } %204, 1
  %207 = call i32 @nk_begin(ptr noundef %19, ptr noundef %200, <2 x float> %205, <2 x float> %206, i32 noundef 87)
  %.not83 = icmp eq i32 %207, 0
  br i1 %.not83, label %309, label %208

208:                                              ; preds = %.lr.ph108
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %8) #8
  call void @nk_layout_row_dynamic(ptr noundef %19, float noundef 3.000000e+01, i32 noundef 1)
  %209 = load i32, ptr %198, align 4, !tbaa !5
  %210 = call ptr @glfwGetJoystickGUID(i32 noundef %209) #8
  call void (ptr, i32, ptr, ...) @nk_labelf(ptr noundef %19, i32 noundef 17, ptr noundef nonnull @.str.144, ptr noundef %210)
  call void @nk_label(ptr noundef %19, ptr noundef nonnull @.str.145, i32 noundef 17)
  %211 = load i32, ptr %198, align 4, !tbaa !5
  %212 = call ptr @glfwGetJoystickAxes(i32 noundef %211, ptr noundef nonnull %5) #8
  %213 = load i32, ptr %198, align 4, !tbaa !5
  %214 = call ptr @glfwGetJoystickButtons(i32 noundef %213, ptr noundef nonnull %6) #8
  %215 = load i32, ptr %198, align 4, !tbaa !5
  %216 = call ptr @glfwGetJoystickHats(i32 noundef %215, ptr noundef nonnull %7) #8
  %217 = load i32, ptr %1, align 4, !tbaa !5
  %.not84 = icmp eq i32 %217, 0
  br i1 %.not84, label %218, label %223

218:                                              ; preds = %208
  %219 = load i32, ptr %7, align 4, !tbaa !5
  %220 = shl nsw i32 %219, 2
  %221 = load i32, ptr %6, align 4, !tbaa !5
  %222 = sub nsw i32 %221, %220
  store i32 %222, ptr %6, align 4, !tbaa !5
  br label %223

223:                                              ; preds = %218, %208
  %224 = load i32, ptr %5, align 4, !tbaa !5
  %225 = icmp sgt i32 %224, 0
  br i1 %225, label %.lr.ph95, label %._crit_edge

.lr.ph95:                                         ; preds = %223, %.lr.ph95
  %indvars.iv115 = phi i64 [ %indvars.iv.next116, %.lr.ph95 ], [ 0, %223 ]
  %226 = getelementptr inbounds float, ptr %212, i64 %indvars.iv115
  %227 = load float, ptr %226, align 4, !tbaa !13
  %228 = call float @nk_slide_float(ptr noundef %19, float noundef -1.000000e+00, float noundef %227, float noundef 1.000000e+00, float noundef 0x3FB99999A0000000)
  %indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1
  %229 = load i32, ptr %5, align 4, !tbaa !5
  %230 = sext i32 %229 to i64
  %231 = icmp slt i64 %indvars.iv.next116, %230
  br i1 %231, label %.lr.ph95, label %._crit_edge, !llvm.loop !15

._crit_edge:                                      ; preds = %.lr.ph95, %223
  call void @nk_layout_row_dynamic(ptr noundef %19, float noundef 3.000000e+01, i32 noundef 12)
  %232 = load i32, ptr %6, align 4, !tbaa !5
  %233 = icmp sgt i32 %232, 0
  br i1 %233, label %.lr.ph98, label %._crit_edge99

.lr.ph98:                                         ; preds = %._crit_edge, %.lr.ph98
  %indvars.iv118 = phi i64 [ %indvars.iv.next119, %.lr.ph98 ], [ 0, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #8
  %indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1
  %234 = trunc nuw nsw i64 %indvars.iv.next119 to i32
  %235 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %9, i64 noundef 16, ptr noundef nonnull @.str.146, i32 noundef %234) #8
  %236 = getelementptr inbounds i8, ptr %214, i64 %indvars.iv118
  %237 = load i8, ptr %236, align 1, !tbaa !16
  %238 = zext i8 %237 to i32
  %239 = call i32 @nk_select_label(ptr noundef %19, ptr noundef nonnull %9, i32 noundef 18, i32 noundef %238)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #8
  %240 = load i32, ptr %6, align 4, !tbaa !5
  %241 = sext i32 %240 to i64
  %242 = icmp slt i64 %indvars.iv.next119, %241
  br i1 %242, label %.lr.ph98, label %._crit_edge99, !llvm.loop !17

._crit_edge99:                                    ; preds = %.lr.ph98, %._crit_edge
  call void @nk_layout_row_dynamic(ptr noundef %19, float noundef 3.000000e+01, i32 noundef 8)
  %243 = load i32, ptr %7, align 4, !tbaa !5
  %244 = icmp sgt i32 %243, 0
  br i1 %244, label %.lr.ph102, label %._crit_edge103

.lr.ph102:                                        ; preds = %._crit_edge99, %.lr.ph102
  %indvars.iv121 = phi i64 [ %indvars.iv.next122, %.lr.ph102 ], [ 0, %._crit_edge99 ]
  %245 = getelementptr inbounds i8, ptr %216, i64 %indvars.iv121
  %246 = load i8, ptr %245, align 1, !tbaa !16
  call void @hat_widget(ptr noundef %19, i8 noundef zeroext %246)
  %indvars.iv.next122 = add nuw nsw i64 %indvars.iv121, 1
  %247 = load i32, ptr %7, align 4, !tbaa !5
  %248 = sext i32 %247 to i64
  %249 = icmp slt i64 %indvars.iv.next122, %248
  br i1 %249, label %.lr.ph102, label %._crit_edge103, !llvm.loop !18

._crit_edge103:                                   ; preds = %.lr.ph102, %._crit_edge99
  call void @nk_layout_row_dynamic(ptr noundef %19, float noundef 3.000000e+01, i32 noundef 1)
  %250 = load i32, ptr %198, align 4, !tbaa !5
  %251 = call i32 @glfwGetGamepadState(i32 noundef %250, ptr noundef nonnull %8) #8
  %.not85 = icmp eq i32 %251, 0
  br i1 %.not85, label %307, label %252

252:                                              ; preds = %._crit_edge103
  %253 = load i32, ptr %198, align 4, !tbaa !5
  %254 = call ptr @glfwGetGamepadName(i32 noundef %253) #8
  call void (ptr, i32, ptr, ...) @nk_labelf(ptr noundef %19, i32 noundef 17, ptr noundef nonnull @.str.158, ptr noundef %254)
  call void @nk_layout_row_dynamic(ptr noundef %19, float noundef 3.000000e+01, i32 noundef 2)
  %255 = load float, ptr %137, align 4, !tbaa !13
  %256 = call float @nk_slide_float(ptr noundef %19, float noundef -1.000000e+00, float noundef %255, float noundef 1.000000e+00, float noundef 0x3FB99999A0000000)
  %257 = load float, ptr %142, align 4, !tbaa !13
  %258 = call float @nk_slide_float(ptr noundef %19, float noundef -1.000000e+00, float noundef %257, float noundef 1.000000e+00, float noundef 0x3FB99999A0000000)
  %259 = load float, ptr %143, align 4, !tbaa !13
  %260 = call float @nk_slide_float(ptr noundef %19, float noundef -1.000000e+00, float noundef %259, float noundef 1.000000e+00, float noundef 0x3FB99999A0000000)
  %261 = load float, ptr %144, align 4, !tbaa !13
  %262 = call float @nk_slide_float(ptr noundef %19, float noundef -1.000000e+00, float noundef %261, float noundef 1.000000e+00, float noundef 0x3FB99999A0000000)
  %263 = load float, ptr %145, align 4, !tbaa !13
  %264 = call float @nk_slide_float(ptr noundef %19, float noundef -1.000000e+00, float noundef %263, float noundef 1.000000e+00, float noundef 0x3FB99999A0000000)
  %265 = load float, ptr %146, align 4, !tbaa !13
  %266 = call float @nk_slide_float(ptr noundef %19, float noundef -1.000000e+00, float noundef %265, float noundef 1.000000e+00, float noundef 0x3FB99999A0000000)
  call void @nk_layout_row_dynamic(ptr noundef %19, float noundef 3.000000e+01, i32 noundef 11)
  %267 = load i8, ptr %8, align 4, !tbaa !16
  %268 = zext i8 %267 to i32
  %269 = call i32 @nk_select_label(ptr noundef %19, ptr noundef %147, i32 noundef 18, i32 noundef %268)
  %270 = load i8, ptr %149, align 1, !tbaa !16
  %271 = zext i8 %270 to i32
  %272 = call i32 @nk_select_label(ptr noundef %19, ptr noundef %148, i32 noundef 18, i32 noundef %271)
  %273 = load i8, ptr %151, align 2, !tbaa !16
  %274 = zext i8 %273 to i32
  %275 = call i32 @nk_select_label(ptr noundef %19, ptr noundef %150, i32 noundef 18, i32 noundef %274)
  %276 = load i8, ptr %153, align 1, !tbaa !16
  %277 = zext i8 %276 to i32
  %278 = call i32 @nk_select_label(ptr noundef %19, ptr noundef %152, i32 noundef 18, i32 noundef %277)
  %279 = load i8, ptr %155, align 4, !tbaa !16
  %280 = zext i8 %279 to i32
  %281 = call i32 @nk_select_label(ptr noundef %19, ptr noundef %154, i32 noundef 18, i32 noundef %280)
  %282 = load i8, ptr %157, align 1, !tbaa !16
  %283 = zext i8 %282 to i32
  %284 = call i32 @nk_select_label(ptr noundef %19, ptr noundef %156, i32 noundef 18, i32 noundef %283)
  %285 = load i8, ptr %159, align 2, !tbaa !16
  %286 = zext i8 %285 to i32
  %287 = call i32 @nk_select_label(ptr noundef %19, ptr noundef %158, i32 noundef 18, i32 noundef %286)
  %288 = load i8, ptr %161, align 1, !tbaa !16
  %289 = zext i8 %288 to i32
  %290 = call i32 @nk_select_label(ptr noundef %19, ptr noundef %160, i32 noundef 18, i32 noundef %289)
  %291 = load i8, ptr %163, align 4, !tbaa !16
  %292 = zext i8 %291 to i32
  %293 = call i32 @nk_select_label(ptr noundef %19, ptr noundef %162, i32 noundef 18, i32 noundef %292)
  %294 = load i8, ptr %165, align 1, !tbaa !16
  %295 = zext i8 %294 to i32
  %296 = call i32 @nk_select_label(ptr noundef %19, ptr noundef %164, i32 noundef 18, i32 noundef %295)
  %297 = load i8, ptr %167, align 2, !tbaa !16
  %298 = zext i8 %297 to i32
  %299 = call i32 @nk_select_label(ptr noundef %19, ptr noundef %166, i32 noundef 18, i32 noundef %298)
  %300 = load i8, ptr %138, align 1, !tbaa !16
  %.not86 = icmp ne i8 %300, 0
  %spec.select = zext i1 %.not86 to i8
  %301 = load i8, ptr %139, align 4, !tbaa !16
  %.not87 = icmp eq i8 %301, 0
  %302 = or disjoint i8 %spec.select, 2
  %.1 = select i1 %.not87, i8 %spec.select, i8 %302
  %303 = load i8, ptr %140, align 1, !tbaa !16
  %.not88 = icmp eq i8 %303, 0
  %304 = or disjoint i8 %.1, 4
  %.2 = select i1 %.not88, i8 %.1, i8 %304
  %305 = load i8, ptr %141, align 2, !tbaa !16
  %.not89 = icmp eq i8 %305, 0
  %306 = or disjoint i8 %.2, 8
  %.3 = select i1 %.not89, i8 %.2, i8 %306
  call void @nk_layout_row_dynamic(ptr noundef %19, float noundef 3.000000e+01, i32 noundef 8)
  call void @hat_widget(ptr noundef %19, i8 noundef zeroext %.3)
  br label %308

307:                                              ; preds = %._crit_edge103
  call void @nk_label(ptr noundef %19, ptr noundef nonnull @.str.159, i32 noundef 17)
  br label %308

308:                                              ; preds = %307, %252
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  br label %309

309:                                              ; preds = %308, %.lr.ph108
  call void @nk_end(ptr noundef %19)
  %indvars.iv.next131 = add nuw nsw i64 %indvars.iv130, 1
  %310 = load i32, ptr @joystick_count, align 4, !tbaa !5
  %311 = sext i32 %310 to i64
  %312 = icmp slt i64 %indvars.iv.next131, %311
  br i1 %312, label %.lr.ph108, label %._crit_edge109, !llvm.loop !19

._crit_edge109:                                   ; preds = %309, %.loopexit
  call void @nk_glfw3_render(i32 noundef 1)
  %313 = load ptr, ptr @window, align 8, !tbaa !9
  call void @glfwSwapBuffers(ptr noundef %313) #8
  call void @glfwPollEvents() #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  %314 = load ptr, ptr @window, align 8, !tbaa !9
  %315 = call i32 @glfwWindowShouldClose(ptr noundef %314) #8
  %.not80 = icmp eq i32 %315, 0
  br i1 %.not80, label %168, label %._crit_edge113, !llvm.loop !20

._crit_edge113:                                   ; preds = %._crit_edge109, %131
  call void @glfwTerminate() #8
  call void @exit(i32 noundef 0) #9
  unreachable
}

declare ptr @glfwSetErrorCallback(ptr noundef) local_unnamed_addr #4

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

declare i32 @glfwInit() local_unnamed_addr #4

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

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

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

declare void @glfwTerminate() local_unnamed_addr #4

declare void @glfwMakeContextCurrent(ptr noundef) local_unnamed_addr #4

declare ptr @glfwGetProcAddress(ptr noundef) #4

declare void @glfwSwapInterval(i32 noundef) local_unnamed_addr #4

declare i32 @glfwJoystickPresent(i32 noundef) local_unnamed_addr #4

declare ptr @glfwSetJoystickCallback(ptr noundef) local_unnamed_addr #4

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

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

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

declare i32 @glfwWindowShouldClose(ptr noundef) local_unnamed_addr #4

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

declare ptr @glfwGetJoystickGUID(i32 noundef) local_unnamed_addr #4

declare ptr @glfwGetJoystickAxes(i32 noundef, ptr noundef) local_unnamed_addr #4

declare ptr @glfwGetJoystickButtons(i32 noundef, ptr noundef) local_unnamed_addr #4

declare ptr @glfwGetJoystickHats(i32 noundef, ptr noundef) local_unnamed_addr #4

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

; Function Attrs: nounwind uwtable
declare hidden void @hat_widget(ptr noundef, i8 noundef zeroext) local_unnamed_addr #3

declare i32 @glfwGetGamepadState(i32 noundef, ptr noundef) local_unnamed_addr #4

declare ptr @glfwGetGamepadName(i32 noundef) local_unnamed_addr #4

declare void @glfwSwapBuffers(ptr noundef) local_unnamed_addr #4

declare void @glfwPollEvents() local_unnamed_addr #4

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="64" "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 = { "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 = { noreturn nounwind uwtable "min-legal-vector-width"="64" "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 = { 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 #7 = { 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 #8 = { nounwind }
attributes #9 = { noreturn nounwind }

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

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


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