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

; 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._XRRScreenResources = type { i64, i64, i32, ptr, i32, ptr, i32, ptr }
%struct._XRROutputInfo = type { i64, i64, ptr, i32, i64, i64, i16, i16, i32, ptr, i32, ptr, i32, i32, ptr }
%struct._GLFWmonitor = type { ptr, ptr, i32, i32, ptr, ptr, i32, %struct.GLFWvidmode, %struct.GLFWgammaramp, %struct.GLFWgammaramp, %struct._GLFWmonitorX11 }
%struct.GLFWvidmode = type { i32, i32, i32, i32, i32, i32 }
%struct.GLFWgammaramp = type { ptr, ptr, ptr, i32 }
%struct._GLFWmonitorX11 = type { i64, i64, i64, i32 }
%struct._XRRCrtcInfo = type { i64, i32, i32, i32, i32, i64, i16, i32, ptr, i16, i32, ptr }
%struct.XineramaScreenInfo = type { i32, i16, i16, i16, i16 }
%struct.anon.17 = type { ptr, ptr, i32, i32, i32, i32, ptr, i64, i64, i64, i32, ptr, i32, i32, i32, i32, i32, ptr, i32, i32, ptr, ptr, i32, i64, i64, ptr, ptr, ptr, ptr, i32, ptr, ptr, ptr, i32, i32, ptr, i64, i64, i32, i32, ptr, ptr, i32, ptr }
%struct.Screen = type { ptr, ptr, i64, i32, i32, i32, i32, i32, ptr, i32, ptr, ptr, i64, i64, i64, i32, i32, i32, i32, i64 }

@_glfw = external global %struct._GLFWlibrary, align 8
@.str = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @_glfwPollMonitorsX11() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = 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 !5
  %19 = icmp ne i32 %18, 0
  br i1 %19, label %20, label %303

20:                                               ; preds = %0
  %21 = 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 !46
  %22 = icmp ne i32 %21, 0
  br i1 %22, label %303, label %23

23:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !47
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store ptr null, ptr %5, align 8, !tbaa !48
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store ptr null, ptr %6, align 8, !tbaa !48
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %24 = 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
  %25 = load ptr, ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 16), align 8, !tbaa !50
  %26 = 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
  %27 = call ptr %24(ptr noundef %25, i64 noundef %26)
  store ptr %27, ptr %7, align 8, !tbaa !48
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %28 = 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 17), align 8, !tbaa !52
  %29 = load ptr, ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 16), align 8, !tbaa !50
  %30 = 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
  %31 = call i64 %28(ptr noundef %29, i64 noundef %30)
  store i64 %31, ptr %8, align 8, !tbaa !53
  %32 = load i32, ptr getelementptr inbounds (%struct._GLFWlibraryX11, ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 16), i32 0, i32 69), align 8, !tbaa !54
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %34, label %38

34:                                               ; preds = %23
  %35 = load ptr, ptr getelementptr inbounds (%struct.anon.12, ptr getelementptr inbounds (%struct._GLFWlibraryX11, ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 16), i32 0, i32 69), i32 0, i32 6), align 8, !tbaa !55
  %36 = load ptr, ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 16), align 8, !tbaa !50
  %37 = call ptr %35(ptr noundef %36, ptr noundef %4)
  store ptr %37, ptr %6, align 8, !tbaa !48
  br label %38

38:                                               ; preds = %34, %23
  %39 = load i32, ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 6), align 8, !tbaa !56
  store i32 %39, ptr %3, align 4, !tbaa !47
  %40 = load i32, ptr %3, align 4, !tbaa !47
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %42, label %51

42:                                               ; preds = %38
  %43 = load i32, ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 6), align 8, !tbaa !56
  %44 = sext i32 %43 to i64
  %45 = call noalias ptr @calloc(i64 noundef %44, i64 noundef 8) #7
  store ptr %45, ptr %5, align 8, !tbaa !48
  %46 = load ptr, ptr %5, align 8, !tbaa !48
  %47 = load ptr, ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 5), align 8, !tbaa !57
  %48 = load i32, ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 6), align 8, !tbaa !56
  %49 = sext i32 %48 to i64
  %50 = mul i64 %49, 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %46, ptr align 8 %47, i64 %50, i1 false)
  br label %51

51:                                               ; preds = %42, %38
  store i32 0, ptr %1, align 4, !tbaa !47
  br label %52

52:                                               ; preds = %268, %51
  %53 = load i32, ptr %1, align 4, !tbaa !47
  %54 = load ptr, ptr %7, align 8, !tbaa !48
  %55 = getelementptr inbounds %struct._XRRScreenResources, ptr %54, i32 0, i32 4
  %56 = load i32, ptr %55, align 8, !tbaa !58
  %57 = icmp slt i32 %53, %56
  br i1 %57, label %58, label %271

58:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %59 = 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 !60
  %60 = load ptr, ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 16), align 8, !tbaa !50
  %61 = load ptr, ptr %7, align 8, !tbaa !48
  %62 = load ptr, ptr %7, align 8, !tbaa !48
  %63 = getelementptr inbounds %struct._XRRScreenResources, ptr %62, i32 0, i32 5
  %64 = load ptr, ptr %63, align 8, !tbaa !61
  %65 = load i32, ptr %1, align 4, !tbaa !47
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds i64, ptr %64, i64 %66
  %68 = load i64, ptr %67, align 8, !tbaa !53
  %69 = call ptr %59(ptr noundef %60, ptr noundef %61, i64 noundef %68)
  store ptr %69, ptr %12, align 8, !tbaa !48
  %70 = load ptr, ptr %12, align 8, !tbaa !48
  %71 = getelementptr inbounds %struct._XRROutputInfo, ptr %70, i32 0, i32 6
  %72 = load i16, ptr %71, align 8, !tbaa !62
  %73 = zext i16 %72 to i32
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %80, label %75

75:                                               ; preds = %58
  %76 = load ptr, ptr %12, align 8, !tbaa !48
  %77 = getelementptr inbounds %struct._XRROutputInfo, ptr %76, i32 0, i32 1
  %78 = load i64, ptr %77, align 8, !tbaa !65
  %79 = icmp eq i64 %78, 0
  br i1 %79, label %80, label %83

