; LLVM IR from Eukky/TRender :: lib/glew/src (visualinfo)

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

@display = external dso_local global ptr, align 8
@__const.CreateContext.attrib = external hidden unnamed_addr constant [3 x i32], align 4

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i8 @CreateContext(ptr noundef %0) #1 {
  %2 = alloca i8, align 1
  %3 = alloca ptr, align 8
  %4 = alloca [3 x i32], align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %struct.XSetWindowAttributes, align 8
  %8 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %4) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %4, ptr align 4 @__const.CreateContext.attrib, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 112, ptr %7) #4
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  %10 = icmp eq ptr null, %9
  br i1 %10, label %11, label %12

11:                                               ; preds = %1
  store i8 1, ptr %2, align 1
  store i32 1, ptr %8, align 4
  br label %136

12:                                               ; preds = %1
  %13 = load ptr, ptr @display, align 8, !tbaa !5
  %14 = call ptr @XOpenDisplay(ptr noundef %13)
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.GLContextStruct, ptr %15, i32 0, i32 0
  store ptr %14, ptr %16, align 8, !tbaa !9
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.GLContextStruct, ptr %17, i32 0, i32 0
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  %20 = icmp eq ptr null, %19
  br i1 %20, label %21, label %22

21:                                               ; preds = %12
  store i8 1, ptr %2, align 1
  store i32 1, ptr %8, align 4
  br label %136

22:                                               ; preds = %12
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.GLContextStruct, ptr %23, i32 0, i32 0
  %25 = load ptr, ptr %24, align 8, !tbaa !9
  %26 = call i32 @glXQueryExtension(ptr noundef %25, ptr noundef %5, ptr noundef %6)
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %29, label %28

28:                                               ; preds = %22
  store i8 1, ptr %2, align 1
  store i32 1, ptr %8, align 4
  br label %136

29:                                               ; preds = %22
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.GLContextStruct, ptr %30, i32 0, i32 0
  %32 = load ptr, ptr %31, align 8, !tbaa !9
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.GLContextStruct, ptr %33, i32 0, i32 0
  %35 = load ptr, ptr %34, align 8, !tbaa !9
  %36 = getelementptr inbounds %struct.anon, ptr %35, i32 0, i32 33
  %37 = load i32, ptr %36, align 8, !tbaa !12
  %38 = getelementptr inbounds [3 x i32], ptr %4, i64 0, i64 0
  %39 = call ptr @glXChooseVisual(ptr noundef %32, i32 noundef %37, ptr noundef %38)
  %40 = load ptr, ptr %3, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.GLContextStruct, ptr %40, i32 0, i32 1
  store ptr %39, ptr %41, align 8, !tbaa !15
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.GLContextStruct, ptr %42, i32 0, i32 1
  %44 = load ptr, ptr %43, align 8, !tbaa !15
  %45 = icmp eq ptr null, %44
  br i1 %45, label %46, label %47

46:                                               ; preds = %29
  store i8 1, ptr %2, align 1
  store i32 1, ptr %8, align 4
  br label %136

47:                                               ; preds = %29
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.GLContextStruct, ptr %48, i32 0, i32 0
  %50 = load ptr, ptr %49, align 8, !tbaa !9
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.GLContextStruct, ptr %51, i32 0, i32 1
  %53 = load ptr, ptr %52, align 8, !tbaa !15
  %54 = call ptr @glXCreateContext(ptr noundef %50, ptr noundef %53, ptr noundef null, i32 noundef 1)
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.GLContextStruct, ptr %55, i32 0, i32 2
  store ptr %54, ptr %56, align 8, !tbaa !16
  %57 = load ptr, ptr %3, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.GLContextStruct, ptr %57, i32 0, i32 2
  %59 = load ptr, ptr %58, align 8, !tbaa !16
  %60 = icmp eq ptr null, %59
  br i1 %60, label %61, label %62

61:                                               ; preds = %47
  store i8 1, ptr %2, align 1
  store i32 1, ptr %8, align 4
  br label %136

