#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 */
struct TYPE_2__ {
  int mode;
  int detail;
};
typedef TYPE_1__ XFocusChangeEvent;
typedef int /*<<< orphan*/ XEvent;

/* Variables and functions */
#define NotifyAncestor 139
#define NotifyDetailNone 138
#define NotifyGrab 137
#define NotifyInferior 136
#define NotifyNonlinear 135
#define NotifyNonlinearVirtual 134
#define NotifyNormal 133
#define NotifyPointer 132
#define NotifyPointerRoot 131
#define NotifyUngrab 130
#define NotifyVirtual 129
#define NotifyWhileGrabbed 128
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void do_FocusIn(XEvent *eventp) {
  XFocusChangeEvent *e = (XFocusChangeEvent *)eventp;
  char *mode, *detail;
  char dmode[10], ddetail[10];
  switch (e->mode) {
  case NotifyNormal:
    mode = "NotifyNormal";
    break;
  case NotifyGrab:
    mode = "NotifyGrab";
    break;
  case NotifyUngrab:
    mode = "NotifyUngrab";
    break;
  case NotifyWhileGrabbed:
    mode = "NotifyWhileGrabbed";
    break;
  default:
    mode = dmode, sprintf(dmode, "%u", e->mode);
    break;
  }
  switch (e->detail) {
  case NotifyAncestor:
    detail = "NotifyAncestor";
    break;
  case NotifyVirtual:
    detail = "NotifyVirtual";
    break;
  case NotifyInferior:
    detail = "NotifyInferior";
    break;
  case NotifyNonlinear:
    detail = "NotifyNonlinear";
    break;
  case NotifyNonlinearVirtual:
    detail = "NotifyNonlinearVirtual";
    break;
  case NotifyPointer:
    detail = "NotifyPointer";
    break;
  case NotifyPointerRoot:
    detail = "NotifyPointerRoot";
    break;
  case NotifyDetailNone:
    detail = "NotifyDetailNone";
    break;
  default:
    detail = ddetail;
    sprintf(ddetail, "%u", e->detail);
    break;
  }
  printf("    mode %s, detail %s\n", mode, detail);
}


