#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */
typedef struct TYPE_13__ TYPE_2__;
typedef struct TYPE_12__ TYPE_1__;

/* Type definitions */
struct TYPE_12__ {
  int /*<<< orphan*/ visual;
  int /*<<< orphan*/ depth;
};
typedef TYPE_1__ XVisualInfo;
struct TYPE_13__ {
  int event_mask;
  int /*<<< orphan*/ colormap;
  scalar_t__ border_pixel;
  scalar_t__ background_pixel;
};
typedef TYPE_2__ XSetWindowAttributes;
typedef int /*<<< orphan*/ Window;
typedef TYPE_1__ GLXFBConfig;
typedef int /*<<< orphan*/ *GLXContext;
typedef int /*<<< orphan*/ Display;
typedef scalar_t__ Bool;

/* Variables and functions */
int /*<<< orphan*/ AllocNone;
unsigned long CWBackPixel;
unsigned long CWBorderPixel;
unsigned long CWColormap;
unsigned long CWEventMask;
int /*<<< orphan*/ CheckError(int);
int /*<<< orphan*/ DisplayString(int /*<<< orphan*/ *);
int ExposureMask;
scalar_t__ False;
int /*<<< orphan*/ GLX_EXTENSIONS;
int /*<<< orphan*/ GLX_VENDOR;
int /*<<< orphan*/ GLX_VERSION;
int /*<<< orphan*/ GL_EXTENSIONS;
int /*<<< orphan*/ GL_RENDERER;
int /*<<< orphan*/ GL_VENDOR;
int /*<<< orphan*/ GL_VERSION;
int /*<<< orphan*/ InputOutput;
int /*<<< orphan*/ RootWindow(int /*<<< orphan*/ *, int);
int StructureNotifyMask;
scalar_t__ True;
int /*<<< orphan*/ XCreateColormap(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                   int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ XCreateWindow(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int /*<<< orphan*/, int,
                                 int, int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int /*<<< orphan*/,
                                 unsigned long, TYPE_2__ *);
int /*<<< orphan*/ XDestroyWindow(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ XFree(TYPE_1__ *);
int /*<<< orphan*/ XSync(int /*<<< orphan*/ *, int);
char *build_core_profile_extension_list();
TYPE_1__ *choose_fb_config(int /*<<< orphan*/ *, int);
TYPE_1__ *choose_xvisinfo(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ *create_context_with_config(int /*<<< orphan*/ *, TYPE_1__,
                                               scalar_t__, scalar_t__);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(char *);
scalar_t__ getenv(char *);
scalar_t__ glGetString(int /*<<< orphan*/);
int /*<<< orphan*/ *glXCreateContext(int /*<<< orphan*/ *, TYPE_1__ *,
                                     int /*<<< orphan*/ *, scalar_t__);
int /*<<< orphan*/ glXDestroyContext(int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ *);
char *glXGetClientString(int /*<<< orphan*/ *, int /*<<< orphan*/);
TYPE_1__ *glXGetVisualFromFBConfig(int /*<<< orphan*/ *, TYPE_1__);
scalar_t__ glXIsDirect(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
scalar_t__ glXMakeCurrent(int /*<<< orphan*/ *, int /*<<< orphan*/,
                          int /*<<< orphan*/ *);
char *glXQueryExtensionsString(int /*<<< orphan*/ *, int);
char *glXQueryServerString(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int /*<<< orphan*/ glXQueryVersion(int /*<<< orphan*/ *, int *, int *);
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ print_extension_list(char const *, scalar_t__);
int /*<<< orphan*/ print_limits(char *, char const *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
char *strchr(char *, char);
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
scalar_t__ strlen(int /*<<< orphan*/);
char *strrchr(char *, char);
Bool print_screen_info(Display *dpy, int scrnum, Bool allowDirect,
                       Bool coreProfile, Bool limits, Bool singleLine,
                       Bool coreWorked) {
  Window win;
  XSetWindowAttributes attr;
  unsigned long mask;
  Window root;
  GLXContext ctx = NULL;
  XVisualInfo *visinfo;
  int width = 100, height = 100;
  GLXFBConfig *fbconfigs;
  const char *oglstring = coreProfile ? "OpenGL core profile" : "OpenGL";
  root = RootWindow(dpy, scrnum);
  fbconfigs = choose_fb_config(dpy, scrnum);
  if (fbconfigs) {
    ctx =
        create_context_with_config(dpy, fbconfigs[0], coreProfile, allowDirect);
    if (!ctx && allowDirect && !coreProfile) {
      ctx = create_context_with_config(dpy, fbconfigs[0], coreProfile, False);
    }
    visinfo = glXGetVisualFromFBConfig(dpy, fbconfigs[0]);
    XFree(fbconfigs);
  } else {
    visinfo = choose_xvisinfo(dpy, scrnum);
    if (visinfo)
      ctx = glXCreateContext(dpy, visinfo, NULL, allowDirect);
  }
  if (!visinfo) {
    fprintf(stderr, "Error: couldn't find RGB GLX visual or fbconfig\n");
    return False;
  }
  if (!ctx) {
    if (!coreProfile)
      fprintf(stderr, "Error: glXCreateContext failed\n");
    XFree(visinfo);
    return False;
  }
  attr.background_pixel = 0;
  attr.border_pixel = 0;
  attr.colormap = XCreateColormap(dpy, root, visinfo->visual, AllocNone);
  attr.event_mask = StructureNotifyMask | ExposureMask;
  mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
  win = XCreateWindow(dpy, root, 0, 0, width, height, 0, visinfo->depth,
                      InputOutput, visinfo->visual, mask, &attr);
  if (glXMakeCurrent(dpy, win, ctx)) {
    const char *serverVendor = glXQueryServerString(dpy, scrnum, GLX_VENDOR);
    const char *serverVersion = glXQueryServerString(dpy, scrnum, GLX_VERSION);
    const char *serverExtensions =
        glXQueryServerString(dpy, scrnum, GLX_EXTENSIONS);
    const char *clientVendor = glXGetClientString(dpy, GLX_VENDOR);
    const char *clientVersion = glXGetClientString(dpy, GLX_VERSION);
    const char *clientExtensions = glXGetClientString(dpy, GLX_EXTENSIONS);
    const char *glxExtensions = glXQueryExtensionsString(dpy, scrnum);
    const char *glVendor = (const char *)glGetString(GL_VENDOR);
    const char *glRenderer = (const char *)glGetString(GL_RENDERER);
    const char *glVersion = (const char *)glGetString(GL_VERSION);
    char *glExtensions;
    int glxVersionMajor;
    int glxVersionMinor;
    char *displayName = NULL;
    char *colon = NULL, *period = NULL;
    int version;
    CheckError(913);
    if (coreProfile) {
      glExtensions = build_core_profile_extension_list();
    } else {
      glExtensions = (char *)glGetString(GL_EXTENSIONS);
    }
    CheckError(922);
    if (!glXQueryVersion(dpy, &glxVersionMajor, &glxVersionMinor)) {
      fprintf(stderr, "Error: glXQueryVersion failed\n");
      exit(1);
    }
    if (!coreWorked) {
      if (!(displayName = (char *)malloc(strlen(DisplayString(dpy)) + 1))) {
        fprintf(stderr, "Error: malloc() failed\n");
        exit(1);
      }
      strcpy(displayName, DisplayString(dpy));
      colon = strrchr(displayName, ':');
      if (colon) {
        period = strchr(colon, '.');
        if (period)
          *period = '\0';
      }
      printf("display: %s  screen: %d\n", displayName, scrnum);
      free(displayName);
      printf("direct rendering: ");
      if (glXIsDirect(dpy, ctx)) {
        printf("Yes\n");
      } else {
        if (!allowDirect) {
          printf("No (-i specified)\n");
        } else if (getenv("LIBGL_ALWAYS_INDIRECT")) {
          printf("No (LIBGL_ALWAYS_INDIRECT set)\n");
        } else {
          printf("No (If you want to find out why, try setting "
                 "LIBGL_DEBUG=verbose)\n");
        }
      }
      printf("server glx vendor string: %s\n", serverVendor);
      printf("server glx version string: %s\n", serverVersion);
      printf("server glx extensions:\n");
      print_extension_list(serverExtensions, singleLine);
      printf("client glx vendor string: %s\n", clientVendor);
      printf("client glx version string: %s\n", clientVersion);
      printf("client glx extensions:\n");
      print_extension_list(clientExtensions, singleLine);
      printf("GLX version: %u.%u\n", glxVersionMajor, glxVersionMinor);
      printf("GLX extensions:\n");
      print_extension_list(glxExtensions, singleLine);
      printf("OpenGL vendor string: %s\n", glVendor);
      printf("OpenGL renderer string: %s\n", glRenderer);
    } else
      printf("\n");
    printf("%s version string: %s\n", oglstring, glVersion);
    version = (glVersion[0] - '0') * 10 + (glVersion[2] - '0');
    CheckError(981);
    CheckError(989);
    CheckError(997);
    CheckError(1006);
    printf("%s extensions:\n", oglstring);
    print_extension_list(glExtensions, singleLine);
    CheckError(1011);
    if (limits)
      print_limits(glExtensions, oglstring);
    if (coreProfile)
      free(glExtensions);
  } else {
    fprintf(stderr, "Error: glXMakeCurrent failed\n");
  }
  glXDestroyContext(dpy, ctx);
  XFree(visinfo);
  XDestroyWindow(dpy, win);
  XSync(dpy, 1);
  return True;
}


x86 assembly (clang, -O0):
<print_screen_info>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x150,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x20(%rbp)
mov    %esi,-0x24(%rbp)
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x38(%rbp)
mov    %r8,-0x40(%rbp)
mov    %r9,-0x48(%rbp)
movq   $0x0,-0x80(%rbp)
movl   $0x64,-0x8c(%rbp)
movl   $0x64,-0x90(%rbp)
mov    -0x38(%rbp),%rdx
lea    0xca4(%rip),%rax
lea    0xc89(%rip),%rcx
cmp    $0x0,%rdx
cmovne %rcx,%rax
mov    %rax,-0xa0(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   21c0 <RootWindow@plt>
mov    %eax,-0x74(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   2190 <choose_fb_config@plt>
mov    %rax,-0x98(%rbp)
cmpq   $0x0,-0x98(%rbp)
je     2446 <print_screen_info+0x126>
mov    -0x20(%rbp),%rdi
mov    -0x98(%rbp),%rax
mov    -0x38(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    (%rax),%rsi
call   21f0 <create_context_with_config@plt>
mov    %rax,-0x80(%rbp)
cmpq   $0x0,-0x80(%rbp)
jne    241b <print_screen_info+0xfb>
cmpq   $0x0,-0x30(%rbp)
je     241b <print_screen_info+0xfb>
cmpq   $0x0,-0x38(%rbp)
jne    241b <print_screen_info+0xfb>
mov    -0x20(%rbp),%rdi
mov    -0x98(%rbp),%rax
mov    -0x38(%rbp),%rdx
mov    0x2bc4(%rip),%rcx
mov    (%rcx),%rcx
mov    (%rax),%rsi
call   21f0 <create_context_with_config@plt>
mov    %rax,-0x80(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x98(%rbp),%rax
mov    (%rax),%rsi
call   2240 <glXGetVisualFromFBConfig@plt>
mov    %rax,-0x88(%rbp)
mov    -0x98(%rbp),%rdi
call   2100 <XFree@plt>
jmp    2488 <print_screen_info+0x168>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   2120 <choose_xvisinfo@plt>
mov    %rax,-0x88(%rbp)
cmpq   $0x0,-0x88(%rbp)
je     2483 <print_screen_info+0x163>
mov    -0x20(%rbp),%rdi
mov    -0x88(%rbp),%rsi
mov    -0x30(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%edx
call   2180 <glXCreateContext@plt>
mov    %rax,-0x80(%rbp)
jmp    2488 <print_screen_info+0x168>
cmpq   $0x0,-0x88(%rbp)
jne    24be <print_screen_info+0x19e>
mov    0x2ae3(%rip),%rax
mov    (%rax),%edi
lea    0xb75(%rip),%rsi
call   2150 <fprintf@plt>
mov    0x2b1e(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    2b52 <print_screen_info+0x832>
cmpq   $0x0,-0x80(%rbp)
jne    2508 <print_screen_info+0x1e8>
cmpq   $0x0,-0x38(%rbp)
jne    24e9 <print_screen_info+0x1c9>
mov    0x2aa5(%rip),%rax
mov    (%rax),%edi
lea    0xb68(%rip),%rsi
call   2150 <fprintf@plt>
mov    -0x88(%rbp),%rdi
call   2100 <XFree@plt>
mov    0x2ad4(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    2b52 <print_screen_info+0x832>
movq   $0x0,-0x58(%rbp)
movq   $0x0,-0x60(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x74(%rbp),%esi
mov    -0x88(%rbp),%rax
mov    (%rax),%edx
mov    0x2a81(%rip),%rax
mov    (%rax),%ecx
call   21e0 <XCreateColormap@plt>
mov    %eax,-0x64(%rbp)
mov    0x2a48(%rip),%rax
mov    (%rax),%eax
mov    0x2a17(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x68(%rbp)
mov    0x2a8b(%rip),%rax
mov    (%rax),%rax
mov    0x2a91(%rip),%rcx
or     (%rcx),%rax
mov    0x2a3f(%rip),%rcx
or     (%rcx),%rax
mov    0x29e5(%rip),%rcx
or     (%rcx),%rax
mov    %rax,-0x70(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x74(%rbp),%esi
mov    -0x8c(%rbp),%r8d
mov    -0x90(%rbp),%r9d
mov    -0x88(%rbp),%rax
mov    0x4(%rax),%r14d
mov    0x29c7(%rip),%rax
mov    (%rax),%ebx
mov    -0x88(%rbp),%rax
mov    (%rax),%r11d
mov    -0x70(%rbp),%r10
xor    %ecx,%ecx
lea    -0x68(%rbp),%rax
mov    %ecx,%edx
movl   $0x0,(%rsp)
mov    %r14d,0x8(%rsp)
mov    %ebx,0x10(%rsp)
mov    %r11d,0x18(%rsp)
mov    %r10,0x20(%rsp)
mov    %rax,0x28(%rsp)
call   21a0 <XCreateWindow@plt>
mov    %eax,-0x4c(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x4c(%rbp),%esi
mov    -0x80(%rbp),%rdx
call   2130 <glXMakeCurrent@plt>
cmp    $0x0,%rax
je     2afc <print_screen_info+0x7dc>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    0x29c0(%rip),%rax
mov    (%rax),%edx
call   20a0 <glXQueryServerString@plt>
mov    %rax,-0xa8(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    0x29b4(%rip),%rax
mov    (%rax),%edx
call   20a0 <glXQueryServerString@plt>
mov    %rax,-0xb0(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    0x2930(%rip),%rax
mov    (%rax),%edx
call   20a0 <glXQueryServerString@plt>
mov    %rax,-0xb8(%rbp)
mov    -0x20(%rbp),%rdi
mov    0x296f(%rip),%rax
mov    (%rax),%esi
call   2060 <glXGetClientString@plt>
mov    %rax,-0xc0(%rbp)
mov    -0x20(%rbp),%rdi
mov    0x2966(%rip),%rax
mov    (%rax),%esi
call   2060 <glXGetClientString@plt>
mov    %rax,-0xc8(%rbp)
mov    -0x20(%rbp),%rdi
mov    0x28e5(%rip),%rax
mov    (%rax),%esi
call   2060 <glXGetClientString@plt>
mov    %rax,-0xd0(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   20b0 <glXQueryExtensionsString@plt>
mov    %rax,-0xd8(%rbp)
mov    0x2905(%rip),%rax
mov    (%rax),%edi
call   2170 <glGetString@plt>
mov    %rax,-0xe0(%rbp)
mov    0x28c8(%rip),%rax
mov    (%rax),%edi
call   2170 <glGetString@plt>
mov    %rax,-0xe8(%rbp)
mov    0x28bb(%rip),%rax
mov    (%rax),%edi
call   2170 <glGetString@plt>
mov    %rax,-0xf0(%rbp)
movq   $0x0,-0x108(%rbp)
movq   $0x0,-0x110(%rbp)
movq   $0x0,-0x118(%rbp)
mov    $0x391,%edi
call   2080 <CheckError@plt>
cmpq   $0x0,-0x38(%rbp)
je     2734 <print_screen_info+0x414>
mov    $0x0,%al
call   2220 <build_core_profile_extension_list@plt>
mov    %rax,-0xf8(%rbp)
jmp    2749 <print_screen_info+0x429>
mov    0x283d(%rip),%rax
mov    (%rax),%edi
call   2170 <glGetString@plt>
mov    %rax,-0xf8(%rbp)
mov    $0x39a,%edi
call   2080 <CheckError@plt>
mov    -0x20(%rbp),%rdi
lea    -0xfc(%rbp),%rsi
lea    -0x100(%rbp),%rdx
call   21d0 <glXQueryVersion@plt>
cmp    $0x0,%eax
jne    2792 <print_screen_info+0x472>
mov    0x2806(%rip),%rax
mov    (%rax),%edi
lea    0x8e9(%rip),%rsi
call   2150 <fprintf@plt>
mov    $0x1,%edi
call   2210 <exit@plt>
cmpq   $0x0,0x10(%rbp)
jne    2a1b <print_screen_info+0x6fb>
mov    -0x20(%rbp),%rdi
call   2230 <DisplayString@plt>
mov    %eax,%edi
call   20d0 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   2160 <malloc@plt>
mov    %rax,-0x108(%rbp)
cmp    $0x0,%rax
jne    27e9 <print_screen_info+0x4c9>
mov    0x27af(%rip),%rax
mov    (%rax),%edi
lea    0x8b1(%rip),%rsi
call   2150 <fprintf@plt>
mov    $0x1,%edi
call   2210 <exit@plt>
mov    -0x108(%rbp),%rax
mov    %rax,-0x128(%rbp)
mov    -0x20(%rbp),%rdi
call   2230 <DisplayString@plt>
mov    -0x128(%rbp),%rdi
mov    %eax,%esi
call   2070 <strcpy@plt>
mov    -0x108(%rbp),%rdi
mov    $0x3a,%esi
call   2110 <strrchr@plt>
mov    %rax,-0x110(%rbp)
cmpq   $0x0,-0x110(%rbp)
je     2869 <print_screen_info+0x549>
mov    -0x110(%rbp),%rdi
mov    $0x2e,%esi
call   20e0 <strchr@plt>
mov    %rax,-0x118(%rbp)
cmpq   $0x0,-0x118(%rbp)
je     2864 <print_screen_info+0x544>
mov    -0x118(%rbp),%rax
movb   $0x0,(%rax)
jmp    2869 <print_screen_info+0x549>
mov    -0x108(%rbp),%rsi
mov    -0x24(%rbp),%edx
lea    0x829(%rip),%rdi
mov    $0x0,%al
call   20f0 <printf@plt>
mov    -0x108(%rbp),%rdi
call   2050 <free@plt>
lea    0x828(%rip),%rdi
mov    $0x0,%al
call   20f0 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x80(%rbp),%rsi
call   2090 <glXIsDirect@plt>
cmp    $0x0,%rax
je     28c5 <print_screen_info+0x5a5>
lea    0x816(%rip),%rdi
mov    $0x0,%al
call   20f0 <printf@plt>
jmp    2924 <print_screen_info+0x604>
cmpq   $0x0,-0x30(%rbp)
jne    28e3 <print_screen_info+0x5c3>
lea    0x7fd(%rip),%rdi
mov    $0x0,%al
call   20f0 <printf@plt>
jmp    291f <print_screen_info+0x5ff>
lea    0x7fd(%rip),%rdi
call   2030 <getenv@plt>
cmp    $0x0,%rax
je     290c <print_screen_info+0x5ec>
lea    0x7fd(%rip),%rdi
mov    $0x0,%al
call   20f0 <printf@plt>
jmp    291a <print_screen_info+0x5fa>
lea    0x80a(%rip),%rdi
mov    $0x0,%al
call   20f0 <printf@plt>
jmp    291f <print_screen_info+0x5ff>
jmp    2924 <print_screen_info+0x604>
mov    -0xa8(%rbp),%rsi
lea    0x82e(%rip),%rdi
mov    $0x0,%al
call   20f0 <printf@plt>
mov    -0xb0(%rbp),%rsi
lea    0x837(%rip),%rdi
mov    $0x0,%al
call   20f0 <printf@plt>
lea    0x848(%rip),%rdi
mov    $0x0,%al
call   20f0 <printf@plt>
mov    -0xb8(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   2200 <print_extension_list@plt>
mov    -0xc0(%rbp),%rsi
lea    0x83b(%rip),%rdi
mov    $0x0,%al
call   20f0 <printf@plt>
mov    -0xc8(%rbp),%rsi
lea    0x844(%rip),%rdi
mov    $0x0,%al
call   20f0 <printf@plt>
lea    0x855(%rip),%rdi
mov    $0x0,%al
call   20f0 <printf@plt>
mov    -0xd0(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   2200 <print_extension_list@plt>
mov    -0xfc(%rbp),%esi
mov    -0x100(%rbp),%edx
lea    0x843(%rip),%rdi
mov    $0x0,%al
call   20f0 <printf@plt>
lea    0x849(%rip),%rdi
mov    $0x0,%al
call   20f0 <printf@plt>
mov    -0xd8(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   2200 <print_extension_list@plt>
mov    -0xe0(%rbp),%rsi
lea    0x835(%rip),%rdi
mov    $0x0,%al
call   20f0 <printf@plt>
mov    -0xe8(%rbp),%rsi
lea    0x83a(%rip),%rdi
mov    $0x0,%al
call   20f0 <printf@plt>
jmp    2a29 <print_screen_info+0x709>
lea    0x6c3(%rip),%rdi
mov    $0x0,%al
call   20f0 <printf@plt>
mov    -0xa0(%rbp),%rsi
mov    -0xf0(%rbp),%rdx
lea    0x827(%rip),%rdi
mov    $0x0,%al
call   20f0 <printf@plt>
mov    -0xf0(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
imul   $0xa,%eax,%eax
mov    -0xf0(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0x11c(%rbp)
mov    $0x3d5,%edi
call   2080 <CheckError@plt>
mov    $0x3dd,%edi
call   2080 <CheckError@plt>
mov    $0x3e5,%edi
call   2080 <CheckError@plt>
mov    $0x3ee,%edi
call   2080 <CheckError@plt>
mov    -0xa0(%rbp),%rsi
lea    0x7db(%rip),%rdi
mov    $0x0,%al
call   20f0 <printf@plt>
mov    -0xf8(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   2200 <print_extension_list@plt>
mov    $0x3f3,%edi
call   2080 <CheckError@plt>
cmpq   $0x0,-0x40(%rbp)
je     2ae0 <print_screen_info+0x7c0>
mov    -0xf8(%rbp),%rdi
mov    -0xa0(%rbp),%rsi
call   20c0 <print_limits@plt>
cmpq   $0x0,-0x38(%rbp)
je     2af7 <print_screen_info+0x7d7>
mov    -0xf8(%rbp),%rdi
call   2050 <free@plt>
jmp    2b11 <print_screen_info+0x7f1>
mov    0x247d(%rip),%rax
mov    (%rax),%edi
lea    0x780(%rip),%rsi
call   2150 <fprintf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x80(%rbp),%rsi
call   2040 <glXDestroyContext@plt>
mov    -0x88(%rbp),%rdi
call   2100 <XFree@plt>
mov    -0x20(%rbp),%rdi
mov    -0x4c(%rbp),%esi
call   2140 <XDestroyWindow@plt>
mov    -0x20(%rbp),%rdi
mov    $0x1,%esi
call   21b0 <XSync@plt>
mov    0x2475(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x150,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_screen_info>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
mov    %r9,0x18(%rsp)
mov    %r8,%rbp
mov    %rcx,%r13
mov    %rdx,%rbx
mov    %esi,%r15d
mov    %rdi,%r14
test   %rcx,%rcx
lea    0xc91(%rip),%rax
lea    0xc9e(%rip),%rcx
cmovne %rax,%rcx
mov    %rcx,0x20(%rsp)
call   21e0 <RootWindow@plt>
mov    %eax,0x10(%rsp)
mov    %r14,%rdi
mov    %r15d,%esi
call   21b0 <choose_fb_config@plt>
test   %rax,%rax
mov    %rbp,0x98(%rsp)
mov    %rbx,0x28(%rsp)
je     25ea <print_screen_info+0x2aa>
mov    %rax,%r12
mov    (%rax),%rsi
mov    %r14,%rdi
mov    %r13,%rdx
mov    %rbx,%rcx
call   2210 <create_context_with_config@plt>
test   %r13,%r13
jne    23e4 <print_screen_info+0xa4>
test   %rbx,%rbx
je     23e4 <print_screen_info+0xa4>
test   %rax,%rax
jne    23e4 <print_screen_info+0xa4>
mov    0x2bfd(%rip),%rax
mov    (%rax),%rcx
mov    (%r12),%rsi
mov    %r14,%rdi
xor    %edx,%edx
call   2210 <create_context_with_config@plt>
mov    (%r12),%rsi
mov    %r14,%rdi
mov    %rax,%rbp
call   2260 <glXGetVisualFromFBConfig@plt>
mov    %rax,%rbx
mov    %r12,%rdi
call   2120 <XFree@plt>
mov    %rbp,%rax
test   %rbx,%rbx
je     2646 <print_screen_info+0x306>
test   %rax,%rax
je     2618 <print_screen_info+0x2d8>
mov    %r15d,0x34(%rsp)
mov    %r13,0x8(%rsp)
xorps  %xmm0,%xmm0
movups %xmm0,0xa8(%rsp)
mov    (%rbx),%edx
mov    %rax,%r13
mov    0x2b7c(%rip),%rax
mov    (%rax),%ecx
mov    %r14,%rdi
mov    0x10(%rsp),%r15d
mov    %r15d,%esi
call   2200 <XCreateColormap@plt>
mov    0x2b3b(%rip),%rcx
mov    0x2b0c(%rip),%rdx
mov    (%rdx),%edx
or     (%rcx),%edx
mov    0x2b81(%rip),%rcx
mov    0x2b8a(%rip),%rsi
mov    (%rsi),%rbp
or     (%rcx),%rbp
mov    %eax,0xa4(%rsp)
mov    0x2b2e(%rip),%rax
or     (%rax),%rbp
mov    %edx,0xa0(%rsp)
mov    0x2acd(%rip),%rax
or     (%rax),%rbp
mov    (%rbx),%eax
mov    0x4(%rbx),%r10d
mov    0x2acd(%rip),%rcx
mov    (%rcx),%r12d
lea    0xa0(%rsp),%r11
mov    %r14,%rdi
mov    %r15d,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x64,%r8d
mov    $0x64,%r9d
push   %r11
push   %rbp
push   %rax
push   %r12
push   %r10
push   $0x0
call   21c0 <XCreateWindow@plt>
add    $0x30,%rsp
mov    %eax,%ebp
mov    %r14,%rdi
mov    %eax,%esi
mov    %r13,0x10(%rsp)
mov    %r13,%rdx
call   2150 <glXMakeCurrent@plt>
test   %rax,%rax
je     2667 <print_screen_info+0x327>
mov    %ebp,0x30(%rsp)
mov    %rbx,0x90(%rsp)
mov    0x2ac9(%rip),%r12
mov    (%r12),%edx
mov    %r14,%rdi
mov    0x34(%rsp),%r15d
mov    %r15d,%esi
call   20c0 <glXQueryServerString@plt>
mov    %rax,0x68(%rsp)
mov    0x2ab9(%rip),%rbp
mov    0x0(%rbp),%edx
mov    %r14,%rdi
mov    %r15d,%esi
call   20c0 <glXQueryServerString@plt>
mov    %rax,0x48(%rsp)
mov    0x2a37(%rip),%rbx
mov    (%rbx),%edx
mov    %r14,%rdi
mov    %r15d,%esi
call   20c0 <glXQueryServerString@plt>
mov    %rax,0x60(%rsp)
mov    (%r12),%esi
mov    %r14,%rdi
call   2070 <glXGetClientString@plt>
mov    %rax,0x58(%rsp)
mov    0x0(%rbp),%esi
mov    %r14,%rdi
call   2070 <glXGetClientString@plt>
mov    %rax,0x50(%rsp)
mov    (%rbx),%esi
mov    %r14,%rdi
call   2070 <glXGetClientString@plt>
mov    %rax,0x70(%rsp)
mov    %r14,%rdi
mov    %r15d,%esi
call   20d0 <glXQueryExtensionsString@plt>
mov    %rax,0x88(%rsp)
mov    0x2a23(%rip),%rax
mov    (%rax),%edi
call   2190 <glGetString@plt>
mov    %rax,0x80(%rsp)
mov    0x29e5(%rip),%rax
mov    (%rax),%edi
call   2190 <glGetString@plt>
mov    %rax,0x78(%rsp)
mov    0x29da(%rip),%rax
mov    (%rax),%edi
call   2190 <glGetString@plt>
mov    %rax,%r12
mov    $0x391,%edi
call   20a0 <CheckError@plt>
cmpq   $0x0,0x8(%rsp)
je     2681 <print_screen_info+0x341>
xor    %eax,%eax
call   2240 <build_core_profile_extension_list@plt>
jmp    268f <print_screen_info+0x34f>
mov    %r14,%rdi
mov    %r15d,%esi
call   2140 <choose_xvisinfo@plt>
test   %rax,%rax
je     2646 <print_screen_info+0x306>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
xor    %edx,%edx
mov    0x28(%rsp),%rcx
call   21a0 <glXCreateContext@plt>
test   %rax,%rax
jne    2413 <print_screen_info+0xd3>
test   %r13,%r13
jne    2632 <print_screen_info+0x2f2>
mov    0x295c(%rip),%rax
mov    (%rax),%edi
lea    0xa1f(%rip),%rsi
call   2170 <fprintf@plt>
mov    %rbx,%rdi
call   2120 <XFree@plt>
mov    0x298f(%rip),%rax
jmp    2984 <print_screen_info+0x644>
mov    0x2933(%rip),%rax
mov    (%rax),%edi
lea    0x9c5(%rip),%rsi
call   2170 <fprintf@plt>
mov    0x296e(%rip),%rax
jmp    2984 <print_screen_info+0x644>
mov    0x2912(%rip),%rax
mov    (%rax),%edi
lea    0xb59(%rip),%rsi
call   2170 <fprintf@plt>
jmp    2951 <print_screen_info+0x611>
mov    0x28f0(%rip),%rax
mov    (%rax),%edi
call   2190 <glGetString@plt>
mov    %rax,%r13
mov    0x28(%rsp),%rbx
mov    $0x39a,%edi
call   20a0 <CheckError@plt>
lea    0x3c(%rsp),%rsi
lea    0x38(%rsp),%rdx
mov    %r14,%rdi
call   21f0 <glXQueryVersion@plt>
test   %eax,%eax
je     2999 <print_screen_info+0x659>
cmpq   $0x0,0xf0(%rsp)
je     26e4 <print_screen_info+0x3a4>
mov    $0xa,%edi
call   2060 <putchar@plt>
mov    0x20(%rsp),%rbp
mov    0x18(%rsp),%rbx
mov    0x8(%rsp),%r15
jmp    28c0 <print_screen_info+0x580>
mov    %r13,0x40(%rsp)
mov    %r14,%rdi
call   2250 <DisplayString@plt>
mov    %eax,%edi
call   20f0 <strlen@plt>
lea    0x1(%rax),%rdi
call   2180 <malloc@plt>
test   %rax,%rax
je     29ab <print_screen_info+0x66b>
mov    %rax,%r13
mov    %r14,%rdi
call   2250 <DisplayString@plt>
mov    %r13,%rdi
mov    %eax,%esi
call   2080 <strcpy@plt>
mov    %r13,%rdi
mov    $0x3a,%esi
call   2130 <strrchr@plt>
test   %rax,%rax
je     2746 <print_screen_info+0x406>
mov    %rax,%rdi
mov    $0x2e,%esi
call   2100 <strchr@plt>
test   %rax,%rax
je     2746 <print_screen_info+0x406>
movb   $0x0,(%rax)
lea    0x956(%rip),%rdi
mov    %r13,%rsi
mov    %r15d,%edx
xor    %eax,%eax
call   2110 <printf@plt>
mov    %r13,%rdi
call   2050 <free@plt>
lea    0x953(%rip),%rdi
xor    %eax,%eax
call   2110 <printf@plt>
mov    %r14,%rdi
mov    0x10(%rsp),%rsi
call   20b0 <glXIsDirect@plt>
test   %rax,%rax
je     279f <print_screen_info+0x45f>
lea    0xb16(%rip),%rdi
mov    0x20(%rsp),%rbp
mov    0x18(%rsp),%rbx
mov    0x40(%rsp),%r13
mov    0x8(%rsp),%r15
jmp    27e2 <print_screen_info+0x4a2>
test   %rbx,%rbx
mov    0x20(%rsp),%rbp
mov    0x18(%rsp),%rbx
mov    0x40(%rsp),%r13
mov    0x8(%rsp),%r15
je     27db <print_screen_info+0x49b>
lea    0x910(%rip),%rdi
call   2030 <getenv@plt>
test   %rax,%rax
lea    0xa70(%rip),%rax
lea    0xaab(%rip),%rdi
cmove  %rax,%rdi
jmp    27e2 <print_screen_info+0x4a2>
lea    0xa0c(%rip),%rdi
call   2090 <puts@plt>
lea    0x8f7(%rip),%rdi
mov    0x68(%rsp),%rsi
xor    %eax,%eax
call   2110 <printf@plt>
lea    0x902(%rip),%rdi
mov    0x48(%rsp),%rsi
xor    %eax,%eax
call   2110 <printf@plt>
lea    0x9ec(%rip),%rdi
call   2090 <puts@plt>
mov    0x60(%rsp),%rdi
mov    %rbx,%rsi
call   2220 <print_extension_list@plt>
lea    0x8f5(%rip),%rdi
mov    0x58(%rsp),%rsi
xor    %eax,%eax
call   2110 <printf@plt>
lea    0x900(%rip),%rdi
mov    0x50(%rsp),%rsi
xor    %eax,%eax
call   2110 <printf@plt>
lea    0x9c4(%rip),%rdi
call   2090 <puts@plt>
mov    0x70(%rsp),%rdi
mov    %rbx,%rsi
call   2220 <print_extension_list@plt>
mov    0x3c(%rsp),%esi
mov    0x38(%rsp),%edx
lea    0x8eb(%rip),%rdi
xor    %eax,%eax
call   2110 <printf@plt>
lea    0x9ac(%rip),%rdi
call   2090 <puts@plt>
mov    0x88(%rsp),%rdi
mov    %rbx,%rsi
call   2220 <print_extension_list@plt>
lea    0x8d5(%rip),%rdi
mov    0x80(%rsp),%rsi
xor    %eax,%eax
call   2110 <printf@plt>
lea    0x8d9(%rip),%rdi
mov    0x78(%rsp),%rsi
xor    %eax,%eax
call   2110 <printf@plt>
lea    0x8e2(%rip),%rdi
mov    %rbp,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   2110 <printf@plt>
mov    $0x3d5,%edi
call   20a0 <CheckError@plt>
mov    $0x3dd,%edi
call   20a0 <CheckError@plt>
mov    $0x3e5,%edi
call   20a0 <CheckError@plt>
mov    $0x3ee,%edi
call   20a0 <CheckError@plt>
lea    0x8bd(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   2110 <printf@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
call   2220 <print_extension_list@plt>
mov    $0x3f3,%edi
call   20a0 <CheckError@plt>
cmpq   $0x0,0x98(%rsp)
je     2938 <print_screen_info+0x5f8>
mov    %r13,%rdi
mov    %rbp,%rsi
call   20e0 <print_limits@plt>
test   %r15,%r15
je     2945 <print_screen_info+0x605>
mov    %r13,%rdi
call   2050 <free@plt>
mov    0x90(%rsp),%rbx
mov    0x30(%rsp),%ebp
mov    %r14,%rdi
mov    0x10(%rsp),%rsi
call   2040 <glXDestroyContext@plt>
mov    %rbx,%rdi
call   2120 <XFree@plt>
mov    %r14,%rdi
mov    %ebp,%esi
call   2160 <XDestroyWindow@plt>
mov    %r14,%rdi
mov    $0x1,%esi
call   21d0 <XSync@plt>
mov    0x263c(%rip),%rax
mov    (%rax),%rax
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x25e0(%rip),%rax
mov    (%rax),%edi
lea    0x6c3(%rip),%rsi
jmp    29bb <print_screen_info+0x67b>
mov    0x25ce(%rip),%rax
mov    (%rax),%edi
lea    0x6d0(%rip),%rsi
call   2170 <fprintf@plt>
mov    $0x1,%edi
call   2230 <exit@plt>

LLVM IR (-O0):
%struct.TYPE_13__ = type { i32, i32, i64, i64 }
%struct.TYPE_12__ = type { i32, i32 }
@.str = [20 x i8] c"OpenGL core profile\00"
@.str.1 = [7 x i8] c"OpenGL\00"
@False = global i64 0
@stderr = global i32 0
@.str.2 = [49 x i8] c"Error: couldn't find RGB GLX visual or fbconfig\0A\00"
@.str.3 = [32 x i8] c"Error: glXCreateContext failed\0A\00"
@AllocNone = global i32 0
@StructureNotifyMask = global i32 0
@ExposureMask = global i32 0
@CWBackPixel = global i64 0
@CWBorderPixel = global i64 0
@CWColormap = global i64 0
@CWEventMask = global i64 0
@InputOutput = global i32 0
@GLX_VENDOR = global i32 0
@GLX_VERSION = global i32 0
@GLX_EXTENSIONS = global i32 0
@GL_VENDOR = global i32 0
@GL_RENDERER = global i32 0
@GL_VERSION = global i32 0
@GL_EXTENSIONS = global i32 0
@.str.4 = [31 x i8] c"Error: glXQueryVersion failed\0A\00"
@.str.5 = [24 x i8] c"Error: malloc() failed\0A\00"
@.str.6 = [25 x i8] c"display: %s screen: %d\0A\00"
@.str.7 = [19 x i8] c"direct rendering: \00"
@.str.8 = [5 x i8] c"Yes\0A\00"
@.str.9 = [19 x i8] c"No (-i specified)\0A\00"
@.str.10 = [22 x i8] c"LIBGL_ALWAYS_INDIRECT\00"
@.str.11 = [32 x i8] c"No (LIBGL_ALWAYS_INDIRECT set)\0A\00"
@.str.12 = [67 x i8] c"No (If you want to find out why, try setting LIBGL_DEBUG=verbose)\0A\00"
@.str.13 = [30 x i8] c"server glx vendor string: %s\0A\00"
@.str.14 = [31 x i8] c"server glx version string: %s\0A\00"
@.str.15 = [24 x i8] c"server glx extensions:\0A\00"
@.str.16 = [30 x i8] c"client glx vendor string: %s\0A\00"
@.str.17 = [31 x i8] c"client glx version string: %s\0A\00"
@.str.18 = [24 x i8] c"client glx extensions:\0A\00"
@.str.19 = [20 x i8] c"GLX version: %u.%u\0A\00"
@.str.20 = [17 x i8] c"GLX extensions:\0A\00"
@.str.21 = [26 x i8] c"OpenGL vendor string: %s\0A\00"
@.str.22 = [28 x i8] c"OpenGL renderer string: %s\0A\00"
@.str.23 = [2 x i8] c"\0A\00"
@.str.24 = [23 x i8] c"%s version string: %s\0A\00"
@.str.25 = [16 x i8] c"%s extensions:\0A\00"
@.str.26 = [30 x i8] c"Error: glXMakeCurrent failed\0A\00"
@True = global i64 0
define i64 @print_screen_info(i32* %0, i32 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = alloca i64
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i32
%17 = alloca %struct.TYPE_13__
%18 = alloca i64
%19 = alloca i32
%20 = alloca i32*
%21 = alloca %struct.TYPE_12__*
%22 = alloca i32
%23 = alloca i32
%24 = alloca %struct.TYPE_12__*
%25 = alloca i8*
%26 = alloca i8*
%27 = alloca i8*
%28 = alloca i8*
%29 = alloca i8*
%30 = alloca i8*
%31 = alloca i8*
%32 = alloca i8*
%33 = alloca i8*
%34 = alloca i8*
%35 = alloca i8*
%36 = alloca i8*
%37 = alloca i32
%38 = alloca i32
%39 = alloca i8*
%40 = alloca i8*
%41 = alloca i8*
%42 = alloca i32
store i32* %0, i32** %9
store i32 %1, i32* %10
store i64 %2, i64* %11
store i64 %3, i64* %12
store i64 %4, i64* %13
store i64 %5, i64* %14
store i64 %6, i64* %15
store i32* null, i32** %20
store i32 100, i32* %22
store i32 100, i32* %23
%43 = load i64, i64* %12
%44 = icmp ne i64 %43, 0
%45 = zext i1 %44 to i64
%46 = select i1 %44, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
store i8* %46, i8** %25
%47 = load i32*, i32** %9
%48 = load i32, i32* %10
%49 = call i32 @RootWindow(i32* %47, i32 %48)
store i32 %49, i32* %19
%50 = load i32*, i32** %9
%51 = load i32, i32* %10
%52 = call %struct.TYPE_12__* @choose_fb_config(i32* %50, i32 %51)
store %struct.TYPE_12__* %52, %struct.TYPE_12__** %24
%53 = load %struct.TYPE_12__*, %struct.TYPE_12__** %24
%54 = icmp ne %struct.TYPE_12__* %53, null
br i1 %54, label %55, label %90
55: ; preds = %7
%56 = load i32*, i32** %9
%57 = load %struct.TYPE_12__*, %struct.TYPE_12__** %24
%58 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %57, i64 0
%59 = load i64, i64* %12
%60 = load i64, i64* %11
%61 = bitcast %struct.TYPE_12__* %58 to i64*
%62 = load i64, i64* %61
%63 = call i32* @create_context_with_config(i32* %56, i64 %62, i64 %59, i64 %60)
store i32* %63, i32** %20
%64 = load i32*, i32** %20
%65 = icmp ne i32* %64, null
br i1 %65, label %81, label %66
66: ; preds = %55
%67 = load i64, i64* %11
%68 = icmp ne i64 %67, 0
br i1 %68, label %69, label %81
69: ; preds = %66
%70 = load i64, i64* %12
%71 = icmp ne i64 %70, 0
br i1 %71, label %81, label %72
72: ; preds = %69
%73 = load i32*, i32** %9
%74 = load %struct.TYPE_12__*, %struct.TYPE_12__** %24
%75 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %74, i64 0
%76 = load i64, i64* %12
%77 = load i64, i64* @False
%78 = bitcast %struct.TYPE_12__* %75 to i64*
%79 = load i64, i64* %78
%80 = call i32* @create_context_with_config(i32* %73, i64 %79, i64 %76, i64 %77)
store i32* %80, i32** %20
br label %81
81: ; preds = %72, %69, %66, %55
%82 = load i32*, i32** %9
%83 = load %struct.TYPE_12__*, %struct.TYPE_12__** %24
%84 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %83, i64 0
%85 = bitcast %struct.TYPE_12__* %84 to i64*
%86 = load i64, i64* %85
%87 = call %struct.TYPE_12__* @glXGetVisualFromFBConfig(i32* %82, i64 %86)
store %struct.TYPE_12__* %87, %struct.TYPE_12__** %21
%88 = load %struct.TYPE_12__*, %struct.TYPE_12__** %24
%89 = call i32 @XFree(%struct.TYPE_12__* %88)
br label %102
90: ; preds = %7
%91 = load i32*, i32** %9
%92 = load i32, i32* %10
%93 = call %struct.TYPE_12__* @choose_xvisinfo(i32* %91, i32 %92)
store %struct.TYPE_12__* %93, %struct.TYPE_12__** %21
%94 = load %struct.TYPE_12__*, %struct.TYPE_12__** %21
%95 = icmp ne %struct.TYPE_12__* %94, null
br i1 %95, label %96, label %101
96: ; preds = %90
%97 = load i32*, i32** %9
%98 = load %struct.TYPE_12__*, %struct.TYPE_12__** %21
%99 = load i64, i64* %11
%100 = call i32* @glXCreateContext(i32* %97, %struct.TYPE_12__* %98, i32* null, i64 %99)
store i32* %100, i32** %20
br label %101
101: ; preds = %96, %90
br label %102
102: ; preds = %101, %81
%103 = load %struct.TYPE_12__*, %struct.TYPE_12__** %21
%104 = icmp ne %struct.TYPE_12__* %103, null
br i1 %104, label %109, label %105
105: ; preds = %102
%106 = load i32, i32* @stderr
%107 = call i32 @fprintf(i32 %106, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
%108 = load i64, i64* @False
store i64 %108, i64* %8
br label %357
109: ; preds = %102
%110 = load i32*, i32** %20
%111 = icmp ne i32* %110, null
br i1 %111, label %122, label %112
112: ; preds = %109
%113 = load i64, i64* %12
%114 = icmp ne i64 %113, 0
br i1 %114, label %118, label %115
115: ; preds = %112
%116 = load i32, i32* @stderr
%117 = call i32 @fprintf(i32 %116, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
br label %118
118: ; preds = %115, %112
%119 = load %struct.TYPE_12__*, %struct.TYPE_12__** %21
%120 = call i32 @XFree(%struct.TYPE_12__* %119)
%121 = load i64, i64* @False
store i64 %121, i64* %8
br label %357
122: ; preds = %109
%123 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %17, i32 0, i32 3
store i64 0, i64* %123
%124 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %17, i32 0, i32 2
store i64 0, i64* %124
%125 = load i32*, i32** %9
%126 = load i32, i32* %19
%127 = load %struct.TYPE_12__*, %struct.TYPE_12__** %21
%128 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %127, i32 0, i32 0
%129 = load i32, i32* %128
%130 = load i32, i32* @AllocNone
%131 = call i32 @XCreateColormap(i32* %125, i32 %126, i32 %129, i32 %130)
%132 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %17, i32 0, i32 1
store i32 %131, i32* %132
%133 = load i32, i32* @StructureNotifyMask
%134 = load i32, i32* @ExposureMask
%135 = or i32 %133, %134
%136 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %17, i32 0, i32 0
store i32 %135, i32* %136
%137 = load i64, i64* @CWBackPixel
%138 = load i64, i64* @CWBorderPixel
%139 = or i64 %137, %138
%140 = load i64, i64* @CWColormap
%141 = or i64 %139, %140
%142 = load i64, i64* @CWEventMask
%143 = or i64 %141, %142
store i64 %143, i64* %18
%144 = load i32*, i32** %9
%145 = load i32, i32* %19
%146 = load i32, i32* %22
%147 = load i32, i32* %23
%148 = load %struct.TYPE_12__*, %struct.TYPE_12__** %21
%149 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %148, i32 0, i32 1
%150 = load i32, i32* %149
%151 = load i32, i32* @InputOutput
%152 = load %struct.TYPE_12__*, %struct.TYPE_12__** %21
%153 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %152, i32 0, i32 0
%154 = load i32, i32* %153
%155 = load i64, i64* %18
%156 = call i32 @XCreateWindow(i32* %144, i32 %145, i32 0, i32 0, i32 %146, i32 %147, i32 0, i32 %150, i32 %151, i32 %154, i64 %155, %struct.TYPE_13__* %17)
store i32 %156, i32* %16
%157 = load i32*, i32** %9
%158 = load i32, i32* %16
%159 = load i32*, i32** %20
%160 = call i64 @glXMakeCurrent(i32* %157, i32 %158, i32* %159)
%161 = icmp ne i64 %160, 0
br i1 %161, label %162, label %342
162: ; preds = %122
%163 = load i32*, i32** %9
%164 = load i32, i32* %10
%165 = load i32, i32* @GLX_VENDOR
%166 = call i8* @glXQueryServerString(i32* %163, i32 %164, i32 %165)
store i8* %166, i8** %26
%167 = load i32*, i32** %9
%168 = load i32, i32* %10
%169 = load i32, i32* @GLX_VERSION
%170 = call i8* @glXQueryServerString(i32* %167, i32 %168, i32 %169)
store i8* %170, i8** %27
%171 = load i32*, i32** %9
%172 = load i32, i32* %10
%173 = load i32, i32* @GLX_EXTENSIONS
%174 = call i8* @glXQueryServerString(i32* %171, i32 %172, i32 %173)
store i8* %174, i8** %28
%175 = load i32*, i32** %9
%176 = load i32, i32* @GLX_VENDOR
%177 = call i8* @glXGetClientString(i32* %175, i32 %176)
store i8* %177, i8** %29
%178 = load i32*, i32** %9
%179 = load i32, i32* @GLX_VERSION
%180 = call i8* @glXGetClientString(i32* %178, i32 %179)
store i8* %180, i8** %30
%181 = load i32*, i32** %9
%182 = load i32, i32* @GLX_EXTENSIONS
%183 = call i8* @glXGetClientString(i32* %181, i32 %182)
store i8* %183, i8** %31
%184 = load i32*, i32** %9
%185 = load i32, i32* %10
%186 = call i8* @glXQueryExtensionsString(i32* %184, i32 %185)
store i8* %186, i8** %32
%187 = load i32, i32* @GL_VENDOR
%188 = call i64 @glGetString(i32 %187)
%189 = inttoptr i64 %188 to i8*
store i8* %189, i8** %33
%190 = load i32, i32* @GL_RENDERER
%191 = call i64 @glGetString(i32 %190)
%192 = inttoptr i64 %191 to i8*
store i8* %192, i8** %34
%193 = load i32, i32* @GL_VERSION
%194 = call i64 @glGetString(i32 %193)
%195 = inttoptr i64 %194 to i8*
store i8* %195, i8** %35
store i8* null, i8** %39
store i8* null, i8** %40
store i8* null, i8** %41
%196 = call i32 @CheckError(i32 913)
%197 = load i64, i64* %12
%198 = icmp ne i64 %197, 0
br i1 %198, label %199, label %201
199: ; preds = %162
%200 = call i8* (...) @build_core_profile_extension_list()
store i8* %200, i8** %36
br label %205
201: ; preds = %162
%202 = load i32, i32* @GL_EXTENSIONS
%203 = call i64 @glGetString(i32 %202)
%204 = inttoptr i64 %203 to i8*
store i8* %204, i8** %36
br label %205
205: ; preds = %201, %199
%206 = call i32 @CheckError(i32 922)
%207 = load i32*, i32** %9
%208 = call i32 @glXQueryVersion(i32* %207, i32* %37, i32* %38)
%209 = icmp ne i32 %208, 0
br i1 %209, label %214, label %210
210: ; preds = %205
%211 = load i32, i32* @stderr
%212 = call i32 @fprintf(i32 %211, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
%213 = call i32 @exit(i32 1)
unreachable
214: ; preds = %205
%215 = load i64, i64* %15
%216 = icmp ne i64 %215, 0
br i1 %216, label %301, label %217
217: ; preds = %214
%218 = load i32*, i32** %9
%219 = call i32 @DisplayString(i32* %218)
%220 = call i64 @strlen(i32 %219)
%221 = add nsw i64 %220, 1
%222 = call i64 @malloc(i64 %221)
%223 = inttoptr i64 %222 to i8*
store i8* %223, i8** %39
%224 = icmp ne i8* %223, null
br i1 %224, label %229, label %225
225: ; preds = %217
%226 = load i32, i32* @stderr
%227 = call i32 @fprintf(i32 %226, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
%228 = call i32 @exit(i32 1)
unreachable
229: ; preds = %217
%230 = load i8*, i8** %39
%231 = load i32*, i32** %9
%232 = call i32 @DisplayString(i32* %231)
%233 = call i32 @strcpy(i8* %230, i32 %232)
%234 = load i8*, i8** %39
%235 = call i8* @strrchr(i8* %234, i8 signext 58)
store i8* %235, i8** %40
%236 = load i8*, i8** %40
%237 = icmp ne i8* %236, null
br i1 %237, label %238, label %246
238: ; preds = %229
%239 = load i8*, i8** %40
%240 = call i8* @strchr(i8* %239, i8 signext 46)
store i8* %240, i8** %41
%241 = load i8*, i8** %41
%242 = icmp ne i8* %241, null
br i1 %242, label %243, label %245
243: ; preds = %238
%244 = load i8*, i8** %41
store i8 0, i8* %244
br label %245
245: ; preds = %243, %238
br label %246
246: ; preds = %245, %229
%247 = load i8*, i8** %39
%248 = load i32, i32* %10
%249 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i8* %247, i32 %248)
%250 = load i8*, i8** %39
%251 = call i32 @free(i8* %250)
%252 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
%253 = load i32*, i32** %9
%254 = load i32*, i32** %20
%255 = call i64 @glXIsDirect(i32* %253, i32* %254)
%256 = icmp ne i64 %255, 0
br i1 %256, label %257, label %259
257: ; preds = %246
%258 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
br label %273
259: ; preds = %246
%260 = load i64, i64* %11
%261 = icmp ne i64 %260, 0
br i1 %261, label %264, label %262
262: ; preds = %259
%263 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0))
br label %272
264: ; preds = %259
%265 = call i64 @getenv(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0))
%266 = icmp ne i64 %265, 0
br i1 %266, label %267, label %269
267: ; preds = %264
%268 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.11, i64 0, i64 0))
br label %271
269: ; preds = %264
%270 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.12, i64 0, i64 0))
br label %271
271: ; preds = %269, %267
br label %272
272: ; preds = %271, %262
br label %273
273: ; preds = %272, %257
%274 = load i8*, i8** %26
%275 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.13, i64 0, i64 0), i8* %274)
%276 = load i8*, i8** %27
%277 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.14, i64 0, i64 0), i8* %276)
%278 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.15, i64 0, i64 0))
%279 = load i8*, i8** %28
%280 = load i64, i64* %14
%281 = call i32 @print_extension_list(i8* %279, i64 %280)
%282 = load i8*, i8** %29
%283 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.16, i64 0, i64 0), i8* %282)
%284 = load i8*, i8** %30
%285 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.17, i64 0, i64 0), i8* %284)
%286 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.18, i64 0, i64 0))
%287 = load i8*, i8** %31
%288 = load i64, i64* %14
%289 = call i32 @print_extension_list(i8* %287, i64 %288)
%290 = load i32, i32* %37
%291 = load i32, i32* %38
%292 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.19, i64 0, i64 0), i32 %290, i32 %291)
%293 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.20, i64 0, i64 0))
%294 = load i8*, i8** %32
%295 = load i64, i64* %14
%296 = call i32 @print_extension_list(i8* %294, i64 %295)
%297 = load i8*, i8** %33
%298 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.21, i64 0, i64 0), i8* %297)
%299 = load i8*, i8** %34
%300 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.22, i64 0, i64 0), i8* %299)
br label %303
301: ; preds = %214
%302 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0))
br label %303
303: ; preds = %301, %273
%304 = load i8*, i8** %25
%305 = load i8*, i8** %35
%306 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.24, i64 0, i64 0), i8* %304, i8* %305)
%307 = load i8*, i8** %35
%308 = getelementptr inbounds i8, i8* %307, i64 0
%309 = load i8, i8* %308
%310 = sext i8 %309 to i32
%311 = sub nsw i32 %310, 48
%312 = mul nsw i32 %311, 10
%313 = load i8*, i8** %35
%314 = getelementptr inbounds i8, i8* %313, i64 2
%315 = load i8, i8* %314
%316 = sext i8 %315 to i32
%317 = sub nsw i32 %316, 48
%318 = add nsw i32 %312, %317
store i32 %318, i32* %42
%319 = call i32 @CheckError(i32 981)
%320 = call i32 @CheckError(i32 989)
%321 = call i32 @CheckError(i32 997)
%322 = call i32 @CheckError(i32 1006)
%323 = load i8*, i8** %25
%324 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.25, i64 0, i64 0), i8* %323)
%325 = load i8*, i8** %36
%326 = load i64, i64* %14
%327 = call i32 @print_extension_list(i8* %325, i64 %326)
%328 = call i32 @CheckError(i32 1011)
%329 = load i64, i64* %13
%330 = icmp ne i64 %329, 0
br i1 %330, label %331, label %335
331: ; preds = %303
%332 = load i8*, i8** %36
%333 = load i8*, i8** %25
%334 = call i32 @print_limits(i8* %332, i8* %333)
br label %335
335: ; preds = %331, %303
%336 = load i64, i64* %12
%337 = icmp ne i64 %336, 0
br i1 %337, label %338, label %341
338: ; preds = %335
%339 = load i8*, i8** %36
%340 = call i32 @free(i8* %339)
br label %341
341: ; preds = %338, %335
br label %345
342: ; preds = %122
%343 = load i32, i32* @stderr
%344 = call i32 @fprintf(i32 %343, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.26, i64 0, i64 0))
br label %345
345: ; preds = %342, %341
%346 = load i32*, i32** %9
%347 = load i32*, i32** %20
%348 = call i32 @glXDestroyContext(i32* %346, i32* %347)
%349 = load %struct.TYPE_12__*, %struct.TYPE_12__** %21
%350 = call i32 @XFree(%struct.TYPE_12__* %349)
%351 = load i32*, i32** %9
%352 = load i32, i32* %16
%353 = call i32 @XDestroyWindow(i32* %351, i32 %352)
%354 = load i32*, i32** %9
%355 = call i32 @XSync(i32* %354, i32 1)
%356 = load i64, i64* @True
store i64 %356, i64* %8
br label %357
357: ; preds = %345, %118, %105
%358 = load i64, i64* %8
ret i64 %358
}

