; LLVM IR from erwincoumans/tiny-differentiable-simulator :: src/visualizer/opengl (tiny_x11_opengl_window)

; 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"

%class.TinyX11OpenGLWindow = type <{ %class.TinyWindowInterface, ptr, i8, i8, [6 x i8] }>
%class.TinyWindowInterface = type { ptr }
%struct.InternalData2 = type { ptr, i64, ptr, i64, %struct.XSetWindowAttributes, i64, ptr, %struct.XWindowAttributes, %union._XEvent, ptr, i32, i32, i32, ptr, ptr, ptr, ptr, ptr }
%struct.XSetWindowAttributes = type { i64, i64, i64, i64, i32, i32, i32, i64, i64, i32, i64, i64, i32, i64, i64 }
%struct.XWindowAttributes = type { i32, i32, i32, i32, i32, i32, ptr, i64, i32, i32, i32, i32, i64, i64, i32, i64, i32, i32, i64, i64, i64, i32, ptr }
%union._XEvent = type { [24 x i64] }
%struct.TinyWindowConstructionInfo = type { i32, i32, i8, i32, ptr, ptr, i32, i32 }
%struct.anon = 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 }
%struct.XVisualInfo = type { ptr, i64, i32, i32, i32, i64, i64, i64, i32, i32 }

@att = external dso_local global [15 x i32], align 16
@_ZL12forceOpenGL3 = external hidden global i8, align 1
@stderr = external global ptr, align 8
@.str.16 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [41 x i8], align 1
@_ZZN19TinyX11OpenGLWindow13create_windowERK26TinyWindowConstructionInfoE14visual_attribs = external hidden global [23 x i32], align 16
@.str.18 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [15 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN19TinyX11OpenGLWindow13enable_openglEv(ptr noundef nonnull align 8 dereferenceable(18)) #0 align 2

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

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

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #3

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN19TinyX11OpenGLWindow13create_windowERK26TinyWindowConstructionInfo(ptr noundef nonnull align 8 dereferenceable(18) %0, ptr noundef nonnull align 8 dereferenceable(40) %1) unnamed_addr #0 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %9 = load ptr, ptr %3, align 8
  %10 = call ptr @XOpenDisplay(ptr noundef null)
  %11 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %12 = load ptr, ptr %11, align 8, !tbaa !9
  %13 = getelementptr inbounds %struct.InternalData2, ptr %12, i32 0, i32 0
  store ptr %10, ptr %13, align 8, !tbaa !13
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.TinyWindowConstructionInfo, ptr %14, i32 0, i32 0
  %16 = load i32, ptr %15, align 8, !tbaa !19
  %17 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %18 = load ptr, ptr %17, align 8, !tbaa !9
  %19 = getelementptr inbounds %struct.InternalData2, ptr %18, i32 0, i32 11
  store i32 %16, ptr %19, align 4, !tbaa !21
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.TinyWindowConstructionInfo, ptr %20, i32 0, i32 1
  %22 = load i32, ptr %21, align 4, !tbaa !22
  %23 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %24 = load ptr, ptr %23, align 8, !tbaa !9
  %25 = getelementptr inbounds %struct.InternalData2, ptr %24, i32 0, i32 12
  store i32 %22, ptr %25, align 8, !tbaa !23
  %26 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %27 = load ptr, ptr %26, align 8, !tbaa !9
  %28 = getelementptr inbounds %struct.InternalData2, ptr %27, i32 0, i32 0
  %29 = load ptr, ptr %28, align 8, !tbaa !13
  %30 = icmp eq ptr %29, null
  br i1 %30, label %31, label %34

31:                                               ; preds = %2
  %32 = load ptr, ptr @stderr, align 8, !tbaa !5
  %33 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef @.str.16) #5
  call void @exit(i32 noundef 1) #6
  unreachable

34:                                               ; preds = %2
  %35 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %36 = load ptr, ptr %35, align 8, !tbaa !9
  %37 = getelementptr inbounds %struct.InternalData2, ptr %36, i32 0, i32 0
  %38 = load ptr, ptr %37, align 8, !tbaa !13
  %39 = getelementptr inbounds %struct.anon, ptr %38, i32 0, i32 35
  %40 = load ptr, ptr %39, align 8, !tbaa !24
  %41 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %42 = load ptr, ptr %41, align 8, !tbaa !9
  %43 = getelementptr inbounds %struct.InternalData2, ptr %42, i32 0, i32 0
  %44 = load ptr, ptr %43, align 8, !tbaa !13
  %45 = getelementptr inbounds %struct.anon, ptr %44, i32 0, i32 33
  %46 = load i32, ptr %45, align 8, !tbaa !26
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds %struct.Screen, ptr %40, i64 %47
  %49 = getelementptr inbounds %struct.Screen, ptr %48, i32 0, i32 2
  %50 = load i64, ptr %49, align 8, !tbaa !27
  %51 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %52 = load ptr, ptr %51, align 8, !tbaa !9
  %53 = getelementptr inbounds %struct.InternalData2, ptr %52, i32 0, i32 1
  store i64 %50, ptr %53, align 8, !tbaa !29
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.TinyWindowConstructionInfo, ptr %54, i32 0, i32 6
  %56 = load i32, ptr %55, align 8, !tbaa !30
  %57 = icmp slt i32 %56, 3
  br i1 %57, label %58, label %59

58:                                               ; preds = %34
  store i8 0, ptr @_ZL12forceOpenGL3, align 1, !tbaa !31
  br label %59

59:                                               ; preds = %58, %34
  %60 = load i8, ptr @_ZL12forceOpenGL3, align 1, !tbaa !31, !range !32, !noundef !33
  %61 = trunc i8 %60 to i1
  br i1 %61, label %62, label %245

62:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %63 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %64 = load ptr, ptr %63, align 8, !tbaa !9
  %65 = getelementptr inbounds %struct.InternalData2, ptr %64, i32 0, i32 0
  %66 = load ptr, ptr %65, align 8, !tbaa !13
  %67 = call i32 @glXQueryVersion(ptr noundef %66, ptr noundef %6, ptr noundef %5)
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %69, label %78

69:                                               ; preds = %62
  %70 = load i32, ptr %6, align 4, !tbaa !34
  %71 = icmp eq i32 %70, 1
  br i1 %71, label %72, label %75

