#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 error_code;
  int request_code;
  int minor_code;
  int /*<<< orphan*/ serial;
};
typedef TYPE_1__ XErrorEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ XGetErrorText(int /*<<< orphan*/ *, int, char *, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *, int, int,
                           int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int ignore_xlib_error(Display *disp, XErrorEvent *xee) {
  char errbuf[256];
  XGetErrorText(disp, xee->error_code, errbuf, 256);
  fprintf(
      stderr, "IGNORING Xlib error %d (%s) on request (%d.%d), sernum = %lu.\n",
      xee->error_code, errbuf, xee->request_code, xee->minor_code, xee->serial);
  return 1;
}


x86 assembly (clang, -O0):
<ignore_xlib_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    -0x110(%rbp),%rdx
mov    $0x100,%ecx
call   1040 <XGetErrorText@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    -0x110(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%r8d
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%r9d
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%eax
lea    0xe7e(%rip),%rsi
mov    %eax,(%rsp)
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignore_xlib_error>:
push   %r14
push   %rbx
sub    $0x118,%rsp
mov    %rsi,%rbx
mov    (%rsi),%esi
lea    0x10(%rsp),%r14
mov    %r14,%rdx
mov    $0x100,%ecx
call   1040 <XGetErrorText@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%edx
mov    0x4(%rbx),%r8d
mov    0x8(%rbx),%r9d
mov    0xc(%rbx),%eax
mov    %eax,(%rsp)
lea    0xe9f(%rip),%rsi
mov    %r14,%rcx
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x118,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32, i32, i32 }
@stderr = global i32 0
@.str = [63 x i8] c"IGNORING Xlib error %d (%s) on request (%d.%d), sernum = %lu.\0A\00"
define i32 @ignore_xlib_error(i32* %0, %struct.TYPE_3__* %1) {
%3 = alloca i32*
%4 = alloca %struct.TYPE_3__*
%5 = alloca [256 x i8]
store i32* %0, i32** %3
store %struct.TYPE_3__* %1, %struct.TYPE_3__** %4
%6 = load i32*, i32** %3
%7 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 0
%9 = load i32, i32* %8
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%11 = call i32 @XGetErrorText(i32* %6, i32 %9, i8* %10, i32 256)
%12 = load i32, i32* @stderr
%13 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%14 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %13, i32 0, i32 0
%15 = load i32, i32* %14
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%17 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%18 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %17, i32 0, i32 1
%19 = load i32, i32* %18
%20 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%21 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %20, i32 0, i32 2
%22 = load i32, i32* %21
%23 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%24 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %23, i32 0, i32 3
%25 = load i32, i32* %24
%26 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 %15, i8* %16, i32 %19, i32 %22, i32 %25)
ret i32 1
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32, i32, i32 }
@stderr = global i32 0
@.str = [63 x i8] c"IGNORING Xlib error %d (%s) on request (%d.%d), sernum = %lu.\0A\00"
define i32 @ignore_xlib_error(i32* %0, %struct.TYPE_3__* nocapture %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = call i32 @XGetErrorText(i32* %0, i32 %6, i8* %4, i32 256)
%8 = load i32, i32* @stderr
%9 = load i32, i32* %5
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 1
%11 = load i32, i32* %10
%12 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 2
%13 = load i32, i32* %12
%14 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 3
%15 = load i32, i32* %14
%16 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %4, i32 %11, i32 %13, i32 %15)
ret i32 1
}