#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;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
#define Above 132
#define Below 131
#define BottomIf 130
#define Opposite 129
#define TopIf 128
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int,
                           int /*<<< orphan*/, char *, int /*<<< orphan*/, ...);
int /*<<< orphan*/ sprintf(char *, char *, int);
void do_ConfigureRequest(FILE *out_f, 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;
  }
  fprintf(out_f,
          "    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);
  fprintf(out_f, "    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    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x38(%rbp)
sub    $0x4,%eax
ja     11b4 <do_ConfigureRequest+0x94>
mov    -0x38(%rbp),%rax
lea    0xea5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xea9(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    11d2 <do_ConfigureRequest+0xb2>
lea    0xe9f(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    11d2 <do_ConfigureRequest+0xb2>
lea    0xe95(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    11d2 <do_ConfigureRequest+0xb2>
lea    0xe8b(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    11d2 <do_ConfigureRequest+0xb2>
lea    0xe84(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    11d2 <do_ConfigureRequest+0xb2>
lea    -0x2a(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x2a(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xe6b(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    0x24(%rax),%edx
mov    -0x18(%rbp),%rax
mov    0x20(%rax),%ecx
mov    -0x18(%rbp),%rax
movslq 0x1c(%rax),%r8
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%r9d
mov    -0x18(%rbp),%rax
mov    0x14(%rax),%r10d
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%eax
lea    0xe31(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x18(%rbp),%rax
mov    0xc(%rax),%ecx
mov    -0x20(%rbp),%r8
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%r9d
lea    0xe3c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_ConfigureRequest>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rsi),%edx
lea    -0x80(%rdx),%eax
cmp    $0x5,%eax
jae    114b <do_ConfigureRequest+0x2b>
cltq
lea    0xf5e(%rip),%rcx
movslq (%rcx,%rax,4),%r15
add    %rcx,%r15
jmp    115f <do_ConfigureRequest+0x3f>
lea    0x6(%rsp),%r15
lea    0xecd(%rip),%rsi
mov    %r15,%rdi
call   1040 <sprintf@plt>
mov    0x24(%rbx),%edx
mov    0x20(%rbx),%ecx
movslq 0x1c(%rbx),%r8
mov    0x18(%rbx),%r9d
mov    0x10(%rbx),%r10d
mov    0x14(%rbx),%r11d
lea    0xeab(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
push   %r10
push   %r11
call   1030 <fprintf@plt>
add    $0x10,%rsp
mov    0xc(%rbx),%ecx
mov    0x4(%rbx),%edx
mov    0x8(%rbx),%r9d
lea    0xec7(%rip),%rsi
mov    %r14,%rdi
mov    %r15,%r8
xor    %eax,%eax
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
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, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca %struct.TYPE_2__*
%6 = alloca i8*
%7 = alloca [10 x i8]
store i32* %0, i32** %3
store i32* %1, i32** %4
%8 = load i32*, i32** %4
%9 = bitcast i32* %8 to %struct.TYPE_2__*
store %struct.TYPE_2__* %9, %struct.TYPE_2__** %5
%10 = load %struct.TYPE_2__*, %struct.TYPE_2__** %5
%11 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %10, i32 0, i32 0
%12 = load i32, i32* %11
switch i32 %12, label %18 [
i32 132, label %13
i32 131, label %14
i32 128, label %15
i32 130, label %16
i32 129, label %17
]
13: ; preds = %2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %6
br label %25
14: ; preds = %2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %6
br label %25
15: ; preds = %2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %6
br label %25
16: ; preds = %2
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8** %6
br label %25
17: ; preds = %2
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8** %6
br label %25
18: ; preds = %2
%19 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
store i8* %19, i8** %6
%20 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%21 = load %struct.TYPE_2__*, %struct.TYPE_2__** %5
%22 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %21, i32 0, i32 0
%23 = load i32, i32* %22
%24 = call i32 @sprintf(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %18, %17, %16, %15, %14, %13
%26 = load i32*, i32** %3
%27 = load %struct.TYPE_2__*, %struct.TYPE_2__** %5
%28 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %27, i32 0, i32 9
%29 = load i32, i32* %28
%30 = load %struct.TYPE_2__*, %struct.TYPE_2__** %5
%31 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %30, i32 0, i32 8
%32 = load i32, i32* %31
%33 = load %struct.TYPE_2__*, %struct.TYPE_2__** %5
%34 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %33, i32 0, i32 7
%35 = load i32, i32* %34
%36 = sext i32 %35 to i64
%37 = inttoptr i64 %36 to i8*
%38 = load %struct.TYPE_2__*, %struct.TYPE_2__** %5
%39 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %38, i32 0, i32 6
%40 = load i32, i32* %39
%41 = load %struct.TYPE_2__*, %struct.TYPE_2__** %5
%42 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %41, i32 0, i32 5
%43 = load i32, i32* %42
%44 = load %struct.TYPE_2__*, %struct.TYPE_2__** %5
%45 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %44, i32 0, i32 4
%46 = load i32, i32* %45
%47 = call i32 (i32*, i8*, i32, i32, i8*, i32, ...) @fprintf(i32* %26, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.6, i64 0, i64 0), i32 %29, i32 %32, i8* %37, i32 %40, i32 %43, i32 %46)
%48 = load i32*, i32** %3
%49 = load %struct.TYPE_2__*, %struct.TYPE_2__** %5
%50 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %49, i32 0, i32 1
%51 = load i32, i32* %50
%52 = load %struct.TYPE_2__*, %struct.TYPE_2__** %5
%53 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %52, i32 0, i32 3
%54 = load i32, i32* %53
%55 = load i8*, i8** %6
%56 = load %struct.TYPE_2__*, %struct.TYPE_2__** %5
%57 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %56, i32 0, i32 2
%58 = load i32, i32* %57
%59 = call i32 (i32*, i8*, i32, i32, i8*, i32, ...) @fprintf(i32* %48, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.7, i64 0, i64 0), i32 %51, i32 %54, i8* %55, i32 %58)
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, i32* nocapture %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %1
%6 = add i32 %5, -128
%7 = icmp ult i32 %6, 5
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %5)
br label %14
10: ; preds = %2
%11 = sext i32 %6 to i64
%12 = shl i64 %11, 2
%13 = call i8* @llvm.load.relative.i64(i8* bitcast ([5 x i32]* @reltable.do_ConfigureRequest to i8*), i64 %12)
br label %14
14: ; preds = %10, %8
%15 = phi i8* [ %4, %8 ], [ %13, %10 ]
%16 = getelementptr inbounds i32, i32* %1, i64 9
%17 = load i32, i32* %16
%18 = getelementptr inbounds i32, i32* %1, i64 8
%19 = load i32, i32* %18
%20 = getelementptr inbounds i32, i32* %1, i64 7
%21 = load i32, i32* %20
%22 = sext i32 %21 to i64
%23 = inttoptr i64 %22 to i8*
%24 = getelementptr inbounds i32, i32* %1, i64 6
%25 = load i32, i32* %24
%26 = getelementptr inbounds i32, i32* %1, i64 5
%27 = load i32, i32* %26
%28 = getelementptr inbounds i32, i32* %1, i64 4
%29 = load i32, i32* %28
%30 = tail call i32 (i32*, i8*, i32, i32, i8*, i32, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.6, i64 0, i64 0), i32 %17, i32 %19, i8* %23, i32 %25, i32 %27, i32 %29)
%31 = getelementptr inbounds i32, i32* %1, i64 1
%32 = load i32, i32* %31
%33 = getelementptr inbounds i32, i32* %1, i64 3
%34 = load i32, i32* %33
%35 = getelementptr inbounds i32, i32* %1, i64 2
%36 = load i32, i32* %35
%37 = call i32 (i32*, i8*, i32, i32, i8*, i32, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.7, i64 0, i64 0), i32 %32, i32 %34, i8* %15, i32 %36)
ret void
}