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

/* Type definitions */
typedef int /*<<< orphan*/ XEvent;
struct TYPE_2__ {
  int detail;
  int border_width;
  int /*<<< orphan*/ value_mask;
  int /*<<< orphan*/ above;
  int /*<<< orphan*/ height;
  int /*<<< orphan*/ width;
  int /*<<< orphan*/ y;
  int /*<<< orphan*/ x;
  int /*<<< orphan*/ window;
  int /*<<< orphan*/ parent;
};
typedef TYPE_1__ XConfigureRequestEvent;

/* Variables and functions */
#define Above 132
#define Below 131
#define BottomIf 130
#define Opposite 129
#define TopIf 128
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/, char *,
                          int /*<<< orphan*/, ...);
int /*<<< orphan*/ sprintf(char *, char *, int);
void do_ConfigureRequest(XEvent *eventp) {
  XConfigureRequestEvent *e = (XConfigureRequestEvent *)eventp;
  char *detail;
  char ddummy[10];
  switch (e->detail) {
  case Above:
    detail = "Above";
    break;
  case Below:
    detail = "Below";
    break;
  case TopIf:
    detail = "TopIf";
    break;
  case BottomIf:
    detail = "BottomIf";
    break;
  case Opposite:
    detail = "Opposite";
    break;
  default:
    detail = ddummy;
    sprintf(ddummy, "%d", e->detail);
    break;
  }
  printf("    parent 0x%lx, window 0x%lx, (%d,%d), width %d, height %d,\n",
         e->parent, e->window, e->x, e->y, e->width, e->height);
  printf("    border_width %d, above 0x%lx, detail %s, value 0x%lx\n",
         e->border_width, e->above, detail, e->value_mask);
}


