#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_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ *visual;
};
typedef TYPE_1__ XVisualInfo;
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Visual;
typedef int /*<<< orphan*/ Screen;
typedef int /*<<< orphan*/ Display;
typedef int /*<<< orphan*/ Colormap;

/* Variables and functions */
int /*<<< orphan*/ AllocNone;
int /*<<< orphan*/ DefaultColormap(int /*<<< orphan*/ *, int);
int DefaultDepth(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ *DefaultScreenOfDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ *DefaultVisual(int /*<<< orphan*/ *, int);
int MaxCmapsOfScreen(int /*<<< orphan*/ *);
int /*<<< orphan*/ PseudoColor;
int /*<<< orphan*/ RootWindow(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ TrueColor;
int /*<<< orphan*/ XCreateColormap(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                   int /*<<< orphan*/ *, int /*<<< orphan*/);
scalar_t__ XMatchVisualInfo(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/,
                            TYPE_1__ *);
int /*<<< orphan*/ assert(int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int find_best_visual(Display *dpy, int scr, int *depth, Visual **visual,
                     Colormap *cmap) {
  XVisualInfo visinfo;
  Window root;
  Screen *screen;
  assert(dpy);
  root = RootWindow(dpy, scr);
  screen = DefaultScreenOfDisplay(dpy);
  if (XMatchVisualInfo(dpy, scr, 24, TrueColor, &visinfo)) {
    *depth = 24;
    *visual = visinfo.visual;
    printf("Setting visual to 24 bit truecolor with ");
    if (*visual == DefaultVisual(dpy, scr) && DefaultDepth(dpy, scr) == 24) {
      *cmap = DefaultColormap(dpy, scr);
      printf("default color map\n");
    } else {
      *cmap = XCreateColormap(dpy, root, *visual, AllocNone);
      printf("locally defined color map\n");
    }
  } else if (XMatchVisualInfo(dpy, scr, 8, PseudoColor, &visinfo)) {
    *depth = 8;
    *visual = visinfo.visual;
    printf("Setting visual to 8 bit PsuedoColor with ");
    if (visinfo.visual == DefaultVisual(dpy, scr) &&
        DefaultDepth(dpy, scr) == 8 && MaxCmapsOfScreen(screen) == 1) {
      *cmap = DefaultColormap(dpy, scr);
      printf("default color map\n");
    } else {
      *cmap = XCreateColormap(dpy, root, *visual, AllocNone);
      printf("locally defined color map\n");
    }
  } else {
    *depth = DefaultDepth(dpy, scr);
    *visual = DefaultVisual(dpy, scr);
    *cmap = DefaultColormap(dpy, scr);
    printf("Using default visual with depth %d\n", *depth);
  }
  if (*depth < 8) {
    printf("Error: couldn't get suitable visual!\n");
    exit(1);
  }
  return 1;
}


x86 assembly (clang, -O0):
<find_best_visual>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1070 <RootWindow@plt>
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <DefaultScreenOfDisplay@plt>
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2de2(%rip),%rax
mov    (%rax),%ecx
mov    $0x18,%edx
lea    -0x30(%rbp),%r8
call   10b0 <XMatchVisualInfo@plt>
cmp    $0x0,%rax
je     12d5 <find_best_visual+0x125>
mov    -0x18(%rbp),%rax
movl   $0x18,(%rax)
mov    -0x30(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
lea    0xdcc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x48(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   10d0 <DefaultVisual@plt>
mov    %rax,%rcx
mov    -0x48(%rbp),%rax
cmp    %rcx,%rax
jne    129e <find_best_visual+0xee>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1080 <DefaultDepth@plt>
cmp    $0x18,%eax
jne    129e <find_best_visual+0xee>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1090 <DefaultColormap@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
lea    0xd97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d0 <find_best_visual+0x120>
mov    -0x8(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    -0x20(%rbp),%rax
mov    (%rax),%rdx
mov    0x2d35(%rip),%rax
mov    (%rax),%ecx
call   10a0 <XCreateColormap@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
lea    0xd73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1420 <find_best_visual+0x270>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2ce5(%rip),%rax
mov    (%rax),%ecx
mov    $0x8,%edx
lea    -0x30(%rbp),%r8
call   10b0 <XMatchVisualInfo@plt>
cmp    $0x0,%rax
je     13c9 <find_best_visual+0x219>
mov    -0x18(%rbp),%rax
movl   $0x8,(%rax)
mov    -0x30(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
lea    0xd3e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   10d0 <DefaultVisual@plt>
mov    %rax,%rcx
mov    -0x50(%rbp),%rax
cmp    %rcx,%rax
jne    1392 <find_best_visual+0x1e2>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1080 <DefaultDepth@plt>
cmp    $0x8,%eax
jne    1392 <find_best_visual+0x1e2>
mov    -0x40(%rbp),%rdi
call   1060 <MaxCmapsOfScreen@plt>
cmp    $0x1,%eax
jne    1392 <find_best_visual+0x1e2>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1090 <DefaultColormap@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
lea    0xca3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13c4 <find_best_visual+0x214>
mov    -0x8(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    -0x20(%rbp),%rax
mov    (%rax),%rdx
mov    0x2c41(%rip),%rax
mov    (%rax),%ecx
call   10a0 <XCreateColormap@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
lea    0xc7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    141b <find_best_visual+0x26b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1080 <DefaultDepth@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   10d0 <DefaultVisual@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1090 <DefaultColormap@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xc6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1420 <find_best_visual+0x270>
mov    -0x18(%rbp),%rax
cmpl   $0x8,(%rax)
jge    1445 <find_best_visual+0x295>
lea    0xc71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    $0x1,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_best_visual>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r8,0x10(%rsp)
mov    %rcx,%r14
mov    %rdx,%rbp
mov    %esi,%r15d
mov    %rdi,%rbx
call   1060 <assert@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
call   1080 <RootWindow@plt>
mov    %eax,%r13d
mov    %rbx,%rdi
call   1050 <DefaultScreenOfDisplay@plt>
mov    %rax,%r12
mov    0x2ddc(%rip),%rax
mov    (%rax),%ecx
lea    0x18(%rsp),%r8
mov    %rbx,%rdi
mov    %r15d,%esi
mov    $0x18,%edx
call   10c0 <XMatchVisualInfo@plt>
test   %rax,%rax
je     12d0 <find_best_visual+0x110>
mov    0x10(%rsp),%r12
mov    %rbp,0x8(%rsp)
movl   $0x18,0x0(%rbp)
mov    0x18(%rsp),%rax
mov    %rax,(%r14)
lea    0xdbc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r14),%rbp
mov    %rbx,%rdi
mov    %r15d,%esi
call   10e0 <DefaultVisual@plt>
cmp    %rax,%rbp
jne    1286 <find_best_visual+0xc6>
mov    %rbx,%rdi
mov    %r15d,%esi
call   1090 <DefaultDepth@plt>
cmp    $0x18,%eax
jne    1286 <find_best_visual+0xc6>
mov    %rbx,%rdi
mov    %r15d,%esi
call   10a0 <DefaultColormap@plt>
mov    %eax,(%r12)
lea    0xe32(%rip),%rdi
jmp    12a8 <find_best_visual+0xe8>
mov    (%r14),%rdx
mov    0x2d58(%rip),%rax
mov    (%rax),%ecx
mov    %rbx,%rdi
mov    %r13d,%esi
call   10b0 <XCreateColormap@plt>
mov    %eax,(%r12)
lea    0xdf4(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rsp),%rbp
cmpl   $0x7,0x0(%rbp)
jle    13ed <find_best_visual+0x22d>
mov    $0x1,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r13d,0x8(%rsp)
mov    %r12,0x20(%rsp)
mov    0x2ce7(%rip),%rax
mov    (%rax),%ecx
lea    0x18(%rsp),%r8
mov    %rbx,%rdi
mov    %r15d,%esi
mov    $0x8,%edx
call   10c0 <XMatchVisualInfo@plt>
test   %rax,%rax
je     13a4 <find_best_visual+0x1e4>
movl   $0x8,0x0(%rbp)
mov    0x18(%rsp),%rax
mov    %rax,(%r14)
lea    0xd12(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rsp),%r12
mov    %rbx,%rdi
mov    %r15d,%esi
call   10e0 <DefaultVisual@plt>
cmp    %rax,%r12
jne    136d <find_best_visual+0x1ad>
mov    %rbx,%rdi
mov    %r15d,%esi
call   1090 <DefaultDepth@plt>
cmp    $0x8,%eax
jne    136d <find_best_visual+0x1ad>
mov    0x20(%rsp),%rdi
call   1070 <MaxCmapsOfScreen@plt>
cmp    $0x1,%eax
jne    136d <find_best_visual+0x1ad>
mov    %rbx,%rdi
mov    %r15d,%esi
call   10a0 <DefaultColormap@plt>
mov    0x10(%rsp),%rcx
mov    %eax,(%rcx)
lea    0xd4b(%rip),%rdi
jmp    1393 <find_best_visual+0x1d3>
mov    (%r14),%rdx
mov    0x2c71(%rip),%rax
mov    (%rax),%ecx
mov    %rbx,%rdi
mov    0x8(%rsp),%esi
call   10b0 <XCreateColormap@plt>
mov    0x10(%rsp),%rcx
mov    %eax,(%rcx)
lea    0xd09(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x7,0x0(%rbp)
jg     12bc <find_best_visual+0xfc>
jmp    13ed <find_best_visual+0x22d>
mov    %rbx,%rdi
mov    %r15d,%esi
call   1090 <DefaultDepth@plt>
mov    %eax,0x0(%rbp)
mov    %rbx,%rdi
mov    %r15d,%esi
call   10e0 <DefaultVisual@plt>
mov    %rax,(%r14)
mov    %rbx,%rdi
mov    %r15d,%esi
call   10a0 <DefaultColormap@plt>
mov    0x10(%rsp),%rcx
mov    %eax,(%rcx)
mov    0x0(%rbp),%esi
lea    0xc77(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x7,0x0(%rbp)
jg     12bc <find_best_visual+0xfc>
lea    0xc83(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32* }
@TrueColor = global i32 0
@.str = [41 x i8] c"Setting visual to 24 bit truecolor with \00"
@.str.1 = [19 x i8] c"default color map\0A\00"
@AllocNone = global i32 0
@.str.2 = [27 x i8] c"locally defined color map\0A\00"
@PseudoColor = global i32 0
@.str.3 = [42 x i8] c"Setting visual to 8 bit PsuedoColor with \00"
@.str.4 = [36 x i8] c"Using default visual with depth %d\0A\00"
@.str.5 = [38 x i8] c"Error: couldn't get suitable visual!\0A\00"
define i32 @find_best_visual(i32* %0, i32 %1, i32* %2, i32** %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32**
%10 = alloca i32*
%11 = alloca %struct.TYPE_3__
%12 = alloca i32
%13 = alloca i32*
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32** %3, i32*** %9
store i32* %4, i32** %10
%14 = load i32*, i32** %6
%15 = call i32 @assert(i32* %14)
%16 = load i32*, i32** %6
%17 = load i32, i32* %7
%18 = call i32 @RootWindow(i32* %16, i32 %17)
store i32 %18, i32* %12
%19 = load i32*, i32** %6
%20 = call i32* @DefaultScreenOfDisplay(i32* %19)
store i32* %20, i32** %13
%21 = load i32*, i32** %6
%22 = load i32, i32* %7
%23 = load i32, i32* @TrueColor
%24 = call i64 @XMatchVisualInfo(i32* %21, i32 %22, i32 24, i32 %23, %struct.TYPE_3__* %11)
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %59
26: ; preds = %5
%27 = load i32*, i32** %8
store i32 24, i32* %27
%28 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %11, i32 0, i32 0
%29 = load i32*, i32** %28
%30 = load i32**, i32*** %9
store i32* %29, i32** %30
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%32 = load i32**, i32*** %9
%33 = load i32*, i32** %32
%34 = load i32*, i32** %6
%35 = load i32, i32* %7
%36 = call i32* @DefaultVisual(i32* %34, i32 %35)
%37 = icmp eq i32* %33, %36
br i1 %37, label %38, label %49
38: ; preds = %26
%39 = load i32*, i32** %6
%40 = load i32, i32* %7
%41 = call i32 @DefaultDepth(i32* %39, i32 %40)
%42 = icmp eq i32 %41, 24
br i1 %42, label %43, label %49
43: ; preds = %38
%44 = load i32*, i32** %6
%45 = load i32, i32* %7
%46 = call i32 @DefaultColormap(i32* %44, i32 %45)
%47 = load i32*, i32** %10
store i32 %46, i32* %47
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %58
49: ; preds = %38, %26
%50 = load i32*, i32** %6
%51 = load i32, i32* %12
%52 = load i32**, i32*** %9
%53 = load i32*, i32** %52
%54 = load i32, i32* @AllocNone
%55 = call i32 @XCreateColormap(i32* %50, i32 %51, i32* %53, i32 %54)
%56 = load i32*, i32** %10
store i32 %55, i32* %56
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %58
58: ; preds = %49, %43
br label %119
59: ; preds = %5
%60 = load i32*, i32** %6
%61 = load i32, i32* %7
%62 = load i32, i32* @PseudoColor
%63 = call i64 @XMatchVisualInfo(i32* %60, i32 %61, i32 8, i32 %62, %struct.TYPE_3__* %11)
%64 = icmp ne i64 %63, 0
br i1 %64, label %65, label %102
65: ; preds = %59
%66 = load i32*, i32** %8
store i32 8, i32* %66
%67 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %11, i32 0, i32 0
%68 = load i32*, i32** %67
%69 = load i32**, i32*** %9
store i32* %68, i32** %69
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0))
%71 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %11, i32 0, i32 0
%72 = load i32*, i32** %71
%73 = load i32*, i32** %6
%74 = load i32, i32* %7
%75 = call i32* @DefaultVisual(i32* %73, i32 %74)
%76 = icmp eq i32* %72, %75
br i1 %76, label %77, label %92
77: ; preds = %65
%78 = load i32*, i32** %6
%79 = load i32, i32* %7
%80 = call i32 @DefaultDepth(i32* %78, i32 %79)
%81 = icmp eq i32 %80, 8
br i1 %81, label %82, label %92
82: ; preds = %77
%83 = load i32*, i32** %13
%84 = call i32 @MaxCmapsOfScreen(i32* %83)
%85 = icmp eq i32 %84, 1
br i1 %85, label %86, label %92
86: ; preds = %82
%87 = load i32*, i32** %6
%88 = load i32, i32* %7
%89 = call i32 @DefaultColormap(i32* %87, i32 %88)
%90 = load i32*, i32** %10
store i32 %89, i32* %90
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %101
92: ; preds = %82, %77, %65
%93 = load i32*, i32** %6
%94 = load i32, i32* %12
%95 = load i32**, i32*** %9
%96 = load i32*, i32** %95
%97 = load i32, i32* @AllocNone
%98 = call i32 @XCreateColormap(i32* %93, i32 %94, i32* %96, i32 %97)
%99 = load i32*, i32** %10
store i32 %98, i32* %99
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %101
101: ; preds = %92, %86
br label %118
102: ; preds = %59
%103 = load i32*, i32** %6
%104 = load i32, i32* %7
%105 = call i32 @DefaultDepth(i32* %103, i32 %104)
%106 = load i32*, i32** %8
store i32 %105, i32* %106
%107 = load i32*, i32** %6
%108 = load i32, i32* %7
%109 = call i32* @DefaultVisual(i32* %107, i32 %108)
%110 = load i32**, i32*** %9
store i32* %109, i32** %110
%111 = load i32*, i32** %6
%112 = load i32, i32* %7
%113 = call i32 @DefaultColormap(i32* %111, i32 %112)
%114 = load i32*, i32** %10
store i32 %113, i32* %114
%115 = load i32*, i32** %8
%116 = load i32, i32* %115
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i32 %116)
br label %118
118: ; preds = %102, %101
br label %119
119: ; preds = %118, %58
%120 = load i32*, i32** %8
%121 = load i32, i32* %120
%122 = icmp slt i32 %121, 8
br i1 %122, label %123, label %126
123: ; preds = %119
%124 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0))
%125 = call i32 @exit(i32 1)
unreachable
126: ; preds = %119
ret i32 1
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32* }
@TrueColor = global i32 0
@.str = [41 x i8] c"Setting visual to 24 bit truecolor with \00"
@AllocNone = global i32 0
@PseudoColor = global i32 0
@.str.3 = [42 x i8] c"Setting visual to 8 bit PsuedoColor with \00"
@.str.4 = [36 x i8] c"Using default visual with depth %d\0A\00"
@str = [37 x i8] c"Error: couldn't get suitable visual!\00"
@str.8 = [26 x i8] c"locally defined color map\00"
@str.9 = [18 x i8] c"default color map\00"
define i32 @find_best_visual(i32* %0, i32 %1, i32* nocapture %2, i32** nocapture %3, i32* nocapture writeonly %4) {
%6 = alloca %struct.TYPE_3__
%7 = bitcast %struct.TYPE_3__* %6 to i8*
%8 = tail call i32 @assert(i32* %0)
%9 = tail call i32 @RootWindow(i32* %0, i32 %1)
%10 = tail call i32* @DefaultScreenOfDisplay(i32* %0)
%11 = load i32, i32* @TrueColor
%12 = call i64 @XMatchVisualInfo(i32* %0, i32 %1, i32 24, i32 %11, %struct.TYPE_3__* %6)
%13 = icmp eq i64 %12, 0
br i1 %13, label %32, label %14
14: ; preds = %5
store i32 24, i32* %2
%15 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i64 0, i32 0
%16 = load i32*, i32** %15
store i32* %16, i32** %3
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%18 = load i32*, i32** %3
%19 = call i32* @DefaultVisual(i32* %0, i32 %1)
%20 = icmp eq i32* %18, %19
br i1 %20, label %21, label %27
21: ; preds = %14
%22 = call i32 @DefaultDepth(i32* %0, i32 %1)
%23 = icmp eq i32 %22, 24
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = call i32 @DefaultColormap(i32* %0, i32 %1)
store i32 %25, i32* %4
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.9, i64 0, i64 0))
br label %63
27: ; preds = %21, %14
%28 = load i32*, i32** %3
%29 = load i32, i32* @AllocNone
%30 = call i32 @XCreateColormap(i32* %0, i32 %9, i32* %28, i32 %29)
store i32 %30, i32* %4
%31 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.8, i64 0, i64 0))
br label %63
32: ; preds = %5
%33 = load i32, i32* @PseudoColor
%34 = call i64 @XMatchVisualInfo(i32* %0, i32 %1, i32 8, i32 %33, %struct.TYPE_3__* %6)
%35 = icmp eq i64 %34, 0
br i1 %35, label %57, label %36
36: ; preds = %32
store i32 8, i32* %2
%37 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i64 0, i32 0
%38 = load i32*, i32** %37
store i32* %38, i32** %3
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0))
%40 = load i32*, i32** %37
%41 = call i32* @DefaultVisual(i32* %0, i32 %1)
%42 = icmp eq i32* %40, %41
br i1 %42, label %43, label %52
43: ; preds = %36
%44 = call i32 @DefaultDepth(i32* %0, i32 %1)
%45 = icmp eq i32 %44, 8
br i1 %45, label %46, label %52
46: ; preds = %43
%47 = call i32 @MaxCmapsOfScreen(i32* %10)
%48 = icmp eq i32 %47, 1
br i1 %48, label %49, label %52
49: ; preds = %46
%50 = call i32 @DefaultColormap(i32* %0, i32 %1)
store i32 %50, i32* %4
%51 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.9, i64 0, i64 0))
br label %63
52: ; preds = %46, %43, %36
%53 = load i32*, i32** %3
%54 = load i32, i32* @AllocNone
%55 = call i32 @XCreateColormap(i32* %0, i32 %9, i32* %53, i32 %54)
store i32 %55, i32* %4
%56 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.8, i64 0, i64 0))
br label %63
57: ; preds = %32
%58 = call i32 @DefaultDepth(i32* %0, i32 %1)
store i32 %58, i32* %2
%59 = call i32* @DefaultVisual(i32* %0, i32 %1)
store i32* %59, i32** %3
%60 = call i32 @DefaultColormap(i32* %0, i32 %1)
store i32 %60, i32* %4
%61 = load i32, i32* %2
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i32 %61)
br label %63
63: ; preds = %57, %52, %49, %24, %27
%64 = load i32, i32* %2
%65 = icmp slt i32 %64, 8
br i1 %65, label %66, label %69
66: ; preds = %63
%67 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%68 = call i32 @exit(i32 1)
unreachable
69: ; preds = %63
ret i32 1
}