72:                                               ; preds = %69
  %73 = load i32, ptr %5, align 4, !tbaa !34
  %74 = icmp slt i32 %73, 3
  br i1 %74, label %78, label %75

75:                                               ; preds = %72, %69
  %76 = load i32, ptr %6, align 4, !tbaa !34
  %77 = icmp slt i32 %76, 1
  br i1 %77, label %78, label %83

78:                                               ; preds = %75, %72, %62
  %79 = load ptr, ptr @stderr, align 8, !tbaa !5
  %80 = load i32, ptr %6, align 4, !tbaa !34
  %81 = load i32, ptr %5, align 4, !tbaa !34
  %82 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %79, ptr noundef @.str.17, i32 noundef %80, i32 noundef %81) #5
  call void @exit(i32 noundef 1) #6
  unreachable

83:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %84 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %85 = load ptr, ptr %84, align 8, !tbaa !9
  %86 = getelementptr inbounds %struct.InternalData2, ptr %85, i32 0, i32 0
  %87 = load ptr, ptr %86, align 8, !tbaa !13
  %88 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %89 = load ptr, ptr %88, align 8, !tbaa !9
  %90 = getelementptr inbounds %struct.InternalData2, ptr %89, i32 0, i32 0
  %91 = load ptr, ptr %90, align 8, !tbaa !13
  %92 = getelementptr inbounds %struct.anon, ptr %91, i32 0, i32 33
  %93 = load i32, ptr %92, align 8, !tbaa !26
  %94 = call ptr @glXChooseFBConfig(ptr noundef %87, i32 noundef %93, ptr noundef @_ZZN19TinyX11OpenGLWindow13create_windowERK26TinyWindowConstructionInfoE14visual_attribs, ptr noundef %7)
  store ptr %94, ptr %8, align 8, !tbaa !5
  %95 = load ptr, ptr %8, align 8, !tbaa !5
  %96 = icmp ne ptr %95, null
  br i1 %96, label %100, label %97

97:                                               ; preds = %83
  %98 = load ptr, ptr @stderr, align 8, !tbaa !5
  %99 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %98, ptr noundef @.str.18) #5
  call void @exit(i32 noundef 1) #6
  unreachable

