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

/* Type definitions */
struct TYPE_4__ {
  scalar_t__ error_code;
  scalar_t__ request_code;
};
typedef TYPE_1__ XErrorEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
scalar_t__ BadAccess;
scalar_t__ BadDrawable;
scalar_t__ BadMatch;
scalar_t__ BadWindow;
scalar_t__ X_ConfigureWindow;
scalar_t__ X_CopyArea;
scalar_t__ X_GrabButton;
scalar_t__ X_GrabKey;
scalar_t__ X_PolyFillRectangle;
scalar_t__ X_PolySegment;
scalar_t__ X_PolyText8;
scalar_t__ X_SetInputFocus;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, scalar_t__, scalar_t__);
int /*<<< orphan*/ stderr;
int xerrorxlib(int /*<<< orphan*/ *, TYPE_1__ *);
int xerror(Display *dpy, XErrorEvent *ee) {
  if (ee->error_code == BadWindow ||
      (ee->request_code == X_SetInputFocus && ee->error_code == BadMatch) ||
      (ee->request_code == X_PolyText8 && ee->error_code == BadDrawable) ||
      (ee->request_code == X_PolyFillRectangle &&
       ee->error_code == BadDrawable) ||
      (ee->request_code == X_PolySegment && ee->error_code == BadDrawable) ||
      (ee->request_code == X_ConfigureWindow && ee->error_code == BadMatch) ||
      (ee->request_code == X_GrabButton && ee->error_code == BadAccess) ||
      (ee->request_code == X_GrabKey && ee->error_code == BadAccess) ||
      (ee->request_code == X_CopyArea && ee->error_code == BadDrawable))
    return 0;
  fprintf(stderr, "tabbed: fatal error: request code=%d, error code=%d\n",
          ee->request_code, ee->error_code);
  return xerrorxlib(dpy, ee);
}


