#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 */

/* Type definitions */
struct option {
  char *member_0;
  int member_1;
  char member_3;
  int /*<<< orphan*/ member_2;
};
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Screen;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ CurrentTime;
int /*<<< orphan*/ False;
int /*<<< orphan*/ GrabModeAsync;
int /*<<< orphan*/ None;
int /*<<< orphan*/ RevertToNone;
int /*<<< orphan*/ RootWindow(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ *ScreenOfDisplay(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ XCloseDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ XDefaultRootWindow(int /*<<< orphan*/ *);
int /*<<< orphan*/ *XDefaultScreenOfDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ XFlush(int /*<<< orphan*/ *);
int /*<<< orphan*/ XGrabPointer(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/);
int XHeightOfScreen(int /*<<< orphan*/ *);
int /*<<< orphan*/ *XOpenDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ XQueryPointer(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                 int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                 int *, int *, int *, int *, unsigned int *);
int XScreenNumberOfScreen(int /*<<< orphan*/ *);
int /*<<< orphan*/ XSetInputFocus(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                  int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ XUngrabPointer(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ XWarpPointer(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, int, int);
int XWidthOfScreen(int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int getopt_long(int, char **, char *, struct option *, int *);
int /*<<< orphan*/ help();
char *optarg;
int optind;
int /*<<< orphan*/ printf(char *, ...);
int sscanf(char *, char *, int *, ...);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  Display *dpy;
  Screen *scr;
  Window wnd;
  int c;
  int screen = -1;
  int x = -1, y = -1;
  int quiet = 0;
  int print = 0;
  Window wtmp;
  int itmp;
  while (1) {
    int option_index = 0;
    static struct option long_options[] = {
        {"print", 0, 0, 'p'}, {"coord", 1, 0, 'c'},   {"quiet", 0, 0, 'q'},
        {"help", 0, 0, 'h'},  {"version", 0, 0, 'V'}, {0, 0, 0, 0}};
    c = getopt_long(argc, argv, "pPmc:qhV", long_options, &option_index);
    if (c == -1)
      break;
    switch (c) {
    case 0:
      break;
    case 'c':
      if (sscanf(optarg, "%d,%d", &x, &y) != 2) {
        fprintf(stderr,
                "Bad argument for -c: %s\n"
                "(Correct format is 'x,y'.)\n",
                optarg);
        exit(1);
      }
      break;
    case 'p':
    case 'P':
      print = 1;
      break;
    case 'q':
      quiet = 1;
      break;
    case 'h':
      help();
      exit(0);
    case 'V':
      printf("switchscreen version "
             "0.1.1"
             "\n");
      exit(0);
    default:
      fprintf(stderr, "Use '%s -h' for help.\n", argv[0]);
      exit(1);
    }
  }
  if (optind < argc) {
    if (optind + 1 < argc) {
      fprintf(stderr, "Too many arguments for format.\n");
      fprintf(stderr, "Use '%s -h' for help.\n", argv[0]);
      exit(1);
    }
    if (sscanf(argv[optind], "%d", &screen) < 1) {
      fprintf(stderr, "Bad argument:  %s\n", argv[optind]);
      fprintf(stderr, "Use '%s -h' for help.\n", argv[0]);
      exit(1);
    }
  }
  if (screen < 0 && (x < 0 || y < 0) && !print) {
    help();
    exit(1);
  }
  dpy = XOpenDisplay(NULL);
  if (dpy == NULL) {
    fprintf(stderr, "%s:  Cannot open display.\n", argv[0]);
    exit(1);
  }
  if ((screen < 0) || print) {
    scr = XDefaultScreenOfDisplay(dpy);
    if (scr == NULL) {
      fprintf(stderr, "XDefaultScreenOfDisplay "
                      "returned NULL!\n");
      exit(1);
    }
    screen = XScreenNumberOfScreen(scr);
  }
  if (print) {
    wnd = XDefaultRootWindow(dpy);
    XQueryPointer(dpy, wnd, &wtmp, &wtmp, &x, &y, &itmp, &itmp,
                  (unsigned int *)&itmp);
    printf("Screen: %d  Coordinates: %d,%d\n", screen, x, y);
    exit(0);
  }
  if (x < 0 || y < 0) {
    scr = ScreenOfDisplay(dpy, screen);
    if (scr == NULL) {
      fprintf(stderr, "XScreensOfDisplay returned NULL!\n");
      exit(1);
    }
    x = XWidthOfScreen(scr) / 2;
    y = XHeightOfScreen(scr) / 2;
  }
  if (!quiet) {
    if (screen == -1)
      printf("Setting coordinates %d,%d.\n", x, y);
    else
      printf("Setting Screen %d at coordinates %d,%d.\n", screen, x, y);
  }
  wnd = RootWindow(dpy, screen);
  XSetInputFocus(dpy, wnd, RevertToNone, CurrentTime);
  XFlush(dpy);
  XGrabPointer(dpy, wnd, False, 0, GrabModeAsync, GrabModeAsync, None, None,
               CurrentTime);
  XWarpPointer(dpy, None, wnd, 0, 0, 0, 0, x, y);
  XUngrabPointer(dpy, CurrentTime);
  XCloseDisplay(dpy);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x2c(%rbp)
movl   $0xffffffff,-0x30(%rbp)
movl   $0xffffffff,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x48(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xd81(%rip),%rdx
lea    0x2e2b(%rip),%rcx
lea    -0x48(%rbp),%r8
call   1030 <getopt_long@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0xffffffff,-0x28(%rbp)
jne    12c0 <main+0x70>
jmp    13ff <main+0x1af>
mov    -0x28(%rbp),%eax
mov    %eax,-0x4c(%rbp)
test   %eax,%eax
je     1339 <main+0xe9>
jmp    12d3 <main+0x83>
mov    -0x4c(%rbp),%eax
sub    $0x50,%eax
je     1397 <main+0x147>
jmp    12e4 <main+0x94>
mov    -0x4c(%rbp),%eax
sub    $0x56,%eax
je     13bd <main+0x16d>
jmp    12f5 <main+0xa5>
mov    -0x4c(%rbp),%eax
sub    $0x63,%eax
je     133e <main+0xee>
jmp    1306 <main+0xb6>
mov    -0x4c(%rbp),%eax
sub    $0x68,%eax
je     13af <main+0x15f>
jmp    1317 <main+0xc7>
mov    -0x4c(%rbp),%eax
sub    $0x70,%eax
je     1397 <main+0x147>
jmp    1328 <main+0xd8>
mov    -0x4c(%rbp),%eax
sub    $0x71,%eax
je     13a3 <main+0x153>
jmp    13d2 <main+0x182>
jmp    13fa <main+0x1aa>
mov    0x2cb3(%rip),%rax
mov    (%rax),%rdi
lea    0xcd9(%rip),%rsi
lea    -0x30(%rbp),%rdx
lea    -0x34(%rbp),%rcx
mov    $0x0,%al
call   10e0 <sscanf@plt>
cmp    $0x2,%eax
je     1392 <main+0x142>
mov    0x2c42(%rip),%rax
mov    (%rax),%edi
mov    0x2c81(%rip),%rax
mov    (%rax),%rdx
lea    0xcad(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    $0x1,%edi
call   1140 <exit@plt>
jmp    13fa <main+0x1aa>
movl   $0x1,-0x3c(%rbp)
jmp    13fa <main+0x1aa>
movl   $0x1,-0x38(%rbp)
jmp    13fa <main+0x1aa>
mov    $0x0,%al
call   1130 <help@plt>
xor    %edi,%edi
call   1140 <exit@plt>
lea    0xc9e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1140 <exit@plt>
mov    0x2bd7(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xc95(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    $0x1,%edi
call   1140 <exit@plt>
jmp    1289 <main+0x39>
mov    0x2bc2(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jge    14e8 <main+0x298>
mov    0x2bb0(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
cmp    -0x8(%rbp),%eax
jge    1465 <main+0x215>
mov    0x2b83(%rip),%rax
mov    (%rax),%edi
lea    0xc5f(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    0x2b6c(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xc2a(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    $0x1,%edi
call   1140 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x2b58(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xbad(%rip),%rsi
lea    -0x2c(%rbp),%rdx
mov    $0x0,%al
call   10e0 <sscanf@plt>
cmp    $0x1,%eax
jge    14e3 <main+0x293>
mov    0x2b17(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x2b22(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xc01(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    0x2aee(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xbac(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    $0x1,%edi
call   1140 <exit@plt>
jmp    14e8 <main+0x298>
cmpl   $0x0,-0x2c(%rbp)
jge    1521 <main+0x2d1>
cmpl   $0x0,-0x30(%rbp)
jl     1506 <main+0x2b6>
cmpl   $0x0,-0x34(%rbp)
jge    1521 <main+0x2d1>
cmpl   $0x0,-0x3c(%rbp)
jne    1521 <main+0x2d1>
mov    $0x0,%al
call   1130 <help@plt>
mov    $0x1,%edi
call   1140 <exit@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10a0 <XOpenDisplay@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1561 <main+0x311>
mov    0x2a70(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xb78(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    $0x1,%edi
call   1140 <exit@plt>
cmpl   $0x0,-0x2c(%rbp)
jl     1575 <main+0x325>
cmpl   $0x0,-0x3c(%rbp)
je     15ba <main+0x36a>
mov    -0x18(%rbp),%rdi
call   1050 <XDefaultScreenOfDisplay@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    15ae <main+0x35e>
mov    0x2a1c(%rip),%rax
mov    (%rax),%edi
lea    0xb46(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    $0x1,%edi
call   1140 <exit@plt>
mov    -0x20(%rbp),%rdi
call   1170 <XScreenNumberOfScreen@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
je     161b <main+0x3cb>
mov    -0x18(%rbp),%rdi
call   1100 <XDefaultRootWindow@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
lea    -0x40(%rbp),%rcx
lea    -0x30(%rbp),%r8
lea    -0x34(%rbp),%r9
lea    -0x44(%rbp),%rax
mov    %rcx,%rdx
mov    %rax,(%rsp)
mov    %rax,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   10c0 <XQueryPointer@plt>
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    -0x34(%rbp),%ecx
lea    0xafe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1140 <exit@plt>
cmpl   $0x0,-0x30(%rbp)
jl     162f <main+0x3df>
cmpl   $0x0,-0x34(%rbp)
jge    1693 <main+0x443>
mov    -0x18(%rbp),%rdi
mov    -0x2c(%rbp),%esi
call   1120 <ScreenOfDisplay@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    166b <main+0x41b>
mov    0x295f(%rip),%rax
mov    (%rax),%edi
lea    0xad1(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    $0x1,%edi
call   1140 <exit@plt>
mov    -0x20(%rbp),%rdi
call   1070 <XWidthOfScreen@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
call   1090 <XHeightOfScreen@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x38(%rbp)
jne    16dc <main+0x48c>
cmpl   $0xffffffff,-0x2c(%rbp)
jne    16c0 <main+0x470>
mov    -0x30(%rbp),%esi
mov    -0x34(%rbp),%edx
lea    0xa99(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    16d7 <main+0x487>
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    -0x34(%rbp),%ecx
lea    0xa99(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    16dc <main+0x48c>
mov    -0x18(%rbp),%rdi
mov    -0x2c(%rbp),%esi
call   10f0 <RootWindow@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    0x28af(%rip),%rax
mov    (%rax),%edx
mov    0x28de(%rip),%rax
mov    (%rax),%ecx
call   1160 <XSetInputFocus@plt>
mov    -0x18(%rbp),%rdi
call   1110 <XFlush@plt>
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    0x28b8(%rip),%rax
mov    (%rax),%edx
mov    0x288f(%rip),%rax
mov    (%rax),%r8d
mov    0x2885(%rip),%rax
mov    (%rax),%r9d
mov    0x2893(%rip),%rax
mov    (%rax),%r11d
mov    0x2889(%rip),%rax
mov    (%rax),%r10d
mov    0x288f(%rip),%rax
mov    (%rax),%eax
xor    %ecx,%ecx
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1060 <XGrabPointer@plt>
mov    -0x18(%rbp),%rdi
mov    0x285e(%rip),%rax
mov    (%rax),%esi
mov    -0x24(%rbp),%edx
mov    -0x30(%rbp),%r10d
mov    -0x34(%rbp),%eax
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1080 <XWarpPointer@plt>
mov    -0x18(%rbp),%rdi
mov    0x2839(%rip),%rax
mov    (%rax),%esi
call   10d0 <XUngrabPointer@plt>
mov    -0x18(%rbp),%rdi
call   1150 <XCloseDisplay@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r15
mov    %edi,%ebp
movl   $0xffffffff,0x14(%rsp)
ff
movl   $0xffffffff,0xc(%rsp)
ff
movl   $0xffffffff,0x10(%rsp)
ff
lea    0xe15(%rip),%r14
lea    0x2e47(%rip),%r12
lea    0x20(%rsp),%rbx
lea    0xd5b(%rip),%r13
movl   $0x0,0x18(%rsp)
movl   $0x0,0x1c(%rsp)
jmp    12c0 <main+0x60>
movl   $0x1,0x18(%rsp)
nop
movl   $0x0,0x20(%rsp)
mov    %ebp,%edi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %r12,%rcx
mov    %rbx,%r8
call   1040 <getopt_long@plt>
lea    -0x50(%rax),%ecx
cmp    $0x21,%ecx
ja     1300 <main+0xa0>
movslq 0x0(%r13,%rcx,4),%rax
add    %r13,%rax
jmp    *%rax
movl   $0x1,0x1c(%rsp)
jmp    12c0 <main+0x60>
nopw   0x0(%rax,%rax,1)
test   %eax,%eax
je     12c0 <main+0x60>
jmp    134c <main+0xec>
mov    0x2ceb(%rip),%rax
mov    (%rax),%rdi
lea    0xd99(%rip),%rsi
lea    0xc(%rsp),%rdx
lea    0x10(%rsp),%rcx
xor    %eax,%eax
call   10f0 <sscanf@plt>
cmp    $0x2,%eax
je     12c0 <main+0x60>
mov    0x2c7c(%rip),%rax
mov    (%rax),%edi
mov    0x2cbb(%rip),%rax
mov    (%rax),%rdx
lea    0xd6f(%rip),%rsi
jmp    154b <main+0x2eb>
cmp    $0xffffffff,%eax
jne    1538 <main+0x2d8>
mov    0x2c6c(%rip),%r14
movslq (%r14),%rax
cmp    %ebp,%eax
mov    0x1c(%rsp),%ebx
jge    1398 <main+0x138>
lea    0x1(%rax),%ecx
cmp    %ebp,%ecx
jl     15f8 <main+0x398>
mov    (%r15,%rax,8),%rdi
lea    0xd36(%rip),%rsi
lea    0x14(%rsp),%rdx
xor    %eax,%eax
call   10f0 <sscanf@plt>
test   %eax,%eax
jle    1616 <main+0x3b6>
cmpl   $0x0,0x14(%rsp)
jns    13aa <main+0x14a>
mov    0xc(%rsp),%eax
or     0x10(%rsp),%eax
jns    13aa <main+0x14a>
test   %ebx,%ebx
je     15e7 <main+0x387>
xor    %edi,%edi
call   10b0 <XOpenDisplay@plt>
test   %rax,%rax
je     157d <main+0x31d>
mov    %rax,%r14
mov    0x14(%rsp),%eax
test   %eax,%eax
js     13c9 <main+0x169>
test   %ebx,%ebx
je     13e6 <main+0x186>
mov    %r14,%rdi
call   1060 <XDefaultScreenOfDisplay@plt>
test   %rax,%rax
je     163d <main+0x3dd>
mov    %rax,%rdi
call   1180 <XScreenNumberOfScreen@plt>
mov    %eax,0x14(%rsp)
test   %ebx,%ebx
jne    1592 <main+0x332>
cmpl   $0x0,0xc(%rsp)
js     1406 <main+0x1a6>
mov    0x10(%rsp),%ecx
test   %ecx,%ecx
js     1406 <main+0x1a6>
cmpl   $0x0,0x18(%rsp)
jne    147c <main+0x21c>
jmp    144d <main+0x1ed>
mov    %r14,%rdi
mov    %eax,%esi
call   1130 <ScreenOfDisplay@plt>
test   %rax,%rax
je     164f <main+0x3ef>
mov    %rax,%rbx
mov    %rax,%rdi
call   1080 <XWidthOfScreen@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
mov    %ecx,0xc(%rsp)
mov    %rbx,%rdi
call   10a0 <XHeightOfScreen@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
mov    %ecx,0x10(%rsp)
cmpl   $0x0,0x18(%rsp)
jne    147c <main+0x21c>
mov    0x14(%rsp),%esi
mov    0xc(%rsp),%edx
cmp    $0xffffffff,%esi
je     146a <main+0x20a>
lea    0xd74(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    147c <main+0x21c>
lea    0xd48(%rip),%rdi
mov    %edx,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x14(%rsp),%esi
mov    %r14,%rdi
call   1100 <RootWindow@plt>
mov    %eax,%ebx
mov    0x2b17(%rip),%rax
mov    (%rax),%edx
mov    0x2b46(%rip),%r15
mov    (%r15),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
call   1170 <XSetInputFocus@plt>
mov    %r14,%rdi
call   1120 <XFlush@plt>
mov    0x2b22(%rip),%rax
mov    (%rax),%edx
mov    0x2af9(%rip),%rax
mov    (%rax),%r8d
mov    0x2b07(%rip),%r12
mov    (%r12),%eax
mov    (%r15),%ebp
sub    $0x8,%rsp
mov    %r14,%rdi
mov    %ebx,%esi
xor    %ecx,%ecx
mov    %r8d,%r9d
push   %rbp
push   %rax
push   %rax
call   1070 <XGrabPointer@plt>
add    $0x20,%rsp
mov    (%r12),%esi
mov    0xc(%rsp),%eax
mov    0x10(%rsp),%ebp
sub    $0x8,%rsp
mov    %r14,%rdi
mov    %ebx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %rbp
push   %rax
push   $0x0
call   1090 <XWarpPointer@plt>
add    $0x20,%rsp
mov    (%r15),%esi
mov    %r14,%rdi
call   10e0 <XUngrabPointer@plt>
mov    %r14,%rdi
call   1160 <XCloseDisplay@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2a71(%rip),%rax
mov    (%rax),%edi
mov    (%r15),%rdx
lea    0xb9f(%rip),%rsi
xor    %eax,%eax
call   10c0 <fprintf@plt>
mov    $0x1,%edi
call   1150 <exit@plt>
lea    0xc9b(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1150 <exit@plt>
xor    %eax,%eax
call   1140 <help@plt>
xor    %edi,%edi
call   1150 <exit@plt>
mov    0x2a2c(%rip),%rax
mov    (%rax),%edi
mov    (%r15),%rdx
lea    0xba4(%rip),%rsi
jmp    154b <main+0x2eb>
mov    %r14,%rdi
call   1110 <XDefaultRootWindow@plt>
sub    $0x8,%rsp
lea    0x2c(%rsp),%rbp
lea    0x28(%rsp),%rcx
lea    0x14(%rsp),%r8
lea    0x18(%rsp),%r9
mov    %r14,%rdi
mov    %eax,%esi
mov    %rcx,%rdx
push   %rbp
push   %rbp
push   %rbp
call   10d0 <XQueryPointer@plt>
add    $0x20,%rsp
mov    0x14(%rsp),%esi
mov    0xc(%rsp),%edx
mov    0x10(%rsp),%ecx
lea    0xb9e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %edi,%edi
call   1150 <exit@plt>
xor    %eax,%eax
call   1140 <help@plt>
mov    $0x1,%edi
call   1150 <exit@plt>
mov    0x29b1(%rip),%rbx
mov    (%rbx),%edi
lea    0xaf9(%rip),%rsi
xor    %eax,%eax
call   10c0 <fprintf@plt>
mov    (%rbx),%edi
jmp    1541 <main+0x2e1>
mov    0x2993(%rip),%rbp
mov    0x0(%rbp),%edi
movslq (%r14),%rax
mov    (%r15,%rax,8),%rdx
lea    0xaf3(%rip),%rsi
xor    %eax,%eax
call   10c0 <fprintf@plt>
mov    0x0(%rbp),%edi
jmp    1541 <main+0x2e1>
mov    0x296c(%rip),%rax
mov    (%rax),%edi
lea    0xb02(%rip),%rsi
jmp    165f <main+0x3ff>
mov    0x295a(%rip),%rax
mov    (%rax),%edi
lea    0xb38(%rip),%rsi
xor    %eax,%eax
call   10c0 <fprintf@plt>
mov    $0x1,%edi
call   1150 <exit@plt>

LLVM IR (-O0):
%struct.option = type { i8*, i32, i8, i32 }
@main.long_options = internal global [6 x %struct.option] [%struct.option { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i32 0, i8 0, i32 112 }, %struct.option { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i32 1, i8 0, i32 99 }, %struct.option { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i32 0, i8 0, i32 113 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i32 0, i8 0, i32 104 }, %struct.option { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i32 0, i32 0), i32 0, i8 0, i32 86 }, %struct.option zeroinitializer]
@.str = [6 x i8] c"print\00"
@.str.1 = [6 x i8] c"coord\00"
@.str.2 = [6 x i8] c"quiet\00"
@.str.3 = [5 x i8] c"help\00"
@.str.4 = [8 x i8] c"version\00"
@.str.5 = [9 x i8] c"pPmc:qhV\00"
@optarg = global i8* null
@.str.6 = [6 x i8] c"%d,%d\00"
@stderr = global i32 0
@.str.7 = [52 x i8] c"Bad argument for -c: %s\0A(Correct format is 'x,y'.)\0A\00"
@.str.8 = [28 x i8] c"switchscreen version 0.1.1\0A\00"
@.str.9 = [23 x i8] c"Use '%s -h' for help.\0A\00"
@optind = global i32 0
@.str.10 = [32 x i8] c"Too many arguments for format.\0A\00"
@.str.11 = [3 x i8] c"%d\00"
@.str.12 = [19 x i8] c"Bad argument: %s\0A\00"
@.str.13 = [27 x i8] c"%s: Cannot open display.\0A\00"
@.str.14 = [40 x i8] c"XDefaultScreenOfDisplay returned NULL!\0A\00"
@.str.15 = [32 x i8] c"Screen: %d Coordinates: %d,%d\0A\00"
@.str.16 = [34 x i8] c"XScreensOfDisplay returned NULL!\0A\00"
@.str.17 = [28 x i8] c"Setting coordinates %d,%d.\0A\00"
@.str.18 = [41 x i8] c"Setting Screen %d at coordinates %d,%d.\0A\00"
@RevertToNone = global i32 0
@CurrentTime = global i32 0
@False = global i32 0
@GrabModeAsync = global i32 0
@None = global i32 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 i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -1, i32* %10
store i32 -1, i32* %11
store i32 -1, i32* %12
store i32 0, i32* %13
store i32 0, i32* %14
br label %18
18: ; preds = %2, %53
store i32 0, i32* %17
%19 = load i32, i32* %4
%20 = load i8**, i8*** %5
%21 = call i32 @getopt_long(i32 %19, i8** %20, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), %struct.option* getelementptr inbounds ([6 x %struct.option], [6 x %struct.option]* @main.long_options, i64 0, i64 0), i32* %17)
store i32 %21, i32* %9
%22 = load i32, i32* %9
%23 = icmp eq i32 %22, -1
br i1 %23, label %24, label %25
24: ; preds = %18
br label %54
25: ; preds = %18
%26 = load i32, i32* %9
switch i32 %26, label %46 [
i32 0, label %27
i32 99, label %28
i32 112, label %38
i32 80, label %38
i32 113, label %39
i32 104, label %40
i32 86, label %43
]
27: ; preds = %25
br label %53
28: ; preds = %25
%29 = load i8*, i8** @optarg
%30 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %29, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32* %11, i32* %12)
%31 = icmp ne i32 %30, 2
br i1 %31, label %32, label %37
32: ; preds = %28
%33 = load i32, i32* @stderr
%34 = load i8*, i8** @optarg
%35 = call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0), i8* %34)
%36 = call i32 @exit(i32 1)
unreachable
37: ; preds = %28
br label %53
38: ; preds = %25, %25
store i32 1, i32* %14
br label %53
39: ; preds = %25
store i32 1, i32* %13
br label %53
40: ; preds = %25
%41 = call i32 (...) @help()
%42 = call i32 @exit(i32 0)
unreachable
43: ; preds = %25
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0))
%45 = call i32 @exit(i32 0)
unreachable
46: ; preds = %25
%47 = load i32, i32* @stderr
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 0
%50 = load i8*, i8** %49
%51 = call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i8* %50)
%52 = call i32 @exit(i32 1)
unreachable
53: ; preds = %39, %38, %37, %27
br label %18
54: ; preds = %24
%55 = load i32, i32* @optind
%56 = load i32, i32* %4
%57 = icmp slt i32 %55, %56
br i1 %57, label %58, label %95
58: ; preds = %54
%59 = load i32, i32* @optind
%60 = add nsw i32 %59, 1
%61 = load i32, i32* %4
%62 = icmp slt i32 %60, %61
br i1 %62, label %63, label %72
63: ; preds = %58
%64 = load i32, i32* @stderr
%65 = call i32 (i32, i8*, ...) @fprintf(i32 %64, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0))
%66 = load i32, i32* @stderr
%67 = load i8**, i8*** %5
%68 = getelementptr inbounds i8*, i8** %67, i64 0
%69 = load i8*, i8** %68
%70 = call i32 (i32, i8*, ...) @fprintf(i32 %66, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i8* %69)
%71 = call i32 @exit(i32 1)
unreachable
72: ; preds = %58
%73 = load i8**, i8*** %5
%74 = load i32, i32* @optind
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds i8*, i8** %73, i64 %75
%77 = load i8*, i8** %76
%78 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %77, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32* %10)
%79 = icmp slt i32 %78, 1
br i1 %79, label %80, label %94
80: ; preds = %72
%81 = load i32, i32* @stderr
%82 = load i8**, i8*** %5
%83 = load i32, i32* @optind
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i8*, i8** %82, i64 %84
%86 = load i8*, i8** %85
%87 = call i32 (i32, i8*, ...) @fprintf(i32 %81, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i8* %86)
%88 = load i32, i32* @stderr
%89 = load i8**, i8*** %5
%90 = getelementptr inbounds i8*, i8** %89, i64 0
%91 = load i8*, i8** %90
%92 = call i32 (i32, i8*, ...) @fprintf(i32 %88, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i8* %91)
%93 = call i32 @exit(i32 1)
unreachable
94: ; preds = %72
br label %95
95: ; preds = %94, %54
%96 = load i32, i32* %10
%97 = icmp slt i32 %96, 0
br i1 %97, label %98, label %110
98: ; preds = %95
%99 = load i32, i32* %11
%100 = icmp slt i32 %99, 0
br i1 %100, label %104, label %101
101: ; preds = %98
%102 = load i32, i32* %12
%103 = icmp slt i32 %102, 0
br i1 %103, label %104, label %110
104: ; preds = %101, %98
%105 = load i32, i32* %14
%106 = icmp ne i32 %105, 0
br i1 %106, label %110, label %107
107: ; preds = %104
%108 = call i32 (...) @help()
%109 = call i32 @exit(i32 1)
unreachable
110: ; preds = %104, %101, %95
%111 = call i32* @XOpenDisplay(i32* null)
store i32* %111, i32** %6
%112 = load i32*, i32** %6
%113 = icmp eq i32* %112, null
br i1 %113, label %114, label %121
114: ; preds = %110
%115 = load i32, i32* @stderr
%116 = load i8**, i8*** %5
%117 = getelementptr inbounds i8*, i8** %116, i64 0
%118 = load i8*, i8** %117
%119 = call i32 (i32, i8*, ...) @fprintf(i32 %115, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i64 0, i64 0), i8* %118)
%120 = call i32 @exit(i32 1)
unreachable
121: ; preds = %110
%122 = load i32, i32* %10
%123 = icmp slt i32 %122, 0
br i1 %123, label %127, label %124
124: ; preds = %121
%125 = load i32, i32* %14
%126 = icmp ne i32 %125, 0
br i1 %126, label %127, label %139
127: ; preds = %124, %121
%128 = load i32*, i32** %6
%129 = call i32* @XDefaultScreenOfDisplay(i32* %128)
store i32* %129, i32** %7
%130 = load i32*, i32** %7
%131 = icmp eq i32* %130, null
br i1 %131, label %132, label %136
132: ; preds = %127
%133 = load i32, i32* @stderr
%134 = call i32 (i32, i8*, ...) @fprintf(i32 %133, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.14, i64 0, i64 0))
%135 = call i32 @exit(i32 1)
unreachable
136: ; preds = %127
%137 = load i32*, i32** %7
%138 = call i32 @XScreenNumberOfScreen(i32* %137)
store i32 %138, i32* %10
br label %139
139: ; preds = %136, %124
%140 = load i32, i32* %14
%141 = icmp ne i32 %140, 0
br i1 %141, label %142, label %153
142: ; preds = %139
%143 = load i32*, i32** %6
%144 = call i32 @XDefaultRootWindow(i32* %143)
store i32 %144, i32* %8
%145 = load i32*, i32** %6
%146 = load i32, i32* %8
%147 = call i32 @XQueryPointer(i32* %145, i32 %146, i32* %15, i32* %15, i32* %11, i32* %12, i32* %16, i32* %16, i32* %16)
%148 = load i32, i32* %10
%149 = load i32, i32* %11
%150 = load i32, i32* %12
%151 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.15, i64 0, i64 0), i32 %148, i32 %149, i32 %150)
%152 = call i32 @exit(i32 0)
unreachable
153: ; preds = %139
%154 = load i32, i32* %11
%155 = icmp slt i32 %154, 0
br i1 %155, label %159, label %156
156: ; preds = %153
%157 = load i32, i32* %12
%158 = icmp slt i32 %157, 0
br i1 %158, label %159, label %176
159: ; preds = %156, %153
%160 = load i32*, i32** %6
%161 = load i32, i32* %10
%162 = call i32* @ScreenOfDisplay(i32* %160, i32 %161)
store i32* %162, i32** %7
%163 = load i32*, i32** %7
%164 = icmp eq i32* %163, null
br i1 %164, label %165, label %169
165: ; preds = %159
%166 = load i32, i32* @stderr
%167 = call i32 (i32, i8*, ...) @fprintf(i32 %166, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.16, i64 0, i64 0))
%168 = call i32 @exit(i32 1)
unreachable
169: ; preds = %159
%170 = load i32*, i32** %7
%171 = call i32 @XWidthOfScreen(i32* %170)
%172 = sdiv i32 %171, 2
store i32 %172, i32* %11
%173 = load i32*, i32** %7
%174 = call i32 @XHeightOfScreen(i32* %173)
%175 = sdiv i32 %174, 2
store i32 %175, i32* %12
br label %176
176: ; preds = %169, %156
%177 = load i32, i32* %13
%178 = icmp ne i32 %177, 0
br i1 %178, label %192, label %179
179: ; preds = %176
%180 = load i32, i32* %10
%181 = icmp eq i32 %180, -1
br i1 %181, label %182, label %186
182: ; preds = %179
%183 = load i32, i32* %11
%184 = load i32, i32* %12
%185 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.17, i64 0, i64 0), i32 %183, i32 %184)
br label %191
186: ; preds = %179
%187 = load i32, i32* %10
%188 = load i32, i32* %11
%189 = load i32, i32* %12
%190 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.18, i64 0, i64 0), i32 %187, i32 %188, i32 %189)
br label %191
191: ; preds = %186, %182
br label %192
192: ; preds = %191, %176
%193 = load i32*, i32** %6
%194 = load i32, i32* %10
%195 = call i32 @RootWindow(i32* %193, i32 %194)
store i32 %195, i32* %8
%196 = load i32*, i32** %6
%197 = load i32, i32* %8
%198 = load i32, i32* @RevertToNone
%199 = load i32, i32* @CurrentTime
%200 = call i32 @XSetInputFocus(i32* %196, i32 %197, i32 %198, i32 %199)
%201 = load i32*, i32** %6
%202 = call i32 @XFlush(i32* %201)
%203 = load i32*, i32** %6
%204 = load i32, i32* %8
%205 = load i32, i32* @False
%206 = load i32, i32* @GrabModeAsync
%207 = load i32, i32* @GrabModeAsync
%208 = load i32, i32* @None
%209 = load i32, i32* @None
%210 = load i32, i32* @CurrentTime
%211 = call i32 @XGrabPointer(i32* %203, i32 %204, i32 %205, i32 0, i32 %206, i32 %207, i32 %208, i32 %209, i32 %210)
%212 = load i32*, i32** %6
%213 = load i32, i32* @None
%214 = load i32, i32* %8
%215 = load i32, i32* %11
%216 = load i32, i32* %12
%217 = call i32 @XWarpPointer(i32* %212, i32 %213, i32 %214, i32 0, i32 0, i32 0, i32 0, i32 %215, i32 %216)
%218 = load i32*, i32** %6
%219 = load i32, i32* @CurrentTime
%220 = call i32 @XUngrabPointer(i32* %218, i32 %219)
%221 = load i32*, i32** %6
%222 = call i32 @XCloseDisplay(i32* %221)
ret i32 0
}

LLVM IR (-O2):
%struct.option = type { i8*, i32, i8, i32 }
@main.long_options = internal global [6 x %struct.option] [%struct.option { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i32 0, i8 0, i32 112 }, %struct.option { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i32 1, i8 0, i32 99 }, %struct.option { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i32 0, i8 0, i32 113 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i32 0, i8 0, i32 104 }, %struct.option { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i32 0, i32 0), i32 0, i8 0, i32 86 }, %struct.option zeroinitializer]
@.str = [6 x i8] c"print\00"
@.str.1 = [6 x i8] c"coord\00"
@.str.2 = [6 x i8] c"quiet\00"
@.str.3 = [5 x i8] c"help\00"
@.str.4 = [8 x i8] c"version\00"
@.str.5 = [9 x i8] c"pPmc:qhV\00"
@optarg = global i8* null
@.str.6 = [6 x i8] c"%d,%d\00"
@stderr = global i32 0
@.str.7 = [52 x i8] c"Bad argument for -c: %s\0A(Correct format is 'x,y'.)\0A\00"
@.str.9 = [23 x i8] c"Use '%s -h' for help.\0A\00"
@optind = global i32 0
@.str.10 = [32 x i8] c"Too many arguments for format.\0A\00"
@.str.11 = [3 x i8] c"%d\00"
@.str.12 = [19 x i8] c"Bad argument: %s\0A\00"
@.str.13 = [27 x i8] c"%s: Cannot open display.\0A\00"
@.str.14 = [40 x i8] c"XDefaultScreenOfDisplay returned NULL!\0A\00"
@.str.15 = [32 x i8] c"Screen: %d Coordinates: %d,%d\0A\00"
@.str.16 = [34 x i8] c"XScreensOfDisplay returned NULL!\0A\00"
@.str.17 = [28 x i8] c"Setting coordinates %d,%d.\0A\00"
@.str.18 = [41 x i8] c"Setting Screen %d at coordinates %d,%d.\0A\00"
@RevertToNone = global i32 0
@CurrentTime = global i32 0
@False = global i32 0
@GrabModeAsync = global i32 0
@None = global i32 0
@str = [27 x i8] c"switchscreen version 0.1.1\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = bitcast i32* %3 to i8*
store i32 -1, i32* %3
%10 = bitcast i32* %4 to i8*
store i32 -1, i32* %4
%11 = bitcast i32* %5 to i8*
store i32 -1, i32* %5
%12 = bitcast i32* %6 to i8*
%13 = bitcast i32* %7 to i8*
%14 = bitcast i32* %8 to i8*
br label %15
15: ; preds = %41, %2
%16 = phi i32 [ 0, %2 ], [ %42, %41 ]
%17 = phi i32 [ 0, %2 ], [ %43, %41 ]
store i32 0, i32* %8
%18 = call i32 @getopt_long(i32 %0, i8** %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), %struct.option* getelementptr inbounds ([6 x %struct.option], [6 x %struct.option]* @main.long_options, i64 0, i64 0), i32* %8)
switch i32 %18, label %36 [
i32 -1, label %44
i32 0, label %41
i32 99, label %19
i32 112, label %28
i32 80, label %28
i32 113, label %29
i32 104, label %30
i32 86, label %33
]
19: ; preds = %15
%20 = load i8*, i8** @optarg
%21 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %20, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32* %4, i32* %5)
%22 = icmp eq i32 %21, 2
br i1 %22, label %41, label %23
23: ; preds = %19
%24 = load i32, i32* @stderr
%25 = load i8*, i8** @optarg
%26 = call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0), i8* %25)
%27 = call i32 @exit(i32 1)
unreachable
28: ; preds = %15, %15
br label %41
29: ; preds = %15
br label %41
30: ; preds = %15
%31 = call i32 (...) @help()
%32 = call i32 @exit(i32 0)
unreachable
33: ; preds = %15
%34 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%35 = call i32 @exit(i32 0)
unreachable
36: ; preds = %15
%37 = load i32, i32* @stderr
%38 = load i8*, i8** %1
%39 = call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i8* %38)
%40 = call i32 @exit(i32 1)
unreachable
41: ; preds = %28, %29, %19, %15
%42 = phi i32 [ 1, %29 ], [ %16, %28 ], [ %16, %19 ], [ %16, %15 ]
%43 = phi i32 [ %17, %29 ], [ 1, %28 ], [ %17, %19 ], [ %17, %15 ]
br label %15
44: ; preds = %15
%45 = load i32, i32* @optind
%46 = icmp slt i32 %45, %0
br i1 %46, label %47, label %77
47: ; preds = %44
%48 = add nsw i32 %45, 1
%49 = icmp slt i32 %48, %0
br i1 %49, label %50, label %57
50: ; preds = %47
%51 = load i32, i32* @stderr
%52 = call i32 (i32, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0))
%53 = load i32, i32* @stderr
%54 = load i8*, i8** %1
%55 = call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i8* %54)
%56 = call i32 @exit(i32 1)
unreachable
57: ; preds = %47
%58 = sext i32 %45 to i64
%59 = getelementptr inbounds i8*, i8** %1, i64 %58
%60 = load i8*, i8** %59
%61 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %60, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32* %3)
%62 = icmp slt i32 %61, 1
br i1 %62, label %63, label %74
63: ; preds = %57
%64 = load i32, i32* @stderr
%65 = load i32, i32* @optind
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i8*, i8** %1, i64 %66
%68 = load i8*, i8** %67
%69 = call i32 (i32, i8*, ...) @fprintf(i32 %64, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i8* %68)
%70 = load i32, i32* @stderr
%71 = load i8*, i8** %1
%72 = call i32 (i32, i8*, ...) @fprintf(i32 %70, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i8* %71)
%73 = call i32 @exit(i32 1)
unreachable
74: ; preds = %57
%75 = load i32, i32* %3
%76 = icmp slt i32 %75, 0
br i1 %76, label %77, label %88
77: ; preds = %44, %74
%78 = load i32, i32* %4
%79 = icmp sgt i32 %78, -1
%80 = load i32, i32* %5
%81 = icmp sgt i32 %80, -1
%82 = select i1 %79, i1 %81, i1 false
%83 = icmp ne i32 %17, 0
%84 = select i1 %82, i1 true, i1 %83
br i1 %84, label %88, label %85
85: ; preds = %77
%86 = call i32 (...) @help()
%87 = call i32 @exit(i32 1)
unreachable
88: ; preds = %77, %74
%89 = call i32* @XOpenDisplay(i32* null)
%90 = icmp eq i32* %89, null
br i1 %90, label %91, label %96
91: ; preds = %88
%92 = load i32, i32* @stderr
%93 = load i8*, i8** %1
%94 = call i32 (i32, i8*, ...) @fprintf(i32 %92, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i64 0, i64 0), i8* %93)
%95 = call i32 @exit(i32 1)
unreachable
96: ; preds = %88
%97 = load i32, i32* %3
%98 = icmp slt i32 %97, 0
%99 = icmp ne i32 %17, 0
%100 = select i1 %98, i1 true, i1 %99
br i1 %100, label %101, label %110
101: ; preds = %96
%102 = call i32* @XDefaultScreenOfDisplay(i32* %89)
%103 = icmp eq i32* %102, null
br i1 %103, label %104, label %108
104: ; preds = %101
%105 = load i32, i32* @stderr
%106 = call i32 (i32, i8*, ...) @fprintf(i32 %105, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.14, i64 0, i64 0))
%107 = call i32 @exit(i32 1)
unreachable
108: ; preds = %101
%109 = call i32 @XScreenNumberOfScreen(i32* %102)
store i32 %109, i32* %3
br label %110
110: ; preds = %96, %108
%111 = phi i32 [ %97, %96 ], [ %109, %108 ]
br i1 %99, label %112, label %120
112: ; preds = %110
%113 = call i32 @XDefaultRootWindow(i32* %89)
%114 = call i32 @XQueryPointer(i32* %89, i32 %113, i32* %6, i32* %6, i32* %4, i32* %5, i32* %7, i32* %7, i32* %7)
%115 = load i32, i32* %3
%116 = load i32, i32* %4
%117 = load i32, i32* %5
%118 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.15, i64 0, i64 0), i32 %115, i32 %116, i32 %117)
%119 = call i32 @exit(i32 0)
unreachable
120: ; preds = %110
%121 = load i32, i32* %4
%122 = icmp slt i32 %121, 0
%123 = load i32, i32* %5
%124 = icmp slt i32 %123, 0
%125 = select i1 %122, i1 true, i1 %124
br i1 %125, label %126, label %138
126: ; preds = %120
%127 = call i32* @ScreenOfDisplay(i32* %89, i32 %111)
%128 = icmp eq i32* %127, null
br i1 %128, label %129, label %133
129: ; preds = %126
%130 = load i32, i32* @stderr
%131 = call i32 (i32, i8*, ...) @fprintf(i32 %130, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.16, i64 0, i64 0))
%132 = call i32 @exit(i32 1)
unreachable
133: ; preds = %126
%134 = call i32 @XWidthOfScreen(i32* %127)
%135 = sdiv i32 %134, 2
store i32 %135, i32* %4
%136 = call i32 @XHeightOfScreen(i32* %127)
%137 = sdiv i32 %136, 2
store i32 %137, i32* %5
br label %138
138: ; preds = %120, %133
%139 = phi i32 [ %123, %120 ], [ %137, %133 ]
%140 = icmp eq i32 %16, 0
br i1 %140, label %141, label %149
141: ; preds = %138
%142 = load i32, i32* %3
%143 = icmp eq i32 %142, -1
%144 = load i32, i32* %4
br i1 %143, label %145, label %147
145: ; preds = %141
%146 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.17, i64 0, i64 0), i32 %144, i32 %139)
br label %149
147: ; preds = %141
%148 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.18, i64 0, i64 0), i32 %142, i32 %144, i32 %139)
br label %149
149: ; preds = %145, %147, %138
%150 = load i32, i32* %3
%151 = call i32 @RootWindow(i32* %89, i32 %150)
%152 = load i32, i32* @RevertToNone
%153 = load i32, i32* @CurrentTime
%154 = call i32 @XSetInputFocus(i32* %89, i32 %151, i32 %152, i32 %153)
%155 = call i32 @XFlush(i32* %89)
%156 = load i32, i32* @False
%157 = load i32, i32* @GrabModeAsync
%158 = load i32, i32* @None
%159 = load i32, i32* @CurrentTime
%160 = call i32 @XGrabPointer(i32* %89, i32 %151, i32 %156, i32 0, i32 %157, i32 %157, i32 %158, i32 %158, i32 %159)
%161 = load i32, i32* @None
%162 = load i32, i32* %4
%163 = load i32, i32* %5
%164 = call i32 @XWarpPointer(i32* %89, i32 %161, i32 %151, i32 0, i32 0, i32 0, i32 0, i32 %162, i32 %163)
%165 = load i32, i32* @CurrentTime
%166 = call i32 @XUngrabPointer(i32* %89, i32 %165)
%167 = call i32 @XCloseDisplay(i32* %89)
ret i32 0
}