100:                                              ; preds = %83
  %101 = load ptr, ptr %8, align 8, !tbaa !5
  %102 = load ptr, ptr %101, align 8, !tbaa !5
  %103 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %104 = load ptr, ptr %103, align 8, !tbaa !9
  %105 = getelementptr inbounds %struct.InternalData2, ptr %104, i32 0, i32 9
  store ptr %102, ptr %105, align 8, !tbaa !35
  %106 = load ptr, ptr %8, align 8, !tbaa !5
  %107 = call i32 @XFree(ptr noundef %106)
  %108 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %109 = load ptr, ptr %108, align 8, !tbaa !9
  %110 = getelementptr inbounds %struct.InternalData2, ptr %109, i32 0, i32 0
  %111 = load ptr, ptr %110, align 8, !tbaa !13
  %112 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %113 = load ptr, ptr %112, align 8, !tbaa !9
  %114 = getelementptr inbounds %struct.InternalData2, ptr %113, i32 0, i32 9
  %115 = load ptr, ptr %114, align 8, !tbaa !35
  %116 = call ptr @glXGetVisualFromFBConfig(ptr noundef %111, ptr noundef %115)
  %117 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %118 = load ptr, ptr %117, align 8, !tbaa !9
  %119 = getelementptr inbounds %struct.InternalData2, ptr %118, i32 0, i32 2
  store ptr %116, ptr %119, align 8, !tbaa !36
  %120 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %121 = load ptr, ptr %120, align 8, !tbaa !9
  %122 = getelementptr inbounds %struct.InternalData2, ptr %121, i32 0, i32 0
  %123 = load ptr, ptr %122, align 8, !tbaa !13
  %124 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %125 = load ptr, ptr %124, align 8, !tbaa !9
  %126 = getelementptr inbounds %struct.InternalData2, ptr %125, i32 0, i32 0
  %127 = load ptr, ptr %126, align 8, !tbaa !13
  %128 = getelementptr inbounds %struct.anon, ptr %127, i32 0, i32 35
  %129 = load ptr, ptr %128, align 8, !tbaa !24
  %130 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %131 = load ptr, ptr %130, align 8, !tbaa !9
  %132 = getelementptr inbounds %struct.InternalData2, ptr %131, i32 0, i32 2
  %133 = load ptr, ptr %132, align 8, !tbaa !36
  %134 = getelementptr inbounds %struct.XVisualInfo, ptr %133, i32 0, i32 2
  %135 = load i32, ptr %134, align 8, !tbaa !37
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds %struct.Screen, ptr %129, i64 %136
  %138 = getelementptr inbounds %struct.Screen, ptr %137, i32 0, i32 2
  %139 = load i64, ptr %138, align 8, !tbaa !27
  %140 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %141 = load ptr, ptr %140, align 8, !tbaa !9
  %142 = getelementptr inbounds %struct.InternalData2, ptr %141, i32 0, i32 2
  %143 = load ptr, ptr %142, align 8, !tbaa !36
  %144 = getelementptr inbounds %struct.XVisualInfo, ptr %143, i32 0, i32 0
  %145 = load ptr, ptr %144, align 8, !tbaa !39
  %146 = call i64 @XCreateColormap(ptr noundef %123, i64 noundef %139, ptr noundef %145, i32 noundef 0)
  %147 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %148 = load ptr, ptr %147, align 8, !tbaa !9
  %149 = getelementptr inbounds %struct.InternalData2, ptr %148, i32 0, i32 3
  store i64 %146, ptr %149, align 8, !tbaa !40
  %150 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %151 = load ptr, ptr %150, align 8, !tbaa !9
  %152 = getelementptr inbounds %struct.InternalData2, ptr %151, i32 0, i32 4
  %153 = getelementptr inbounds %struct.XSetWindowAttributes, ptr %152, i32 0, i32 13
  store i64 %146, ptr %153, align 8, !tbaa !41
  %154 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %155 = load ptr, ptr %154, align 8, !tbaa !9
  %156 = getelementptr inbounds %struct.InternalData2, ptr %155, i32 0, i32 4
  %157 = getelementptr inbounds %struct.XSetWindowAttributes, ptr %156, i32 0, i32 0
  store i64 0, ptr %157, align 8, !tbaa !42
  %158 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %159 = load ptr, ptr %158, align 8, !tbaa !9
  %160 = getelementptr inbounds %struct.InternalData2, ptr %159, i32 0, i32 4
  %161 = getelementptr inbounds %struct.XSetWindowAttributes, ptr %160, i32 0, i32 3
  store i64 0, ptr %161, align 8, !tbaa !43
  %162 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %163 = load ptr, ptr %162, align 8, !tbaa !9
  %164 = getelementptr inbounds %struct.InternalData2, ptr %163, i32 0, i32 4
  %165 = getelementptr inbounds %struct.XSetWindowAttributes, ptr %164, i32 0, i32 10
  store i64 163919, ptr %165, align 8, !tbaa !44
  %166 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %167 = load ptr, ptr %166, align 8, !tbaa !9
  %168 = getelementptr inbounds %struct.InternalData2, ptr %167, i32 0, i32 0
  %169 = load ptr, ptr %168, align 8, !tbaa !13
  %170 = getelementptr inbounds %struct.anon, ptr %169, i32 0, i32 35
  %171 = load ptr, ptr %170, align 8, !tbaa !24
  %172 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %173 = load ptr, ptr %172, align 8, !tbaa !9
  %174 = getelementptr inbounds %struct.InternalData2, ptr %173, i32 0, i32 2
  %175 = load ptr, ptr %174, align 8, !tbaa !36
  %176 = getelementptr inbounds %struct.XVisualInfo, ptr %175, i32 0, i32 2
  %177 = load i32, ptr %176, align 8, !tbaa !37
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds %struct.Screen, ptr %171, i64 %178
  %180 = getelementptr inbounds %struct.Screen, ptr %179, i32 0, i32 2
  %181 = load i64, ptr %180, align 8, !tbaa !27
  %182 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %183 = load ptr, ptr %182, align 8, !tbaa !9
  %184 = getelementptr inbounds %struct.InternalData2, ptr %183, i32 0, i32 1
  store i64 %181, ptr %184, align 8, !tbaa !29
  %185 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %186 = load ptr, ptr %185, align 8, !tbaa !9
  %187 = getelementptr inbounds %struct.InternalData2, ptr %186, i32 0, i32 0
  %188 = load ptr, ptr %187, align 8, !tbaa !13
  %189 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %190 = load ptr, ptr %189, align 8, !tbaa !9
  %191 = getelementptr inbounds %struct.InternalData2, ptr %190, i32 0, i32 1
  %192 = load i64, ptr %191, align 8, !tbaa !29
  %193 = load ptr, ptr %4, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.TinyWindowConstructionInfo, ptr %193, i32 0, i32 0
  %195 = load i32, ptr %194, align 8, !tbaa !19
  %196 = load ptr, ptr %4, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.TinyWindowConstructionInfo, ptr %196, i32 0, i32 1
  %198 = load i32, ptr %197, align 4, !tbaa !22
  %199 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %200 = load ptr, ptr %199, align 8, !tbaa !9
  %201 = getelementptr inbounds %struct.InternalData2, ptr %200, i32 0, i32 2
  %202 = load ptr, ptr %201, align 8, !tbaa !36
  %203 = getelementptr inbounds %struct.XVisualInfo, ptr %202, i32 0, i32 3
  %204 = load i32, ptr %203, align 4, !tbaa !45
  %205 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %206 = load ptr, ptr %205, align 8, !tbaa !9
  %207 = getelementptr inbounds %struct.InternalData2, ptr %206, i32 0, i32 2
  %208 = load ptr, ptr %207, align 8, !tbaa !36
  %209 = getelementptr inbounds %struct.XVisualInfo, ptr %208, i32 0, i32 0
  %210 = load ptr, ptr %209, align 8, !tbaa !39
  %211 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %212 = load ptr, ptr %211, align 8, !tbaa !9
  %213 = getelementptr inbounds %struct.InternalData2, ptr %212, i32 0, i32 4
  %214 = call i64 @XCreateWindow(ptr noundef %188, i64 noundef %192, i32 noundef 0, i32 noundef 0, i32 noundef %195, i32 noundef %198, i32 noundef 0, i32 noundef %204, i32 noundef 1, ptr noundef %210, i64 noundef 10248, ptr noundef %213)
  %215 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %216 = load ptr, ptr %215, align 8, !tbaa !9
  %217 = getelementptr inbounds %struct.InternalData2, ptr %216, i32 0, i32 5
  store i64 %214, ptr %217, align 8, !tbaa !46
  %218 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %219 = load ptr, ptr %218, align 8, !tbaa !9
  %220 = getelementptr inbounds %struct.InternalData2, ptr %219, i32 0, i32 5
  %221 = load i64, ptr %220, align 8, !tbaa !46
  %222 = icmp ne i64 %221, 0
  br i1 %222, label %226, label %223

223:                                              ; preds = %100
  %224 = load ptr, ptr @stderr, align 8, !tbaa !5
  %225 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %224, ptr noundef @.str.19) #5
  call void @exit(i32 noundef 1) #6
  unreachable

226:                                              ; preds = %100
  %227 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %228 = load ptr, ptr %227, align 8, !tbaa !9
  %229 = getelementptr inbounds %struct.InternalData2, ptr %228, i32 0, i32 0
  %230 = load ptr, ptr %229, align 8, !tbaa !13
  %231 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %232 = load ptr, ptr %231, align 8, !tbaa !9
  %233 = getelementptr inbounds %struct.InternalData2, ptr %232, i32 0, i32 5
  %234 = load i64, ptr %233, align 8, !tbaa !46
  %235 = call i32 @XMapWindow(ptr noundef %230, i64 noundef %234)
  %236 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %237 = load ptr, ptr %236, align 8, !tbaa !9
  %238 = getelementptr inbounds %struct.InternalData2, ptr %237, i32 0, i32 0
  %239 = load ptr, ptr %238, align 8, !tbaa !13
  %240 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %241 = load ptr, ptr %240, align 8, !tbaa !9
  %242 = getelementptr inbounds %struct.InternalData2, ptr %241, i32 0, i32 5
  %243 = load i64, ptr %242, align 8, !tbaa !46
  %244 = call i32 @XStoreName(ptr noundef %239, i64 noundef %243, ptr noundef @.str.20)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %354

