#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;
  char member_3;
  char *name;
  int /*<<< orphan*/ flag;
  int /*<<< orphan*/ member_2;
  int /*<<< orphan*/ const member_1;
};
typedef int __s32;

/* Variables and functions */
int /*<<< orphan*/ abort();
int atoi(char *);
int /*<<< orphan*/ exit(int);
int getopt_long(int, char **, char *, struct option *, int *);
int /*<<< orphan*/ help();
int /*<<< orphan*/ listDevices();
#define no_argument 129
char *optarg;
int optind;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
#define required_argument 128
int /*<<< orphan*/ setDeadzoneAndFuzz(char *, int, int, int);
int /*<<< orphan*/ showCalibration(char *);
int main(int argc, char *argv[]) {
  char *evdevice = NULL;
  int c, axisindex = -1;
  __s32 flat = -1, fuzz = -1;
  if (argc == 1) {
    help();
    exit(0);
  }
  while (1) {
    static struct option long_options[] = {
        {"help", no_argument, 0, 'h'},
        {"listdevs", no_argument, 0, 'l'},
        {"showcal", required_argument, 0, 's'},
        {"evdev", required_argument, 0, 'e'},
        {"deadzone", required_argument, 0, 'd'},
        {"fuzz", required_argument, 0, 'f'},
        {"axis", required_argument, 0, 'a'},
        {0, 0, 0, 0}};
    int option_index = 0;
    c = getopt_long(argc, argv, "h:l:s:e:d:f:a:", long_options, &option_index);
    if (c == -1)
      break;
    switch (c) {
    case 0:
      if (long_options[option_index].flag != 0)
        break;
      printf("option %s", long_options[option_index].name);
      if (optarg)
        printf(" with arg %s", optarg);
      printf("\n");
      break;
    case 'h':
      help();
      break;
    case 'l':
      listDevices();
      break;
    case 's':
      evdevice = optarg;
      showCalibration(evdevice);
      break;
    case 'e':
      evdevice = optarg;
      printf("Event device file: %s\n", evdevice);
      break;
    case 'd':
      flat = atoi(optarg);
      printf("New dead zone value: %d\n", flat);
      break;
    case 'f':
      fuzz = atoi(optarg);
      printf("New fuzz value: %d\n", fuzz);
      break;
    case 'a':
      axisindex = atoi(optarg);
      printf("Axis index to deal with: %d\n", axisindex);
      break;
    case '?':
      break;
    default:
      abort();
    }
  }
  if (optind < argc) {
    printf("non-option ARGV-elements: ");
    while (optind < argc)
      printf("%s ", argv[optind++]);
    putchar('\n');
  }
  if (flat != -1 || fuzz != -1) {
    if (evdevice == NULL) {
      printf("You must specify the event device for your joystick\n");
      exit(1);
    } else {
      if (axisindex == -1) {
        if (flat != -1)
          printf("Trying to set all axes deadzone to: %d\n", flat);
        if (fuzz != -1)
          printf("Trying to set all axes fuzz to: %d\n", fuzz);
      } else {
        if (flat != -1)
          printf("Trying to set axis %d deadzone to: %d\n", axisindex, flat);
        if (fuzz != -1)
          printf("Trying to set axis %d fuzz to: %d\n", axisindex, fuzz);
      }
      setDeadzoneAndFuzz(evdevice, axisindex, flat, fuzz);
    }
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0xffffffff,-0x20(%rbp)
movl   $0xffffffff,-0x24(%rbp)
movl   $0xffffffff,-0x28(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    11eb <main+0x4b>
mov    $0x0,%al
call   10a0 <help@plt>
xor    %edi,%edi
call   10c0 <exit@plt>
jmp    11f0 <main+0x50>
movl   $0x0,-0x2c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe2a(%rip),%rdx
lea    0x2e74(%rip),%rcx
lea    -0x2c(%rbp),%r8
call   1050 <getopt_long@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    1227 <main+0x87>
jmp    1425 <main+0x285>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x30(%rbp)
test   %eax,%eax
je     12c2 <main+0x122>
jmp    123a <main+0x9a>
mov    -0x30(%rbp),%eax
sub    $0x3f,%eax
je     1414 <main+0x274>
jmp    124b <main+0xab>
mov    -0x30(%rbp),%eax
sub    $0x61,%eax
je     13ec <main+0x24c>
jmp    125c <main+0xbc>
mov    -0x30(%rbp),%eax
sub    $0x64,%eax
je     139c <main+0x1fc>
jmp    126d <main+0xcd>
mov    -0x30(%rbp),%eax
sub    $0x65,%eax
je     1377 <main+0x1d7>
jmp    127e <main+0xde>
mov    -0x30(%rbp),%eax
sub    $0x66,%eax
je     13c4 <main+0x224>
jmp    128f <main+0xef>
mov    -0x30(%rbp),%eax
sub    $0x68,%eax
je     1343 <main+0x1a3>
jmp    12a0 <main+0x100>
mov    -0x30(%rbp),%eax
sub    $0x6c,%eax
je     134f <main+0x1af>
jmp    12b1 <main+0x111>
mov    -0x30(%rbp),%eax
sub    $0x73,%eax
je     135b <main+0x1bb>
jmp    1419 <main+0x279>
movslq -0x2c(%rbp),%rcx
lea    0x2db3(%rip),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
cmpl   $0x0,0x18(%rax)
je     12e3 <main+0x143>
jmp    1420 <main+0x280>
movslq -0x2c(%rbp),%rcx
lea    0x2d92(%rip),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
mov    0x10(%rax),%rsi
lea    0xd3e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2cea(%rip),%rax
cmpq   $0x0,(%rax)
je     1330 <main+0x190>
mov    0x2cd9(%rip),%rax
mov    (%rax),%rsi
lea    0xd1f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd4c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1420 <main+0x280>
mov    $0x0,%al
call   10a0 <help@plt>
jmp    1420 <main+0x280>
mov    $0x0,%al
call   1090 <listDevices@plt>
jmp    1420 <main+0x280>
mov    0x2c96(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1080 <showCalibration@plt>
jmp    1420 <main+0x280>
mov    0x2c7a(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xcc5(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1420 <main+0x280>
mov    0x2c55(%rip),%rax
mov    (%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xcb4(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1420 <main+0x280>
mov    0x2c2d(%rip),%rax
mov    (%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%esi
lea    0xca5(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1420 <main+0x280>
mov    0x2c05(%rip),%rax
mov    (%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%esi
lea    0xc91(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1420 <main+0x280>
jmp    1420 <main+0x280>
mov    $0x0,%al
call   1040 <abort@plt>
jmp    11f0 <main+0x50>
mov    0x2bb4(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jge    1496 <main+0x2f6>
lea    0xc78(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2b94(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jge    148c <main+0x2ec>
mov    -0x10(%rbp),%rax
mov    0x2b7e(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    0x2b70(%rip),%rdx
mov    %esi,(%rdx)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xc51(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1445 <main+0x2a5>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0xffffffff,-0x24(%rbp)
jne    14aa <main+0x30a>
cmpl   $0xffffffff,-0x28(%rbp)
je     156a <main+0x3ca>
cmpq   $0x0,-0x18(%rbp)
jne    14cd <main+0x32d>
lea    0xc19(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
cmpl   $0xffffffff,-0x20(%rbp)
jne    1512 <main+0x372>
cmpl   $0xffffffff,-0x24(%rbp)
je     14f2 <main+0x352>
mov    -0x24(%rbp),%esi
lea    0xc1f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
cmpl   $0xffffffff,-0x28(%rbp)
je     150d <main+0x36d>
mov    -0x28(%rbp),%esi
lea    0xc2c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1553 <main+0x3b3>
cmpl   $0xffffffff,-0x24(%rbp)
je     1530 <main+0x390>
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xc2d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
cmpl   $0xffffffff,-0x28(%rbp)
je     154e <main+0x3ae>
mov    -0x20(%rbp),%esi
mov    -0x28(%rbp),%edx
lea    0xc36(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1553 <main+0x3b3>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x28(%rbp),%ecx
call   1070 <setDeadzoneAndFuzz@plt>
jmp    156a <main+0x3ca>
xor    %edi,%edi
call   10c0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
cmp    $0x1,%edi
jne    11d1 <main+0x21>
xor    %eax,%eax
call   10b0 <help@plt>
xor    %edi,%edi
call   10d0 <exit@plt>
mov    %rsi,%rbp
mov    %edi,%ebx
movl   $0xffffffff,(%rsp)
lea    0xf1f(%rip),%r14
lea    0x2e95(%rip),%r15
lea    0xc(%rsp),%r12
lea    0xe09(%rip),%r13
xor    %eax,%eax
mov    %rax,0x10(%rsp)
movl   $0xffffffff,0x8(%rsp)
ff
movl   $0xffffffff,0x4(%rsp)
ff
jmp    1233 <main+0x83>
mov    0x2de1(%rip),%rax
mov    (%rax),%rdi
call   10c0 <atoi@plt>
lea    0xf1a(%rip),%rdi
mov    %eax,0x8(%rsp)
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
movl   $0x0,0xc(%rsp)
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
mov    %r12,%r8
call   1060 <getopt_long@plt>
lea    -0x3f(%rax),%ecx
cmp    $0x34,%ecx
ja     127b <main+0xcb>
movslq 0x0(%r13,%rcx,4),%rax
add    %r13,%rax
jmp    *%rax
mov    0x2d91(%rip),%rax
mov    (%rax),%rdi
call   10c0 <atoi@plt>
lea    0xef7(%rip),%rdi
mov    %eax,(%rsp)
jmp    122a <main+0x7a>
test   %eax,%eax
jne    1345 <main+0x195>
movslq 0xc(%rsp),%rax
lea    (%rax,%rax,4),%rax
cmpl   $0x0,0x18(%r15,%rax,8)
jne    1233 <main+0x83>
mov    0x10(%r15,%rax,8),%rsi
lea    0xe72(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x2d4a(%rip),%rax
mov    (%rax),%rsi
test   %rsi,%rsi
je     12c4 <main+0x114>
lea    0xe5f(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1233 <main+0x83>
mov    0x2d1e(%rip),%rax
mov    (%rax),%rsi
lea    0xe45(%rip),%rdi
mov    %rsi,0x10(%rsp)
xor    %eax,%eax
call   1070 <printf@plt>
jmp    1233 <main+0x83>
mov    0x2cfc(%rip),%rax
mov    (%rax),%rdi
call   10c0 <atoi@plt>
lea    0xe4e(%rip),%rdi
mov    %eax,0x4(%rsp)
jmp    122a <main+0x7a>
xor    %eax,%eax
call   10b0 <help@plt>
jmp    1233 <main+0x83>
xor    %eax,%eax
call   10a0 <listDevices@plt>
jmp    1233 <main+0x83>
mov    0x2cc5(%rip),%rax
mov    (%rax),%rdi
mov    %rdi,0x10(%rsp)
call   1090 <showCalibration@plt>
jmp    1233 <main+0x83>
cmp    $0xffffffff,%eax
jne    13c3 <main+0x213>
mov    0x2c8f(%rip),%r15
cmp    %ebx,(%r15)
jge    13a8 <main+0x1f8>
lea    0xe2d(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    (%r15),%eax
cmp    %ebx,%eax
jge    139e <main+0x1ee>
lea    0xe33(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x1(%rax),%ecx
mov    %ecx,(%r15)
cltq
mov    0x0(%rbp,%rax,8),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    (%r15),%eax
cmp    %ebx,%eax
jl     1380 <main+0x1d0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%ebx
cmp    $0xffffffff,%ebx
mov    0x4(%rsp),%r15d
jne    13ca <main+0x21a>
cmp    $0xffffffff,%r15d
jne    13ca <main+0x21a>
xor    %edi,%edi
call   10d0 <exit@plt>
xor    %eax,%eax
call   1040 <abort@plt>
mov    0x10(%rsp),%rbp
test   %rbp,%rbp
jne    13ea <main+0x23a>
lea    0xe64(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    (%rsp),%r14d
cmp    $0xffffffff,%r14d
jne    1422 <main+0x272>
cmp    $0xffffffff,%ebx
je     1409 <main+0x259>
lea    0xda9(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1070 <printf@plt>
cmp    $0xffffffff,%r15d
je     1454 <main+0x2a4>
lea    0xdbb(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    1454 <main+0x2a4>
cmp    $0xffffffff,%ebx
je     143a <main+0x28a>
lea    0xdc7(%rip),%rdi
mov    %r14d,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1070 <printf@plt>
cmp    $0xffffffff,%r15d
je     1454 <main+0x2a4>
lea    0xdd5(%rip),%rdi
mov    %r14d,%esi
mov    %r15d,%edx
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %ebx,%edx
mov    %r15d,%ecx
call   1080 <setDeadzoneAndFuzz@plt>
xor    %edi,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
%struct.option = type { i8*, i8, i8*, i32, i32, i32 }
@main.long_options = internal global [8 x %struct.option] [%struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8 -127, i8* null, i32 104, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i8 -127, i8* null, i32 108, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i32 0, i32 0), i8 -128, i8* null, i32 115, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i8 -128, i8* null, i32 101, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i32 0, i32 0), i8 -128, i8* null, i32 100, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i32 0, i32 0), i8 -128, i8* null, i32 102, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i32 0, i32 0), i8 -128, i8* null, i32 97, i32 0, i32 0 }, %struct.option zeroinitializer]
@.str = [5 x i8] c"help\00"
@.str.1 = [9 x i8] c"listdevs\00"
@.str.2 = [8 x i8] c"showcal\00"
@.str.3 = [6 x i8] c"evdev\00"
@.str.4 = [9 x i8] c"deadzone\00"
@.str.5 = [5 x i8] c"fuzz\00"
@.str.6 = [5 x i8] c"axis\00"
@.str.7 = [15 x i8] c"h:l:s:e:d:f:a:\00"
@.str.8 = [10 x i8] c"option %s\00"
@optarg = global i8* null
@.str.9 = [13 x i8] c" with arg %s\00"
@.str.10 = [2 x i8] c"\0A\00"
@.str.11 = [23 x i8] c"Event device file: %s\0A\00"
@.str.12 = [25 x i8] c"New dead zone value: %d\0A\00"
@.str.13 = [20 x i8] c"New fuzz value: %d\0A\00"
@.str.14 = [29 x i8] c"Axis index to deal with: %d\0A\00"
@optind = global i32 0
@.str.15 = [27 x i8] c"non-option ARGV-elements: \00"
@.str.16 = [4 x i8] c"%s \00"
@.str.17 = [53 x i8] c"You must specify the event device for your joystick\0A\00"
@.str.18 = [40 x i8] c"Trying to set all axes deadzone to: %d\0A\00"
@.str.19 = [36 x i8] c"Trying to set all axes fuzz to: %d\0A\00"
@.str.20 = [39 x i8] c"Trying to set axis %d deadzone to: %d\0A\00"
@.str.21 = [35 x i8] c"Trying to set axis %d fuzz to: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
store i32 -1, i32* %8
store i32 -1, i32* %9
store i32 -1, i32* %10
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = call i32 (...) @help()
%16 = call i32 @exit(i32 0)
unreachable
17: ; preds = %2
br label %18
18: ; preds = %17, %79
store i32 0, i32* %11
%19 = load i32, i32* %4
%20 = load i8**, i8*** %5
%21 = call i32 @getopt_long(i32 %19, i8** %20, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), %struct.option* getelementptr inbounds ([8 x %struct.option], [8 x %struct.option]* @main.long_options, i64 0, i64 0), i32* %11)
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = icmp eq i32 %22, -1
br i1 %23, label %24, label %25
24: ; preds = %18
br label %80
25: ; preds = %18
%26 = load i32, i32* %7
switch i32 %26, label %77 [
i32 0, label %27
i32 104, label %49
i32 108, label %51
i32 115, label %53
i32 101, label %57
i32 100, label %61
i32 102, label %66
i32 97, label %71
i32 63, label %76
]
27: ; preds = %25
%28 = load i32, i32* %11
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [8 x %struct.option], [8 x %struct.option]* @main.long_options, i64 0, i64 %29
%31 = getelementptr inbounds %struct.option, %struct.option* %30, i32 0, i32 3
%32 = load i32, i32* %31
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %35
34: ; preds = %27
br label %79
35: ; preds = %27
%36 = load i32, i32* %11
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [8 x %struct.option], [8 x %struct.option]* @main.long_options, i64 0, i64 %37
%39 = getelementptr inbounds %struct.option, %struct.option* %38, i32 0, i32 2
%40 = load i8*, i8** %39
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8* %40)
%42 = load i8*, i8** @optarg
%43 = icmp ne i8* %42, null
br i1 %43, label %44, label %47
44: ; preds = %35
%45 = load i8*, i8** @optarg
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* %45)
br label %47
47: ; preds = %44, %35
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
br label %79
49: ; preds = %25
%50 = call i32 (...) @help()
br label %79
51: ; preds = %25
%52 = call i32 (...) @listDevices()
br label %79
53: ; preds = %25
%54 = load i8*, i8** @optarg
store i8* %54, i8** %6
%55 = load i8*, i8** %6
%56 = call i32 @showCalibration(i8* %55)
br label %79
57: ; preds = %25
%58 = load i8*, i8** @optarg
store i8* %58, i8** %6
%59 = load i8*, i8** %6
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.11, i64 0, i64 0), i8* %59)
br label %79
61: ; preds = %25
%62 = load i8*, i8** @optarg
%63 = call i32 @atoi(i8* %62)
store i32 %63, i32* %9
%64 = load i32, i32* %9
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.12, i64 0, i64 0), i32 %64)
br label %79
66: ; preds = %25
%67 = load i8*, i8** @optarg
%68 = call i32 @atoi(i8* %67)
store i32 %68, i32* %10
%69 = load i32, i32* %10
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.13, i64 0, i64 0), i32 %69)
br label %79
71: ; preds = %25
%72 = load i8*, i8** @optarg
%73 = call i32 @atoi(i8* %72)
store i32 %73, i32* %8
%74 = load i32, i32* %8
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.14, i64 0, i64 0), i32 %74)
br label %79
76: ; preds = %25
br label %79
77: ; preds = %25
%78 = call i32 (...) @abort()
unreachable
79: ; preds = %76, %71, %66, %61, %57, %53, %51, %49, %47, %34
br label %18
80: ; preds = %24
%81 = load i32, i32* @optind
%82 = load i32, i32* %4
%83 = icmp slt i32 %81, %82
br i1 %83, label %84, label %100
84: ; preds = %80
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.15, i64 0, i64 0))
br label %86
86: ; preds = %90, %84
%87 = load i32, i32* @optind
%88 = load i32, i32* %4
%89 = icmp slt i32 %87, %88
br i1 %89, label %90, label %98
90: ; preds = %86
%91 = load i8**, i8*** %5
%92 = load i32, i32* @optind
%93 = add nsw i32 %92, 1
store i32 %93, i32* @optind
%94 = sext i32 %92 to i64
%95 = getelementptr inbounds i8*, i8** %91, i64 %94
%96 = load i8*, i8** %95
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i8* %96)
br label %86
98: ; preds = %86
%99 = call i32 @putchar(i8 signext 10)
br label %100
100: ; preds = %98, %80
%101 = load i32, i32* %9
%102 = icmp ne i32 %101, -1
br i1 %102, label %106, label %103
103: ; preds = %100
%104 = load i32, i32* %10
%105 = icmp ne i32 %104, -1
br i1 %105, label %106, label %150
106: ; preds = %103, %100
%107 = load i8*, i8** %6
%108 = icmp eq i8* %107, null
br i1 %108, label %109, label %112
109: ; preds = %106
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.17, i64 0, i64 0))
%111 = call i32 @exit(i32 1)
unreachable
112: ; preds = %106
%113 = load i32, i32* %8
%114 = icmp eq i32 %113, -1
br i1 %114, label %115, label %128
115: ; preds = %112
%116 = load i32, i32* %9
%117 = icmp ne i32 %116, -1
br i1 %117, label %118, label %121
118: ; preds = %115
%119 = load i32, i32* %9
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.18, i64 0, i64 0), i32 %119)
br label %121
121: ; preds = %118, %115
%122 = load i32, i32* %10
%123 = icmp ne i32 %122, -1
br i1 %123, label %124, label %127
124: ; preds = %121
%125 = load i32, i32* %10
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.19, i64 0, i64 0), i32 %125)
br label %127
127: ; preds = %124, %121
br label %143
128: ; preds = %112
%129 = load i32, i32* %9
%130 = icmp ne i32 %129, -1
br i1 %130, label %131, label %135
131: ; preds = %128
%132 = load i32, i32* %8
%133 = load i32, i32* %9
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.20, i64 0, i64 0), i32 %132, i32 %133)
br label %135
135: ; preds = %131, %128
%136 = load i32, i32* %10
%137 = icmp ne i32 %136, -1
br i1 %137, label %138, label %142
138: ; preds = %135
%139 = load i32, i32* %8
%140 = load i32, i32* %10
%141 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.21, i64 0, i64 0), i32 %139, i32 %140)
br label %142
142: ; preds = %138, %135
br label %143
143: ; preds = %142, %127
%144 = load i8*, i8** %6
%145 = load i32, i32* %8
%146 = load i32, i32* %9
%147 = load i32, i32* %10
%148 = call i32 @setDeadzoneAndFuzz(i8* %144, i32 %145, i32 %146, i32 %147)
br label %149
149: ; preds = %143
br label %150
150: ; preds = %149, %103
%151 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.option = type { i8*, i8, i8*, i32, i32, i32 }
@main.long_options = internal global [8 x %struct.option] [%struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8 -127, i8* null, i32 104, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i8 -127, i8* null, i32 108, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i32 0, i32 0), i8 -128, i8* null, i32 115, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i8 -128, i8* null, i32 101, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i32 0, i32 0), i8 -128, i8* null, i32 100, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i32 0, i32 0), i8 -128, i8* null, i32 102, i32 0, i32 0 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i32 0, i32 0), i8 -128, i8* null, i32 97, i32 0, i32 0 }, %struct.option zeroinitializer]
@.str = [5 x i8] c"help\00"
@.str.1 = [9 x i8] c"listdevs\00"
@.str.2 = [8 x i8] c"showcal\00"
@.str.3 = [6 x i8] c"evdev\00"
@.str.4 = [9 x i8] c"deadzone\00"
@.str.5 = [5 x i8] c"fuzz\00"
@.str.6 = [5 x i8] c"axis\00"
@.str.7 = [15 x i8] c"h:l:s:e:d:f:a:\00"
@.str.8 = [10 x i8] c"option %s\00"
@optarg = global i8* null
@.str.9 = [13 x i8] c" with arg %s\00"
@.str.11 = [23 x i8] c"Event device file: %s\0A\00"
@.str.12 = [25 x i8] c"New dead zone value: %d\0A\00"
@.str.13 = [20 x i8] c"New fuzz value: %d\0A\00"
@.str.14 = [29 x i8] c"Axis index to deal with: %d\0A\00"
@optind = global i32 0
@.str.15 = [27 x i8] c"non-option ARGV-elements: \00"
@.str.16 = [4 x i8] c"%s \00"
@.str.18 = [40 x i8] c"Trying to set all axes deadzone to: %d\0A\00"
@.str.19 = [36 x i8] c"Trying to set all axes fuzz to: %d\0A\00"
@.str.20 = [39 x i8] c"Trying to set axis %d deadzone to: %d\0A\00"
@.str.21 = [35 x i8] c"Trying to set axis %d fuzz to: %d\0A\00"
@str = [52 x i8] c"You must specify the event device for your joystick\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = icmp eq i32 %0, 1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = bitcast i32* %3 to i8*
br label %10
7: ; preds = %2
%8 = tail call i32 (...) @help()
%9 = tail call i32 @exit(i32 0)
unreachable
10: ; preds = %5, %56
%11 = phi i8* [ %57, %56 ], [ null, %5 ]
%12 = phi i32 [ %58, %56 ], [ -1, %5 ]
%13 = phi i32 [ %59, %56 ], [ -1, %5 ]
%14 = phi i32 [ %60, %56 ], [ -1, %5 ]
store i32 0, i32* %3
%15 = call i32 @getopt_long(i32 %0, i8** %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), %struct.option* getelementptr inbounds ([8 x %struct.option], [8 x %struct.option]* @main.long_options, i64 0, i64 0), i32* %3)
switch i32 %15, label %54 [
i32 -1, label %61
i32 0, label %16
i32 104, label %32
i32 108, label %34
i32 115, label %36
i32 101, label %39
i32 100, label %42
i32 102, label %46
i32 97, label %50
i32 63, label %56
]
16: ; preds = %10
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [8 x %struct.option], [8 x %struct.option]* @main.long_options, i64 0, i64 %18, i32 3
%20 = load i32, i32* %19
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %56
22: ; preds = %16
%23 = getelementptr inbounds [8 x %struct.option], [8 x %struct.option]* @main.long_options, i64 0, i64 %18, i32 2
%24 = load i8*, i8** %23
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8* %24)
%26 = load i8*, i8** @optarg
%27 = icmp eq i8* %26, null
br i1 %27, label %30, label %28
28: ; preds = %22
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* %26)
br label %30
30: ; preds = %28, %22
%31 = call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 10)
br label %56
32: ; preds = %10
%33 = call i32 (...) @help()
br label %56
34: ; preds = %10
%35 = call i32 (...) @listDevices()
br label %56
36: ; preds = %10
%37 = load i8*, i8** @optarg
%38 = call i32 @showCalibration(i8* %37)
br label %56
39: ; preds = %10
%40 = load i8*, i8** @optarg
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.11, i64 0, i64 0), i8* %40)
br label %56
42: ; preds = %10
%43 = load i8*, i8** @optarg
%44 = call i32 @atoi(i8* %43)
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.12, i64 0, i64 0), i32 %44)
br label %56
46: ; preds = %10
%47 = load i8*, i8** @optarg
%48 = call i32 @atoi(i8* %47)
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.13, i64 0, i64 0), i32 %48)
br label %56
50: ; preds = %10
%51 = load i8*, i8** @optarg
%52 = call i32 @atoi(i8* %51)
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.14, i64 0, i64 0), i32 %52)
br label %56
54: ; preds = %10
%55 = call i32 (...) @abort()
unreachable
56: ; preds = %30, %32, %34, %36, %39, %42, %46, %50, %16, %10
%57 = phi i8* [ %11, %50 ], [ %11, %46 ], [ %11, %42 ], [ %40, %39 ], [ %37, %36 ], [ %11, %34 ], [ %11, %32 ], [ %11, %16 ], [ %11, %30 ], [ %11, %10 ]
%58 = phi i32 [ %52, %50 ], [ %12, %46 ], [ %12, %42 ], [ %12, %39 ], [ %12, %36 ], [ %12, %34 ], [ %12, %32 ], [ %12, %16 ], [ %12, %30 ], [ %12, %10 ]
%59 = phi i32 [ %13, %50 ], [ %13, %46 ], [ %44, %42 ], [ %13, %39 ], [ %13, %36 ], [ %13, %34 ], [ %13, %32 ], [ %13, %16 ], [ %13, %30 ], [ %13, %10 ]
%60 = phi i32 [ %14, %50 ], [ %48, %46 ], [ %14, %42 ], [ %14, %39 ], [ %14, %36 ], [ %14, %34 ], [ %14, %32 ], [ %14, %16 ], [ %14, %30 ], [ %14, %10 ]
br label %10
61: ; preds = %10
%62 = load i32, i32* @optind
%63 = icmp slt i32 %62, %0
br i1 %63, label %64, label %79
64: ; preds = %61
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.15, i64 0, i64 0))
%66 = load i32, i32* @optind
%67 = icmp slt i32 %66, %0
br i1 %67, label %68, label %77
68: ; preds = %64, %68
%69 = phi i32 [ %75, %68 ], [ %66, %64 ]
%70 = add nsw i32 %69, 1
store i32 %70, i32* @optind
%71 = sext i32 %69 to i64
%72 = getelementptr inbounds i8*, i8** %1, i64 %71
%73 = load i8*, i8** %72
%74 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i8* %73)
%75 = load i32, i32* @optind
%76 = icmp slt i32 %75, %0
br i1 %76, label %68, label %77
77: ; preds = %68, %64
%78 = call i32 @putchar(i8 signext 10)
br label %79
79: ; preds = %77, %61
%80 = icmp ne i32 %13, -1
%81 = icmp ne i32 %14, -1
%82 = select i1 %80, i1 true, i1 %81
br i1 %82, label %83, label %104
83: ; preds = %79
%84 = icmp eq i8* %11, null
br i1 %84, label %85, label %88
85: ; preds = %83
%86 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
%87 = call i32 @exit(i32 1)
unreachable
88: ; preds = %83
%89 = icmp eq i32 %12, -1
br i1 %89, label %90, label %96
90: ; preds = %88
br i1 %80, label %91, label %93
91: ; preds = %90
%92 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.18, i64 0, i64 0), i32 %13)
br label %93
93: ; preds = %91, %90
br i1 %81, label %94, label %102
94: ; preds = %93
%95 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.19, i64 0, i64 0), i32 %14)
br label %102
96: ; preds = %88
br i1 %80, label %97, label %99
97: ; preds = %96
%98 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.20, i64 0, i64 0), i32 %12, i32 %13)
br label %99
99: ; preds = %97, %96
br i1 %81, label %100, label %102
100: ; preds = %99
%101 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.21, i64 0, i64 0), i32 %12, i32 %14)
br label %102
102: ; preds = %99, %100, %93, %94
%103 = call i32 @setDeadzoneAndFuzz(i8* %11, i32 %12, i32 %13, i32 %14)
br label %104
104: ; preds = %79, %102
%105 = call i32 @exit(i32 0)
unreachable
}