#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 */

/* Type definitions */
typedef int /*<<< orphan*/ GLXPbuffer;
typedef int /*<<< orphan*/ GLXFBConfig;
typedef int /*<<< orphan*/ GLXContext;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int GLX_CONFIG_CAVEAT;
int GLX_DOUBLEBUFFER;
int GLX_DRAWABLE_TYPE;
int GLX_NONE;
int GLX_PBUFFER_BIT;
int GLX_PBUFFER_HEIGHT;
int GLX_PBUFFER_WIDTH;
int GLX_RENDER_TYPE;
int GLX_RGBA_BIT;
int /*<<< orphan*/ GLX_RGBA_TYPE;
int /*<<< orphan*/ GLX_VENDOR;
int /*<<< orphan*/ GL_RENDERER;
int /*<<< orphan*/ GL_VENDOR;
int /*<<< orphan*/ GL_VERSION;
int True;
int /*<<< orphan*/ *XOpenDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
scalar_t__ glGetString(int /*<<< orphan*/);
int /*<<< orphan*/ *glXChooseFBConfig(int /*<<< orphan*/ *, int, int *, int *);
int /*<<< orphan*/ glXCreateNewContext(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                       int /*<<< orphan*/, int /*<<< orphan*/,
                                       int);
int /*<<< orphan*/ glXCreatePbuffer(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                    int *);
char *glXGetClientString(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ glXIsDirect(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ glXMakeCurrent(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                  int /*<<< orphan*/);
char *glXQueryServerString(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *, ...);
scalar_t__ strstr(char const *, char *);
int main(int argc, char *argv[]) {
  const char *msg1 = "X display";
  Display *dpy = XOpenDisplay(NULL);
  if (!dpy)
    ({
      printf("fatal: %s:\t"
             "failed to open connection"
             "\n",
             msg1);
      exit(1);
    });
  int screen = 0;
  msg1 = "GLX server";
  const char *glx_srv_vnd = glXQueryServerString(dpy, screen, GLX_VENDOR);
  if (!glx_srv_vnd)
    ({
      printf("fatal: %s:\t"
             "lookup failed"
             "\n",
             msg1);
      exit(1);
    });
  printf("info:  %s:\t"
         "%s"
         "\n",
         msg1, glx_srv_vnd);
  msg1 = "GLX client";
  const char *glx_lib_vnd = glXGetClientString(dpy, GLX_VENDOR);
  printf("info:  %s:\t"
         "%s"
         "\n",
         msg1, glx_lib_vnd);
  msg1 = "GLX DB RGBA FBConfig";
  int nconfigs, fbattrs[] = {GLX_CONFIG_CAVEAT,
                             GLX_NONE,
                             GLX_DOUBLEBUFFER,
                             True,
                             GLX_RENDER_TYPE,
                             GLX_RGBA_BIT,
                             GLX_DRAWABLE_TYPE,
                             GLX_PBUFFER_BIT,
                             0};
  GLXFBConfig *fbconfigs = glXChooseFBConfig(dpy, screen, fbattrs, &nconfigs);
  if (!fbconfigs)
    ({
      printf("fatal: %s:\t"
             "none reported"
             "\n",
             msg1);
      exit(1);
    });
  msg1 = "GLX Pbuffer";
  int pbattrs[] = {GLX_PBUFFER_WIDTH, 32, GLX_PBUFFER_HEIGHT, 32, 0};
  GLXPbuffer pbuf = glXCreatePbuffer(dpy, fbconfigs[0], pbattrs);
  msg1 = "GLX Context";
  GLXContext ctx =
      glXCreateNewContext(dpy, fbconfigs[0], GLX_RGBA_TYPE, 0, True);
  if (!ctx)
    ({
      printf("fatal: %s:\t"
             "failed"
             "\n",
             msg1);
      exit(1);
    });
  if (!glXIsDirect(dpy, ctx))
    printf("info:  %s:\t"
           "direct rendering not available"
           "\n",
           msg1);
  if (!glXMakeCurrent(dpy, pbuf, ctx))
    ({
      printf("fatal: %s:\t"
             "glXMakeCurrent failed"
             "\n",
             msg1);
      exit(1);
    });
  msg1 = "GL vendor";
  const char *gl_vnd = (const char *)glGetString(GL_VENDOR);
  printf("info:  %s:\t"
         "%s"
         "\n",
         msg1, gl_vnd);
  msg1 = "GL renderer";
  const char *gl_rnd = (const char *)glGetString(GL_RENDERER);
  printf("info:  %s:\t"
         "%s"
         "\n",
         msg1, gl_rnd);
  msg1 = "GL version";
  const char *gl_ver = (const char *)glGetString(GL_VERSION);
  printf("info:  %s:\t"
         "%s"
         "\n",
         msg1, gl_ver);
  msg1 = "GL hw accelerated";
  if (strstr(gl_rnd, "llvmpipe") || strstr(gl_rnd, "Software"))
    printf("info:  %s:\t"
           "no"
           "\n",
           msg1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe20(%rip),%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1080 <XOpenDisplay@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1218 <main+0x58>
mov    -0x18(%rbp),%rsi
lea    0xe03(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
movl   $0x0,-0x28(%rbp)
lea    0xe0a(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%esi
mov    0x2d90(%rip),%rax
mov    (%rax),%edx
call   1050 <glXQueryServerString@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    126a <main+0xaa>
mov    -0x18(%rbp),%rsi
lea    0xde2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x18(%rbp),%rsi
mov    -0x30(%rbp),%rdx
lea    0xddc(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xddd(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
mov    0x2d32(%rip),%rax
mov    (%rax),%esi
call   1030 <glXGetClientString@plt>
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x40(%rbp),%rdx
lea    0xda5(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xdb1(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2ca7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x70(%rbp)
mov    0x2ca3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x6c(%rbp)
mov    0x2c9f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x68(%rbp)
mov    0x2cd3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x64(%rbp)
mov    0x2cd7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x60(%rbp)
mov    0x2cdb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x5c(%rbp)
mov    0x2cd7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x58(%rbp)
mov    0x2c8b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
movl   $0x0,-0x50(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%esi
lea    -0x70(%rbp),%rdx
lea    -0x44(%rbp),%rcx
call   10b0 <glXChooseFBConfig@plt>
mov    %rax,-0x78(%rbp)
cmpq   $0x0,-0x78(%rbp)
jne    1368 <main+0x1a8>
mov    -0x18(%rbp),%rsi
lea    0xd2d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
lea    0xd2f(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2c36(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x90(%rbp)
movl   $0x20,-0x8c(%rbp)
mov    0x2bf5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x88(%rbp)
movl   $0x20,-0x84(%rbp)
movl   $0x0,-0x80(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x78(%rbp),%rax
mov    (%rax),%esi
lea    -0x90(%rbp),%rdx
call   10c0 <glXCreatePbuffer@plt>
mov    %eax,-0x94(%rbp)
lea    0xcdb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x78(%rbp),%rax
mov    (%rax),%esi
mov    0x2bf4(%rip),%rax
mov    (%rax),%edx
mov    0x2bd3(%rip),%rax
mov    (%rax),%r8d
xor    %ecx,%ecx
call   1090 <glXCreateNewContext@plt>
mov    %eax,-0x98(%rbp)
cmpl   $0x0,-0x98(%rbp)
jne    1426 <main+0x266>
mov    -0x18(%rbp),%rsi
lea    0xca1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x20(%rbp),%rdi
mov    -0x98(%rbp),%esi
call   1040 <glXIsDirect@plt>
cmp    $0x0,%eax
jne    1450 <main+0x290>
mov    -0x18(%rbp),%rsi
lea    0xc80(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x94(%rbp),%esi
mov    -0x98(%rbp),%edx
call   1070 <glXMakeCurrent@plt>
cmp    $0x0,%eax
jne    148a <main+0x2ca>
mov    -0x18(%rbp),%rsi
lea    0xc7b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
lea    0xc85(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2b1c(%rip),%rax
mov    (%rax),%edi
call   10a0 <glGetString@plt>
mov    %rax,-0xa8(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0xa8(%rbp),%rdx
lea    0xb99(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xc56(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2abb(%rip),%rax
mov    (%rax),%edi
call   10a0 <glGetString@plt>
mov    %rax,-0xb0(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0xb0(%rbp),%rdx
lea    0xb60(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xc29(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2a8a(%rip),%rax
mov    (%rax),%edi
call   10a0 <glGetString@plt>
mov    %rax,-0xb8(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0xb8(%rbp),%rdx
lea    0xb27(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xbfb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0xb0(%rbp),%rdi
lea    0xbfb(%rip),%rsi
call   10e0 <strstr@plt>
cmp    $0x0,%rax
jne    157a <main+0x3ba>
mov    -0xb0(%rbp),%rdi
lea    0xbe7(%rip),%rsi
call   10e0 <strstr@plt>
cmp    $0x0,%rax
je     158c <main+0x3cc>
mov    -0x18(%rbp),%rsi
lea    0xbd6(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x48,%rsp
xor    %edi,%edi
call   1080 <XOpenDisplay@plt>
test   %rax,%rax
je     1415 <main+0x255>
mov    %rax,%rbx
mov    0x2de4(%rip),%r14
mov    (%r14),%edx
mov    %rax,%rdi
xor    %esi,%esi
call   1050 <glXQueryServerString@plt>
test   %rax,%rax
je     1425 <main+0x265>
lea    0xe54(%rip),%rbp
lea    0xe28(%rip),%rsi
mov    %rbp,%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%r14),%esi
mov    %rbx,%rdi
call   1030 <glXGetClientString@plt>
lea    0xe3d(%rip),%rsi
mov    %rbp,%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2d35(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
mov    0x2d31(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rsp)
mov    0x2d2c(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x8(%rsp)
mov    0x2d5f(%rip),%r15
mov    (%r15),%eax
mov    %eax,0xc(%rsp)
mov    0x2d61(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x10(%rsp)
mov    0x2d64(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x14(%rsp)
mov    0x2d5f(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x18(%rsp)
mov    0x2d12(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x1c(%rsp)
movl   $0x0,0x20(%rsp)
mov    %rsp,%rdx
lea    0x44(%rsp),%rcx
mov    %rbx,%rdi
xor    %esi,%esi
call   10b0 <glXChooseFBConfig@plt>
test   %rax,%rax
je     1435 <main+0x275>
mov    %rax,%rbp
mov    0x2ce7(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x30(%rsp)
movl   $0x20,0x34(%rsp)
mov    0x2caa(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x38(%rsp)
movq   $0x20,0x3c(%rsp)
mov    0x0(%rbp),%esi
lea    0x30(%rsp),%rdx
mov    %rbx,%rdi
call   10c0 <glXCreatePbuffer@plt>
mov    %eax,%r14d
mov    0x0(%rbp),%esi
mov    0x2cce(%rip),%rax
mov    (%rax),%edx
mov    (%r15),%r8d
mov    %rbx,%rdi
xor    %ecx,%ecx
call   1090 <glXCreateNewContext@plt>
test   %eax,%eax
je     1445 <main+0x285>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <glXIsDirect@plt>
test   %eax,%eax
jne    1346 <main+0x186>
lea    0xd85(%rip),%rdi
lea    0xd5f(%rip),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %ebp,%edx
call   1070 <glXMakeCurrent@plt>
test   %eax,%eax
je     144e <main+0x28e>
mov    0x2c56(%rip),%rax
mov    (%rax),%edi
call   10a0 <glGetString@plt>
lea    0xce5(%rip),%rbp
lea    0xd93(%rip),%rsi
mov    %rbp,%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2c05(%rip),%rax
mov    (%rax),%edi
call   10a0 <glGetString@plt>
mov    %rax,%rbx
lea    0xd78(%rip),%rsi
mov    %rbp,%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2be8(%rip),%rax
mov    (%rax),%edi
call   10a0 <glGetString@plt>
lea    0xd62(%rip),%rsi
mov    %rbp,%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd6b(%rip),%rsi
mov    %rbx,%rdi
call   10e0 <strstr@plt>
test   %rax,%rax
jne    13f3 <main+0x233>
lea    0xd60(%rip),%rsi
mov    %rbx,%rdi
call   10e0 <strstr@plt>
test   %rax,%rax
je     1408 <main+0x248>
lea    0xd55(%rip),%rdi
lea    0xd2a(%rip),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xbee(%rip),%rdi
lea    0xbdd(%rip),%rsi
jmp    145c <main+0x29c>
lea    0xc0f(%rip),%rdi
lea    0xbfd(%rip),%rsi
jmp    145c <main+0x29c>
lea    0xc48(%rip),%rdi
lea    0xc2c(%rip),%rsi
jmp    145c <main+0x29c>
lea    0xc5e(%rip),%rdi
jmp    1455 <main+0x295>
lea    0xc93(%rip),%rdi
lea    0xc42(%rip),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"X display\00"
@.str.1 = [38 x i8] c"fatal: %s:\09failed to open connection\0A\00"
@.str.2 = [11 x i8] c"GLX server\00"
@GLX_VENDOR = global i32 0
@.str.3 = [26 x i8] c"fatal: %s:\09lookup failed\0A\00"
@.str.4 = [15 x i8] c"info: %s:\09%s\0A\00"
@.str.5 = [11 x i8] c"GLX client\00"
@.str.6 = [21 x i8] c"GLX DB RGBA FBConfig\00"
@GLX_CONFIG_CAVEAT = global i32 0
@GLX_NONE = global i32 0
@GLX_DOUBLEBUFFER = global i32 0
@True = global i32 0
@GLX_RENDER_TYPE = global i32 0
@GLX_RGBA_BIT = global i32 0
@GLX_DRAWABLE_TYPE = global i32 0
@GLX_PBUFFER_BIT = global i32 0
@.str.7 = [26 x i8] c"fatal: %s:\09none reported\0A\00"
@.str.8 = [12 x i8] c"GLX Pbuffer\00"
@GLX_PBUFFER_WIDTH = global i32 0
@GLX_PBUFFER_HEIGHT = global i32 0
@.str.9 = [12 x i8] c"GLX Context\00"
@GLX_RGBA_TYPE = global i32 0
@.str.10 = [19 x i8] c"fatal: %s:\09failed\0A\00"
@.str.11 = [43 x i8] c"info: %s:\09direct rendering not available\0A\00"
@.str.12 = [34 x i8] c"fatal: %s:\09glXMakeCurrent failed\0A\00"
@.str.13 = [10 x i8] c"GL vendor\00"
@GL_VENDOR = global i32 0
@.str.14 = [12 x i8] c"GL renderer\00"
@GL_RENDERER = global i32 0
@.str.15 = [11 x i8] c"GL version\00"
@GL_VERSION = global i32 0
@.str.16 = [18 x i8] c"GL hw accelerated\00"
@.str.17 = [9 x i8] c"llvmpipe\00"
@.str.18 = [9 x i8] c"Software\00"
@.str.19 = [15 x i8] c"info: %s:\09no\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i32
%14 = alloca [9 x i32]
%15 = alloca i32*
%16 = alloca i32
%17 = alloca [5 x i32]
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i8*
%23 = alloca i8*
%24 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %6
%25 = call i32* @XOpenDisplay(i32* null)
store i32* %25, i32** %7
%26 = load i32*, i32** %7
%27 = icmp ne i32* %26, null
br i1 %27, label %32, label %28
28: ; preds = %2
%29 = load i8*, i8** %6
%30 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %29)
%31 = call i32 @exit(i32 1)
unreachable
32: ; preds = %2
store i32 0, i32* %9
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8** %6
%33 = load i32*, i32** %7
%34 = load i32, i32* %9
%35 = load i32, i32* @GLX_VENDOR
%36 = call i8* @glXQueryServerString(i32* %33, i32 %34, i32 %35)
store i8* %36, i8** %10
%37 = load i8*, i8** %10
%38 = icmp ne i8* %37, null
br i1 %38, label %43, label %39
39: ; preds = %32
%40 = load i8*, i8** %6
%41 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* %40)
%42 = call i32 @exit(i32 1)
unreachable
43: ; preds = %32
%44 = load i8*, i8** %6
%45 = load i8*, i8** %10
%46 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %44, i8* %45)
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8** %6
%47 = load i32*, i32** %7
%48 = load i32, i32* @GLX_VENDOR
%49 = call i8* @glXGetClientString(i32* %47, i32 %48)
store i8* %49, i8** %12
%50 = load i8*, i8** %6
%51 = load i8*, i8** %12
%52 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %50, i8* %51)
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i8** %6
%53 = getelementptr inbounds [9 x i32], [9 x i32]* %14, i64 0, i64 0
%54 = load i32, i32* @GLX_CONFIG_CAVEAT
store i32 %54, i32* %53
%55 = getelementptr inbounds i32, i32* %53, i64 1
%56 = load i32, i32* @GLX_NONE
store i32 %56, i32* %55
%57 = getelementptr inbounds i32, i32* %55, i64 1
%58 = load i32, i32* @GLX_DOUBLEBUFFER
store i32 %58, i32* %57
%59 = getelementptr inbounds i32, i32* %57, i64 1
%60 = load i32, i32* @True
store i32 %60, i32* %59
%61 = getelementptr inbounds i32, i32* %59, i64 1
%62 = load i32, i32* @GLX_RENDER_TYPE
store i32 %62, i32* %61
%63 = getelementptr inbounds i32, i32* %61, i64 1
%64 = load i32, i32* @GLX_RGBA_BIT
store i32 %64, i32* %63
%65 = getelementptr inbounds i32, i32* %63, i64 1
%66 = load i32, i32* @GLX_DRAWABLE_TYPE
store i32 %66, i32* %65
%67 = getelementptr inbounds i32, i32* %65, i64 1
%68 = load i32, i32* @GLX_PBUFFER_BIT
store i32 %68, i32* %67
%69 = getelementptr inbounds i32, i32* %67, i64 1
store i32 0, i32* %69
%70 = load i32*, i32** %7
%71 = load i32, i32* %9
%72 = getelementptr inbounds [9 x i32], [9 x i32]* %14, i64 0, i64 0
%73 = call i32* @glXChooseFBConfig(i32* %70, i32 %71, i32* %72, i32* %13)
store i32* %73, i32** %15
%74 = load i32*, i32** %15
%75 = icmp ne i32* %74, null
br i1 %75, label %80, label %76
76: ; preds = %43
%77 = load i8*, i8** %6
%78 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i8* %77)
%79 = call i32 @exit(i32 1)
unreachable
80: ; preds = %43
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i8** %6
%81 = getelementptr inbounds [5 x i32], [5 x i32]* %17, i64 0, i64 0
%82 = load i32, i32* @GLX_PBUFFER_WIDTH
store i32 %82, i32* %81
%83 = getelementptr inbounds i32, i32* %81, i64 1
store i32 32, i32* %83
%84 = getelementptr inbounds i32, i32* %83, i64 1
%85 = load i32, i32* @GLX_PBUFFER_HEIGHT
store i32 %85, i32* %84
%86 = getelementptr inbounds i32, i32* %84, i64 1
store i32 32, i32* %86
%87 = getelementptr inbounds i32, i32* %86, i64 1
store i32 0, i32* %87
%88 = load i32*, i32** %7
%89 = load i32*, i32** %15
%90 = getelementptr inbounds i32, i32* %89, i64 0
%91 = load i32, i32* %90
%92 = getelementptr inbounds [5 x i32], [5 x i32]* %17, i64 0, i64 0
%93 = call i32 @glXCreatePbuffer(i32* %88, i32 %91, i32* %92)
store i32 %93, i32* %18
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i8** %6
%94 = load i32*, i32** %7
%95 = load i32*, i32** %15
%96 = getelementptr inbounds i32, i32* %95, i64 0
%97 = load i32, i32* %96
%98 = load i32, i32* @GLX_RGBA_TYPE
%99 = load i32, i32* @True
%100 = call i32 @glXCreateNewContext(i32* %94, i32 %97, i32 %98, i32 0, i32 %99)
store i32 %100, i32* %19
%101 = load i32, i32* %19
%102 = icmp ne i32 %101, 0
br i1 %102, label %107, label %103
103: ; preds = %80
%104 = load i8*, i8** %6
%105 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i8* %104)
%106 = call i32 @exit(i32 1)
unreachable
107: ; preds = %80
%108 = load i32*, i32** %7
%109 = load i32, i32* %19
%110 = call i32 @glXIsDirect(i32* %108, i32 %109)
%111 = icmp ne i32 %110, 0
br i1 %111, label %115, label %112
112: ; preds = %107
%113 = load i8*, i8** %6
%114 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.11, i64 0, i64 0), i8* %113)
br label %115
115: ; preds = %112, %107
%116 = load i32*, i32** %7
%117 = load i32, i32* %18
%118 = load i32, i32* %19
%119 = call i32 @glXMakeCurrent(i32* %116, i32 %117, i32 %118)
%120 = icmp ne i32 %119, 0
br i1 %120, label %125, label %121
121: ; preds = %115
%122 = load i8*, i8** %6
%123 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.12, i64 0, i64 0), i8* %122)
%124 = call i32 @exit(i32 1)
unreachable
125: ; preds = %115
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0), i8** %6
%126 = load i32, i32* @GL_VENDOR
%127 = call i64 @glGetString(i32 %126)
%128 = inttoptr i64 %127 to i8*
store i8* %128, i8** %22
%129 = load i8*, i8** %6
%130 = load i8*, i8** %22
%131 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %129, i8* %130)
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0), i8** %6
%132 = load i32, i32* @GL_RENDERER
%133 = call i64 @glGetString(i32 %132)
%134 = inttoptr i64 %133 to i8*
store i8* %134, i8** %23
%135 = load i8*, i8** %6
%136 = load i8*, i8** %23
%137 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %135, i8* %136)
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.15, i64 0, i64 0), i8** %6
%138 = load i32, i32* @GL_VERSION
%139 = call i64 @glGetString(i32 %138)
%140 = inttoptr i64 %139 to i8*
store i8* %140, i8** %24
%141 = load i8*, i8** %6
%142 = load i8*, i8** %24
%143 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %141, i8* %142)
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.16, i64 0, i64 0), i8** %6
%144 = load i8*, i8** %23
%145 = call i64 @strstr(i8* %144, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0))
%146 = icmp ne i64 %145, 0
br i1 %146, label %151, label %147
147: ; preds = %125
%148 = load i8*, i8** %23
%149 = call i64 @strstr(i8* %148, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i64 0, i64 0))
%150 = icmp ne i64 %149, 0
br i1 %150, label %151, label %154
151: ; preds = %147, %125
%152 = load i8*, i8** %6
%153 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.19, i64 0, i64 0), i8* %152)
br label %154
154: ; preds = %151, %147
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"X display\00"
@.str.1 = [38 x i8] c"fatal: %s:\09failed to open connection\0A\00"
@.str.2 = [11 x i8] c"GLX server\00"
@GLX_VENDOR = global i32 0
@.str.3 = [26 x i8] c"fatal: %s:\09lookup failed\0A\00"
@.str.4 = [15 x i8] c"info: %s:\09%s\0A\00"
@.str.5 = [11 x i8] c"GLX client\00"
@.str.6 = [21 x i8] c"GLX DB RGBA FBConfig\00"
@GLX_CONFIG_CAVEAT = global i32 0
@GLX_NONE = global i32 0
@GLX_DOUBLEBUFFER = global i32 0
@True = global i32 0
@GLX_RENDER_TYPE = global i32 0
@GLX_RGBA_BIT = global i32 0
@GLX_DRAWABLE_TYPE = global i32 0
@GLX_PBUFFER_BIT = global i32 0
@.str.7 = [26 x i8] c"fatal: %s:\09none reported\0A\00"
@GLX_PBUFFER_WIDTH = global i32 0
@GLX_PBUFFER_HEIGHT = global i32 0
@.str.9 = [12 x i8] c"GLX Context\00"
@GLX_RGBA_TYPE = global i32 0
@.str.10 = [19 x i8] c"fatal: %s:\09failed\0A\00"
@.str.11 = [43 x i8] c"info: %s:\09direct rendering not available\0A\00"
@.str.12 = [34 x i8] c"fatal: %s:\09glXMakeCurrent failed\0A\00"
@.str.13 = [10 x i8] c"GL vendor\00"
@GL_VENDOR = global i32 0
@.str.14 = [12 x i8] c"GL renderer\00"
@GL_RENDERER = global i32 0
@.str.15 = [11 x i8] c"GL version\00"
@GL_VERSION = global i32 0
@.str.16 = [18 x i8] c"GL hw accelerated\00"
@.str.17 = [9 x i8] c"llvmpipe\00"
@.str.18 = [9 x i8] c"Software\00"
@.str.19 = [15 x i8] c"info: %s:\09no\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [9 x i32]
%5 = alloca [5 x i32]
%6 = tail call i32* @XOpenDisplay(i32* null)
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %2
%12 = load i32, i32* @GLX_VENDOR
%13 = tail call i8* @glXQueryServerString(i32* %6, i32 0, i32 %12)
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%17 = tail call i32 @exit(i32 1)
unreachable
18: ; preds = %11
%19 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %13)
%20 = load i32, i32* @GLX_VENDOR
%21 = tail call i8* @glXGetClientString(i32* %6, i32 %20)
%22 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* %21)
%23 = bitcast i32* %3 to i8*
%24 = bitcast [9 x i32]* %4 to i8*
%25 = getelementptr inbounds [9 x i32], [9 x i32]* %4, i64 0, i64 0
%26 = load i32, i32* @GLX_CONFIG_CAVEAT
store i32 %26, i32* %25
%27 = getelementptr inbounds [9 x i32], [9 x i32]* %4, i64 0, i64 1
%28 = load i32, i32* @GLX_NONE
store i32 %28, i32* %27
%29 = getelementptr inbounds [9 x i32], [9 x i32]* %4, i64 0, i64 2
%30 = load i32, i32* @GLX_DOUBLEBUFFER
store i32 %30, i32* %29
%31 = getelementptr inbounds [9 x i32], [9 x i32]* %4, i64 0, i64 3
%32 = load i32, i32* @True
store i32 %32, i32* %31
%33 = getelementptr inbounds [9 x i32], [9 x i32]* %4, i64 0, i64 4
%34 = load i32, i32* @GLX_RENDER_TYPE
store i32 %34, i32* %33
%35 = getelementptr inbounds [9 x i32], [9 x i32]* %4, i64 0, i64 5
%36 = load i32, i32* @GLX_RGBA_BIT
store i32 %36, i32* %35
%37 = getelementptr inbounds [9 x i32], [9 x i32]* %4, i64 0, i64 6
%38 = load i32, i32* @GLX_DRAWABLE_TYPE
store i32 %38, i32* %37
%39 = getelementptr inbounds [9 x i32], [9 x i32]* %4, i64 0, i64 7
%40 = load i32, i32* @GLX_PBUFFER_BIT
store i32 %40, i32* %39
%41 = getelementptr inbounds [9 x i32], [9 x i32]* %4, i64 0, i64 8
store i32 0, i32* %41
%42 = call i32* @glXChooseFBConfig(i32* %6, i32 0, i32* %25, i32* %3)
%43 = icmp eq i32* %42, null
br i1 %43, label %44, label %47
44: ; preds = %18
%45 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
%46 = call i32 @exit(i32 1)
unreachable
47: ; preds = %18
%48 = bitcast [5 x i32]* %5 to i8*
%49 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 0
%50 = load i32, i32* @GLX_PBUFFER_WIDTH
store i32 %50, i32* %49
%51 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 1
store i32 32, i32* %51
%52 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 2
%53 = load i32, i32* @GLX_PBUFFER_HEIGHT
store i32 %53, i32* %52
%54 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 3
store i32 32, i32* %54
%55 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 4
store i32 0, i32* %55
%56 = load i32, i32* %42
%57 = call i32 @glXCreatePbuffer(i32* %6, i32 %56, i32* %49)
%58 = load i32, i32* %42
%59 = load i32, i32* @GLX_RGBA_TYPE
%60 = load i32, i32* @True
%61 = call i32 @glXCreateNewContext(i32* %6, i32 %58, i32 %59, i32 0, i32 %60)
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %66
63: ; preds = %47
%64 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
%65 = call i32 @exit(i32 1)
unreachable
66: ; preds = %47
%67 = call i32 @glXIsDirect(i32* %6, i32 %61)
%68 = icmp eq i32 %67, 0
br i1 %68, label %69, label %71
69: ; preds = %66
%70 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
br label %71
71: ; preds = %69, %66
%72 = call i32 @glXMakeCurrent(i32* %6, i32 %57, i32 %61)
%73 = icmp eq i32 %72, 0
br i1 %73, label %74, label %77
74: ; preds = %71
%75 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
%76 = call i32 @exit(i32 1)
unreachable
77: ; preds = %71
%78 = load i32, i32* @GL_VENDOR
%79 = call i64 @glGetString(i32 %78)
%80 = inttoptr i64 %79 to i8*
%81 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0), i8* %80)
%82 = load i32, i32* @GL_RENDERER
%83 = call i64 @glGetString(i32 %82)
%84 = inttoptr i64 %83 to i8*
%85 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0), i8* %84)
%86 = load i32, i32* @GL_VERSION
%87 = call i64 @glGetString(i32 %86)
%88 = inttoptr i64 %87 to i8*
%89 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.15, i64 0, i64 0), i8* %88)
%90 = call i64 @strstr(i8* %84, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0))
%91 = icmp eq i64 %90, 0
br i1 %91, label %92, label %95
92: ; preds = %77
%93 = call i64 @strstr(i8* %84, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i64 0, i64 0))
%94 = icmp eq i64 %93, 0
br i1 %94, label %97, label %95
95: ; preds = %92, %77
%96 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.16, i64 0, i64 0))
br label %97
97: ; preds = %95, %92
ret i32 0
}