245:                                              ; preds = %59
  %246 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %247 = load ptr, ptr %246, align 8, !tbaa !9
  %248 = getelementptr inbounds %struct.InternalData2, ptr %247, i32 0, i32 0
  %249 = load ptr, ptr %248, align 8, !tbaa !13
  %250 = call ptr @glXChooseVisual(ptr noundef %249, i32 noundef 0, ptr noundef @att)
  %251 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %252 = load ptr, ptr %251, align 8, !tbaa !9
  %253 = getelementptr inbounds %struct.InternalData2, ptr %252, i32 0, i32 2
  store ptr %250, ptr %253, align 8, !tbaa !36
  %254 = call i32 (ptr, ...) @printf(ptr noundef @.str.21)
  %255 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %256 = load ptr, ptr %255, align 8, !tbaa !9
  %257 = getelementptr inbounds %struct.InternalData2, ptr %256, i32 0, i32 2
  %258 = load ptr, ptr %257, align 8, !tbaa !36
  %259 = icmp eq ptr %258, null
  br i1 %259, label %260, label %263

260:                                              ; preds = %245
  %261 = load ptr, ptr @stderr, align 8, !tbaa !5
  %262 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %261, ptr noundef @.str.22) #5
  call void @exit(i32 noundef 1) #6
  unreachable

263:                                              ; preds = %245
  %264 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %265 = load ptr, ptr %264, align 8, !tbaa !9
  %266 = getelementptr inbounds %struct.InternalData2, ptr %265, i32 0, i32 2
  %267 = load ptr, ptr %266, align 8, !tbaa !36
  %268 = getelementptr inbounds %struct.XVisualInfo, ptr %267, i32 0, i32 1
  %269 = load i64, ptr %268, align 8, !tbaa !47
  %270 = inttoptr i64 %269 to ptr
  %271 = call i32 (ptr, ...) @printf(ptr noundef @.str.23, ptr noundef %270)
  br label %272

272:                                              ; preds = %263
  %273 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %274 = load ptr, ptr %273, align 8, !tbaa !9
  %275 = getelementptr inbounds %struct.InternalData2, ptr %274, i32 0, i32 0
  %276 = load ptr, ptr %275, align 8, !tbaa !13
  %277 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %278 = load ptr, ptr %277, align 8, !tbaa !9
  %279 = getelementptr inbounds %struct.InternalData2, ptr %278, i32 0, i32 1
  %280 = load i64, ptr %279, align 8, !tbaa !29
  %281 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %282 = load ptr, ptr %281, align 8, !tbaa !9
  %283 = getelementptr inbounds %struct.InternalData2, ptr %282, i32 0, i32 2
  %284 = load ptr, ptr %283, align 8, !tbaa !36
  %285 = getelementptr inbounds %struct.XVisualInfo, ptr %284, i32 0, i32 0
  %286 = load ptr, ptr %285, align 8, !tbaa !39
  %287 = call i64 @XCreateColormap(ptr noundef %276, i64 noundef %280, ptr noundef %286, i32 noundef 0)
  %288 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %289 = load ptr, ptr %288, align 8, !tbaa !9
  %290 = getelementptr inbounds %struct.InternalData2, ptr %289, i32 0, i32 3
  store i64 %287, ptr %290, align 8, !tbaa !40
  %291 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %292 = load ptr, ptr %291, align 8, !tbaa !9
  %293 = getelementptr inbounds %struct.InternalData2, ptr %292, i32 0, i32 3
  %294 = load i64, ptr %293, align 8, !tbaa !40
  %295 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %296 = load ptr, ptr %295, align 8, !tbaa !9
  %297 = getelementptr inbounds %struct.InternalData2, ptr %296, i32 0, i32 4
  %298 = getelementptr inbounds %struct.XSetWindowAttributes, ptr %297, i32 0, i32 13
  store i64 %294, ptr %298, align 8, !tbaa !41
  %299 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %300 = load ptr, ptr %299, align 8, !tbaa !9
  %301 = getelementptr inbounds %struct.InternalData2, ptr %300, i32 0, i32 4
  %302 = getelementptr inbounds %struct.XSetWindowAttributes, ptr %301, i32 0, i32 10
  store i64 163919, ptr %302, align 8, !tbaa !44
  %303 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %304 = load ptr, ptr %303, align 8, !tbaa !9
  %305 = getelementptr inbounds %struct.InternalData2, ptr %304, i32 0, i32 0
  %306 = load ptr, ptr %305, align 8, !tbaa !13
  %307 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %308 = load ptr, ptr %307, align 8, !tbaa !9
  %309 = getelementptr inbounds %struct.InternalData2, ptr %308, i32 0, i32 1
  %310 = load i64, ptr %309, align 8, !tbaa !29
  %311 = load ptr, ptr %4, align 8, !tbaa !5
  %312 = getelementptr inbounds %struct.TinyWindowConstructionInfo, ptr %311, i32 0, i32 0
  %313 = load i32, ptr %312, align 8, !tbaa !19
  %314 = load ptr, ptr %4, align 8, !tbaa !5
  %315 = getelementptr inbounds %struct.TinyWindowConstructionInfo, ptr %314, i32 0, i32 1
  %316 = load i32, ptr %315, align 4, !tbaa !22
  %317 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %318 = load ptr, ptr %317, align 8, !tbaa !9
  %319 = getelementptr inbounds %struct.InternalData2, ptr %318, i32 0, i32 2
  %320 = load ptr, ptr %319, align 8, !tbaa !36
  %321 = getelementptr inbounds %struct.XVisualInfo, ptr %320, i32 0, i32 3
  %322 = load i32, ptr %321, align 4, !tbaa !45
  %323 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %324 = load ptr, ptr %323, align 8, !tbaa !9
  %325 = getelementptr inbounds %struct.InternalData2, ptr %324, i32 0, i32 2
  %326 = load ptr, ptr %325, align 8, !tbaa !36
  %327 = getelementptr inbounds %struct.XVisualInfo, ptr %326, i32 0, i32 0
  %328 = load ptr, ptr %327, align 8, !tbaa !39
  %329 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %330 = load ptr, ptr %329, align 8, !tbaa !9
  %331 = getelementptr inbounds %struct.InternalData2, ptr %330, i32 0, i32 4
  %332 = call i64 @XCreateWindow(ptr noundef %306, i64 noundef %310, i32 noundef 0, i32 noundef 0, i32 noundef %313, i32 noundef %316, i32 noundef 0, i32 noundef %322, i32 noundef 1, ptr noundef %328, i64 noundef 10240, ptr noundef %331)
  %333 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %334 = load ptr, ptr %333, align 8, !tbaa !9
  %335 = getelementptr inbounds %struct.InternalData2, ptr %334, i32 0, i32 5
  store i64 %332, ptr %335, align 8, !tbaa !46
  %336 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %337 = load ptr, ptr %336, align 8, !tbaa !9
  %338 = getelementptr inbounds %struct.InternalData2, ptr %337, i32 0, i32 0
  %339 = load ptr, ptr %338, align 8, !tbaa !13
  %340 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %341 = load ptr, ptr %340, align 8, !tbaa !9
  %342 = getelementptr inbounds %struct.InternalData2, ptr %341, i32 0, i32 5
  %343 = load i64, ptr %342, align 8, !tbaa !46
  %344 = call i32 @XMapWindow(ptr noundef %339, i64 noundef %343)
  %345 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %346 = load ptr, ptr %345, align 8, !tbaa !9
  %347 = getelementptr inbounds %struct.InternalData2, ptr %346, i32 0, i32 0
  %348 = load ptr, ptr %347, align 8, !tbaa !13
  %349 = getelementptr inbounds %class.TinyX11OpenGLWindow, ptr %9, i32 0, i32 1
  %350 = load ptr, ptr %349, align 8, !tbaa !9
  %351 = getelementptr inbounds %struct.InternalData2, ptr %350, i32 0, i32 5
  %352 = load i64, ptr %351, align 8, !tbaa !46
  %353 = call i32 @XStoreName(ptr noundef %348, i64 noundef %352, ptr noundef @.str.24)
  br label %354