80:                                               ; preds = %75, %58
  %81 = 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 !66
  %82 = load ptr, ptr %12, align 8, !tbaa !48
  call void %81(ptr noundef %82)
  store i32 4, ptr %15, align 4
  br label %265

83:                                               ; preds = %75
  store i32 0, ptr %2, align 4, !tbaa !47
  br label %84

84:                                               ; preds = %118, %83
  %85 = load i32, ptr %2, align 4, !tbaa !47
  %86 = load i32, ptr %3, align 4, !tbaa !47
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %88, label %121

88:                                               ; preds = %84
  %89 = load ptr, ptr %5, align 8, !tbaa !48
  %90 = load i32, ptr %2, align 4, !tbaa !47
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds ptr, ptr %89, i64 %91
  %93 = load ptr, ptr %92, align 8, !tbaa !48
  %94 = icmp ne ptr %93, null
  br i1 %94, label %95, label %117

95:                                               ; preds = %88
  %96 = load ptr, ptr %5, align 8, !tbaa !48
  %97 = load i32, ptr %2, align 4, !tbaa !47
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds ptr, ptr %96, i64 %98
  %100 = load ptr, ptr %99, align 8, !tbaa !48
  %101 = getelementptr inbounds %struct._GLFWmonitor, ptr %100, i32 0, i32 10
  %102 = getelementptr inbounds %struct._GLFWmonitorX11, ptr %101, i32 0, i32 0
  %103 = load i64, ptr %102, align 8, !tbaa !67
  %104 = load ptr, ptr %7, align 8, !tbaa !48
  %105 = getelementptr inbounds %struct._XRRScreenResources, ptr %104, i32 0, i32 5
  %106 = load ptr, ptr %105, align 8, !tbaa !61
  %107 = load i32, ptr %1, align 4, !tbaa !47
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds i64, ptr %106, i64 %108
  %110 = load i64, ptr %109, align 8, !tbaa !53
  %111 = icmp eq i64 %103, %110
  br i1 %111, label %112, label %117

112:                                              ; preds = %95
  %113 = load ptr, ptr %5, align 8, !tbaa !48
  %114 = load i32, ptr %2, align 4, !tbaa !47
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds ptr, ptr %113, i64 %115
  store ptr null, ptr %116, align 8, !tbaa !48
  br label %121

117:                                              ; preds = %95, %88
  br label %118

118:                                              ; preds = %117
  %119 = load i32, ptr %2, align 4, !tbaa !47
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %2, align 4, !tbaa !47
  br label %84, !llvm.loop !72

121:                                              ; preds = %112, %84
  %122 = load i32, ptr %2, align 4, !tbaa !47
  %123 = load i32, ptr %3, align 4, !tbaa !47
  %124 = icmp slt i32 %122, %123
  br i1 %124, label %125, label %128

125:                                              ; preds = %121
  %126 = 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 !66
  %127 = load ptr, ptr %12, align 8, !tbaa !48
  call void %126(ptr noundef %127)
  store i32 4, ptr %15, align 4
  br label %265

128:                                              ; preds = %121
  %129 = 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 !74
  %130 = load ptr, ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 16), align 8, !tbaa !50
  %131 = load ptr, ptr %7, align 8, !tbaa !48
  %132 = load ptr, ptr %12, align 8, !tbaa !48
  %133 = getelementptr inbounds %struct._XRROutputInfo, ptr %132, i32 0, i32 1
  %134 = load i64, ptr %133, align 8, !tbaa !65
  %135 = call ptr %129(ptr noundef %130, ptr noundef %131, i64 noundef %134)
  store ptr %135, ptr %13, align 8, !tbaa !48
  %136 = load ptr, ptr %13, align 8, !tbaa !48
  %137 = getelementptr inbounds %struct._XRRCrtcInfo, ptr %136, i32 0, i32 6
  %138 = load i16, ptr %137, align 8, !tbaa !75
  %139 = zext i16 %138 to i32
  %140 = icmp eq i32 %139, 2
  br i1 %140, label %147, label %141

141:                                              ; preds = %128
  %142 = load ptr, ptr %13, align 8, !tbaa !48
  %143 = getelementptr inbounds %struct._XRRCrtcInfo, ptr %142, i32 0, i32 6
  %144 = load i16, ptr %143, align 8, !tbaa !75
  %145 = zext i16 %144 to i32
  %146 = icmp eq i32 %145, 8
  br i1 %146, label %147, label %156

147:                                              ; preds = %141, %128
  %148 = load ptr, ptr %12, align 8, !tbaa !48
  %149 = getelementptr inbounds %struct._XRROutputInfo, ptr %148, i32 0, i32 5
  %150 = load i64, ptr %149, align 8, !tbaa !77
  %151 = trunc i64 %150 to i32
  store i32 %151, ptr %10, align 4, !tbaa !47
  %152 = load ptr, ptr %12, align 8, !tbaa !48
  %153 = getelementptr inbounds %struct._XRROutputInfo, ptr %152, i32 0, i32 4
  %154 = load i64, ptr %153, align 8, !tbaa !78
  %155 = trunc i64 %154 to i32
  store i32 %155, ptr %11, align 4, !tbaa !47
  br label %165

156:                                              ; preds = %141
  %157 = load ptr, ptr %12, align 8, !tbaa !48
  %158 = getelementptr inbounds %struct._XRROutputInfo, ptr %157, i32 0, i32 4
  %159 = load i64, ptr %158, align 8, !tbaa !78
  %160 = trunc i64 %159 to i32
  store i32 %160, ptr %10, align 4, !tbaa !47
  %161 = load ptr, ptr %12, align 8, !tbaa !48
  %162 = getelementptr inbounds %struct._XRROutputInfo, ptr %161, i32 0, i32 5
  %163 = load i64, ptr %162, align 8, !tbaa !77
  %164 = trunc i64 %163 to i32
  store i32 %164, ptr %11, align 4, !tbaa !47
  br label %165

