#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 place;
  int /*<<< orphan*/ window;
  int /*<<< orphan*/ parent;
};
typedef TYPE_1__ XCirculateRequestEvent;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
#define PlaceOnBottom 129
#define PlaceOnTop 128
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int /*<<< orphan*/,
                           int /*<<< orphan*/, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void do_CirculateRequest(FILE *out_f, XEvent *eventp) {
  XCirculateRequestEvent *e = (XCirculateRequestEvent *)eventp;
  char *p;
  char pdummy[10];
  switch (e->place) {
  case PlaceOnTop:
    p = "PlaceOnTop";
    break;
  case PlaceOnBottom:
    p = "PlaceOnBottom";
    break;
  default:
    p = pdummy;
    sprintf(pdummy, "%d", e->place);
    break;
  }
  fprintf(out_f, "    parent 0x%lx, window 0x%lx, place %s\n", e->parent,
          e->window, p);
}


x86 assembly (clang, -O0):
<do_CirculateRequest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
sub    $0x80,%eax
je     1164 <do_CirculateRequest+0x44>
jmp    1151 <do_CirculateRequest+0x31>
mov    -0x30(%rbp),%eax
sub    $0x81,%eax
je     1174 <do_CirculateRequest+0x54>
jmp    1184 <do_CirculateRequest+0x64>
lea    0xe95(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    11a2 <do_CirculateRequest+0x82>
lea    0xe90(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    11a2 <do_CirculateRequest+0x82>
lea    -0x2a(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x2a(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xe7c(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%edx
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x20(%rbp),%r8
lea    0xe5d(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_CirculateRequest>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rsi),%edx
cmp    $0x80,%edx
je     114a <do_CirculateRequest+0x2a>
cmp    $0x81,%edx
jne    1153 <do_CirculateRequest+0x33>
lea    0xec3(%rip),%r15
jmp    1167 <do_CirculateRequest+0x47>
lea    0xeaf(%rip),%r15
jmp    1167 <do_CirculateRequest+0x47>
lea    0x6(%rsp),%r15
lea    0xeba(%rip),%rsi
mov    %r15,%rdi
call   1040 <sprintf@plt>
mov    0x4(%rbx),%ecx
mov    0x8(%rbx),%edx
lea    0xea8(%rip),%rsi
mov    %r14,%rdi
mov    %r15,%r8
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32, i32, i32 }
@.str = [11 x i8] c"PlaceOnTop\00"
@.str.1 = [14 x i8] c"PlaceOnBottom\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [42 x i8] c" parent 0x%lx, window 0x%lx, place %s\0A\00"
define void @do_CirculateRequest(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 %15 [
i32 128, label %13
i32 129, label %14
]
13: ; preds = %2
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %6
br label %22
14: ; preds = %2
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8** %6
br label %22
15: ; preds = %2
%16 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
store i8* %16, i8** %6
%17 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%18 = load %struct.TYPE_2__*, %struct.TYPE_2__** %5
%19 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %18, i32 0, i32 0
%20 = load i32, i32* %19
%21 = call i32 @sprintf(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %20)
br label %22
22: ; preds = %15, %14, %13
%23 = load i32*, i32** %3
%24 = load %struct.TYPE_2__*, %struct.TYPE_2__** %5
%25 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %24, i32 0, i32 2
%26 = load i32, i32* %25
%27 = load %struct.TYPE_2__*, %struct.TYPE_2__** %5
%28 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %27, i32 0, i32 1
%29 = load i32, i32* %28
%30 = load i8*, i8** %6
%31 = call i32 @fprintf(i32* %23, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i32 %26, i32 %29, i8* %30)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"PlaceOnTop\00"
@.str.1 = [14 x i8] c"PlaceOnBottom\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [42 x i8] c" parent 0x%lx, window 0x%lx, place %s\0A\00"
define void @do_CirculateRequest(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
switch i32 %5, label %7 [
i32 128, label %9
i32 129, label %6
]
6: ; preds = %2
br label %9
7: ; preds = %2
%8 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %5)
br label %9
9: ; preds = %2, %7, %6
%10 = phi i8* [ %4, %7 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), %6 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), %2 ]
%11 = getelementptr inbounds i32, i32* %1, i64 2
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %1, i64 1
%14 = load i32, i32* %13
%15 = call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i32 %12, i32 %14, i8* %10)
ret void
}