354:                                              ; preds = %272, %226
  call void @_ZN19TinyX11OpenGLWindow13enable_openglEv(ptr noundef nonnull align 8 dereferenceable(18) %9)
  ret void
}

declare ptr @XOpenDisplay(ptr noundef) #2

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

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

declare i32 @XFree(ptr noundef) #2

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

declare i64 @XCreateColormap(ptr noundef, i64 noundef, ptr noundef, i32 noundef) #2

declare i64 @XCreateWindow(ptr noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, i64 noundef, ptr noundef) #2

declare i32 @XMapWindow(ptr noundef, i64 noundef) #2

declare i32 @XStoreName(ptr noundef, i64 noundef, ptr noundef) #2

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"_ZTS19TinyX11OpenGLWindow", !11, i64 0, !6, i64 8, !12, i64 16, !12, i64 17}
!11 = !{!"_ZTS19TinyWindowInterface"}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTS13InternalData2", !6, i64 0, !15, i64 8, !6, i64 16, !15, i64 24, !16, i64 32, !15, i64 144, !6, i64 152, !18, i64 160, !7, i64 296, !6, i64 488, !17, i64 496, !17, i64 500, !17, i64 504, !6, i64 512, !6, i64 520, !6, i64 528, !6, i64 536, !6, i64 544}
!15 = !{!"long", !7, i64 0}
!16 = !{!"_ZTS20XSetWindowAttributes", !15, i64 0, !15, i64 8, !15, i64 16, !15, i64 24, !17, i64 32, !17, i64 36, !17, i64 40, !15, i64 48, !15, i64 56, !17, i64 64, !15, i64 72, !15, i64 80, !17, i64 88, !15, i64 96, !15, i64 104}
!17 = !{!"int", !7, i64 0}
!18 = !{!"_ZTS17XWindowAttributes", !17, i64 0, !17, i64 4, !17, i64 8, !17, i64 12, !17, i64 16, !17, i64 20, !6, i64 24, !15, i64 32, !17, i64 40, !17, i64 44, !17, i64 48, !17, i64 52, !15, i64 56, !15, i64 64, !17, i64 72, !15, i64 80, !17, i64 88, !17, i64 92, !15, i64 96, !15, i64 104, !15, i64 112, !17, i64 120, !6, i64 128}
!19 = !{!20, !17, i64 0}
!20 = !{!"_ZTS26TinyWindowConstructionInfo", !17, i64 0, !17, i64 4, !12, i64 8, !17, i64 12, !6, i64 16, !6, i64 24, !17, i64 32, !17, i64 36}
!21 = !{!14, !17, i64 500}
!22 = !{!20, !17, i64 4}
!23 = !{!14, !17, i64 504}
!24 = !{!25, !6, i64 232}
!25 = !{!"_ZTS3$_0", !6, i64 0, !6, i64 8, !17, i64 16, !17, i64 20, !17, i64 24, !17, i64 28, !6, i64 32, !15, i64 40, !15, i64 48, !15, i64 56, !17, i64 64, !6, i64 72, !17, i64 80, !17, i64 84, !17, i64 88, !17, i64 92, !17, i64 96, !6, i64 104, !17, i64 112, !17, i64 116, !6, i64 120, !6, i64 128, !17, i64 136, !15, i64 144, !15, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !17, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !17, i64 224, !17, i64 228, !6, i64 232, !15, i64 240, !15, i64 248, !17, i64 256, !17, i64 260, !6, i64 264, !6, i64 272, !17, i64 280, !6, i64 288}
!26 = !{!25, !17, i64 224}
!27 = !{!28, !15, i64 16}
!28 = !{!"_ZTS6Screen", !6, i64 0, !6, i64 8, !15, i64 16, !17, i64 24, !17, i64 28, !17, i64 32, !17, i64 36, !17, i64 40, !6, i64 48, !17, i64 56, !6, i64 64, !6, i64 72, !15, i64 80, !15, i64 88, !15, i64 96, !17, i64 104, !17, i64 108, !17, i64 112, !17, i64 116, !15, i64 120}
!29 = !{!14, !15, i64 8}
!30 = !{!20, !17, i64 32}
!31 = !{!12, !12, i64 0}
!32 = !{i8 0, i8 2}
!33 = !{}
!34 = !{!17, !17, i64 0}
!35 = !{!14, !6, i64 488}
!36 = !{!14, !6, i64 16}
!37 = !{!38, !17, i64 16}
!38 = !{!"_ZTS11XVisualInfo", !6, i64 0, !15, i64 8, !17, i64 16, !17, i64 20, !17, i64 24, !15, i64 32, !15, i64 40, !15, i64 48, !17, i64 56, !17, i64 60}
!39 = !{!38, !6, i64 0}
!40 = !{!14, !15, i64 24}
!41 = !{!14, !15, i64 128}
!42 = !{!14, !15, i64 32}
!43 = !{!14, !15, i64 56}
!44 = !{!14, !15, i64 104}
!45 = !{!38, !17, i64 20}
!46 = !{!14, !15, i64 144}
!47 = !{!38, !15, i64 8}


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

