; LLVM IR from erincatto/box2d-lite :: extern/glfw/src/x11_monitor.ll (glfwSetVideoModeX11)

; 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._GLFWlibrary = type { i32, %struct.anon, ptr, ptr, ptr, ptr, i32, [16 x %struct._GLFWjoystick], ptr, i32, %struct._GLFWtls, %struct._GLFWtls, %struct._GLFWmutex, %struct.anon.4, %struct.anon.5, %struct.anon.6, %struct._GLFWlibraryX11, %struct._GLFWlibraryGLX, %struct._GLFWlibraryLinux, %struct._GLFWlibraryEGL, %struct._GLFWlibraryOSMesa }
%struct.anon = type { %struct._GLFWinitconfig, %struct._GLFWfbconfig, %struct._GLFWwndconfig, %struct._GLFWctxconfig, i32 }
%struct._GLFWinitconfig = type { i32, %struct.anon.0 }
%struct.anon.0 = type { i32, i32 }
%struct._GLFWfbconfig = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64 }
%struct._GLFWwndconfig = type { i32, i32, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.anon.1, %struct.anon.2 }
%struct.anon.1 = type { i32, [256 x i8] }
%struct.anon.2 = type { [256 x i8], [256 x i8] }
%struct._GLFWctxconfig = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, %struct.anon.3 }
%struct.anon.3 = type { i32 }
%struct._GLFWjoystick = type { i32, ptr, i32, ptr, i32, ptr, i32, ptr, ptr, [33 x i8], ptr, %struct._GLFWjoystickLinux }
%struct._GLFWjoystickLinux = type { i32, [4096 x i8], [512 x i32], [64 x i32], [64 x %struct.input_absinfo], [4 x [2 x i32]] }
%struct.input_absinfo = type { i32, i32, i32, i32, i32, i32 }
%struct._GLFWtls = type { %struct._GLFWtlsPOSIX }
%struct._GLFWtlsPOSIX = type { i32, i32 }
%struct._GLFWmutex = type { %struct._GLFWmutexPOSIX }
%struct._GLFWmutexPOSIX = type { i32, %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%struct.anon.4 = type { i64, %struct._GLFWtimerPOSIX }
%struct._GLFWtimerPOSIX = type { i32, i64 }
%struct.anon.5 = type { i32, ptr, [2 x ptr], ptr, ptr, i32, i32, i32 }
%struct.anon.6 = type { ptr, ptr }
%struct._GLFWlibraryX11 = type { ptr, i32, i64, float, float, i64, i64, i32, ptr, i32, ptr, ptr, [5 x i8], [256 x i16], [349 x i16], double, double, ptr, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, %struct.anon.7, %struct.anon.8, %struct.anon.9, %struct.anon.10, %struct.anon.11, %struct.anon.12, %struct.anon.13, %struct.anon.14, %struct.anon.15, %struct.anon.16 }
%struct.anon.7 = type { i32, ptr, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.anon.8 = type { i32, i32, i32, i32, i32, i32, i32 }
%struct.anon.9 = type { i32, i32, i32, i32, i32 }
%struct.anon.10 = type { i32, i64, i64 }
%struct.anon.11 = type { ptr, ptr, ptr, ptr }
%struct.anon.12 = type { i32, ptr, i32, i32, ptr, ptr, ptr }
%struct.anon.13 = type { ptr, ptr }
%struct.anon.14 = type { i32, ptr, i32, i32, ptr, ptr, ptr, ptr }
%struct.anon.15 = type { i32, ptr, i32, i32, i32, i32, i32, ptr, ptr }
%struct.anon.16 = type { i32, ptr, i32, i32, i32, i32, ptr, ptr, ptr }
%struct._GLFWlibraryGLX = type { i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct._GLFWlibraryLinux = type { i32, i32, %struct.re_pattern_buffer, i32 }
%struct.re_pattern_buffer = type { ptr, i64, i64, i64, ptr, ptr, i64, i8 }
%struct._GLFWlibraryEGL = type { ptr, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._GLFWlibraryOSMesa = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.GLFWvidmode = type { i32, i32, i32, i32, i32, i32 }
%struct._GLFWmonitor = type { ptr, ptr, i32, i32, ptr, ptr, i32, %struct.GLFWvidmode, %struct.GLFWgammaramp, %struct.GLFWgammaramp, %struct._GLFWmonitorX11 }
%struct.GLFWgammaramp = type { ptr, ptr, ptr, i32 }
%struct._GLFWmonitorX11 = type { i64, i64, i64, i32 }
%struct._XRROutputInfo = type { i64, i64, ptr, i32, i64, i64, i16, i16, i32, ptr, i32, ptr, i32, i32, ptr }
%struct._XRRModeInfo = type { i64, i32, i32, i64, i32, i32, i32, i32, i32, i32, i32, ptr, i32, i64 }
%struct._XRRCrtcInfo = type { i64, i32, i32, i32, i32, i64, i16, i32, ptr, i16, i32, ptr }

@_glfw = external global %struct._GLFWlibrary, 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
define dso_local void @_glfwSetVideoModeX11(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %struct.GLFWvidmode, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca %struct.GLFWvidmode, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %15 = load i32, ptr getelementptr inbounds (%struct._GLFWlibraryX11, ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 16), i32 0, i32 64), align 8, !tbaa !9
  %16 = icmp ne i32 %15, 0
  br i1 %16, label %17, label %139

17:                                               ; preds = %2
  %18 = load i32, ptr getelementptr inbounds (%struct.anon.7, ptr getelementptr inbounds (%struct._GLFWlibraryX11, ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 16), i32 0, i32 64), i32 0, i32 7), align 4, !tbaa !47
  %19 = icmp ne i32 %18, 0
  br i1 %19, label %139, label %20

20:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  store i64 0, ptr %10, align 8, !tbaa !48
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = call ptr @_glfwChooseVideoMode(ptr noundef %21, ptr noundef %22)
  store ptr %23, ptr %9, align 8, !tbaa !5
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  call void @_glfwPlatformGetVideoMode(ptr noundef %24, ptr noundef %8)
  %25 = load ptr, ptr %9, align 8, !tbaa !5
  %26 = call i32 @_glfwCompareVideoModes(ptr noundef %8, ptr noundef %25)
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %28, label %29

28:                                               ; preds = %20
  store i32 1, ptr %12, align 4
  br label %136

29:                                               ; preds = %20
  %30 = load ptr, ptr getelementptr inbounds (%struct.anon.7, ptr getelementptr inbounds (%struct._GLFWlibraryX11, ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 16), i32 0, i32 64), i32 0, i32 18), align 8, !tbaa !49
  %31 = load ptr, ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 16), align 8, !tbaa !50
  %32 = load i64, ptr getelementptr inbounds (%struct._GLFWlibraryX11, ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 16), i32 0, i32 2), align 8, !tbaa !51
  %33 = call ptr %30(ptr noundef %31, i64 noundef %32)
  store ptr %33, ptr %5, align 8, !tbaa !5
  %34 = load ptr, ptr getelementptr inbounds (%struct.anon.7, ptr getelementptr inbounds (%struct._GLFWlibraryX11, ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 16), i32 0, i32 64), i32 0, i32 15), align 8, !tbaa !52
  %35 = load ptr, ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 16), align 8, !tbaa !50
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct._GLFWmonitor, ptr %37, i32 0, i32 10
  %39 = getelementptr inbounds %struct._GLFWmonitorX11, ptr %38, i32 0, i32 1
  %40 = load i64, ptr %39, align 8, !tbaa !53
  %41 = call ptr %34(ptr noundef %35, ptr noundef %36, i64 noundef %40)
  store ptr %41, ptr %6, align 8, !tbaa !5
  %42 = load ptr, ptr getelementptr inbounds (%struct.anon.7, ptr getelementptr inbounds (%struct._GLFWlibraryX11, ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 16), i32 0, i32 64), i32 0, i32 16), align 8, !tbaa !58
  %43 = load ptr, ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 16), align 8, !tbaa !50
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = load ptr, ptr %3, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct._GLFWmonitor, ptr %45, i32 0, i32 10
  %47 = getelementptr inbounds %struct._GLFWmonitorX11, ptr %46, i32 0, i32 0
  %48 = load i64, ptr %47, align 8, !tbaa !59
  %49 = call ptr %42(ptr noundef %43, ptr noundef %44, i64 noundef %48)
  store ptr %49, ptr %7, align 8, !tbaa !5
  store i32 0, ptr %11, align 4, !tbaa !60
  br label %50