x86 assembly (clang, -O0):
<do_ConfigureRequest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x30(%rbp)
sub    $0x4,%eax
ja     11b0 <do_ConfigureRequest+0x90>
mov    -0x30(%rbp),%rax
lea    0xea9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xead(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    11ce <do_ConfigureRequest+0xae>
lea    0xea3(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    11ce <do_ConfigureRequest+0xae>
lea    0xe99(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    11ce <do_ConfigureRequest+0xae>
lea    0xe8f(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    11ce <do_ConfigureRequest+0xae>
lea    0xe88(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    11ce <do_ConfigureRequest+0xae>
lea    -0x22(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x22(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xe6f(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
mov    0x24(%rax),%esi
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%edx
mov    -0x10(%rbp),%rax
movslq 0x1c(%rax),%rcx
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%r8d
mov    -0x10(%rbp),%rax
mov    0x14(%rax),%r9d
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%eax
lea    0xe39(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%esi
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%edx
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%r8d
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_ConfigureRequest>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
mov    (%rdi),%edx
lea    -0x80(%rdx),%eax
cmp    $0x5,%eax
jae    1146 <do_ConfigureRequest+0x26>
cltq
lea    0xf63(%rip),%rcx
movslq (%rcx,%rax,4),%r14
add    %rcx,%r14
jmp    115a <do_ConfigureRequest+0x3a>
lea    0xe(%rsp),%r14
lea    0xed2(%rip),%rsi
mov    %r14,%rdi
call   1040 <sprintf@plt>
mov    0x24(%rbx),%esi
mov    0x20(%rbx),%edx
movslq 0x1c(%rbx),%rcx
mov    0x18(%rbx),%r8d
mov    0x10(%rbx),%eax
mov    0x14(%rbx),%r9d
mov    %eax,(%rsp)
lea    0xeae(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rbx),%edx
mov    0x4(%rbx),%esi
mov    0x8(%rbx),%r8d
lea    0xed5(%rip),%rdi
mov    %r14,%rcx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
@.str = [6 x i8] c"Above\00"
@.str.1 = [6 x i8] c"Below\00"
@.str.2 = [6 x i8] c"TopIf\00"
@.str.3 = [9 x i8] c"BottomIf\00"
@.str.4 = [9 x i8] c"Opposite\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [63 x i8] c" parent 0x%lx, window 0x%lx, (%d,%d), width %d, height %d,\0A\00"
@.str.7 = [58 x i8] c" border_width %d, above 0x%lx, detail %s, value 0x%lx\0A\00"
define void @do_ConfigureRequest(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.TYPE_2__*
%4 = alloca i8*
%5 = alloca [10 x i8]
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = bitcast i32* %6 to %struct.TYPE_2__*
store %struct.TYPE_2__* %7, %struct.TYPE_2__** %3
%8 = load %struct.TYPE_2__*, %struct.TYPE_2__** %3
%9 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %8, i32 0, i32 0
%10 = load i32, i32* %9
switch i32 %10, label %16 [
i32 132, label %11
i32 131, label %12
i32 128, label %13
i32 130, label %14
i32 129, label %15
]
11: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %4
br label %23
12: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %4
br label %23
13: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %4
br label %23
14: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8** %4
br label %23
15: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8** %4
br label %23
16: ; preds = %1
%17 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
store i8* %17, i8** %4
%18 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%19 = load %struct.TYPE_2__*, %struct.TYPE_2__** %3
%20 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %19, i32 0, i32 0
%21 = load i32, i32* %20
%22 = call i32 @sprintf(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %21)
br label %23
23: ; preds = %16, %15, %14, %13, %12, %11
%24 = load %struct.TYPE_2__*, %struct.TYPE_2__** %3
%25 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %24, i32 0, i32 9
%26 = load i32, i32* %25
%27 = load %struct.TYPE_2__*, %struct.TYPE_2__** %3
%28 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %27, i32 0, i32 8
%29 = load i32, i32* %28
%30 = load %struct.TYPE_2__*, %struct.TYPE_2__** %3
%31 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %30, i32 0, i32 7
%32 = load i32, i32* %31
%33 = sext i32 %32 to i64
%34 = inttoptr i64 %33 to i8*
%35 = load %struct.TYPE_2__*, %struct.TYPE_2__** %3
%36 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %35, i32 0, i32 6
%37 = load i32, i32* %36
%38 = load %struct.TYPE_2__*, %struct.TYPE_2__** %3
%39 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %38, i32 0, i32 5
%40 = load i32, i32* %39
%41 = load %struct.TYPE_2__*, %struct.TYPE_2__** %3
%42 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %41, i32 0, i32 4
%43 = load i32, i32* %42
%44 = call i32 (i8*, i32, i32, i8*, i32, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.6, i64 0, i64 0), i32 %26, i32 %29, i8* %34, i32 %37, i32 %40, i32 %43)
%45 = load %struct.TYPE_2__*, %struct.TYPE_2__** %3
%46 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %45, i32 0, i32 1
%47 = load i32, i32* %46
%48 = load %struct.TYPE_2__*, %struct.TYPE_2__** %3
%49 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %48, i32 0, i32 3
%50 = load i32, i32* %49
%51 = load i8*, i8** %4
%52 = load %struct.TYPE_2__*, %struct.TYPE_2__** %3
%53 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %52, i32 0, i32 2
%54 = load i32, i32* %53
%55 = call i32 (i8*, i32, i32, i8*, i32, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.7, i64 0, i64 0), i32 %47, i32 %50, i8* %51, i32 %54)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"Above\00"
@.str.1 = [6 x i8] c"Below\00"
@.str.2 = [6 x i8] c"TopIf\00"
@.str.3 = [9 x i8] c"BottomIf\00"
@.str.4 = [9 x i8] c"Opposite\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [63 x i8] c" parent 0x%lx, window 0x%lx, (%d,%d), width %d, height %d,\0A\00"
@.str.7 = [58 x i8] c" border_width %d, above 0x%lx, detail %s, value 0x%lx\0A\00"
@reltable.do_ConfigureRequest = [5 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.2 to i64), i64 ptrtoint ([5 x i32]* @reltable.do_ConfigureRequest to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.4 to i64), i64 ptrtoint ([5 x i32]* @reltable.do_ConfigureRequest to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.3 to i64), i64 ptrtoint ([5 x i32]* @reltable.do_ConfigureRequest to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.1 to i64), i64 ptrtoint ([5 x i32]* @reltable.do_ConfigureRequest to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str to i64), i64 ptrtoint ([5 x i32]* @reltable.do_ConfigureRequest to i64)) to i32)]
define void @do_ConfigureRequest(i32* nocapture %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* %0
%5 = add i32 %4, -128
%6 = icmp ult i32 %5, 5
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %4)
br label %13
9: ; preds = %1
%10 = sext i32 %5 to i64
%11 = shl i64 %10, 2
%12 = call i8* @llvm.load.relative.i64(i8* bitcast ([5 x i32]* @reltable.do_ConfigureRequest to i8*), i64 %11)
br label %13
13: ; preds = %9, %7
%14 = phi i8* [ %3, %7 ], [ %12, %9 ]
%15 = getelementptr inbounds i32, i32* %0, i64 9
%16 = load i32, i32* %15
%17 = getelementptr inbounds i32, i32* %0, i64 8
%18 = load i32, i32* %17
%19 = getelementptr inbounds i32, i32* %0, i64 7
%20 = load i32, i32* %19
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i8*
%23 = getelementptr inbounds i32, i32* %0, i64 6
%24 = load i32, i32* %23
%25 = getelementptr inbounds i32, i32* %0, i64 5
%26 = load i32, i32* %25
%27 = getelementptr inbounds i32, i32* %0, i64 4
%28 = load i32, i32* %27
%29 = tail call i32 (i8*, i32, i32, i8*, i32, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.6, i64 0, i64 0), i32 %16, i32 %18, i8* %22, i32 %24, i32 %26, i32 %28)
%30 = getelementptr inbounds i32, i32* %0, i64 1
%31 = load i32, i32* %30
%32 = getelementptr inbounds i32, i32* %0, i64 3
%33 = load i32, i32* %32
%34 = getelementptr inbounds i32, i32* %0, i64 2
%35 = load i32, i32* %34
%36 = call i32 (i8*, i32, i32, i8*, i32, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.7, i64 0, i64 0), i32 %31, i32 %33, i8* %14, i32 %35)
ret void
}