@att = external dso_local global [15 x i32], align 16
@_ZL12forceOpenGL3 = external hidden local_unnamed_addr global i8, align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.16 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [41 x i8], align 1
@_ZZN19TinyX11OpenGLWindow13create_windowERK26TinyWindowConstructionInfoE14visual_attribs = external hidden global [23 x i32], align 16
@.str.18 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [15 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN19TinyX11OpenGLWindow13enable_openglEv(ptr noundef nonnull align 8 dereferenceable(18)) local_unnamed_addr #0 align 2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN19TinyX11OpenGLWindow13create_windowERK26TinyWindowConstructionInfo(ptr noundef nonnull align 8 dereferenceable(18) %0, ptr nocapture noundef nonnull readonly align 8 dereferenceable(40) %1) unnamed_addr #0 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = tail call ptr @XOpenDisplay(ptr noundef null)
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %6, ptr %8, align 8, !tbaa !12
  %9 = getelementptr inbounds i8, ptr %8, i64 500
  %10 = getelementptr inbounds i8, ptr %1, i64 4
  %11 = load <2 x i32>, ptr %1, align 8, !tbaa !18
  store <2 x i32> %11, ptr %9, align 4, !tbaa !18
  %12 = icmp eq ptr %6, null
  br i1 %12, label %13, label %16

13:                                               ; preds = %2
  %14 = load ptr, ptr @stderr, align 8, !tbaa !19
  %15 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %14, ptr noundef nonnull @.str.16) #5
  tail call void @exit(i32 noundef 1) #6
  unreachable

16:                                               ; preds = %2
  %17 = getelementptr inbounds i8, ptr %6, i64 232
  %18 = load ptr, ptr %17, align 8, !tbaa !20
  %19 = getelementptr inbounds i8, ptr %6, i64 224
  %20 = load i32, ptr %19, align 8, !tbaa !22
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds %struct.Screen, ptr %18, i64 %21, i32 2
  %23 = load i64, ptr %22, align 8, !tbaa !23
  %24 = getelementptr inbounds i8, ptr %8, i64 8
  store i64 %23, ptr %24, align 8, !tbaa !25
  %25 = getelementptr inbounds i8, ptr %1, i64 32
  %26 = load i32, ptr %25, align 8, !tbaa !26
  %27 = icmp slt i32 %26, 3
  br i1 %27, label %.thread, label %28

.thread:                                          ; preds = %16
  store i8 0, ptr @_ZL12forceOpenGL3, align 1, !tbaa !28
  br label %106

28:                                               ; preds = %16
  %.pre = load i8, ptr @_ZL12forceOpenGL3, align 1, !tbaa !28, !range !29
  %29 = trunc nuw i8 %.pre to i1
  br i1 %29, label %30, label %106

30:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %31 = call i32 @glXQueryVersion(ptr noundef nonnull %6, ptr noundef nonnull %4, ptr noundef nonnull %3)
  %.not = icmp eq i32 %31, 0
  %.pre19 = load i32, ptr %4, align 4
  %.pre20 = load i32, ptr %3, align 4
  br i1 %.not, label %36, label %32

32:                                               ; preds = %30
  %33 = icmp eq i32 %.pre19, 1
  %34 = icmp slt i32 %.pre20, 3
  %or.cond = select i1 %33, i1 %34, i1 false
  %35 = icmp slt i32 %.pre19, 1
  %or.cond3 = or i1 %35, %or.cond
  br i1 %or.cond3, label %36, label %39

36:                                               ; preds = %32, %30
  %37 = load ptr, ptr @stderr, align 8, !tbaa !19
  %38 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef nonnull @.str.17, i32 noundef %.pre19, i32 noundef %.pre20) #5
  call void @exit(i32 noundef 1) #6
  unreachable

39:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = load ptr, ptr %40, align 8, !tbaa !12
  %42 = getelementptr inbounds i8, ptr %41, i64 224
  %43 = load i32, ptr %42, align 8, !tbaa !22
  %44 = call ptr @glXChooseFBConfig(ptr noundef %41, i32 noundef %43, ptr noundef nonnull @_ZZN19TinyX11OpenGLWindow13create_windowERK26TinyWindowConstructionInfoE14visual_attribs, ptr noundef nonnull %5)
  %.not17 = icmp eq ptr %44, null
  br i1 %.not17, label %45, label %48

45:                                               ; preds = %39
  %46 = load ptr, ptr @stderr, align 8, !tbaa !19
  %47 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef nonnull @.str.18) #5
  call void @exit(i32 noundef 1) #6
  unreachable