165:                                              ; preds = %156, %147
  %166 = load ptr, ptr %12, align 8, !tbaa !48
  %167 = getelementptr inbounds %struct._XRROutputInfo, ptr %166, i32 0, i32 2
  %168 = load ptr, ptr %167, align 8, !tbaa !79
  %169 = load i32, ptr %10, align 4, !tbaa !47
  %170 = load i32, ptr %11, align 4, !tbaa !47
  %171 = call ptr @_glfwAllocMonitor(ptr noundef %168, i32 noundef %169, i32 noundef %170)
  store ptr %171, ptr %14, align 8, !tbaa !48
  %172 = load ptr, ptr %7, align 8, !tbaa !48
  %173 = getelementptr inbounds %struct._XRRScreenResources, ptr %172, i32 0, i32 5
  %174 = load ptr, ptr %173, align 8, !tbaa !61
  %175 = load i32, ptr %1, align 4, !tbaa !47
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds i64, ptr %174, i64 %176
  %178 = load i64, ptr %177, align 8, !tbaa !53
  %179 = load ptr, ptr %14, align 8, !tbaa !48
  %180 = getelementptr inbounds %struct._GLFWmonitor, ptr %179, i32 0, i32 10
  %181 = getelementptr inbounds %struct._GLFWmonitorX11, ptr %180, i32 0, i32 0
  store i64 %178, ptr %181, align 8, !tbaa !67
  %182 = load ptr, ptr %12, align 8, !tbaa !48
  %183 = getelementptr inbounds %struct._XRROutputInfo, ptr %182, i32 0, i32 1
  %184 = load i64, ptr %183, align 8, !tbaa !65
  %185 = load ptr, ptr %14, align 8, !tbaa !48
  %186 = getelementptr inbounds %struct._GLFWmonitor, ptr %185, i32 0, i32 10
  %187 = getelementptr inbounds %struct._GLFWmonitorX11, ptr %186, i32 0, i32 1
  store i64 %184, ptr %187, align 8, !tbaa !80
  store i32 0, ptr %2, align 4, !tbaa !47
  br label %188

188:                                              ; preds = %246, %165
  %189 = load i32, ptr %2, align 4, !tbaa !47
  %190 = load i32, ptr %4, align 4, !tbaa !47
  %191 = icmp slt i32 %189, %190
  br i1 %191, label %192, label %249

192:                                              ; preds = %188
  %193 = load ptr, ptr %6, align 8, !tbaa !48
  %194 = load i32, ptr %2, align 4, !tbaa !47
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds %struct.XineramaScreenInfo, ptr %193, i64 %195
  %197 = getelementptr inbounds %struct.XineramaScreenInfo, ptr %196, i32 0, i32 1
  %198 = load i16, ptr %197, align 4, !tbaa !81
  %199 = sext i16 %198 to i32
  %200 = load ptr, ptr %13, align 8, !tbaa !48
  %201 = getelementptr inbounds %struct._XRRCrtcInfo, ptr %200, i32 0, i32 1
  %202 = load i32, ptr %201, align 8, !tbaa !83
  %203 = icmp eq i32 %199, %202
  br i1 %203, label %204, label %245

204:                                              ; preds = %192
  %205 = load ptr, ptr %6, align 8, !tbaa !48
  %206 = load i32, ptr %2, align 4, !tbaa !47
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds %struct.XineramaScreenInfo, ptr %205, i64 %207
  %209 = getelementptr inbounds %struct.XineramaScreenInfo, ptr %208, i32 0, i32 2
  %210 = load i16, ptr %209, align 2, !tbaa !84
  %211 = sext i16 %210 to i32
  %212 = load ptr, ptr %13, align 8, !tbaa !48
  %213 = getelementptr inbounds %struct._XRRCrtcInfo, ptr %212, i32 0, i32 2
  %214 = load i32, ptr %213, align 4, !tbaa !85
  %215 = icmp eq i32 %211, %214
  br i1 %215, label %216, label %245

216:                                              ; preds = %204
  %217 = load ptr, ptr %6, align 8, !tbaa !48
  %218 = load i32, ptr %2, align 4, !tbaa !47
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds %struct.XineramaScreenInfo, ptr %217, i64 %219
  %221 = getelementptr inbounds %struct.XineramaScreenInfo, ptr %220, i32 0, i32 3
  %222 = load i16, ptr %221, align 4, !tbaa !86
  %223 = sext i16 %222 to i32
  %224 = load ptr, ptr %13, align 8, !tbaa !48
  %225 = getelementptr inbounds %struct._XRRCrtcInfo, ptr %224, i32 0, i32 3
  %226 = load i32, ptr %225, align 8, !tbaa !87
  %227 = icmp eq i32 %223, %226
  br i1 %227, label %228, label %245

228:                                              ; preds = %216
  %229 = load ptr, ptr %6, align 8, !tbaa !48
  %230 = load i32, ptr %2, align 4, !tbaa !47
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds %struct.XineramaScreenInfo, ptr %229, i64 %231
  %233 = getelementptr inbounds %struct.XineramaScreenInfo, ptr %232, i32 0, i32 4
  %234 = load i16, ptr %233, align 2, !tbaa !88
  %235 = sext i16 %234 to i32
  %236 = load ptr, ptr %13, align 8, !tbaa !48
  %237 = getelementptr inbounds %struct._XRRCrtcInfo, ptr %236, i32 0, i32 4
  %238 = load i32, ptr %237, align 4, !tbaa !89
  %239 = icmp eq i32 %235, %238
  br i1 %239, label %240, label %245

240:                                              ; preds = %228
  %241 = load i32, ptr %2, align 4, !tbaa !47
  %242 = load ptr, ptr %14, align 8, !tbaa !48
  %243 = getelementptr inbounds %struct._GLFWmonitor, ptr %242, i32 0, i32 10
  %244 = getelementptr inbounds %struct._GLFWmonitorX11, ptr %243, i32 0, i32 3
  store i32 %241, ptr %244, align 8, !tbaa !90
  br label %249

245:                                              ; preds = %228, %216, %204, %192
  br label %246

246:                                              ; preds = %245
  %247 = load i32, ptr %2, align 4, !tbaa !47
  %248 = add nsw i32 %247, 1
  store i32 %248, ptr %2, align 4, !tbaa !47
  br label %188, !llvm.loop !91

249:                                              ; preds = %240, %188
  %250 = load ptr, ptr %14, align 8, !tbaa !48
  %251 = getelementptr inbounds %struct._GLFWmonitor, ptr %250, i32 0, i32 10
  %252 = getelementptr inbounds %struct._GLFWmonitorX11, ptr %251, i32 0, i32 0
  %253 = load i64, ptr %252, align 8, !tbaa !67
  %254 = load i64, ptr %8, align 8, !tbaa !53
  %255 = icmp eq i64 %253, %254
  br i1 %255, label %256, label %257

