; LLVM IR from erincatto/box2d-lite :: extern/glfw/src (context)

; 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.1, ptr, ptr, ptr, ptr, i32, [16 x %struct._GLFWjoystick], ptr, i32, %struct._GLFWtls, %struct._GLFWtls, %struct._GLFWmutex, %struct.anon.5, %struct.anon.6, %struct.anon.7, %struct._GLFWlibraryX11, %struct._GLFWlibraryGLX, %struct._GLFWlibraryLinux, %struct._GLFWlibraryEGL, %struct._GLFWlibraryOSMesa }
%struct.anon.1 = type { %struct._GLFWinitconfig, %struct._GLFWfbconfig, %struct._GLFWwndconfig, %struct._GLFWctxconfig, i32 }
%struct._GLFWinitconfig = type { i32, %struct.anon.2 }
%struct.anon.2 = 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.3, %struct.anon.4 }
%struct.anon.3 = type { i32, [256 x i8] }
%struct.anon.4 = type { [256 x i8], [256 x i8] }
%struct._GLFWctxconfig = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, %struct.anon }
%struct.anon = 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.5 = type { i64, %struct._GLFWtimerPOSIX }
%struct._GLFWtimerPOSIX = type { i32, i64 }
%struct.anon.6 = type { i32, ptr, [2 x ptr], ptr, ptr, i32, i32, i32 }
%struct.anon.7 = 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.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.17 }
%struct.anon.8 = 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.9 = type { i32, i32, i32, i32, i32, i32, i32 }
%struct.anon.10 = type { i32, i32, i32, i32, i32 }
%struct.anon.11 = type { i32, i64, i64 }
%struct.anon.12 = type { ptr, ptr, ptr, ptr }
%struct.anon.13 = type { i32, ptr, i32, i32, ptr, ptr, ptr }
%struct.anon.14 = type { ptr, ptr }
%struct.anon.15 = type { i32, ptr, i32, i32, ptr, ptr, ptr, ptr }
%struct.anon.16 = type { i32, ptr, i32, i32, i32, i32, i32, ptr, ptr }
%struct.anon.17 = 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._GLFWwindow = type { ptr, i32, i32, i32, i32, i32, i32, ptr, %struct.GLFWvidmode, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [8 x i8], [349 x i8], double, double, %struct._GLFWcontext, %struct.anon.0, %struct._GLFWwindowX11 }
%struct.GLFWvidmode = type { i32, i32, i32, i32, i32, i32 }
%struct._GLFWcontext = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct._GLFWcontextGLX, %struct._GLFWcontextEGL, %struct._GLFWcontextOSMesa }
%struct._GLFWcontextGLX = type { ptr, i64 }
%struct._GLFWcontextEGL = type { ptr, ptr, ptr, ptr }
%struct._GLFWcontextOSMesa = type { ptr, i32, i32, ptr }
%struct.anon.0 = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._GLFWwindowX11 = type { i64, i64, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64 }

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

declare void @_glfwInputError(i32 noundef, ptr noundef, ...) #0

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

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