48:                                               ; preds = %39
  %49 = load ptr, ptr %44, align 8, !tbaa !19
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = getelementptr inbounds i8, ptr %50, i64 488
  store ptr %49, ptr %51, align 8, !tbaa !30
  %52 = call i32 @XFree(ptr noundef nonnull %44)
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = load ptr, ptr %53, align 8, !tbaa !12
  %55 = getelementptr inbounds i8, ptr %53, i64 488
  %56 = load ptr, ptr %55, align 8, !tbaa !30
  %57 = call ptr @glXGetVisualFromFBConfig(ptr noundef %54, ptr noundef %56)
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  %59 = getelementptr inbounds i8, ptr %58, i64 16
  store ptr %57, ptr %59, align 8, !tbaa !31
  %60 = load ptr, ptr %58, align 8, !tbaa !12
  %61 = getelementptr inbounds i8, ptr %60, i64 232
  %62 = load ptr, ptr %61, align 8, !tbaa !20
  %63 = getelementptr inbounds i8, ptr %57, i64 16
  %64 = load i32, ptr %63, align 8, !tbaa !32
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds %struct.Screen, ptr %62, i64 %65, i32 2
  %67 = load i64, ptr %66, align 8, !tbaa !23
  %68 = load ptr, ptr %57, align 8, !tbaa !34
  %69 = call i64 @XCreateColormap(ptr noundef %60, i64 noundef %67, ptr noundef %68, i32 noundef 0)
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = getelementptr inbounds i8, ptr %70, i64 24
  store i64 %69, ptr %71, align 8, !tbaa !35
  %72 = getelementptr inbounds i8, ptr %70, i64 128
  store i64 %69, ptr %72, align 8, !tbaa !36
  %73 = getelementptr inbounds i8, ptr %70, i64 32
  store i64 0, ptr %73, align 8, !tbaa !37
  %74 = getelementptr inbounds i8, ptr %70, i64 56
  store i64 0, ptr %74, align 8, !tbaa !38
  %75 = getelementptr inbounds i8, ptr %70, i64 104
  store i64 163919, ptr %75, align 8, !tbaa !39
  %76 = load ptr, ptr %70, align 8, !tbaa !12
  %77 = getelementptr inbounds i8, ptr %76, i64 232
  %78 = load ptr, ptr %77, align 8, !tbaa !20
  %79 = getelementptr inbounds i8, ptr %70, i64 16
  %80 = load ptr, ptr %79, align 8, !tbaa !31
  %81 = getelementptr inbounds i8, ptr %80, i64 16
  %82 = load i32, ptr %81, align 8, !tbaa !32
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds %struct.Screen, ptr %78, i64 %83, i32 2
  %85 = load i64, ptr %84, align 8, !tbaa !23
  %86 = getelementptr inbounds i8, ptr %70, i64 8
  store i64 %85, ptr %86, align 8, !tbaa !25
  %87 = load i32, ptr %1, align 8, !tbaa !40
  %88 = load i32, ptr %10, align 4, !tbaa !41
  %89 = getelementptr inbounds i8, ptr %80, i64 20
  %90 = load i32, ptr %89, align 4, !tbaa !42
  %91 = load ptr, ptr %80, align 8, !tbaa !34
  %92 = call i64 @XCreateWindow(ptr noundef %76, i64 noundef %85, i32 noundef 0, i32 noundef 0, i32 noundef %87, i32 noundef %88, i32 noundef 0, i32 noundef %90, i32 noundef 1, ptr noundef %91, i64 noundef 10248, ptr noundef nonnull %73)
  %93 = load ptr, ptr %7, align 8, !tbaa !5
  %94 = getelementptr inbounds i8, ptr %93, i64 144
  store i64 %92, ptr %94, align 8, !tbaa !43
  %.not18 = icmp eq i64 %92, 0
  br i1 %.not18, label %95, label %98

95:                                               ; preds = %48
  %96 = load ptr, ptr @stderr, align 8, !tbaa !19
  %97 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %96, ptr noundef nonnull @.str.19) #5
  call void @exit(i32 noundef 1) #6
  unreachable

98:                                               ; preds = %48
  %99 = load ptr, ptr %93, align 8, !tbaa !12
  %100 = call i32 @XMapWindow(ptr noundef %99, i64 noundef %92)
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  %102 = load ptr, ptr %101, align 8, !tbaa !12
  %103 = getelementptr inbounds i8, ptr %101, i64 144
  %104 = load i64, ptr %103, align 8, !tbaa !43
  %105 = call i32 @XStoreName(ptr noundef %102, i64 noundef %104, ptr noundef nonnull @.str.20)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  br label %156

106:                                              ; preds = %.thread, %28
  %107 = tail call ptr @glXChooseVisual(ptr noundef nonnull %6, i32 noundef 0, ptr noundef nonnull @att)
  %108 = load ptr, ptr %7, align 8, !tbaa !5
  %109 = getelementptr inbounds i8, ptr %108, i64 16
  store ptr %107, ptr %109, align 8, !tbaa !31
  %110 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.21)
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  %112 = getelementptr inbounds i8, ptr %111, i64 16
  %113 = load ptr, ptr %112, align 8, !tbaa !31
  %114 = icmp eq ptr %113, null
  br i1 %114, label %115, label %118

115:                                              ; preds = %106
  %116 = load ptr, ptr @stderr, align 8, !tbaa !19
  %117 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %116, ptr noundef nonnull @.str.22) #5
  tail call void @exit(i32 noundef 1) #6
  unreachable

118:                                              ; preds = %106
  %119 = getelementptr inbounds i8, ptr %113, i64 8
  %120 = load i64, ptr %119, align 8, !tbaa !44
  %121 = inttoptr i64 %120 to ptr
  %122 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23, ptr noundef %121)
  %123 = load ptr, ptr %7, align 8, !tbaa !5
  %124 = load ptr, ptr %123, align 8, !tbaa !12
  %125 = getelementptr inbounds i8, ptr %123, i64 8
  %126 = load i64, ptr %125, align 8, !tbaa !25
  %127 = getelementptr inbounds i8, ptr %123, i64 16
  %128 = load ptr, ptr %127, align 8, !tbaa !31
  %129 = load ptr, ptr %128, align 8, !tbaa !34
  %130 = tail call i64 @XCreateColormap(ptr noundef %124, i64 noundef %126, ptr noundef %129, i32 noundef 0)
  %131 = load ptr, ptr %7, align 8, !tbaa !5
  %132 = getelementptr inbounds i8, ptr %131, i64 24
  store i64 %130, ptr %132, align 8, !tbaa !35
  %133 = getelementptr inbounds i8, ptr %131, i64 128
  store i64 %130, ptr %133, align 8, !tbaa !36
  %134 = getelementptr inbounds i8, ptr %131, i64 104
  store i64 163919, ptr %134, align 8, !tbaa !39
  %135 = load ptr, ptr %131, align 8, !tbaa !12
  %136 = getelementptr inbounds i8, ptr %131, i64 8
  %137 = load i64, ptr %136, align 8, !tbaa !25
  %138 = load i32, ptr %1, align 8, !tbaa !40
  %139 = load i32, ptr %10, align 4, !tbaa !41
  %140 = getelementptr inbounds i8, ptr %131, i64 16
  %141 = load ptr, ptr %140, align 8, !tbaa !31
  %142 = getelementptr inbounds i8, ptr %141, i64 20
  %143 = load i32, ptr %142, align 4, !tbaa !42
  %144 = load ptr, ptr %141, align 8, !tbaa !34
  %145 = getelementptr inbounds i8, ptr %131, i64 32
  %146 = tail call i64 @XCreateWindow(ptr noundef %135, i64 noundef %137, i32 noundef 0, i32 noundef 0, i32 noundef %138, i32 noundef %139, i32 noundef 0, i32 noundef %143, i32 noundef 1, ptr noundef %144, i64 noundef 10240, ptr noundef nonnull %145)
  %147 = load ptr, ptr %7, align 8, !tbaa !5
  %148 = getelementptr inbounds i8, ptr %147, i64 144
  store i64 %146, ptr %148, align 8, !tbaa !43
  %149 = load ptr, ptr %147, align 8, !tbaa !12
  %150 = tail call i32 @XMapWindow(ptr noundef %149, i64 noundef %146)
  %151 = load ptr, ptr %7, align 8, !tbaa !5
  %152 = load ptr, ptr %151, align 8, !tbaa !12
  %153 = getelementptr inbounds i8, ptr %151, i64 144
  %154 = load i64, ptr %153, align 8, !tbaa !43
  %155 = tail call i32 @XStoreName(ptr noundef %152, i64 noundef %154, ptr noundef nonnull @.str.24)
  br label %156