x86 assembly (clang, -O0):
<xerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x2e9a(%rip),%rcx
cmp    (%rcx),%rax
je     12bf <xerror+0x19f>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2e3a(%rip),%rcx
cmp    (%rcx),%rax
jne    1176 <xerror+0x56>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x2e0b(%rip),%rcx
cmp    (%rcx),%rax
je     12bf <xerror+0x19f>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2e23(%rip),%rcx
cmp    (%rcx),%rax
jne    11a5 <xerror+0x85>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x2e2c(%rip),%rcx
cmp    (%rcx),%rax
je     12bf <xerror+0x19f>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2e0c(%rip),%rcx
cmp    (%rcx),%rax
jne    11d4 <xerror+0xb4>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x2dfd(%rip),%rcx
cmp    (%rcx),%rax
je     12bf <xerror+0x19f>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2e05(%rip),%rcx
cmp    (%rcx),%rax
jne    1203 <xerror+0xe3>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x2dce(%rip),%rcx
cmp    (%rcx),%rax
je     12bf <xerror+0x19f>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2d8e(%rip),%rcx
cmp    (%rcx),%rax
jne    1232 <xerror+0x112>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x2d4f(%rip),%rcx
cmp    (%rcx),%rax
je     12bf <xerror+0x19f>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2d8f(%rip),%rcx
cmp    (%rcx),%rax
jne    1261 <xerror+0x141>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x2d40(%rip),%rcx
cmp    (%rcx),%rax
je     12bf <xerror+0x19f>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2d18(%rip),%rcx
cmp    (%rcx),%rax
jne    1290 <xerror+0x170>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x2d11(%rip),%rcx
cmp    (%rcx),%rax
je     12bf <xerror+0x19f>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2d41(%rip),%rcx
cmp    (%rcx),%rax
jne    12cb <xerror+0x1ab>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x2d12(%rip),%rcx
cmp    (%rcx),%rax
jne    12cb <xerror+0x1ab>
movl   $0x0,-0x4(%rbp)
jmp    12ff <xerror+0x1df>
mov    0x2cde(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
lea    0xd16(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <xerrorxlib@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xerror>:
push   %r14
push   %rbx
push   %rax
mov    (%rsi),%rcx
mov    0x2eaa(%rip),%rax
cmp    (%rax),%rcx
je     11eb <xerror+0xcb>
mov    %rsi,%rbx
mov    %rdi,%r14
mov    0x8(%rsi),%rdx
mov    0x2e48(%rip),%rax
mov    0x2e29(%rip),%rsi
mov    (%rsi),%rsi
cmp    (%rax),%rdx
jne    1160 <xerror+0x40>
cmp    %rsi,%rcx
je     11eb <xerror+0xcb>
mov    0x2e41(%rip),%rdi
mov    0x2e5a(%rip),%rax
mov    (%rax),%rax
cmp    (%rdi),%rdx
jne    117b <xerror+0x5b>
cmp    %rax,%rcx
je     11eb <xerror+0xcb>
mov    0x2e3e(%rip),%rdi
cmp    (%rdi),%rdx
jne    118c <xerror+0x6c>
cmp    %rax,%rcx
je     11eb <xerror+0xcb>
mov    0x2e55(%rip),%rdi
cmp    (%rdi),%rdx
jne    119d <xerror+0x7d>
cmp    %rax,%rcx
je     11eb <xerror+0xcb>
mov    0x2dfc(%rip),%rdi
cmp    (%rdi),%rdx
jne    11ae <xerror+0x8e>
cmp    %rsi,%rcx
je     11eb <xerror+0xcb>
mov    0x2e1b(%rip),%rdi
mov    0x2ddc(%rip),%rsi
mov    (%rsi),%rsi
cmp    (%rdi),%rdx
jne    11c9 <xerror+0xa9>
cmp    %rsi,%rcx
je     11eb <xerror+0xcb>
mov    0x2db8(%rip),%rdi
cmp    (%rdi),%rdx
jne    11da <xerror+0xba>
cmp    %rsi,%rcx
je     11eb <xerror+0xcb>
mov    0x2dff(%rip),%rsi
cmp    (%rsi),%rdx
jne    11f5 <xerror+0xd5>
cmp    %rax,%rcx
jne    11f5 <xerror+0xd5>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2db4(%rip),%rax
mov    (%rax),%edi
lea    0xdfb(%rip),%rsi
call   1040 <fprintf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <xerrorxlib@plt>

LLVM IR (-O0):
%struct.TYPE_4__ = type { i64, i64 }
@BadWindow = global i64 0
@X_SetInputFocus = global i64 0
@BadMatch = global i64 0
@X_PolyText8 = global i64 0
@BadDrawable = global i64 0
@X_PolyFillRectangle = global i64 0
@X_PolySegment = global i64 0
@X_ConfigureWindow = global i64 0
@X_GrabButton = global i64 0
@BadAccess = global i64 0
@X_GrabKey = global i64 0
@X_CopyArea = global i64 0
@stderr = global i32 0
@.str = [53 x i8] c"tabbed: fatal error: request code=%d, error code=%d\0A\00"
define i32 @xerror(i32* %0, %struct.TYPE_4__* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca %struct.TYPE_4__*
store i32* %0, i32** %4
store %struct.TYPE_4__* %1, %struct.TYPE_4__** %5
%6 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%7 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %6, i32 0, i32 0
%8 = load i64, i64* %7
%9 = load i64, i64* @BadWindow
%10 = icmp eq i64 %8, %9
br i1 %10, label %107, label %11
11: ; preds = %2
%12 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%13 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %12, i32 0, i32 1
%14 = load i64, i64* %13
%15 = load i64, i64* @X_SetInputFocus
%16 = icmp eq i64 %14, %15
br i1 %16, label %17, label %23
17: ; preds = %11
%18 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%19 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %18, i32 0, i32 0
%20 = load i64, i64* %19
%21 = load i64, i64* @BadMatch
%22 = icmp eq i64 %20, %21
br i1 %22, label %107, label %23
23: ; preds = %17, %11
%24 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%25 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %24, i32 0, i32 1
%26 = load i64, i64* %25
%27 = load i64, i64* @X_PolyText8
%28 = icmp eq i64 %26, %27
br i1 %28, label %29, label %35
29: ; preds = %23
%30 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%31 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %30, i32 0, i32 0
%32 = load i64, i64* %31
%33 = load i64, i64* @BadDrawable
%34 = icmp eq i64 %32, %33
br i1 %34, label %107, label %35
35: ; preds = %29, %23
%36 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%37 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %36, i32 0, i32 1
%38 = load i64, i64* %37
%39 = load i64, i64* @X_PolyFillRectangle
%40 = icmp eq i64 %38, %39
br i1 %40, label %41, label %47
41: ; preds = %35
%42 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%43 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %42, i32 0, i32 0
%44 = load i64, i64* %43
%45 = load i64, i64* @BadDrawable
%46 = icmp eq i64 %44, %45
br i1 %46, label %107, label %47
47: ; preds = %41, %35
%48 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%49 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %48, i32 0, i32 1
%50 = load i64, i64* %49
%51 = load i64, i64* @X_PolySegment
%52 = icmp eq i64 %50, %51
br i1 %52, label %53, label %59
53: ; preds = %47
%54 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%55 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %54, i32 0, i32 0
%56 = load i64, i64* %55
%57 = load i64, i64* @BadDrawable
%58 = icmp eq i64 %56, %57
br i1 %58, label %107, label %59
59: ; preds = %53, %47
%60 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%61 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %60, i32 0, i32 1
%62 = load i64, i64* %61
%63 = load i64, i64* @X_ConfigureWindow
%64 = icmp eq i64 %62, %63
br i1 %64, label %65, label %71
65: ; preds = %59
%66 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%67 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %66, i32 0, i32 0
%68 = load i64, i64* %67
%69 = load i64, i64* @BadMatch
%70 = icmp eq i64 %68, %69
br i1 %70, label %107, label %71
71: ; preds = %65, %59
%72 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%73 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %72, i32 0, i32 1
%74 = load i64, i64* %73
%75 = load i64, i64* @X_GrabButton
%76 = icmp eq i64 %74, %75
br i1 %76, label %77, label %83
77: ; preds = %71
%78 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%79 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %78, i32 0, i32 0
%80 = load i64, i64* %79
%81 = load i64, i64* @BadAccess
%82 = icmp eq i64 %80, %81
br i1 %82, label %107, label %83
83: ; preds = %77, %71
%84 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%85 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %84, i32 0, i32 1
%86 = load i64, i64* %85
%87 = load i64, i64* @X_GrabKey
%88 = icmp eq i64 %86, %87
br i1 %88, label %89, label %95
89: ; preds = %83
%90 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%91 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %90, i32 0, i32 0
%92 = load i64, i64* %91
%93 = load i64, i64* @BadAccess
%94 = icmp eq i64 %92, %93
br i1 %94, label %107, label %95
95: ; preds = %89, %83
%96 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%97 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %96, i32 0, i32 1
%98 = load i64, i64* %97
%99 = load i64, i64* @X_CopyArea
%100 = icmp eq i64 %98, %99
br i1 %100, label %101, label %108
101: ; preds = %95
%102 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%103 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %102, i32 0, i32 0
%104 = load i64, i64* %103
%105 = load i64, i64* @BadDrawable
%106 = icmp eq i64 %104, %105
br i1 %106, label %107, label %108
107: ; preds = %101, %89, %77, %65, %53, %41, %29, %17, %2
store i32 0, i32* %3
br label %120
108: ; preds = %101, %95
%109 = load i32, i32* @stderr
%110 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%111 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %110, i32 0, i32 1
%112 = load i64, i64* %111
%113 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%114 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %113, i32 0, i32 0
%115 = load i64, i64* %114
%116 = call i32 @fprintf(i32 %109, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i64 %112, i64 %115)
%117 = load i32*, i32** %4
%118 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%119 = call i32 @xerrorxlib(i32* %117, %struct.TYPE_4__* %118)
store i32 %119, i32* %3
br label %120
120: ; preds = %108, %107
%121 = load i32, i32* %3
ret i32 %121
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i64, i64 }
@BadWindow = global i64 0
@X_SetInputFocus = global i64 0
@BadMatch = global i64 0
@X_PolyText8 = global i64 0
@BadDrawable = global i64 0
@X_PolyFillRectangle = global i64 0
@X_PolySegment = global i64 0
@X_ConfigureWindow = global i64 0
@X_GrabButton = global i64 0
@BadAccess = global i64 0
@X_GrabKey = global i64 0
@X_CopyArea = global i64 0
@stderr = global i32 0
@.str = [53 x i8] c"tabbed: fatal error: request code=%d, error code=%d\0A\00"
define i32 @xerror(i32* %0, %struct.TYPE_4__* %1) {
%3 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %1, i64 0, i32 0
%4 = load i64, i64* %3
%5 = load i64, i64* @BadWindow
%6 = icmp eq i64 %4, %5
br i1 %6, label %52, label %7
7: ; preds = %2
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = load i64, i64* @X_SetInputFocus
%11 = icmp eq i64 %9, %10
%12 = load i64, i64* @BadMatch
%13 = icmp eq i64 %4, %12
%14 = select i1 %11, i1 %13, i1 false
br i1 %14, label %52, label %15
15: ; preds = %7
%16 = load i64, i64* @X_PolyText8
%17 = icmp eq i64 %9, %16
%18 = load i64, i64* @BadDrawable
%19 = icmp eq i64 %4, %18
%20 = select i1 %17, i1 %19, i1 false
br i1 %20, label %52, label %21
21: ; preds = %15
%22 = load i64, i64* @X_PolyFillRectangle
%23 = icmp eq i64 %9, %22
%24 = select i1 %23, i1 %19, i1 false
br i1 %24, label %52, label %25
25: ; preds = %21
%26 = load i64, i64* @X_PolySegment
%27 = icmp eq i64 %9, %26
%28 = select i1 %27, i1 %19, i1 false
br i1 %28, label %52, label %29
29: ; preds = %25
%30 = load i64, i64* @X_ConfigureWindow
%31 = icmp ne i64 %9, %30
%32 = xor i1 %13, true
%33 = select i1 %31, i1 true, i1 %32
br i1 %33, label %34, label %52
34: ; preds = %29
%35 = load i64, i64* @X_GrabButton
%36 = icmp eq i64 %9, %35
%37 = load i64, i64* @BadAccess
%38 = icmp eq i64 %4, %37
%39 = select i1 %36, i1 %38, i1 false
br i1 %39, label %52, label %40
40: ; preds = %34
%41 = load i64, i64* @X_GrabKey
%42 = icmp eq i64 %9, %41
%43 = select i1 %42, i1 %38, i1 false
br i1 %43, label %52, label %44
44: ; preds = %40
%45 = load i64, i64* @X_CopyArea
%46 = icmp eq i64 %9, %45
%47 = select i1 %46, i1 %19, i1 false
br i1 %47, label %52, label %48
48: ; preds = %44
%49 = load i32, i32* @stderr
%50 = tail call i32 @fprintf(i32 %49, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i64 %9, i64 %4)
%51 = tail call i32 @xerrorxlib(i32* %0, %struct.TYPE_4__* %1)
br label %52
52: ; preds = %44, %40, %34, %29, %25, %21, %15, %2, %7, %48
%53 = phi i32 [ %51, %48 ], [ 0, %7 ], [ 0, %2 ], [ 0, %15 ], [ 0, %21 ], [ 0, %25 ], [ 0, %29 ], [ 0, %34 ], [ 0, %40 ], [ 0, %44 ]
ret i32 %53
}