62:                                               ; preds = %47
  %63 = load ptr, ptr %3, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.GLContextStruct, ptr %63, i32 0, i32 0
  %65 = load ptr, ptr %64, align 8, !tbaa !9
  %66 = load ptr, ptr %3, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.GLContextStruct, ptr %66, i32 0, i32 0
  %68 = load ptr, ptr %67, align 8, !tbaa !9
  %69 = getelementptr inbounds %struct.anon, ptr %68, i32 0, i32 35
  %70 = load ptr, ptr %69, align 8, !tbaa !17
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.GLContextStruct, ptr %71, i32 0, i32 1
  %73 = load ptr, ptr %72, align 8, !tbaa !15
  %74 = getelementptr inbounds %struct.XVisualInfo, ptr %73, i32 0, i32 2
  %75 = load i32, ptr %74, align 8, !tbaa !18
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds %struct.Screen, ptr %70, i64 %76
  %78 = getelementptr inbounds %struct.Screen, ptr %77, i32 0, i32 2
  %79 = load i64, ptr %78, align 8, !tbaa !20
  %80 = load ptr, ptr %3, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.GLContextStruct, ptr %80, i32 0, i32 1
  %82 = load ptr, ptr %81, align 8, !tbaa !15
  %83 = getelementptr inbounds %struct.XVisualInfo, ptr %82, i32 0, i32 0
  %84 = load ptr, ptr %83, align 8, !tbaa !22
  %85 = call i64 @XCreateColormap(ptr noundef %65, i64 noundef %79, ptr noundef %84, i32 noundef 0)
  %86 = load ptr, ptr %3, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.GLContextStruct, ptr %86, i32 0, i32 4
  store i64 %85, ptr %87, align 8, !tbaa !23
  %88 = getelementptr inbounds %struct.XSetWindowAttributes, ptr %7, i32 0, i32 3
  store i64 0, ptr %88, align 8, !tbaa !24
  %89 = load ptr, ptr %3, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.GLContextStruct, ptr %89, i32 0, i32 4
  %91 = load i64, ptr %90, align 8, !tbaa !23
  %92 = getelementptr inbounds %struct.XSetWindowAttributes, ptr %7, i32 0, i32 13
  store i64 %91, ptr %92, align 8, !tbaa !26
  %93 = load ptr, ptr %3, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.GLContextStruct, ptr %93, i32 0, i32 0
  %95 = load ptr, ptr %94, align 8, !tbaa !9
  %96 = load ptr, ptr %3, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.GLContextStruct, ptr %96, i32 0, i32 0
  %98 = load ptr, ptr %97, align 8, !tbaa !9
  %99 = getelementptr inbounds %struct.anon, ptr %98, i32 0, i32 35
  %100 = load ptr, ptr %99, align 8, !tbaa !17
  %101 = load ptr, ptr %3, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.GLContextStruct, ptr %101, i32 0, i32 1
  %103 = load ptr, ptr %102, align 8, !tbaa !15
  %104 = getelementptr inbounds %struct.XVisualInfo, ptr %103, i32 0, i32 2
  %105 = load i32, ptr %104, align 8, !tbaa !18
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds %struct.Screen, ptr %100, i64 %106
  %108 = getelementptr inbounds %struct.Screen, ptr %107, i32 0, i32 2
  %109 = load i64, ptr %108, align 8, !tbaa !20
  %110 = load ptr, ptr %3, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.GLContextStruct, ptr %110, i32 0, i32 1
  %112 = load ptr, ptr %111, align 8, !tbaa !15
  %113 = getelementptr inbounds %struct.XVisualInfo, ptr %112, i32 0, i32 3
  %114 = load i32, ptr %113, align 4, !tbaa !27
  %115 = load ptr, ptr %3, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.GLContextStruct, ptr %115, i32 0, i32 1
  %117 = load ptr, ptr %116, align 8, !tbaa !15
  %118 = getelementptr inbounds %struct.XVisualInfo, ptr %117, i32 0, i32 0
  %119 = load ptr, ptr %118, align 8, !tbaa !22
  %120 = call i64 @XCreateWindow(ptr noundef %95, i64 noundef %109, i32 noundef 0, i32 noundef 0, i32 noundef 1, i32 noundef 1, i32 noundef 0, i32 noundef %114, i32 noundef 1, ptr noundef %119, i64 noundef 8200, ptr noundef %7)
  %121 = load ptr, ptr %3, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.GLContextStruct, ptr %121, i32 0, i32 3
  store i64 %120, ptr %122, align 8, !tbaa !28
  %123 = load ptr, ptr %3, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.GLContextStruct, ptr %123, i32 0, i32 0
  %125 = load ptr, ptr %124, align 8, !tbaa !9
  %126 = load ptr, ptr %3, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.GLContextStruct, ptr %126, i32 0, i32 3
  %128 = load i64, ptr %127, align 8, !tbaa !28
  %129 = load ptr, ptr %3, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.GLContextStruct, ptr %129, i32 0, i32 2
  %131 = load ptr, ptr %130, align 8, !tbaa !16
  %132 = call i32 @glXMakeCurrent(ptr noundef %125, i64 noundef %128, ptr noundef %131)
  %133 = icmp ne i32 %132, 0
  br i1 %133, label %135, label %134

134:                                              ; preds = %62
  store i8 1, ptr %2, align 1
  store i32 1, ptr %8, align 4
  br label %136

135:                                              ; preds = %62
  store i8 0, ptr %2, align 1
  store i32 1, ptr %8, align 4
  br label %136

136:                                              ; preds = %135, %134, %61, %46, %28, %21, %11
  call void @llvm.lifetime.end.p0(i64 112, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr %4) #4
  %137 = load i8, ptr %2, align 1
  ret i8 %137
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

declare ptr @XOpenDisplay(ptr noundef) #3

declare i32 @glXQueryExtension(ptr noundef, ptr noundef, ptr noundef) #3

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

declare ptr @glXCreateContext(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #3

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

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

declare i32 @glXMakeCurrent(ptr noundef, i64 noundef, ptr noundef) #3

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"GLContextStruct", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24, !11, i64 32}
!11 = !{!"long", !7, i64 0}
!12 = !{!13, !14, i64 224}
!13 = !{!"", !6, i64 0, !6, i64 8, !14, i64 16, !14, i64 20, !14, i64 24, !14, i64 28, !6, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !14, i64 64, !6, i64 72, !14, i64 80, !14, i64 84, !14, i64 88, !14, i64 92, !14, i64 96, !6, i64 104, !14, i64 112, !14, i64 116, !6, i64 120, !6, i64 128, !14, i64 136, !11, i64 144, !11, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !14, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !14, i64 224, !14, i64 228, !6, i64 232, !11, i64 240, !11, i64 248, !14, i64 256, !14, i64 260, !6, i64 264, !6, i64 272, !14, i64 280, !6, i64 288}
!14 = !{!"int", !7, i64 0}
!15 = !{!10, !6, i64 8}
!16 = !{!10, !6, i64 16}
!17 = !{!13, !6, i64 232}
!18 = !{!19, !14, i64 16}
!19 = !{!"", !6, i64 0, !11, i64 8, !14, i64 16, !14, i64 20, !14, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !14, i64 56, !14, i64 60}
!20 = !{!21, !11, i64 16}
!21 = !{!"", !6, i64 0, !6, i64 8, !11, i64 16, !14, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !14, i64 40, !6, i64 48, !14, i64 56, !6, i64 64, !6, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !14, i64 104, !14, i64 108, !14, i64 112, !14, i64 116, !11, i64 120}
!22 = !{!19, !6, i64 0}
!23 = !{!10, !11, i64 32}
!24 = !{!25, !11, i64 24}
!25 = !{!"", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !14, i64 32, !14, i64 36, !14, i64 40, !11, i64 48, !11, i64 56, !14, i64 64, !11, i64 72, !11, i64 80, !14, i64 88, !11, i64 96, !11, i64 104}
!26 = !{!25, !11, i64 96}
!27 = !{!19, !14, i64 20}
!28 = !{!10, !11, i64 24}


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