156:                                              ; preds = %118, %98
  call void @_ZN19TinyX11OpenGLWindow13enable_openglEv(ptr noundef nonnull align 8 dereferenceable(18) %0)
  ret void
}

declare ptr @XOpenDisplay(ptr noundef) local_unnamed_addr #4

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

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

declare i32 @XFree(ptr noundef) local_unnamed_addr #4

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

declare i64 @XCreateColormap(ptr noundef, i64 noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

declare i64 @XCreateWindow(ptr noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #4

declare i32 @XMapWindow(ptr noundef, i64 noundef) local_unnamed_addr #4

declare i32 @XStoreName(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #4

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

attributes #0 = { mustprogress 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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 = { cold nounwind }
attributes #6 = { noreturn nounwind }
attributes #7 = { 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, !8, i64 8}
!6 = !{!"_ZTS19TinyX11OpenGLWindow", !7, i64 0, !8, i64 8, !11, i64 16, !11, i64 17}
!7 = !{!"_ZTS19TinyWindowInterface"}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"bool", !9, i64 0}
!12 = !{!13, !8, i64 0}
!13 = !{!"_ZTS13InternalData2", !8, i64 0, !14, i64 8, !8, i64 16, !14, i64 24, !15, i64 32, !14, i64 144, !8, i64 152, !17, i64 160, !9, i64 296, !8, i64 488, !16, i64 496, !16, i64 500, !16, i64 504, !8, i64 512, !8, i64 520, !8, i64 528, !8, i64 536, !8, i64 544}
!14 = !{!"long", !9, i64 0}
!15 = !{!"_ZTS20XSetWindowAttributes", !14, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !16, i64 32, !16, i64 36, !16, i64 40, !14, i64 48, !14, i64 56, !16, i64 64, !14, i64 72, !14, i64 80, !16, i64 88, !14, i64 96, !14, i64 104}
!16 = !{!"int", !9, i64 0}
!17 = !{!"_ZTS17XWindowAttributes", !16, i64 0, !16, i64 4, !16, i64 8, !16, i64 12, !16, i64 16, !16, i64 20, !8, i64 24, !14, i64 32, !16, i64 40, !16, i64 44, !16, i64 48, !16, i64 52, !14, i64 56, !14, i64 64, !16, i64 72, !14, i64 80, !16, i64 88, !16, i64 92, !14, i64 96, !14, i64 104, !14, i64 112, !16, i64 120, !8, i64 128}
!18 = !{!16, !16, i64 0}
!19 = !{!8, !8, i64 0}
!20 = !{!21, !8, i64 232}
!21 = !{!"_ZTS3$_0", !8, i64 0, !8, i64 8, !16, i64 16, !16, i64 20, !16, i64 24, !16, i64 28, !8, i64 32, !14, i64 40, !14, i64 48, !14, i64 56, !16, i64 64, !8, i64 72, !16, i64 80, !16, i64 84, !16, i64 88, !16, i64 92, !16, i64 96, !8, i64 104, !16, i64 112, !16, i64 116, !8, i64 120, !8, i64 128, !16, i64 136, !14, i64 144, !14, i64 152, !8, i64 160, !8, i64 168, !8, i64 176, !8, i64 184, !16, i64 192, !8, i64 200, !8, i64 208, !8, i64 216, !16, i64 224, !16, i64 228, !8, i64 232, !14, i64 240, !14, i64 248, !16, i64 256, !16, i64 260, !8, i64 264, !8, i64 272, !16, i64 280, !8, i64 288}
!22 = !{!21, !16, i64 224}
!23 = !{!24, !14, i64 16}
!24 = !{!"_ZTS6Screen", !8, i64 0, !8, i64 8, !14, i64 16, !16, i64 24, !16, i64 28, !16, i64 32, !16, i64 36, !16, i64 40, !8, i64 48, !16, i64 56, !8, i64 64, !8, i64 72, !14, i64 80, !14, i64 88, !14, i64 96, !16, i64 104, !16, i64 108, !16, i64 112, !16, i64 116, !14, i64 120}
!25 = !{!13, !14, i64 8}
!26 = !{!27, !16, i64 32}
!27 = !{!"_ZTS26TinyWindowConstructionInfo", !16, i64 0, !16, i64 4, !11, i64 8, !16, i64 12, !8, i64 16, !8, i64 24, !16, i64 32, !16, i64 36}
!28 = !{!11, !11, i64 0}
!29 = !{i8 0, i8 2}
!30 = !{!13, !8, i64 488}
!31 = !{!13, !8, i64 16}
!32 = !{!33, !16, i64 16}
!33 = !{!"_ZTS11XVisualInfo", !8, i64 0, !14, i64 8, !16, i64 16, !16, i64 20, !16, i64 24, !14, i64 32, !14, i64 40, !14, i64 48, !16, i64 56, !16, i64 60}
!34 = !{!33, !8, i64 0}
!35 = !{!13, !14, i64 24}
!36 = !{!13, !14, i64 128}
!37 = !{!13, !14, i64 32}
!38 = !{!13, !14, i64 56}
!39 = !{!13, !14, i64 104}
!40 = !{!27, !16, i64 0}
!41 = !{!27, !16, i64 4}
!42 = !{!33, !16, i64 20}
!43 = !{!13, !14, i64 144}
!44 = !{!33, !14, i64 8}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass