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

/* 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*/ fprintf(int /*<<< orphan*/ *, char *, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void do_FocusIn(FILE *out_f, 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;
  }
  fprintf(out_f, "    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    %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,-0x48(%rbp)
sub    $0x9,%eax
ja     11a4 <do_FocusIn+0x84>
mov    -0x48(%rbp),%rax
lea    0xea5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xee9(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    11c2 <do_FocusIn+0xa2>
lea    0xee6(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    11c2 <do_FocusIn+0xa2>
lea    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    11c2 <do_FocusIn+0xa2>
lea    0xede(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    11c2 <do_FocusIn+0xa2>
lea    -0x32(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x32(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xecf(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
add    $0xffffff7f,%eax
mov    %eax,%ecx
mov    %rcx,-0x50(%rbp)
sub    $0xa,%eax
ja     1271 <do_FocusIn+0x151>
mov    -0x50(%rbp),%rax
lea    0xe40(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe97(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    1290 <do_FocusIn+0x170>
lea    0xe96(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    1290 <do_FocusIn+0x170>
lea    0xe94(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    1290 <do_FocusIn+0x170>
lea    0xe93(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    1290 <do_FocusIn+0x170>
lea    0xe93(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    1290 <do_FocusIn+0x170>
lea    0xe9a(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    1290 <do_FocusIn+0x170>
lea    0xe98(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    1290 <do_FocusIn+0x170>
lea    0xe9a(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    1290 <do_FocusIn+0x170>
lea    -0x3c(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x3c(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%edx
lea    0xe01(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
lea    0xe70(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_FocusIn>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rsi),%edx
lea    -0x80(%rdx),%eax
cmp    $0xa,%eax
jae    1143 <do_FocusIn+0x23>
mov    $0x225,%ecx
bt     %eax,%ecx
jb     1159 <do_FocusIn+0x39>
lea    0x16(%rsp),%r15
lea    0xee9(%rip),%rsi
mov    %r15,%rdi
call   1040 <sprintf@plt>
jmp    1169 <do_FocusIn+0x49>
cltq
lea    0xf76(%rip),%rcx
movslq (%rcx,%rax,4),%r15
add    %rcx,%r15
mov    0x4(%rbx),%edx
lea    -0x81(%rdx),%eax
cmp    $0xb,%eax
jae    1181 <do_FocusIn+0x61>
mov    $0x6ed,%ecx
bt     %eax,%ecx
jb     1197 <do_FocusIn+0x77>
lea    0xc(%rsp),%rbx
lea    0xeab(%rip),%rsi
mov    %rbx,%rdi
call   1040 <sprintf@plt>
jmp    11a7 <do_FocusIn+0x87>
cltq
lea    0xf60(%rip),%rcx
movslq (%rcx,%rax,4),%rbx
add    %rcx,%rbx
lea    0xf11(%rip),%rsi
mov    %r14,%rdi
mov    %r15,%rdx
mov    %rbx,%rcx
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
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, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca %struct.TYPE_2__*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca [10 x i8]
%9 = alloca [10 x i8]
store i32* %0, i32** %3
store i32* %1, i32** %4
%10 = load i32*, i32** %4
%11 = bitcast i32* %10 to %struct.TYPE_2__*
store %struct.TYPE_2__* %11, %struct.TYPE_2__** %5
%12 = load %struct.TYPE_2__*, %struct.TYPE_2__** %5
%13 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %12, i32 0, i32 0
%14 = load i32, i32* %13
switch i32 %14, label %19 [
i32 133, label %15
i32 137, label %16
i32 130, label %17
i32 128, label %18
]
15: ; preds = %2
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %6
br label %26
16: ; preds = %2
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8** %6
br label %26
17: ; preds = %2
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8** %6
br label %26
18: ; preds = %2
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8** %6
br label %26
19: ; preds = %2
%20 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
store i8* %20, i8** %6
%21 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%22 = load %struct.TYPE_2__*, %struct.TYPE_2__** %5
%23 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %22, i32 0, i32 0
%24 = load i32, i32* %23
%25 = call i32 @sprintf(i8* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %24)
br label %26
26: ; preds = %19, %18, %17, %16, %15
%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
switch i32 %29, label %38 [
i32 139, label %30
i32 129, label %31
i32 136, label %32
i32 135, label %33
i32 134, label %34
i32 132, label %35
i32 131, label %36
i32 138, label %37
]
30: ; preds = %26
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8** %7
br label %45
31: ; preds = %26
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8** %7
br label %45
32: ; preds = %26
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i8** %7
br label %45
33: ; preds = %26
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i8** %7
br label %45
34: ; preds = %26
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i8** %7
br label %45
35: ; preds = %26
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i8** %7
br label %45
36: ; preds = %26
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i8** %7
br label %45
37: ; preds = %26
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0), i8** %7
br label %45
38: ; preds = %26
%39 = getelementptr inbounds [10 x i8], [10 x i8]* %9, i64 0, i64 0
store i8* %39, i8** %7
%40 = getelementptr inbounds [10 x i8], [10 x i8]* %9, i64 0, i64 0
%41 = load %struct.TYPE_2__*, %struct.TYPE_2__** %5
%42 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %41, i32 0, i32 1
%43 = load i32, i32* %42
%44 = call i32 @sprintf(i8* %40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %43)
br label %45
45: ; preds = %38, %37, %36, %35, %34, %33, %32, %31, %30
%46 = load i32*, i32** %3
%47 = load i8*, i8** %6
%48 = load i8*, i8** %7
%49 = call i32 @fprintf(i32* %46, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.13, i64 0, i64 0), i8* %47, i8* %48)
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, i32* nocapture %1) {
%3 = alloca [10 x i8]
%4 = alloca [10 x i8]
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%7 = load i32, i32* %1
%8 = add i32 %7, -128
%9 = icmp ult i32 %8, 10
br i1 %9, label %12, label %10
10: ; preds = %12, %2
%11 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %7)
br label %21
12: ; preds = %2
%13 = trunc i32 %8 to i16
%14 = lshr i16 549, %13
%15 = and i16 %14, 1
%16 = icmp eq i16 %15, 0
br i1 %16, label %10, label %17
17: ; preds = %12
%18 = sext i32 %8 to i64
%19 = shl i64 %18, 2
%20 = call i8* @llvm.load.relative.i64(i8* bitcast ([10 x i32]* @reltable.do_FocusIn to i8*), i64 %19)
br label %21
21: ; preds = %17, %10
%22 = phi i8* [ %5, %10 ], [ %20, %17 ]
%23 = getelementptr inbounds i32, i32* %1, i64 1
%24 = load i32, i32* %23
%25 = add i32 %24, -129
%26 = icmp ult i32 %25, 11
br i1 %26, label %29, label %27
27: ; preds = %29, %21
%28 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %24)
br label %38
29: ; preds = %21
%30 = trunc i32 %25 to i16
%31 = lshr i16 1773, %30
%32 = and i16 %31, 1
%33 = icmp eq i16 %32, 0
br i1 %33, label %27, label %34
34: ; preds = %29
%35 = sext i32 %25 to i64
%36 = shl i64 %35, 2
%37 = call i8* @llvm.load.relative.i64(i8* bitcast ([11 x i32]* @reltable.do_FocusIn.15 to i8*), i64 %36)
br label %38
38: ; preds = %34, %27
%39 = phi i8* [ %6, %27 ], [ %37, %34 ]
%40 = call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.13, i64 0, i64 0), i8* %22, i8* %39)
ret void
}