#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*/ event;
};
typedef TYPE_1__ XCirculateEvent;

/* Variables and functions */
#define PlaceOnBottom 129
#define PlaceOnTop 128
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, int /*<<< orphan*/,
                          char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void do_CirculateNotify(XEvent *eventp) {
  XCirculateEvent *e = (XCirculateEvent *)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;
  }
  printf("    event 0x%lx, window 0x%lx, place %s\n", e->event, e->window, p);
}


x86 assembly (clang, -O0):
<do_CirculateNotify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
sub    $0x80,%eax
je     1160 <do_CirculateNotify+0x40>
jmp    114d <do_CirculateNotify+0x2d>
mov    -0x28(%rbp),%eax
sub    $0x81,%eax
je     1170 <do_CirculateNotify+0x50>
jmp    1180 <do_CirculateNotify+0x60>
lea    0xe99(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    119e <do_CirculateNotify+0x7e>
lea    0xe94(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    119e <do_CirculateNotify+0x7e>
lea    -0x22(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x22(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xe80(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%esi
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x18(%rbp),%rcx
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_CirculateNotify>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
mov    (%rdi),%edx
cmp    $0x80,%edx
je     1145 <do_CirculateNotify+0x25>
cmp    $0x81,%edx
jne    114e <do_CirculateNotify+0x2e>
lea    0xec8(%rip),%r14
jmp    1162 <do_CirculateNotify+0x42>
lea    0xeb4(%rip),%r14
jmp    1162 <do_CirculateNotify+0x42>
lea    0xe(%rsp),%r14
lea    0xebf(%rip),%rsi
mov    %r14,%rdi
call   1040 <sprintf@plt>
mov    0x4(%rbx),%edx
mov    0x8(%rbx),%esi
lea    0xead(%rip),%rdi
mov    %r14,%rcx
call   1030 <printf@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
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 = [41 x i8] c" event 0x%lx, window 0x%lx, place %s\0A\00"
define void @do_CirculateNotify(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 %13 [
i32 128, label %11
i32 129, label %12
]
11: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %4
br label %20
12: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8** %4
br label %20
13: ; preds = %1
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
store i8* %14, i8** %4
%15 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%16 = load %struct.TYPE_2__*, %struct.TYPE_2__** %3
%17 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %16, i32 0, i32 0
%18 = load i32, i32* %17
%19 = call i32 @sprintf(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %13, %12, %11
%21 = load %struct.TYPE_2__*, %struct.TYPE_2__** %3
%22 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %21, i32 0, i32 2
%23 = load i32, i32* %22
%24 = load %struct.TYPE_2__*, %struct.TYPE_2__** %3
%25 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %24, i32 0, i32 1
%26 = load i32, i32* %25
%27 = load i8*, i8** %4
%28 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i32 %23, i32 %26, i8* %27)
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 = [41 x i8] c" event 0x%lx, window 0x%lx, place %s\0A\00"
define void @do_CirculateNotify(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
switch i32 %4, label %6 [
i32 128, label %8
i32 129, label %5
]
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %4)
br label %8
8: ; preds = %1, %6, %5
%9 = phi i8* [ %3, %6 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), %5 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), %1 ]
%10 = getelementptr inbounds i32, i32* %0, i64 2
%11 = load i32, i32* %10
%12 = getelementptr inbounds i32, i32* %0, i64 1
%13 = load i32, i32* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i32 %11, i32 %13, i8* %9)
ret void
}