declare ptr @_glfwPlatformGetTls(ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local void @glfwMakeContextCurrent(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  %6 = load ptr, ptr %2, align 8, !tbaa !5
  store ptr %6, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  %7 = call ptr @_glfwPlatformGetTls(ptr noundef getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 11))
  store ptr %7, ptr %4, align 8, !tbaa !5
  %8 = load i32, ptr @_glfw, align 8, !tbaa !9
  %9 = icmp ne i32 %8, 0
  br i1 %9, label %11, label %10

10:                                               ; preds = %1
  call void (i32, ptr, ...) @_glfwInputError(i32 noundef 65537, ptr noundef null)
  store i32 1, ptr %5, align 4
  br label %53

11:                                               ; preds = %1
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = icmp ne ptr %12, null
  br i1 %13, label %14, label %21

14:                                               ; preds = %11
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct._GLFWwindow, ptr %15, i32 0, i32 25
  %17 = getelementptr inbounds %struct._GLFWcontext, ptr %16, i32 0, i32 0
  %18 = load i32, ptr %17, align 8, !tbaa !47
  %19 = icmp eq i32 %18, 0
  br i1 %19, label %20, label %21

20:                                               ; preds = %14
  call void (i32, ptr, ...) @_glfwInputError(i32 noundef 65546, ptr noundef @.str.29)
  store i32 1, ptr %5, align 4
  br label %53

21:                                               ; preds = %14, %11
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = icmp ne ptr %22, null
  br i1 %23, label %24, label %43

24:                                               ; preds = %21
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = icmp ne ptr %25, null
  br i1 %26, label %27, label %37

27:                                               ; preds = %24
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct._GLFWwindow, ptr %28, i32 0, i32 25
  %30 = getelementptr inbounds %struct._GLFWcontext, ptr %29, i32 0, i32 1
  %31 = load i32, ptr %30, align 4, !tbaa !56
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._GLFWwindow, ptr %32, i32 0, i32 25
  %34 = getelementptr inbounds %struct._GLFWcontext, ptr %33, i32 0, i32 1
  %35 = load i32, ptr %34, align 4, !tbaa !56
  %36 = icmp ne i32 %31, %35
  br i1 %36, label %37, label %42

37:                                               ; preds = %27, %24
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct._GLFWwindow, ptr %38, i32 0, i32 25
  %40 = getelementptr inbounds %struct._GLFWcontext, ptr %39, i32 0, i32 14
  %41 = load ptr, ptr %40, align 8, !tbaa !57
  call void %41(ptr noundef null)
  br label %42

42:                                               ; preds = %37, %27
  br label %43

43:                                               ; preds = %42, %21
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  %45 = icmp ne ptr %44, null
  br i1 %45, label %46, label %52

46:                                               ; preds = %43
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct._GLFWwindow, ptr %47, i32 0, i32 25
  %49 = getelementptr inbounds %struct._GLFWcontext, ptr %48, i32 0, i32 14
  %50 = load ptr, ptr %49, align 8, !tbaa !57
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  call void %50(ptr noundef %51)
  br label %52

52:                                               ; preds = %46, %43
  store i32 0, ptr %5, align 4
  br label %53

53:                                               ; preds = %52, %20, %10
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  %54 = load i32, ptr %5, align 4
  switch i32 %54, label %56 [
    i32 0, label %55
    i32 1, label %55
  ]

55:                                               ; preds = %53, %53
  ret void

56:                                               ; preds = %53
  unreachable
}

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

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

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


; 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.1, ptr, ptr, ptr, ptr, i32, [16 x %struct._GLFWjoystick], ptr, i32, %struct._GLFWtls, %struct._GLFWtls, %struct._GLFWmutex, %struct.anon.5, %struct.anon.6, %struct.anon.7, %struct._GLFWlibraryX11, %struct._GLFWlibraryGLX, %struct._GLFWlibraryLinux, %struct._GLFWlibraryEGL, %struct._GLFWlibraryOSMesa }
%struct.anon.1 = type { %struct._GLFWinitconfig, %struct._GLFWfbconfig, %struct._GLFWwndconfig, %struct._GLFWctxconfig, i32 }
%struct._GLFWinitconfig = type { i32, %struct.anon.2 }
%struct.anon.2 = 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.3, %struct.anon.4 }
%struct.anon.3 = type { i32, [256 x i8] }
%struct.anon.4 = type { [256 x i8], [256 x i8] }
%struct._GLFWctxconfig = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, %struct.anon }
%struct.anon = 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.5 = type { i64, %struct._GLFWtimerPOSIX }
%struct._GLFWtimerPOSIX = type { i32, i64 }
%struct.anon.6 = type { i32, ptr, [2 x ptr], ptr, ptr, i32, i32, i32 }
%struct.anon.7 = 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.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.17 }
%struct.anon.8 = 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.9 = type { i32, i32, i32, i32, i32, i32, i32 }
%struct.anon.10 = type { i32, i32, i32, i32, i32 }
%struct.anon.11 = type { i32, i64, i64 }
%struct.anon.12 = type { ptr, ptr, ptr, ptr }
%struct.anon.13 = type { i32, ptr, i32, i32, ptr, ptr, ptr }
%struct.anon.14 = type { ptr, ptr }
%struct.anon.15 = type { i32, ptr, i32, i32, ptr, ptr, ptr, ptr }
%struct.anon.16 = type { i32, ptr, i32, i32, i32, i32, i32, ptr, ptr }
%struct.anon.17 = 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 }

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