256:                                              ; preds = %249
  store i32 0, ptr %9, align 4, !tbaa !47
  br label %258

257:                                              ; preds = %249
  store i32 1, ptr %9, align 4, !tbaa !47
  br label %258

258:                                              ; preds = %257, %256
  %259 = load ptr, ptr %14, align 8, !tbaa !48
  %260 = load i32, ptr %9, align 4, !tbaa !47
  call void @_glfwInputMonitor(ptr noundef %259, i32 noundef 262145, i32 noundef %260)
  %261 = 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 !66
  %262 = load ptr, ptr %12, align 8, !tbaa !48
  call void %261(ptr noundef %262)
  %263 = 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 !92
  %264 = load ptr, ptr %13, align 8, !tbaa !48
  call void %263(ptr noundef %264)
  store i32 0, ptr %15, align 4
  br label %265

265:                                              ; preds = %258, %125, %80
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  %266 = load i32, ptr %15, align 4
  switch i32 %266, label %324 [
    i32 0, label %267
    i32 4, label %268
  ]

267:                                              ; preds = %265
  br label %268

268:                                              ; preds = %267, %265
  %269 = load i32, ptr %1, align 4, !tbaa !47
  %270 = add nsw i32 %269, 1
  store i32 %270, ptr %1, align 4, !tbaa !47
  br label %52, !llvm.loop !93

271:                                              ; preds = %52
  %272 = 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 !94
  %273 = load ptr, ptr %7, align 8, !tbaa !48
  call void %272(ptr noundef %273)
  %274 = load ptr, ptr %6, align 8, !tbaa !48
  %275 = icmp ne ptr %274, null
  br i1 %275, label %276, label %279

276:                                              ; preds = %271
  %277 = load ptr, ptr %6, align 8, !tbaa !48
  %278 = call i32 @XFree(ptr noundef %277)
  br label %279

279:                                              ; preds = %276, %271
  store i32 0, ptr %1, align 4, !tbaa !47
  br label %280

280:                                              ; preds = %298, %279
  %281 = load i32, ptr %1, align 4, !tbaa !47
  %282 = load i32, ptr %3, align 4, !tbaa !47
  %283 = icmp slt i32 %281, %282
  br i1 %283, label %284, label %301

284:                                              ; preds = %280
  %285 = load ptr, ptr %5, align 8, !tbaa !48
  %286 = load i32, ptr %1, align 4, !tbaa !47
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds ptr, ptr %285, i64 %287
  %289 = load ptr, ptr %288, align 8, !tbaa !48
  %290 = icmp ne ptr %289, null
  br i1 %290, label %291, label %297

291:                                              ; preds = %284
  %292 = load ptr, ptr %5, align 8, !tbaa !48
  %293 = load i32, ptr %1, align 4, !tbaa !47
  %294 = sext i32 %293 to i64
  %295 = getelementptr inbounds ptr, ptr %292, i64 %294
  %296 = load ptr, ptr %295, align 8, !tbaa !48
  call void @_glfwInputMonitor(ptr noundef %296, i32 noundef 262146, i32 noundef 0)
  br label %297

297:                                              ; preds = %291, %284
  br label %298

298:                                              ; preds = %297
  %299 = load i32, ptr %1, align 4, !tbaa !47
  %300 = add nsw i32 %299, 1
  store i32 %300, ptr %1, align 4, !tbaa !47
  br label %280, !llvm.loop !95

301:                                              ; preds = %280
  %302 = load ptr, ptr %5, align 8, !tbaa !48
  call void @free(ptr noundef %302) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #6
  br label %323

303:                                              ; preds = %20, %0
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %304 = load ptr, ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 16), align 8, !tbaa !50
  %305 = getelementptr inbounds %struct.anon.17, ptr %304, i32 0, i32 35
  %306 = load ptr, ptr %305, align 8, !tbaa !96
  %307 = load i32, ptr getelementptr inbounds (%struct._GLFWlibraryX11, ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 16), i32 0, i32 1), align 8, !tbaa !98
  %308 = sext i32 %307 to i64
  %309 = getelementptr inbounds %struct.Screen, ptr %306, i64 %308
  %310 = getelementptr inbounds %struct.Screen, ptr %309, i32 0, i32 5
  %311 = load i32, ptr %310, align 8, !tbaa !99
  store i32 %311, ptr %16, align 4, !tbaa !47
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %312 = load ptr, ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 16), align 8, !tbaa !50
  %313 = getelementptr inbounds %struct.anon.17, ptr %312, i32 0, i32 35
  %314 = load ptr, ptr %313, align 8, !tbaa !96
  %315 = load i32, ptr getelementptr inbounds (%struct._GLFWlibraryX11, ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 16), i32 0, i32 1), align 8, !tbaa !98
  %316 = sext i32 %315 to i64
  %317 = getelementptr inbounds %struct.Screen, ptr %314, i64 %316
  %318 = getelementptr inbounds %struct.Screen, ptr %317, i32 0, i32 6
  %319 = load i32, ptr %318, align 4, !tbaa !101
  store i32 %319, ptr %17, align 4, !tbaa !47
  %320 = load i32, ptr %16, align 4, !tbaa !47
  %321 = load i32, ptr %17, align 4, !tbaa !47
  %322 = call ptr @_glfwAllocMonitor(ptr noundef @.str, i32 noundef %320, i32 noundef %321)
  call void @_glfwInputMonitor(ptr noundef %322, i32 noundef 262145, i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %323

323:                                              ; preds = %303, %301
  ret void

324:                                              ; preds = %265
  unreachable
}

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

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

; 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) #3

declare ptr @_glfwAllocMonitor(ptr noundef, i32 noundef, i32 noundef) #4

declare void @_glfwInputMonitor(ptr noundef, i32 noundef, i32 noundef) #4

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

