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

/* Type definitions */
struct TYPE_3__ {
  int bstate;
  int /*<<< orphan*/ z;
  int /*<<< orphan*/ y;
  int /*<<< orphan*/ x;
  int /*<<< orphan*/ id;
};
typedef TYPE_1__ MEVENT;

/* Variables and functions */
int /*<<< orphan*/ ALL_MOUSE_EVENTS;
int BUTTON1_CLICKED;
int BUTTON1_DOUBLE_CLICKED;
int BUTTON1_PRESSED;
int BUTTON1_RELEASED;
int BUTTON1_TRIPLE_CLICKED;
int BUTTON2_CLICKED;
int BUTTON2_DOUBLE_CLICKED;
int BUTTON2_PRESSED;
int BUTTON2_RELEASED;
int BUTTON2_TRIPLE_CLICKED;
int BUTTON3_CLICKED;
int BUTTON3_DOUBLE_CLICKED;
int BUTTON3_PRESSED;
int BUTTON3_RELEASED;
int BUTTON3_TRIPLE_CLICKED;
int BUTTON4_CLICKED;
int BUTTON4_DOUBLE_CLICKED;
int BUTTON4_PRESSED;
int BUTTON4_RELEASED;
int BUTTON4_TRIPLE_CLICKED;
int BUTTON_ALT;
int BUTTON_CTRL;
int BUTTON_SHIFT;
#define KEY_MOUSE 128
int /*<<< orphan*/ OK;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ clear();
int /*<<< orphan*/ clrtoeol();
int /*<<< orphan*/ endwin();
int getch();
int /*<<< orphan*/ getmouse(TYPE_1__ *);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mousemask(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ printw(char *, ...);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ stdscr;
int main() {
  MEVENT e;
  initscr();
  clear();
  noecho();
  cbreak();
  keypad(stdscr, TRUE);
  mousemask(ALL_MOUSE_EVENTS, NULL);
  bool end = false;
  while (!end) {
    int c = getch();
    switch (c) {
    case 10:
      end = true;
      break;
    case KEY_MOUSE:
      if (getmouse(&e) == OK) {
        printw("id: %d, x: %d, y: %d, z: %d\n", e.id, e.x, e.y, e.z);
        if (e.bstate & BUTTON1_PRESSED)
          printw("BUTTON1_PRESSED\n");
        if (e.bstate & BUTTON1_RELEASED)
          printw("BUTTON1_RELEASED\n");
        if (e.bstate & BUTTON1_CLICKED)
          printw("BUTTON1_CLICKED\n");
        if (e.bstate & BUTTON1_DOUBLE_CLICKED)
          printw("BUTTON1_DOUBLE_CLICKED\n");
        if (e.bstate & BUTTON1_TRIPLE_CLICKED)
          printw("BUTTON1_TRIPLE_CLICKED\n");
        if (e.bstate & BUTTON2_PRESSED)
          printw("BUTTON2_PRESSED\n");
        if (e.bstate & BUTTON2_RELEASED)
          printw("BUTTON2_RELEASED\n");
        if (e.bstate & BUTTON2_CLICKED)
          printw("BUTTON2_CLICKED\n");
        if (e.bstate & BUTTON2_DOUBLE_CLICKED)
          printw("BUTTON2_DOUBLE_CLICKED\n");
        if (e.bstate & BUTTON2_TRIPLE_CLICKED)
          printw("BUTTON2_TRIPLE_CLICKED\n");
        if (e.bstate & BUTTON3_PRESSED)
          printw("BUTTON3_PRESSED\n");
        if (e.bstate & BUTTON3_RELEASED)
          printw("BUTTON3_RELEASED\n");
        if (e.bstate & BUTTON3_CLICKED)
          printw("BUTTON3_CLICKED\n");
        if (e.bstate & BUTTON3_DOUBLE_CLICKED)
          printw("BUTTON3_DOUBLE_CLICKED\n");
        if (e.bstate & BUTTON3_TRIPLE_CLICKED)
          printw("BUTTON3_TRIPLE_CLICKED\n");
        if (e.bstate & BUTTON4_PRESSED)
          printw("BUTTON4_PRESSED\n");
        if (e.bstate & BUTTON4_RELEASED)
          printw("BUTTON4_RELEASED\n");
        if (e.bstate & BUTTON4_CLICKED)
          printw("BUTTON4_CLICKED\n");
        if (e.bstate & BUTTON4_DOUBLE_CLICKED)
          printw("BUTTON4_DOUBLE_CLICKED\n");
        if (e.bstate & BUTTON4_TRIPLE_CLICKED)
          printw("BUTTON4_TRIPLE_CLICKED\n");
        if (e.bstate & BUTTON_SHIFT)
          printw("BUTTON_SHIFT\n");
        if (e.bstate & BUTTON_CTRL)
          printw("BUTTON_CTRL\n");
        if (e.bstate & BUTTON_ALT)
          printw("BUTTON_ALT\n");
      }
      break;
    }
  }
  clrtoeol();
  refresh();
  endwin();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <initscr@plt>
mov    $0x0,%al
call   10e0 <clear@plt>
mov    $0x0,%al
call   10d0 <noecho@plt>
mov    $0x0,%al
call   1030 <cbreak@plt>
mov    0x2da6(%rip),%rax
mov    (%rax),%edi
mov    0x2d8d(%rip),%rax
mov    (%rax),%esi
call   1050 <keypad@plt>
mov    0x2d9f(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <mousemask@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1231 <main+0x71>
jmp    15d5 <main+0x415>
xor    %eax,%eax
call   10a0 <getch@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
sub    $0xa,%eax
je     1262 <main+0xa2>
jmp    124f <main+0x8f>
mov    -0x24(%rbp),%eax
sub    $0x80,%eax
je     126e <main+0xae>
jmp    15d0 <main+0x410>
movl   $0x1,-0x1c(%rbp)
jmp    15d0 <main+0x410>
lea    -0x18(%rbp),%rdi
call   1070 <getmouse@plt>
mov    0x2c9a(%rip),%rcx
cmp    (%rcx),%eax
jne    15cb <main+0x40b>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xd66(%rip),%rdi
mov    $0x0,%al
call   1080 <printw@plt>
mov    -0x18(%rbp),%eax
mov    0x2c9d(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     12c4 <main+0x104>
lea    0xd60(%rip),%rdi
mov    $0x0,%al
call   1080 <printw@plt>
mov    -0x18(%rbp),%eax
mov    0x2cf2(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     12e7 <main+0x127>
lea    0xd4e(%rip),%rdi
mov    $0x0,%al
call   1080 <printw@plt>
mov    -0x18(%rbp),%eax
mov    0x2c87(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     130a <main+0x14a>
lea    0xd3d(%rip),%rdi
mov    $0x0,%al
call   1080 <printw@plt>
mov    -0x18(%rbp),%eax
mov    0x2c2c(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     132d <main+0x16d>
lea    0xd2b(%rip),%rdi
mov    $0x0,%al
call   1080 <printw@plt>
mov    -0x18(%rbp),%eax
mov    0x2c91(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1350 <main+0x190>
lea    0xd20(%rip),%rdi
mov    $0x0,%al
call   1080 <printw@plt>
mov    -0x18(%rbp),%eax
mov    0x2c8e(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1373 <main+0x1b3>
lea    0xd15(%rip),%rdi
mov    $0x0,%al
call   1080 <printw@plt>
mov    -0x18(%rbp),%eax
mov    0x2c73(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1396 <main+0x1d6>
lea    0xd03(%rip),%rdi
mov    $0x0,%al
call   1080 <printw@plt>
mov    -0x18(%rbp),%eax
mov    0x2bc0(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     13b9 <main+0x1f9>
lea    0xcf2(%rip),%rdi
mov    $0x0,%al
call   1080 <printw@plt>
mov    -0x18(%rbp),%eax
mov    0x2b75(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     13dc <main+0x21c>
lea    0xce0(%rip),%rdi
mov    $0x0,%al
call   1080 <printw@plt>
mov    -0x18(%rbp),%eax
mov    0x2b6a(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     13ff <main+0x23f>
lea    0xcd5(%rip),%rdi
mov    $0x0,%al
call   1080 <printw@plt>
mov    -0x18(%rbp),%eax
mov    0x2b07(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1422 <main+0x262>
lea    0xcca(%rip),%rdi
mov    $0x0,%al
call   1080 <printw@plt>
mov    -0x18(%rbp),%eax
mov    0x2bac(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1445 <main+0x285>
lea    0xcb8(%rip),%rdi
mov    $0x0,%al
call   1080 <printw@plt>
mov    -0x18(%rbp),%eax
mov    0x2ad1(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1468 <main+0x2a8>
lea    0xca7(%rip),%rdi
mov    $0x0,%al
call   1080 <printw@plt>
mov    -0x18(%rbp),%eax
mov    0x2b2e(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     148b <main+0x2cb>
lea    0xc95(%rip),%rdi
mov    $0x0,%al
call   1080 <printw@plt>
mov    -0x18(%rbp),%eax
mov    0x2a9b(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     14ae <main+0x2ee>
lea    0xc8a(%rip),%rdi
mov    $0x0,%al
call   1080 <printw@plt>
mov    -0x18(%rbp),%eax
mov    0x2ad8(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     14d1 <main+0x311>
lea    0xc7f(%rip),%rdi
mov    $0x0,%al
call   1080 <printw@plt>
mov    -0x18(%rbp),%eax
mov    0x2af5(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     14f4 <main+0x334>
lea    0xc6d(%rip),%rdi
mov    $0x0,%al
call   1080 <printw@plt>
mov    -0x18(%rbp),%eax
mov    0x2a5a(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1517 <main+0x357>
lea    0xc5c(%rip),%rdi
mov    $0x0,%al
call   1080 <printw@plt>
mov    -0x18(%rbp),%eax
mov    0x2a47(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     153a <main+0x37a>
lea    0xc4a(%rip),%rdi
mov    $0x0,%al
call   1080 <printw@plt>
mov    -0x18(%rbp),%eax
mov    0x2a6c(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     155d <main+0x39d>
lea    0xc3f(%rip),%rdi
mov    $0x0,%al
call   1080 <printw@plt>
mov    -0x18(%rbp),%eax
mov    0x29c1(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1580 <main+0x3c0>
lea    0xc34(%rip),%rdi
mov    $0x0,%al
call   1080 <printw@plt>
mov    -0x18(%rbp),%eax
mov    0x29f6(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     15a3 <main+0x3e3>
lea    0xc1f(%rip),%rdi
mov    $0x0,%al
call   1080 <printw@plt>
mov    -0x18(%rbp),%eax
mov    0x2a0b(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     15c6 <main+0x406>
lea    0xc09(%rip),%rdi
mov    $0x0,%al
call   1080 <printw@plt>
jmp    15cb <main+0x40b>
jmp    15d0 <main+0x410>
jmp    121b <main+0x5b>
mov    $0x0,%al
call   10c0 <clrtoeol@plt>
mov    $0x0,%al
call   1090 <refresh@plt>
mov    $0x0,%al
call   10b0 <endwin@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
xor    %eax,%eax
call   1060 <initscr@plt>
xor    %eax,%eax
call   10e0 <clear@plt>
xor    %eax,%eax
call   10d0 <noecho@plt>
xor    %eax,%eax
call   1030 <cbreak@plt>
mov    0x2da7(%rip),%rax
mov    (%rax),%edi
mov    0x2d8e(%rip),%rax
mov    (%rax),%esi
call   1050 <keypad@plt>
mov    0x2da0(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1040 <mousemask@plt>
mov    %rsp,%rbx
mov    0x2cfd(%rip),%rbp
mov    0x2d8e(%rip),%r14
mov    0x2cff(%rip),%r12
mov    0x2d50(%rip),%r13
mov    0x2d81(%rip),%r15
jmp    1249 <main+0x89>
nopl   0x0(%rax)
cmp    $0xa,%eax
je     14fa <main+0x33a>
xor    %eax,%eax
call   10a0 <getch@plt>
cmp    $0x80,%eax
jne    1240 <main+0x80>
mov    %rbx,%rdi
call   1070 <getmouse@plt>
cmp    0x0(%rbp),%eax
jne    1249 <main+0x89>
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
mov    0x4(%rsp),%r8d
mov    0x8(%rsp),%ecx
lea    0xd84(%rip),%rdi
xor    %eax,%eax
call   1080 <printw@plt>
mov    (%rsp),%eax
mov    0x2cbb(%rip),%rcx
test   %eax,(%rcx)
je     12a2 <main+0xe2>
lea    0xd85(%rip),%rdi
xor    %eax,%eax
call   1080 <printw@plt>
mov    (%rsp),%eax
mov    0x2d17(%rip),%rcx
test   %eax,(%rcx)
je     12be <main+0xfe>
lea    0xd7a(%rip),%rdi
xor    %eax,%eax
call   1080 <printw@plt>
mov    (%rsp),%eax
mov    0x2cb3(%rip),%rcx
test   %eax,(%rcx)
je     12da <main+0x11a>
lea    0xd70(%rip),%rdi
xor    %eax,%eax
call   1080 <printw@plt>
mov    (%rsp),%eax
mov    0x2c5f(%rip),%rcx
test   %eax,(%rcx)
je     12f6 <main+0x136>
lea    0xd65(%rip),%rdi
xor    %eax,%eax
call   1080 <printw@plt>
mov    (%rsp),%eax
mov    0x2ccb(%rip),%rcx
test   %eax,(%rcx)
je     1312 <main+0x152>
lea    0xd61(%rip),%rdi
xor    %eax,%eax
call   1080 <printw@plt>
mov    (%rsp),%eax
mov    0x2ccf(%rip),%rcx
test   %eax,(%rcx)
je     132e <main+0x16e>
lea    0xd5d(%rip),%rdi
xor    %eax,%eax
call   1080 <printw@plt>
mov    (%rsp),%eax
mov    0x2cbb(%rip),%rcx
test   %eax,(%rcx)
je     134a <main+0x18a>
lea    0xd52(%rip),%rdi
xor    %eax,%eax
call   1080 <printw@plt>
mov    (%rsp),%eax
mov    0x2c0f(%rip),%rcx
test   %eax,(%rcx)
je     1366 <main+0x1a6>
lea    0xd48(%rip),%rdi
xor    %eax,%eax
call   1080 <printw@plt>
mov    (%rsp),%eax
mov    0x2bcb(%rip),%rcx
test   %eax,(%rcx)
je     1382 <main+0x1c2>
lea    0xd3d(%rip),%rdi
xor    %eax,%eax
call   1080 <printw@plt>
mov    (%rsp),%eax
mov    0x2bc7(%rip),%rcx
test   %eax,(%rcx)
je     139e <main+0x1de>
lea    0xd39(%rip),%rdi
xor    %eax,%eax
call   1080 <printw@plt>
mov    (%rsp),%eax
mov    0x2b6b(%rip),%rcx
test   %eax,(%rcx)
je     13ba <main+0x1fa>
lea    0xd35(%rip),%rdi
xor    %eax,%eax
call   1080 <printw@plt>
mov    (%rsp),%eax
mov    0x2c17(%rip),%rcx
test   %eax,(%rcx)
je     13d6 <main+0x216>
lea    0xd2a(%rip),%rdi
xor    %eax,%eax
call   1080 <printw@plt>
mov    (%rsp),%eax
mov    0x2b43(%rip),%rcx
test   %eax,(%rcx)
je     13f2 <main+0x232>
lea    0xd20(%rip),%rdi
xor    %eax,%eax
call   1080 <printw@plt>
mov    (%rsp),%eax
mov    0x2ba7(%rip),%rcx
test   %eax,(%rcx)
je     140e <main+0x24e>
lea    0xd15(%rip),%rdi
xor    %eax,%eax
call   1080 <printw@plt>
mov    (%rsp),%eax
mov    0x2b1b(%rip),%rcx
test   %eax,(%rcx)
je     142a <main+0x26a>
lea    0xd11(%rip),%rdi
xor    %eax,%eax
call   1080 <printw@plt>
mov    (%rsp),%eax
mov    0x2b5f(%rip),%rcx
test   %eax,(%rcx)
je     1446 <main+0x286>
lea    0xd0d(%rip),%rdi
xor    %eax,%eax
call   1080 <printw@plt>
mov    (%rsp),%eax
mov    0x2b83(%rip),%rcx
test   %eax,(%rcx)
je     1462 <main+0x2a2>
lea    0xd02(%rip),%rdi
xor    %eax,%eax
call   1080 <printw@plt>
mov    (%rsp),%eax
mov    0x2aef(%rip),%rcx
test   %eax,(%rcx)
je     147e <main+0x2be>
lea    0xcf8(%rip),%rdi
xor    %eax,%eax
call   1080 <printw@plt>
mov    (%rsp),%eax
mov    0x2ae3(%rip),%rcx
test   %eax,(%rcx)
je     149a <main+0x2da>
lea    0xced(%rip),%rdi
xor    %eax,%eax
call   1080 <printw@plt>
mov    (%rsp),%eax
test   %eax,(%r14)
je     14b0 <main+0x2f0>
lea    0xcef(%rip),%rdi
xor    %eax,%eax
call   1080 <printw@plt>
mov    (%rsp),%eax
test   %eax,(%r12)
je     14c7 <main+0x307>
lea    0xcf0(%rip),%rdi
xor    %eax,%eax
call   1080 <printw@plt>
mov    (%rsp),%eax
test   %eax,0x0(%r13)
je     14de <main+0x31e>
lea    0xce7(%rip),%rdi
xor    %eax,%eax
call   1080 <printw@plt>
mov    (%rsp),%eax
test   %eax,(%r15)
je     1249 <main+0x89>
lea    0xcda(%rip),%rdi
xor    %eax,%eax
call   1080 <printw@plt>
jmp    1249 <main+0x89>
xor    %eax,%eax
call   10c0 <clrtoeol@plt>
xor    %eax,%eax
call   1090 <refresh@plt>
xor    %eax,%eax
call   10b0 <endwin@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32, i32, i32, i32 }
@stdscr = global i32 0
@TRUE = global i32 0
@ALL_MOUSE_EVENTS = global i32 0
@OK = global i32 0
@.str = [29 x i8] c"id: %d, x: %d, y: %d, z: %d\0A\00"
@BUTTON1_PRESSED = global i32 0
@.str.1 = [17 x i8] c"BUTTON1_PRESSED\0A\00"
@BUTTON1_RELEASED = global i32 0
@.str.2 = [18 x i8] c"BUTTON1_RELEASED\0A\00"
@BUTTON1_CLICKED = global i32 0
@.str.3 = [17 x i8] c"BUTTON1_CLICKED\0A\00"
@BUTTON1_DOUBLE_CLICKED = global i32 0
@.str.4 = [24 x i8] c"BUTTON1_DOUBLE_CLICKED\0A\00"
@BUTTON1_TRIPLE_CLICKED = global i32 0
@.str.5 = [24 x i8] c"BUTTON1_TRIPLE_CLICKED\0A\00"
@BUTTON2_PRESSED = global i32 0
@.str.6 = [17 x i8] c"BUTTON2_PRESSED\0A\00"
@BUTTON2_RELEASED = global i32 0
@.str.7 = [18 x i8] c"BUTTON2_RELEASED\0A\00"
@BUTTON2_CLICKED = global i32 0
@.str.8 = [17 x i8] c"BUTTON2_CLICKED\0A\00"
@BUTTON2_DOUBLE_CLICKED = global i32 0
@.str.9 = [24 x i8] c"BUTTON2_DOUBLE_CLICKED\0A\00"
@BUTTON2_TRIPLE_CLICKED = global i32 0
@.str.10 = [24 x i8] c"BUTTON2_TRIPLE_CLICKED\0A\00"
@BUTTON3_PRESSED = global i32 0
@.str.11 = [17 x i8] c"BUTTON3_PRESSED\0A\00"
@BUTTON3_RELEASED = global i32 0
@.str.12 = [18 x i8] c"BUTTON3_RELEASED\0A\00"
@BUTTON3_CLICKED = global i32 0
@.str.13 = [17 x i8] c"BUTTON3_CLICKED\0A\00"
@BUTTON3_DOUBLE_CLICKED = global i32 0
@.str.14 = [24 x i8] c"BUTTON3_DOUBLE_CLICKED\0A\00"
@BUTTON3_TRIPLE_CLICKED = global i32 0
@.str.15 = [24 x i8] c"BUTTON3_TRIPLE_CLICKED\0A\00"
@BUTTON4_PRESSED = global i32 0
@.str.16 = [17 x i8] c"BUTTON4_PRESSED\0A\00"
@BUTTON4_RELEASED = global i32 0
@.str.17 = [18 x i8] c"BUTTON4_RELEASED\0A\00"
@BUTTON4_CLICKED = global i32 0
@.str.18 = [17 x i8] c"BUTTON4_CLICKED\0A\00"
@BUTTON4_DOUBLE_CLICKED = global i32 0
@.str.19 = [24 x i8] c"BUTTON4_DOUBLE_CLICKED\0A\00"
@BUTTON4_TRIPLE_CLICKED = global i32 0
@.str.20 = [24 x i8] c"BUTTON4_TRIPLE_CLICKED\0A\00"
@BUTTON_SHIFT = global i32 0
@.str.21 = [14 x i8] c"BUTTON_SHIFT\0A\00"
@BUTTON_CTRL = global i32 0
@.str.22 = [13 x i8] c"BUTTON_CTRL\0A\00"
@BUTTON_ALT = global i32 0
@.str.23 = [12 x i8] c"BUTTON_ALT\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.TYPE_3__
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @initscr()
%6 = call i32 (...) @clear()
%7 = call i32 (...) @noecho()
%8 = call i32 (...) @cbreak()
%9 = load i32, i32* @stdscr
%10 = load i32, i32* @TRUE
%11 = call i32 @keypad(i32 %9, i32 %10)
%12 = load i32, i32* @ALL_MOUSE_EVENTS
%13 = call i32 @mousemask(i32 %12, i32* null)
store i32 0, i32* %3
br label %14
14: ; preds = %221, %0
%15 = load i32, i32* %3
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
br i1 %17, label %18, label %222
18: ; preds = %14
%19 = call i32 (...) @getch()
store i32 %19, i32* %4
%20 = load i32, i32* %4
switch i32 %20, label %221 [
i32 10, label %21
i32 128, label %22
]
21: ; preds = %18
store i32 1, i32* %3
br label %221
22: ; preds = %18
%23 = call i32 @getmouse(%struct.TYPE_3__* %2)
%24 = load i32, i32* @OK
%25 = icmp eq i32 %23, %24
br i1 %25, label %26, label %220
26: ; preds = %22
%27 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 4
%28 = load i32, i32* %27
%29 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 3
%30 = load i32, i32* %29
%31 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 2
%32 = load i32, i32* %31
%33 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 1
%34 = load i32, i32* %33
%35 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %28, i32 %30, i32 %32, i32 %34)
%36 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
%37 = load i32, i32* %36
%38 = load i32, i32* @BUTTON1_PRESSED
%39 = and i32 %37, %38
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %26
%42 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %43
43: ; preds = %41, %26
%44 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
%45 = load i32, i32* %44
%46 = load i32, i32* @BUTTON1_RELEASED
%47 = and i32 %45, %46
%48 = icmp ne i32 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %43
%50 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
br label %51
51: ; preds = %49, %43
%52 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
%53 = load i32, i32* %52
%54 = load i32, i32* @BUTTON1_CLICKED
%55 = and i32 %53, %54
%56 = icmp ne i32 %55, 0
br i1 %56, label %57, label %59
57: ; preds = %51
%58 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
br label %59
59: ; preds = %57, %51
%60 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
%61 = load i32, i32* %60
%62 = load i32, i32* @BUTTON1_DOUBLE_CLICKED
%63 = and i32 %61, %62
%64 = icmp ne i32 %63, 0
br i1 %64, label %65, label %67
65: ; preds = %59
%66 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
br label %67
67: ; preds = %65, %59
%68 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
%69 = load i32, i32* %68
%70 = load i32, i32* @BUTTON1_TRIPLE_CLICKED
%71 = and i32 %69, %70
%72 = icmp ne i32 %71, 0
br i1 %72, label %73, label %75
73: ; preds = %67
%74 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
br label %75
75: ; preds = %73, %67
%76 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
%77 = load i32, i32* %76
%78 = load i32, i32* @BUTTON2_PRESSED
%79 = and i32 %77, %78
%80 = icmp ne i32 %79, 0
br i1 %80, label %81, label %83
81: ; preds = %75
%82 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
br label %83
83: ; preds = %81, %75
%84 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
%85 = load i32, i32* %84
%86 = load i32, i32* @BUTTON2_RELEASED
%87 = and i32 %85, %86
%88 = icmp ne i32 %87, 0
br i1 %88, label %89, label %91
89: ; preds = %83
%90 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0))
br label %91
91: ; preds = %89, %83
%92 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
%93 = load i32, i32* %92
%94 = load i32, i32* @BUTTON2_CLICKED
%95 = and i32 %93, %94
%96 = icmp ne i32 %95, 0
br i1 %96, label %97, label %99
97: ; preds = %91
%98 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0))
br label %99
99: ; preds = %97, %91
%100 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
%101 = load i32, i32* %100
%102 = load i32, i32* @BUTTON2_DOUBLE_CLICKED
%103 = and i32 %101, %102
%104 = icmp ne i32 %103, 0
br i1 %104, label %105, label %107
105: ; preds = %99
%106 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0))
br label %107
107: ; preds = %105, %99
%108 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
%109 = load i32, i32* %108
%110 = load i32, i32* @BUTTON2_TRIPLE_CLICKED
%111 = and i32 %109, %110
%112 = icmp ne i32 %111, 0
br i1 %112, label %113, label %115
113: ; preds = %107
%114 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0))
br label %115
115: ; preds = %113, %107
%116 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
%117 = load i32, i32* %116
%118 = load i32, i32* @BUTTON3_PRESSED
%119 = and i32 %117, %118
%120 = icmp ne i32 %119, 0
br i1 %120, label %121, label %123
121: ; preds = %115
%122 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.11, i64 0, i64 0))
br label %123
123: ; preds = %121, %115
%124 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
%125 = load i32, i32* %124
%126 = load i32, i32* @BUTTON3_RELEASED
%127 = and i32 %125, %126
%128 = icmp ne i32 %127, 0
br i1 %128, label %129, label %131
129: ; preds = %123
%130 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0))
br label %131
131: ; preds = %129, %123
%132 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
%133 = load i32, i32* %132
%134 = load i32, i32* @BUTTON3_CLICKED
%135 = and i32 %133, %134
%136 = icmp ne i32 %135, 0
br i1 %136, label %137, label %139
137: ; preds = %131
%138 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.13, i64 0, i64 0))
br label %139
139: ; preds = %137, %131
%140 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
%141 = load i32, i32* %140
%142 = load i32, i32* @BUTTON3_DOUBLE_CLICKED
%143 = and i32 %141, %142
%144 = icmp ne i32 %143, 0
br i1 %144, label %145, label %147
145: ; preds = %139
%146 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.14, i64 0, i64 0))
br label %147
147: ; preds = %145, %139
%148 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
%149 = load i32, i32* %148
%150 = load i32, i32* @BUTTON3_TRIPLE_CLICKED
%151 = and i32 %149, %150
%152 = icmp ne i32 %151, 0
br i1 %152, label %153, label %155
153: ; preds = %147
%154 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.15, i64 0, i64 0))
br label %155
155: ; preds = %153, %147
%156 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
%157 = load i32, i32* %156
%158 = load i32, i32* @BUTTON4_PRESSED
%159 = and i32 %157, %158
%160 = icmp ne i32 %159, 0
br i1 %160, label %161, label %163
161: ; preds = %155
%162 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.16, i64 0, i64 0))
br label %163
163: ; preds = %161, %155
%164 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
%165 = load i32, i32* %164
%166 = load i32, i32* @BUTTON4_RELEASED
%167 = and i32 %165, %166
%168 = icmp ne i32 %167, 0
br i1 %168, label %169, label %171
169: ; preds = %163
%170 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.17, i64 0, i64 0))
br label %171
171: ; preds = %169, %163
%172 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
%173 = load i32, i32* %172
%174 = load i32, i32* @BUTTON4_CLICKED
%175 = and i32 %173, %174
%176 = icmp ne i32 %175, 0
br i1 %176, label %177, label %179
177: ; preds = %171
%178 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.18, i64 0, i64 0))
br label %179
179: ; preds = %177, %171
%180 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
%181 = load i32, i32* %180
%182 = load i32, i32* @BUTTON4_DOUBLE_CLICKED
%183 = and i32 %181, %182
%184 = icmp ne i32 %183, 0
br i1 %184, label %185, label %187
185: ; preds = %179
%186 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.19, i64 0, i64 0))
br label %187
187: ; preds = %185, %179
%188 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
%189 = load i32, i32* %188
%190 = load i32, i32* @BUTTON4_TRIPLE_CLICKED
%191 = and i32 %189, %190
%192 = icmp ne i32 %191, 0
br i1 %192, label %193, label %195
193: ; preds = %187
%194 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.20, i64 0, i64 0))
br label %195
195: ; preds = %193, %187
%196 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
%197 = load i32, i32* %196
%198 = load i32, i32* @BUTTON_SHIFT
%199 = and i32 %197, %198
%200 = icmp ne i32 %199, 0
br i1 %200, label %201, label %203
201: ; preds = %195
%202 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.21, i64 0, i64 0))
br label %203
203: ; preds = %201, %195
%204 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
%205 = load i32, i32* %204
%206 = load i32, i32* @BUTTON_CTRL
%207 = and i32 %205, %206
%208 = icmp ne i32 %207, 0
br i1 %208, label %209, label %211
209: ; preds = %203
%210 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.22, i64 0, i64 0))
br label %211
211: ; preds = %209, %203
%212 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
%213 = load i32, i32* %212
%214 = load i32, i32* @BUTTON_ALT
%215 = and i32 %213, %214
%216 = icmp ne i32 %215, 0
br i1 %216, label %217, label %219
217: ; preds = %211
%218 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.23, i64 0, i64 0))
br label %219
219: ; preds = %217, %211
br label %220
220: ; preds = %219, %22
br label %221
221: ; preds = %18, %220, %21
br label %14
222: ; preds = %14
%223 = call i32 (...) @clrtoeol()
%224 = call i32 (...) @refresh()
%225 = call i32 (...) @endwin()
%226 = load i32, i32* %1
ret i32 %226
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32, i32, i32, i32 }
@stdscr = global i32 0
@TRUE = global i32 0
@ALL_MOUSE_EVENTS = global i32 0
@OK = global i32 0
@.str = [29 x i8] c"id: %d, x: %d, y: %d, z: %d\0A\00"
@BUTTON1_PRESSED = global i32 0
@.str.1 = [17 x i8] c"BUTTON1_PRESSED\0A\00"
@BUTTON1_RELEASED = global i32 0
@.str.2 = [18 x i8] c"BUTTON1_RELEASED\0A\00"
@BUTTON1_CLICKED = global i32 0
@.str.3 = [17 x i8] c"BUTTON1_CLICKED\0A\00"
@BUTTON1_DOUBLE_CLICKED = global i32 0
@.str.4 = [24 x i8] c"BUTTON1_DOUBLE_CLICKED\0A\00"
@BUTTON1_TRIPLE_CLICKED = global i32 0
@.str.5 = [24 x i8] c"BUTTON1_TRIPLE_CLICKED\0A\00"
@BUTTON2_PRESSED = global i32 0
@.str.6 = [17 x i8] c"BUTTON2_PRESSED\0A\00"
@BUTTON2_RELEASED = global i32 0
@.str.7 = [18 x i8] c"BUTTON2_RELEASED\0A\00"
@BUTTON2_CLICKED = global i32 0
@.str.8 = [17 x i8] c"BUTTON2_CLICKED\0A\00"
@BUTTON2_DOUBLE_CLICKED = global i32 0
@.str.9 = [24 x i8] c"BUTTON2_DOUBLE_CLICKED\0A\00"
@BUTTON2_TRIPLE_CLICKED = global i32 0
@.str.10 = [24 x i8] c"BUTTON2_TRIPLE_CLICKED\0A\00"
@BUTTON3_PRESSED = global i32 0
@.str.11 = [17 x i8] c"BUTTON3_PRESSED\0A\00"
@BUTTON3_RELEASED = global i32 0
@.str.12 = [18 x i8] c"BUTTON3_RELEASED\0A\00"
@BUTTON3_CLICKED = global i32 0
@.str.13 = [17 x i8] c"BUTTON3_CLICKED\0A\00"
@BUTTON3_DOUBLE_CLICKED = global i32 0
@.str.14 = [24 x i8] c"BUTTON3_DOUBLE_CLICKED\0A\00"
@BUTTON3_TRIPLE_CLICKED = global i32 0
@.str.15 = [24 x i8] c"BUTTON3_TRIPLE_CLICKED\0A\00"
@BUTTON4_PRESSED = global i32 0
@.str.16 = [17 x i8] c"BUTTON4_PRESSED\0A\00"
@BUTTON4_RELEASED = global i32 0
@.str.17 = [18 x i8] c"BUTTON4_RELEASED\0A\00"
@BUTTON4_CLICKED = global i32 0
@.str.18 = [17 x i8] c"BUTTON4_CLICKED\0A\00"
@BUTTON4_DOUBLE_CLICKED = global i32 0
@.str.19 = [24 x i8] c"BUTTON4_DOUBLE_CLICKED\0A\00"
@BUTTON4_TRIPLE_CLICKED = global i32 0
@.str.20 = [24 x i8] c"BUTTON4_TRIPLE_CLICKED\0A\00"
@BUTTON_SHIFT = global i32 0
@.str.21 = [14 x i8] c"BUTTON_SHIFT\0A\00"
@BUTTON_CTRL = global i32 0
@.str.22 = [13 x i8] c"BUTTON_CTRL\0A\00"
@BUTTON_ALT = global i32 0
@.str.23 = [12 x i8] c"BUTTON_ALT\0A\00"
define i32 @main() {
%1 = alloca %struct.TYPE_3__
%2 = bitcast %struct.TYPE_3__* %1 to i8*
%3 = tail call i32 (...) @initscr()
%4 = tail call i32 (...) @clear()
%5 = tail call i32 (...) @noecho()
%6 = tail call i32 (...) @cbreak()
%7 = load i32, i32* @stdscr
%8 = load i32, i32* @TRUE
%9 = tail call i32 @keypad(i32 %7, i32 %8)
%10 = load i32, i32* @ALL_MOUSE_EVENTS
%11 = tail call i32 @mousemask(i32 %10, i32* null)
%12 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 4
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 3
%14 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 2
%15 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 1
%16 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 0
br label %17
17: ; preds = %23, %0
%18 = call i32 (...) @getch()
switch i32 %18, label %23 [
i32 10, label %212
i32 128, label %19
]
19: ; preds = %17
%20 = call i32 @getmouse(%struct.TYPE_3__* %1)
%21 = load i32, i32* @OK
%22 = icmp eq i32 %20, %21
br i1 %22, label %24, label %23
23: ; preds = %19, %210, %205, %17
br label %17
24: ; preds = %19
%25 = load i32, i32* %12
%26 = load i32, i32* %13
%27 = load i32, i32* %14
%28 = load i32, i32* %15
%29 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %25, i32 %26, i32 %27, i32 %28)
%30 = load i32, i32* %16
%31 = load i32, i32* @BUTTON1_PRESSED
%32 = and i32 %31, %30
%33 = icmp eq i32 %32, 0
br i1 %33, label %37, label %34
34: ; preds = %24
%35 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%36 = load i32, i32* %16
br label %37
37: ; preds = %34, %24
%38 = phi i32 [ %36, %34 ], [ %30, %24 ]
%39 = load i32, i32* @BUTTON1_RELEASED
%40 = and i32 %39, %38
%41 = icmp eq i32 %40, 0
br i1 %41, label %45, label %42
42: ; preds = %37
%43 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%44 = load i32, i32* %16
br label %45
45: ; preds = %42, %37
%46 = phi i32 [ %44, %42 ], [ %38, %37 ]
%47 = load i32, i32* @BUTTON1_CLICKED
%48 = and i32 %47, %46
%49 = icmp eq i32 %48, 0
br i1 %49, label %53, label %50
50: ; preds = %45
%51 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%52 = load i32, i32* %16
br label %53
53: ; preds = %50, %45
%54 = phi i32 [ %52, %50 ], [ %46, %45 ]
%55 = load i32, i32* @BUTTON1_DOUBLE_CLICKED
%56 = and i32 %55, %54
%57 = icmp eq i32 %56, 0
br i1 %57, label %61, label %58
58: ; preds = %53
%59 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
%60 = load i32, i32* %16
br label %61
61: ; preds = %58, %53
%62 = phi i32 [ %60, %58 ], [ %54, %53 ]
%63 = load i32, i32* @BUTTON1_TRIPLE_CLICKED
%64 = and i32 %63, %62
%65 = icmp eq i32 %64, 0
br i1 %65, label %69, label %66
66: ; preds = %61
%67 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
%68 = load i32, i32* %16
br label %69
69: ; preds = %66, %61
%70 = phi i32 [ %68, %66 ], [ %62, %61 ]
%71 = load i32, i32* @BUTTON2_PRESSED
%72 = and i32 %71, %70
%73 = icmp eq i32 %72, 0
br i1 %73, label %77, label %74
74: ; preds = %69
%75 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
%76 = load i32, i32* %16
br label %77
77: ; preds = %74, %69
%78 = phi i32 [ %76, %74 ], [ %70, %69 ]
%79 = load i32, i32* @BUTTON2_RELEASED
%80 = and i32 %79, %78
%81 = icmp eq i32 %80, 0
br i1 %81, label %85, label %82
82: ; preds = %77
%83 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0))
%84 = load i32, i32* %16
br label %85
85: ; preds = %82, %77
%86 = phi i32 [ %84, %82 ], [ %78, %77 ]
%87 = load i32, i32* @BUTTON2_CLICKED
%88 = and i32 %87, %86
%89 = icmp eq i32 %88, 0
br i1 %89, label %93, label %90
90: ; preds = %85
%91 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0))
%92 = load i32, i32* %16
br label %93
93: ; preds = %90, %85
%94 = phi i32 [ %92, %90 ], [ %86, %85 ]
%95 = load i32, i32* @BUTTON2_DOUBLE_CLICKED
%96 = and i32 %95, %94
%97 = icmp eq i32 %96, 0
br i1 %97, label %101, label %98
98: ; preds = %93
%99 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0))
%100 = load i32, i32* %16
br label %101
101: ; preds = %98, %93
%102 = phi i32 [ %100, %98 ], [ %94, %93 ]
%103 = load i32, i32* @BUTTON2_TRIPLE_CLICKED
%104 = and i32 %103, %102
%105 = icmp eq i32 %104, 0
br i1 %105, label %109, label %106
106: ; preds = %101
%107 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0))
%108 = load i32, i32* %16
br label %109
109: ; preds = %106, %101
%110 = phi i32 [ %108, %106 ], [ %102, %101 ]
%111 = load i32, i32* @BUTTON3_PRESSED
%112 = and i32 %111, %110
%113 = icmp eq i32 %112, 0
br i1 %113, label %117, label %114
114: ; preds = %109
%115 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.11, i64 0, i64 0))
%116 = load i32, i32* %16
br label %117
117: ; preds = %114, %109
%118 = phi i32 [ %116, %114 ], [ %110, %109 ]
%119 = load i32, i32* @BUTTON3_RELEASED
%120 = and i32 %119, %118
%121 = icmp eq i32 %120, 0
br i1 %121, label %125, label %122
122: ; preds = %117
%123 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0))
%124 = load i32, i32* %16
br label %125
125: ; preds = %122, %117
%126 = phi i32 [ %124, %122 ], [ %118, %117 ]
%127 = load i32, i32* @BUTTON3_CLICKED
%128 = and i32 %127, %126
%129 = icmp eq i32 %128, 0
br i1 %129, label %133, label %130
130: ; preds = %125
%131 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.13, i64 0, i64 0))
%132 = load i32, i32* %16
br label %133
133: ; preds = %130, %125
%134 = phi i32 [ %132, %130 ], [ %126, %125 ]
%135 = load i32, i32* @BUTTON3_DOUBLE_CLICKED
%136 = and i32 %135, %134
%137 = icmp eq i32 %136, 0
br i1 %137, label %141, label %138
138: ; preds = %133
%139 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.14, i64 0, i64 0))
%140 = load i32, i32* %16
br label %141
141: ; preds = %138, %133
%142 = phi i32 [ %140, %138 ], [ %134, %133 ]
%143 = load i32, i32* @BUTTON3_TRIPLE_CLICKED
%144 = and i32 %143, %142
%145 = icmp eq i32 %144, 0
br i1 %145, label %149, label %146
146: ; preds = %141
%147 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.15, i64 0, i64 0))
%148 = load i32, i32* %16
br label %149
149: ; preds = %146, %141
%150 = phi i32 [ %148, %146 ], [ %142, %141 ]
%151 = load i32, i32* @BUTTON4_PRESSED
%152 = and i32 %151, %150
%153 = icmp eq i32 %152, 0
br i1 %153, label %157, label %154
154: ; preds = %149
%155 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.16, i64 0, i64 0))
%156 = load i32, i32* %16
br label %157
157: ; preds = %154, %149
%158 = phi i32 [ %156, %154 ], [ %150, %149 ]
%159 = load i32, i32* @BUTTON4_RELEASED
%160 = and i32 %159, %158
%161 = icmp eq i32 %160, 0
br i1 %161, label %165, label %162
162: ; preds = %157
%163 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.17, i64 0, i64 0))
%164 = load i32, i32* %16
br label %165
165: ; preds = %162, %157
%166 = phi i32 [ %164, %162 ], [ %158, %157 ]
%167 = load i32, i32* @BUTTON4_CLICKED
%168 = and i32 %167, %166
%169 = icmp eq i32 %168, 0
br i1 %169, label %173, label %170
170: ; preds = %165
%171 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.18, i64 0, i64 0))
%172 = load i32, i32* %16
br label %173
173: ; preds = %170, %165
%174 = phi i32 [ %172, %170 ], [ %166, %165 ]
%175 = load i32, i32* @BUTTON4_DOUBLE_CLICKED
%176 = and i32 %175, %174
%177 = icmp eq i32 %176, 0
br i1 %177, label %181, label %178
178: ; preds = %173
%179 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.19, i64 0, i64 0))
%180 = load i32, i32* %16
br label %181
181: ; preds = %178, %173
%182 = phi i32 [ %180, %178 ], [ %174, %173 ]
%183 = load i32, i32* @BUTTON4_TRIPLE_CLICKED
%184 = and i32 %183, %182
%185 = icmp eq i32 %184, 0
br i1 %185, label %189, label %186
186: ; preds = %181
%187 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.20, i64 0, i64 0))
%188 = load i32, i32* %16
br label %189
189: ; preds = %186, %181
%190 = phi i32 [ %188, %186 ], [ %182, %181 ]
%191 = load i32, i32* @BUTTON_SHIFT
%192 = and i32 %191, %190
%193 = icmp eq i32 %192, 0
br i1 %193, label %197, label %194
194: ; preds = %189
%195 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.21, i64 0, i64 0))
%196 = load i32, i32* %16
br label %197
197: ; preds = %194, %189
%198 = phi i32 [ %196, %194 ], [ %190, %189 ]
%199 = load i32, i32* @BUTTON_CTRL
%200 = and i32 %199, %198
%201 = icmp eq i32 %200, 0
br i1 %201, label %205, label %202
202: ; preds = %197
%203 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.22, i64 0, i64 0))
%204 = load i32, i32* %16
br label %205
205: ; preds = %202, %197
%206 = phi i32 [ %204, %202 ], [ %198, %197 ]
%207 = load i32, i32* @BUTTON_ALT
%208 = and i32 %207, %206
%209 = icmp eq i32 %208, 0
br i1 %209, label %23, label %210
210: ; preds = %205
%211 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.23, i64 0, i64 0))
br label %23
212: ; preds = %17
%213 = call i32 (...) @clrtoeol()
%214 = call i32 (...) @refresh()
%215 = call i32 (...) @endwin()
ret i32 0
}