declare void @_glfwInputError(i32 noundef, ptr noundef, ...) local_unnamed_addr #0

declare ptr @_glfwPlatformGetTls(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @glfwMakeContextCurrent(ptr noundef %0) local_unnamed_addr #1 {
  %2 = tail call ptr @_glfwPlatformGetTls(ptr noundef nonnull getelementptr inbounds (i8, ptr @_glfw, i64 130588)) #2
  %3 = load i32, ptr @_glfw, align 8, !tbaa !5
  %.not = icmp eq i32 %3, 0
  br i1 %.not, label %4, label %5

4:                                                ; preds = %1
  tail call void (i32, ptr, ...) @_glfwInputError(i32 noundef 65537, ptr noundef null) #2
  br label %.thread18

5:                                                ; preds = %1
  %.not12 = icmp eq ptr %0, null
  br i1 %.not12, label %11, label %6

6:                                                ; preds = %5
  %7 = getelementptr inbounds i8, ptr %0, i64 496
  %8 = load i32, ptr %7, align 8, !tbaa !46
  %9 = icmp eq i32 %8, 0
  br i1 %9, label %10, label %.thread

10:                                               ; preds = %6
  tail call void (i32, ptr, ...) @_glfwInputError(i32 noundef 65546, ptr noundef nonnull @.str.29) #2
  br label %.thread18

11:                                               ; preds = %5
  %.not13 = icmp eq ptr %2, null
  br i1 %.not13, label %.thread18, label %.thread19

.thread19:                                        ; preds = %11
  %12 = getelementptr inbounds i8, ptr %2, i64 568
  %13 = load ptr, ptr %12, align 8, !tbaa !55
  tail call void %13(ptr noundef null) #2
  br label %.thread18

.thread:                                          ; preds = %6
  %.not1315 = icmp eq ptr %2, null
  br i1 %.not1315, label %.thread17, label %14

14:                                               ; preds = %.thread
  %15 = getelementptr inbounds i8, ptr %0, i64 500
  %16 = load i32, ptr %15, align 4, !tbaa !56
  %17 = getelementptr inbounds i8, ptr %2, i64 500
  %18 = load i32, ptr %17, align 4, !tbaa !56
  %.not14 = icmp eq i32 %16, %18
  br i1 %.not14, label %.thread17, label %19

19:                                               ; preds = %14
  %20 = getelementptr inbounds i8, ptr %2, i64 568
  %21 = load ptr, ptr %20, align 8, !tbaa !55
  tail call void %21(ptr noundef null) #2
  br label %.thread17

.thread17:                                        ; preds = %19, %14, %.thread
  %22 = getelementptr inbounds i8, ptr %0, i64 568
  %23 = load ptr, ptr %22, align 8, !tbaa !55
  tail call void %23(ptr noundef nonnull %0) #2
  br label %.thread18

.thread18:                                        ; preds = %11, %.thread19, %.thread17, %10, %4
  ret void
}

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!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 = !{!47, !7, i64 496}
!47 = !{!"_GLFWwindow", !16, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !16, i64 32, !48, i64 40, !16, i64 64, !16, i64 72, !7, i64 80, !7, i64 84, !7, i64 88, !7, i64 92, !7, i64 96, !7, i64 100, !7, i64 104, !7, i64 108, !7, i64 112, !7, i64 116, !8, i64 120, !8, i64 128, !31, i64 480, !31, i64 488, !49, i64 496, !53, i64 688, !54, i64 824}
!48 = !{!"GLFWvidmode", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!49 = !{!"_GLFWcontext", !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, !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, !50, i64 120, !51, i64 136, !52, i64 168}
!50 = !{!"_GLFWcontextGLX", !16, i64 0, !14, i64 8}
!51 = !{!"_GLFWcontextEGL", !16, i64 0, !16, i64 8, !16, i64 16, !16, i64 24}
!52 = !{!"_GLFWcontextOSMesa", !16, i64 0, !7, i64 8, !7, i64 12, !16, i64 16}
!53 = !{!"", !16, i64 0, !16, i64 8, !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}
!54 = !{!"_GLFWwindowX11", !14, i64 0, !14, i64 8, !16, i64 16, !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, !7, i64 64, !7, i64 68, !14, i64 72}
!55 = !{!47, !16, i64 568}
!56 = !{!47, !7, i64 500}


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