#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_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ wifiserver;
typedef int /*<<< orphan*/ wificlient;
struct TYPE_3__ {
  int /*<<< orphan*/ s_addr;
};
struct TYPE_4__ {
  int vendor;
  int product;
  int version;
  int /*<<< orphan*/ bustype;
};
struct uinput_user_dev {
  int *absmax;
  int *absmin;
  int *absfuzz;
  int *absflat;
  int /*<<< orphan*/ sin_port;
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_family;
  TYPE_2__ id;
  int /*<<< orphan*/ name;
};
struct sockaddr_in {
  int *absmax;
  int *absmin;
  int *absfuzz;
  int *absflat;
  int /*<<< orphan*/ sin_port;
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_family;
  TYPE_2__ id;
  int /*<<< orphan*/ name;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ device;

/* Variables and functions */
int ABS_MAX;
size_t ABS_X;
size_t ABS_Y;
int /*<<< orphan*/ AF_INET;
size_t BTN_1;
size_t BTN_2;
size_t BTN_3;
size_t BTN_4;
size_t BTN_5;
size_t BTN_6;
size_t BTN_BACK;
size_t BTN_FORWARD;
size_t BTN_LEFT;
size_t BTN_RIGHT;
size_t BTN_SELECT;
size_t BTN_START;
int /*<<< orphan*/ BUS_USB;
int /*<<< orphan*/ Die(char *);
int /*<<< orphan*/ EV_ABS;
int /*<<< orphan*/ EV_KEY;
int /*<<< orphan*/ EV_SYN;
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ IPPROTO_UDP;
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_DGRAM;
size_t SYN_REPORT;
int /*<<< orphan*/ UI_DEV_CREATE;
int /*<<< orphan*/ UI_SET_ABSBIT;
int /*<<< orphan*/ UI_SET_EVBIT;
int /*<<< orphan*/ UI_SET_KEYBIT;
int /*<<< orphan*/ atoi(char *);
scalar_t__ bind(int, struct sockaddr *, unsigned int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int /*<<< orphan*/ htons(int /*<<< orphan*/);
scalar_t__ ioctl(int, int /*<<< orphan*/, ...);
int /*<<< orphan*/ memset(struct uinput_user_dev *, int /*<<< orphan*/, int);
int open(char *, int /*<<< orphan*/);
int recvfrom(int, unsigned char *, int, int /*<<< orphan*/, struct sockaddr *,
             unsigned int *);
int /*<<< orphan*/ send_event(int, int /*<<< orphan*/, size_t, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcpy(int /*<<< orphan*/, char *);
int write(int, struct uinput_user_dev *, int);
int main(int argc, char *argv[]) {
  int i, j, fd;
  struct uinput_user_dev device;
  memset(&device, 0, sizeof device);
  int sock;
  struct sockaddr_in wifiserver;
  struct sockaddr_in wificlient;
  unsigned char buffer[11];
  unsigned int clientlen, serverlen;
  int received = 0;
  if (argc != 2) {
    fprintf(stderr, "USAGE: %s <port>\n", argv[0]);
    fprintf(stderr,
            "\n\t20001 -> Controller 1\n\t20002 -> Controller 2\n\t....\n",
            argv[0]);
    exit(1);
  }
  fd = open("/dev/uinput", O_RDWR);
  strcpy(device.name, "wificontoller");
  device.id.bustype = BUS_USB;
  device.id.vendor = 1;
  device.id.product = 1;
  device.id.version = 1;
  for (i = 0; i < ABS_MAX; i++) {
    device.absmax[i] = -1;
    device.absmin[i] = -1;
    device.absfuzz[i] = -1;
    device.absflat[i] = -1;
  }
  for (j = 0; j < ABS_MAX; j++) {
    device.absmax[j] = -1;
    device.absmin[j] = -1;
    device.absfuzz[j] = -1;
    device.absflat[j] = -1;
  }
  device.absmin[ABS_X] = 0;
  device.absmax[ABS_X] = 255;
  device.absfuzz[ABS_X] = 0;
  device.absflat[ABS_X] = 0;
  device.absmin[ABS_Y] = 0;
  device.absmax[ABS_Y] = 255;
  device.absfuzz[ABS_Y] = 0;
  device.absflat[ABS_Y] = 0;
  if (write(fd, &device, sizeof(device)) != sizeof(device)) {
    fprintf(stderr, "error setup\n");
  }
  if (ioctl(fd, UI_SET_EVBIT, EV_KEY) < 0)
    fprintf(stderr, "error evbit key\n");
  if (ioctl(fd, UI_SET_KEYBIT, BTN_1) < 0)
    fprintf(stderr, "error evbit button0\n");
  if (ioctl(fd, UI_SET_KEYBIT, BTN_2) < 0)
    fprintf(stderr, "error evbit button1\n");
  if (ioctl(fd, UI_SET_KEYBIT, BTN_3) < 0)
    fprintf(stderr, "error evbit button2\n");
  if (ioctl(fd, UI_SET_KEYBIT, BTN_4) < 0)
    fprintf(stderr, "error evbit button3\n");
  if (ioctl(fd, UI_SET_KEYBIT, BTN_5) < 0)
    fprintf(stderr, "error evbit button4\n");
  if (ioctl(fd, UI_SET_KEYBIT, BTN_6) < 0)
    fprintf(stderr, "error evbit button5\n");
  if (ioctl(fd, UI_SET_KEYBIT, BTN_SELECT) < 0)
    fprintf(stderr, "error evbit button6\n");
  if (ioctl(fd, UI_SET_KEYBIT, BTN_START) < 0)
    fprintf(stderr, "error evbit button7\n");
  if (ioctl(fd, UI_SET_KEYBIT, BTN_FORWARD) < 0)
    fprintf(stderr, "error evbit button8\n");
  if (ioctl(fd, UI_SET_KEYBIT, BTN_BACK) < 0)
    fprintf(stderr, "error evbit button9\n");
  if (ioctl(fd, UI_SET_KEYBIT, BTN_LEFT) < 0)
    fprintf(stderr, "error evbit button10\n");
  if (ioctl(fd, UI_SET_KEYBIT, BTN_RIGHT) < 0)
    fprintf(stderr, "error evbit button11\n");
  if (ioctl(fd, UI_SET_EVBIT, EV_ABS) < 0)
    fprintf(stderr, "error evbit absolute\n");
  for (i = ABS_X; i < ABS_MAX; i++)
    if (ioctl(fd, UI_SET_ABSBIT, i) < 0)
      fprintf(stderr, "error set absolute bit %d\n", i);
  for (j = ABS_Y; j < ABS_MAX; j++)
    if (ioctl(fd, UI_SET_ABSBIT, j) < 0)
      fprintf(stderr, "error set absolute bit %d\n", j);
  if (ioctl(fd, UI_DEV_CREATE) < 0) {
    fprintf(stderr, "error create\n");
  }
  if ((sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
    Die("Failed to create socket");
  }
  memset(&wifiserver, 0, sizeof(wifiserver));
  wifiserver.sin_family = AF_INET;
  wifiserver.sin_addr.s_addr = htonl(INADDR_ANY);
  wifiserver.sin_port = htons(atoi(argv[1]));
  serverlen = sizeof(wifiserver);
  if (bind(sock, (struct sockaddr *)&wifiserver, serverlen) < 0) {
    Die("Failed to bind server socket");
  }
  while (1) {
    clientlen = sizeof(wificlient);
    if ((received = recvfrom(sock, buffer, 11, 0,
                             (struct sockaddr *)&wificlient, &clientlen)) < 0) {
      Die("Failed to receive message");
    }
    send_event(fd, EV_ABS, ABS_X, buffer[6]);
    send_event(fd, EV_SYN, SYN_REPORT, 0);
    send_event(fd, EV_ABS, ABS_Y, buffer[7]);
    send_event(fd, EV_SYN, SYN_REPORT, 0);
    send_event(fd, EV_KEY, BTN_FORWARD, (1 == ((buffer[8] >> 4) & 1)));
    send_event(fd, EV_SYN, SYN_REPORT, 0);
    send_event(fd, EV_KEY, BTN_BACK, (1 == ((buffer[8] >> 6) & 1)));
    send_event(fd, EV_SYN, SYN_REPORT, 0);
    send_event(fd, EV_KEY, BTN_LEFT, (1 == ((buffer[8] >> 7) & 1)));
    send_event(fd, EV_SYN, SYN_REPORT, 0);
    send_event(fd, EV_KEY, BTN_RIGHT, (1 == ((buffer[8] >> 5) & 1)));
    send_event(fd, EV_SYN, SYN_REPORT, 0);
    send_event(fd, EV_KEY, BTN_SELECT, (1 == ((buffer[8] >> 0) & 1)));
    send_event(fd, EV_SYN, SYN_REPORT, 0);
    send_event(fd, EV_KEY, BTN_START, (1 == ((buffer[8] >> 3) & 1)));
    send_event(fd, EV_SYN, SYN_REPORT, 0);
    send_event(fd, EV_KEY, BTN_1, (1 == ((buffer[9] >> 6) & 1)));
    send_event(fd, EV_SYN, SYN_REPORT, 0);
    send_event(fd, EV_KEY, BTN_2, (1 == ((buffer[9] >> 5) & 1)));
    send_event(fd, EV_SYN, SYN_REPORT, 0);
    send_event(fd, EV_KEY, BTN_3, (1 == ((buffer[9] >> 7) & 1)));
    send_event(fd, EV_SYN, SYN_REPORT, 0);
    send_event(fd, EV_KEY, BTN_4, (1 == ((buffer[9] >> 4) & 1)));
    send_event(fd, EV_SYN, SYN_REPORT, 0);
    send_event(fd, EV_KEY, BTN_5, (1 == ((buffer[9] >> 0) & 1)));
    send_event(fd, EV_SYN, SYN_REPORT, 0);
    send_event(fd, EV_KEY, BTN_6, (1 == ((buffer[9] >> 1) & 1)));
    send_event(fd, EV_SYN, SYN_REPORT, 0);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1070 <memset@plt>
movl   $0x0,-0x100(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1273 <main+0x83>
mov    0x2d0c(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xdbc(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x2cee(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xdb0(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
mov    0x2d46(%rip),%rax
mov    (%rax),%esi
lea    0xdc5(%rip),%rdi
call   10d0 <open@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x24(%rbp),%edi
lea    0xdbf(%rip),%rsi
call   1030 <strcpy@plt>
mov    0x2d2f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
movl   $0x1,-0x34(%rbp)
movl   $0x1,-0x30(%rbp)
movl   $0x1,-0x2c(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2c24(%rip),%rcx
cmp    (%rcx),%eax
jge    131e <main+0x12e>
mov    -0x60(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x58(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x50(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x48(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12c2 <main+0xd2>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    0x2bc1(%rip),%rcx
cmp    (%rcx),%eax
jge    1381 <main+0x191>
mov    -0x60(%rbp),%rax
movslq -0x18(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x58(%rbp),%rax
movslq -0x18(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x50(%rbp),%rax
movslq -0x18(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x48(%rbp),%rax
movslq -0x18(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1325 <main+0x135>
mov    -0x58(%rbp),%rax
mov    0x2bc4(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x60(%rbp),%rax
mov    0x2baf(%rip),%rcx
mov    (%rcx),%rcx
movl   $0xff,(%rax,%rcx,4)
mov    -0x50(%rbp),%rax
mov    0x2b9a(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x48(%rbp),%rax
mov    0x2b85(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x58(%rbp),%rax
mov    0x2c18(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x60(%rbp),%rax
mov    0x2c03(%rip),%rcx
mov    (%rcx),%rcx
movl   $0xff,(%rax,%rcx,4)
mov    -0x50(%rbp),%rax
mov    0x2bee(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x48(%rbp),%rax
mov    0x2bd9(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%edi
lea    -0x60(%rbp),%rsi
mov    $0x40,%edx
call   1040 <write@plt>
cltq
cmp    $0x40,%rax
je     145d <main+0x26d>
mov    0x2af3(%rip),%rax
mov    (%rax),%edi
lea    0xc0c(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x1c(%rbp),%edi
mov    0x2b29(%rip),%rax
mov    (%rax),%esi
mov    0x2b38(%rip),%rax
mov    (%rax),%edx
mov    $0x0,%al
call   1080 <ioctl@plt>
cmp    $0x0,%rax
jge    149a <main+0x2aa>
mov    0x2ab6(%rip),%rax
mov    (%rax),%edi
lea    0xbdc(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x1c(%rbp),%edi
mov    0x2aa4(%rip),%rax
mov    (%rax),%esi
mov    0x2a73(%rip),%rax
mov    (%rax),%rdx
mov    $0x0,%al
call   1080 <ioctl@plt>
cmp    $0x0,%rax
jge    14d8 <main+0x2e8>
mov    0x2a78(%rip),%rax
mov    (%rax),%edi
lea    0xbaf(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x1c(%rbp),%edi
mov    0x2a66(%rip),%rax
mov    (%rax),%esi
mov    0x2a9d(%rip),%rax
mov    (%rax),%rdx
mov    $0x0,%al
call   1080 <ioctl@plt>
cmp    $0x0,%rax
jge    1516 <main+0x326>
mov    0x2a3a(%rip),%rax
mov    (%rax),%edi
lea    0xb86(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x1c(%rbp),%edi
mov    0x2a28(%rip),%rax
mov    (%rax),%esi
mov    0x29ef(%rip),%rax
mov    (%rax),%rdx
mov    $0x0,%al
call   1080 <ioctl@plt>
cmp    $0x0,%rax
jge    1554 <main+0x364>
mov    0x29fc(%rip),%rax
mov    (%rax),%edi
lea    0xb5d(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x1c(%rbp),%edi
mov    0x29ea(%rip),%rax
mov    (%rax),%esi
mov    0x2a19(%rip),%rax
mov    (%rax),%rdx
mov    $0x0,%al
call   1080 <ioctl@plt>
cmp    $0x0,%rax
jge    1592 <main+0x3a2>
mov    0x29be(%rip),%rax
mov    (%rax),%edi
lea    0xb34(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x1c(%rbp),%edi
mov    0x29ac(%rip),%rax
mov    (%rax),%esi
mov    0x2953(%rip),%rax
mov    (%rax),%rdx
mov    $0x0,%al
call   1080 <ioctl@plt>
cmp    $0x0,%rax
jge    15d0 <main+0x3e0>
mov    0x2980(%rip),%rax
mov    (%rax),%edi
lea    0xb0b(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x1c(%rbp),%edi
mov    0x296e(%rip),%rax
mov    (%rax),%esi
mov    0x2985(%rip),%rax
mov    (%rax),%rdx
mov    $0x0,%al
call   1080 <ioctl@plt>
cmp    $0x0,%rax
jge    160e <main+0x41e>
mov    0x2942(%rip),%rax
mov    (%rax),%edi
lea    0xae2(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x1c(%rbp),%edi
mov    0x2930(%rip),%rax
mov    (%rax),%esi
mov    0x297f(%rip),%rax
mov    (%rax),%rdx
mov    $0x0,%al
call   1080 <ioctl@plt>
cmp    $0x0,%rax
jge    164c <main+0x45c>
mov    0x2904(%rip),%rax
mov    (%rax),%edi
lea    0xab9(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x1c(%rbp),%edi
mov    0x28f2(%rip),%rax
mov    (%rax),%esi
mov    0x28c9(%rip),%rax
mov    (%rax),%rdx
mov    $0x0,%al
call   1080 <ioctl@plt>
cmp    $0x0,%rax
jge    168a <main+0x49a>
mov    0x28c6(%rip),%rax
mov    (%rax),%edi
lea    0xa90(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x1c(%rbp),%edi
mov    0x28b4(%rip),%rax
mov    (%rax),%esi
mov    0x2893(%rip),%rax
mov    (%rax),%rdx
mov    $0x0,%al
call   1080 <ioctl@plt>
cmp    $0x0,%rax
jge    16c8 <main+0x4d8>
mov    0x2888(%rip),%rax
mov    (%rax),%edi
lea    0xa67(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x1c(%rbp),%edi
mov    0x2876(%rip),%rax
mov    (%rax),%esi
mov    0x2895(%rip),%rax
mov    (%rax),%rdx
mov    $0x0,%al
call   1080 <ioctl@plt>
cmp    $0x0,%rax
jge    1706 <main+0x516>
mov    0x284a(%rip),%rax
mov    (%rax),%edi
lea    0xa3e(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x1c(%rbp),%edi
mov    0x2838(%rip),%rax
mov    (%rax),%esi
mov    0x2897(%rip),%rax
mov    (%rax),%rdx
mov    $0x0,%al
call   1080 <ioctl@plt>
cmp    $0x0,%rax
jge    1744 <main+0x554>
mov    0x280c(%rip),%rax
mov    (%rax),%edi
lea    0xa15(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x1c(%rbp),%edi
mov    0x27fa(%rip),%rax
mov    (%rax),%esi
mov    0x2899(%rip),%rax
mov    (%rax),%rdx
mov    $0x0,%al
call   1080 <ioctl@plt>
cmp    $0x0,%rax
jge    1782 <main+0x592>
mov    0x27ce(%rip),%rax
mov    (%rax),%edi
lea    0x9ed(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x1c(%rbp),%edi
mov    0x2804(%rip),%rax
mov    (%rax),%esi
mov    0x2753(%rip),%rax
mov    (%rax),%edx
mov    $0x0,%al
call   1080 <ioctl@plt>
cmp    $0x0,%rax
jge    17bf <main+0x5cf>
mov    0x2791(%rip),%rax
mov    (%rax),%edi
lea    0x9c6(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x278a(%rip),%rax
mov    (%rax),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x271a(%rip),%rcx
cmp    (%rcx),%eax
jge    182b <main+0x63b>
mov    -0x1c(%rbp),%edi
mov    0x2718(%rip),%rax
mov    (%rax),%esi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1080 <ioctl@plt>
cmp    $0x0,%rax
jge    1818 <main+0x628>
mov    0x273b(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
lea    0x983(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    181d <main+0x62d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    17cc <main+0x5dc>
mov    0x27c6(%rip),%rax
mov    (%rax),%rax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    0x26ae(%rip),%rcx
cmp    (%rcx),%eax
jge    1897 <main+0x6a7>
mov    -0x1c(%rbp),%edi
mov    0x26ac(%rip),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%edx
mov    $0x0,%al
call   1080 <ioctl@plt>
cmp    $0x0,%rax
jge    1884 <main+0x694>
mov    0x26cf(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%edx
lea    0x917(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    1889 <main+0x699>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1838 <main+0x648>
mov    -0x1c(%rbp),%edi
mov    0x2747(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1080 <ioctl@plt>
cmp    $0x0,%rax
jge    18cb <main+0x6db>
mov    0x2685(%rip),%rax
mov    (%rax),%edi
lea    0x8eb(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x2666(%rip),%rax
mov    (%rax),%edi
mov    0x269d(%rip),%rax
mov    (%rax),%esi
mov    0x2624(%rip),%rax
mov    (%rax),%edx
call   1110 <socket@plt>
mov    %eax,-0x64(%rbp)
cmp    $0x0,%eax
jge    1903 <main+0x713>
lea    0x8bf(%rip),%rdi
call   10b0 <Die@plt>
lea    -0xa8(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1070 <memset@plt>
mov    0x269b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x80(%rbp)
mov    0x266f(%rip),%rax
mov    (%rax),%edi
call   1060 <htonl@plt>
mov    %eax,-0x84(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10f0 <atoi@plt>
mov    %eax,%edi
call   1050 <htons@plt>
mov    %eax,-0x88(%rbp)
movl   $0x40,-0xfc(%rbp)
mov    -0x64(%rbp),%edi
lea    -0xa8(%rbp),%rsi
mov    -0xfc(%rbp),%edx
call   10c0 <bind@plt>
cmp    $0x0,%rax
jge    1985 <main+0x795>
lea    0x855(%rip),%rdi
call   10b0 <Die@plt>
jmp    198a <main+0x79a>
movl   $0x40,-0xf8(%rbp)
mov    -0x64(%rbp),%edi
lea    -0xf3(%rbp),%rsi
lea    -0xe8(%rbp),%r8
mov    $0xb,%edx
xor    %ecx,%ecx
lea    -0xf8(%rbp),%r9
call   10a0 <recvfrom@plt>
mov    %eax,-0x100(%rbp)
cmp    $0x0,%eax
jge    19d3 <main+0x7e3>
lea    0x824(%rip),%rdi
call   10b0 <Die@plt>
mov    -0x1c(%rbp),%edi
mov    0x250b(%rip),%rax
mov    (%rax),%esi
mov    0x256a(%rip),%rax
mov    (%rax),%rdx
movzbl -0xed(%rbp),%ecx
call   10e0 <send_event@plt>
mov    -0x1c(%rbp),%edi
mov    0x25d9(%rip),%rax
mov    (%rax),%esi
mov    0x2558(%rip),%rax
mov    (%rax),%rdx
xor    %ecx,%ecx
call   10e0 <send_event@plt>
mov    -0x1c(%rbp),%edi
mov    0x24cc(%rip),%rax
mov    (%rax),%esi
mov    0x25d3(%rip),%rax
mov    (%rax),%rdx
movzbl -0xec(%rbp),%ecx
call   10e0 <send_event@plt>
mov    -0x1c(%rbp),%edi
mov    0x259a(%rip),%rax
mov    (%rax),%esi
mov    0x2519(%rip),%rax
mov    (%rax),%rdx
xor    %ecx,%ecx
call   10e0 <send_event@plt>
mov    -0x1c(%rbp),%edi
mov    0x254d(%rip),%rax
mov    (%rax),%esi
mov    0x24cc(%rip),%rax
mov    (%rax),%rdx
movzbl -0xeb(%rbp),%ecx
sar    $0x4,%ecx
and    $0x1,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%ecx
call   10e0 <send_event@plt>
mov    -0x1c(%rbp),%edi
mov    0x2546(%rip),%rax
mov    (%rax),%esi
mov    0x24c5(%rip),%rax
mov    (%rax),%rdx
xor    %ecx,%ecx
call   10e0 <send_event@plt>
mov    -0x1c(%rbp),%edi
mov    0x24f9(%rip),%rax
mov    (%rax),%esi
mov    0x24b8(%rip),%rax
mov    (%rax),%rdx
movzbl -0xeb(%rbp),%ecx
sar    $0x6,%ecx
and    $0x1,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%ecx
call   10e0 <send_event@plt>
mov    -0x1c(%rbp),%edi
mov    0x24f2(%rip),%rax
mov    (%rax),%esi
mov    0x2471(%rip),%rax
mov    (%rax),%rdx
xor    %ecx,%ecx
call   10e0 <send_event@plt>
mov    -0x1c(%rbp),%edi
mov    0x24a5(%rip),%rax
mov    (%rax),%esi
mov    0x24a4(%rip),%rax
mov    (%rax),%rdx
movzbl -0xeb(%rbp),%ecx
sar    $0x7,%ecx
and    $0x1,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%ecx
call   10e0 <send_event@plt>
mov    -0x1c(%rbp),%edi
mov    0x249e(%rip),%rax
mov    (%rax),%esi
mov    0x241d(%rip),%rax
mov    (%rax),%rdx
xor    %ecx,%ecx
call   10e0 <send_event@plt>
mov    -0x1c(%rbp),%edi
mov    0x2451(%rip),%rax
mov    (%rax),%esi
mov    0x2490(%rip),%rax
mov    (%rax),%rdx
movzbl -0xeb(%rbp),%ecx
sar    $0x5,%ecx
and    $0x1,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%ecx
call   10e0 <send_event@plt>
mov    -0x1c(%rbp),%edi
mov    0x244a(%rip),%rax
mov    (%rax),%esi
mov    0x23c9(%rip),%rax
mov    (%rax),%rdx
xor    %ecx,%ecx
call   10e0 <send_event@plt>
mov    -0x1c(%rbp),%edi
mov    0x23fd(%rip),%rax
mov    (%rax),%esi
mov    0x23ec(%rip),%rax
mov    (%rax),%rdx
movzbl -0xeb(%rbp),%ecx
sar    $0x0,%ecx
and    $0x1,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%ecx
call   10e0 <send_event@plt>
mov    -0x1c(%rbp),%edi
mov    0x23f6(%rip),%rax
mov    (%rax),%esi
mov    0x2375(%rip),%rax
mov    (%rax),%rdx
xor    %ecx,%ecx
call   10e0 <send_event@plt>
mov    -0x1c(%rbp),%edi
mov    0x23a9(%rip),%rax
mov    (%rax),%esi
mov    0x2320(%rip),%rax
mov    (%rax),%rdx
movzbl -0xeb(%rbp),%ecx
sar    $0x3,%ecx
and    $0x1,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%ecx
call   10e0 <send_event@plt>
mov    -0x1c(%rbp),%edi
mov    0x23a2(%rip),%rax
mov    (%rax),%esi
mov    0x2321(%rip),%rax
mov    (%rax),%rdx
xor    %ecx,%ecx
call   10e0 <send_event@plt>
mov    -0x1c(%rbp),%edi
mov    0x2355(%rip),%rax
mov    (%rax),%esi
mov    0x22c4(%rip),%rax
mov    (%rax),%rdx
movzbl -0xea(%rbp),%ecx
sar    $0x6,%ecx
and    $0x1,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%ecx
call   10e0 <send_event@plt>
mov    -0x1c(%rbp),%edi
mov    0x234e(%rip),%rax
mov    (%rax),%esi
mov    0x22cd(%rip),%rax
mov    (%rax),%rdx
xor    %ecx,%ecx
call   10e0 <send_event@plt>
mov    -0x1c(%rbp),%edi
mov    0x2301(%rip),%rax
mov    (%rax),%esi
mov    0x22d8(%rip),%rax
mov    (%rax),%rdx
movzbl -0xea(%rbp),%ecx
sar    $0x5,%ecx
and    $0x1,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%ecx
call   10e0 <send_event@plt>
mov    -0x1c(%rbp),%edi
mov    0x22fa(%rip),%rax
mov    (%rax),%esi
mov    0x2279(%rip),%rax
mov    (%rax),%rdx
xor    %ecx,%ecx
call   10e0 <send_event@plt>
mov    -0x1c(%rbp),%edi
mov    0x22ad(%rip),%rax
mov    (%rax),%esi
mov    0x2214(%rip),%rax
mov    (%rax),%rdx
movzbl -0xea(%rbp),%ecx
sar    $0x7,%ecx
and    $0x1,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%ecx
call   10e0 <send_event@plt>
mov    -0x1c(%rbp),%edi
mov    0x22a6(%rip),%rax
mov    (%rax),%esi
mov    0x2225(%rip),%rax
mov    (%rax),%rdx
xor    %ecx,%ecx
call   10e0 <send_event@plt>
mov    -0x1c(%rbp),%edi
mov    0x2259(%rip),%rax
mov    (%rax),%esi
mov    0x2228(%rip),%rax
mov    (%rax),%rdx
movzbl -0xea(%rbp),%ecx
sar    $0x4,%ecx
and    $0x1,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%ecx
call   10e0 <send_event@plt>
mov    -0x1c(%rbp),%edi
mov    0x2252(%rip),%rax
mov    (%rax),%esi
mov    0x21d1(%rip),%rax
mov    (%rax),%rdx
xor    %ecx,%ecx
call   10e0 <send_event@plt>
mov    -0x1c(%rbp),%edi
mov    0x2205(%rip),%rax
mov    (%rax),%esi
mov    0x214c(%rip),%rax
mov    (%rax),%rdx
movzbl -0xea(%rbp),%ecx
sar    $0x0,%ecx
and    $0x1,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%ecx
call   10e0 <send_event@plt>
mov    -0x1c(%rbp),%edi
mov    0x21fe(%rip),%rax
mov    (%rax),%esi
mov    0x217d(%rip),%rax
mov    (%rax),%rdx
xor    %ecx,%ecx
call   10e0 <send_event@plt>
mov    -0x1c(%rbp),%edi
mov    0x21b1(%rip),%rax
mov    (%rax),%esi
mov    0x2168(%rip),%rax
mov    (%rax),%rdx
movzbl -0xea(%rbp),%ecx
sar    $0x1,%ecx
and    $0x1,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%ecx
call   10e0 <send_event@plt>
mov    -0x1c(%rbp),%edi
mov    0x21aa(%rip),%rax
mov    (%rax),%esi
mov    0x2129(%rip),%rax
mov    (%rax),%rdx
xor    %ecx,%ecx
call   10e0 <send_event@plt>
jmp    198a <main+0x79a>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
mov    %rsi,%r14
mov    %edi,%ebx
lea    0x10(%rsp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1070 <memset@plt>
cmp    $0x2,%ebx
jne    1ad6 <main+0x8e6>
mov    0x2d99(%rip),%rax
mov    (%rax),%esi
lea    0xe18(%rip),%rdi
call   10d0 <open@plt>
mov    %eax,%ebx
mov    0x4c(%rsp),%edi
lea    0xe12(%rip),%rsi
call   1030 <strcpy@plt>
mov    0x2d82(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x48(%rsp)
movabs $0x100000001,%rax
mov    %rax,0x3c(%rsp)
movl   $0x1,0x44(%rsp)
mov    0x2c7e(%rip),%r12
cmpl   $0x0,(%r12)
jle    131b <main+0x12b>
mov    0x10(%rsp),%rax
mov    0x18(%rsp),%rcx
mov    0x20(%rsp),%rdx
mov    0x28(%rsp),%rsi
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movl   $0xffffffff,(%rax,%rdi,4)
movl   $0xffffffff,(%rcx,%rdi,4)
movl   $0xffffffff,(%rdx,%rdi,4)
movl   $0xffffffff,(%rsi,%rdi,4)
add    $0x1,%rdi
movslq (%r12),%rbp
cmp    %rbp,%rdi
jl     12a0 <main+0xb0>
test   %ebp,%ebp
jle    131b <main+0x12b>
mov    0x10(%rsp),%rax
mov    0x18(%rsp),%rdx
mov    0x20(%rsp),%rcx
mov    0x28(%rsp),%rsi
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movl   $0xffffffff,(%rax,%rdi,4)
movl   $0xffffffff,(%rdx,%rdi,4)
movl   $0xffffffff,(%rcx,%rdi,4)
movl   $0xffffffff,(%rsi,%rdi,4)
add    $0x1,%rdi
movslq (%r12),%rbp
cmp    %rbp,%rdi
jl     12f0 <main+0x100>
jmp    132f <main+0x13f>
mov    0x10(%rsp),%rax
mov    0x18(%rsp),%rdx
mov    0x20(%rsp),%rcx
mov    0x28(%rsp),%rsi
mov    %r14,0x50(%rsp)
mov    0x2c15(%rip),%rdi
mov    (%rdi),%rdi
movl   $0x0,(%rdx,%rdi,4)
movl   $0xff,(%rax,%rdi,4)
movl   $0x0,(%rcx,%rdi,4)
movl   $0x0,(%rsi,%rdi,4)
mov    0x2c97(%rip),%rdi
mov    (%rdi),%rdi
movl   $0x0,(%rdx,%rdi,4)
movl   $0xff,(%rax,%rdi,4)
movl   $0x0,(%rcx,%rdi,4)
movl   $0x0,(%rsi,%rdi,4)
lea    0x10(%rsp),%rsi
mov    %ebx,%edi
mov    $0x40,%edx
call   1040 <write@plt>
cmp    $0x40,%eax
je     13ad <main+0x1bd>
mov    0x2ba3(%rip),%rax
mov    (%rax),%edi
lea    0xcbc(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x2bdc(%rip),%r14
mov    (%r14),%esi
mov    0x2bea(%rip),%r13
mov    0x0(%r13),%edx
mov    %ebx,%edi
xor    %eax,%eax
call   1080 <ioctl@plt>
test   %rax,%rax
jns    13e7 <main+0x1f7>
mov    0x2b69(%rip),%rax
mov    (%rax),%edi
lea    0xc8f(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x2b5a(%rip),%rbp
mov    0x0(%rbp),%esi
mov    0x2b28(%rip),%rax
mov    (%rax),%rdx
mov    %ebx,%edi
xor    %eax,%eax
call   1080 <ioctl@plt>
test   %rax,%rax
jns    1420 <main+0x230>
mov    0x2b30(%rip),%rax
mov    (%rax),%edi
lea    0xc67(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x0(%rbp),%esi
mov    0x2b5e(%rip),%rax
mov    (%rax),%rdx
mov    %ebx,%edi
xor    %eax,%eax
call   1080 <ioctl@plt>
test   %rax,%rax
jns    1452 <main+0x262>
mov    0x2afe(%rip),%rax
mov    (%rax),%edi
lea    0xc4a(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x0(%rbp),%esi
mov    0x2abc(%rip),%rax
mov    (%rax),%rdx
mov    %ebx,%edi
xor    %eax,%eax
call   1080 <ioctl@plt>
test   %rax,%rax
jns    1484 <main+0x294>
mov    0x2acc(%rip),%rax
mov    (%rax),%edi
lea    0xc2d(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x0(%rbp),%esi
mov    0x2af2(%rip),%rax
mov    (%rax),%rdx
mov    %ebx,%edi
xor    %eax,%eax
call   1080 <ioctl@plt>
test   %rax,%rax
jns    14b6 <main+0x2c6>
mov    0x2a9a(%rip),%rax
mov    (%rax),%edi
lea    0xc10(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x0(%rbp),%esi
mov    0x2a38(%rip),%rax
mov    (%rax),%rdx
mov    %ebx,%edi
xor    %eax,%eax
call   1080 <ioctl@plt>
test   %rax,%rax
jns    14e8 <main+0x2f8>
mov    0x2a68(%rip),%rax
mov    (%rax),%edi
lea    0xbf3(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x0(%rbp),%esi
mov    0x2a76(%rip),%rax
mov    (%rax),%rdx
mov    %ebx,%edi
xor    %eax,%eax
call   1080 <ioctl@plt>
test   %rax,%rax
jns    151a <main+0x32a>
mov    0x2a36(%rip),%rax
mov    (%rax),%edi
lea    0xbd6(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x0(%rbp),%esi
mov    0x2a7c(%rip),%rax
mov    (%rax),%rdx
mov    %ebx,%edi
xor    %eax,%eax
call   1080 <ioctl@plt>
test   %rax,%rax
jns    154c <main+0x35c>
mov    0x2a04(%rip),%rax
mov    (%rax),%edi
lea    0xbb9(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x0(%rbp),%esi
mov    0x29d2(%rip),%rax
mov    (%rax),%rdx
mov    %ebx,%edi
xor    %eax,%eax
call   1080 <ioctl@plt>
test   %rax,%rax
jns    157e <main+0x38e>
mov    0x29d2(%rip),%rax
mov    (%rax),%edi
lea    0xb9c(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x0(%rbp),%esi
mov    0x29a8(%rip),%rax
mov    (%rax),%rdx
mov    %ebx,%edi
xor    %eax,%eax
call   1080 <ioctl@plt>
test   %rax,%rax
jns    15b0 <main+0x3c0>
mov    0x29a0(%rip),%rax
mov    (%rax),%edi
lea    0xb7f(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x0(%rbp),%esi
mov    0x29b6(%rip),%rax
mov    (%rax),%rdx
mov    %ebx,%edi
xor    %eax,%eax
call   1080 <ioctl@plt>
test   %rax,%rax
jns    15e2 <main+0x3f2>
mov    0x296e(%rip),%rax
mov    (%rax),%edi
lea    0xb62(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x0(%rbp),%esi
mov    0x29c4(%rip),%rax
mov    (%rax),%rdx
mov    %ebx,%edi
xor    %eax,%eax
call   1080 <ioctl@plt>
test   %rax,%rax
jns    1614 <main+0x424>
mov    0x293c(%rip),%rax
mov    (%rax),%edi
lea    0xb45(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x0(%rbp),%esi
mov    0x29d2(%rip),%rax
mov    (%rax),%rdx
mov    %ebx,%edi
xor    %eax,%eax
call   1080 <ioctl@plt>
test   %rax,%rax
jns    1646 <main+0x456>
mov    0x290a(%rip),%rax
mov    (%rax),%edi
lea    0xb29(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    (%r14),%esi
mov    0x2898(%rip),%r14
mov    (%r14),%edx
mov    %ebx,%edi
xor    %eax,%eax
call   1080 <ioctl@plt>
test   %rax,%rax
jns    1678 <main+0x488>
mov    0x28d8(%rip),%rax
mov    (%rax),%edi
lea    0xb0d(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x28d1(%rip),%rax
mov    (%rax),%ebp
mov    %r12,%r15
mov    (%r12),%eax
cmp    %ebp,%eax
jle    16d9 <main+0x4e9>
mov    0x286d(%rip),%r12
jmp    16aa <main+0x4ba>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebp
mov    (%r15),%eax
cmp    %eax,%ebp
jge    16d9 <main+0x4e9>
mov    (%r12),%esi
mov    %ebx,%edi
mov    %ebp,%edx
xor    %eax,%eax
call   1080 <ioctl@plt>
test   %rax,%rax
jns    16a0 <main+0x4b0>
mov    0x287b(%rip),%rax
mov    (%rax),%edi
lea    0xac6(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1090 <fprintf@plt>
jmp    16a0 <main+0x4b0>
mov    0x2918(%rip),%rcx
mov    (%rcx),%ebp
cmp    %ebp,%eax
jle    1727 <main+0x537>
mov    0x2813(%rip),%r12
jmp    16f8 <main+0x508>
nop
add    $0x1,%ebp
cmp    (%r15),%ebp
jge    1727 <main+0x537>
mov    (%r12),%esi
mov    %ebx,%edi
mov    %ebp,%edx
xor    %eax,%eax
call   1080 <ioctl@plt>
test   %rax,%rax
jns    16f0 <main+0x500>
mov    0x282d(%rip),%rax
mov    (%rax),%edi
lea    0xa78(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1090 <fprintf@plt>
jmp    16f0 <main+0x500>
mov    0x28ba(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
xor    %eax,%eax
call   1080 <ioctl@plt>
test   %rax,%rax
jns    1755 <main+0x565>
mov    0x27fb(%rip),%rax
mov    (%rax),%edi
lea    0xa61(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x27dc(%rip),%rax
mov    (%rax),%edi
mov    0x2813(%rip),%rax
mov    (%rax),%esi
mov    0x279a(%rip),%rax
mov    (%rax),%edx
call   1110 <socket@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    1787 <main+0x597>
lea    0xa3b(%rip),%rdi
call   10b0 <Die@plt>
lea    0x58(%rsp),%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1070 <memset@plt>
mov    0x2816(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x80(%rsp)
mov    0x27e6(%rip),%rax
mov    (%rax),%edi
call   1060 <htonl@plt>
mov    %eax,0x7c(%rsp)
mov    0x50(%rsp),%rax
mov    0x8(%rax),%rdi
call   10f0 <atoi@plt>
mov    %eax,%edi
call   1050 <htons@plt>
mov    %eax,0x78(%rsp)
mov    %ebp,%edi
mov    %r15,%rsi
mov    $0x40,%edx
call   10c0 <bind@plt>
test   %rax,%rax
jns    17f6 <main+0x606>
lea    0x9e4(%rip),%rdi
call   10b0 <Die@plt>
mov    0x27db(%rip),%r15
mov    0x275c(%rip),%r12
jmp    1a95 <main+0x8a5>
nopl   0x0(%rax)
mov    (%r14),%esi
mov    0x2736(%rip),%rax
mov    (%rax),%rdx
movzbl 0x7(%rsp),%ecx
mov    %ebx,%edi
call   10e0 <send_event@plt>
mov    (%r15),%esi
mov    (%r12),%rdx
mov    %ebx,%edi
xor    %ecx,%ecx
call   10e0 <send_event@plt>
mov    (%r14),%esi
mov    0x27b5(%rip),%rax
mov    (%rax),%rdx
movzbl 0x8(%rsp),%ecx
mov    %ebx,%edi
call   10e0 <send_event@plt>
mov    (%r15),%esi
mov    (%r12),%rdx
mov    %ebx,%edi
xor    %ecx,%ecx
call   10e0 <send_event@plt>
mov    0x0(%r13),%esi
mov    0x26c3(%rip),%rax
mov    (%rax),%rdx
movzbl 0x9(%rsp),%ecx
shr    $0x4,%ecx
and    $0x1,%ecx
mov    %ebx,%edi
call   10e0 <send_event@plt>
mov    (%r15),%esi
mov    (%r12),%rdx
mov    %ebx,%edi
xor    %ecx,%ecx
call   10e0 <send_event@plt>
mov    0x0(%r13),%esi
mov    0x26d3(%rip),%rax
mov    (%rax),%rdx
movzbl 0x9(%rsp),%ecx
shr    $0x6,%ecx
and    $0x1,%ecx
mov    %ebx,%edi
call   10e0 <send_event@plt>
mov    (%r15),%esi
mov    (%r12),%rdx
mov    %ebx,%edi
xor    %ecx,%ecx
call   10e0 <send_event@plt>
mov    0x0(%r13),%esi
mov    0x26e3(%rip),%rax
mov    (%rax),%rdx
movzbl 0x9(%rsp),%ecx
shr    $0x7,%ecx
mov    %ebx,%edi
call   10e0 <send_event@plt>
mov    (%r15),%esi
mov    (%r12),%rdx
mov    %ebx,%edi
xor    %ecx,%ecx
call   10e0 <send_event@plt>
mov    0x0(%r13),%esi
mov    0x26f6(%rip),%rax
mov    (%rax),%rdx
movzbl 0x9(%rsp),%ecx
shr    $0x5,%ecx
and    $0x1,%ecx
mov    %ebx,%edi
call   10e0 <send_event@plt>
mov    (%r15),%esi
mov    (%r12),%rdx
mov    %ebx,%edi
xor    %ecx,%ecx
call   10e0 <send_event@plt>
mov    0x0(%r13),%esi
mov    0x2676(%rip),%rax
mov    (%rax),%rdx
movzbl 0x9(%rsp),%ecx
and    $0x1,%ecx
mov    %ebx,%edi
call   10e0 <send_event@plt>
mov    (%r15),%esi
mov    (%r12),%rdx
mov    %ebx,%edi
xor    %ecx,%ecx
call   10e0 <send_event@plt>
mov    0x0(%r13),%esi
mov    0x25d1(%rip),%rax
mov    (%rax),%rdx
movzbl 0x9(%rsp),%ecx
shr    $0x3,%ecx
and    $0x1,%ecx
mov    %ebx,%edi
call   10e0 <send_event@plt>
mov    (%r15),%esi
mov    (%r12),%rdx
mov    %ebx,%edi
xor    %ecx,%ecx
call   10e0 <send_event@plt>
mov    0x0(%r13),%esi
mov    0x2599(%rip),%rax
mov    (%rax),%rdx
movzbl 0xa(%rsp),%ecx
shr    $0x6,%ecx
and    $0x1,%ecx
mov    %ebx,%edi
call   10e0 <send_event@plt>
mov    (%r15),%esi
mov    (%r12),%rdx
mov    %ebx,%edi
xor    %ecx,%ecx
call   10e0 <send_event@plt>
mov    0x0(%r13),%esi
mov    0x25d1(%rip),%rax
mov    (%rax),%rdx
movzbl 0xa(%rsp),%ecx
shr    $0x5,%ecx
and    $0x1,%ecx
mov    %ebx,%edi
call   10e0 <send_event@plt>
mov    (%r15),%esi
mov    (%r12),%rdx
mov    %ebx,%edi
xor    %ecx,%ecx
call   10e0 <send_event@plt>
mov    0x0(%r13),%esi
mov    0x2531(%rip),%rax
mov    (%rax),%rdx
movzbl 0xa(%rsp),%ecx
shr    $0x7,%ecx
mov    %ebx,%edi
call   10e0 <send_event@plt>
mov    (%r15),%esi
mov    (%r12),%rdx
mov    %ebx,%edi
xor    %ecx,%ecx
call   10e0 <send_event@plt>
mov    0x0(%r13),%esi
mov    0x256c(%rip),%rax
mov    (%rax),%rdx
movzbl 0xa(%rsp),%ecx
shr    $0x4,%ecx
and    $0x1,%ecx
mov    %ebx,%edi
call   10e0 <send_event@plt>
mov    (%r15),%esi
mov    (%r12),%rdx
mov    %ebx,%edi
xor    %ecx,%ecx
call   10e0 <send_event@plt>
mov    0x0(%r13),%esi
mov    0x24b4(%rip),%rax
mov    (%rax),%rdx
movzbl 0xa(%rsp),%ecx
and    $0x1,%ecx
mov    %ebx,%edi
call   10e0 <send_event@plt>
mov    (%r15),%esi
mov    (%r12),%rdx
mov    %ebx,%edi
xor    %ecx,%ecx
call   10e0 <send_event@plt>
mov    0x0(%r13),%esi
mov    0x24f7(%rip),%rax
mov    (%rax),%rdx
movzbl 0xa(%rsp),%ecx
shr    %ecx
and    $0x1,%ecx
mov    %ebx,%edi
call   10e0 <send_event@plt>
mov    (%r15),%esi
mov    (%r12),%rdx
mov    %ebx,%edi
xor    %ecx,%ecx
call   10e0 <send_event@plt>
movl   $0x40,0xc(%rsp)
mov    %ebp,%edi
lea    0x1(%rsp),%rsi
mov    $0xb,%edx
xor    %ecx,%ecx
lea    0x98(%rsp),%r8
lea    0xc(%rsp),%r9
call   10a0 <recvfrom@plt>
test   %eax,%eax
jns    1810 <main+0x620>
lea    0x726(%rip),%rdi
call   10b0 <Die@plt>
jmp    1810 <main+0x620>
mov    0x2463(%rip),%rbx
mov    (%rbx),%edi
mov    (%r14),%rdx
lea    0x517(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    (%rbx),%edi
mov    (%r14),%rdx
lea    0x516(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   1100 <exit@plt>

LLVM IR (-O0):
%struct.uinput_user_dev = type { i32*, i32*, i32*, i32*, i32, %struct.TYPE_3__, i32, %struct.TYPE_4__, i32 }
%struct.TYPE_3__ = type { i32 }
%struct.TYPE_4__ = type { i32, i32, i32, i32 }
%struct.sockaddr_in = type { i32*, i32*, i32*, i32*, i32, %struct.TYPE_3__, i32, %struct.TYPE_4__, i32 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [18 x i8] c"USAGE: %s <port>\0A\00"
@.str.1 = [54 x i8] c"\0A\0920001 -> Controller 1\0A\0920002 -> Controller 2\0A\09....\0A\00"
@.str.2 = [12 x i8] c"/dev/uinput\00"
@O_RDWR = global i32 0
@.str.3 = [14 x i8] c"wificontoller\00"
@BUS_USB = global i32 0
@ABS_MAX = global i32 0
@ABS_X = global i64 0
@ABS_Y = global i64 0
@.str.4 = [13 x i8] c"error setup\0A\00"
@UI_SET_EVBIT = global i32 0
@EV_KEY = global i32 0
@.str.5 = [17 x i8] c"error evbit key\0A\00"
@UI_SET_KEYBIT = global i32 0
@BTN_1 = global i64 0
@.str.6 = [21 x i8] c"error evbit button0\0A\00"
@BTN_2 = global i64 0
@.str.7 = [21 x i8] c"error evbit button1\0A\00"
@BTN_3 = global i64 0
@.str.8 = [21 x i8] c"error evbit button2\0A\00"
@BTN_4 = global i64 0
@.str.9 = [21 x i8] c"error evbit button3\0A\00"
@BTN_5 = global i64 0
@.str.10 = [21 x i8] c"error evbit button4\0A\00"
@BTN_6 = global i64 0
@.str.11 = [21 x i8] c"error evbit button5\0A\00"
@BTN_SELECT = global i64 0
@.str.12 = [21 x i8] c"error evbit button6\0A\00"
@BTN_START = global i64 0
@.str.13 = [21 x i8] c"error evbit button7\0A\00"
@BTN_FORWARD = global i64 0
@.str.14 = [21 x i8] c"error evbit button8\0A\00"
@BTN_BACK = global i64 0
@.str.15 = [21 x i8] c"error evbit button9\0A\00"
@BTN_LEFT = global i64 0
@.str.16 = [22 x i8] c"error evbit button10\0A\00"
@BTN_RIGHT = global i64 0
@.str.17 = [22 x i8] c"error evbit button11\0A\00"
@EV_ABS = global i32 0
@.str.18 = [22 x i8] c"error evbit absolute\0A\00"
@UI_SET_ABSBIT = global i32 0
@.str.19 = [27 x i8] c"error set absolute bit %d\0A\00"
@UI_DEV_CREATE = global i32 0
@.str.20 = [14 x i8] c"error create\0A\00"
@PF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@IPPROTO_UDP = global i32 0
@.str.21 = [24 x i8] c"Failed to create socket\00"
@AF_INET = global i32 0
@INADDR_ANY = global i32 0
@.str.22 = [29 x i8] c"Failed to bind server socket\00"
@.str.23 = [26 x i8] c"Failed to receive message\00"
@EV_SYN = global i32 0
@SYN_REPORT = global i64 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca %struct.uinput_user_dev
%10 = alloca i32
%11 = alloca %struct.sockaddr_in
%12 = alloca %struct.sockaddr_in
%13 = alloca [11 x i8]
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%17 = call i32 @memset(%struct.uinput_user_dev* %9, i32 0, i32 64)
store i32 0, i32* %16
%18 = load i32, i32* %4
%19 = icmp ne i32 %18, 2
br i1 %19, label %20, label %32
20: ; preds = %2
%21 = load i32, i32* @stderr
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %24)
%26 = load i32, i32* @stderr
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 0
%29 = load i8*, i8** %28
%30 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0), i8* %29)
%31 = call i32 @exit(i32 1)
unreachable
32: ; preds = %2
%33 = load i32, i32* @O_RDWR
%34 = call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %33)
store i32 %34, i32* %8
%35 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %9, i32 0, i32 8
%36 = load i32, i32* %35
%37 = call i32 @strcpy(i32 %36, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%38 = load i32, i32* @BUS_USB
%39 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %9, i32 0, i32 7
%40 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %39, i32 0, i32 3
store i32 %38, i32* %40
%41 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %9, i32 0, i32 7
%42 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %41, i32 0, i32 0
store i32 1, i32* %42
%43 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %9, i32 0, i32 7
%44 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %43, i32 0, i32 1
store i32 1, i32* %44
%45 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %9, i32 0, i32 7
%46 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %45, i32 0, i32 2
store i32 1, i32* %46
store i32 0, i32* %6
br label %47
47: ; preds = %72, %32
%48 = load i32, i32* %6
%49 = load i32, i32* @ABS_MAX
%50 = icmp slt i32 %48, %49
br i1 %50, label %51, label %75
51: ; preds = %47
%52 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %9, i32 0, i32 0
%53 = load i32*, i32** %52
%54 = load i32, i32* %6
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i32, i32* %53, i64 %55
store i32 -1, i32* %56
%57 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %9, i32 0, i32 1
%58 = load i32*, i32** %57
%59 = load i32, i32* %6
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i32, i32* %58, i64 %60
store i32 -1, i32* %61
%62 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %9, i32 0, i32 2
%63 = load i32*, i32** %62
%64 = load i32, i32* %6
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i32, i32* %63, i64 %65
store i32 -1, i32* %66
%67 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %9, i32 0, i32 3
%68 = load i32*, i32** %67
%69 = load i32, i32* %6
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i32, i32* %68, i64 %70
store i32 -1, i32* %71
br label %72
72: ; preds = %51
%73 = load i32, i32* %6
%74 = add nsw i32 %73, 1
store i32 %74, i32* %6
br label %47
75: ; preds = %47
store i32 0, i32* %7
br label %76
76: ; preds = %101, %75
%77 = load i32, i32* %7
%78 = load i32, i32* @ABS_MAX
%79 = icmp slt i32 %77, %78
br i1 %79, label %80, label %104
80: ; preds = %76
%81 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %9, i32 0, i32 0
%82 = load i32*, i32** %81
%83 = load i32, i32* %7
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i32, i32* %82, i64 %84
store i32 -1, i32* %85
%86 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %9, i32 0, i32 1
%87 = load i32*, i32** %86
%88 = load i32, i32* %7
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds i32, i32* %87, i64 %89
store i32 -1, i32* %90
%91 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %9, i32 0, i32 2
%92 = load i32*, i32** %91
%93 = load i32, i32* %7
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds i32, i32* %92, i64 %94
store i32 -1, i32* %95
%96 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %9, i32 0, i32 3
%97 = load i32*, i32** %96
%98 = load i32, i32* %7
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds i32, i32* %97, i64 %99
store i32 -1, i32* %100
br label %101
101: ; preds = %80
%102 = load i32, i32* %7
%103 = add nsw i32 %102, 1
store i32 %103, i32* %7
br label %76
104: ; preds = %76
%105 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %9, i32 0, i32 1
%106 = load i32*, i32** %105
%107 = load i64, i64* @ABS_X
%108 = getelementptr inbounds i32, i32* %106, i64 %107
store i32 0, i32* %108
%109 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %9, i32 0, i32 0
%110 = load i32*, i32** %109
%111 = load i64, i64* @ABS_X
%112 = getelementptr inbounds i32, i32* %110, i64 %111
store i32 255, i32* %112
%113 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %9, i32 0, i32 2
%114 = load i32*, i32** %113
%115 = load i64, i64* @ABS_X
%116 = getelementptr inbounds i32, i32* %114, i64 %115
store i32 0, i32* %116
%117 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %9, i32 0, i32 3
%118 = load i32*, i32** %117
%119 = load i64, i64* @ABS_X
%120 = getelementptr inbounds i32, i32* %118, i64 %119
store i32 0, i32* %120
%121 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %9, i32 0, i32 1
%122 = load i32*, i32** %121
%123 = load i64, i64* @ABS_Y
%124 = getelementptr inbounds i32, i32* %122, i64 %123
store i32 0, i32* %124
%125 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %9, i32 0, i32 0
%126 = load i32*, i32** %125
%127 = load i64, i64* @ABS_Y
%128 = getelementptr inbounds i32, i32* %126, i64 %127
store i32 255, i32* %128
%129 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %9, i32 0, i32 2
%130 = load i32*, i32** %129
%131 = load i64, i64* @ABS_Y
%132 = getelementptr inbounds i32, i32* %130, i64 %131
store i32 0, i32* %132
%133 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %9, i32 0, i32 3
%134 = load i32*, i32** %133
%135 = load i64, i64* @ABS_Y
%136 = getelementptr inbounds i32, i32* %134, i64 %135
store i32 0, i32* %136
%137 = load i32, i32* %8
%138 = call i32 @write(i32 %137, %struct.uinput_user_dev* %9, i32 64)
%139 = sext i32 %138 to i64
%140 = icmp ne i64 %139, 64
br i1 %140, label %141, label %144
141: ; preds = %104
%142 = load i32, i32* @stderr
%143 = call i32 (i32, i8*, ...) @fprintf(i32 %142, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
br label %144
144: ; preds = %141, %104
%145 = load i32, i32* %8
%146 = load i32, i32* @UI_SET_EVBIT
%147 = load i32, i32* @EV_KEY
%148 = call i64 (i32, i32, ...) @ioctl(i32 %145, i32 %146, i32 %147)
%149 = icmp slt i64 %148, 0
br i1 %149, label %150, label %153
150: ; preds = %144
%151 = load i32, i32* @stderr
%152 = call i32 (i32, i8*, ...) @fprintf(i32 %151, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
br label %153
153: ; preds = %150, %144
%154 = load i32, i32* %8
%155 = load i32, i32* @UI_SET_KEYBIT
%156 = load i64, i64* @BTN_1
%157 = call i64 (i32, i32, ...) @ioctl(i32 %154, i32 %155, i64 %156)
%158 = icmp slt i64 %157, 0
br i1 %158, label %159, label %162
159: ; preds = %153
%160 = load i32, i32* @stderr
%161 = call i32 (i32, i8*, ...) @fprintf(i32 %160, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
br label %162
162: ; preds = %159, %153
%163 = load i32, i32* %8
%164 = load i32, i32* @UI_SET_KEYBIT
%165 = load i64, i64* @BTN_2
%166 = call i64 (i32, i32, ...) @ioctl(i32 %163, i32 %164, i64 %165)
%167 = icmp slt i64 %166, 0
br i1 %167, label %168, label %171
168: ; preds = %162
%169 = load i32, i32* @stderr
%170 = call i32 (i32, i8*, ...) @fprintf(i32 %169, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
br label %171
171: ; preds = %168, %162
%172 = load i32, i32* %8
%173 = load i32, i32* @UI_SET_KEYBIT
%174 = load i64, i64* @BTN_3
%175 = call i64 (i32, i32, ...) @ioctl(i32 %172, i32 %173, i64 %174)
%176 = icmp slt i64 %175, 0
br i1 %176, label %177, label %180
177: ; preds = %171
%178 = load i32, i32* @stderr
%179 = call i32 (i32, i8*, ...) @fprintf(i32 %178, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0))
br label %180
180: ; preds = %177, %171
%181 = load i32, i32* %8
%182 = load i32, i32* @UI_SET_KEYBIT
%183 = load i64, i64* @BTN_4
%184 = call i64 (i32, i32, ...) @ioctl(i32 %181, i32 %182, i64 %183)
%185 = icmp slt i64 %184, 0
br i1 %185, label %186, label %189
186: ; preds = %180
%187 = load i32, i32* @stderr
%188 = call i32 (i32, i8*, ...) @fprintf(i32 %187, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0))
br label %189
189: ; preds = %186, %180
%190 = load i32, i32* %8
%191 = load i32, i32* @UI_SET_KEYBIT
%192 = load i64, i64* @BTN_5
%193 = call i64 (i32, i32, ...) @ioctl(i32 %190, i32 %191, i64 %192)
%194 = icmp slt i64 %193, 0
br i1 %194, label %195, label %198
195: ; preds = %189
%196 = load i32, i32* @stderr
%197 = call i32 (i32, i8*, ...) @fprintf(i32 %196, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i64 0, i64 0))
br label %198
198: ; preds = %195, %189
%199 = load i32, i32* %8
%200 = load i32, i32* @UI_SET_KEYBIT
%201 = load i64, i64* @BTN_6
%202 = call i64 (i32, i32, ...) @ioctl(i32 %199, i32 %200, i64 %201)
%203 = icmp slt i64 %202, 0
br i1 %203, label %204, label %207
204: ; preds = %198
%205 = load i32, i32* @stderr
%206 = call i32 (i32, i8*, ...) @fprintf(i32 %205, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0))
br label %207
207: ; preds = %204, %198
%208 = load i32, i32* %8
%209 = load i32, i32* @UI_SET_KEYBIT
%210 = load i64, i64* @BTN_SELECT
%211 = call i64 (i32, i32, ...) @ioctl(i32 %208, i32 %209, i64 %210)
%212 = icmp slt i64 %211, 0
br i1 %212, label %213, label %216
213: ; preds = %207
%214 = load i32, i32* @stderr
%215 = call i32 (i32, i8*, ...) @fprintf(i32 %214, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0))
br label %216
216: ; preds = %213, %207
%217 = load i32, i32* %8
%218 = load i32, i32* @UI_SET_KEYBIT
%219 = load i64, i64* @BTN_START
%220 = call i64 (i32, i32, ...) @ioctl(i32 %217, i32 %218, i64 %219)
%221 = icmp slt i64 %220, 0
br i1 %221, label %222, label %225
222: ; preds = %216
%223 = load i32, i32* @stderr
%224 = call i32 (i32, i8*, ...) @fprintf(i32 %223, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.13, i64 0, i64 0))
br label %225
225: ; preds = %222, %216
%226 = load i32, i32* %8
%227 = load i32, i32* @UI_SET_KEYBIT
%228 = load i64, i64* @BTN_FORWARD
%229 = call i64 (i32, i32, ...) @ioctl(i32 %226, i32 %227, i64 %228)
%230 = icmp slt i64 %229, 0
br i1 %230, label %231, label %234
231: ; preds = %225
%232 = load i32, i32* @stderr
%233 = call i32 (i32, i8*, ...) @fprintf(i32 %232, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.14, i64 0, i64 0))
br label %234
234: ; preds = %231, %225
%235 = load i32, i32* %8
%236 = load i32, i32* @UI_SET_KEYBIT
%237 = load i64, i64* @BTN_BACK
%238 = call i64 (i32, i32, ...) @ioctl(i32 %235, i32 %236, i64 %237)
%239 = icmp slt i64 %238, 0
br i1 %239, label %240, label %243
240: ; preds = %234
%241 = load i32, i32* @stderr
%242 = call i32 (i32, i8*, ...) @fprintf(i32 %241, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0))
br label %243
243: ; preds = %240, %234
%244 = load i32, i32* %8
%245 = load i32, i32* @UI_SET_KEYBIT
%246 = load i64, i64* @BTN_LEFT
%247 = call i64 (i32, i32, ...) @ioctl(i32 %244, i32 %245, i64 %246)
%248 = icmp slt i64 %247, 0
br i1 %248, label %249, label %252
249: ; preds = %243
%250 = load i32, i32* @stderr
%251 = call i32 (i32, i8*, ...) @fprintf(i32 %250, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.16, i64 0, i64 0))
br label %252
252: ; preds = %249, %243
%253 = load i32, i32* %8
%254 = load i32, i32* @UI_SET_KEYBIT
%255 = load i64, i64* @BTN_RIGHT
%256 = call i64 (i32, i32, ...) @ioctl(i32 %253, i32 %254, i64 %255)
%257 = icmp slt i64 %256, 0
br i1 %257, label %258, label %261
258: ; preds = %252
%259 = load i32, i32* @stderr
%260 = call i32 (i32, i8*, ...) @fprintf(i32 %259, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.17, i64 0, i64 0))
br label %261
261: ; preds = %258, %252
%262 = load i32, i32* %8
%263 = load i32, i32* @UI_SET_EVBIT
%264 = load i32, i32* @EV_ABS
%265 = call i64 (i32, i32, ...) @ioctl(i32 %262, i32 %263, i32 %264)
%266 = icmp slt i64 %265, 0
br i1 %266, label %267, label %270
267: ; preds = %261
%268 = load i32, i32* @stderr
%269 = call i32 (i32, i8*, ...) @fprintf(i32 %268, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.18, i64 0, i64 0))
br label %270
270: ; preds = %267, %261
%271 = load i64, i64* @ABS_X
%272 = trunc i64 %271 to i32
store i32 %272, i32* %6
br label %273
273: ; preds = %288, %270
%274 = load i32, i32* %6
%275 = load i32, i32* @ABS_MAX
%276 = icmp slt i32 %274, %275
br i1 %276, label %277, label %291
277: ; preds = %273
%278 = load i32, i32* %8
%279 = load i32, i32* @UI_SET_ABSBIT
%280 = load i32, i32* %6
%281 = call i64 (i32, i32, ...) @ioctl(i32 %278, i32 %279, i32 %280)
%282 = icmp slt i64 %281, 0
br i1 %282, label %283, label %287
283: ; preds = %277
%284 = load i32, i32* @stderr
%285 = load i32, i32* %6
%286 = call i32 (i32, i8*, ...) @fprintf(i32 %284, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.19, i64 0, i64 0), i32 %285)
br label %287
287: ; preds = %283, %277
br label %288
288: ; preds = %287
%289 = load i32, i32* %6
%290 = add nsw i32 %289, 1
store i32 %290, i32* %6
br label %273
291: ; preds = %273
%292 = load i64, i64* @ABS_Y
%293 = trunc i64 %292 to i32
store i32 %293, i32* %7
br label %294
294: ; preds = %309, %291
%295 = load i32, i32* %7
%296 = load i32, i32* @ABS_MAX
%297 = icmp slt i32 %295, %296
br i1 %297, label %298, label %312
298: ; preds = %294
%299 = load i32, i32* %8
%300 = load i32, i32* @UI_SET_ABSBIT
%301 = load i32, i32* %7
%302 = call i64 (i32, i32, ...) @ioctl(i32 %299, i32 %300, i32 %301)
%303 = icmp slt i64 %302, 0
br i1 %303, label %304, label %308
304: ; preds = %298
%305 = load i32, i32* @stderr
%306 = load i32, i32* %7
%307 = call i32 (i32, i8*, ...) @fprintf(i32 %305, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.19, i64 0, i64 0), i32 %306)
br label %308
308: ; preds = %304, %298
br label %309
309: ; preds = %308
%310 = load i32, i32* %7
%311 = add nsw i32 %310, 1
store i32 %311, i32* %7
br label %294
312: ; preds = %294
%313 = load i32, i32* %8
%314 = load i32, i32* @UI_DEV_CREATE
%315 = call i64 (i32, i32, ...) @ioctl(i32 %313, i32 %314)
%316 = icmp slt i64 %315, 0
br i1 %316, label %317, label %320
317: ; preds = %312
%318 = load i32, i32* @stderr
%319 = call i32 (i32, i8*, ...) @fprintf(i32 %318, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.20, i64 0, i64 0))
br label %320
320: ; preds = %317, %312
%321 = load i32, i32* @PF_INET
%322 = load i32, i32* @SOCK_DGRAM
%323 = load i32, i32* @IPPROTO_UDP
%324 = call i32 @socket(i32 %321, i32 %322, i32 %323)
store i32 %324, i32* %10
%325 = icmp slt i32 %324, 0
br i1 %325, label %326, label %328
326: ; preds = %320
%327 = call i32 @Die(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.21, i64 0, i64 0))
br label %328
328: ; preds = %326, %320
%329 = bitcast %struct.sockaddr_in* %11 to %struct.uinput_user_dev*
%330 = call i32 @memset(%struct.uinput_user_dev* %329, i32 0, i32 64)
%331 = load i32, i32* @AF_INET
%332 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 6
store i32 %331, i32* %332
%333 = load i32, i32* @INADDR_ANY
%334 = call i32 @htonl(i32 %333)
%335 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 5
%336 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %335, i32 0, i32 0
store i32 %334, i32* %336
%337 = load i8**, i8*** %5
%338 = getelementptr inbounds i8*, i8** %337, i64 1
%339 = load i8*, i8** %338
%340 = call i32 @atoi(i8* %339)
%341 = call i32 @htons(i32 %340)
%342 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 4
store i32 %341, i32* %342
store i32 64, i32* %15
%343 = load i32, i32* %10
%344 = bitcast %struct.sockaddr_in* %11 to %struct.sockaddr*
%345 = load i32, i32* %15
%346 = call i64 @bind(i32 %343, %struct.sockaddr* %344, i32 %345)
%347 = icmp slt i64 %346, 0
br i1 %347, label %348, label %350
348: ; preds = %328
%349 = call i32 @Die(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.22, i64 0, i64 0))
br label %350
350: ; preds = %348, %328
br label %351
351: ; preds = %350, %359
store i32 64, i32* %14
%352 = load i32, i32* %10
%353 = getelementptr inbounds [11 x i8], [11 x i8]* %13, i64 0, i64 0
%354 = bitcast %struct.sockaddr_in* %12 to %struct.sockaddr*
%355 = call i32 @recvfrom(i32 %352, i8* %353, i32 11, i32 0, %struct.sockaddr* %354, i32* %14)
store i32 %355, i32* %16
%356 = icmp slt i32 %355, 0
br i1 %356, label %357, label %359
357: ; preds = %351
%358 = call i32 @Die(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.23, i64 0, i64 0))
br label %359
359: ; preds = %357, %351
%360 = load i32, i32* %8
%361 = load i32, i32* @EV_ABS
%362 = load i64, i64* @ABS_X
%363 = getelementptr inbounds [11 x i8], [11 x i8]* %13, i64 0, i64 6
%364 = load i8, i8* %363
%365 = zext i8 %364 to i32
%366 = call i32 @send_event(i32 %360, i32 %361, i64 %362, i32 %365)
%367 = load i32, i32* %8
%368 = load i32, i32* @EV_SYN
%369 = load i64, i64* @SYN_REPORT
%370 = call i32 @send_event(i32 %367, i32 %368, i64 %369, i32 0)
%371 = load i32, i32* %8
%372 = load i32, i32* @EV_ABS
%373 = load i64, i64* @ABS_Y
%374 = getelementptr inbounds [11 x i8], [11 x i8]* %13, i64 0, i64 7
%375 = load i8, i8* %374
%376 = zext i8 %375 to i32
%377 = call i32 @send_event(i32 %371, i32 %372, i64 %373, i32 %376)
%378 = load i32, i32* %8
%379 = load i32, i32* @EV_SYN
%380 = load i64, i64* @SYN_REPORT
%381 = call i32 @send_event(i32 %378, i32 %379, i64 %380, i32 0)
%382 = load i32, i32* %8
%383 = load i32, i32* @EV_KEY
%384 = load i64, i64* @BTN_FORWARD
%385 = getelementptr inbounds [11 x i8], [11 x i8]* %13, i64 0, i64 8
%386 = load i8, i8* %385
%387 = zext i8 %386 to i32
%388 = ashr i32 %387, 4
%389 = and i32 %388, 1
%390 = icmp eq i32 1, %389
%391 = zext i1 %390 to i32
%392 = call i32 @send_event(i32 %382, i32 %383, i64 %384, i32 %391)
%393 = load i32, i32* %8
%394 = load i32, i32* @EV_SYN
%395 = load i64, i64* @SYN_REPORT
%396 = call i32 @send_event(i32 %393, i32 %394, i64 %395, i32 0)
%397 = load i32, i32* %8
%398 = load i32, i32* @EV_KEY
%399 = load i64, i64* @BTN_BACK
%400 = getelementptr inbounds [11 x i8], [11 x i8]* %13, i64 0, i64 8
%401 = load i8, i8* %400
%402 = zext i8 %401 to i32
%403 = ashr i32 %402, 6
%404 = and i32 %403, 1
%405 = icmp eq i32 1, %404
%406 = zext i1 %405 to i32
%407 = call i32 @send_event(i32 %397, i32 %398, i64 %399, i32 %406)
%408 = load i32, i32* %8
%409 = load i32, i32* @EV_SYN
%410 = load i64, i64* @SYN_REPORT
%411 = call i32 @send_event(i32 %408, i32 %409, i64 %410, i32 0)
%412 = load i32, i32* %8
%413 = load i32, i32* @EV_KEY
%414 = load i64, i64* @BTN_LEFT
%415 = getelementptr inbounds [11 x i8], [11 x i8]* %13, i64 0, i64 8
%416 = load i8, i8* %415
%417 = zext i8 %416 to i32
%418 = ashr i32 %417, 7
%419 = and i32 %418, 1
%420 = icmp eq i32 1, %419
%421 = zext i1 %420 to i32
%422 = call i32 @send_event(i32 %412, i32 %413, i64 %414, i32 %421)
%423 = load i32, i32* %8
%424 = load i32, i32* @EV_SYN
%425 = load i64, i64* @SYN_REPORT
%426 = call i32 @send_event(i32 %423, i32 %424, i64 %425, i32 0)
%427 = load i32, i32* %8
%428 = load i32, i32* @EV_KEY
%429 = load i64, i64* @BTN_RIGHT
%430 = getelementptr inbounds [11 x i8], [11 x i8]* %13, i64 0, i64 8
%431 = load i8, i8* %430
%432 = zext i8 %431 to i32
%433 = ashr i32 %432, 5
%434 = and i32 %433, 1
%435 = icmp eq i32 1, %434
%436 = zext i1 %435 to i32
%437 = call i32 @send_event(i32 %427, i32 %428, i64 %429, i32 %436)
%438 = load i32, i32* %8
%439 = load i32, i32* @EV_SYN
%440 = load i64, i64* @SYN_REPORT
%441 = call i32 @send_event(i32 %438, i32 %439, i64 %440, i32 0)
%442 = load i32, i32* %8
%443 = load i32, i32* @EV_KEY
%444 = load i64, i64* @BTN_SELECT
%445 = getelementptr inbounds [11 x i8], [11 x i8]* %13, i64 0, i64 8
%446 = load i8, i8* %445
%447 = zext i8 %446 to i32
%448 = ashr i32 %447, 0
%449 = and i32 %448, 1
%450 = icmp eq i32 1, %449
%451 = zext i1 %450 to i32
%452 = call i32 @send_event(i32 %442, i32 %443, i64 %444, i32 %451)
%453 = load i32, i32* %8
%454 = load i32, i32* @EV_SYN
%455 = load i64, i64* @SYN_REPORT
%456 = call i32 @send_event(i32 %453, i32 %454, i64 %455, i32 0)
%457 = load i32, i32* %8
%458 = load i32, i32* @EV_KEY
%459 = load i64, i64* @BTN_START
%460 = getelementptr inbounds [11 x i8], [11 x i8]* %13, i64 0, i64 8
%461 = load i8, i8* %460
%462 = zext i8 %461 to i32
%463 = ashr i32 %462, 3
%464 = and i32 %463, 1
%465 = icmp eq i32 1, %464
%466 = zext i1 %465 to i32
%467 = call i32 @send_event(i32 %457, i32 %458, i64 %459, i32 %466)
%468 = load i32, i32* %8
%469 = load i32, i32* @EV_SYN
%470 = load i64, i64* @SYN_REPORT
%471 = call i32 @send_event(i32 %468, i32 %469, i64 %470, i32 0)
%472 = load i32, i32* %8
%473 = load i32, i32* @EV_KEY
%474 = load i64, i64* @BTN_1
%475 = getelementptr inbounds [11 x i8], [11 x i8]* %13, i64 0, i64 9
%476 = load i8, i8* %475
%477 = zext i8 %476 to i32
%478 = ashr i32 %477, 6
%479 = and i32 %478, 1
%480 = icmp eq i32 1, %479
%481 = zext i1 %480 to i32
%482 = call i32 @send_event(i32 %472, i32 %473, i64 %474, i32 %481)
%483 = load i32, i32* %8
%484 = load i32, i32* @EV_SYN
%485 = load i64, i64* @SYN_REPORT
%486 = call i32 @send_event(i32 %483, i32 %484, i64 %485, i32 0)
%487 = load i32, i32* %8
%488 = load i32, i32* @EV_KEY
%489 = load i64, i64* @BTN_2
%490 = getelementptr inbounds [11 x i8], [11 x i8]* %13, i64 0, i64 9
%491 = load i8, i8* %490
%492 = zext i8 %491 to i32
%493 = ashr i32 %492, 5
%494 = and i32 %493, 1
%495 = icmp eq i32 1, %494
%496 = zext i1 %495 to i32
%497 = call i32 @send_event(i32 %487, i32 %488, i64 %489, i32 %496)
%498 = load i32, i32* %8
%499 = load i32, i32* @EV_SYN
%500 = load i64, i64* @SYN_REPORT
%501 = call i32 @send_event(i32 %498, i32 %499, i64 %500, i32 0)
%502 = load i32, i32* %8
%503 = load i32, i32* @EV_KEY
%504 = load i64, i64* @BTN_3
%505 = getelementptr inbounds [11 x i8], [11 x i8]* %13, i64 0, i64 9
%506 = load i8, i8* %505
%507 = zext i8 %506 to i32
%508 = ashr i32 %507, 7
%509 = and i32 %508, 1
%510 = icmp eq i32 1, %509
%511 = zext i1 %510 to i32
%512 = call i32 @send_event(i32 %502, i32 %503, i64 %504, i32 %511)
%513 = load i32, i32* %8
%514 = load i32, i32* @EV_SYN
%515 = load i64, i64* @SYN_REPORT
%516 = call i32 @send_event(i32 %513, i32 %514, i64 %515, i32 0)
%517 = load i32, i32* %8
%518 = load i32, i32* @EV_KEY
%519 = load i64, i64* @BTN_4
%520 = getelementptr inbounds [11 x i8], [11 x i8]* %13, i64 0, i64 9
%521 = load i8, i8* %520
%522 = zext i8 %521 to i32
%523 = ashr i32 %522, 4
%524 = and i32 %523, 1
%525 = icmp eq i32 1, %524
%526 = zext i1 %525 to i32
%527 = call i32 @send_event(i32 %517, i32 %518, i64 %519, i32 %526)
%528 = load i32, i32* %8
%529 = load i32, i32* @EV_SYN
%530 = load i64, i64* @SYN_REPORT
%531 = call i32 @send_event(i32 %528, i32 %529, i64 %530, i32 0)
%532 = load i32, i32* %8
%533 = load i32, i32* @EV_KEY
%534 = load i64, i64* @BTN_5
%535 = getelementptr inbounds [11 x i8], [11 x i8]* %13, i64 0, i64 9
%536 = load i8, i8* %535
%537 = zext i8 %536 to i32
%538 = ashr i32 %537, 0
%539 = and i32 %538, 1
%540 = icmp eq i32 1, %539
%541 = zext i1 %540 to i32
%542 = call i32 @send_event(i32 %532, i32 %533, i64 %534, i32 %541)
%543 = load i32, i32* %8
%544 = load i32, i32* @EV_SYN
%545 = load i64, i64* @SYN_REPORT
%546 = call i32 @send_event(i32 %543, i32 %544, i64 %545, i32 0)
%547 = load i32, i32* %8
%548 = load i32, i32* @EV_KEY
%549 = load i64, i64* @BTN_6
%550 = getelementptr inbounds [11 x i8], [11 x i8]* %13, i64 0, i64 9
%551 = load i8, i8* %550
%552 = zext i8 %551 to i32
%553 = ashr i32 %552, 1
%554 = and i32 %553, 1
%555 = icmp eq i32 1, %554
%556 = zext i1 %555 to i32
%557 = call i32 @send_event(i32 %547, i32 %548, i64 %549, i32 %556)
%558 = load i32, i32* %8
%559 = load i32, i32* @EV_SYN
%560 = load i64, i64* @SYN_REPORT
%561 = call i32 @send_event(i32 %558, i32 %559, i64 %560, i32 0)
br label %351
}

LLVM IR (-O2):
%struct.uinput_user_dev = type { i32*, i32*, i32*, i32*, i32, %struct.TYPE_3__, i32, %struct.TYPE_4__, i32 }
%struct.TYPE_3__ = type { i32 }
%struct.TYPE_4__ = type { i32, i32, i32, i32 }
%struct.sockaddr_in = type { i32*, i32*, i32*, i32*, i32, %struct.TYPE_3__, i32, %struct.TYPE_4__, i32 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [18 x i8] c"USAGE: %s <port>\0A\00"
@.str.1 = [54 x i8] c"\0A\0920001 -> Controller 1\0A\0920002 -> Controller 2\0A\09....\0A\00"
@.str.2 = [12 x i8] c"/dev/uinput\00"
@O_RDWR = global i32 0
@.str.3 = [14 x i8] c"wificontoller\00"
@BUS_USB = global i32 0
@ABS_MAX = global i32 0
@ABS_X = global i64 0
@ABS_Y = global i64 0
@.str.4 = [13 x i8] c"error setup\0A\00"
@UI_SET_EVBIT = global i32 0
@EV_KEY = global i32 0
@.str.5 = [17 x i8] c"error evbit key\0A\00"
@UI_SET_KEYBIT = global i32 0
@BTN_1 = global i64 0
@.str.6 = [21 x i8] c"error evbit button0\0A\00"
@BTN_2 = global i64 0
@.str.7 = [21 x i8] c"error evbit button1\0A\00"
@BTN_3 = global i64 0
@.str.8 = [21 x i8] c"error evbit button2\0A\00"
@BTN_4 = global i64 0
@.str.9 = [21 x i8] c"error evbit button3\0A\00"
@BTN_5 = global i64 0
@.str.10 = [21 x i8] c"error evbit button4\0A\00"
@BTN_6 = global i64 0
@.str.11 = [21 x i8] c"error evbit button5\0A\00"
@BTN_SELECT = global i64 0
@.str.12 = [21 x i8] c"error evbit button6\0A\00"
@BTN_START = global i64 0
@.str.13 = [21 x i8] c"error evbit button7\0A\00"
@BTN_FORWARD = global i64 0
@.str.14 = [21 x i8] c"error evbit button8\0A\00"
@BTN_BACK = global i64 0
@.str.15 = [21 x i8] c"error evbit button9\0A\00"
@BTN_LEFT = global i64 0
@.str.16 = [22 x i8] c"error evbit button10\0A\00"
@BTN_RIGHT = global i64 0
@.str.17 = [22 x i8] c"error evbit button11\0A\00"
@EV_ABS = global i32 0
@.str.18 = [22 x i8] c"error evbit absolute\0A\00"
@UI_SET_ABSBIT = global i32 0
@.str.19 = [27 x i8] c"error set absolute bit %d\0A\00"
@UI_DEV_CREATE = global i32 0
@.str.20 = [14 x i8] c"error create\0A\00"
@PF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@IPPROTO_UDP = global i32 0
@.str.21 = [24 x i8] c"Failed to create socket\00"
@AF_INET = global i32 0
@INADDR_ANY = global i32 0
@.str.22 = [29 x i8] c"Failed to bind server socket\00"
@.str.23 = [26 x i8] c"Failed to receive message\00"
@EV_SYN = global i32 0
@SYN_REPORT = global i64 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.uinput_user_dev
%4 = alloca %struct.sockaddr_in
%5 = alloca %struct.sockaddr_in
%6 = alloca [11 x i8]
%7 = alloca i32
%8 = bitcast %struct.uinput_user_dev* %3 to i8*
%9 = call i32 @memset(%struct.uinput_user_dev* %3, i32 0, i32 64)
%10 = bitcast %struct.sockaddr_in* %4 to i8*
%11 = bitcast %struct.sockaddr_in* %5 to i8*
%12 = getelementptr inbounds [11 x i8], [11 x i8]* %6, i64 0, i64 0
%13 = bitcast i32* %7 to i8*
%14 = icmp eq i32 %0, 2
br i1 %14, label %23, label %15
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = load i8*, i8** %1
%18 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = load i32, i32* @stderr
%20 = load i8*, i8** %1
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0), i8* %20)
%22 = call i32 @exit(i32 1)
unreachable
23: ; preds = %2
%24 = load i32, i32* @O_RDWR
%25 = call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %24)
%26 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %3, i64 0, i32 8
%27 = load i32, i32* %26
%28 = call i32 @strcpy(i32 %27, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%29 = load i32, i32* @BUS_USB
%30 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %3, i64 0, i32 7, i32 3
store i32 %29, i32* %30
%31 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %3, i64 0, i32 7, i32 0
store i32 1, i32* %31
%32 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %3, i64 0, i32 7, i32 1
store i32 1, i32* %32
%33 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %3, i64 0, i32 7, i32 2
store i32 1, i32* %33
%34 = load i32, i32* @ABS_MAX
%35 = icmp sgt i32 %34, 0
br i1 %35, label %36, label %47
36: ; preds = %23
%37 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %3, i64 0, i32 0
%38 = load i32*, i32** %37
%39 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %3, i64 0, i32 1
%40 = load i32*, i32** %39
%41 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %3, i64 0, i32 2
%42 = load i32*, i32** %41
%43 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %3, i64 0, i32 3
%44 = load i32*, i32** %43
br label %65
45: ; preds = %65
%46 = icmp sgt i32 %72, 0
br i1 %46, label %56, label %47
47: ; preds = %23, %45
%48 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %3, i64 0, i32 1
%49 = load i32*, i32** %48
%50 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %3, i64 0, i32 0
%51 = load i32*, i32** %50
%52 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %3, i64 0, i32 2
%53 = load i32*, i32** %52
%54 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %3, i64 0, i32 3
%55 = load i32*, i32** %54
br label %85
56: ; preds = %45
%57 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %3, i64 0, i32 0
%58 = load i32*, i32** %57
%59 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %3, i64 0, i32 1
%60 = load i32*, i32** %59
%61 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %3, i64 0, i32 2
%62 = load i32*, i32** %61
%63 = getelementptr inbounds %struct.uinput_user_dev, %struct.uinput_user_dev* %3, i64 0, i32 3
%64 = load i32*, i32** %63
br label %75
65: ; preds = %36, %65
%66 = phi i64 [ 0, %36 ], [ %71, %65 ]
%67 = getelementptr inbounds i32, i32* %38, i64 %66
store i32 -1, i32* %67
%68 = getelementptr inbounds i32, i32* %40, i64 %66
store i32 -1, i32* %68
%69 = getelementptr inbounds i32, i32* %42, i64 %66
store i32 -1, i32* %69
%70 = getelementptr inbounds i32, i32* %44, i64 %66
store i32 -1, i32* %70
%71 = add nuw nsw i64 %66, 1
%72 = load i32, i32* @ABS_MAX
%73 = sext i32 %72 to i64
%74 = icmp slt i64 %71, %73
br i1 %74, label %65, label %45
75: ; preds = %56, %75
%76 = phi i64 [ 0, %56 ], [ %81, %75 ]
%77 = getelementptr inbounds i32, i32* %58, i64 %76
store i32 -1, i32* %77
%78 = getelementptr inbounds i32, i32* %60, i64 %76
store i32 -1, i32* %78
%79 = getelementptr inbounds i32, i32* %62, i64 %76
store i32 -1, i32* %79
%80 = getelementptr inbounds i32, i32* %64, i64 %76
store i32 -1, i32* %80
%81 = add nuw nsw i64 %76, 1
%82 = load i32, i32* @ABS_MAX
%83 = sext i32 %82 to i64
%84 = icmp slt i64 %81, %83
br i1 %84, label %75, label %85
85: ; preds = %75, %47
%86 = phi i32* [ %55, %47 ], [ %64, %75 ]
%87 = phi i32* [ %53, %47 ], [ %62, %75 ]
%88 = phi i32* [ %51, %47 ], [ %58, %75 ]
%89 = phi i32* [ %49, %47 ], [ %60, %75 ]
%90 = load i64, i64* @ABS_X
%91 = getelementptr inbounds i32, i32* %89, i64 %90
store i32 0, i32* %91
%92 = getelementptr inbounds i32, i32* %88, i64 %90
store i32 255, i32* %92
%93 = getelementptr inbounds i32, i32* %87, i64 %90
store i32 0, i32* %93
%94 = getelementptr inbounds i32, i32* %86, i64 %90
store i32 0, i32* %94
%95 = load i64, i64* @ABS_Y
%96 = getelementptr inbounds i32, i32* %89, i64 %95
store i32 0, i32* %96
%97 = getelementptr inbounds i32, i32* %88, i64 %95
store i32 255, i32* %97
%98 = getelementptr inbounds i32, i32* %87, i64 %95
store i32 0, i32* %98
%99 = getelementptr inbounds i32, i32* %86, i64 %95
store i32 0, i32* %99
%100 = call i32 @write(i32 %25, %struct.uinput_user_dev* %3, i32 64)
%101 = icmp eq i32 %100, 64
br i1 %101, label %105, label %102
102: ; preds = %85
%103 = load i32, i32* @stderr
%104 = call i32 (i32, i8*, ...) @fprintf(i32 %103, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
br label %105
105: ; preds = %102, %85
%106 = load i32, i32* @UI_SET_EVBIT
%107 = load i32, i32* @EV_KEY
%108 = call i64 (i32, i32, ...) @ioctl(i32 %25, i32 %106, i32 %107)
%109 = icmp slt i64 %108, 0
br i1 %109, label %110, label %113
110: ; preds = %105
%111 = load i32, i32* @stderr
%112 = call i32 (i32, i8*, ...) @fprintf(i32 %111, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
br label %113
113: ; preds = %110, %105
%114 = load i32, i32* @UI_SET_KEYBIT
%115 = load i64, i64* @BTN_1
%116 = call i64 (i32, i32, ...) @ioctl(i32 %25, i32 %114, i64 %115)
%117 = icmp slt i64 %116, 0
br i1 %117, label %118, label %121
118: ; preds = %113
%119 = load i32, i32* @stderr
%120 = call i32 (i32, i8*, ...) @fprintf(i32 %119, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
br label %121
121: ; preds = %118, %113
%122 = load i32, i32* @UI_SET_KEYBIT
%123 = load i64, i64* @BTN_2
%124 = call i64 (i32, i32, ...) @ioctl(i32 %25, i32 %122, i64 %123)
%125 = icmp slt i64 %124, 0
br i1 %125, label %126, label %129
126: ; preds = %121
%127 = load i32, i32* @stderr
%128 = call i32 (i32, i8*, ...) @fprintf(i32 %127, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
br label %129
129: ; preds = %126, %121
%130 = load i32, i32* @UI_SET_KEYBIT
%131 = load i64, i64* @BTN_3
%132 = call i64 (i32, i32, ...) @ioctl(i32 %25, i32 %130, i64 %131)
%133 = icmp slt i64 %132, 0
br i1 %133, label %134, label %137
134: ; preds = %129
%135 = load i32, i32* @stderr
%136 = call i32 (i32, i8*, ...) @fprintf(i32 %135, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0))
br label %137
137: ; preds = %134, %129
%138 = load i32, i32* @UI_SET_KEYBIT
%139 = load i64, i64* @BTN_4
%140 = call i64 (i32, i32, ...) @ioctl(i32 %25, i32 %138, i64 %139)
%141 = icmp slt i64 %140, 0
br i1 %141, label %142, label %145
142: ; preds = %137
%143 = load i32, i32* @stderr
%144 = call i32 (i32, i8*, ...) @fprintf(i32 %143, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0))
br label %145
145: ; preds = %142, %137
%146 = load i32, i32* @UI_SET_KEYBIT
%147 = load i64, i64* @BTN_5
%148 = call i64 (i32, i32, ...) @ioctl(i32 %25, i32 %146, i64 %147)
%149 = icmp slt i64 %148, 0
br i1 %149, label %150, label %153
150: ; preds = %145
%151 = load i32, i32* @stderr
%152 = call i32 (i32, i8*, ...) @fprintf(i32 %151, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i64 0, i64 0))
br label %153
153: ; preds = %150, %145
%154 = load i32, i32* @UI_SET_KEYBIT
%155 = load i64, i64* @BTN_6
%156 = call i64 (i32, i32, ...) @ioctl(i32 %25, i32 %154, i64 %155)
%157 = icmp slt i64 %156, 0
br i1 %157, label %158, label %161
158: ; preds = %153
%159 = load i32, i32* @stderr
%160 = call i32 (i32, i8*, ...) @fprintf(i32 %159, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0))
br label %161
161: ; preds = %158, %153
%162 = load i32, i32* @UI_SET_KEYBIT
%163 = load i64, i64* @BTN_SELECT
%164 = call i64 (i32, i32, ...) @ioctl(i32 %25, i32 %162, i64 %163)
%165 = icmp slt i64 %164, 0
br i1 %165, label %166, label %169
166: ; preds = %161
%167 = load i32, i32* @stderr
%168 = call i32 (i32, i8*, ...) @fprintf(i32 %167, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0))
br label %169
169: ; preds = %166, %161
%170 = load i32, i32* @UI_SET_KEYBIT
%171 = load i64, i64* @BTN_START
%172 = call i64 (i32, i32, ...) @ioctl(i32 %25, i32 %170, i64 %171)
%173 = icmp slt i64 %172, 0
br i1 %173, label %174, label %177
174: ; preds = %169
%175 = load i32, i32* @stderr
%176 = call i32 (i32, i8*, ...) @fprintf(i32 %175, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.13, i64 0, i64 0))
br label %177
177: ; preds = %174, %169
%178 = load i32, i32* @UI_SET_KEYBIT
%179 = load i64, i64* @BTN_FORWARD
%180 = call i64 (i32, i32, ...) @ioctl(i32 %25, i32 %178, i64 %179)
%181 = icmp slt i64 %180, 0
br i1 %181, label %182, label %185
182: ; preds = %177
%183 = load i32, i32* @stderr
%184 = call i32 (i32, i8*, ...) @fprintf(i32 %183, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.14, i64 0, i64 0))
br label %185
185: ; preds = %182, %177
%186 = load i32, i32* @UI_SET_KEYBIT
%187 = load i64, i64* @BTN_BACK
%188 = call i64 (i32, i32, ...) @ioctl(i32 %25, i32 %186, i64 %187)
%189 = icmp slt i64 %188, 0
br i1 %189, label %190, label %193
190: ; preds = %185
%191 = load i32, i32* @stderr
%192 = call i32 (i32, i8*, ...) @fprintf(i32 %191, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0))
br label %193
193: ; preds = %190, %185
%194 = load i32, i32* @UI_SET_KEYBIT
%195 = load i64, i64* @BTN_LEFT
%196 = call i64 (i32, i32, ...) @ioctl(i32 %25, i32 %194, i64 %195)
%197 = icmp slt i64 %196, 0
br i1 %197, label %198, label %201
198: ; preds = %193
%199 = load i32, i32* @stderr
%200 = call i32 (i32, i8*, ...) @fprintf(i32 %199, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.16, i64 0, i64 0))
br label %201
201: ; preds = %198, %193
%202 = load i32, i32* @UI_SET_KEYBIT
%203 = load i64, i64* @BTN_RIGHT
%204 = call i64 (i32, i32, ...) @ioctl(i32 %25, i32 %202, i64 %203)
%205 = icmp slt i64 %204, 0
br i1 %205, label %206, label %209
206: ; preds = %201
%207 = load i32, i32* @stderr
%208 = call i32 (i32, i8*, ...) @fprintf(i32 %207, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.17, i64 0, i64 0))
br label %209
209: ; preds = %206, %201
%210 = load i32, i32* @UI_SET_EVBIT
%211 = load i32, i32* @EV_ABS
%212 = call i64 (i32, i32, ...) @ioctl(i32 %25, i32 %210, i32 %211)
%213 = icmp slt i64 %212, 0
br i1 %213, label %214, label %217
214: ; preds = %209
%215 = load i32, i32* @stderr
%216 = call i32 (i32, i8*, ...) @fprintf(i32 %215, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.18, i64 0, i64 0))
br label %217
217: ; preds = %214, %209
%218 = load i64, i64* @ABS_X
%219 = trunc i64 %218 to i32
%220 = load i32, i32* @ABS_MAX
%221 = icmp sgt i32 %220, %219
br i1 %221, label %222, label %234
222: ; preds = %217, %230
%223 = phi i32 [ %231, %230 ], [ %219, %217 ]
%224 = load i32, i32* @UI_SET_ABSBIT
%225 = call i64 (i32, i32, ...) @ioctl(i32 %25, i32 %224, i32 %223)
%226 = icmp slt i64 %225, 0
br i1 %226, label %227, label %230
227: ; preds = %222
%228 = load i32, i32* @stderr
%229 = call i32 (i32, i8*, ...) @fprintf(i32 %228, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.19, i64 0, i64 0), i32 %223)
br label %230
230: ; preds = %222, %227
%231 = add nsw i32 %223, 1
%232 = load i32, i32* @ABS_MAX
%233 = icmp slt i32 %231, %232
br i1 %233, label %222, label %234
234: ; preds = %230, %217
%235 = phi i32 [ %220, %217 ], [ %232, %230 ]
%236 = load i64, i64* @ABS_Y
%237 = trunc i64 %236 to i32
%238 = icmp sgt i32 %235, %237
br i1 %238, label %239, label %251
239: ; preds = %234, %247
%240 = phi i32 [ %248, %247 ], [ %237, %234 ]
%241 = load i32, i32* @UI_SET_ABSBIT
%242 = call i64 (i32, i32, ...) @ioctl(i32 %25, i32 %241, i32 %240)
%243 = icmp slt i64 %242, 0
br i1 %243, label %244, label %247
244: ; preds = %239
%245 = load i32, i32* @stderr
%246 = call i32 (i32, i8*, ...) @fprintf(i32 %245, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.19, i64 0, i64 0), i32 %240)
br label %247
247: ; preds = %239, %244
%248 = add nsw i32 %240, 1
%249 = load i32, i32* @ABS_MAX
%250 = icmp slt i32 %248, %249
br i1 %250, label %239, label %251
251: ; preds = %247, %234
%252 = load i32, i32* @UI_DEV_CREATE
%253 = call i64 (i32, i32, ...) @ioctl(i32 %25, i32 %252)
%254 = icmp slt i64 %253, 0
br i1 %254, label %255, label %258
255: ; preds = %251
%256 = load i32, i32* @stderr
%257 = call i32 (i32, i8*, ...) @fprintf(i32 %256, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.20, i64 0, i64 0))
br label %258
258: ; preds = %255, %251
%259 = load i32, i32* @PF_INET
%260 = load i32, i32* @SOCK_DGRAM
%261 = load i32, i32* @IPPROTO_UDP
%262 = call i32 @socket(i32 %259, i32 %260, i32 %261)
%263 = icmp slt i32 %262, 0
br i1 %263, label %264, label %266
264: ; preds = %258
%265 = call i32 @Die(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.21, i64 0, i64 0))
br label %266
266: ; preds = %264, %258
%267 = bitcast %struct.sockaddr_in* %4 to %struct.uinput_user_dev*
%268 = call i32 @memset(%struct.uinput_user_dev* %267, i32 0, i32 64)
%269 = load i32, i32* @AF_INET
%270 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 6
store i32 %269, i32* %270
%271 = load i32, i32* @INADDR_ANY
%272 = call i32 @htonl(i32 %271)
%273 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 5, i32 0
store i32 %272, i32* %273
%274 = getelementptr inbounds i8*, i8** %1, i64 1
%275 = load i8*, i8** %274
%276 = call i32 @atoi(i8* %275)
%277 = call i32 @htons(i32 %276)
%278 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 4
store i32 %277, i32* %278
%279 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%280 = call i64 @bind(i32 %262, %struct.sockaddr* %279, i32 64)
%281 = icmp slt i64 %280, 0
br i1 %281, label %282, label %284
282: ; preds = %266
%283 = call i32 @Die(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.22, i64 0, i64 0))
br label %284
284: ; preds = %282, %266
%285 = bitcast %struct.sockaddr_in* %5 to %struct.sockaddr*
%286 = getelementptr inbounds [11 x i8], [11 x i8]* %6, i64 0, i64 6
%287 = getelementptr inbounds [11 x i8], [11 x i8]* %6, i64 0, i64 7
%288 = getelementptr inbounds [11 x i8], [11 x i8]* %6, i64 0, i64 8
%289 = getelementptr inbounds [11 x i8], [11 x i8]* %6, i64 0, i64 9
br label %290
290: ; preds = %295, %284
store i32 64, i32* %7
%291 = call i32 @recvfrom(i32 %262, i8* %12, i32 11, i32 0, %struct.sockaddr* %285, i32* %7)
%292 = icmp slt i32 %291, 0
br i1 %292, label %293, label %295
293: ; preds = %290
%294 = call i32 @Die(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.23, i64 0, i64 0))
br label %295
295: ; preds = %293, %290
%296 = load i32, i32* @EV_ABS
%297 = load i64, i64* @ABS_X
%298 = load i8, i8* %286
%299 = zext i8 %298 to i32
%300 = call i32 @send_event(i32 %25, i32 %296, i64 %297, i32 %299)
%301 = load i32, i32* @EV_SYN
%302 = load i64, i64* @SYN_REPORT
%303 = call i32 @send_event(i32 %25, i32 %301, i64 %302, i32 0)
%304 = load i32, i32* @EV_ABS
%305 = load i64, i64* @ABS_Y
%306 = load i8, i8* %287
%307 = zext i8 %306 to i32
%308 = call i32 @send_event(i32 %25, i32 %304, i64 %305, i32 %307)
%309 = load i32, i32* @EV_SYN
%310 = load i64, i64* @SYN_REPORT
%311 = call i32 @send_event(i32 %25, i32 %309, i64 %310, i32 0)
%312 = load i32, i32* @EV_KEY
%313 = load i64, i64* @BTN_FORWARD
%314 = load i8, i8* %288
%315 = lshr i8 %314, 4
%316 = and i8 %315, 1
%317 = zext i8 %316 to i32
%318 = call i32 @send_event(i32 %25, i32 %312, i64 %313, i32 %317)
%319 = load i32, i32* @EV_SYN
%320 = load i64, i64* @SYN_REPORT
%321 = call i32 @send_event(i32 %25, i32 %319, i64 %320, i32 0)
%322 = load i32, i32* @EV_KEY
%323 = load i64, i64* @BTN_BACK
%324 = load i8, i8* %288
%325 = lshr i8 %324, 6
%326 = and i8 %325, 1
%327 = zext i8 %326 to i32
%328 = call i32 @send_event(i32 %25, i32 %322, i64 %323, i32 %327)
%329 = load i32, i32* @EV_SYN
%330 = load i64, i64* @SYN_REPORT
%331 = call i32 @send_event(i32 %25, i32 %329, i64 %330, i32 0)
%332 = load i32, i32* @EV_KEY
%333 = load i64, i64* @BTN_LEFT
%334 = load i8, i8* %288
%335 = lshr i8 %334, 7
%336 = zext i8 %335 to i32
%337 = call i32 @send_event(i32 %25, i32 %332, i64 %333, i32 %336)
%338 = load i32, i32* @EV_SYN
%339 = load i64, i64* @SYN_REPORT
%340 = call i32 @send_event(i32 %25, i32 %338, i64 %339, i32 0)
%341 = load i32, i32* @EV_KEY
%342 = load i64, i64* @BTN_RIGHT
%343 = load i8, i8* %288
%344 = lshr i8 %343, 5
%345 = and i8 %344, 1
%346 = zext i8 %345 to i32
%347 = call i32 @send_event(i32 %25, i32 %341, i64 %342, i32 %346)
%348 = load i32, i32* @EV_SYN
%349 = load i64, i64* @SYN_REPORT
%350 = call i32 @send_event(i32 %25, i32 %348, i64 %349, i32 0)
%351 = load i32, i32* @EV_KEY
%352 = load i64, i64* @BTN_SELECT
%353 = load i8, i8* %288
%354 = and i8 %353, 1
%355 = zext i8 %354 to i32
%356 = call i32 @send_event(i32 %25, i32 %351, i64 %352, i32 %355)
%357 = load i32, i32* @EV_SYN
%358 = load i64, i64* @SYN_REPORT
%359 = call i32 @send_event(i32 %25, i32 %357, i64 %358, i32 0)
%360 = load i32, i32* @EV_KEY
%361 = load i64, i64* @BTN_START
%362 = load i8, i8* %288
%363 = lshr i8 %362, 3
%364 = and i8 %363, 1
%365 = zext i8 %364 to i32
%366 = call i32 @send_event(i32 %25, i32 %360, i64 %361, i32 %365)
%367 = load i32, i32* @EV_SYN
%368 = load i64, i64* @SYN_REPORT
%369 = call i32 @send_event(i32 %25, i32 %367, i64 %368, i32 0)
%370 = load i32, i32* @EV_KEY
%371 = load i64, i64* @BTN_1
%372 = load i8, i8* %289
%373 = lshr i8 %372, 6
%374 = and i8 %373, 1
%375 = zext i8 %374 to i32
%376 = call i32 @send_event(i32 %25, i32 %370, i64 %371, i32 %375)
%377 = load i32, i32* @EV_SYN
%378 = load i64, i64* @SYN_REPORT
%379 = call i32 @send_event(i32 %25, i32 %377, i64 %378, i32 0)
%380 = load i32, i32* @EV_KEY
%381 = load i64, i64* @BTN_2
%382 = load i8, i8* %289
%383 = lshr i8 %382, 5
%384 = and i8 %383, 1
%385 = zext i8 %384 to i32
%386 = call i32 @send_event(i32 %25, i32 %380, i64 %381, i32 %385)
%387 = load i32, i32* @EV_SYN
%388 = load i64, i64* @SYN_REPORT
%389 = call i32 @send_event(i32 %25, i32 %387, i64 %388, i32 0)
%390 = load i32, i32* @EV_KEY
%391 = load i64, i64* @BTN_3
%392 = load i8, i8* %289
%393 = lshr i8 %392, 7
%394 = zext i8 %393 to i32
%395 = call i32 @send_event(i32 %25, i32 %390, i64 %391, i32 %394)
%396 = load i32, i32* @EV_SYN
%397 = load i64, i64* @SYN_REPORT
%398 = call i32 @send_event(i32 %25, i32 %396, i64 %397, i32 0)
%399 = load i32, i32* @EV_KEY
%400 = load i64, i64* @BTN_4
%401 = load i8, i8* %289
%402 = lshr i8 %401, 4
%403 = and i8 %402, 1
%404 = zext i8 %403 to i32
%405 = call i32 @send_event(i32 %25, i32 %399, i64 %400, i32 %404)
%406 = load i32, i32* @EV_SYN
%407 = load i64, i64* @SYN_REPORT
%408 = call i32 @send_event(i32 %25, i32 %406, i64 %407, i32 0)
%409 = load i32, i32* @EV_KEY
%410 = load i64, i64* @BTN_5
%411 = load i8, i8* %289
%412 = and i8 %411, 1
%413 = zext i8 %412 to i32
%414 = call i32 @send_event(i32 %25, i32 %409, i64 %410, i32 %413)
%415 = load i32, i32* @EV_SYN
%416 = load i64, i64* @SYN_REPORT
%417 = call i32 @send_event(i32 %25, i32 %415, i64 %416, i32 0)
%418 = load i32, i32* @EV_KEY
%419 = load i64, i64* @BTN_6
%420 = load i8, i8* %289
%421 = lshr i8 %420, 1
%422 = and i8 %421, 1
%423 = zext i8 %422 to i32
%424 = call i32 @send_event(i32 %25, i32 %418, i64 %419, i32 %423)
%425 = load i32, i32* @EV_SYN
%426 = load i64, i64* @SYN_REPORT
%427 = call i32 @send_event(i32 %25, i32 %425, i64 %426, i32 0)
br label %290
}