#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*/ XImage;
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Visual;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ *CreateTrueColorImage(int /*<<< orphan*/ *,
                                         int /*<<< orphan*/ *,
                                         int /*<<< orphan*/, int, int);
int /*<<< orphan*/ DefaultGC(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ *DefaultVisual(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ XDestroyImage(int /*<<< orphan*/ *);
int /*<<< orphan*/ XPutImage(int /*<<< orphan*/ *, int /*<<< orphan*/,
                             int /*<<< orphan*/, int /*<<< orphan*/ *,
                             int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/, int /*<<< orphan*/, int, int);
void processEvent(Display *display, Window window, int width, int height,
                  int s) {
  XImage *ximage;
  Visual *visual = DefaultVisual(display, s);
  ximage = CreateTrueColorImage(display, visual, 0, width, height);
  XPutImage(display, window, DefaultGC(display, 0), ximage, 0, 0, 0, 0, width,
            height);
  XDestroyImage(ximage);
}


x86 assembly (clang, -O0):
<processEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1070 <DefaultVisual@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
xor    %edx,%edx
call   1060 <CreateTrueColorImage@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <DefaultGC@plt>
mov    -0x38(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    %eax,%edx
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%r10d
mov    -0x14(%rbp),%eax
xor    %r9d,%r9d
mov    %r9d,%r8d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %eax,0x18(%rsp)
call   1050 <XPutImage@plt>
mov    -0x20(%rbp),%rdi
call   1040 <XDestroyImage@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processEvent>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %ecx,%r12d
mov    %edx,%r14d
mov    %esi,%r15d
mov    %rdi,%rbp
mov    %r8d,%esi
call   1070 <DefaultVisual@plt>
mov    %rbp,%rdi
mov    %rax,%rsi
xor    %edx,%edx
mov    %r14d,%ecx
mov    %r12d,%r8d
call   1060 <CreateTrueColorImage@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
xor    %esi,%esi
call   1030 <DefaultGC@plt>
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %eax,%edx
mov    %rbx,%rcx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %r12
push   %r14
push   $0x0
push   $0x0
call   1050 <XPutImage@plt>
add    $0x20,%rsp
mov    %rbx,%rdi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <XDestroyImage@plt>

LLVM IR (-O0):
define void @processEvent(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 i32*
%12 = 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
%13 = load i32*, i32** %6
%14 = load i32, i32* %10
%15 = call i32* @DefaultVisual(i32* %13, i32 %14)
store i32* %15, i32** %12
%16 = load i32*, i32** %6
%17 = load i32*, i32** %12
%18 = load i32, i32* %8
%19 = load i32, i32* %9
%20 = call i32* @CreateTrueColorImage(i32* %16, i32* %17, i32 0, i32 %18, i32 %19)
store i32* %20, i32** %11
%21 = load i32*, i32** %6
%22 = load i32, i32* %7
%23 = load i32*, i32** %6
%24 = call i32 @DefaultGC(i32* %23, i32 0)
%25 = load i32*, i32** %11
%26 = load i32, i32* %8
%27 = load i32, i32* %9
%28 = call i32 @XPutImage(i32* %21, i32 %22, i32 %24, i32* %25, i32 0, i32 0, i32 0, i32 0, i32 %26, i32 %27)
%29 = load i32*, i32** %11
%30 = call i32 @XDestroyImage(i32* %29)
ret void
}

LLVM IR (-O2):
define void @processEvent(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32* @DefaultVisual(i32* %0, i32 %4)
%7 = tail call i32* @CreateTrueColorImage(i32* %0, i32* %6, i32 0, i32 %2, i32 %3)
%8 = tail call i32 @DefaultGC(i32* %0, i32 0)
%9 = tail call i32 @XPutImage(i32* %0, i32 %1, i32 %8, i32* %7, i32 0, i32 0, i32 0, i32 0, i32 %2, i32 %3)
%10 = tail call i32 @XDestroyImage(i32* %7)
ret void
}