declare i32 @XFree(ptr noundef) #4

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind allocsize(0,1) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }
attributes #7 = { nounwind allocsize(0,1) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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, !7, i64 132484}
!47 = !{!7, !7, i64 0}
!48 = !{!16, !16, i64 0}
!49 = !{!6, !16, i64 132568}
!50 = !{!6, !16, i64 130752}
!51 = !{!6, !14, i64 130768}
!52 = !{!6, !16, i64 132560}
!53 = !{!14, !14, i64 0}
!54 = !{!6, !7, i64 132728}
!55 = !{!6, !16, i64 132768}
!56 = !{!6, !7, i64 1024}
!57 = !{!6, !16, i64 1016}
!58 = !{!59, !7, i64 32}
!59 = !{!"_XRRScreenResources", !14, i64 0, !14, i64 8, !7, i64 16, !16, i64 24, !7, i64 32, !16, i64 40, !7, i64 48, !16, i64 56}
!60 = !{!6, !16, i64 132552}
!61 = !{!59, !16, i64 40}
!62 = !{!63, !64, i64 48}
!63 = !{!"_XRROutputInfo", !14, i64 0, !14, i64 8, !16, i64 16, !7, i64 24, !14, i64 32, !14, i64 40, !64, i64 48, !64, i64 50, !7, i64 52, !16, i64 56, !7, i64 64, !16, i64 72, !7, i64 80, !7, i64 84, !16, i64 88}
!64 = !{!"short", !8, i64 0}
!65 = !{!63, !14, i64 8}
!66 = !{!6, !16, i64 132512}
!67 = !{!68, !14, i64 136}
!68 = !{!"_GLFWmonitor", !16, i64 0, !16, i64 8, !7, i64 16, !7, i64 20, !16, i64 24, !16, i64 32, !7, i64 40, !69, i64 44, !70, i64 72, !70, i64 104, !71, i64 136}
!69 = !{!"GLFWvidmode", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!70 = !{!"GLFWgammaramp", !16, i64 0, !16, i64 8, !16, i64 16, !7, i64 24}
!71 = !{!"_GLFWmonitorX11", !14, i64 0, !14, i64 8, !14, i64 16, !7, i64 24}
!72 = distinct !{!72, !73}
!73 = !{!"llvm.loop.mustprogress"}
!74 = !{!6, !16, i64 132544}
!75 = !{!76, !64, i64 32}
!76 = !{!"_XRRCrtcInfo", !14, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !14, i64 24, !64, i64 32, !7, i64 36, !16, i64 40, !64, i64 48, !7, i64 52, !16, i64 56}
!77 = !{!63, !14, i64 40}
!78 = !{!63, !14, i64 32}
!79 = !{!63, !16, i64 16}
!80 = !{!68, !14, i64 144}
!81 = !{!82, !64, i64 4}
!82 = !{!"", !7, i64 0, !64, i64 4, !64, i64 6, !64, i64 8, !64, i64 10}
!83 = !{!76, !7, i64 8}
!84 = !{!82, !64, i64 6}
!85 = !{!76, !7, i64 12}
!86 = !{!82, !64, i64 8}
!87 = !{!76, !7, i64 16}
!88 = !{!82, !64, i64 10}
!89 = !{!76, !7, i64 20}
!90 = !{!68, !7, i64 160}
!91 = distinct !{!91, !73}
!92 = !{!6, !16, i64 132496}
!93 = distinct !{!93, !73}
!94 = !{!6, !16, i64 132520}
!95 = distinct !{!95, !73}
!96 = !{!97, !16, i64 232}
!97 = !{!"", !16, i64 0, !16, i64 8, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !16, i64 32, !14, i64 40, !14, i64 48, !14, i64 56, !7, i64 64, !16, i64 72, !7, i64 80, !7, i64 84, !7, i64 88, !7, i64 92, !7, i64 96, !16, i64 104, !7, i64 112, !7, i64 116, !16, i64 120, !16, i64 128, !7, i64 136, !14, i64 144, !14, i64 152, !16, i64 160, !16, i64 168, !16, i64 176, !16, i64 184, !7, i64 192, !16, i64 200, !16, i64 208, !16, i64 216, !7, i64 224, !7, i64 228, !16, i64 232, !14, i64 240, !14, i64 248, !7, i64 256, !7, i64 260, !16, i64 264, !16, i64 272, !7, i64 280, !16, i64 288}
!98 = !{!6, !7, i64 130760}
!99 = !{!100, !7, i64 32}
!100 = !{!"", !16, i64 0, !16, i64 8, !14, i64 16, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !16, i64 48, !7, i64 56, !16, i64 64, !16, i64 72, !14, i64 80, !14, i64 88, !14, i64 96, !7, i64 104, !7, i64 108, !7, i64 112, !7, i64 116, !14, i64 120}
!101 = !{!100, !7, i64 36}


; 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.XineramaScreenInfo = type { i32, i16, i16, i16, i16 }
%struct.Screen = type { ptr, ptr, i64, i32, i32, i32, i32, i32, ptr, i32, ptr, ptr, i64, i64, i64, i32, i32, i32, i32, i64 }

@_glfw = external local_unnamed_addr global %struct._GLFWlibrary, align 8
@.str = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @_glfwPollMonitorsX11() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = load i32, ptr getelementptr inbounds (i8, ptr @_glfw, i64 132448), align 8, !tbaa !5
  %3 = icmp eq i32 %2, 0
  %4 = load i32, ptr getelementptr inbounds (i8, ptr @_glfw, i64 132484), align 4
  %5 = icmp ne i32 %4, 0
  %or.cond = select i1 %3, i1 true, i1 %5
  br i1 %or.cond, label %130, label %6

6:                                                ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 0, ptr %1, align 4, !tbaa !46
  %7 = load ptr, ptr getelementptr inbounds (i8, ptr @_glfw, i64 132568), align 8, !tbaa !47
  %8 = load ptr, ptr getelementptr inbounds (i8, ptr @_glfw, i64 130752), align 8, !tbaa !48
  %9 = load i64, ptr getelementptr inbounds (i8, ptr @_glfw, i64 130768), align 8, !tbaa !49
  %10 = tail call ptr %7(ptr noundef %8, i64 noundef %9) #6
  %11 = load ptr, ptr getelementptr inbounds (i8, ptr @_glfw, i64 132560), align 8, !tbaa !50
  %12 = load ptr, ptr getelementptr inbounds (i8, ptr @_glfw, i64 130752), align 8, !tbaa !48
  %13 = load i64, ptr getelementptr inbounds (i8, ptr @_glfw, i64 130768), align 8, !tbaa !49
  %14 = tail call i64 %11(ptr noundef %12, i64 noundef %13) #6
  %15 = load i32, ptr getelementptr inbounds (i8, ptr @_glfw, i64 132728), align 8, !tbaa !51
  %.not = icmp eq i32 %15, 0
  br i1 %.not, label %20, label %16

16:                                               ; preds = %6
  %17 = load ptr, ptr getelementptr inbounds (i8, ptr @_glfw, i64 132768), align 8, !tbaa !52
  %18 = load ptr, ptr getelementptr inbounds (i8, ptr @_glfw, i64 130752), align 8, !tbaa !48
  %19 = call ptr %17(ptr noundef %18, ptr noundef nonnull %1) #6
  br label %20

20:                                               ; preds = %16, %6
  %.079 = phi ptr [ %19, %16 ], [ null, %6 ]
  %21 = load i32, ptr getelementptr inbounds (i8, ptr @_glfw, i64 1024), align 8, !tbaa !53
  %.not87 = icmp eq i32 %21, 0
  br i1 %.not87, label %27, label %22

22:                                               ; preds = %20
  %23 = sext i32 %21 to i64
  %24 = call noalias ptr @calloc(i64 noundef %23, i64 noundef 8) #7
  %25 = load ptr, ptr getelementptr inbounds (i8, ptr @_glfw, i64 1016), align 8, !tbaa !54
  %26 = shl nsw i64 %23, 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %24, ptr align 8 %25, i64 %26, i1 false)
  br label %27

27:                                               ; preds = %22, %20
  %.078 = phi ptr [ %24, %22 ], [ null, %20 ]
  %28 = getelementptr inbounds i8, ptr %10, i64 32
  %29 = load i32, ptr %28, align 8, !tbaa !55
  %30 = icmp sgt i32 %29, 0
  br i1 %30, label %.lr.ph98, label %._crit_edge

.lr.ph98:                                         ; preds = %27
  %31 = getelementptr inbounds i8, ptr %10, i64 40
  %32 = icmp sgt i32 %21, 0
  %wide.trip.count = zext nneg i32 %21 to i64
  br label %33

33:                                               ; preds = %.lr.ph98, %117
  %indvars.iv111 = phi i64 [ 0, %.lr.ph98 ], [ %indvars.iv.next112, %117 ]
  %34 = load ptr, ptr getelementptr inbounds (i8, ptr @_glfw, i64 132552), align 8, !tbaa !57
  %35 = load ptr, ptr getelementptr inbounds (i8, ptr @_glfw, i64 130752), align 8, !tbaa !48
  %36 = load ptr, ptr %31, align 8, !tbaa !58
  %37 = getelementptr inbounds i64, ptr %36, i64 %indvars.iv111
  %38 = load i64, ptr %37, align 8, !tbaa !59
  %39 = call ptr %34(ptr noundef %35, ptr noundef nonnull %10, i64 noundef %38) #6
  %40 = getelementptr inbounds i8, ptr %39, i64 48
  %41 = load i16, ptr %40, align 8, !tbaa !60
  %.not90 = icmp eq i16 %41, 0
  br i1 %.not90, label %42, label %46

42:                                               ; preds = %33
  %43 = getelementptr inbounds i8, ptr %39, i64 8
  %44 = load i64, ptr %43, align 8, !tbaa !63
  %45 = icmp eq i64 %44, 0
  br i1 %45, label %46, label %.preheader

.preheader:                                       ; preds = %42
  br i1 %32, label %.lr.ph, label %.critedge

46:                                               ; preds = %42, %33
  %47 = load ptr, ptr getelementptr inbounds (i8, ptr @_glfw, i64 132512), align 8, !tbaa !64
  call void %47(ptr noundef nonnull %39) #6
  br label %117

.lr.ph:                                           ; preds = %.preheader, %57
  %indvars.iv = phi i64 [ %indvars.iv.next, %57 ], [ 0, %.preheader ]
  %48 = getelementptr inbounds ptr, ptr %.078, i64 %indvars.iv
  %49 = load ptr, ptr %48, align 8, !tbaa !65
  %.not91 = icmp eq ptr %49, null
  br i1 %.not91, label %57, label %50

50:                                               ; preds = %.lr.ph
  %51 = getelementptr inbounds i8, ptr %49, i64 136
  %52 = load i64, ptr %51, align 8, !tbaa !66
  %53 = load ptr, ptr %31, align 8, !tbaa !58
  %54 = getelementptr inbounds i64, ptr %53, i64 %indvars.iv111
  %55 = load i64, ptr %54, align 8, !tbaa !59
  %56 = icmp eq i64 %52, %55
  br i1 %56, label %58, label %57

57:                                               ; preds = %.lr.ph, %50
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.critedge, label %.lr.ph, !llvm.loop !71

58:                                               ; preds = %50
  %59 = getelementptr inbounds ptr, ptr %.078, i64 %indvars.iv
  store ptr null, ptr %59, align 8, !tbaa !65
  %60 = load ptr, ptr getelementptr inbounds (i8, ptr @_glfw, i64 132512), align 8, !tbaa !64
  call void %60(ptr noundef %39) #6
  br label %117

.critedge:                                        ; preds = %57, %.preheader
  %61 = load ptr, ptr getelementptr inbounds (i8, ptr @_glfw, i64 132544), align 8, !tbaa !73
  %62 = load ptr, ptr getelementptr inbounds (i8, ptr @_glfw, i64 130752), align 8, !tbaa !48
  %63 = call ptr %61(ptr noundef %62, ptr noundef %10, i64 noundef %44) #6
  %64 = getelementptr inbounds i8, ptr %63, i64 32
  %65 = load i16, ptr %64, align 8, !tbaa !74
  switch i16 %65, label %66 [
    i16 2, label %67
    i16 8, label %67
  ]

66:                                               ; preds = %.critedge
  br label %67