50:                                               ; preds = %85, %29
  %51 = load i32, ptr %11, align 4, !tbaa !60
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct._XRROutputInfo, ptr %52, i32 0, i32 12
  %54 = load i32, ptr %53, align 8, !tbaa !61
  %55 = icmp slt i32 %51, %54
  br i1 %55, label %56, label %88

56:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct._XRROutputInfo, ptr %58, i32 0, i32 14
  %60 = load ptr, ptr %59, align 8, !tbaa !64
  %61 = load i32, ptr %11, align 4, !tbaa !60
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds i64, ptr %60, i64 %62
  %64 = load i64, ptr %63, align 8, !tbaa !48
  %65 = call ptr @getModeInfo(ptr noundef %57, i64 noundef %64)
  store ptr %65, ptr %13, align 8, !tbaa !5
  %66 = load ptr, ptr %13, align 8, !tbaa !5
  %67 = call i32 @modeIsGood(ptr noundef %66)
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %70, label %69

69:                                               ; preds = %56
  store i32 4, ptr %12, align 4
  br label %82

70:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #3
  %71 = load ptr, ptr %13, align 8, !tbaa !5
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  call void @vidmodeFromModeInfo(ptr dead_on_unwind writable sret(%struct.GLFWvidmode) align 4 %14, ptr noundef %71, ptr noundef %72)
  %73 = load ptr, ptr %9, align 8, !tbaa !5
  %74 = call i32 @_glfwCompareVideoModes(ptr noundef %73, ptr noundef %14)
  %75 = icmp eq i32 %74, 0
  br i1 %75, label %76, label %80

76:                                               ; preds = %70
  %77 = load ptr, ptr %13, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct._XRRModeInfo, ptr %77, i32 0, i32 0
  %79 = load i64, ptr %78, align 8, !tbaa !65
  store i64 %79, ptr %10, align 8, !tbaa !48
  store i32 2, ptr %12, align 4
  br label %81

80:                                               ; preds = %70
  store i32 0, ptr %12, align 4
  br label %81

81:                                               ; preds = %80, %76
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #3
  br label %82

82:                                               ; preds = %81, %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  %83 = load i32, ptr %12, align 4
  switch i32 %83, label %140 [
    i32 0, label %84
    i32 4, label %85
    i32 2, label %88
  ]

84:                                               ; preds = %82
  br label %85

85:                                               ; preds = %84, %82
  %86 = load i32, ptr %11, align 4, !tbaa !60
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %11, align 4, !tbaa !60
  br label %50, !llvm.loop !67