x86 assembly (clang, -O0):
<do_FocusIn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%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,-0x40(%rbp)
sub    $0x9,%eax
ja     11a0 <do_FocusIn+0x80>
mov    -0x40(%rbp),%rax
lea    0xea9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xeed(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    11be <do_FocusIn+0x9e>
lea    0xeea(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    11be <do_FocusIn+0x9e>
lea    0xee5(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    11be <do_FocusIn+0x9e>
lea    0xee2(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    11be <do_FocusIn+0x9e>
lea    -0x2a(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x2a(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xed3(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
add    $0xffffff7f,%eax
mov    %eax,%ecx
mov    %rcx,-0x48(%rbp)
sub    $0xa,%eax
ja     126d <do_FocusIn+0x14d>
mov    -0x48(%rbp),%rax
lea    0xe44(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe9b(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    128c <do_FocusIn+0x16c>
lea    0xe9a(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    128c <do_FocusIn+0x16c>
lea    0xe98(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    128c <do_FocusIn+0x16c>
lea    0xe97(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    128c <do_FocusIn+0x16c>
lea    0xe97(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    128c <do_FocusIn+0x16c>
lea    0xe9e(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    128c <do_FocusIn+0x16c>
lea    0xe9c(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    128c <do_FocusIn+0x16c>
lea    0xe9e(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    128c <do_FocusIn+0x16c>
lea    -0x34(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x34(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edx
lea    0xe05(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_FocusIn>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
mov    (%rdi),%edx
lea    -0x80(%rdx),%eax
cmp    $0xa,%eax
jae    113e <do_FocusIn+0x1e>
mov    $0x225,%ecx
bt     %eax,%ecx
jb     1154 <do_FocusIn+0x34>
lea    0xe(%rsp),%r14
lea    0xeee(%rip),%rsi
mov    %r14,%rdi
call   1040 <sprintf@plt>
jmp    1164 <do_FocusIn+0x44>
cltq
lea    0xf7b(%rip),%rcx
movslq (%rcx,%rax,4),%r14
add    %rcx,%r14
mov    0x4(%rbx),%edx
lea    -0x81(%rdx),%eax
cmp    $0xb,%eax
jae    117c <do_FocusIn+0x5c>
mov    $0x6ed,%ecx
bt     %eax,%ecx
jb     1192 <do_FocusIn+0x72>
lea    0x4(%rsp),%rbx
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdi
call   1040 <sprintf@plt>
jmp    11a2 <do_FocusIn+0x82>
cltq
lea    0xf65(%rip),%rcx
movslq (%rcx,%rax,4),%rbx
add    %rcx,%rbx
lea    0xf16(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32, i32 }
@.str = [13 x i8] c"NotifyNormal\00"
@.str.1 = [11 x i8] c"NotifyGrab\00"
@.str.2 = [13 x i8] c"NotifyUngrab\00"
@.str.3 = [19 x i8] c"NotifyWhileGrabbed\00"
@.str.4 = [3 x i8] c"%u\00"
@.str.5 = [15 x i8] c"NotifyAncestor\00"
@.str.6 = [14 x i8] c"NotifyVirtual\00"
@.str.7 = [15 x i8] c"NotifyInferior\00"
@.str.8 = [16 x i8] c"NotifyNonlinear\00"
@.str.9 = [23 x i8] c"NotifyNonlinearVirtual\00"
@.str.10 = [14 x i8] c"NotifyPointer\00"
@.str.11 = [18 x i8] c"NotifyPointerRoot\00"
@.str.12 = [17 x i8] c"NotifyDetailNone\00"
@.str.13 = [24 x i8] c" mode %s, detail %s\0A\00"
define void @do_FocusIn(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.TYPE_2__*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca [10 x i8]
%7 = alloca [10 x i8]
store i32* %0, i32** %2
%8 = load i32*, i32** %2
%9 = bitcast i32* %8 to %struct.TYPE_2__*
store %struct.TYPE_2__* %9, %struct.TYPE_2__** %3
%10 = load %struct.TYPE_2__*, %struct.TYPE_2__** %3
%11 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %10, i32 0, i32 0
%12 = load i32, i32* %11
switch i32 %12, label %17 [
i32 133, label %13
i32 137, label %14
i32 130, label %15
i32 128, label %16
]
13: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %4
br label %24
14: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8** %4
br label %24
15: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8** %4
br label %24
16: ; preds = %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8** %4
br label %24
17: ; preds = %1
%18 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
store i8* %18, i8** %4
%19 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%20 = load %struct.TYPE_2__*, %struct.TYPE_2__** %3
%21 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %20, i32 0, i32 0
%22 = load i32, i32* %21
%23 = call i32 @sprintf(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %17, %16, %15, %14, %13
%25 = load %struct.TYPE_2__*, %struct.TYPE_2__** %3
%26 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %25, i32 0, i32 1
%27 = load i32, i32* %26
switch i32 %27, label %36 [
i32 139, label %28
i32 129, label %29
i32 136, label %30
i32 135, label %31
i32 134, label %32
i32 132, label %33
i32 131, label %34
i32 138, label %35
]
28: ; preds = %24
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8** %5
br label %43
29: ; preds = %24
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8** %5
br label %43
30: ; preds = %24
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i8** %5
br label %43
31: ; preds = %24
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i8** %5
br label %43
32: ; preds = %24
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i8** %5
br label %43
33: ; preds = %24
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i8** %5
br label %43
34: ; preds = %24
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i8** %5
br label %43
35: ; preds = %24
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0), i8** %5
br label %43
36: ; preds = %24
%37 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
store i8* %37, i8** %5
%38 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%39 = load %struct.TYPE_2__*, %struct.TYPE_2__** %3
%40 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %39, i32 0, i32 1
%41 = load i32, i32* %40
%42 = call i32 @sprintf(i8* %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %41)
br label %43
43: ; preds = %36, %35, %34, %33, %32, %31, %30, %29, %28
%44 = load i8*, i8** %4
%45 = load i8*, i8** %5
%46 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.13, i64 0, i64 0), i8* %44, i8* %45)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"NotifyNormal\00"
@.str.1 = [11 x i8] c"NotifyGrab\00"
@.str.2 = [13 x i8] c"NotifyUngrab\00"
@.str.3 = [19 x i8] c"NotifyWhileGrabbed\00"
@.str.4 = [3 x i8] c"%u\00"
@.str.5 = [15 x i8] c"NotifyAncestor\00"
@.str.6 = [14 x i8] c"NotifyVirtual\00"
@.str.7 = [15 x i8] c"NotifyInferior\00"
@.str.8 = [16 x i8] c"NotifyNonlinear\00"
@.str.9 = [23 x i8] c"NotifyNonlinearVirtual\00"
@.str.10 = [14 x i8] c"NotifyPointer\00"
@.str.11 = [18 x i8] c"NotifyPointerRoot\00"
@.str.12 = [17 x i8] c"NotifyDetailNone\00"
@.str.13 = [24 x i8] c" mode %s, detail %s\0A\00"
@reltable.do_FocusIn = [10 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.3 to i64), i64 ptrtoint ([10 x i32]* @reltable.do_FocusIn to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str to i64), i64 ptrtoint ([10 x i32]* @reltable.do_FocusIn to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.2 to i64), i64 ptrtoint ([10 x i32]* @reltable.do_FocusIn to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str to i64), i64 ptrtoint ([10 x i32]* @reltable.do_FocusIn to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str to i64), i64 ptrtoint ([10 x i32]* @reltable.do_FocusIn to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str to i64), i64 ptrtoint ([10 x i32]* @reltable.do_FocusIn to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str to i64), i64 ptrtoint ([10 x i32]* @reltable.do_FocusIn to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str to i64), i64 ptrtoint ([10 x i32]* @reltable.do_FocusIn to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str to i64), i64 ptrtoint ([10 x i32]* @reltable.do_FocusIn to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.1 to i64), i64 ptrtoint ([10 x i32]* @reltable.do_FocusIn to i64)) to i32)]
@reltable.do_FocusIn.15 = [11 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.6 to i64), i64 ptrtoint ([11 x i32]* @reltable.do_FocusIn.15 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str.5 to i64), i64 ptrtoint ([11 x i32]* @reltable.do_FocusIn.15 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str.11 to i64), i64 ptrtoint ([11 x i32]* @reltable.do_FocusIn.15 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.10 to i64), i64 ptrtoint ([11 x i32]* @reltable.do_FocusIn.15 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str.5 to i64), i64 ptrtoint ([11 x i32]* @reltable.do_FocusIn.15 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([23 x i8]* @.str.9 to i64), i64 ptrtoint ([11 x i32]* @reltable.do_FocusIn.15 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([16 x i8]* @.str.8 to i64), i64 ptrtoint ([11 x i32]* @reltable.do_FocusIn.15 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str.7 to i64), i64 ptrtoint ([11 x i32]* @reltable.do_FocusIn.15 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str.5 to i64), i64 ptrtoint ([11 x i32]* @reltable.do_FocusIn.15 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @.str.12 to i64), i64 ptrtoint ([11 x i32]* @reltable.do_FocusIn.15 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str.5 to i64), i64 ptrtoint ([11 x i32]* @reltable.do_FocusIn.15 to i64)) to i32)]
define void @do_FocusIn(i32* nocapture %0) {
%2 = alloca [10 x i8]
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%6 = load i32, i32* %0
%7 = add i32 %6, -128
%8 = icmp ult i32 %7, 10
br i1 %8, label %11, label %9
9: ; preds = %11, %1
%10 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %6)
br label %20
11: ; preds = %1
%12 = trunc i32 %7 to i16
%13 = lshr i16 549, %12
%14 = and i16 %13, 1
%15 = icmp eq i16 %14, 0
br i1 %15, label %9, label %16
16: ; preds = %11
%17 = sext i32 %7 to i64
%18 = shl i64 %17, 2
%19 = call i8* @llvm.load.relative.i64(i8* bitcast ([10 x i32]* @reltable.do_FocusIn to i8*), i64 %18)
br label %20
20: ; preds = %16, %9
%21 = phi i8* [ %4, %9 ], [ %19, %16 ]
%22 = getelementptr inbounds i32, i32* %0, i64 1
%23 = load i32, i32* %22
%24 = add i32 %23, -129
%25 = icmp ult i32 %24, 11
br i1 %25, label %28, label %26
26: ; preds = %28, %20
%27 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %23)
br label %37
28: ; preds = %20
%29 = trunc i32 %24 to i16
%30 = lshr i16 1773, %29
%31 = and i16 %30, 1
%32 = icmp eq i16 %31, 0
br i1 %32, label %26, label %33
33: ; preds = %28
%34 = sext i32 %24 to i64
%35 = shl i64 %34, 2
%36 = call i8* @llvm.load.relative.i64(i8* bitcast ([11 x i32]* @reltable.do_FocusIn.15 to i8*), i64 %35)
br label %37
37: ; preds = %33, %26
%38 = phi i8* [ %5, %26 ], [ %36, %33 ]
%39 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.13, i64 0, i64 0), i8* %21, i8* %38)
ret void
}