#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, char *, int);
int /*<<< orphan*/ *stderr;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ usleep(int);
int main(int argc, char **argv) {
  FILE *fgpio;
  char gpio[] = "/sys/class/gpio/gpio00/value";
  char dir[] = "/sys/class/gpio/gpio00/direction";
  char wipi[] = "/usr/local/bin/gpio -g mode 00 up/down/tri 2>/dev/null";
  char wip2[] = "/usr/bin/gpio -g mode 00 up/down/tri 2>/dev/null";
  char s[8];
  int i;
  int port;
  int value;
  int trig = -1;
  int pseudoPUpDown = -1;
  int pin_ports[] = {-1, -1, 2,  -1, 3,  -1, 4,  14, -1, 15, 17, 18, 27, -1,
                     22, 23, -1, 24, 10, -1, 9,  25, 11, 8,  -1, 7,  -1, -1,
                     5,  -1, 6,  12, 13, -1, 19, 16, 26, 20, -1, 21};
  if (argc < 2 || argc > 4) {
    fprintf(stderr, "usage: %s port [value]\n", argv[0]);
    printf("9\n");
    return -1;
  }
  port = atoi(argv[1]);
  for (i = 0; i < 40; i++) {
    if (pin_ports[i] == port) {
      break;
    }
  }
  if (i == 40 || port < 0) {
    fprintf(stderr, "Unsupported Port Error, %d\n", port);
    printf("9\n");
    return -1;
  }
  gpio[20] = '\0';
  dir[20] = '\0';
  sprintf(gpio, "%s%d/value", gpio, port);
  sprintf(dir, "%s%d/direction", dir, port);
  fgpio = fopen(gpio, "r");
  if (fgpio == NULL) {
    fgpio = fopen("/sys/class/gpio/export", "w");
    if (fgpio == NULL) {
      fprintf(stderr, "IO Error\n");
      printf("9\n");
      return -1;
    }
    fprintf(fgpio, "%d\n", port);
    fclose(fgpio);
    for (i = 0; i < 3; i++) {
      fgpio = fopen(dir, "w");
      if (fgpio)
        break;
      usleep(50000);
    }
    if (i == 3) {
      fprintf(stderr, "IO Error %s\n", dir);
      printf("9\n");
      return -1;
    }
    fprintf(fgpio, "in\n");
    fclose(fgpio);
    fgpio = fopen(dir, "r");
    if (fgpio == NULL) {
      fprintf(stderr, "IO Error %s\n", gpio);
      printf("9\n");
      return -1;
    }
    fgets(s, 8, fgpio);
    if (strcmp(s, "in\n")) {
      fprintf(stderr, "IO Error (IO Mode = %s)\n", s);
      printf("9\n");
      fclose(fgpio);
      return -1;
    }
    fclose(fgpio);
  }
  fclose(fgpio);
  if (argc >= 3) {
    if (!strcmp(argv[2], "NC"))
      value = -1;
    else if (!strcmp(argv[2], "LOW"))
      value = 0;
    else if (!strcmp(argv[2], "HIGH"))
      value = 1;
    else if (!strcmp(argv[2], "PUP"))
      value = 2;
    else if (!strcmp(argv[2], "PDOWN"))
      value = 3;
    else
      value = atoi(argv[2]);
    switch (value) {
    case -1:
      fgpio = fopen("/sys/class/gpio/unexport", "w");
      if (fgpio) {
        fprintf(fgpio, "%d\n", port);
        fclose(fgpio);
        printf("-1\n");
        return 0;
      } else {
        fprintf(stderr, "IO Error\n");
        printf("9\n");
        return -1;
      }
      break;
    case 0:
    case 1:
      trig = value;
      break;
    case 2:
      wipi[28] = '\0';
      wip2[22] = '\0';
      sprintf(wip2, "%s %d up 2> /dev/null", wip2, port);
      sprintf(wipi, "%s %d up", wipi, port);
      if (system(wip2)) {
        if (system(wipi)) {
          fgpio = fopen(dir, "w");
          if (fgpio) {
            fprintf(fgpio, "high\n");
            fclose(fgpio);
            pseudoPUpDown = 1;
          } else {
            fprintf(stderr, "IO Error\n");
            printf("9\n");
            return -1;
          }
        }
      }
      if (argc == 4) {
        if (!strcmp(argv[3], "LOW"))
          trig = 0;
        else if (!strcmp(argv[3], "HIGH"))
          trig = 1;
        else
          trig = atoi(argv[3]);
        if (trig % 2 != trig)
          trig = -1;
      }
      break;
    case 3:
      wipi[28] = '\0';
      wip2[22] = '\0';
      sprintf(wip2, "%s %d down 2> /dev/null", wip2, port);
      sprintf(wipi, "%s %d down", wipi, port);
      if (system(wip2)) {
        if (system(wipi)) {
          fgpio = fopen(dir, "w");
          if (fgpio) {
            fprintf(fgpio, "low\n");
            fclose(fgpio);
            pseudoPUpDown = 0;
          } else {
            fprintf(stderr, "IO Error\n");
            printf("9\n");
            return -1;
          }
        }
      }
      if (argc == 4) {
        if (!strcmp(argv[3], "LOW"))
          trig = 0;
        else if (!strcmp(argv[3], "HIGH"))
          trig = 1;
        else
          trig = atoi(argv[3]);
        if (trig % 2 != trig)
          trig = -1;
      }
      break;
    default:
      fprintf(stderr, "Unsupported Value Error, %d\n", value);
      printf("9\n");
      return -1;
    }
  }
  if (pseudoPUpDown >= 0) {
    fprintf(stderr, "Pseudo Pull Up / Down mode (%d)\n", pseudoPUpDown);
    fprintf(stderr, "WiringPiをインストールしてください。\n");
    fprintf(stderr, "git clone git://git.drogon.net/wiringPi\n");
  }
  fgpio = fopen(gpio, "r");
  if (fgpio == NULL) {
    fprintf(stderr, "IO Error\n");
    printf("9\n");
    return -1;
  }
  fgets(s, 8, fgpio);
  value = atoi(s);
  fclose(fgpio);
  if (trig >= 0) {
    i = 0;
    if (pseudoPUpDown < 0) {
      while (value != trig) {
        fgpio = fopen(gpio, "r");
        fgets(s, 8, fgpio);
        value = atoi(s);
        i++;
        fclose(fgpio);
        usleep(100000);
      }
    } else {
      while (value != trig) {
        fgpio = fopen(dir, "w");
        if (pseudoPUpDown == 0)
          fprintf(fgpio, "low\n");
        else
          fprintf(fgpio, "high\n");
        fclose(fgpio);
        fgpio = fopen(gpio, "r");
        fgets(s, 8, fgpio);
        value = atoi(s);
        i++;
        fclose(fgpio);
        fgpio = fopen(dir, "w");
        fprintf(fgpio, "in\n");
        fclose(fgpio);
        usleep(100000);
      }
    }
    value = i;
  }
  for (i = 0; i < 3; i++) {
    fgpio = fopen(dir, "r");
    if (fgpio)
      break;
    usleep(50000);
  }
  if (i == 3) {
    fprintf(stderr, "IO Error %s\n", dir);
    printf("9\n");
    return -1;
  }
  fgets(s, 8, fgpio);
  if (strcmp(s, "in\n")) {
    for (i = 0; i < 3; i++) {
      fgpio = fopen(dir, "w");
      if (fgpio)
        break;
      usleep(50000);
    }
    if (i == 3) {
      fprintf(stderr, "IO Error %s\n", dir);
      printf("9\n");
      return -1;
    }
    if (fgpio) {
      fprintf(fgpio, "in\n");
      fclose(fgpio);
    }
  }
  printf("%d\n", value);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xef0(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xeed(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xeea(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xee8(%rip),%eax
mov    %eax,-0x28(%rbp)
mov    0xee3(%rip),%al
mov    %al,-0x24(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x21,%edx
call   1090 <memcpy@plt>
lea    -0xb0(%rbp),%rdi
lea    0xef1(%rip),%rsi
mov    $0x37,%edx
call   1090 <memcpy@plt>
lea    -0xf0(%rbp),%rdi
lea    0xf19(%rip),%rsi
mov    $0x31,%edx
call   1090 <memcpy@plt>
movl   $0xffffffff,-0x108(%rbp)
ff ff ff
movl   $0xffffffff,-0x10c(%rbp)
ff ff ff
lea    -0x1b0(%rbp),%rdi
lea    0xdbd(%rip),%rsi
mov    $0xa0,%edx
call   1090 <memcpy@plt>
cmpl   $0x2,-0x8(%rbp)
jl     1281 <main+0xd1>
cmpl   $0x4,-0x8(%rbp)
jle    12ba <main+0x10a>
mov    0x2d58(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xee8(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
lea    0xef2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1f79 <main+0xdc9>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x100(%rbp)
movl   $0x0,-0xfc(%rbp)
cmpl   $0x28,-0xfc(%rbp)
jge    131c <main+0x16c>
movslq -0xfc(%rbp),%rax
mov    -0x1b0(%rbp,%rax,4),%eax
cmp    -0x100(%rbp),%eax
jne    1303 <main+0x153>
jmp    131c <main+0x16c>
jmp    1308 <main+0x158>
mov    -0xfc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfc(%rbp)
jmp    12d7 <main+0x127>
cmpl   $0x28,-0xfc(%rbp)
je     1336 <main+0x186>
cmpl   $0x0,-0x100(%rbp)
jge    136e <main+0x1be>
mov    0x2ca3(%rip),%rax
mov    (%rax),%rdi
mov    -0x100(%rbp),%edx
lea    0xe4f(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1f79 <main+0xdc9>
movb   $0x0,-0x2c(%rbp)
movb   $0x0,-0x5c(%rbp)
lea    -0x40(%rbp),%rdi
lea    -0x40(%rbp),%rdx
mov    -0x100(%rbp),%ecx
lea    0xe2d(%rip),%rsi
call   10c0 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    -0x70(%rbp),%rdx
mov    -0x100(%rbp),%ecx
lea    0xe1e(%rip),%rsi
call   10c0 <sprintf@plt>
lea    -0x40(%rbp),%rdi
lea    0xe1d(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    15c7 <main+0x417>
lea    0xe04(%rip),%rdi
lea    0xe14(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    141d <main+0x26d>
mov    0x2bee(%rip),%rax
mov    (%rax),%rdi
lea    0xdf1(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
lea    0xd8f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1f79 <main+0xdc9>
mov    -0x18(%rbp),%rdi
mov    -0x100(%rbp),%edx
lea    0xe8c(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0xfc(%rbp)
cmpl   $0x3,-0xfc(%rbp)
jge    1497 <main+0x2e7>
lea    -0x70(%rbp),%rdi
lea    0xd8b(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1479 <main+0x2c9>
jmp    1497 <main+0x2e7>
mov    $0xc350,%edi
call   10d0 <usleep@plt>
mov    -0xfc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfc(%rbp)
jmp    1448 <main+0x298>
cmpl   $0x3,-0xfc(%rbp)
jne    14da <main+0x32a>
mov    0x2b35(%rip),%rax
mov    (%rax),%rdi
lea    -0x70(%rbp),%rdx
lea    0xd3e(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
lea    0xcd2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1f79 <main+0xdc9>
mov    -0x18(%rbp),%rdi
lea    0xd1f(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
lea    -0x70(%rbp),%rdi
lea    0xcd2(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    154a <main+0x39a>
mov    0x2ac5(%rip),%rax
mov    (%rax),%rdi
lea    -0x40(%rbp),%rdx
lea    0xcce(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
lea    0xc62(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1f79 <main+0xdc9>
lea    -0xf8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x8,%esi
call   1060 <fgets@plt>
lea    -0xf8(%rbp),%rdi
lea    0xc97(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     15be <main+0x40e>
mov    0x2a5d(%rip),%rax
mov    (%rax),%rdi
lea    -0xf8(%rbp),%rdx
lea    0xc74(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
lea    0xbf7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1f79 <main+0xdc9>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
cmpl   $0x3,-0x8(%rbp)
jl     1b3f <main+0x98f>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xc38(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1607 <main+0x457>
movl   $0xffffffff,-0x104(%rbp)
ff ff ff
jmp    16e2 <main+0x532>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xc0e(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1634 <main+0x484>
movl   $0x0,-0x104(%rbp)
jmp    16dd <main+0x52d>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xbe5(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1661 <main+0x4b1>
movl   $0x1,-0x104(%rbp)
jmp    16d8 <main+0x528>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xbbd(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    168e <main+0x4de>
movl   $0x2,-0x104(%rbp)
jmp    16d3 <main+0x523>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xb94(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    16bb <main+0x50b>
movl   $0x3,-0x104(%rbp)
jmp    16ce <main+0x51e>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x104(%rbp)
jmp    16d3 <main+0x523>
jmp    16d8 <main+0x528>
jmp    16dd <main+0x52d>
jmp    16e2 <main+0x532>
mov    -0x104(%rbp),%eax
add    $0x1,%eax
mov    %eax,%ecx
mov    %rcx,-0x1b8(%rbp)
sub    $0x4,%eax
ja     1b02 <main+0x952>
mov    -0x1b8(%rbp),%rax
lea    0x8f5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xb1c(%rip),%rdi
lea    0xac9(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1771 <main+0x5c1>
mov    -0x18(%rbp),%rdi
mov    -0x100(%rbp),%edx
lea    0xb73(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
lea    0xaf2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1f79 <main+0xdc9>
mov    0x2868(%rip),%rax
mov    (%rax),%rdi
lea    0xa6b(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
lea    0xa09(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1f79 <main+0xdc9>
mov    -0x104(%rbp),%eax
mov    %eax,-0x108(%rbp)
jmp    1b3a <main+0x98a>
movb   $0x0,-0x94(%rbp)
movb   $0x0,-0xda(%rbp)
lea    -0xf0(%rbp),%rdi
lea    -0xf0(%rbp),%rdx
mov    -0x100(%rbp),%ecx
lea    0xa77(%rip),%rsi
call   10c0 <sprintf@plt>
lea    -0xb0(%rbp),%rdi
lea    -0xb0(%rbp),%rdx
mov    -0x100(%rbp),%ecx
lea    0xa6d(%rip),%rsi
call   10c0 <sprintf@plt>
lea    -0xf0(%rbp),%rdi
call   1040 <system@plt>
cmp    $0x0,%eax
je     18b1 <main+0x701>
lea    -0xb0(%rbp),%rdi
call   1040 <system@plt>
cmp    $0x0,%eax
je     18ac <main+0x6fc>
lea    -0x70(%rbp),%rdi
lea    0x9b4(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1875 <main+0x6c5>
mov    -0x18(%rbp),%rdi
lea    0xa1d(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x10c(%rbp)
jmp    18a7 <main+0x6f7>
mov    0x2764(%rip),%rax
mov    (%rax),%rdi
lea    0x967(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
lea    0x905(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1f79 <main+0xdc9>
jmp    18ac <main+0x6fc>
jmp    18b1 <main+0x701>
cmpl   $0x4,-0x8(%rbp)
jne    1956 <main+0x7a6>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0x95a(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    18e8 <main+0x738>
movl   $0x0,-0x108(%rbp)
jmp    192d <main+0x77d>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0x931(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1915 <main+0x765>
movl   $0x1,-0x108(%rbp)
jmp    1928 <main+0x778>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x108(%rbp)
jmp    192d <main+0x77d>
mov    -0x108(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    -0x108(%rbp),%edx
je     1951 <main+0x7a1>
movl   $0xffffffff,-0x108(%rbp)
ff ff ff
jmp    1956 <main+0x7a6>
jmp    1b3a <main+0x98a>
movb   $0x0,-0x94(%rbp)
movb   $0x0,-0xda(%rbp)
lea    -0xf0(%rbp),%rdi
lea    -0xf0(%rbp),%rdx
mov    -0x100(%rbp),%ecx
lea    0x8f5(%rip),%rsi
call   10c0 <sprintf@plt>
lea    -0xb0(%rbp),%rdi
lea    -0xb0(%rbp),%rdx
mov    -0x100(%rbp),%ecx
lea    0x8ed(%rip),%rsi
call   10c0 <sprintf@plt>
lea    -0xf0(%rbp),%rdi
call   1040 <system@plt>
cmp    $0x0,%eax
je     1a58 <main+0x8a8>
lea    -0xb0(%rbp),%rdi
call   1040 <system@plt>
cmp    $0x0,%eax
je     1a53 <main+0x8a3>
lea    -0x70(%rbp),%rdi
lea    0x80d(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1a1c <main+0x86c>
mov    -0x18(%rbp),%rdi
lea    0x89f(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x10c(%rbp)
jmp    1a4e <main+0x89e>
mov    0x25bd(%rip),%rax
mov    (%rax),%rdi
lea    0x7c0(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
lea    0x75e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1f79 <main+0xdc9>
jmp    1a53 <main+0x8a3>
jmp    1a58 <main+0x8a8>
cmpl   $0x4,-0x8(%rbp)
jne    1afd <main+0x94d>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0x7b3(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1a8f <main+0x8df>
movl   $0x0,-0x108(%rbp)
jmp    1ad4 <main+0x924>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0x78a(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1abc <main+0x90c>
movl   $0x1,-0x108(%rbp)
jmp    1acf <main+0x91f>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x108(%rbp)
jmp    1ad4 <main+0x924>
mov    -0x108(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    -0x108(%rbp),%edx
je     1af8 <main+0x948>
movl   $0xffffffff,-0x108(%rbp)
ff ff ff
jmp    1afd <main+0x94d>
jmp    1b3a <main+0x98a>
mov    0x24d7(%rip),%rax
mov    (%rax),%rdi
mov    -0x104(%rbp),%edx
lea    0x788(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
lea    0x672(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1f79 <main+0xdc9>
jmp    1b3f <main+0x98f>
cmpl   $0x0,-0x10c(%rbp)
jl     1b9a <main+0x9ea>
mov    0x248d(%rip),%rax
mov    (%rax),%rdi
mov    -0x10c(%rbp),%edx
lea    0x75b(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x246f(%rip),%rax
mov    (%rax),%rdi
lea    0x764(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2457(%rip),%rax
mov    (%rax),%rdi
lea    0x780(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
lea    -0x40(%rbp),%rdi
lea    0x62d(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1beb <main+0xa3b>
mov    0x2420(%rip),%rax
mov    (%rax),%rdi
lea    0x623(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
lea    0x5c1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1f79 <main+0xdc9>
lea    -0xf8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x8,%esi
call   1060 <fgets@plt>
lea    -0xf8(%rbp),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x104(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
cmpl   $0x0,-0x108(%rbp)
jl     1dc9 <main+0xc19>
movl   $0x0,-0xfc(%rbp)
cmpl   $0x0,-0x10c(%rbp)
jge    1cbd <main+0xb0d>
jmp    1c44 <main+0xa94>
mov    -0x104(%rbp),%eax
cmp    -0x108(%rbp),%eax
je     1cb8 <main+0xb08>
lea    -0x40(%rbp),%rdi
lea    0x571(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
lea    -0xf8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x8,%esi
call   1060 <fgets@plt>
lea    -0xf8(%rbp),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x104(%rbp)
mov    -0xfc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfc(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    $0x186a0,%edi
call   10d0 <usleep@plt>
jmp    1c44 <main+0xa94>
jmp    1dbd <main+0xc0d>
jmp    1cc2 <main+0xb12>
mov    -0x104(%rbp),%eax
cmp    -0x108(%rbp),%eax
je     1db8 <main+0xc08>
lea    -0x70(%rbp),%rdi
lea    0x50c(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0x10c(%rbp)
jne    1d0c <main+0xb5c>
mov    -0x18(%rbp),%rdi
lea    0x59c(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    1d1e <main+0xb6e>
mov    -0x18(%rbp),%rdi
lea    0x55c(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
lea    -0x40(%rbp),%rdi
lea    0x4a0(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
lea    -0xf8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x8,%esi
call   1060 <fgets@plt>
lea    -0xf8(%rbp),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x104(%rbp)
mov    -0xfc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfc(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
lea    -0x70(%rbp),%rdi
lea    0x466(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0x46b(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    $0x186a0,%edi
call   10d0 <usleep@plt>
jmp    1cc2 <main+0xb12>
jmp    1dbd <main+0xc0d>
mov    -0xfc(%rbp),%eax
mov    %eax,-0x104(%rbp)
movl   $0x0,-0xfc(%rbp)
cmpl   $0x3,-0xfc(%rbp)
jge    1e22 <main+0xc72>
lea    -0x70(%rbp),%rdi
lea    0x3e7(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1e04 <main+0xc54>
jmp    1e22 <main+0xc72>
mov    $0xc350,%edi
call   10d0 <usleep@plt>
mov    -0xfc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfc(%rbp)
jmp    1dd3 <main+0xc23>
cmpl   $0x3,-0xfc(%rbp)
jne    1e65 <main+0xcb5>
mov    0x21aa(%rip),%rax
mov    (%rax),%rdi
lea    -0x70(%rbp),%rdx
lea    0x3b3(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
lea    0x347(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1f79 <main+0xdc9>
lea    -0xf8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x8,%esi
call   1060 <fgets@plt>
lea    -0xf8(%rbp),%rdi
lea    0x37c(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     1f5e <main+0xdae>
movl   $0x0,-0xfc(%rbp)
cmpl   $0x3,-0xfc(%rbp)
jge    1ef0 <main+0xd40>
lea    -0x70(%rbp),%rdi
lea    0x332(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1ed2 <main+0xd22>
jmp    1ef0 <main+0xd40>
mov    $0xc350,%edi
call   10d0 <usleep@plt>
mov    -0xfc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfc(%rbp)
jmp    1ea1 <main+0xcf1>
cmpl   $0x3,-0xfc(%rbp)
jne    1f33 <main+0xd83>
mov    0x20dc(%rip),%rax
mov    (%rax),%rdi
lea    -0x70(%rbp),%rdx
lea    0x2e5(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
lea    0x279(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1f79 <main+0xdc9>
cmpq   $0x0,-0x18(%rbp)
je     1f59 <main+0xda9>
mov    -0x18(%rbp),%rdi
lea    0x2bb(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
jmp    1f5e <main+0xdae>
mov    -0x104(%rbp),%esi
lea    0x34f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1c0,%rsp
pop    %rbp
ret

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,%r12d
movups 0xeef(%rip),%xmm0
movups %xmm0,0x4d(%rsp)
movaps 0xed6(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xefa(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xede(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movb   $0x0,0x30(%rsp)
movaps 0xf1d(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xefe(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xee2(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movabs $0x6c6c756e2f7665,%rax
mov    %rax,0x8f(%rsp)
movaps 0xf24(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0xee6(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movb   $0x0,0xd0(%rsp)
lea    -0x5(%r12),%eax
cmp    $0xfffffffc,%eax
ja     12a4 <main+0xe4>
mov    0x2d55(%rip),%rax
mov    (%rax),%rdi
mov    (%r14),%rdx
lea    0xee9(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
jmp    1af1 <main+0x931>
mov    0x8(%r14),%rdi
call   10b0 <atoi@plt>
mov    %eax,%ebp
mov    $0x4,%eax
lea    0xd65(%rip),%rcx
nopl   0x0(%rax,%rax,1)
cmp    %ebp,-0x10(%rcx,%rax,4)
je     12f0 <main+0x130>
cmp    %ebp,-0xc(%rcx,%rax,4)
je     12fe <main+0x13e>
cmp    %ebp,-0x8(%rcx,%rax,4)
je     130c <main+0x14c>
cmp    %ebp,-0x4(%rcx,%rax,4)
je     1481 <main+0x2c1>
cmp    %ebp,(%rcx,%rax,4)
je     1310 <main+0x150>
add    $0x5,%rax
cmp    $0x2c,%rax
jne    12c0 <main+0x100>
jmp    148e <main+0x2ce>
add    $0xfffffffffffffffc,%rax
cmp    $0x28,%eax
jne    1319 <main+0x159>
jmp    148e <main+0x2ce>
add    $0xfffffffffffffffd,%rax
cmp    $0x28,%eax
jne    1319 <main+0x159>
jmp    148e <main+0x2ce>
add    $0xfffffffffffffffe,%rax
cmp    $0x28,%eax
je     148e <main+0x2ce>
test   %ebp,%ebp
js     148e <main+0x2ce>
movb   $0x0,0x54(%rsp)
movb   $0x0,0x24(%rsp)
lea    0xe83(%rip),%rsi
lea    0x40(%rsp),%rbx
mov    %rbx,%rdi
mov    %rbx,%rdx
mov    %ebp,%ecx
call   10c0 <sprintf@plt>
lea    0xe75(%rip),%rsi
lea    0x10(%rsp),%rdi
mov    %rdi,%rdx
mov    %ebp,%ecx
call   10c0 <sprintf@plt>
lea    0xe6e(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
je     14ad <main+0x2ed>
mov    %rbx,%rdi
call   1040 <fclose@plt>
movl   $0xffffffff,0x4(%rsp)
ff
cmp    $0x3,%r12d
jl     15eb <main+0x42b>
mov    0x10(%r14),%rdi
lea    0xe84(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1434 <main+0x274>
mov    0x10(%r14),%rdi
lea    0xe6e(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1770 <main+0x5b0>
mov    0x10(%r14),%rdi
lea    0xe59(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1904 <main+0x744>
mov    0x10(%r14),%rdi
lea    0xe45(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1934 <main+0x774>
mov    0x10(%r14),%rdi
lea    0xe30(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     19ed <main+0x82d>
mov    0x10(%r14),%rdi
call   10b0 <atoi@plt>
mov    %eax,%r15d
add    $0x1,%eax
cmp    $0x4,%eax
ja     1b8e <main+0x9ce>
lea    0xbd5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xdf9(%rip),%rdi
lea    0xda6(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1ad1 <main+0x911>
mov    %rax,%r14
lea    0xe59(%rip),%rsi
xor    %ebx,%ebx
mov    %rax,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
jmp    1b02 <main+0x942>
add    $0xffffffffffffffff,%rax
cmp    $0x28,%eax
jne    1319 <main+0x159>
mov    0x2b4b(%rip),%rax
mov    (%rax),%rdi
lea    0xcfa(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1090 <fprintf@plt>
jmp    1af1 <main+0x931>
lea    0xd1d(%rip),%rdi
lea    0xd2d(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1ad1 <main+0x911>
mov    %rax,%rbx
lea    0xde0(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
lea    0xcfa(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10a0 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    154a <main+0x38a>
mov    $0xc350,%edi
call   10e0 <usleep@plt>
lea    0xcd7(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10a0 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    154a <main+0x38a>
mov    $0xc350,%edi
call   10e0 <usleep@plt>
lea    0xcb4(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10a0 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
je     190f <main+0x74f>
lea    0xcb0(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
lea    0xc5d(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1755 <main+0x595>
mov    %rax,%rbx
lea    0x8(%rsp),%r15
mov    %r15,%rdi
mov    $0x8,%esi
mov    %rax,%rdx
call   1070 <fgets@plt>
lea    0xc5d(%rip),%rsi
mov    %r15,%rdi
call   1080 <strcmp@plt>
test   %rax,%rax
je     18f7 <main+0x737>
mov    0x2a24(%rip),%rax
mov    (%rax),%rdi
lea    0xc3f(%rip),%rsi
lea    0x8(%rsp),%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
lea    0xd5f(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
jmp    1afd <main+0x93d>
mov    $0xffffffff,%r15d
lea    0xbd7(%rip),%rsi
lea    0x40(%rsp),%rdi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1ad1 <main+0x911>
mov    %rax,%rbx
lea    0x8(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x8,%esi
mov    %rax,%rdx
call   1070 <fgets@plt>
mov    %rbp,%rdi
call   10b0 <atoi@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <fclose@plt>
test   %r15d,%r15d
js     174d <main+0x58d>
cmpl   $0x0,0x4(%rsp)
js     1778 <main+0x5b8>
xor    %r12d,%r12d
cmp    %r15d,%ebp
je     17d8 <main+0x618>
xor    %r12d,%r12d
lea    0xb89(%rip),%rbp
lea    0x10(%rsp),%rdi
mov    %r15d,0x3c(%rsp)
jmp    171b <main+0x55b>
xchg   %ax,%ax
mov    $0x5,%esi
mov    $0x1,%edx
lea    0xbeb(%rip),%rdi
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
lea    0x40(%rsp),%rdi
lea    0xb32(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%rbx
lea    0x8(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x8,%esi
mov    %rax,%rdx
call   1070 <fgets@plt>
mov    %rbp,%rdi
call   10b0 <atoi@plt>
mov    %eax,%r15d
add    $0x1,%r12d
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %r13,%rdi
mov    %r14,%rsi
call   10a0 <fopen@plt>
mov    %rax,%rbx
mov    $0x3,%esi
mov    $0x1,%edx
lea    0xb11(%rip),%rdi
mov    %rax,%rcx
call   10d0 <fwrite@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    $0x186a0,%edi
call   10e0 <usleep@plt>
mov    %r13,%rdi
mov    %r14,%rbp
cmp    0x3c(%rsp),%r15d
je     17d8 <main+0x618>
mov    %rdi,%r13
mov    %rbp,%r14
mov    %rbp,%rsi
call   10a0 <fopen@plt>
mov    %rax,%rbx
cmpl   $0x0,0x4(%rsp)
jne    1670 <main+0x4b0>
mov    $0x4,%esi
mov    $0x1,%edx
lea    0xb4d(%rip),%rdi
jmp    1681 <main+0x4c1>
mov    %ebp,%r12d
jmp    17d8 <main+0x618>
mov    0x2884(%rip),%rax
mov    (%rax),%rdi
lea    0xa8e(%rip),%rsi
lea    0x40(%rsp),%rdx
jmp    1298 <main+0xd8>
xor    %r15d,%r15d
jmp    15f1 <main+0x431>
xor    %r12d,%r12d
cmp    %r15d,%ebp
je     17d8 <main+0x618>
xor    %r12d,%r12d
lea    0x40(%rsp),%r13
lea    0x8(%rsp),%rbx
nopl   (%rax)
mov    %r13,%rdi
lea    0xa35(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    $0x8,%esi
mov    %rax,%rdx
call   1070 <fgets@plt>
mov    %rbx,%rdi
call   10b0 <atoi@plt>
mov    %eax,%r14d
add    $0x1,%r12d
mov    %rbp,%rdi
call   1040 <fclose@plt>
mov    $0x186a0,%edi
call   10e0 <usleep@plt>
cmp    %r15d,%r14d
jne    1790 <main+0x5d0>
lea    0x9f0(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10a0 <fopen@plt>
test   %rax,%rax
jne    1832 <main+0x672>
mov    $0xc350,%edi
call   10e0 <usleep@plt>
lea    0x9d0(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10a0 <fopen@plt>
test   %rax,%rax
jne    1832 <main+0x672>
mov    $0xc350,%edi
call   10e0 <usleep@plt>
lea    0x9b0(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10a0 <fopen@plt>
test   %rax,%rax
je     190f <main+0x74f>
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
mov    %rax,%rdx
call   1070 <fgets@plt>
lea    0x9b3(%rip),%rsi
mov    %rbx,%rdi
call   1080 <strcmp@plt>
test   %rax,%rax
je     18df <main+0x71f>
lea    0x982(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10a0 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    18be <main+0x6fe>
mov    $0xc350,%edi
call   10e0 <usleep@plt>
lea    0x95f(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10a0 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    18be <main+0x6fe>
mov    $0xc350,%edi
call   10e0 <usleep@plt>
lea    0x93c(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10a0 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
je     190f <main+0x74f>
lea    0x93c(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
lea    0x9cd(%rip),%rdi
xor    %ebx,%ebx
mov    %r12d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    1b02 <main+0x942>
mov    %rbx,%rdi
call   1040 <fclose@plt>
jmp    1375 <main+0x1b5>
mov    $0x1,%r15d
jmp    15f1 <main+0x431>
mov    $0xc350,%edi
call   10e0 <usleep@plt>
mov    0x26c0(%rip),%rax
mov    (%rax),%rdi
lea    0x8ca(%rip),%rsi
lea    0x10(%rsp),%rdx
jmp    1298 <main+0xd8>
movb   $0x0,0x7c(%rsp)
movb   $0x0,0xb6(%rsp)
lea    0x905(%rip),%rsi
lea    0xa0(%rsp),%rbx
mov    %rbx,%rdi
mov    %rbx,%rdx
mov    %ebp,%ecx
call   10c0 <sprintf@plt>
lea    0x8ff(%rip),%rsi
lea    0x60(%rsp),%rdi
mov    %rdi,%rdx
mov    %ebp,%ecx
call   10c0 <sprintf@plt>
mov    %rbx,%rdi
call   1050 <system@plt>
mov    $0xffffffff,%r15d
mov    $0xffffffff,%ebp
test   %eax,%eax
je     1a92 <main+0x8d2>
lea    0x60(%rsp),%rdi
call   1050 <system@plt>
mov    $0xffffffff,%ebp
test   %eax,%eax
je     1a92 <main+0x8d2>
lea    0x83c(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1ad1 <main+0x911>
mov    %rax,%rbx
lea    0x8a3(%rip),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   10d0 <fwrite@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    $0x1,%ebp
jmp    1a92 <main+0x8d2>
movb   $0x0,0x7c(%rsp)
movb   $0x0,0xb6(%rsp)
lea    0x871(%rip),%rsi
lea    0xa0(%rsp),%rbx
mov    %rbx,%rdi
mov    %rbx,%rdx
mov    %ebp,%ecx
call   10c0 <sprintf@plt>
lea    0x86d(%rip),%rsi
lea    0x60(%rsp),%rdi
mov    %rdi,%rdx
mov    %ebp,%ecx
call   10c0 <sprintf@plt>
mov    %rbx,%rdi
call   1050 <system@plt>
mov    $0xffffffff,%r15d
mov    $0xffffffff,%ebp
test   %eax,%eax
je     1a92 <main+0x8d2>
lea    0x60(%rsp),%rdi
call   1050 <system@plt>
mov    $0xffffffff,%ebp
test   %eax,%eax
je     1a92 <main+0x8d2>
lea    0x78b(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1ad1 <main+0x911>
mov    %rax,%rbx
lea    0x81f(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   10d0 <fwrite@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
xor    %ebp,%ebp
cmp    $0x4,%r12d
jne    1b31 <main+0x971>
mov    0x18(%r14),%rdi
lea    0x77a(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1b16 <main+0x956>
mov    0x18(%r14),%rdi
lea    0x769(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1b1a <main+0x95a>
mov    0x18(%r14),%rdi
call   10b0 <atoi@plt>
jmp    1b1f <main+0x95f>
mov    0x2508(%rip),%rax
mov    (%rax),%rcx
lea    0x708(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
call   10d0 <fwrite@plt>
lea    0x840(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
jmp    1b1f <main+0x95f>
mov    $0x1,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
neg    %ecx
sbb    %r15d,%r15d
or     %eax,%r15d
test   %ebp,%ebp
js     15f1 <main+0x431>
mov    0x24a0(%rip),%rbx
mov    (%rbx),%rdi
lea    0x76d(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    (%rbx),%rcx
lea    0x77b(%rip),%rdi
mov    $0x33,%esi
mov    $0x1,%edx
call   10d0 <fwrite@plt>
mov    (%rbx),%rcx
lea    0x796(%rip),%rdi
mov    $0x28,%esi
mov    $0x1,%edx
call   10d0 <fwrite@plt>
mov    %ebp,0x4(%rsp)
jmp    15f1 <main+0x431>
mov    0x244b(%rip),%rax
mov    (%rax),%rdi
lea    0x6fb(%rip),%rsi
mov    %r15d,%edx
jmp    14a1 <main+0x2e1>

LLVM IR (-O0):
@__const.main.gpio = [29 x i8] c"/sys/class/gpio/gpio00/value\00"
@__const.main.dir = [33 x i8] c"/sys/class/gpio/gpio00/direction\00"
@__const.main.wipi = [55 x i8] c"/usr/local/bin/gpio -g mode 00 up/down/tri 2>/dev/null\00"
@__const.main.wip2 = [49 x i8] c"/usr/bin/gpio -g mode 00 up/down/tri 2>/dev/null\00"
@__const.main.pin_ports = [40 x i32] [i32 -1, i32 -1, i32 2, i32 -1, i32 3, i32 -1, i32 4, i32 14, i32 -1, i32 15, i32 17, i32 18, i32 27, i32 -1, i32 22, i32 23, i32 -1, i32 24, i32 10, i32 -1, i32 9, i32 25, i32 11, i32 8, i32 -1, i32 7, i32 -1, i32 -1, i32 5, i32 -1, i32 6, i32 12, i32 13, i32 -1, i32 19, i32 16, i32 26, i32 20, i32 -1, i32 21]
@stderr = global i32* null
@.str = [24 x i8] c"usage: %s port [value]\0A\00"
@.str.1 = [3 x i8] c"9\0A\00"
@.str.2 = [28 x i8] c"Unsupported Port Error, %d\0A\00"
@.str.3 = [11 x i8] c"%s%d/value\00"
@.str.4 = [15 x i8] c"%s%d/direction\00"
@.str.5 = [2 x i8] c"r\00"
@.str.6 = [23 x i8] c"/sys/class/gpio/export\00"
@.str.7 = [2 x i8] c"w\00"
@.str.8 = [10 x i8] c"IO Error\0A\00"
@.str.9 = [4 x i8] c"%d\0A\00"
@.str.10 = [13 x i8] c"IO Error %s\0A\00"
@.str.11 = [4 x i8] c"in\0A\00"
@.str.12 = [25 x i8] c"IO Error (IO Mode = %s)\0A\00"
@.str.13 = [3 x i8] c"NC\00"
@.str.14 = [4 x i8] c"LOW\00"
@.str.15 = [5 x i8] c"HIGH\00"
@.str.16 = [4 x i8] c"PUP\00"
@.str.17 = [6 x i8] c"PDOWN\00"
@.str.18 = [25 x i8] c"/sys/class/gpio/unexport\00"
@.str.19 = [4 x i8] c"-1\0A\00"
@.str.20 = [22 x i8] c"%s %d up 2> /dev/null\00"
@.str.21 = [9 x i8] c"%s %d up\00"
@.str.22 = [6 x i8] c"high\0A\00"
@.str.23 = [24 x i8] c"%s %d down 2> /dev/null\00"
@.str.24 = [11 x i8] c"%s %d down\00"
@.str.25 = [5 x i8] c"low\0A\00"
@.str.26 = [29 x i8] c"Unsupported Value Error, %d\0A\00"
@.str.27 = [33 x i8] c"Pseudo Pull Up / Down mode (%d)\0A\00"
@.str.28 = [52 x i8] c"WiringPi\E3\82\92\E3\82\A4\E3\83\B3\E3\82\B9\E3\83\88\E3\83\BC\E3\83\AB\E3\81\97\E3\81\A6\E3\81\8F\E3\81\A0\E3\81\95\E3\81\84\E3\80\82\0A\00"
@.str.29 = [41 x i8] c"git clone git://git.drogon.net/wiringPi\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca [29 x i8]
%8 = alloca [33 x i8]
%9 = alloca [55 x i8]
%10 = alloca [49 x i8]
%11 = alloca [8 x i8]
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca [40 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%18 = bitcast [29 x i8]* %7 to i8*
%19 = bitcast [33 x i8]* %8 to i8*
%20 = bitcast [55 x i8]* %9 to i8*
%21 = bitcast [49 x i8]* %10 to i8*
store i32 -1, i32* %15
store i32 -1, i32* %16
%22 = bitcast [40 x i32]* %17 to i8*
%23 = load i32, i32* %4
%24 = icmp slt i32 %23, 2
br i1 %24, label %28, label %25
25: ; preds = %2
%26 = load i32, i32* %4
%27 = icmp sgt i32 %26, 4
br i1 %27, label %28, label %35
28: ; preds = %25, %2
%29 = load i32*, i32** @stderr
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 0
%32 = load i8*, i8** %31
%33 = call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %32)
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %509
35: ; preds = %25
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 1
%38 = load i8*, i8** %37
%39 = call i32 @atoi(i8* %38)
store i32 %39, i32* %13
store i32 0, i32* %12
br label %40
40: ; preds = %52, %35
%41 = load i32, i32* %12
%42 = icmp slt i32 %41, 40
br i1 %42, label %43, label %55
43: ; preds = %40
%44 = load i32, i32* %12
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [40 x i32], [40 x i32]* %17, i64 0, i64 %45
%47 = load i32, i32* %46
%48 = load i32, i32* %13
%49 = icmp eq i32 %47, %48
br i1 %49, label %50, label %51
50: ; preds = %43
br label %55
51: ; preds = %43
br label %52
52: ; preds = %51
%53 = load i32, i32* %12
%54 = add nsw i32 %53, 1
store i32 %54, i32* %12
br label %40
55: ; preds = %50, %40
%56 = load i32, i32* %12
%57 = icmp eq i32 %56, 40
br i1 %57, label %61, label %58
58: ; preds = %55
%59 = load i32, i32* %13
%60 = icmp slt i32 %59, 0
br i1 %60, label %61, label %66
61: ; preds = %58, %55
%62 = load i32*, i32** @stderr
%63 = load i32, i32* %13
%64 = call i32 (i32*, i8*, ...) @fprintf(i32* %62, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %63)
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %509
66: ; preds = %58
%67 = getelementptr inbounds [29 x i8], [29 x i8]* %7, i64 0, i64 20
store i8 0, i8* %67
%68 = getelementptr inbounds [33 x i8], [33 x i8]* %8, i64 0, i64 20
store i8 0, i8* %68
%69 = getelementptr inbounds [29 x i8], [29 x i8]* %7, i64 0, i64 0
%70 = getelementptr inbounds [29 x i8], [29 x i8]* %7, i64 0, i64 0
%71 = load i32, i32* %13
%72 = call i32 @sprintf(i8* %69, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* %70, i32 %71)
%73 = getelementptr inbounds [33 x i8], [33 x i8]* %8, i64 0, i64 0
%74 = getelementptr inbounds [33 x i8], [33 x i8]* %8, i64 0, i64 0
%75 = load i32, i32* %13
%76 = call i32 @sprintf(i8* %73, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %74, i32 %75)
%77 = getelementptr inbounds [29 x i8], [29 x i8]* %7, i64 0, i64 0
%78 = call i32* @fopen(i8* %77, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %78, i32** %6
%79 = load i32*, i32** %6
%80 = icmp eq i32* %79, null
br i1 %80, label %81, label %148
81: ; preds = %66
%82 = call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %82, i32** %6
%83 = load i32*, i32** %6
%84 = icmp eq i32* %83, null
br i1 %84, label %85, label %89
85: ; preds = %81
%86 = load i32*, i32** @stderr
%87 = call i32 (i32*, i8*, ...) @fprintf(i32* %86, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %509
89: ; preds = %81
%90 = load i32*, i32** %6
%91 = load i32, i32* %13
%92 = call i32 (i32*, i8*, ...) @fprintf(i32* %90, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 %91)
%93 = load i32*, i32** %6
%94 = call i32 @fclose(i32* %93)
store i32 0, i32* %12
br label %95
95: ; preds = %106, %89
%96 = load i32, i32* %12
%97 = icmp slt i32 %96, 3
br i1 %97, label %98, label %109
98: ; preds = %95
%99 = getelementptr inbounds [33 x i8], [33 x i8]* %8, i64 0, i64 0
%100 = call i32* @fopen(i8* %99, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %100, i32** %6
%101 = load i32*, i32** %6
%102 = icmp ne i32* %101, null
br i1 %102, label %103, label %104
103: ; preds = %98
br label %109
104: ; preds = %98
%105 = call i32 @usleep(i32 50000)
br label %106
106: ; preds = %104
%107 = load i32, i32* %12
%108 = add nsw i32 %107, 1
store i32 %108, i32* %12
br label %95
109: ; preds = %103, %95
%110 = load i32, i32* %12
%111 = icmp eq i32 %110, 3
br i1 %111, label %112, label %117
112: ; preds = %109
%113 = load i32*, i32** @stderr
%114 = getelementptr inbounds [33 x i8], [33 x i8]* %8, i64 0, i64 0
%115 = call i32 (i32*, i8*, ...) @fprintf(i32* %113, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8* %114)
%116 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %509
117: ; preds = %109
%118 = load i32*, i32** %6
%119 = call i32 (i32*, i8*, ...) @fprintf(i32* %118, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%120 = load i32*, i32** %6
%121 = call i32 @fclose(i32* %120)
%122 = getelementptr inbounds [33 x i8], [33 x i8]* %8, i64 0, i64 0
%123 = call i32* @fopen(i8* %122, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %123, i32** %6
%124 = load i32*, i32** %6
%125 = icmp eq i32* %124, null
br i1 %125, label %126, label %131
126: ; preds = %117
%127 = load i32*, i32** @stderr
%128 = getelementptr inbounds [29 x i8], [29 x i8]* %7, i64 0, i64 0
%129 = call i32 (i32*, i8*, ...) @fprintf(i32* %127, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8* %128)
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %509
131: ; preds = %117
%132 = getelementptr inbounds [8 x i8], [8 x i8]* %11, i64 0, i64 0
%133 = load i32*, i32** %6
%134 = call i32 @fgets(i8* %132, i32 8, i32* %133)
%135 = getelementptr inbounds [8 x i8], [8 x i8]* %11, i64 0, i64 0
%136 = call i64 @strcmp(i8* %135, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%137 = icmp ne i64 %136, 0
br i1 %137, label %138, label %145
138: ; preds = %131
%139 = load i32*, i32** @stderr
%140 = getelementptr inbounds [8 x i8], [8 x i8]* %11, i64 0, i64 0
%141 = call i32 (i32*, i8*, ...) @fprintf(i32* %139, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.12, i64 0, i64 0), i8* %140)
%142 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%143 = load i32*, i32** %6
%144 = call i32 @fclose(i32* %143)
store i32 -1, i32* %3
br label %509
145: ; preds = %131
%146 = load i32*, i32** %6
%147 = call i32 @fclose(i32* %146)
br label %148
148: ; preds = %145, %66
%149 = load i32*, i32** %6
%150 = call i32 @fclose(i32* %149)
%151 = load i32, i32* %4
%152 = icmp sge i32 %151, 3
br i1 %152, label %153, label %352
153: ; preds = %148
%154 = load i8**, i8*** %5
%155 = getelementptr inbounds i8*, i8** %154, i64 2
%156 = load i8*, i8** %155
%157 = call i64 @strcmp(i8* %156, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
%158 = icmp ne i64 %157, 0
br i1 %158, label %160, label %159
159: ; preds = %153
store i32 -1, i32* %14
br label %197
160: ; preds = %153
%161 = load i8**, i8*** %5
%162 = getelementptr inbounds i8*, i8** %161, i64 2
%163 = load i8*, i8** %162
%164 = call i64 @strcmp(i8* %163, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%165 = icmp ne i64 %164, 0
br i1 %165, label %167, label %166
166: ; preds = %160
store i32 0, i32* %14
br label %196
167: ; preds = %160
%168 = load i8**, i8*** %5
%169 = getelementptr inbounds i8*, i8** %168, i64 2
%170 = load i8*, i8** %169
%171 = call i64 @strcmp(i8* %170, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
%172 = icmp ne i64 %171, 0
br i1 %172, label %174, label %173
173: ; preds = %167
store i32 1, i32* %14
br label %195
174: ; preds = %167
%175 = load i8**, i8*** %5
%176 = getelementptr inbounds i8*, i8** %175, i64 2
%177 = load i8*, i8** %176
%178 = call i64 @strcmp(i8* %177, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0))
%179 = icmp ne i64 %178, 0
br i1 %179, label %181, label %180
180: ; preds = %174
store i32 2, i32* %14
br label %194
181: ; preds = %174
%182 = load i8**, i8*** %5
%183 = getelementptr inbounds i8*, i8** %182, i64 2
%184 = load i8*, i8** %183
%185 = call i64 @strcmp(i8* %184, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.17, i64 0, i64 0))
%186 = icmp ne i64 %185, 0
br i1 %186, label %188, label %187
187: ; preds = %181
store i32 3, i32* %14
br label %193
188: ; preds = %181
%189 = load i8**, i8*** %5
%190 = getelementptr inbounds i8*, i8** %189, i64 2
%191 = load i8*, i8** %190
%192 = call i32 @atoi(i8* %191)
store i32 %192, i32* %14
br label %193
193: ; preds = %188, %187
br label %194
194: ; preds = %193, %180
br label %195
195: ; preds = %194, %173
br label %196
196: ; preds = %195, %166
br label %197
197: ; preds = %196, %159
%198 = load i32, i32* %14
switch i32 %198, label %346 [
i32 -1, label %199
i32 0, label %214
i32 1, label %214
i32 2, label %216
i32 3, label %281
]
199: ; preds = %197
%200 = call i32* @fopen(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %200, i32** %6
%201 = load i32*, i32** %6
%202 = icmp ne i32* %201, null
br i1 %202, label %203, label %210
203: ; preds = %199
%204 = load i32*, i32** %6
%205 = load i32, i32* %13
%206 = call i32 (i32*, i8*, ...) @fprintf(i32* %204, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 %205)
%207 = load i32*, i32** %6
%208 = call i32 @fclose(i32* %207)
%209 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0))
store i32 0, i32* %3
br label %509
210: ; preds = %199
%211 = load i32*, i32** @stderr
%212 = call i32 (i32*, i8*, ...) @fprintf(i32* %211, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
%213 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %509
214: ; preds = %197, %197
%215 = load i32, i32* %14
store i32 %215, i32* %15
br label %351
216: ; preds = %197
%217 = getelementptr inbounds [55 x i8], [55 x i8]* %9, i64 0, i64 28
store i8 0, i8* %217
%218 = getelementptr inbounds [49 x i8], [49 x i8]* %10, i64 0, i64 22
store i8 0, i8* %218
%219 = getelementptr inbounds [49 x i8], [49 x i8]* %10, i64 0, i64 0
%220 = getelementptr inbounds [49 x i8], [49 x i8]* %10, i64 0, i64 0
%221 = load i32, i32* %13
%222 = call i32 @sprintf(i8* %219, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.20, i64 0, i64 0), i8* %220, i32 %221)
%223 = getelementptr inbounds [55 x i8], [55 x i8]* %9, i64 0, i64 0
%224 = getelementptr inbounds [55 x i8], [55 x i8]* %9, i64 0, i64 0
%225 = load i32, i32* %13
%226 = call i32 @sprintf(i8* %223, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.21, i64 0, i64 0), i8* %224, i32 %225)
%227 = getelementptr inbounds [49 x i8], [49 x i8]* %10, i64 0, i64 0
%228 = call i32 @system(i8* %227)
%229 = icmp ne i32 %228, 0
br i1 %229, label %230, label %250
230: ; preds = %216
%231 = getelementptr inbounds [55 x i8], [55 x i8]* %9, i64 0, i64 0
%232 = call i32 @system(i8* %231)
%233 = icmp ne i32 %232, 0
br i1 %233, label %234, label %249
234: ; preds = %230
%235 = getelementptr inbounds [33 x i8], [33 x i8]* %8, i64 0, i64 0
%236 = call i32* @fopen(i8* %235, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %236, i32** %6
%237 = load i32*, i32** %6
%238 = icmp ne i32* %237, null
br i1 %238, label %239, label %244
239: ; preds = %234
%240 = load i32*, i32** %6
%241 = call i32 (i32*, i8*, ...) @fprintf(i32* %240, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i64 0, i64 0))
%242 = load i32*, i32** %6
%243 = call i32 @fclose(i32* %242)
store i32 1, i32* %16
br label %248
244: ; preds = %234
%245 = load i32*, i32** @stderr
%246 = call i32 (i32*, i8*, ...) @fprintf(i32* %245, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
%247 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %509
248: ; preds = %239
br label %249
249: ; preds = %248, %230
br label %250
250: ; preds = %249, %216
%251 = load i32, i32* %4
%252 = icmp eq i32 %251, 4
br i1 %252, label %253, label %280
253: ; preds = %250
%254 = load i8**, i8*** %5
%255 = getelementptr inbounds i8*, i8** %254, i64 3
%256 = load i8*, i8** %255
%257 = call i64 @strcmp(i8* %256, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%258 = icmp ne i64 %257, 0
br i1 %258, label %260, label %259
259: ; preds = %253
store i32 0, i32* %15
br label %273
260: ; preds = %253
%261 = load i8**, i8*** %5
%262 = getelementptr inbounds i8*, i8** %261, i64 3
%263 = load i8*, i8** %262
%264 = call i64 @strcmp(i8* %263, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
%265 = icmp ne i64 %264, 0
br i1 %265, label %267, label %266
266: ; preds = %260
store i32 1, i32* %15
br label %272
267: ; preds = %260
%268 = load i8**, i8*** %5
%269 = getelementptr inbounds i8*, i8** %268, i64 3
%270 = load i8*, i8** %269
%271 = call i32 @atoi(i8* %270)
store i32 %271, i32* %15
br label %272
272: ; preds = %267, %266
br label %273
273: ; preds = %272, %259
%274 = load i32, i32* %15
%275 = srem i32 %274, 2
%276 = load i32, i32* %15
%277 = icmp ne i32 %275, %276
br i1 %277, label %278, label %279
278: ; preds = %273
store i32 -1, i32* %15
br label %279
279: ; preds = %278, %273
br label %280
280: ; preds = %279, %250
br label %351
281: ; preds = %197
%282 = getelementptr inbounds [55 x i8], [55 x i8]* %9, i64 0, i64 28
store i8 0, i8* %282
%283 = getelementptr inbounds [49 x i8], [49 x i8]* %10, i64 0, i64 22
store i8 0, i8* %283
%284 = getelementptr inbounds [49 x i8], [49 x i8]* %10, i64 0, i64 0
%285 = getelementptr inbounds [49 x i8], [49 x i8]* %10, i64 0, i64 0
%286 = load i32, i32* %13
%287 = call i32 @sprintf(i8* %284, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.23, i64 0, i64 0), i8* %285, i32 %286)
%288 = getelementptr inbounds [55 x i8], [55 x i8]* %9, i64 0, i64 0
%289 = getelementptr inbounds [55 x i8], [55 x i8]* %9, i64 0, i64 0
%290 = load i32, i32* %13
%291 = call i32 @sprintf(i8* %288, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.24, i64 0, i64 0), i8* %289, i32 %290)
%292 = getelementptr inbounds [49 x i8], [49 x i8]* %10, i64 0, i64 0
%293 = call i32 @system(i8* %292)
%294 = icmp ne i32 %293, 0
br i1 %294, label %295, label %315
295: ; preds = %281
%296 = getelementptr inbounds [55 x i8], [55 x i8]* %9, i64 0, i64 0
%297 = call i32 @system(i8* %296)
%298 = icmp ne i32 %297, 0
br i1 %298, label %299, label %314
299: ; preds = %295
%300 = getelementptr inbounds [33 x i8], [33 x i8]* %8, i64 0, i64 0
%301 = call i32* @fopen(i8* %300, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %301, i32** %6
%302 = load i32*, i32** %6
%303 = icmp ne i32* %302, null
br i1 %303, label %304, label %309
304: ; preds = %299
%305 = load i32*, i32** %6
%306 = call i32 (i32*, i8*, ...) @fprintf(i32* %305, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.25, i64 0, i64 0))
%307 = load i32*, i32** %6
%308 = call i32 @fclose(i32* %307)
store i32 0, i32* %16
br label %313
309: ; preds = %299
%310 = load i32*, i32** @stderr
%311 = call i32 (i32*, i8*, ...) @fprintf(i32* %310, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
%312 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %509
313: ; preds = %304
br label %314
314: ; preds = %313, %295
br label %315
315: ; preds = %314, %281
%316 = load i32, i32* %4
%317 = icmp eq i32 %316, 4
br i1 %317, label %318, label %345
318: ; preds = %315
%319 = load i8**, i8*** %5
%320 = getelementptr inbounds i8*, i8** %319, i64 3
%321 = load i8*, i8** %320
%322 = call i64 @strcmp(i8* %321, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%323 = icmp ne i64 %322, 0
br i1 %323, label %325, label %324
324: ; preds = %318
store i32 0, i32* %15
br label %338
325: ; preds = %318
%326 = load i8**, i8*** %5
%327 = getelementptr inbounds i8*, i8** %326, i64 3
%328 = load i8*, i8** %327
%329 = call i64 @strcmp(i8* %328, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
%330 = icmp ne i64 %329, 0
br i1 %330, label %332, label %331
331: ; preds = %325
store i32 1, i32* %15
br label %337
332: ; preds = %325
%333 = load i8**, i8*** %5
%334 = getelementptr inbounds i8*, i8** %333, i64 3
%335 = load i8*, i8** %334
%336 = call i32 @atoi(i8* %335)
store i32 %336, i32* %15
br label %337
337: ; preds = %332, %331
br label %338
338: ; preds = %337, %324
%339 = load i32, i32* %15
%340 = srem i32 %339, 2
%341 = load i32, i32* %15
%342 = icmp ne i32 %340, %341
br i1 %342, label %343, label %344
343: ; preds = %338
store i32 -1, i32* %15
br label %344
344: ; preds = %343, %338
br label %345
345: ; preds = %344, %315
br label %351
346: ; preds = %197
%347 = load i32*, i32** @stderr
%348 = load i32, i32* %14
%349 = call i32 (i32*, i8*, ...) @fprintf(i32* %347, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.26, i64 0, i64 0), i32 %348)
%350 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %509
351: ; preds = %345, %280, %214
br label %352
352: ; preds = %351, %148
%353 = load i32, i32* %16
%354 = icmp sge i32 %353, 0
br i1 %354, label %355, label %363
355: ; preds = %352
%356 = load i32*, i32** @stderr
%357 = load i32, i32* %16
%358 = call i32 (i32*, i8*, ...) @fprintf(i32* %356, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.27, i64 0, i64 0), i32 %357)
%359 = load i32*, i32** @stderr
%360 = call i32 (i32*, i8*, ...) @fprintf(i32* %359, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.28, i64 0, i64 0))
%361 = load i32*, i32** @stderr
%362 = call i32 (i32*, i8*, ...) @fprintf(i32* %361, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.29, i64 0, i64 0))
br label %363
363: ; preds = %355, %352
%364 = getelementptr inbounds [29 x i8], [29 x i8]* %7, i64 0, i64 0
%365 = call i32* @fopen(i8* %364, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %365, i32** %6
%366 = load i32*, i32** %6
%367 = icmp eq i32* %366, null
br i1 %367, label %368, label %372
368: ; preds = %363
%369 = load i32*, i32** @stderr
%370 = call i32 (i32*, i8*, ...) @fprintf(i32* %369, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
%371 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %509
372: ; preds = %363
%373 = getelementptr inbounds [8 x i8], [8 x i8]* %11, i64 0, i64 0
%374 = load i32*, i32** %6
%375 = call i32 @fgets(i8* %373, i32 8, i32* %374)
%376 = getelementptr inbounds [8 x i8], [8 x i8]* %11, i64 0, i64 0
%377 = call i32 @atoi(i8* %376)
store i32 %377, i32* %14
%378 = load i32*, i32** %6
%379 = call i32 @fclose(i32* %378)
%380 = load i32, i32* %15
%381 = icmp sge i32 %380, 0
br i1 %381, label %382, label %444
382: ; preds = %372
store i32 0, i32* %12
%383 = load i32, i32* %16
%384 = icmp slt i32 %383, 0
br i1 %384, label %385, label %404
385: ; preds = %382
br label %386
386: ; preds = %390, %385
%387 = load i32, i32* %14
%388 = load i32, i32* %15
%389 = icmp ne i32 %387, %388
br i1 %389, label %390, label %403
390: ; preds = %386
%391 = getelementptr inbounds [29 x i8], [29 x i8]* %7, i64 0, i64 0
%392 = call i32* @fopen(i8* %391, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %392, i32** %6
%393 = getelementptr inbounds [8 x i8], [8 x i8]* %11, i64 0, i64 0
%394 = load i32*, i32** %6
%395 = call i32 @fgets(i8* %393, i32 8, i32* %394)
%396 = getelementptr inbounds [8 x i8], [8 x i8]* %11, i64 0, i64 0
%397 = call i32 @atoi(i8* %396)
store i32 %397, i32* %14
%398 = load i32, i32* %12
%399 = add nsw i32 %398, 1
store i32 %399, i32* %12
%400 = load i32*, i32** %6
%401 = call i32 @fclose(i32* %400)
%402 = call i32 @usleep(i32 100000)
br label %386
403: ; preds = %386
br label %442
404: ; preds = %382
br label %405
405: ; preds = %420, %404
%406 = load i32, i32* %14
%407 = load i32, i32* %15
%408 = icmp ne i32 %406, %407
br i1 %408, label %409, label %441
409: ; preds = %405
%410 = getelementptr inbounds [33 x i8], [33 x i8]* %8, i64 0, i64 0
%411 = call i32* @fopen(i8* %410, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %411, i32** %6
%412 = load i32, i32* %16
%413 = icmp eq i32 %412, 0
br i1 %413, label %414, label %417
414: ; preds = %409
%415 = load i32*, i32** %6
%416 = call i32 (i32*, i8*, ...) @fprintf(i32* %415, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.25, i64 0, i64 0))
br label %420
417: ; preds = %409
%418 = load i32*, i32** %6
%419 = call i32 (i32*, i8*, ...) @fprintf(i32* %418, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i64 0, i64 0))
br label %420
420: ; preds = %417, %414
%421 = load i32*, i32** %6
%422 = call i32 @fclose(i32* %421)
%423 = getelementptr inbounds [29 x i8], [29 x i8]* %7, i64 0, i64 0
%424 = call i32* @fopen(i8* %423, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %424, i32** %6
%425 = getelementptr inbounds [8 x i8], [8 x i8]* %11, i64 0, i64 0
%426 = load i32*, i32** %6
%427 = call i32 @fgets(i8* %425, i32 8, i32* %426)
%428 = getelementptr inbounds [8 x i8], [8 x i8]* %11, i64 0, i64 0
%429 = call i32 @atoi(i8* %428)
store i32 %429, i32* %14
%430 = load i32, i32* %12
%431 = add nsw i32 %430, 1
store i32 %431, i32* %12
%432 = load i32*, i32** %6
%433 = call i32 @fclose(i32* %432)
%434 = getelementptr inbounds [33 x i8], [33 x i8]* %8, i64 0, i64 0
%435 = call i32* @fopen(i8* %434, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %435, i32** %6
%436 = load i32*, i32** %6
%437 = call i32 (i32*, i8*, ...) @fprintf(i32* %436, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%438 = load i32*, i32** %6
%439 = call i32 @fclose(i32* %438)
%440 = call i32 @usleep(i32 100000)
br label %405
441: ; preds = %405
br label %442
442: ; preds = %441, %403
%443 = load i32, i32* %12
store i32 %443, i32* %14
br label %444
444: ; preds = %442, %372
store i32 0, i32* %12
br label %445
445: ; preds = %456, %444
%446 = load i32, i32* %12
%447 = icmp slt i32 %446, 3
br i1 %447, label %448, label %459
448: ; preds = %445
%449 = getelementptr inbounds [33 x i8], [33 x i8]* %8, i64 0, i64 0
%450 = call i32* @fopen(i8* %449, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %450, i32** %6
%451 = load i32*, i32** %6
%452 = icmp ne i32* %451, null
br i1 %452, label %453, label %454
453: ; preds = %448
br label %459
454: ; preds = %448
%455 = call i32 @usleep(i32 50000)
br label %456
456: ; preds = %454
%457 = load i32, i32* %12
%458 = add nsw i32 %457, 1
store i32 %458, i32* %12
br label %445
459: ; preds = %453, %445
%460 = load i32, i32* %12
%461 = icmp eq i32 %460, 3
br i1 %461, label %462, label %467
462: ; preds = %459
%463 = load i32*, i32** @stderr
%464 = getelementptr inbounds [33 x i8], [33 x i8]* %8, i64 0, i64 0
%465 = call i32 (i32*, i8*, ...) @fprintf(i32* %463, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8* %464)
%466 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %509
467: ; preds = %459
%468 = getelementptr inbounds [8 x i8], [8 x i8]* %11, i64 0, i64 0
%469 = load i32*, i32** %6
%470 = call i32 @fgets(i8* %468, i32 8, i32* %469)
%471 = getelementptr inbounds [8 x i8], [8 x i8]* %11, i64 0, i64 0
%472 = call i64 @strcmp(i8* %471, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%473 = icmp ne i64 %472, 0
br i1 %473, label %474, label %506
474: ; preds = %467
store i32 0, i32* %12
br label %475
475: ; preds = %486, %474
%476 = load i32, i32* %12
%477 = icmp slt i32 %476, 3
br i1 %477, label %478, label %489
478: ; preds = %475
%479 = getelementptr inbounds [33 x i8], [33 x i8]* %8, i64 0, i64 0
%480 = call i32* @fopen(i8* %479, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %480, i32** %6
%481 = load i32*, i32** %6
%482 = icmp ne i32* %481, null
br i1 %482, label %483, label %484
483: ; preds = %478
br label %489
484: ; preds = %478
%485 = call i32 @usleep(i32 50000)
br label %486
486: ; preds = %484
%487 = load i32, i32* %12
%488 = add nsw i32 %487, 1
store i32 %488, i32* %12
br label %475
489: ; preds = %483, %475
%490 = load i32, i32* %12
%491 = icmp eq i32 %490, 3
br i1 %491, label %492, label %497
492: ; preds = %489
%493 = load i32*, i32** @stderr
%494 = getelementptr inbounds [33 x i8], [33 x i8]* %8, i64 0, i64 0
%495 = call i32 (i32*, i8*, ...) @fprintf(i32* %493, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8* %494)
%496 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %509
497: ; preds = %489
%498 = load i32*, i32** %6
%499 = icmp ne i32* %498, null
br i1 %499, label %500, label %505
500: ; preds = %497
%501 = load i32*, i32** %6
%502 = call i32 (i32*, i8*, ...) @fprintf(i32* %501, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%503 = load i32*, i32** %6
%504 = call i32 @fclose(i32* %503)
br label %505
505: ; preds = %500, %497
br label %506
506: ; preds = %505, %467
%507 = load i32, i32* %14
%508 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 %507)
store i32 0, i32* %3
br label %509
509: ; preds = %506, %492, %462, %368, %346, %309, %244, %210, %203, %138, %126, %112, %85, %61, %28
%510 = load i32, i32* %3
ret i32 %510
}

LLVM IR (-O2):
@__const.main.gpio = [29 x i8] c"/sys/class/gpio/gpio00/value\00"
@__const.main.dir = [33 x i8] c"/sys/class/gpio/gpio00/direction\00"
@__const.main.wipi = [55 x i8] c"/usr/local/bin/gpio -g mode 00 up/down/tri 2>/dev/null\00"
@__const.main.wip2 = [49 x i8] c"/usr/bin/gpio -g mode 00 up/down/tri 2>/dev/null\00"
@__const.main.pin_ports = [40 x i32] [i32 -1, i32 -1, i32 2, i32 -1, i32 3, i32 -1, i32 4, i32 14, i32 -1, i32 15, i32 17, i32 18, i32 27, i32 -1, i32 22, i32 23, i32 -1, i32 24, i32 10, i32 -1, i32 9, i32 25, i32 11, i32 8, i32 -1, i32 7, i32 -1, i32 -1, i32 5, i32 -1, i32 6, i32 12, i32 13, i32 -1, i32 19, i32 16, i32 26, i32 20, i32 -1, i32 21]
@stderr = global i32* null
@.str = [24 x i8] c"usage: %s port [value]\0A\00"
@.str.2 = [28 x i8] c"Unsupported Port Error, %d\0A\00"
@.str.3 = [11 x i8] c"%s%d/value\00"
@.str.4 = [15 x i8] c"%s%d/direction\00"
@.str.5 = [2 x i8] c"r\00"
@.str.6 = [23 x i8] c"/sys/class/gpio/export\00"
@.str.7 = [2 x i8] c"w\00"
@.str.8 = [10 x i8] c"IO Error\0A\00"
@.str.9 = [4 x i8] c"%d\0A\00"
@.str.10 = [13 x i8] c"IO Error %s\0A\00"
@.str.11 = [4 x i8] c"in\0A\00"
@.str.12 = [25 x i8] c"IO Error (IO Mode = %s)\0A\00"
@.str.13 = [3 x i8] c"NC\00"
@.str.14 = [4 x i8] c"LOW\00"
@.str.15 = [5 x i8] c"HIGH\00"
@.str.16 = [4 x i8] c"PUP\00"
@.str.17 = [6 x i8] c"PDOWN\00"
@.str.18 = [25 x i8] c"/sys/class/gpio/unexport\00"
@.str.20 = [22 x i8] c"%s %d up 2> /dev/null\00"
@.str.21 = [9 x i8] c"%s %d up\00"
@.str.22 = [6 x i8] c"high\0A\00"
@.str.23 = [24 x i8] c"%s %d down 2> /dev/null\00"
@.str.24 = [11 x i8] c"%s %d down\00"
@.str.25 = [5 x i8] c"low\0A\00"
@.str.26 = [29 x i8] c"Unsupported Value Error, %d\0A\00"
@.str.27 = [33 x i8] c"Pseudo Pull Up / Down mode (%d)\0A\00"
@.str.28 = [52 x i8] c"WiringPi\E3\82\92\E3\82\A4\E3\83\B3\E3\82\B9\E3\83\88\E3\83\BC\E3\83\AB\E3\81\97\E3\81\A6\E3\81\8F\E3\81\A0\E3\81\95\E3\81\84\E3\80\82\0A\00"
@.str.29 = [41 x i8] c"git clone git://git.drogon.net/wiringPi\0A\00"
@str.35 = [3 x i8] c"-1\00"
@str.42 = [2 x i8] c"9\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [29 x i8]
%4 = alloca [33 x i8]
%5 = alloca [55 x i8]
%6 = alloca [49 x i8]
%7 = alloca [8 x i8]
%8 = getelementptr inbounds [29 x i8], [29 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [33 x i8], [33 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [55 x i8], [55 x i8]* %5, i64 0, i64 0
%11 = getelementptr inbounds [49 x i8], [49 x i8]* %6, i64 0, i64 0
%12 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%13 = add i32 %0, -5
%14 = icmp ult i32 %13, -3
br i1 %14, label %15, label %20
15: ; preds = %2
%16 = load i32*, i32** @stderr
%17 = load i8*, i8** %1
%18 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.42, i64 0, i64 0))
br label %342
20: ; preds = %2
%21 = getelementptr inbounds i8*, i8** %1, i64 1
%22 = load i8*, i8** %21
%23 = tail call i32 @atoi(i8* %22)
br label %24
24: ; preds = %49, %20
%25 = phi i64 [ 0, %20 ], [ %50, %49 ]
%26 = getelementptr inbounds [40 x i32], [40 x i32]* @__const.main.pin_ports, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = icmp eq i32 %27, %23
br i1 %28, label %52, label %29
29: ; preds = %24
%30 = add nuw nsw i64 %25, 1
%31 = getelementptr inbounds [40 x i32], [40 x i32]* @__const.main.pin_ports, i64 0, i64 %30
%32 = load i32, i32* %31
%33 = icmp eq i32 %32, %23
br i1 %33, label %52, label %34
34: ; preds = %29
%35 = add nuw nsw i64 %25, 2
%36 = getelementptr inbounds [40 x i32], [40 x i32]* @__const.main.pin_ports, i64 0, i64 %35
%37 = load i32, i32* %36
%38 = icmp eq i32 %37, %23
br i1 %38, label %52, label %39
39: ; preds = %34
%40 = add nuw nsw i64 %25, 3
%41 = getelementptr inbounds [40 x i32], [40 x i32]* @__const.main.pin_ports, i64 0, i64 %40
%42 = load i32, i32* %41
%43 = icmp eq i32 %42, %23
br i1 %43, label %52, label %44
44: ; preds = %39
%45 = add nuw nsw i64 %25, 4
%46 = getelementptr inbounds [40 x i32], [40 x i32]* @__const.main.pin_ports, i64 0, i64 %45
%47 = load i32, i32* %46
%48 = icmp eq i32 %47, %23
br i1 %48, label %52, label %49
49: ; preds = %44
%50 = add nuw nsw i64 %25, 5
%51 = icmp eq i64 %50, 40
br i1 %51, label %58, label %24
52: ; preds = %44, %39, %34, %29, %24
%53 = phi i64 [ %25, %24 ], [ %30, %29 ], [ %35, %34 ], [ %40, %39 ], [ %45, %44 ]
%54 = trunc i64 %53 to i32
%55 = icmp eq i32 %54, 40
%56 = icmp slt i32 %23, 0
%57 = select i1 %55, i1 true, i1 %56
br i1 %57, label %58, label %62
58: ; preds = %49, %52
%59 = load i32*, i32** @stderr
%60 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %59, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %23)
%61 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.42, i64 0, i64 0))
br label %342
62: ; preds = %52
%63 = getelementptr inbounds [29 x i8], [29 x i8]* %3, i64 0, i64 20
store i8 0, i8* %63
%64 = getelementptr inbounds [33 x i8], [33 x i8]* %4, i64 0, i64 20
store i8 0, i8* %64
%65 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* %8, i32 %23)
%66 = call i32 @sprintf(i8* %9, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %9, i32 %23)
%67 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%68 = icmp eq i32* %67, null
br i1 %68, label %69, label %115
69: ; preds = %62
%70 = call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%71 = icmp eq i32* %70, null
br i1 %71, label %72, label %76
72: ; preds = %69
%73 = load i32*, i32** @stderr
%74 = call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i64 9, i64 1, i32* %73)
%75 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.42, i64 0, i64 0))
br label %342
76: ; preds = %69
%77 = call i32 (i32*, i8*, ...) @fprintf(i32* %70, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 %23)
%78 = call i32 @fclose(i32* %70)
%79 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%80 = icmp eq i32* %79, null
br i1 %80, label %81, label %94
81: ; preds = %76
%82 = call i32 @usleep(i32 50000)
%83 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%84 = icmp eq i32* %83, null
br i1 %84, label %85, label %94
85: ; preds = %81
%86 = call i32 @usleep(i32 50000)
%87 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%88 = icmp eq i32* %87, null
br i1 %88, label %89, label %94
89: ; preds = %85
%90 = call i32 @usleep(i32 50000)
%91 = load i32*, i32** @stderr
%92 = call i32 (i32*, i8*, ...) @fprintf(i32* %91, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8* %9)
%93 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.42, i64 0, i64 0))
br label %342
94: ; preds = %76, %81, %85
%95 = phi i32* [ %79, %76 ], [ %83, %81 ], [ %87, %85 ]
%96 = call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i64 3, i64 1, i32* %95)
%97 = call i32 @fclose(i32* %95)
%98 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%99 = icmp eq i32* %98, null
br i1 %99, label %100, label %104
100: ; preds = %94
%101 = load i32*, i32** @stderr
%102 = call i32 (i32*, i8*, ...) @fprintf(i32* %101, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8* %8)
%103 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.42, i64 0, i64 0))
br label %342
104: ; preds = %94
%105 = call i32 @fgets(i8* %12, i32 8, i32* %98)
%106 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%107 = icmp eq i64 %106, 0
br i1 %107, label %113, label %108
108: ; preds = %104
%109 = load i32*, i32** @stderr
%110 = call i32 (i32*, i8*, ...) @fprintf(i32* %109, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.12, i64 0, i64 0), i8* %12)
%111 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.42, i64 0, i64 0))
%112 = call i32 @fclose(i32* %98)
br label %342
113: ; preds = %104
%114 = call i32 @fclose(i32* %98)
br label %115
115: ; preds = %113, %62
%116 = phi i32* [ %98, %113 ], [ %67, %62 ]
%117 = call i32 @fclose(i32* %116)
%118 = icmp sgt i32 %0, 2
br i1 %118, label %119, label %249
119: ; preds = %115
%120 = getelementptr inbounds i8*, i8** %1, i64 2
%121 = load i8*, i8** %120
%122 = call i64 @strcmp(i8* %121, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
%123 = icmp eq i64 %122, 0
br i1 %123, label %143, label %124
124: ; preds = %119
%125 = load i8*, i8** %120
%126 = call i64 @strcmp(i8* %125, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%127 = icmp eq i64 %126, 0
br i1 %127, label %249, label %128
128: ; preds = %124
%129 = load i8*, i8** %120
%130 = call i64 @strcmp(i8* %129, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
%131 = icmp eq i64 %130, 0
br i1 %131, label %249, label %132
132: ; preds = %128
%133 = load i8*, i8** %120
%134 = call i64 @strcmp(i8* %133, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0))
%135 = icmp eq i64 %134, 0
br i1 %135, label %154, label %136
136: ; preds = %132
%137 = load i8*, i8** %120
%138 = call i64 @strcmp(i8* %137, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.17, i64 0, i64 0))
%139 = icmp eq i64 %138, 0
br i1 %139, label %194, label %140
140: ; preds = %136
%141 = load i8*, i8** %120
%142 = call i32 @atoi(i8* %141)
switch i32 %142, label %234 [
i32 -1, label %143
i32 0, label %249
i32 1, label %249
i32 2, label %154
i32 3, label %194
]
143: ; preds = %119, %140
%144 = call i32* @fopen(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%145 = icmp eq i32* %144, null
br i1 %145, label %150, label %146
146: ; preds = %143
%147 = call i32 (i32*, i8*, ...) @fprintf(i32* %144, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 %23)
%148 = call i32 @fclose(i32* %144)
%149 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.35, i64 0, i64 0))
br label %342
150: ; preds = %143
%151 = load i32*, i32** @stderr
%152 = call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i64 9, i64 1, i32* %151)
%153 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.42, i64 0, i64 0))
br label %342
154: ; preds = %132, %140
%155 = getelementptr inbounds [55 x i8], [55 x i8]* %5, i64 0, i64 28
store i8 0, i8* %155
%156 = getelementptr inbounds [49 x i8], [49 x i8]* %6, i64 0, i64 22
store i8 0, i8* %156
%157 = call i32 @sprintf(i8* %11, i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.20, i64 0, i64 0), i8* %11, i32 %23)
%158 = call i32 @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.21, i64 0, i64 0), i8* %10, i32 %23)
%159 = call i32 @system(i8* %11)
%160 = icmp eq i32 %159, 0
br i1 %160, label %174, label %161
161: ; preds = %154
%162 = call i32 @system(i8* %10)
%163 = icmp eq i32 %162, 0
br i1 %163, label %174, label %164
164: ; preds = %161
%165 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%166 = icmp eq i32* %165, null
br i1 %166, label %170, label %167
167: ; preds = %164
%168 = call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i64 0, i64 0), i64 5, i64 1, i32* %165)
%169 = call i32 @fclose(i32* %165)
br label %174
170: ; preds = %164
%171 = load i32*, i32** @stderr
%172 = call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i64 9, i64 1, i32* %171)
%173 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.42, i64 0, i64 0))
br label %342
174: ; preds = %161, %167, %154
%175 = phi i32 [ 1, %167 ], [ -1, %161 ], [ -1, %154 ]
%176 = icmp eq i32 %0, 4
br i1 %176, label %177, label %238
177: ; preds = %174
%178 = getelementptr inbounds i8*, i8** %1, i64 3
%179 = load i8*, i8** %178
%180 = call i64 @strcmp(i8* %179, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%181 = icmp eq i64 %180, 0
br i1 %181, label %189, label %182
182: ; preds = %177
%183 = load i8*, i8** %178
%184 = call i64 @strcmp(i8* %183, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
%185 = icmp eq i64 %184, 0
br i1 %185, label %189, label %186
186: ; preds = %182
%187 = load i8*, i8** %178
%188 = call i32 @atoi(i8* %187)
br label %189
189: ; preds = %182, %177, %186
%190 = phi i32 [ %188, %186 ], [ 0, %177 ], [ 1, %182 ]
%191 = srem i32 %190, 2
%192 = icmp eq i32 %191, %190
%193 = select i1 %192, i32 %190, i32 -1
br label %238
194: ; preds = %136, %140
%195 = getelementptr inbounds [55 x i8], [55 x i8]* %5, i64 0, i64 28
store i8 0, i8* %195
%196 = getelementptr inbounds [49 x i8], [49 x i8]* %6, i64 0, i64 22
store i8 0, i8* %196
%197 = call i32 @sprintf(i8* %11, i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.23, i64 0, i64 0), i8* %11, i32 %23)
%198 = call i32 @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.24, i64 0, i64 0), i8* %10, i32 %23)
%199 = call i32 @system(i8* %11)
%200 = icmp eq i32 %199, 0
br i1 %200, label %214, label %201
201: ; preds = %194
%202 = call i32 @system(i8* %10)
%203 = icmp eq i32 %202, 0
br i1 %203, label %214, label %204
204: ; preds = %201
%205 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%206 = icmp eq i32* %205, null
br i1 %206, label %210, label %207
207: ; preds = %204
%208 = call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.25, i64 0, i64 0), i64 4, i64 1, i32* %205)
%209 = call i32 @fclose(i32* %205)
br label %214
210: ; preds = %204
%211 = load i32*, i32** @stderr
%212 = call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i64 9, i64 1, i32* %211)
%213 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.42, i64 0, i64 0))
br label %342
214: ; preds = %201, %207, %194
%215 = phi i32 [ 0, %207 ], [ -1, %201 ], [ -1, %194 ]
%216 = icmp eq i32 %0, 4
br i1 %216, label %217, label %238
217: ; preds = %214
%218 = getelementptr inbounds i8*, i8** %1, i64 3
%219 = load i8*, i8** %218
%220 = call i64 @strcmp(i8* %219, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%221 = icmp eq i64 %220, 0
br i1 %221, label %229, label %222
222: ; preds = %217
%223 = load i8*, i8** %218
%224 = call i64 @strcmp(i8* %223, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
%225 = icmp eq i64 %224, 0
br i1 %225, label %229, label %226
226: ; preds = %222
%227 = load i8*, i8** %218
%228 = call i32 @atoi(i8* %227)
br label %229
229: ; preds = %222, %217, %226
%230 = phi i32 [ %228, %226 ], [ 0, %217 ], [ 1, %222 ]
%231 = srem i32 %230, 2
%232 = icmp eq i32 %231, %230
%233 = select i1 %232, i32 %230, i32 -1
br label %238
234: ; preds = %140
%235 = load i32*, i32** @stderr
%236 = call i32 (i32*, i8*, ...) @fprintf(i32* %235, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.26, i64 0, i64 0), i32 %142)
%237 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.42, i64 0, i64 0))
br label %342
238: ; preds = %189, %174, %229, %214
%239 = phi i32 [ %233, %229 ], [ -1, %214 ], [ %193, %189 ], [ -1, %174 ]
%240 = phi i32 [ %215, %229 ], [ %215, %214 ], [ %175, %189 ], [ %175, %174 ]
%241 = icmp sgt i32 %240, -1
br i1 %241, label %242, label %249
242: ; preds = %238
%243 = load i32*, i32** @stderr
%244 = call i32 (i32*, i8*, ...) @fprintf(i32* %243, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.27, i64 0, i64 0), i32 %240)
%245 = load i32*, i32** @stderr
%246 = call i64 @fwrite(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.28, i64 0, i64 0), i64 51, i64 1, i32* %245)
%247 = load i32*, i32** @stderr
%248 = call i64 @fwrite(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.29, i64 0, i64 0), i64 40, i64 1, i32* %247)
br label %249
249: ; preds = %128, %124, %140, %140, %115, %242, %238
%250 = phi i32 [ %240, %242 ], [ -1, %238 ], [ -1, %115 ], [ -1, %140 ], [ -1, %140 ], [ -1, %124 ], [ -1, %128 ]
%251 = phi i32 [ %239, %242 ], [ %239, %238 ], [ -1, %115 ], [ %142, %140 ], [ %142, %140 ], [ 0, %124 ], [ 1, %128 ]
%252 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%253 = icmp eq i32* %252, null
br i1 %253, label %254, label %258
254: ; preds = %249
%255 = load i32*, i32** @stderr
%256 = call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i64 9, i64 1, i32* %255)
%257 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.42, i64 0, i64 0))
br label %342
258: ; preds = %249
%259 = call i32 @fgets(i8* %12, i32 8, i32* %252)
%260 = call i32 @atoi(i8* %12)
%261 = call i32 @fclose(i32* %252)
%262 = icmp sgt i32 %251, -1
br i1 %262, label %263, label %298
263: ; preds = %258
%264 = icmp slt i32 %250, 0
%265 = icmp eq i32 %260, %251
br i1 %264, label %269, label %266
266: ; preds = %263
br i1 %265, label %298, label %267
267: ; preds = %266
%268 = icmp eq i32 %250, 0
br label %279
269: ; preds = %263
br i1 %265, label %298, label %270
270: ; preds = %269, %270
%271 = phi i32 [ %275, %270 ], [ 0, %269 ]
%272 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%273 = call i32 @fgets(i8* %12, i32 8, i32* %272)
%274 = call i32 @atoi(i8* %12)
%275 = add nuw nsw i32 %271, 1
%276 = call i32 @fclose(i32* %272)
%277 = call i32 @usleep(i32 100000)
%278 = icmp eq i32 %274, %251
br i1 %278, label %298, label %270
279: ; preds = %267, %286
%280 = phi i32 [ 0, %267 ], [ %291, %286 ]
%281 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br i1 %268, label %282, label %284
282: ; preds = %279
%283 = call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.25, i64 0, i64 0), i64 4, i64 1, i32* %281)
br label %286
284: ; preds = %279
%285 = call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i64 0, i64 0), i64 5, i64 1, i32* %281)
br label %286
286: ; preds = %284, %282
%287 = call i32 @fclose(i32* %281)
%288 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%289 = call i32 @fgets(i8* %12, i32 8, i32* %288)
%290 = call i32 @atoi(i8* %12)
%291 = add nuw nsw i32 %280, 1
%292 = call i32 @fclose(i32* %288)
%293 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%294 = call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i64 3, i64 1, i32* %293)
%295 = call i32 @fclose(i32* %293)
%296 = call i32 @usleep(i32 100000)
%297 = icmp eq i32 %290, %251
br i1 %297, label %298, label %279
298: ; preds = %286, %270, %266, %269, %258
%299 = phi i32 [ %260, %258 ], [ 0, %269 ], [ 0, %266 ], [ %275, %270 ], [ %291, %286 ]
%300 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%301 = icmp eq i32* %300, null
br i1 %301, label %302, label %315
302: ; preds = %298
%303 = call i32 @usleep(i32 50000)
%304 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%305 = icmp eq i32* %304, null
br i1 %305, label %306, label %315
306: ; preds = %302
%307 = call i32 @usleep(i32 50000)
%308 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%309 = icmp eq i32* %308, null
br i1 %309, label %310, label %315
310: ; preds = %306
%311 = call i32 @usleep(i32 50000)
%312 = load i32*, i32** @stderr
%313 = call i32 (i32*, i8*, ...) @fprintf(i32* %312, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8* %9)
%314 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.42, i64 0, i64 0))
br label %342
315: ; preds = %298, %302, %306
%316 = phi i32* [ %300, %298 ], [ %304, %302 ], [ %308, %306 ]
%317 = call i32 @fgets(i8* %12, i32 8, i32* %316)
%318 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%319 = icmp eq i64 %318, 0
br i1 %319, label %340, label %320
320: ; preds = %315
%321 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%322 = icmp eq i32* %321, null
br i1 %322, label %323, label %336
323: ; preds = %320
%324 = call i32 @usleep(i32 50000)
%325 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%326 = icmp eq i32* %325, null
br i1 %326, label %327, label %336
327: ; preds = %323
%328 = call i32 @usleep(i32 50000)
%329 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%330 = icmp eq i32* %329, null
br i1 %330, label %331, label %336
331: ; preds = %327
%332 = call i32 @usleep(i32 50000)
%333 = load i32*, i32** @stderr
%334 = call i32 (i32*, i8*, ...) @fprintf(i32* %333, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8* %9)
%335 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.42, i64 0, i64 0))
br label %342
336: ; preds = %320, %323, %327
%337 = phi i32* [ %321, %320 ], [ %325, %323 ], [ %329, %327 ]
%338 = call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i64 3, i64 1, i32* %337)
%339 = call i32 @fclose(i32* %337)
br label %340
340: ; preds = %336, %315
%341 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 %299)
br label %342
342: ; preds = %340, %331, %310, %254, %234, %210, %170, %150, %146, %108, %100, %89, %72, %58, %15
%343 = phi i32 [ -1, %15 ], [ -1, %58 ], [ -1, %72 ], [ -1, %89 ], [ -1, %100 ], [ -1, %108 ], [ -1, %234 ], [ -1, %254 ], [ -1, %310 ], [ -1, %331 ], [ 0, %340 ], [ -1, %210 ], [ -1, %170 ], [ 0, %146 ], [ -1, %150 ]
ret i32 %343
}