#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 serial;
  int send_event;
  int window;
  int root;
  int subwindow;
  int x;
  int y;
  int x_root;
  int y_root;
  int keycode;
  int same_screen;
  int state;
};
typedef TYPE_1__ XKeyEvent;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int, int, int, int, int, int,
                          int, int, int);
void printKeyEvent(XKeyEvent e) {
  printf("serial = %d\n"
         "send_event = %d\n"
         "window = 0x%x\n"
         "root = 0x%x\n"
         "subwindow = 0x%x\n"
         "x, y = %d,%d,\n"
         "x-root, y-root = %d,%d,\n"
         "keycode = 0x%x\n"
         "same_screen = %d\n"
         "state = %d\n\n",
         e.serial, e.send_event, e.window, e.root, e.subwindow, e.x, e.y,
         e.x_root, e.y_root, e.keycode, e.same_screen, e.state);
}


x86 assembly (clang, -O0):
<printKeyEvent>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x40,%rsp
lea    0x10(%rbp),%rax
mov    (%rax),%esi
mov    0x4(%rax),%edx
mov    0x8(%rax),%ecx
mov    0xc(%rax),%r8d
mov    0x10(%rax),%r9d
mov    0x14(%rax),%r12d
mov    0x18(%rax),%r15d
mov    0x1c(%rax),%r14d
mov    0x20(%rax),%ebx
mov    0x24(%rax),%r11d
mov    0x28(%rax),%r10d
mov    0x2c(%rax),%eax
lea    0xeac(%rip),%rdi
mov    %r12d,(%rsp)
mov    %r15d,0x8(%rsp)
mov    %r14d,0x10(%rsp)
mov    %ebx,0x18(%rsp)
mov    %r11d,0x20(%rsp)
mov    %r10d,0x28(%rsp)
mov    %eax,0x30(%rsp)
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<printKeyEvent>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    0x30(%rsp),%esi
mov    0x34(%rsp),%edx
mov    0x38(%rsp),%ecx
mov    0x3c(%rsp),%r8d
mov    0x40(%rsp),%r9d
mov    0x44(%rsp),%r10d
mov    0x48(%rsp),%r11d
mov    0x4c(%rsp),%r14d
mov    0x50(%rsp),%r15d
mov    0x54(%rsp),%r12d
mov    0x58(%rsp),%ebx
mov    0x5c(%rsp),%eax
sub    $0x8,%rsp
lea    0xea6(%rip),%rdi
push   %rax
push   %rbx
push   %r12
push   %r15
push   %r14
push   %r11
push   %r10
call   1030 <printf@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
@.str = [154 x i8] c"serial = %d\0Asend_event = %d\0Awindow = 0x%x\0Aroot = 0x%x\0Asubwindow = 0x%x\0Ax, y = %d,%d,\0Ax-root, y-root = %d,%d,\0Akeycode = 0x%x\0Asame_screen = %d\0Astate = %d\0A\0A\00"
define void @printKeyEvent(%struct.TYPE_3__* byval(%struct.TYPE_3__) align 8 %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i32 0, i32 0
%3 = load i32, i32* %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i32 0, i32 1
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i32 0, i32 2
%7 = load i32, i32* %6
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i32 0, i32 3
%9 = load i32, i32* %8
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i32 0, i32 4
%11 = load i32, i32* %10
%12 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i32 0, i32 5
%13 = load i32, i32* %12
%14 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i32 0, i32 6
%15 = load i32, i32* %14
%16 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i32 0, i32 7
%17 = load i32, i32* %16
%18 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i32 0, i32 8
%19 = load i32, i32* %18
%20 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i32 0, i32 9
%21 = load i32, i32* %20
%22 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i32 0, i32 10
%23 = load i32, i32* %22
%24 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i32 0, i32 11
%25 = load i32, i32* %24
%26 = call i32 @printf(i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5, i32 %7, i32 %9, i32 %11, i32 %13, i32 %15, i32 %17, i32 %19, i32 %21, i32 %23, i32 %25)
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
@.str = [154 x i8] c"serial = %d\0Asend_event = %d\0Awindow = 0x%x\0Aroot = 0x%x\0Asubwindow = 0x%x\0Ax, y = %d,%d,\0Ax-root, y-root = %d,%d,\0Akeycode = 0x%x\0Asame_screen = %d\0Astate = %d\0A\0A\00"
define void @printKeyEvent(%struct.TYPE_3__* nocapture byval(%struct.TYPE_3__) align 8 %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 1
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 2
%7 = load i32, i32* %6
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 3
%9 = load i32, i32* %8
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 4
%11 = load i32, i32* %10
%12 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 5
%13 = load i32, i32* %12
%14 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 6
%15 = load i32, i32* %14
%16 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 7
%17 = load i32, i32* %16
%18 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 8
%19 = load i32, i32* %18
%20 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 9
%21 = load i32, i32* %20
%22 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 10
%23 = load i32, i32* %22
%24 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 11
%25 = load i32, i32* %24
%26 = tail call i32 @printf(i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5, i32 %7, i32 %9, i32 %11, i32 %13, i32 %15, i32 %17, i32 %19, i32 %21, i32 %23, i32 %25)
ret void
}