@display = external dso_local local_unnamed_addr global ptr, align 8
@__const.CreateContext.attrib = external hidden unnamed_addr constant [3 x i32], align 4

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

; Function Attrs: nounwind uwtable
define dso_local zeroext range(i8 0, 2) i8 @CreateContext(ptr noundef %0) local_unnamed_addr #1 {
  %2 = alloca [3 x i32], align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %struct.XSetWindowAttributes, align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) @__const.CreateContext.attrib, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %5) #4
  %6 = icmp eq ptr %0, null
  br i1 %6, label %57, label %7

7:                                                ; preds = %1
  %8 = load ptr, ptr @display, align 8, !tbaa !5
  %9 = tail call ptr @XOpenDisplay(ptr noundef %8) #4
  store ptr %9, ptr %0, align 8, !tbaa !9
  %10 = icmp eq ptr %9, null
  br i1 %10, label %57, label %11

11:                                               ; preds = %7
  %12 = call i32 @glXQueryExtension(ptr noundef nonnull %9, ptr noundef nonnull %3, ptr noundef nonnull %4) #4
  %.not = icmp eq i32 %12, 0
  br i1 %.not, label %57, label %13

13:                                               ; preds = %11
  %14 = load ptr, ptr %0, align 8, !tbaa !9
  %15 = getelementptr inbounds i8, ptr %14, i64 224
  %16 = load i32, ptr %15, align 8, !tbaa !12
  %17 = call ptr @glXChooseVisual(ptr noundef %14, i32 noundef %16, ptr noundef nonnull %2) #4
  %18 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %17, ptr %18, align 8, !tbaa !15
  %19 = icmp eq ptr %17, null
  br i1 %19, label %57, label %20

20:                                               ; preds = %13
  %21 = load ptr, ptr %0, align 8, !tbaa !9
  %22 = call ptr @glXCreateContext(ptr noundef %21, ptr noundef nonnull %17, ptr noundef null, i32 noundef 1) #4
  %23 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %22, ptr %23, align 8, !tbaa !16
  %24 = icmp eq ptr %22, null
  br i1 %24, label %57, label %25

25:                                               ; preds = %20
  %26 = load ptr, ptr %0, align 8, !tbaa !9
  %27 = getelementptr inbounds i8, ptr %26, i64 232
  %28 = load ptr, ptr %27, align 8, !tbaa !17
  %29 = load ptr, ptr %18, align 8, !tbaa !15
  %30 = getelementptr inbounds i8, ptr %29, i64 16
  %31 = load i32, ptr %30, align 8, !tbaa !18
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds %struct.Screen, ptr %28, i64 %32, i32 2
  %34 = load i64, ptr %33, align 8, !tbaa !20
  %35 = load ptr, ptr %29, align 8, !tbaa !22
  %36 = call i64 @XCreateColormap(ptr noundef %26, i64 noundef %34, ptr noundef %35, i32 noundef 0) #4
  %37 = getelementptr inbounds i8, ptr %0, i64 32
  store i64 %36, ptr %37, align 8, !tbaa !23
  %38 = getelementptr inbounds i8, ptr %5, i64 24
  store i64 0, ptr %38, align 8, !tbaa !24
  %39 = getelementptr inbounds i8, ptr %5, i64 96
  store i64 %36, ptr %39, align 8, !tbaa !26
  %40 = load ptr, ptr %0, align 8, !tbaa !9
  %41 = getelementptr inbounds i8, ptr %40, i64 232
  %42 = load ptr, ptr %41, align 8, !tbaa !17
  %43 = load ptr, ptr %18, align 8, !tbaa !15
  %44 = getelementptr inbounds i8, ptr %43, i64 16
  %45 = load i32, ptr %44, align 8, !tbaa !18
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds %struct.Screen, ptr %42, i64 %46, i32 2
  %48 = load i64, ptr %47, align 8, !tbaa !20
  %49 = getelementptr inbounds i8, ptr %43, i64 20
  %50 = load i32, ptr %49, align 4, !tbaa !27
  %51 = load ptr, ptr %43, align 8, !tbaa !22
  %52 = call i64 @XCreateWindow(ptr noundef %40, i64 noundef %48, i32 noundef 0, i32 noundef 0, i32 noundef 1, i32 noundef 1, i32 noundef 0, i32 noundef %50, i32 noundef 1, ptr noundef %51, i64 noundef 8200, ptr noundef nonnull %5) #4
  %53 = getelementptr inbounds i8, ptr %0, i64 24
  store i64 %52, ptr %53, align 8, !tbaa !28
  %54 = load ptr, ptr %0, align 8, !tbaa !9
  %55 = load ptr, ptr %23, align 8, !tbaa !16
  %56 = call i32 @glXMakeCurrent(ptr noundef %54, i64 noundef %52, ptr noundef %55) #4
  %.not30 = icmp eq i32 %56, 0
  %. = zext i1 %.not30 to i8
  br label %57