67:                                               ; preds = %.critedge, %.critedge, %66
  %.sink121 = phi i64 [ 32, %66 ], [ 40, %.critedge ], [ 40, %.critedge ]
  %.sink = phi i64 [ 40, %66 ], [ 32, %.critedge ], [ 32, %.critedge ]
  %68 = getelementptr inbounds i8, ptr %39, i64 %.sink121
  %69 = getelementptr inbounds i8, ptr %39, i64 %.sink
  %.081.in = load i64, ptr %69, align 8, !tbaa !59
  %.081 = trunc i64 %.081.in to i32
  %.082.in = load i64, ptr %68, align 8, !tbaa !59
  %.082 = trunc i64 %.082.in to i32
  %70 = getelementptr inbounds i8, ptr %39, i64 16
  %71 = load ptr, ptr %70, align 8, !tbaa !76
  %72 = call ptr @_glfwAllocMonitor(ptr noundef %71, i32 noundef %.082, i32 noundef %.081) #6
  %73 = load ptr, ptr %31, align 8, !tbaa !58
  %74 = getelementptr inbounds i64, ptr %73, i64 %indvars.iv111
  %75 = load i64, ptr %74, align 8, !tbaa !59
  %76 = getelementptr inbounds i8, ptr %72, i64 136
  store i64 %75, ptr %76, align 8, !tbaa !66
  %77 = load i64, ptr %43, align 8, !tbaa !63
  %78 = getelementptr inbounds i8, ptr %72, i64 144
  store i64 %77, ptr %78, align 8, !tbaa !77
  %79 = load i32, ptr %1, align 4, !tbaa !46
  %80 = icmp sgt i32 %79, 0
  br i1 %80, label %.lr.ph96, label %.loopexit

.lr.ph96:                                         ; preds = %67
  %81 = getelementptr inbounds i8, ptr %63, i64 8
  %82 = load i32, ptr %81, align 8, !tbaa !78
  %83 = getelementptr inbounds i8, ptr %63, i64 12
  %84 = getelementptr inbounds i8, ptr %63, i64 16
  %85 = getelementptr inbounds i8, ptr %63, i64 20
  %wide.trip.count109 = zext nneg i32 %79 to i64
  br label %86

86:                                               ; preds = %.lr.ph96, %113
  %indvars.iv106 = phi i64 [ 0, %.lr.ph96 ], [ %indvars.iv.next107, %113 ]
  %87 = getelementptr inbounds %struct.XineramaScreenInfo, ptr %.079, i64 %indvars.iv106
  %88 = getelementptr inbounds i8, ptr %87, i64 4
  %89 = load i16, ptr %88, align 4, !tbaa !79
  %90 = sext i16 %89 to i32
  %91 = icmp eq i32 %82, %90
  br i1 %91, label %92, label %113

92:                                               ; preds = %86
  %93 = getelementptr inbounds i8, ptr %87, i64 6
  %94 = load i16, ptr %93, align 2, !tbaa !81
  %95 = sext i16 %94 to i32
  %96 = load i32, ptr %83, align 4, !tbaa !82
  %97 = icmp eq i32 %96, %95
  br i1 %97, label %98, label %113

98:                                               ; preds = %92
  %99 = getelementptr inbounds i8, ptr %87, i64 8
  %100 = load i16, ptr %99, align 4, !tbaa !83
  %101 = sext i16 %100 to i32
  %102 = load i32, ptr %84, align 8, !tbaa !84
  %103 = icmp eq i32 %102, %101
  br i1 %103, label %104, label %113

104:                                              ; preds = %98
  %105 = getelementptr inbounds i8, ptr %87, i64 10
  %106 = load i16, ptr %105, align 2, !tbaa !85
  %107 = sext i16 %106 to i32
  %108 = load i32, ptr %85, align 4, !tbaa !86
  %109 = icmp eq i32 %108, %107
  br i1 %109, label %110, label %113

110:                                              ; preds = %104
  %111 = trunc nuw nsw i64 %indvars.iv106 to i32
  %112 = getelementptr inbounds i8, ptr %72, i64 160
  store i32 %111, ptr %112, align 8, !tbaa !87
  br label %.loopexit

113:                                              ; preds = %86, %92, %98, %104
  %indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
  %exitcond110.not = icmp eq i64 %indvars.iv.next107, %wide.trip.count109
  br i1 %exitcond110.not, label %.loopexit, label %86, !llvm.loop !88

.loopexit:                                        ; preds = %113, %67, %110
  %114 = icmp ne i64 %75, %14
  %. = zext i1 %114 to i32
  call void @_glfwInputMonitor(ptr noundef %72, i32 noundef 262145, i32 noundef %.) #6
  %115 = load ptr, ptr getelementptr inbounds (i8, ptr @_glfw, i64 132512), align 8, !tbaa !64
  call void %115(ptr noundef %39) #6
  %116 = load ptr, ptr getelementptr inbounds (i8, ptr @_glfw, i64 132496), align 8, !tbaa !89
  call void %116(ptr noundef %63) #6
  br label %117

117:                                              ; preds = %.loopexit, %58, %46
  %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
  %118 = load i32, ptr %28, align 8, !tbaa !55
  %119 = sext i32 %118 to i64
  %120 = icmp slt i64 %indvars.iv.next112, %119
  br i1 %120, label %33, label %._crit_edge, !llvm.loop !90

._crit_edge:                                      ; preds = %117, %27
  %121 = load ptr, ptr getelementptr inbounds (i8, ptr @_glfw, i64 132520), align 8, !tbaa !91
  call void %121(ptr noundef nonnull %10) #6
  %.not88 = icmp eq ptr %.079, null
  br i1 %.not88, label %124, label %122

122:                                              ; preds = %._crit_edge
  %123 = call i32 @XFree(ptr noundef nonnull %.079) #6
  br label %124

124:                                              ; preds = %122, %._crit_edge
  %125 = icmp sgt i32 %21, 0
  br i1 %125, label %.lr.ph101.preheader, label %._crit_edge102

.lr.ph101.preheader:                              ; preds = %124
  %wide.trip.count117 = zext nneg i32 %21 to i64
  br label %.lr.ph101

.lr.ph101:                                        ; preds = %.lr.ph101.preheader, %129
  %indvars.iv114 = phi i64 [ 0, %.lr.ph101.preheader ], [ %indvars.iv.next115, %129 ]
  %126 = getelementptr inbounds ptr, ptr %.078, i64 %indvars.iv114
  %127 = load ptr, ptr %126, align 8, !tbaa !65
  %.not89 = icmp eq ptr %127, null
  br i1 %.not89, label %129, label %128

128:                                              ; preds = %.lr.ph101
  call void @_glfwInputMonitor(ptr noundef nonnull %127, i32 noundef 262146, i32 noundef 0) #6
  br label %129

129:                                              ; preds = %.lr.ph101, %128
  %indvars.iv.next115 = add nuw nsw i64 %indvars.iv114, 1
  %exitcond118.not = icmp eq i64 %indvars.iv.next115, %wide.trip.count117
  br i1 %exitcond118.not, label %._crit_edge102, label %.lr.ph101, !llvm.loop !92

._crit_edge102:                                   ; preds = %129, %124
  call void @free(ptr noundef %.078) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  br label %142

130:                                              ; preds = %0
  %131 = load ptr, ptr getelementptr inbounds (i8, ptr @_glfw, i64 130752), align 8, !tbaa !48
  %132 = getelementptr inbounds i8, ptr %131, i64 232
  %133 = load ptr, ptr %132, align 8, !tbaa !93
  %134 = load i32, ptr getelementptr inbounds (i8, ptr @_glfw, i64 130760), align 8, !tbaa !95
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds %struct.Screen, ptr %133, i64 %135
  %137 = getelementptr inbounds i8, ptr %136, i64 32
  %138 = load i32, ptr %137, align 8, !tbaa !96
  %139 = getelementptr inbounds i8, ptr %136, i64 36
  %140 = load i32, ptr %139, align 4, !tbaa !98
  %141 = tail call ptr @_glfwAllocMonitor(ptr noundef nonnull @.str, i32 noundef %138, i32 noundef %140) #6
  tail call void @_glfwInputMonitor(ptr noundef %141, i32 noundef 262145, i32 noundef 0) #6
  br label %142

142:                                              ; preds = %130, %._crit_edge102
  ret void
}

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

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

; Function Attrs: mustprogress 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) #3

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

declare void @_glfwInputMonitor(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #4

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

declare i32 @XFree(ptr noundef) local_unnamed_addr #4

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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 = !{!7, !7, i64 0}
!47 = !{!6, !16, i64 132568}
!48 = !{!6, !16, i64 130752}
!49 = !{!6, !14, i64 130768}
!50 = !{!6, !16, i64 132560}
!51 = !{!6, !7, i64 132728}
!52 = !{!6, !16, i64 132768}
!53 = !{!6, !7, i64 1024}
!54 = !{!6, !16, i64 1016}
!55 = !{!56, !7, i64 32}
!56 = !{!"_XRRScreenResources", !14, i64 0, !14, i64 8, !7, i64 16, !16, i64 24, !7, i64 32, !16, i64 40, !7, i64 48, !16, i64 56}
!57 = !{!6, !16, i64 132552}
!58 = !{!56, !16, i64 40}
!59 = !{!14, !14, i64 0}
!60 = !{!61, !62, i64 48}
!61 = !{!"_XRROutputInfo", !14, i64 0, !14, i64 8, !16, i64 16, !7, i64 24, !14, i64 32, !14, i64 40, !62, i64 48, !62, i64 50, !7, i64 52, !16, i64 56, !7, i64 64, !16, i64 72, !7, i64 80, !7, i64 84, !16, i64 88}
!62 = !{!"short", !8, i64 0}
!63 = !{!61, !14, i64 8}
!64 = !{!6, !16, i64 132512}
!65 = !{!16, !16, i64 0}
!66 = !{!67, !14, i64 136}
!67 = !{!"_GLFWmonitor", !16, i64 0, !16, i64 8, !7, i64 16, !7, i64 20, !16, i64 24, !16, i64 32, !7, i64 40, !68, i64 44, !69, i64 72, !69, i64 104, !70, i64 136}
!68 = !{!"GLFWvidmode", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!69 = !{!"GLFWgammaramp", !16, i64 0, !16, i64 8, !16, i64 16, !7, i64 24}
!70 = !{!"_GLFWmonitorX11", !14, i64 0, !14, i64 8, !14, i64 16, !7, i64 24}
!71 = distinct !{!71, !72}
!72 = !{!"llvm.loop.mustprogress"}
!73 = !{!6, !16, i64 132544}
!74 = !{!75, !62, i64 32}
!75 = !{!"_XRRCrtcInfo", !14, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !14, i64 24, !62, i64 32, !7, i64 36, !16, i64 40, !62, i64 48, !7, i64 52, !16, i64 56}
!76 = !{!61, !16, i64 16}
!77 = !{!67, !14, i64 144}
!78 = !{!75, !7, i64 8}
!79 = !{!80, !62, i64 4}
!80 = !{!"", !7, i64 0, !62, i64 4, !62, i64 6, !62, i64 8, !62, i64 10}
!81 = !{!80, !62, i64 6}
!82 = !{!75, !7, i64 12}
!83 = !{!80, !62, i64 8}
!84 = !{!75, !7, i64 16}
!85 = !{!80, !62, i64 10}
!86 = !{!75, !7, i64 20}
!87 = !{!67, !7, i64 160}
!88 = distinct !{!88, !72}
!89 = !{!6, !16, i64 132496}
!90 = distinct !{!90, !72}
!91 = !{!6, !16, i64 132520}
!92 = distinct !{!92, !72}
!93 = !{!94, !16, i64 232}
!94 = !{!"", !16, i64 0, !16, i64 8, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !16, i64 32, !14, i64 40, !14, i64 48, !14, i64 56, !7, i64 64, !16, i64 72, !7, i64 80, !7, i64 84, !7, i64 88, !7, i64 92, !7, i64 96, !16, i64 104, !7, i64 112, !7, i64 116, !16, i64 120, !16, i64 128, !7, i64 136, !14, i64 144, !14, i64 152, !16, i64 160, !16, i64 168, !16, i64 176, !16, i64 184, !7, i64 192, !16, i64 200, !16, i64 208, !16, i64 216, !7, i64 224, !7, i64 228, !16, i64 232, !14, i64 240, !14, i64 248, !7, i64 256, !7, i64 260, !16, i64 264, !16, i64 272, !7, i64 280, !16, i64 288}
!95 = !{!6, !7, i64 130760}
!96 = !{!97, !7, i64 32}
!97 = !{!"", !16, i64 0, !16, i64 8, !14, i64 16, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !16, i64 48, !7, i64 56, !16, i64 64, !16, i64 72, !14, i64 80, !14, i64 88, !14, i64 96, !7, i64 104, !7, i64 108, !7, i64 112, !7, i64 116, !14, i64 120}
!98 = !{!97, !7, i64 36}


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