88:                                               ; preds = %82, %50
  %89 = load i64, ptr %10, align 8, !tbaa !48
  %90 = icmp ne i64 %89, 0
  br i1 %90, label %91, label %129

91:                                               ; preds = %88
  %92 = load ptr, ptr %3, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct._GLFWmonitor, ptr %92, i32 0, i32 10
  %94 = getelementptr inbounds %struct._GLFWmonitorX11, ptr %93, i32 0, i32 2
  %95 = load i64, ptr %94, align 8, !tbaa !69
  %96 = icmp eq i64 %95, 0
  br i1 %96, label %97, label %104

97:                                               ; preds = %91
  %98 = load ptr, ptr %6, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct._XRRCrtcInfo, ptr %98, i32 0, i32 5
  %100 = load i64, ptr %99, align 8, !tbaa !70
  %101 = load ptr, ptr %3, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct._GLFWmonitor, ptr %101, i32 0, i32 10
  %103 = getelementptr inbounds %struct._GLFWmonitorX11, ptr %102, i32 0, i32 2
  store i64 %100, ptr %103, align 8, !tbaa !69
  br label %104

104:                                              ; preds = %97, %91
  %105 = load ptr, ptr getelementptr inbounds (%struct.anon.7, ptr getelementptr inbounds (%struct._GLFWlibraryX11, ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 16), i32 0, i32 64), i32 0, i32 22), align 8, !tbaa !72
  %106 = load ptr, ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 16), align 8, !tbaa !50
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = load ptr, ptr %3, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct._GLFWmonitor, ptr %108, i32 0, i32 10
  %110 = getelementptr inbounds %struct._GLFWmonitorX11, ptr %109, i32 0, i32 1
  %111 = load i64, ptr %110, align 8, !tbaa !53
  %112 = load ptr, ptr %6, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct._XRRCrtcInfo, ptr %112, i32 0, i32 1
  %114 = load i32, ptr %113, align 8, !tbaa !73
  %115 = load ptr, ptr %6, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct._XRRCrtcInfo, ptr %115, i32 0, i32 2
  %117 = load i32, ptr %116, align 4, !tbaa !74
  %118 = load i64, ptr %10, align 8, !tbaa !48
  %119 = load ptr, ptr %6, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct._XRRCrtcInfo, ptr %119, i32 0, i32 6
  %121 = load i16, ptr %120, align 8, !tbaa !75
  %122 = load ptr, ptr %6, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct._XRRCrtcInfo, ptr %122, i32 0, i32 8
  %124 = load ptr, ptr %123, align 8, !tbaa !76
  %125 = load ptr, ptr %6, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct._XRRCrtcInfo, ptr %125, i32 0, i32 7
  %127 = load i32, ptr %126, align 4, !tbaa !77
  %128 = call i32 %105(ptr noundef %106, ptr noundef %107, i64 noundef %111, i64 noundef 0, i32 noundef %114, i32 noundef %117, i64 noundef %118, i16 noundef zeroext %121, ptr noundef %124, i32 noundef %127)
  br label %129

129:                                              ; preds = %104, %88
  %130 = load ptr, ptr getelementptr inbounds (%struct.anon.7, ptr getelementptr inbounds (%struct._GLFWlibraryX11, ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 16), i32 0, i32 64), i32 0, i32 11), align 8, !tbaa !78
  %131 = load ptr, ptr %7, align 8, !tbaa !5
  call void %130(ptr noundef %131)
  %132 = load ptr, ptr getelementptr inbounds (%struct.anon.7, ptr getelementptr inbounds (%struct._GLFWlibraryX11, ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 16), i32 0, i32 64), i32 0, i32 9), align 8, !tbaa !79
  %133 = load ptr, ptr %6, align 8, !tbaa !5
  call void %132(ptr noundef %133)
  %134 = load ptr, ptr getelementptr inbounds (%struct.anon.7, ptr getelementptr inbounds (%struct._GLFWlibraryX11, ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 16), i32 0, i32 64), i32 0, i32 12), align 8, !tbaa !80
  %135 = load ptr, ptr %5, align 8, !tbaa !5
  call void %134(ptr noundef %135)
  store i32 0, ptr %12, align 4
  br label %136

136:                                              ; preds = %129, %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  %137 = load i32, ptr %12, align 4
  switch i32 %137, label %140 [
    i32 0, label %138
    i32 1, label %139
  ]

138:                                              ; preds = %136
  br label %139

139:                                              ; preds = %138, %136, %17, %2
  ret void

140:                                              ; preds = %136, %82
  unreachable
}

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

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

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

; Function Attrs: nounwind uwtable
declare hidden ptr @getModeInfo(ptr noundef, i64 noundef) #1

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

; Function Attrs: nounwind uwtable
declare hidden void @vidmodeFromModeInfo(ptr dead_on_unwind noalias writable sret(%struct.GLFWvidmode) align 4, ptr noundef, ptr noundef) #1

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 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 132448}
!10 = !{!"_GLFWlibrary", !11, i64 0, !12, i64 8, !6, i64 992, !6, i64 1000, !6, i64 1008, !6, i64 1016, !11, i64 1024, !7, i64 1032, !6, i64 130568, !11, i64 130576, !22, i64 130580, !22, i64 130588, !24, i64 130600, !26, i64 130648, !28, i64 130672, !29, i64 130736, !30, i64 130752, !42, i64 132960, !43, i64 133184, !45, i64 133264, !46, i64 133440}
!11 = !{!"int", !7, i64 0}
!12 = !{!"", !13, i64 0, !15, i64 16, !17, i64 88, !20, i64 920, !11, i64 976}
!13 = !{!"_GLFWinitconfig", !11, i64 0, !14, i64 4}
!14 = !{!"", !11, i64 0, !11, i64 4}
!15 = !{!"_GLFWfbconfig", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !16, i64 64}
!16 = !{!"long", !7, i64 0}
!17 = !{!"_GLFWwndconfig", !11, i64 0, !11, i64 4, !6, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !18, i64 56, !19, i64 316}
!18 = !{!"", !11, i64 0, !7, i64 4}
!19 = !{!"", !7, i64 0, !7, i64 256}
!20 = !{!"_GLFWctxconfig", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !6, i64 40, !21, i64 48}
!21 = !{!"", !11, i64 0}
!22 = !{!"_GLFWtls", !23, i64 0}
!23 = !{!"_GLFWtlsPOSIX", !11, i64 0, !11, i64 4}
!24 = !{!"_GLFWmutex", !25, i64 0}
!25 = !{!"_GLFWmutexPOSIX", !11, i64 0, !7, i64 8}
!26 = !{!"", !16, i64 0, !27, i64 8}
!27 = !{!"_GLFWtimerPOSIX", !11, i64 0, !16, i64 8}
!28 = !{!"", !11, i64 0, !6, i64 8, !7, i64 16, !6, i64 32, !6, i64 40, !11, i64 48, !11, i64 52, !11, i64 56}
!29 = !{!"", !6, i64 0, !6, i64 8}
!30 = !{!"_GLFWlibraryX11", !6, i64 0, !11, i64 8, !16, i64 16, !31, i64 24, !31, i64 28, !16, i64 32, !16, i64 40, !11, i64 48, !6, i64 56, !11, i64 64, !6, i64 72, !6, i64 80, !7, i64 88, !7, i64 94, !7, i64 606, !32, i64 1304, !32, i64 1312, !6, i64 1320, !16, i64 1328, !16, i64 1336, !16, i64 1344, !16, i64 1352, !16, i64 1360, !16, i64 1368, !16, i64 1376, !16, i64 1384, !16, i64 1392, !16, i64 1400, !16, i64 1408, !16, i64 1416, !16, i64 1424, !16, i64 1432, !16, i64 1440, !16, i64 1448, !16, i64 1456, !16, i64 1464, !16, i64 1472, !16, i64 1480, !16, i64 1488, !16, i64 1496, !16, i64 1504, !16, i64 1512, !16, i64 1520, !16, i64 1528, !16, i64 1536, !16, i64 1544, !16, i64 1552, !16, i64 1560, !16, i64 1568, !16, i64 1576, !16, i64 1584, !16, i64 1592, !16, i64 1600, !16, i64 1608, !16, i64 1616, !16, i64 1624, !16, i64 1632, !16, i64 1640, !16, i64 1648, !16, i64 1656, !16, i64 1664, !16, i64 1672, !16, i64 1680, !16, i64 1688, !33, i64 1696, !34, i64 1872, !35, i64 1900, !36, i64 1920, !37, i64 1944, !38, i64 1976, !29, i64 2024, !39, i64 2040, !40, i64 2096, !41, i64 2152}
!31 = !{!"float", !7, i64 0}
!32 = !{!"double", !7, i64 0}
!33 = !{!"", !11, i64 0, !6, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168}
!34 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24}
!35 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16}
!36 = !{!"", !11, i64 0, !16, i64 8, !16, i64 16}
!37 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!38 = !{!"", !11, i64 0, !6, i64 8, !11, i64 16, !11, i64 20, !6, i64 24, !6, i64 32, !6, i64 40}
!39 = !{!"", !11, i64 0, !6, i64 8, !11, i64 16, !11, i64 20, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!40 = !{!"", !11, i64 0, !6, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !6, i64 40, !6, i64 48}
!41 = !{!"", !11, i64 0, !6, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !6, i64 32, !6, i64 40, !6, i64 48}
!42 = !{!"_GLFWlibraryGLX", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !11, i64 176, !11, i64 180, !11, i64 184, !11, i64 188, !11, i64 192, !11, i64 196, !11, i64 200, !11, i64 204, !11, i64 208, !11, i64 212, !11, i64 216, !11, i64 220}
!43 = !{!"_GLFWlibraryLinux", !11, i64 0, !11, i64 4, !44, i64 8, !11, i64 72}
!44 = !{!"re_pattern_buffer", !6, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !6, i64 32, !6, i64 40, !16, i64 48, !11, i64 56, !11, i64 56, !11, i64 56, !11, i64 56, !11, i64 56, !11, i64 56, !11, i64 56}
!45 = !{!"_GLFWlibraryEGL", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168}
!46 = !{!"_GLFWlibraryOSMesa", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!47 = !{!10, !11, i64 132484}
!48 = !{!16, !16, i64 0}
!49 = !{!10, !6, i64 132568}
!50 = !{!10, !6, i64 130752}
!51 = !{!10, !16, i64 130768}
!52 = !{!10, !6, i64 132544}
!53 = !{!54, !16, i64 144}
!54 = !{!"_GLFWmonitor", !6, i64 0, !6, i64 8, !11, i64 16, !11, i64 20, !6, i64 24, !6, i64 32, !11, i64 40, !55, i64 44, !56, i64 72, !56, i64 104, !57, i64 136}
!55 = !{!"GLFWvidmode", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!56 = !{!"GLFWgammaramp", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24}
!57 = !{!"_GLFWmonitorX11", !16, i64 0, !16, i64 8, !16, i64 16, !11, i64 24}
!58 = !{!10, !6, i64 132552}
!59 = !{!54, !16, i64 136}
!60 = !{!11, !11, i64 0}
!61 = !{!62, !11, i64 80}
!62 = !{!"_XRROutputInfo", !16, i64 0, !16, i64 8, !6, i64 16, !11, i64 24, !16, i64 32, !16, i64 40, !63, i64 48, !63, i64 50, !11, i64 52, !6, i64 56, !11, i64 64, !6, i64 72, !11, i64 80, !11, i64 84, !6, i64 88}
!63 = !{!"short", !7, i64 0}
!64 = !{!62, !6, i64 88}
!65 = !{!66, !16, i64 0}
!66 = !{!"_XRRModeInfo", !16, i64 0, !11, i64 8, !11, i64 12, !16, i64 16, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !6, i64 56, !11, i64 64, !16, i64 72}
!67 = distinct !{!67, !68}
!68 = !{!"llvm.loop.mustprogress"}
!69 = !{!54, !16, i64 152}
!70 = !{!71, !16, i64 24}
!71 = !{!"_XRRCrtcInfo", !16, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !16, i64 24, !63, i64 32, !11, i64 36, !6, i64 40, !63, i64 48, !11, i64 52, !6, i64 56}
!72 = !{!10, !6, i64 132600}
!73 = !{!71, !11, i64 8}
!74 = !{!71, !11, i64 12}
!75 = !{!71, !63, i64 32}
!76 = !{!71, !6, i64 40}
!77 = !{!71, !11, i64 36}
!78 = !{!10, !6, i64 132512}
!79 = !{!10, !6, i64 132496}
!80 = !{!10, !6, i64 132520}


; 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._GLFWlibrary = type { i32, %struct.anon, ptr, ptr, ptr, ptr, i32, [16 x %struct._GLFWjoystick], ptr, i32, %struct._GLFWtls, %struct._GLFWtls, %struct._GLFWmutex, %struct.anon.4, %struct.anon.5, %struct.anon.6, %struct._GLFWlibraryX11, %struct._GLFWlibraryGLX, %struct._GLFWlibraryLinux, %struct._GLFWlibraryEGL, %struct._GLFWlibraryOSMesa }
%struct.anon = type { %struct._GLFWinitconfig, %struct._GLFWfbconfig, %struct._GLFWwndconfig, %struct._GLFWctxconfig, i32 }
%struct._GLFWinitconfig = type { i32, %struct.anon.0 }
%struct.anon.0 = type { i32, i32 }
%struct._GLFWfbconfig = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64 }
%struct._GLFWwndconfig = type { i32, i32, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.anon.1, %struct.anon.2 }
%struct.anon.1 = type { i32, [256 x i8] }
%struct.anon.2 = type { [256 x i8], [256 x i8] }
%struct._GLFWctxconfig = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, %struct.anon.3 }
%struct.anon.3 = type { i32 }
%struct._GLFWjoystick = type { i32, ptr, i32, ptr, i32, ptr, i32, ptr, ptr, [33 x i8], ptr, %struct._GLFWjoystickLinux }
%struct._GLFWjoystickLinux = type { i32, [4096 x i8], [512 x i32], [64 x i32], [64 x %struct.input_absinfo], [4 x [2 x i32]] }
%struct.input_absinfo = type { i32, i32, i32, i32, i32, i32 }
%struct._GLFWtls = type { %struct._GLFWtlsPOSIX }
%struct._GLFWtlsPOSIX = type { i32, i32 }
%struct._GLFWmutex = type { %struct._GLFWmutexPOSIX }
%struct._GLFWmutexPOSIX = type { i32, %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%struct.anon.4 = type { i64, %struct._GLFWtimerPOSIX }
%struct._GLFWtimerPOSIX = type { i32, i64 }
%struct.anon.5 = type { i32, ptr, [2 x ptr], ptr, ptr, i32, i32, i32 }
%struct.anon.6 = type { ptr, ptr }
%struct._GLFWlibraryX11 = type { ptr, i32, i64, float, float, i64, i64, i32, ptr, i32, ptr, ptr, [5 x i8], [256 x i16], [349 x i16], double, double, ptr, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, %struct.anon.7, %struct.anon.8, %struct.anon.9, %struct.anon.10, %struct.anon.11, %struct.anon.12, %struct.anon.13, %struct.anon.14, %struct.anon.15, %struct.anon.16 }
%struct.anon.7 = type { i32, ptr, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.anon.8 = type { i32, i32, i32, i32, i32, i32, i32 }
%struct.anon.9 = type { i32, i32, i32, i32, i32 }
%struct.anon.10 = type { i32, i64, i64 }
%struct.anon.11 = type { ptr, ptr, ptr, ptr }
%struct.anon.12 = type { i32, ptr, i32, i32, ptr, ptr, ptr }
%struct.anon.13 = type { ptr, ptr }
%struct.anon.14 = type { i32, ptr, i32, i32, ptr, ptr, ptr, ptr }
%struct.anon.15 = type { i32, ptr, i32, i32, i32, i32, i32, ptr, ptr }
%struct.anon.16 = type { i32, ptr, i32, i32, i32, i32, ptr, ptr, ptr }
%struct._GLFWlibraryGLX = type { i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct._GLFWlibraryLinux = type { i32, i32, %struct.re_pattern_buffer, i32 }
%struct.re_pattern_buffer = type { ptr, i64, i64, i64, ptr, ptr, i64, i8 }
%struct._GLFWlibraryEGL = type { ptr, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._GLFWlibraryOSMesa = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.GLFWvidmode = type { i32, i32, i32, i32, i32, i32 }

@_glfw = external local_unnamed_addr global %struct._GLFWlibrary, 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
define dso_local void @_glfwSetVideoModeX11(ptr noundef %0, ptr noundef %1) local_unnamed_addr #1 {
  %3 = alloca %struct.GLFWvidmode, align 4
  %4 = alloca %struct.GLFWvidmode, align 4
  %5 = load i32, ptr getelementptr inbounds (i8, ptr @_glfw, i64 132448), align 8, !tbaa !5
  %6 = icmp eq i32 %5, 0
  %7 = load i32, ptr getelementptr inbounds (i8, ptr @_glfw, i64 132484), align 4
  %8 = icmp ne i32 %7, 0
  %or.cond = select i1 %6, i1 true, i1 %8
  br i1 %or.cond, label %72, label %9

9:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #3
  %10 = tail call ptr @_glfwChooseVideoMode(ptr noundef %0, ptr noundef %1) #3
  call void @_glfwPlatformGetVideoMode(ptr noundef %0, ptr noundef nonnull %3)
  %11 = call i32 @_glfwCompareVideoModes(ptr noundef nonnull %3, ptr noundef %10) #3
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %71, label %13

13:                                               ; preds = %9
  %14 = load ptr, ptr getelementptr inbounds (i8, ptr @_glfw, i64 132568), align 8, !tbaa !46
  %15 = load ptr, ptr getelementptr inbounds (i8, ptr @_glfw, i64 130752), align 8, !tbaa !47
  %16 = load i64, ptr getelementptr inbounds (i8, ptr @_glfw, i64 130768), align 8, !tbaa !48
  %17 = call ptr %14(ptr noundef %15, i64 noundef %16) #3
  %18 = load ptr, ptr getelementptr inbounds (i8, ptr @_glfw, i64 132544), align 8, !tbaa !49
  %19 = load ptr, ptr getelementptr inbounds (i8, ptr @_glfw, i64 130752), align 8, !tbaa !47
  %20 = getelementptr inbounds i8, ptr %0, i64 136
  %21 = getelementptr inbounds i8, ptr %0, i64 144
  %22 = load i64, ptr %21, align 8, !tbaa !50
  %23 = call ptr %18(ptr noundef %19, ptr noundef %17, i64 noundef %22) #3
  %24 = load ptr, ptr getelementptr inbounds (i8, ptr @_glfw, i64 132552), align 8, !tbaa !55
  %25 = load ptr, ptr getelementptr inbounds (i8, ptr @_glfw, i64 130752), align 8, !tbaa !47
  %26 = load i64, ptr %20, align 8, !tbaa !56
  %27 = call ptr %24(ptr noundef %25, ptr noundef %17, i64 noundef %26) #3
  %28 = getelementptr inbounds i8, ptr %27, i64 80
  %29 = load i32, ptr %28, align 8, !tbaa !57
  %30 = icmp sgt i32 %29, 0
  br i1 %30, label %.lr.ph, label %.loopexit.thread

.lr.ph:                                           ; preds = %13
  %31 = getelementptr inbounds i8, ptr %27, i64 88
  br label %32

32:                                               ; preds = %.lr.ph, %.thread
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %.thread ]
  %33 = load ptr, ptr %31, align 8, !tbaa !60
  %34 = getelementptr inbounds i64, ptr %33, i64 %indvars.iv
  %35 = load i64, ptr %34, align 8, !tbaa !61
  %36 = call ptr @getModeInfo(ptr noundef %17, i64 noundef %35)
  %37 = call i32 @modeIsGood(ptr noundef %36)
  %.not = icmp eq i32 %37, 0
  br i1 %.not, label %.thread, label %38

38:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #3
  call void @vidmodeFromModeInfo(ptr dead_on_unwind nonnull writable sret(%struct.GLFWvidmode) align 4 %4, ptr noundef %36, ptr noundef %23)
  %39 = call i32 @_glfwCompareVideoModes(ptr noundef %10, ptr noundef nonnull %4) #3
  %40 = icmp eq i32 %39, 0
  br i1 %40, label %.loopexit, label %41

41:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #3
  br label %.thread

.thread:                                          ; preds = %32, %41
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %42 = load i32, ptr %28, align 8, !tbaa !57
  %43 = sext i32 %42 to i64
  %44 = icmp slt i64 %indvars.iv.next, %43
  br i1 %44, label %32, label %.loopexit.thread, !llvm.loop !62

.loopexit:                                        ; preds = %38
  %45 = load i64, ptr %36, align 8, !tbaa !64
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #3
  %.not38 = icmp eq i64 %45, 0
  br i1 %.not38, label %.loopexit.thread, label %46

46:                                               ; preds = %.loopexit
  %47 = getelementptr inbounds i8, ptr %0, i64 152
  %48 = load i64, ptr %47, align 8, !tbaa !66
  %49 = icmp eq i64 %48, 0
  br i1 %49, label %50, label %53

50:                                               ; preds = %46
  %51 = getelementptr inbounds i8, ptr %23, i64 24
  %52 = load i64, ptr %51, align 8, !tbaa !67
  store i64 %52, ptr %47, align 8, !tbaa !66
  br label %53

53:                                               ; preds = %50, %46
  %54 = load ptr, ptr getelementptr inbounds (i8, ptr @_glfw, i64 132600), align 8, !tbaa !69
  %55 = load ptr, ptr getelementptr inbounds (i8, ptr @_glfw, i64 130752), align 8, !tbaa !47
  %56 = load i64, ptr %21, align 8, !tbaa !50
  %57 = getelementptr inbounds i8, ptr %23, i64 8
  %58 = load i32, ptr %57, align 8, !tbaa !70
  %59 = getelementptr inbounds i8, ptr %23, i64 12
  %60 = load i32, ptr %59, align 4, !tbaa !71
  %61 = getelementptr inbounds i8, ptr %23, i64 32
  %62 = load i16, ptr %61, align 8, !tbaa !72
  %63 = getelementptr inbounds i8, ptr %23, i64 40
  %64 = load ptr, ptr %63, align 8, !tbaa !73
  %65 = getelementptr inbounds i8, ptr %23, i64 36
  %66 = load i32, ptr %65, align 4, !tbaa !74
  %67 = call i32 %54(ptr noundef %55, ptr noundef %17, i64 noundef %56, i64 noundef 0, i32 noundef %58, i32 noundef %60, i64 noundef %45, i16 noundef zeroext %62, ptr noundef %64, i32 noundef %66) #3
  br label %.loopexit.thread

.loopexit.thread:                                 ; preds = %.thread, %13, %53, %.loopexit
  %68 = load ptr, ptr getelementptr inbounds (i8, ptr @_glfw, i64 132512), align 8, !tbaa !75
  call void %68(ptr noundef nonnull %27) #3
  %69 = load ptr, ptr getelementptr inbounds (i8, ptr @_glfw, i64 132496), align 8, !tbaa !76
  call void %69(ptr noundef %23) #3
  %70 = load ptr, ptr getelementptr inbounds (i8, ptr @_glfw, i64 132520), align 8, !tbaa !77
  call void %70(ptr noundef %17) #3
  br label %71

71:                                               ; preds = %9, %.loopexit.thread
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #3
  br label %72

72:                                               ; preds = %71, %2
  ret void
}

declare ptr @_glfwChooseVideoMode(ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare i32 @_glfwCompareVideoModes(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden ptr @getModeInfo(ptr noundef, i64 noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare hidden void @vidmodeFromModeInfo(ptr dead_on_unwind noalias writable sret(%struct.GLFWvidmode) align 4, ptr noundef, ptr noundef) local_unnamed_addr #1

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!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, !7, i64 132448}
!6 = !{!"_GLFWlibrary", !7, i64 0, !10, i64 8, !16, i64 992, !16, i64 1000, !16, i64 1008, !16, i64 1016, !7, i64 1024, !8, i64 1032, !16, i64 130568, !7, i64 130576, !21, i64 130580, !21, i64 130588, !23, i64 130600, !25, i64 130648, !27, i64 130672, !28, i64 130736, !29, i64 130752, !41, i64 132960, !42, i64 133184, !44, i64 133264, !45, i64 133440}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"", !11, i64 0, !13, i64 16, !15, i64 88, !19, i64 920, !7, i64 976}
!11 = !{!"_GLFWinitconfig", !7, i64 0, !12, i64 4}
!12 = !{!"", !7, i64 0, !7, i64 4}
!13 = !{!"_GLFWfbconfig", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !14, i64 64}
!14 = !{!"long", !8, i64 0}
!15 = !{!"_GLFWwndconfig", !7, i64 0, !7, i64 4, !16, i64 8, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !17, i64 56, !18, i64 316}
!16 = !{!"any pointer", !8, i64 0}
!17 = !{!"", !7, i64 0, !8, i64 4}
!18 = !{!"", !8, i64 0, !8, i64 256}
!19 = !{!"_GLFWctxconfig", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !16, i64 40, !20, i64 48}
!20 = !{!"", !7, i64 0}
!21 = !{!"_GLFWtls", !22, i64 0}
!22 = !{!"_GLFWtlsPOSIX", !7, i64 0, !7, i64 4}
!23 = !{!"_GLFWmutex", !24, i64 0}
!24 = !{!"_GLFWmutexPOSIX", !7, i64 0, !8, i64 8}
!25 = !{!"", !14, i64 0, !26, i64 8}
!26 = !{!"_GLFWtimerPOSIX", !7, i64 0, !14, i64 8}
!27 = !{!"", !7, i64 0, !16, i64 8, !8, i64 16, !16, i64 32, !16, i64 40, !7, i64 48, !7, i64 52, !7, i64 56}
!28 = !{!"", !16, i64 0, !16, i64 8}
!29 = !{!"_GLFWlibraryX11", !16, i64 0, !7, i64 8, !14, i64 16, !30, i64 24, !30, i64 28, !14, i64 32, !14, i64 40, !7, i64 48, !16, i64 56, !7, i64 64, !16, i64 72, !16, i64 80, !8, i64 88, !8, i64 94, !8, i64 606, !31, i64 1304, !31, i64 1312, !16, i64 1320, !14, i64 1328, !14, i64 1336, !14, i64 1344, !14, i64 1352, !14, i64 1360, !14, i64 1368, !14, i64 1376, !14, i64 1384, !14, i64 1392, !14, i64 1400, !14, i64 1408, !14, i64 1416, !14, i64 1424, !14, i64 1432, !14, i64 1440, !14, i64 1448, !14, i64 1456, !14, i64 1464, !14, i64 1472, !14, i64 1480, !14, i64 1488, !14, i64 1496, !14, i64 1504, !14, i64 1512, !14, i64 1520, !14, i64 1528, !14, i64 1536, !14, i64 1544, !14, i64 1552, !14, i64 1560, !14, i64 1568, !14, i64 1576, !14, i64 1584, !14, i64 1592, !14, i64 1600, !14, i64 1608, !14, i64 1616, !14, i64 1624, !14, i64 1632, !14, i64 1640, !14, i64 1648, !14, i64 1656, !14, i64 1664, !14, i64 1672, !14, i64 1680, !14, i64 1688, !32, i64 1696, !33, i64 1872, !34, i64 1900, !35, i64 1920, !36, i64 1944, !37, i64 1976, !28, i64 2024, !38, i64 2040, !39, i64 2096, !40, i64 2152}
!30 = !{!"float", !8, i64 0}
!31 = !{!"double", !8, i64 0}
!32 = !{!"", !7, i64 0, !16, i64 8, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !16, i64 40, !16, i64 48, !16, i64 56, !16, i64 64, !16, i64 72, !16, i64 80, !16, i64 88, !16, i64 96, !16, i64 104, !16, i64 112, !16, i64 120, !16, i64 128, !16, i64 136, !16, i64 144, !16, i64 152, !16, i64 160, !16, i64 168}
!33 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24}
!34 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16}
!35 = !{!"", !7, i64 0, !14, i64 8, !14, i64 16}
!36 = !{!"", !16, i64 0, !16, i64 8, !16, i64 16, !16, i64 24}
!37 = !{!"", !7, i64 0, !16, i64 8, !7, i64 16, !7, i64 20, !16, i64 24, !16, i64 32, !16, i64 40}
!38 = !{!"", !7, i64 0, !16, i64 8, !7, i64 16, !7, i64 20, !16, i64 24, !16, i64 32, !16, i64 40, !16, i64 48}
!39 = !{!"", !7, i64 0, !16, i64 8, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !16, i64 40, !16, i64 48}
!40 = !{!"", !7, i64 0, !16, i64 8, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !16, i64 32, !16, i64 40, !16, i64 48}
!41 = !{!"_GLFWlibraryGLX", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !16, i64 16, !16, i64 24, !16, i64 32, !16, i64 40, !16, i64 48, !16, i64 56, !16, i64 64, !16, i64 72, !16, i64 80, !16, i64 88, !16, i64 96, !16, i64 104, !16, i64 112, !16, i64 120, !16, i64 128, !16, i64 136, !16, i64 144, !16, i64 152, !16, i64 160, !16, i64 168, !7, i64 176, !7, i64 180, !7, i64 184, !7, i64 188, !7, i64 192, !7, i64 196, !7, i64 200, !7, i64 204, !7, i64 208, !7, i64 212, !7, i64 216, !7, i64 220}
!42 = !{!"_GLFWlibraryLinux", !7, i64 0, !7, i64 4, !43, i64 8, !7, i64 72}
!43 = !{!"re_pattern_buffer", !16, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !16, i64 32, !16, i64 40, !14, i64 48, !7, i64 56, !7, i64 56, !7, i64 56, !7, i64 56, !7, i64 56, !7, i64 56, !7, i64 56}
!44 = !{!"_GLFWlibraryEGL", !16, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !16, i64 40, !16, i64 48, !16, i64 56, !16, i64 64, !16, i64 72, !16, i64 80, !16, i64 88, !16, i64 96, !16, i64 104, !16, i64 112, !16, i64 120, !16, i64 128, !16, i64 136, !16, i64 144, !16, i64 152, !16, i64 160, !16, i64 168}
!45 = !{!"_GLFWlibraryOSMesa", !16, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !16, i64 32, !16, i64 40, !16, i64 48, !16, i64 56}
!46 = !{!6, !16, i64 132568}
!47 = !{!6, !16, i64 130752}
!48 = !{!6, !14, i64 130768}
!49 = !{!6, !16, i64 132544}
!50 = !{!51, !14, i64 144}
!51 = !{!"_GLFWmonitor", !16, i64 0, !16, i64 8, !7, i64 16, !7, i64 20, !16, i64 24, !16, i64 32, !7, i64 40, !52, i64 44, !53, i64 72, !53, i64 104, !54, i64 136}
!52 = !{!"GLFWvidmode", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!53 = !{!"GLFWgammaramp", !16, i64 0, !16, i64 8, !16, i64 16, !7, i64 24}
!54 = !{!"_GLFWmonitorX11", !14, i64 0, !14, i64 8, !14, i64 16, !7, i64 24}
!55 = !{!6, !16, i64 132552}
!56 = !{!51, !14, i64 136}
!57 = !{!58, !7, i64 80}
!58 = !{!"_XRROutputInfo", !14, i64 0, !14, i64 8, !16, i64 16, !7, i64 24, !14, i64 32, !14, i64 40, !59, i64 48, !59, i64 50, !7, i64 52, !16, i64 56, !7, i64 64, !16, i64 72, !7, i64 80, !7, i64 84, !16, i64 88}
!59 = !{!"short", !8, i64 0}
!60 = !{!58, !16, i64 88}
!61 = !{!14, !14, i64 0}
!62 = distinct !{!62, !63}
!63 = !{!"llvm.loop.mustprogress"}
!64 = !{!65, !14, i64 0}
!65 = !{!"_XRRModeInfo", !14, i64 0, !7, i64 8, !7, i64 12, !14, i64 16, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !16, i64 56, !7, i64 64, !14, i64 72}
!66 = !{!51, !14, i64 152}
!67 = !{!68, !14, i64 24}
!68 = !{!"_XRRCrtcInfo", !14, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !14, i64 24, !59, i64 32, !7, i64 36, !16, i64 40, !59, i64 48, !7, i64 52, !16, i64 56}
!69 = !{!6, !16, i64 132600}
!70 = !{!68, !7, i64 8}
!71 = !{!68, !7, i64 12}
!72 = !{!68, !59, i64 32}
!73 = !{!68, !16, i64 40}
!74 = !{!68, !7, i64 36}
!75 = !{!6, !16, i64 132512}
!76 = !{!6, !16, i64 132496}
!77 = !{!6, !16, i64 132520}


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