57:                                               ; preds = %25, %20, %13, %11, %7, %1
  %.0 = phi i8 [ 1, %1 ], [ 1, %7 ], [ 1, %11 ], [ 1, %13 ], [ 1, %20 ], [ %., %25 ]
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #4
  ret i8 %.0
}

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

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

declare ptr @XOpenDisplay(ptr noundef) local_unnamed_addr #3

declare i32 @glXQueryExtension(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

declare ptr @glXCreateContext(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

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

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

declare i32 @glXMakeCurrent(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #3

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"GLContextStruct", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24, !11, i64 32}
!11 = !{!"long", !7, i64 0}
!12 = !{!13, !14, i64 224}
!13 = !{!"", !6, i64 0, !6, i64 8, !14, i64 16, !14, i64 20, !14, i64 24, !14, i64 28, !6, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !14, i64 64, !6, i64 72, !14, i64 80, !14, i64 84, !14, i64 88, !14, i64 92, !14, i64 96, !6, i64 104, !14, i64 112, !14, i64 116, !6, i64 120, !6, i64 128, !14, i64 136, !11, i64 144, !11, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !14, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !14, i64 224, !14, i64 228, !6, i64 232, !11, i64 240, !11, i64 248, !14, i64 256, !14, i64 260, !6, i64 264, !6, i64 272, !14, i64 280, !6, i64 288}
!14 = !{!"int", !7, i64 0}
!15 = !{!10, !6, i64 8}
!16 = !{!10, !6, i64 16}
!17 = !{!13, !6, i64 232}
!18 = !{!19, !14, i64 16}
!19 = !{!"", !6, i64 0, !11, i64 8, !14, i64 16, !14, i64 20, !14, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !14, i64 56, !14, i64 60}
!20 = !{!21, !11, i64 16}
!21 = !{!"", !6, i64 0, !6, i64 8, !11, i64 16, !14, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !14, i64 40, !6, i64 48, !14, i64 56, !6, i64 64, !6, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !14, i64 104, !14, i64 108, !14, i64 112, !14, i64 116, !11, i64 120}
!22 = !{!19, !6, i64 0}
!23 = !{!10, !11, i64 32}
!24 = !{!25, !11, i64 24}
!25 = !{!"", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !14, i64 32, !14, i64 36, !14, i64 40, !11, i64 48, !11, i64 56, !14, i64 64, !11, i64 72, !11, i64 80, !14, i64 88, !11, i64 96, !11, i64 104}
!26 = !{!25, !11, i64 96}
!27 = !{!19, !14, i64 20}
!28 = !{!10, !11, i64 24}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass