#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_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  void *same_screen;
  void *keycode;
  int /*<<< orphan*/ *state;
  void *subwindow;
  void *window;
  int /*<<< orphan*/ *display;
  int /*<<< orphan*/ type;
};
typedef TYPE_1__ XKeyReleasedEvent;
typedef TYPE_1__ XKeyPressedEvent;
typedef void *Window;
typedef int /*<<< orphan*/ KeySym;
typedef void *KeyCode;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ False;
int /*<<< orphan*/ KeyPress;
int /*<<< orphan*/ KeyRelease;
void *None;
void *True;
int /*<<< orphan*/ XFlush(int /*<<< orphan*/ *);
int /*<<< orphan*/ XK_0;
int /*<<< orphan*/ XK_1;
int /*<<< orphan*/ XK_2;
int /*<<< orphan*/ XK_3;
int /*<<< orphan*/ XK_4;
int /*<<< orphan*/ XK_5;
int /*<<< orphan*/ XK_6;
int /*<<< orphan*/ XK_7;
int /*<<< orphan*/ XK_8;
int /*<<< orphan*/ XK_9;
int /*<<< orphan*/ XK_a;
int /*<<< orphan*/ XK_g;
void *XKeysymToKeycode(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ *XOpenDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ XSendEvent(int /*<<< orphan*/ *, void *, int /*<<< orphan*/,
                              int /*<<< orphan*/ *, TYPE_1__ *);
scalar_t__ atoi(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int iArgc, char *asArgv[]) {
  char *cmd;
  Display *pDisplay;
  KeyCode A_KeyCode;
  KeySym kasy;
  XKeyPressedEvent KeyPressEvent;
  XKeyReleasedEvent KeyReleaseEvent;
  Window Target;
  int iDummy, i;
  if (iArgc != 3) {
    printf("Usage: %s <winid> <string>\n", asArgv[0]);
    return 0;
  }
  Target = (Window)atoi(asArgv[1]);
  cmd = asArgv[2];
  pDisplay = XOpenDisplay(NULL);
  while (*cmd != '\0') {
    switch (*cmd) {
    case '0':
      kasy = XK_0;
      break;
    case '1':
      kasy = XK_1;
      break;
    case '2':
      kasy = XK_2;
      break;
    case '3':
      kasy = XK_3;
      break;
    case '4':
      kasy = XK_4;
      break;
    case '5':
      kasy = XK_5;
      break;
    case '6':
      kasy = XK_6;
      break;
    case '7':
      kasy = XK_7;
      break;
    case '8':
      kasy = XK_8;
      break;
    case '9':
      kasy = XK_9;
      break;
    case 'a':
      kasy = XK_a;
      break;
    case 'g':
      kasy = XK_g;
      break;
    }
    A_KeyCode = XKeysymToKeycode(pDisplay, kasy);
    KeyPressEvent.type = KeyPress;
    KeyPressEvent.display = pDisplay;
    KeyPressEvent.window = Target;
    KeyPressEvent.subwindow = None;
    KeyPressEvent.state = NULL;
    KeyPressEvent.keycode = A_KeyCode;
    KeyPressEvent.same_screen = True;
    KeyReleaseEvent.type = KeyRelease;
    KeyReleaseEvent.display = pDisplay;
    KeyReleaseEvent.window = Target;
    KeyReleaseEvent.subwindow = None;
    KeyReleaseEvent.state = NULL;
    KeyReleaseEvent.keycode = A_KeyCode;
    KeyReleaseEvent.same_screen = True;
    XSendEvent(pDisplay, Target, False, NULL, &KeyPressEvent);
    XSendEvent(pDisplay, Target, False, NULL, &KeyReleaseEvent);
    XFlush(pDisplay);
    cmd++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11a2 <main+0x42>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xf4f(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    13f1 <main+0x291>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1080 <atoi@plt>
mov    %rax,-0xa8(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <XOpenDisplay@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     13ea <main+0x28a>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
add    $0xffffffd0,%eax
mov    %eax,%ecx
mov    %rcx,-0xb8(%rbp)
sub    $0x37,%eax
ja     12d9 <main+0x179>
mov    -0xb8(%rbp),%rax
lea    0xdf7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2d57(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
jmp    12d9 <main+0x179>
mov    0x2d96(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
jmp    12d9 <main+0x179>
mov    0x2d3d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
jmp    12d9 <main+0x179>
mov    0x2d6c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
jmp    12d9 <main+0x179>
mov    0x2d0b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
jmp    12d9 <main+0x179>
mov    0x2d42(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
jmp    12d9 <main+0x179>
mov    0x2ce1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
jmp    12d9 <main+0x179>
mov    0x2d18(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
jmp    12d9 <main+0x179>
mov    0x2cb7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
jmp    12d9 <main+0x179>
mov    0x2ce6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
jmp    12d9 <main+0x179>
mov    0x2d05(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
jmp    12d9 <main+0x179>
mov    0x2d0c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x2c(%rbp),%esi
call   1060 <XKeysymToKeycode@plt>
mov    %rax,-0x28(%rbp)
mov    0x2cb0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0xa8(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    0x2cc9(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x50(%rbp)
movq   $0x0,-0x58(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    0x2ca3(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x68(%rbp)
mov    0x2c4d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x70(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0xa8(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    0x2c7e(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x88(%rbp)
movq   $0x0,-0x90(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    0x2c4f(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0xa8(%rbp),%rsi
mov    0x2c4b(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x68(%rbp),%r8
call   1030 <XSendEvent@plt>
mov    -0x20(%rbp),%rdi
mov    -0xa8(%rbp),%rsi
mov    0x2c2a(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%ecx
lea    -0xa0(%rbp),%r8
call   1030 <XSendEvent@plt>
mov    -0x20(%rbp),%rdi
call   1070 <XFlush@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    11cf <main+0x6f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rsi,%rbp
cmp    $0x3,%edi
jne    1309 <main+0x1a9>
mov    0x8(%rbp),%rdi
call   1080 <atoi@plt>
mov    %rax,%rbx
mov    0x10(%rbp),%r14
xor    %edi,%edi
call   1050 <XOpenDisplay@plt>
mov    %rax,%rbp
mov    (%r14),%cl
mov    $0x1,%eax
test   %cl,%cl
je     131b <main+0x1bb>
add    $0x1,%r14
mov    0x2e39(%rip),%r15
lea    0xe4a(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
movsbl %cl,%eax
add    $0xffffffd0,%eax
cmp    $0x37,%eax
ja     1243 <main+0xe3>
movslq (%r12,%rax,4),%rax
add    %r12,%rax
jmp    *%rax
mov    0x2d95(%rip),%rax
jmp    1240 <main+0xe0>
mov    0x2ddc(%rip),%rax
jmp    1240 <main+0xe0>
mov    0x2d8b(%rip),%rax
jmp    1240 <main+0xe0>
mov    0x2dc2(%rip),%rax
jmp    1240 <main+0xe0>
mov    0x2d69(%rip),%rax
jmp    1240 <main+0xe0>
mov    0x2da8(%rip),%rax
jmp    1240 <main+0xe0>
mov    0x2d4f(%rip),%rax
jmp    1240 <main+0xe0>
mov    0x2d8e(%rip),%rax
jmp    1240 <main+0xe0>
mov    0x2d35(%rip),%rax
jmp    1240 <main+0xe0>
mov    0x2d6c(%rip),%rax
jmp    1240 <main+0xe0>
mov    0x2d93(%rip),%rax
jmp    1240 <main+0xe0>
mov    0x2da2(%rip),%rax
xchg   %ax,%ax
mov    (%rax),%r13d
mov    %rbp,%rdi
mov    %r13d,%esi
call   1060 <XKeysymToKeycode@plt>
mov    0x2d4b(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,0x70(%rsp)
mov    %rbp,0x68(%rsp)
mov    %rbx,0x60(%rsp)
mov    0x2d6c(%rip),%rcx
mov    (%rcx),%rcx
mov    %rcx,0x58(%rsp)
movq   $0x0,0x50(%rsp)
mov    %rax,0x48(%rsp)
mov    0x2d47(%rip),%rdx
mov    (%rdx),%rdx
mov    %rdx,0x40(%rsp)
mov    0x2cf0(%rip),%rsi
mov    (%rsi),%esi
mov    %esi,0x38(%rsp)
mov    %rbp,0x30(%rsp)
mov    %rbx,0x28(%rsp)
mov    %rcx,0x20(%rsp)
movq   $0x0,0x18(%rsp)
mov    %rax,0x10(%rsp)
mov    %rdx,0x8(%rsp)
mov    (%r15),%edx
mov    %rbp,%rdi
mov    %rbx,%rsi
xor    %ecx,%ecx
lea    0x40(%rsp),%r8
call   1030 <XSendEvent@plt>
mov    (%r15),%edx
mov    %rbp,%rdi
mov    %rbx,%rsi
xor    %ecx,%ecx
lea    0x8(%rsp),%r8
call   1030 <XSendEvent@plt>
mov    %rbp,%rdi
call   1070 <XFlush@plt>
movzbl (%r14),%ecx
add    $0x1,%r14
test   %cl,%cl
jne    11c0 <main+0x60>
mov    $0x1,%eax
jmp    131b <main+0x1bb>
mov    0x0(%rbp),%rsi
lea    0xdcc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { i8*, i8*, i32*, i8*, i8*, i32*, i32 }
@.str = [28 x i8] c"Usage: %s <winid> <string>\0A\00"
@XK_0 = global i32 0
@XK_1 = global i32 0
@XK_2 = global i32 0
@XK_3 = global i32 0
@XK_4 = global i32 0
@XK_5 = global i32 0
@XK_6 = global i32 0
@XK_7 = global i32 0
@XK_8 = global i32 0
@XK_9 = global i32 0
@XK_a = global i32 0
@XK_g = global i32 0
@KeyPress = global i32 0
@None = global i8* null
@True = global i8* null
@KeyRelease = global i32 0
@False = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca %struct.TYPE_4__
%11 = alloca %struct.TYPE_4__
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i32, i32* %4
%16 = icmp ne i32 %15, 3
br i1 %16, label %17, label %22
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 0
%20 = load i8*, i8** %19
%21 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %20)
store i32 0, i32* %3
br label %108
22: ; preds = %2
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i64 @atoi(i8* %25)
%27 = inttoptr i64 %26 to i8*
store i8* %27, i8** %12
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 2
%30 = load i8*, i8** %29
store i8* %30, i8** %6
%31 = call i32* @XOpenDisplay(i32* null)
store i32* %31, i32** %7
br label %32
32: ; preds = %65, %22
%33 = load i8*, i8** %6
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp ne i32 %35, 0
br i1 %36, label %37, label %107
37: ; preds = %32
%38 = load i8*, i8** %6
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
switch i32 %40, label %65 [
i32 48, label %41
i32 49, label %43
i32 50, label %45
i32 51, label %47
i32 52, label %49
i32 53, label %51
i32 54, label %53
i32 55, label %55
i32 56, label %57
i32 57, label %59
i32 97, label %61
i32 103, label %63
]
41: ; preds = %37
%42 = load i32, i32* @XK_0
store i32 %42, i32* %9
br label %65
43: ; preds = %37
%44 = load i32, i32* @XK_1
store i32 %44, i32* %9
br label %65
45: ; preds = %37
%46 = load i32, i32* @XK_2
store i32 %46, i32* %9
br label %65
47: ; preds = %37
%48 = load i32, i32* @XK_3
store i32 %48, i32* %9
br label %65
49: ; preds = %37
%50 = load i32, i32* @XK_4
store i32 %50, i32* %9
br label %65
51: ; preds = %37
%52 = load i32, i32* @XK_5
store i32 %52, i32* %9
br label %65
53: ; preds = %37
%54 = load i32, i32* @XK_6
store i32 %54, i32* %9
br label %65
55: ; preds = %37
%56 = load i32, i32* @XK_7
store i32 %56, i32* %9
br label %65
57: ; preds = %37
%58 = load i32, i32* @XK_8
store i32 %58, i32* %9
br label %65
59: ; preds = %37
%60 = load i32, i32* @XK_9
store i32 %60, i32* %9
br label %65
61: ; preds = %37
%62 = load i32, i32* @XK_a
store i32 %62, i32* %9
br label %65
63: ; preds = %37
%64 = load i32, i32* @XK_g
store i32 %64, i32* %9
br label %65
65: ; preds = %37, %63, %61, %59, %57, %55, %53, %51, %49, %47, %45, %43, %41
%66 = load i32*, i32** %7
%67 = load i32, i32* %9
%68 = call i8* @XKeysymToKeycode(i32* %66, i32 %67)
store i8* %68, i8** %8
%69 = load i32, i32* @KeyPress
%70 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i32 0, i32 6
store i32 %69, i32* %70
%71 = load i32*, i32** %7
%72 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i32 0, i32 5
store i32* %71, i32** %72
%73 = load i8*, i8** %12
%74 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i32 0, i32 4
store i8* %73, i8** %74
%75 = load i8*, i8** @None
%76 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i32 0, i32 3
store i8* %75, i8** %76
%77 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i32 0, i32 2
store i32* null, i32** %77
%78 = load i8*, i8** %8
%79 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i32 0, i32 1
store i8* %78, i8** %79
%80 = load i8*, i8** @True
%81 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i32 0, i32 0
store i8* %80, i8** %81
%82 = load i32, i32* @KeyRelease
%83 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %11, i32 0, i32 6
store i32 %82, i32* %83
%84 = load i32*, i32** %7
%85 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %11, i32 0, i32 5
store i32* %84, i32** %85
%86 = load i8*, i8** %12
%87 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %11, i32 0, i32 4
store i8* %86, i8** %87
%88 = load i8*, i8** @None
%89 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %11, i32 0, i32 3
store i8* %88, i8** %89
%90 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %11, i32 0, i32 2
store i32* null, i32** %90
%91 = load i8*, i8** %8
%92 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %11, i32 0, i32 1
store i8* %91, i8** %92
%93 = load i8*, i8** @True
%94 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %11, i32 0, i32 0
store i8* %93, i8** %94
%95 = load i32*, i32** %7
%96 = load i8*, i8** %12
%97 = load i32, i32* @False
%98 = call i32 @XSendEvent(i32* %95, i8* %96, i32 %97, i32* null, %struct.TYPE_4__* %10)
%99 = load i32*, i32** %7
%100 = load i8*, i8** %12
%101 = load i32, i32* @False
%102 = call i32 @XSendEvent(i32* %99, i8* %100, i32 %101, i32* null, %struct.TYPE_4__* %11)
%103 = load i32*, i32** %7
%104 = call i32 @XFlush(i32* %103)
%105 = load i8*, i8** %6
%106 = getelementptr inbounds i8, i8* %105, i32 1
store i8* %106, i8** %6
br label %32
107: ; preds = %32
store i32 1, i32* %3
br label %108
108: ; preds = %107, %17
%109 = load i32, i32* %3
ret i32 %109
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i8*, i8*, i32*, i8*, i8*, i32*, i32 }
@.str = [28 x i8] c"Usage: %s <winid> <string>\0A\00"
@XK_0 = global i32 0
@XK_1 = global i32 0
@XK_2 = global i32 0
@XK_3 = global i32 0
@XK_4 = global i32 0
@XK_5 = global i32 0
@XK_6 = global i32 0
@XK_7 = global i32 0
@XK_8 = global i32 0
@XK_9 = global i32 0
@XK_a = global i32 0
@XK_g = global i32 0
@KeyPress = global i32 0
@None = global i8* null
@True = global i8* null
@KeyRelease = global i32 0
@False = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.TYPE_4__
%4 = alloca %struct.TYPE_4__
%5 = bitcast %struct.TYPE_4__* %3 to i8*
%6 = bitcast %struct.TYPE_4__* %4 to i8*
%7 = icmp eq i32 %0, 3
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i8*, i8** %1
%10 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %80
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = tail call i64 @atoi(i8* %13)
%15 = inttoptr i64 %14 to i8*
%16 = getelementptr inbounds i8*, i8** %1, i64 2
%17 = load i8*, i8** %16
%18 = tail call i32* @XOpenDisplay(i32* null)
%19 = load i8, i8* %17
%20 = icmp eq i8 %19, 0
br i1 %20, label %80, label %21
21: ; preds = %11
%22 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i64 0, i32 6
%23 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i64 0, i32 5
%24 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i64 0, i32 4
%25 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i64 0, i32 3
%26 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i64 0, i32 2
%27 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i64 0, i32 1
%28 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i64 0, i32 0
%29 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i64 0, i32 6
%30 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i64 0, i32 5
%31 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i64 0, i32 4
%32 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i64 0, i32 3
%33 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i64 0, i32 2
%34 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i64 0, i32 1
%35 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i64 0, i32 0
br label %36
36: ; preds = %21, %65
%37 = phi i8 [ %19, %21 ], [ %78, %65 ]
%38 = phi i8* [ %17, %21 ], [ %77, %65 ]
%39 = phi i32 [ undef, %21 ], [ %66, %65 ]
%40 = sext i8 %37 to i32
switch i32 %40, label %65 [
i32 48, label %41
i32 49, label %43
i32 50, label %45
i32 51, label %47
i32 52, label %49
i32 53, label %51
i32 54, label %53
i32 55, label %55
i32 56, label %57
i32 57, label %59
i32 97, label %61
i32 103, label %63
]
41: ; preds = %36
%42 = load i32, i32* @XK_0
br label %65
43: ; preds = %36
%44 = load i32, i32* @XK_1
br label %65
45: ; preds = %36
%46 = load i32, i32* @XK_2
br label %65
47: ; preds = %36
%48 = load i32, i32* @XK_3
br label %65
49: ; preds = %36
%50 = load i32, i32* @XK_4
br label %65
51: ; preds = %36
%52 = load i32, i32* @XK_5
br label %65
53: ; preds = %36
%54 = load i32, i32* @XK_6
br label %65
55: ; preds = %36
%56 = load i32, i32* @XK_7
br label %65
57: ; preds = %36
%58 = load i32, i32* @XK_8
br label %65
59: ; preds = %36
%60 = load i32, i32* @XK_9
br label %65
61: ; preds = %36
%62 = load i32, i32* @XK_a
br label %65
63: ; preds = %36
%64 = load i32, i32* @XK_g
br label %65
65: ; preds = %36, %63, %61, %59, %57, %55, %53, %51, %49, %47, %45, %43, %41
%66 = phi i32 [ %39, %36 ], [ %64, %63 ], [ %62, %61 ], [ %60, %59 ], [ %58, %57 ], [ %56, %55 ], [ %54, %53 ], [ %52, %51 ], [ %50, %49 ], [ %48, %47 ], [ %46, %45 ], [ %44, %43 ], [ %42, %41 ]
%67 = call i8* @XKeysymToKeycode(i32* %18, i32 %66)
%68 = load i32, i32* @KeyPress
store i32 %68, i32* %22
store i32* %18, i32** %23
store i8* %15, i8** %24
%69 = load i8*, i8** @None
store i8* %69, i8** %25
store i32* null, i32** %26
store i8* %67, i8** %27
%70 = load i8*, i8** @True
store i8* %70, i8** %28
%71 = load i32, i32* @KeyRelease
store i32 %71, i32* %29
store i32* %18, i32** %30
store i8* %15, i8** %31
store i8* %69, i8** %32
store i32* null, i32** %33
store i8* %67, i8** %34
store i8* %70, i8** %35
%72 = load i32, i32* @False
%73 = call i32 @XSendEvent(i32* %18, i8* %15, i32 %72, i32* null, %struct.TYPE_4__* %3)
%74 = load i32, i32* @False
%75 = call i32 @XSendEvent(i32* %18, i8* %15, i32 %74, i32* null, %struct.TYPE_4__* %4)
%76 = call i32 @XFlush(i32* %18)
%77 = getelementptr inbounds i8, i8* %38, i64 1
%78 = load i8, i8* %77
%79 = icmp eq i8 %78, 0
br i1 %79, label %80, label %36
80: ; preds = %65, %11, %8
%81 = phi i32 [ 0, %8 ], [ 1, %11 ], [ 1, %65 ]
ret i32 %81
}