LLVM IR (-O2):
%struct.TYPE_13__ = type { i32, i32, i64, i64 }
%struct.TYPE_12__ = type { i32, i32 }
@.str = [20 x i8] c"OpenGL core profile\00"
@.str.1 = [7 x i8] c"OpenGL\00"
@False = global i64 0
@stderr = global i32 0
@.str.2 = [49 x i8] c"Error: couldn't find RGB GLX visual or fbconfig\0A\00"
@.str.3 = [32 x i8] c"Error: glXCreateContext failed\0A\00"
@AllocNone = global i32 0
@StructureNotifyMask = global i32 0
@ExposureMask = global i32 0
@CWBackPixel = global i64 0
@CWBorderPixel = global i64 0
@CWColormap = global i64 0
@CWEventMask = global i64 0
@InputOutput = global i32 0
@GLX_VENDOR = global i32 0
@GLX_VERSION = global i32 0
@GLX_EXTENSIONS = global i32 0
@GL_VENDOR = global i32 0
@GL_RENDERER = global i32 0
@GL_VERSION = global i32 0
@GL_EXTENSIONS = global i32 0
@.str.4 = [31 x i8] c"Error: glXQueryVersion failed\0A\00"
@.str.5 = [24 x i8] c"Error: malloc() failed\0A\00"
@.str.6 = [25 x i8] c"display: %s screen: %d\0A\00"
@.str.7 = [19 x i8] c"direct rendering: \00"
@.str.10 = [22 x i8] c"LIBGL_ALWAYS_INDIRECT\00"
@.str.13 = [30 x i8] c"server glx vendor string: %s\0A\00"
@.str.14 = [31 x i8] c"server glx version string: %s\0A\00"
@.str.16 = [30 x i8] c"client glx vendor string: %s\0A\00"
@.str.17 = [31 x i8] c"client glx version string: %s\0A\00"
@.str.19 = [20 x i8] c"GLX version: %u.%u\0A\00"
@.str.21 = [26 x i8] c"OpenGL vendor string: %s\0A\00"
@.str.22 = [28 x i8] c"OpenGL renderer string: %s\0A\00"
@.str.24 = [23 x i8] c"%s version string: %s\0A\00"
@.str.25 = [16 x i8] c"%s extensions:\0A\00"
@.str.26 = [30 x i8] c"Error: glXMakeCurrent failed\0A\00"
@True = global i64 0
@str = [18 x i8] c"No (-i specified)\00"
@str.27 = [23 x i8] c"server glx extensions:\00"
@str.28 = [23 x i8] c"client glx extensions:\00"
@str.29 = [16 x i8] c"GLX extensions:\00"
@str.30 = [66 x i8] c"No (If you want to find out why, try setting LIBGL_DEBUG=verbose)\00"
@str.31 = [31 x i8] c"No (LIBGL_ALWAYS_INDIRECT set)\00"
@str.32 = [4 x i8] c"Yes\00"
define i64 @print_screen_info(i32* %0, i32 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = alloca %struct.TYPE_13__
%9 = alloca i32
%10 = alloca i32
%11 = bitcast %struct.TYPE_13__* %8 to i8*
%12 = icmp ne i64 %3, 0
%13 = select i1 %12, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%14 = tail call i32 @RootWindow(i32* %0, i32 %1)
%15 = tail call %struct.TYPE_12__* @choose_fb_config(i32* %0, i32 %1)
%16 = icmp eq %struct.TYPE_12__* %15, null
br i1 %16, label %29, label %17
17: ; preds = %7
%18 = bitcast %struct.TYPE_12__* %15 to i64*
%19 = load i64, i64* %18
%20 = tail call i32* @create_context_with_config(i32* %0, i64 %19, i64 %3, i64 %2)
%21 = icmp ne i32* %20, null
%22 = icmp eq i64 %2, 0
%23 = or i1 %22, %21
%24 = or i1 %12, %23
br i1 %24, label %34, label %25
25: ; preds = %17
%26 = load i64, i64* @False
%27 = load i64, i64* %18
%28 = tail call i32* @create_context_with_config(i32* %0, i64 %27, i64 0, i64 %26)
br label %34
29: ; preds = %7
%30 = tail call %struct.TYPE_12__* @choose_xvisinfo(i32* %0, i32 %1)
%31 = icmp eq %struct.TYPE_12__* %30, null
br i1 %31, label %40, label %32
32: ; preds = %29
%33 = tail call i32* @glXCreateContext(i32* %0, %struct.TYPE_12__* %30, i32* null, i64 %2)
br label %43
34: ; preds = %17, %25
%35 = phi i32* [ %20, %17 ], [ %28, %25 ]
%36 = load i64, i64* %18
%37 = tail call %struct.TYPE_12__* @glXGetVisualFromFBConfig(i32* %0, i64 %36)
%38 = tail call i32 @XFree(%struct.TYPE_12__* %15)
%39 = icmp eq %struct.TYPE_12__* %37, null
br i1 %39, label %40, label %43
40: ; preds = %29, %34
%41 = load i32, i32* @stderr
%42 = tail call i32 @fprintf(i32 %41, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
br label %198
43: ; preds = %32, %34
%44 = phi i32* [ %33, %32 ], [ %35, %34 ]
%45 = phi %struct.TYPE_12__* [ %30, %32 ], [ %37, %34 ]
%46 = icmp eq i32* %44, null
br i1 %46, label %47, label %53
47: ; preds = %43
br i1 %12, label %51, label %48
48: ; preds = %47
%49 = load i32, i32* @stderr
%50 = tail call i32 @fprintf(i32 %49, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
br label %51
51: ; preds = %48, %47
%52 = tail call i32 @XFree(%struct.TYPE_12__* %45)
br label %198
53: ; preds = %43
%54 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %8, i64 0, i32 2
%55 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %45, i64 0, i32 0
%56 = bitcast i64* %54 to i8*
%57 = load i32, i32* %55
%58 = load i32, i32* @AllocNone
%59 = tail call i32 @XCreateColormap(i32* %0, i32 %14, i32 %57, i32 %58)
%60 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %8, i64 0, i32 1
store i32 %59, i32* %60
%61 = load i32, i32* @StructureNotifyMask
%62 = load i32, i32* @ExposureMask
%63 = or i32 %62, %61
%64 = getelementptr inbounds %struct.TYPE_13__, %struct.TYPE_13__* %8, i64 0, i32 0
store i32 %63, i32* %64
%65 = load i64, i64* @CWBackPixel
%66 = load i64, i64* @CWBorderPixel
%67 = or i64 %66, %65
%68 = load i64, i64* @CWColormap
%69 = or i64 %67, %68
%70 = load i64, i64* @CWEventMask
%71 = or i64 %69, %70
%72 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %45, i64 0, i32 1
%73 = load i32, i32* %72
%74 = load i32, i32* @InputOutput
%75 = load i32, i32* %55
%76 = call i32 @XCreateWindow(i32* %0, i32 %14, i32 0, i32 0, i32 100, i32 100, i32 0, i32 %73, i32 %74, i32 %75, i64 %71, %struct.TYPE_13__* %8)
%77 = call i64 @glXMakeCurrent(i32* %0, i32 %76, i32* %44)
%78 = icmp eq i64 %77, 0
br i1 %78, label %190, label %79
79: ; preds = %53
%80 = load i32, i32* @GLX_VENDOR
%81 = call i8* @glXQueryServerString(i32* %0, i32 %1, i32 %80)
%82 = load i32, i32* @GLX_VERSION
%83 = call i8* @glXQueryServerString(i32* %0, i32 %1, i32 %82)
%84 = load i32, i32* @GLX_EXTENSIONS
%85 = call i8* @glXQueryServerString(i32* %0, i32 %1, i32 %84)
%86 = load i32, i32* @GLX_VENDOR
%87 = call i8* @glXGetClientString(i32* %0, i32 %86)
%88 = load i32, i32* @GLX_VERSION
%89 = call i8* @glXGetClientString(i32* %0, i32 %88)
%90 = load i32, i32* @GLX_EXTENSIONS
%91 = call i8* @glXGetClientString(i32* %0, i32 %90)
%92 = call i8* @glXQueryExtensionsString(i32* %0, i32 %1)
%93 = load i32, i32* @GL_VENDOR
%94 = call i64 @glGetString(i32 %93)
%95 = inttoptr i64 %94 to i8*
%96 = load i32, i32* @GL_RENDERER
%97 = call i64 @glGetString(i32 %96)
%98 = inttoptr i64 %97 to i8*
%99 = load i32, i32* @GL_VERSION
%100 = call i64 @glGetString(i32 %99)
%101 = inttoptr i64 %100 to i8*
%102 = bitcast i32* %9 to i8*
%103 = bitcast i32* %10 to i8*
%104 = call i32 @CheckError(i32 913)
br i1 %12, label %105, label %107
105: ; preds = %79
%106 = call i8* (...) @build_core_profile_extension_list()
br label %111
107: ; preds = %79
%108 = load i32, i32* @GL_EXTENSIONS
%109 = call i64 @glGetString(i32 %108)
%110 = inttoptr i64 %109 to i8*
br label %111
111: ; preds = %107, %105
%112 = phi i8* [ %106, %105 ], [ %110, %107 ]
%113 = call i32 @CheckError(i32 922)
%114 = call i32 @glXQueryVersion(i32* %0, i32* %9, i32* %10)
%115 = icmp eq i32 %114, 0
br i1 %115, label %116, label %120
116: ; preds = %111
%117 = load i32, i32* @stderr
%118 = call i32 @fprintf(i32 %117, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
%119 = call i32 @exit(i32 1)
unreachable
120: ; preds = %111
%121 = icmp eq i64 %6, 0
br i1 %121, label %122, label %172
122: ; preds = %120
%123 = call i32 @DisplayString(i32* %0)
%124 = call i64 @strlen(i32 %123)
%125 = add nsw i64 %124, 1
%126 = call i64 @malloc(i64 %125)
%127 = inttoptr i64 %126 to i8*
%128 = icmp eq i64 %126, 0
br i1 %128, label %129, label %133
129: ; preds = %122
%130 = load i32, i32* @stderr
%131 = call i32 @fprintf(i32 %130, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
%132 = call i32 @exit(i32 1)
unreachable
133: ; preds = %122
%134 = call i32 @DisplayString(i32* %0)
%135 = call i32 @strcpy(i8* %127, i32 %134)
%136 = call i8* @strrchr(i8* %127, i8 signext 58)
%137 = icmp eq i8* %136, null
br i1 %137, label %142, label %138
138: ; preds = %133
%139 = call i8* @strchr(i8* %136, i8 signext 46)
%140 = icmp eq i8* %139, null
br i1 %140, label %142, label %141
141: ; preds = %138
store i8 0, i8* %139
br label %142
142: ; preds = %138, %141, %133
%143 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i8* %127, i32 %1)
%144 = call i32 @free(i8* %127)
%145 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
%146 = call i64 @glXIsDirect(i32* %0, i32* %44)
%147 = icmp eq i64 %146, 0
br i1 %147, label %148, label %154
148: ; preds = %142
%149 = icmp eq i64 %2, 0
br i1 %149, label %154, label %150
150: ; preds = %148
%151 = call i64 @getenv(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0))
%152 = icmp eq i64 %151, 0
%153 = select i1 %152, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @str.30, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @str.31, i64 0, i64 0)
br label %154
154: ; preds = %150, %148, %142
%155 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @str.32, i64 0, i64 0), %142 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0), %148 ], [ %153, %150 ]
%156 = call i32 @puts(i8* dereferenceable(1) %155)
%157 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.13, i64 0, i64 0), i8* %81)
%158 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.14, i64 0, i64 0), i8* %83)
%159 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.27, i64 0, i64 0))
%160 = call i32 @print_extension_list(i8* %85, i64 %5)
%161 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.16, i64 0, i64 0), i8* %87)
%162 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.17, i64 0, i64 0), i8* %89)
%163 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.28, i64 0, i64 0))
%164 = call i32 @print_extension_list(i8* %91, i64 %5)
%165 = load i32, i32* %9
%166 = load i32, i32* %10
%167 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.19, i64 0, i64 0), i32 %165, i32 %166)
%168 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.29, i64 0, i64 0))
%169 = call i32 @print_extension_list(i8* %92, i64 %5)
%170 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.21, i64 0, i64 0), i8* %95)
%171 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.22, i64 0, i64 0), i8* %98)
br label %174
172: ; preds = %120
%173 = call i32 @putchar(i32 10)
br label %174
174: ; preds = %172, %154
%175 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.24, i64 0, i64 0), i8* %13, i8* %101)
%176 = call i32 @CheckError(i32 981)
%177 = call i32 @CheckError(i32 989)
%178 = call i32 @CheckError(i32 997)
%179 = call i32 @CheckError(i32 1006)
%180 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.25, i64 0, i64 0), i8* %13)
%181 = call i32 @print_extension_list(i8* %112, i64 %5)
%182 = call i32 @CheckError(i32 1011)
%183 = icmp eq i64 %4, 0
br i1 %183, label %186, label %184
184: ; preds = %174
%185 = call i32 @print_limits(i8* %112, i8* %13)
br label %186
186: ; preds = %184, %174
br i1 %12, label %187, label %189
187: ; preds = %186
%188 = call i32 @free(i8* %112)
br label %189
189: ; preds = %187, %186
br label %193
190: ; preds = %53
%191 = load i32, i32* @stderr
%192 = call i32 @fprintf(i32 %191, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.26, i64 0, i64 0))
br label %193
193: ; preds = %190, %189
%194 = call i32 @glXDestroyContext(i32* %0, i32* %44)
%195 = call i32 @XFree(%struct.TYPE_12__* %45)
%196 = call i32 @XDestroyWindow(i32* %0, i32 %76)
%197 = call i32 @XSync(i32* %0, i32 1)
br label %198
198: ; preds = %193, %51, %40
%199 = phi i64* [ @True, %193 ], [ @False, %51 ], [ @False, %40 ]
%200 = load i64, i64* %199
ret i64 %200
}