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

/* Variables and functions */
int O_CLOEXEC;
int O_RDONLY;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, unsigned int,
                         int /*<<< orphan*/);
int /*<<< orphan*/ isdigit(char);
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ my_is_alnum_punct(char);
int open(char *, int);
int /*<<< orphan*/ pclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int read(int, unsigned char *, int);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ write(int, char *, int);
int main(int argc, char *argv[]) {
  FILE *fp;
  char buffer[4096 + 80];
  char command[512] = "";
  int found = 0;
  if (argc != 2) {
    char msg[] = "usage: get_kernel_version <kernel_image>\n";
    write(2, msg, sizeof(msg));
    return 1;
  }
  {
    unsigned char buf[2];
    int fd = open(argv[1], O_RDONLY | O_CLOEXEC);
    if (fd == -1) {
      fprintf(stderr, "Cannot open kernel image \"%s\"\n", argv[1]);
      return 1;
    }
    if (read(fd, buf, 2) != 2) {
      fprintf(stderr, "Short read\n");
      close(fd);
      return 1;
    }
    if (buf[0] == 037 && (buf[1] == 0213 || buf[1] == 0236)) {
      snprintf(command, sizeof(command), "/bin/gzip -dc %s 2>/dev/null",
               argv[1]);
      fp = popen(command, "re");
      if (fp == NULL) {
        fprintf(stderr, "%s: faild\n", command);
        return 1;
      }
    } else {
      fp = fopen(argv[1], "re");
    }
    close(fd);
  }
  memset(buffer, 0, sizeof(buffer));
  while (!found) {
    ssize_t in;
    int i;
    in = fread(&buffer[80], 1, sizeof(buffer) - 80, fp);
    if (in <= 0) {
      break;
    }
    for (i = 0; i < in; i++) {
      if (buffer[i] == 'L' && buffer[i + 1] == 'i' && buffer[i + 2] == 'n' &&
          buffer[i + 3] == 'u' && buffer[i + 4] == 'x' &&
          buffer[i + 5] == '-') {
        int l;
        int c = 0;
        char version[80];
        for (l = i + 6; l < in; l++) {
          if (buffer[l] == '(') {
            version[c] = '\0';
            found = 1;
            snprintf(buffer, c, "%s", version);
            break;
          }
          version[c] = buffer[l];
          c++;
        }
        if (found) {
          printf("%s\n", version);
        }
      }
    }
    if (found) {
      break;
    }
    for (i = 0; i < in; i++) {
      if (buffer[i] == 'L' && buffer[i + 1] == 'i' && buffer[i + 2] == 'n' &&
          buffer[i + 3] == 'u' && buffer[i + 4] == 'x' &&
          buffer[i + 5] == ' ' && buffer[i + 6] == 'v' &&
          buffer[i + 7] == 'e' && buffer[i + 8] == 'r' &&
          buffer[i + 9] == 's' && buffer[i + 10] == 'i' &&
          buffer[i + 11] == 'o' && buffer[i + 12] == 'n' &&
          buffer[i + 13] == ' ') {
        int j = i + 14;
        int invalid_char = 0;
        int number_dots = 0;
        for (j = j + 1; buffer[j] != ' '; j++) {
          char c = buffer[j];
          if (c == '.') {
            number_dots++;
            continue;
          }
          if (((number_dots < 2) && !isdigit(c)) ||
              ((number_dots >= 2) && !my_is_alnum_punct(c))) {
            printf("invalid=1 for %c\n", c);
            break;
          }
        }
        if (!invalid_char) {
          found = 1;
          break;
        }
      }
    }
    if (found) {
      int j;
      for (j = i + 14; buffer[j] != ' '; j++)
        ;
      buffer[j] = '\0';
      printf("%s\n", &buffer[i + 14]);
    } else {
      if (in < (ssize_t)(sizeof(buffer) - 80)) {
        break;
      }
      memcpy(&buffer[0], &buffer[sizeof(buffer) - 80], 80);
      memset(&buffer[80], 0, sizeof(buffer) - 80);
    }
  }
  if (!found) {
    if (!fseek(fp, 0x202, SEEK_SET) && fread(buffer, 1, 4, fp) == 4 &&
        buffer[0] == 0x48 && buffer[1] == 0x64 && buffer[2] == 0x72 &&
        buffer[3] == 0x53 && !fseek(fp, 0x20e, SEEK_SET) &&
        fread(buffer, 1, 2, fp) == 2) {
      unsigned ofs = 0x200 + ((unsigned char *)buffer)[0] +
                     (((unsigned char *)buffer)[1] << 8);
      if (!fseek(fp, ofs, SEEK_SET) && fread(buffer, 1, 80, fp) == 80) {
        char *s = buffer;
        for (s[80] = 0; *s; s++)
          if (*s == ' ') {
            *s = 0;
            break;
          }
        if (*buffer) {
          found = 1;
          printf("%s\n", buffer);
        }
      }
    }
  }
  if (command[0] != '\0') {
    pclose(fp);
  } else {
    fclose(fp);
  }
  if (found) {
    return 0;
  } else {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1330,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1270(%rbp),%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   10a0 <memset@plt>
movl   $0x0,-0x1274(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     128a <main+0x7a>
lea    -0x12a0(%rbp),%rdi
lea    0xda2(%rip),%rsi
mov    $0x2a,%edx
call   10e0 <memcpy@plt>
lea    -0x12a0(%rbp),%rsi
mov    $0x2,%edi
mov    $0x2a,%edx
call   1050 <write@plt>
movl   $0x1,-0x4(%rbp)
jmp    1bf6 <main+0x9e6>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2d4f(%rip),%rax
mov    (%rax),%esi
mov    0x2d1e(%rip),%rax
or     (%rax),%esi
call   1110 <open@plt>
mov    %eax,-0x12a8(%rbp)
cmpl   $0xffffffff,-0x12a8(%rbp)
jne    12e7 <main+0xd7>
mov    0x2d15(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xd56(%rip),%rsi
mov    $0x0,%al
call   10d0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1bf6 <main+0x9e6>
mov    -0x12a8(%rbp),%edi
lea    -0x12a2(%rbp),%rsi
mov    $0x2,%edx
call   10c0 <read@plt>
cmp    $0x2,%eax
je     1335 <main+0x125>
mov    0x2cca(%rip),%rax
mov    (%rax),%edi
lea    0xd32(%rip),%rsi
mov    $0x0,%al
call   10d0 <fprintf@plt>
mov    -0x12a8(%rbp),%edi
call   10b0 <close@plt>
movl   $0x1,-0x4(%rbp)
jmp    1bf6 <main+0x9e6>
movzbl -0x12a2(%rbp),%eax
cmp    $0x1f,%eax
jne    13da <main+0x1ca>
movzbl -0x12a1(%rbp),%eax
cmp    $0x8b,%eax
je     1369 <main+0x159>
movzbl -0x12a1(%rbp),%eax
cmp    $0x9e,%eax
jne    13da <main+0x1ca>
lea    -0x1270(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    $0x200,%esi
lea    0xcd1(%rip),%rdx
call   1090 <snprintf@plt>
lea    -0x1270(%rbp),%rdi
lea    0xcdb(%rip),%rsi
call   1120 <popen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    13d5 <main+0x1c5>
mov    0x2c26(%rip),%rax
mov    (%rax),%edi
lea    -0x1270(%rbp),%rdx
lea    0xcb3(%rip),%rsi
mov    $0x0,%al
call   10d0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1bf6 <main+0x9e6>
jmp    13f2 <main+0x1e2>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xc89(%rip),%rsi
call   1130 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x12a8(%rbp),%edi
call   10b0 <close@plt>
lea    -0x1070(%rbp),%rdi
xor    %esi,%esi
mov    $0x1050,%edx
call   10a0 <memset@plt>
cmpl   $0x0,-0x1274(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1429 <main+0x219>
jmp    19d8 <main+0x7c8>
lea    -0x1070(%rbp),%rdi
add    $0x50,%rdi
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
mov    $0x1000,%edx
call   1040 <fread@plt>
mov    %eax,-0x12ac(%rbp)
cmpl   $0x0,-0x12ac(%rbp)
jg     145f <main+0x24f>
jmp    19d8 <main+0x7c8>
movl   $0x0,-0x12b0(%rbp)
mov    -0x12b0(%rbp),%eax
cmp    -0x12ac(%rbp),%eax
jge    161f <main+0x40f>
movslq -0x12b0(%rbp),%rax
movsbl -0x1070(%rbp,%rax,1),%eax
ff
cmp    $0x4c,%eax
jne    1606 <main+0x3f6>
mov    -0x12b0(%rbp),%eax
add    $0x1,%eax
cltq
movsbl -0x1070(%rbp,%rax,1),%eax
ff
cmp    $0x69,%eax
jne    1606 <main+0x3f6>
mov    -0x12b0(%rbp),%eax
add    $0x2,%eax
cltq
movsbl -0x1070(%rbp,%rax,1),%eax
ff
cmp    $0x6e,%eax
jne    1606 <main+0x3f6>
mov    -0x12b0(%rbp),%eax
add    $0x3,%eax
cltq
movsbl -0x1070(%rbp,%rax,1),%eax
ff
cmp    $0x75,%eax
jne    1606 <main+0x3f6>
mov    -0x12b0(%rbp),%eax
add    $0x4,%eax
cltq
movsbl -0x1070(%rbp,%rax,1),%eax
ff
cmp    $0x78,%eax
jne    1606 <main+0x3f6>
mov    -0x12b0(%rbp),%eax
add    $0x5,%eax
cltq
movsbl -0x1070(%rbp,%rax,1),%eax
ff
cmp    $0x2d,%eax
jne    1606 <main+0x3f6>
movl   $0x0,-0x12b8(%rbp)
mov    -0x12b0(%rbp),%eax
add    $0x6,%eax
mov    %eax,-0x12b4(%rbp)
mov    -0x12b4(%rbp),%eax
cmp    -0x12ac(%rbp),%eax
jge    15df <main+0x3cf>
movslq -0x12b4(%rbp),%rax
movsbl -0x1070(%rbp,%rax,1),%eax
ff
cmp    $0x28,%eax
jne    15a0 <main+0x390>
movslq -0x12b8(%rbp),%rax
movb   $0x0,-0x1310(%rbp,%rax,1)
movl   $0x1,-0x1274(%rbp)
lea    -0x1070(%rbp),%rdi
mov    -0x12b8(%rbp),%esi
lea    -0x1310(%rbp),%rcx
lea    0xaea(%rip),%rdx
call   1090 <snprintf@plt>
jmp    15df <main+0x3cf>
movslq -0x12b4(%rbp),%rax
mov    -0x1070(%rbp,%rax,1),%cl
movslq -0x12b8(%rbp),%rax
mov    %cl,-0x1310(%rbp,%rax,1)
mov    -0x12b8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x12b8(%rbp)
mov    -0x12b4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x12b4(%rbp)
jmp    1538 <main+0x328>
cmpl   $0x0,-0x1274(%rbp)
je     1601 <main+0x3f1>
lea    -0x1310(%rbp),%rsi
lea    0xa89(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1606 <main+0x3f6>
jmp    160b <main+0x3fb>
mov    -0x12b0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x12b0(%rbp)
jmp    1469 <main+0x259>
cmpl   $0x0,-0x1274(%rbp)
je     1631 <main+0x421>
jmp    19d8 <main+0x7c8>
movl   $0x0,-0x12b0(%rbp)
mov    -0x12b0(%rbp),%eax
cmp    -0x12ac(%rbp),%eax
jge    1904 <main+0x6f4>
movslq -0x12b0(%rbp),%rax
movsbl -0x1070(%rbp,%rax,1),%eax
ff
cmp    $0x4c,%eax
jne    18eb <main+0x6db>
mov    -0x12b0(%rbp),%eax
add    $0x1,%eax
cltq
movsbl -0x1070(%rbp,%rax,1),%eax
ff
cmp    $0x69,%eax
jne    18eb <main+0x6db>
mov    -0x12b0(%rbp),%eax
add    $0x2,%eax
cltq
movsbl -0x1070(%rbp,%rax,1),%eax
ff
cmp    $0x6e,%eax
jne    18eb <main+0x6db>
mov    -0x12b0(%rbp),%eax
add    $0x3,%eax
cltq
movsbl -0x1070(%rbp,%rax,1),%eax
ff
cmp    $0x75,%eax
jne    18eb <main+0x6db>
mov    -0x12b0(%rbp),%eax
add    $0x4,%eax
cltq
movsbl -0x1070(%rbp,%rax,1),%eax
ff
cmp    $0x78,%eax
jne    18eb <main+0x6db>
mov    -0x12b0(%rbp),%eax
add    $0x5,%eax
cltq
movsbl -0x1070(%rbp,%rax,1),%eax
ff
cmp    $0x20,%eax
jne    18eb <main+0x6db>
mov    -0x12b0(%rbp),%eax
add    $0x6,%eax
cltq
movsbl -0x1070(%rbp,%rax,1),%eax
ff
cmp    $0x76,%eax
jne    18eb <main+0x6db>
mov    -0x12b0(%rbp),%eax
add    $0x7,%eax
cltq
movsbl -0x1070(%rbp,%rax,1),%eax
ff
cmp    $0x65,%eax
jne    18eb <main+0x6db>
mov    -0x12b0(%rbp),%eax
add    $0x8,%eax
cltq
movsbl -0x1070(%rbp,%rax,1),%eax
ff
cmp    $0x72,%eax
jne    18eb <main+0x6db>
mov    -0x12b0(%rbp),%eax
add    $0x9,%eax
cltq
movsbl -0x1070(%rbp,%rax,1),%eax
ff
cmp    $0x73,%eax
jne    18eb <main+0x6db>
mov    -0x12b0(%rbp),%eax
add    $0xa,%eax
cltq
movsbl -0x1070(%rbp,%rax,1),%eax
ff
cmp    $0x69,%eax
jne    18eb <main+0x6db>
mov    -0x12b0(%rbp),%eax
add    $0xb,%eax
cltq
movsbl -0x1070(%rbp,%rax,1),%eax
ff
cmp    $0x6f,%eax
jne    18eb <main+0x6db>
mov    -0x12b0(%rbp),%eax
add    $0xc,%eax
cltq
movsbl -0x1070(%rbp,%rax,1),%eax
ff
cmp    $0x6e,%eax
jne    18eb <main+0x6db>
mov    -0x12b0(%rbp),%eax
add    $0xd,%eax
cltq
movsbl -0x1070(%rbp,%rax,1),%eax
ff
cmp    $0x20,%eax
jne    18eb <main+0x6db>
mov    -0x12b0(%rbp),%eax
add    $0xe,%eax
mov    %eax,-0x1314(%rbp)
movl   $0x0,-0x1318(%rbp)
movl   $0x0,-0x131c(%rbp)
mov    -0x1314(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1314(%rbp)
movslq -0x1314(%rbp),%rax
movsbl -0x1070(%rbp,%rax,1),%eax
ff
cmp    $0x20,%eax
je     18ca <main+0x6ba>
movslq -0x1314(%rbp),%rax
mov    -0x1070(%rbp,%rax,1),%al
mov    %al,-0x131d(%rbp)
movsbl -0x131d(%rbp),%eax
cmp    $0x2e,%eax
jne    1853 <main+0x643>
mov    -0x131c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x131c(%rbp)
jmp    18b6 <main+0x6a6>
cmpl   $0x2,-0x131c(%rbp)
jge    1875 <main+0x665>
movsbl -0x131d(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
je     1897 <main+0x687>
cmpl   $0x2,-0x131c(%rbp)
jl     18b1 <main+0x6a1>
movsbl -0x131d(%rbp),%edi
call   10f0 <my_is_alnum_punct@plt>
cmp    $0x0,%eax
jne    18b1 <main+0x6a1>
movsbl -0x131d(%rbp),%esi
lea    0x7e2(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    18ca <main+0x6ba>
jmp    18b6 <main+0x6a6>
mov    -0x1314(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1314(%rbp)
jmp    1803 <main+0x5f3>
cmpl   $0x0,-0x1318(%rbp)
jne    18e6 <main+0x6d6>
movl   $0x1,-0x1274(%rbp)
jmp    1904 <main+0x6f4>
jmp    18eb <main+0x6db>
jmp    18f0 <main+0x6e0>
mov    -0x12b0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x12b0(%rbp)
jmp    163b <main+0x42b>
cmpl   $0x0,-0x1274(%rbp)
je     1988 <main+0x778>
mov    -0x12b0(%rbp),%eax
add    $0xe,%eax
mov    %eax,-0x1324(%rbp)
movslq -0x1324(%rbp),%rax
movsbl -0x1070(%rbp,%rax,1),%eax
ff
cmp    $0x20,%eax
je     1951 <main+0x741>
jmp    193d <main+0x72d>
mov    -0x1324(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1324(%rbp)
jmp    1920 <main+0x710>
movslq -0x1324(%rbp),%rax
movb   $0x0,-0x1070(%rbp,%rax,1)
mov    -0x12b0(%rbp),%eax
add    $0xe,%eax
cltq
lea    -0x1070(%rbp),%rsi
add    %rax,%rsi
lea    0x707(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    19d3 <main+0x7c3>
cmpl   $0x1000,-0x12ac(%rbp)
jge    199d <main+0x78d>
jmp    19d8 <main+0x7c8>
lea    -0x1070(%rbp),%rdi
lea    -0x1070(%rbp),%rsi
add    $0x1000,%rsi
mov    $0x50,%edx
call   10e0 <memcpy@plt>
lea    -0x1070(%rbp),%rdi
add    $0x50,%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   10a0 <memset@plt>
jmp    1410 <main+0x200>
cmpl   $0x0,-0x1274(%rbp)
jne    1baf <main+0x99f>
mov    -0x18(%rbp),%rdi
mov    0x25e0(%rip),%rax
mov    (%rax),%edx
mov    $0x202,%esi
call   1100 <fseek@plt>
cmp    $0x0,%eax
jne    1baa <main+0x99a>
lea    -0x1070(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
mov    $0x4,%edx
call   1040 <fread@plt>
cmp    $0x4,%eax
jne    1baa <main+0x99a>
movsbl -0x1070(%rbp),%eax
cmp    $0x48,%eax
jne    1baa <main+0x99a>
movsbl -0x106f(%rbp),%eax
cmp    $0x64,%eax
jne    1baa <main+0x99a>
movsbl -0x106e(%rbp),%eax
cmp    $0x72,%eax
jne    1baa <main+0x99a>
movsbl -0x106d(%rbp),%eax
cmp    $0x53,%eax
jne    1baa <main+0x99a>
mov    -0x18(%rbp),%rdi
mov    0x255d(%rip),%rax
mov    (%rax),%edx
mov    $0x20e,%esi
call   1100 <fseek@plt>
cmp    $0x0,%eax
jne    1baa <main+0x99a>
lea    -0x1070(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
mov    $0x2,%edx
call   1040 <fread@plt>
cmp    $0x2,%eax
jne    1baa <main+0x99a>
movzbl -0x1070(%rbp),%eax
add    $0x200,%eax
movzbl -0x106f(%rbp),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    %eax,-0x1328(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1328(%rbp),%esi
mov    0x24f6(%rip),%rax
mov    (%rax),%edx
call   1100 <fseek@plt>
cmp    $0x0,%eax
jne    1ba5 <main+0x995>
lea    -0x1070(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
mov    $0x50,%edx
call   1040 <fread@plt>
cmp    $0x50,%eax
jne    1ba5 <main+0x995>
lea    -0x1070(%rbp),%rax
mov    %rax,-0x1330(%rbp)
mov    -0x1330(%rbp),%rax
movb   $0x0,0x50(%rax)
mov    -0x1330(%rbp),%rax
cmpb   $0x0,(%rax)
je     1b74 <main+0x964>
mov    -0x1330(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1b58 <main+0x948>
mov    -0x1330(%rbp),%rax
movb   $0x0,(%rax)
jmp    1b74 <main+0x964>
jmp    1b5d <main+0x94d>
mov    -0x1330(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1330(%rbp)
jmp    1b26 <main+0x916>
cmpb   $0x0,-0x1070(%rbp)
je     1ba0 <main+0x990>
movl   $0x1,-0x1274(%rbp)
lea    -0x1070(%rbp),%rsi
lea    0x4ea(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1ba5 <main+0x995>
jmp    1baa <main+0x99a>
jmp    1baf <main+0x99f>
movsbl -0x1270(%rbp),%eax
cmp    $0x0,%eax
je     1bcd <main+0x9bd>
mov    -0x18(%rbp),%rdi
call   1080 <pclose@plt>
jmp    1bd6 <main+0x9c6>
mov    -0x18(%rbp),%rdi
call   1060 <fclose@plt>
cmpl   $0x0,-0x1274(%rbp)
je     1bef <main+0x9df>
movl   $0x0,-0x4(%rbp)
jmp    1bf6 <main+0x9e6>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1330,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x12b8,%rsp
mov    %rsi,%rbp
mov    %edi,%ebx
lea    0x10b0(%rsp),%rdi
mov    $0x200,%edx
xor    %esi,%esi
call   10b0 <memset@plt>
cmp    $0x2,%ebx
jne    1304 <main+0xe4>
mov    0x8(%rbp),%rdi
mov    0x2d8a(%rip),%rax
mov    0x2d5b(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
call   1120 <open@plt>
cmp    $0xffffffff,%eax
je     1347 <main+0x127>
mov    %eax,%r15d
lea    0x60(%rsp),%rsi
mov    %eax,%edi
mov    $0x2,%edx
call   10d0 <read@plt>
cmp    $0x2,%eax
jne    136d <main+0x14d>
cmpb   $0x1f,0x60(%rsp)
jne    1397 <main+0x177>
mov    0x61(%rsp),%al
cmp    $0x9e,%al
je     12af <main+0x8f>
cmp    $0x8b,%al
jne    1397 <main+0x177>
mov    0x8(%rbp),%rcx
lea    0xd9b(%rip),%rdx
lea    0x10b0(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x200,%esi
call   10a0 <snprintf@plt>
lea    0xd9c(%rip),%rsi
mov    %rbp,%rdi
call   1130 <popen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    13aa <main+0x18a>
mov    0x2ce7(%rip),%rax
mov    (%rax),%edi
lea    0xd7b(%rip),%rsi
lea    0x10b0(%rsp),%rdx
jmp    135b <main+0x13b>
movups 0xd0f(%rip),%xmm0
movups %xmm0,0x7a(%rsp)
movaps 0xcf9(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xcdd(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
lea    0x60(%rsp),%rsi
mov    $0x2,%edi
mov    $0x2a,%edx
call   1060 <write@plt>
mov    $0x1,%r15d
jmp    1776 <main+0x556>
mov    0x2c8a(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbp),%rdx
lea    0xccf(%rip),%rsi
xor    %eax,%eax
call   10e0 <fprintf@plt>
mov    $0x1,%r15d
jmp    1776 <main+0x556>
mov    0x2c64(%rip),%rax
mov    (%rax),%edi
lea    0xccc(%rip),%rsi
xor    %eax,%eax
call   10e0 <fprintf@plt>
mov    %r15d,%edi
call   10c0 <close@plt>
mov    $0x1,%r15d
jmp    1776 <main+0x556>
mov    0x8(%rbp),%rdi
lea    0xcd0(%rip),%rsi
call   1140 <fopen@plt>
mov    %rax,%rbx
mov    %r15d,%edi
call   10c0 <close@plt>
lea    0x60(%rsp),%rdi
xor    %esi,%esi
mov    $0x1050,%edx
call   10b0 <memset@plt>
lea    0xb0(%rsp),%rbp
mov    %rbx,0x8(%rsp)
mov    %rbp,%rdi
mov    $0x1,%esi
mov    $0x1000,%edx
mov    %rbx,%rcx
call   1050 <fread@plt>
test   %eax,%eax
lea    0x60(%rsp),%rdi
jle    1643 <main+0x423>
mov    %eax,%r13d
lea    -0x6(%r13),%ebx
mov    %eax,%r12d
xor    %r14d,%r14d
lea    0x66(%rsp),%rbp
xor    %r15d,%r15d
jmp    144c <main+0x22c>
mov    %esi,%eax
movb   $0x0,0x10(%rsp,%rax,1)
lea    0x60(%rsp),%rdi
lea    0xc64(%rip),%rdx
lea    0x10(%rsp),%rcx
call   10a0 <snprintf@plt>
mov    $0x1,%r15d
lea    0x10(%rsp),%rdi
call   1040 <puts@plt>
lea    0x60(%rsp),%rdi
nopl   0x0(%rax,%rax,1)
add    $0xffffffff,%ebx
add    $0x1,%rbp
cmp    %r12,%r14
je     14c0 <main+0x2a0>
mov    %r14,%rax
mov    %ebx,%ebx
add    $0x1,%r14
cmpb   $0x4c,0x60(%rsp,%rax,1)
jne    1440 <main+0x220>
cmpb   $0x69,0x60(%rsp,%r14,1)
jne    1440 <main+0x220>
cmpb   $0x6e,0x2(%rax,%rdi,1)
jne    1440 <main+0x220>
cmpb   $0x75,0x3(%rax,%rdi,1)
jne    1440 <main+0x220>
cmpb   $0x78,0x4(%rax,%rdi,1)
jne    1440 <main+0x220>
cmpb   $0x2d,0x5(%rax,%rdi,1)
jne    1440 <main+0x220>
add    $0x6,%eax
cmp    %r13d,%eax
jge    14aa <main+0x28a>
xor    %esi,%esi
nopw   0x0(%rax,%rax,1)
movzbl 0x0(%rbp,%rsi,1),%eax
cmp    $0x28,%al
je     1409 <main+0x1e9>
mov    %al,0x10(%rsp,%rsi,1)
add    $0x1,%rsi
cmp    %rsi,%rbx
jne    1490 <main+0x270>
test   %r15d,%r15d
jne    142c <main+0x20c>
xor    %r15d,%r15d
jmp    1440 <main+0x220>
nopl   0x0(%rax,%rax,1)
test   %r15d,%r15d
jne    1752 <main+0x532>
test   %r13d,%r13d
jle    1643 <main+0x423>
mov    %r12,%rax
neg    %rax
mov    $0x1,%r15b
mov    $0xfffffffffffffff3,%r14
mov    $0xf,%ecx
lea    0x6f(%rsp),%rbx
lea    0x6e(%rsp),%rbp
jmp    1529 <main+0x309>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    -0xe(%rcx),%rdx
cmp    %r12,%rdx
setb   %r15b
add    $0xffffffffffffffff,%r14
add    $0x1,%rbp
lea    (%rax,%rcx,1),%rdx
add    $0x1,%rdx
add    $0x1,%rcx
add    $0x1,%rbx
cmp    $0xf,%rdx
je     1590 <main+0x370>
cmpb   $0x4c,-0xe(%rbp)
jne    1500 <main+0x2e0>
cmpb   $0x69,-0xd(%rbp)
jne    1500 <main+0x2e0>
cmpb   $0x6e,-0xc(%rbp)
jne    1500 <main+0x2e0>
cmpb   $0x75,-0xb(%rbp)
jne    1500 <main+0x2e0>
cmpb   $0x78,-0xa(%rbp)
jne    1500 <main+0x2e0>
cmpb   $0x20,-0x9(%rbp)
jne    1500 <main+0x2e0>
cmpb   $0x76,-0x8(%rbp)
jne    1500 <main+0x2e0>
cmpb   $0x65,-0x7(%rbp)
jne    1500 <main+0x2e0>
cmpb   $0x72,-0x6(%rbp)
jne    1500 <main+0x2e0>
cmpb   $0x73,-0x5(%rbp)
jne    1500 <main+0x2e0>
cmpb   $0x69,-0x4(%rbp)
jne    1500 <main+0x2e0>
cmpb   $0x6f,-0x3(%rbp)
jne    1500 <main+0x2e0>
cmpb   $0x6e,-0x2(%rbp)
jne    1500 <main+0x2e0>
cmpb   $0x20,-0x1(%rbp)
jne    1500 <main+0x2e0>
xor    %eax,%eax
jmp    15e4 <main+0x3c4>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%bl
cmp    $0x1000,%r13d
jl     1643 <main+0x423>
lea    0x1060(%rsp),%rsi
mov    $0x50,%edx
call   10f0 <memcpy@plt>
xor    %r15d,%r15d
lea    0xb0(%rsp),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   10b0 <memset@plt>
test   %bl,%bl
mov    0x8(%rsp),%rbx
jne    13d0 <main+0x1b0>
jmp    175a <main+0x53a>
add    $0x1,%eax
add    $0x1,%rbx
movsbl (%rbx),%r12d
cmp    $0x2e,%r12d
je     15dd <main+0x3bd>
cmp    $0x20,%r12b
je     1625 <main+0x405>
mov    %eax,0x4(%rsp)
mov    %r12d,%edi
cmp    $0x1,%eax
jg     1607 <main+0x3e7>
call   1030 <isdigit@plt>
jmp    160c <main+0x3ec>
call   1100 <my_is_alnum_punct@plt>
test   %eax,%eax
mov    0x4(%rsp),%eax
jne    15e0 <main+0x3c0>
lea    0xa68(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1080 <printf@plt>
test   $0x1,%r15b
jne    17a8 <main+0x588>
xor    %ebx,%ebx
lea    0x60(%rsp),%rdi
cmp    $0x1000,%r13d
jge    159f <main+0x37f>
mov    0x2986(%rip),%r14
mov    (%r14),%edx
mov    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x202,%esi
call   1110 <fseek@plt>
mov    $0x1,%r15d
test   %eax,%eax
jne    175a <main+0x53a>
lea    0x60(%rsp),%rdi
mov    $0x1,%r15d
mov    $0x1,%esi
mov    $0x4,%edx
mov    %rbx,%rcx
call   1050 <fread@plt>
cmp    $0x4,%eax
jne    175a <main+0x53a>
cmpb   $0x48,0x60(%rsp)
jne    175a <main+0x53a>
cmpb   $0x64,0x61(%rsp)
jne    175a <main+0x53a>
cmpb   $0x72,0x62(%rsp)
jne    175a <main+0x53a>
cmpb   $0x53,0x63(%rsp)
jne    175a <main+0x53a>
mov    (%r14),%edx
mov    %rbx,%rdi
mov    $0x20e,%esi
call   1110 <fseek@plt>
test   %eax,%eax
jne    175a <main+0x53a>
lea    0x60(%rsp),%rdi
mov    $0x1,%r15d
mov    $0x1,%esi
mov    $0x2,%edx
mov    %rbx,%rcx
call   1050 <fread@plt>
cmp    $0x2,%eax
jne    175a <main+0x53a>
movzwl 0x60(%rsp),%esi
add    $0x200,%esi
mov    (%r14),%edx
mov    %rbx,%rdi
call   1110 <fseek@plt>
test   %eax,%eax
jne    175a <main+0x53a>
lea    0x60(%rsp),%r14
mov    $0x1,%r15d
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x50,%edx
mov    %rbx,%rcx
call   1050 <fread@plt>
cmp    $0x50,%eax
jne    175a <main+0x53a>
movb   $0x0,0xb0(%rsp)
movzbl (%r14),%eax
test   %al,%al
je     178f <main+0x56f>
cmp    $0x20,%al
je     178b <main+0x56b>
add    $0x1,%r14
jmp    1740 <main+0x520>
xor    %r15d,%r15d
mov    0x8(%rsp),%rbx
cmpb   $0x0,0x10b0(%rsp)
je     176e <main+0x54e>
mov    %rbx,%rdi
call   1090 <pclose@plt>
jmp    1776 <main+0x556>
mov    %rbx,%rdi
call   1070 <fclose@plt>
mov    %r15d,%eax
add    $0x12b8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movb   $0x0,(%r14)
cmpb   $0x0,0x60(%rsp)
je     175a <main+0x53a>
lea    0x60(%rsp),%rbp
mov    %rbp,%rdi
call   1040 <puts@plt>
xor    %r15d,%r15d
jmp    175a <main+0x53a>
neg    %r14
cmpb   $0x20,0x61(%rsp,%r14,1)
lea    0x1(%r14),%r14
jne    17ab <main+0x58b>
mov    %r14d,%eax
movb   $0x0,0x60(%rsp,%rax,1)
mov    0x8(%rsp),%rbx
jmp    179b <main+0x57b>

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

LLVM IR (-O2):
@__const.main.msg = [42 x i8] c"usage: get_kernel_version <kernel_image>\0A\00"
@O_RDONLY = global i32 0
@O_CLOEXEC = global i32 0
@stderr = global i32 0
@.str = [31 x i8] c"Cannot open kernel image \22%s\22\0A\00"
@.str.1 = [12 x i8] c"Short read\0A\00"
@.str.2 = [29 x i8] c"/bin/gzip -dc %s 2>/dev/null\00"
@.str.3 = [3 x i8] c"re\00"
@.str.4 = [11 x i8] c"%s: faild\0A\00"
@.str.5 = [3 x i8] c"%s\00"
@.str.7 = [18 x i8] c"invalid=1 for %c\0A\00"
@SEEK_SET = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [4176 x i8]
%4 = alloca [512 x i8]
%5 = alloca [42 x i8]
%6 = alloca [2 x i8]
%7 = alloca [80 x i8]
%8 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%10 = icmp eq i32 %0, 2
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = getelementptr inbounds [42 x i8], [42 x i8]* %5, i64 0, i64 0
%13 = call i32 @write(i32 2, i8* %12, i32 42)
br label %321
14: ; preds = %2
%15 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%16 = getelementptr inbounds i8*, i8** %1, i64 1
%17 = load i8*, i8** %16
%18 = load i32, i32* @O_RDONLY
%19 = load i32, i32* @O_CLOEXEC
%20 = or i32 %19, %18
%21 = tail call i32 @open(i8* %17, i32 %20)
%22 = icmp eq i32 %21, -1
br i1 %22, label %23, label %27
23: ; preds = %14
%24 = load i32, i32* @stderr
%25 = load i8*, i8** %16
%26 = tail call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %25)
br label %51
27: ; preds = %14
%28 = call i32 @read(i32 %21, i8* %15, i32 2)
%29 = icmp eq i32 %28, 2
br i1 %29, label %34, label %30
30: ; preds = %27
%31 = load i32, i32* @stderr
%32 = tail call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%33 = tail call i32 @close(i32 %21)
br label %51
34: ; preds = %27
%35 = load i8, i8* %15
%36 = icmp eq i8 %35, 31
br i1 %36, label %37, label %48
37: ; preds = %34
%38 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 1
%39 = load i8, i8* %38
switch i8 %39, label %48 [
i8 -98, label %40
i8 -117, label %40
]
40: ; preds = %37, %37
%41 = load i8*, i8** %16
%42 = call i32 @snprintf(i8* %9, i32 512, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %41)
%43 = call i32* @popen(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%44 = icmp eq i32* %43, null
br i1 %44, label %45, label %52
45: ; preds = %40
%46 = load i32, i32* @stderr
%47 = call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* %9)
br label %51
48: ; preds = %37, %34
%49 = load i8*, i8** %16
%50 = tail call i32* @fopen(i8* %49, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %52
51: ; preds = %23, %30, %45
br label %321
52: ; preds = %40, %48
%53 = phi i32* [ %43, %40 ], [ %50, %48 ]
%54 = call i32 @close(i32 %21)
%55 = call i32 @memset(i8* %8, i32 0, i32 4176)
%56 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 80
%57 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%58 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 4096
br label %59
59: ; preds = %52, %254
%60 = call i32 @fread(i8* %56, i32 1, i32 4096, i32* %53)
%61 = icmp slt i32 %60, 1
br i1 %61, label %257, label %62
62: ; preds = %59
%63 = add nsw i32 %60, -6
%64 = zext i32 %60 to i64
br label %65
65: ; preds = %62, %127
%66 = phi i64 [ 0, %62 ], [ %73, %127 ]
%67 = phi i32 [ %63, %62 ], [ %130, %127 ]
%68 = phi i64 [ 6, %62 ], [ %129, %127 ]
%69 = phi i32 [ 0, %62 ], [ %128, %127 ]
%70 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 %66
%71 = load i8, i8* %70
%72 = icmp eq i8 %71, 76
%73 = add nuw nsw i64 %66, 1
br i1 %72, label %74, label %127
74: ; preds = %65
%75 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 %73
%76 = load i8, i8* %75
%77 = icmp eq i8 %76, 105
br i1 %77, label %78, label %127
78: ; preds = %74
%79 = add nuw nsw i64 %66, 2
%80 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 %79
%81 = load i8, i8* %80
%82 = icmp eq i8 %81, 110
br i1 %82, label %83, label %127
83: ; preds = %78
%84 = add nuw nsw i64 %66, 3
%85 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 %84
%86 = load i8, i8* %85
%87 = icmp eq i8 %86, 117
br i1 %87, label %88, label %127
88: ; preds = %83
%89 = add nuw nsw i64 %66, 4
%90 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 %89
%91 = load i8, i8* %90
%92 = icmp eq i8 %91, 120
br i1 %92, label %93, label %127
93: ; preds = %88
%94 = add nuw nsw i64 %66, 5
%95 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 %94
%96 = load i8, i8* %95
%97 = icmp eq i8 %96, 45
br i1 %97, label %98, label %127
98: ; preds = %93
%99 = trunc i64 %66 to i32
%100 = add i32 %99, 6
%101 = icmp slt i32 %100, %60
br i1 %101, label %102, label %120
102: ; preds = %98
%103 = zext i32 %67 to i64
br label %104
104: ; preds = %102, %115
%105 = phi i64 [ %68, %102 ], [ %118, %115 ]
%106 = phi i64 [ 0, %102 ], [ %117, %115 ]
%107 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 %105
%108 = load i8, i8* %107
%109 = icmp eq i8 %108, 40
br i1 %109, label %110, label %115
110: ; preds = %104
%111 = trunc i64 %106 to i32
%112 = and i64 %106, 4294967295
%113 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 %112
store i8 0, i8* %113
%114 = call i32 @snprintf(i8* %8, i32 %111, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %57)
br label %122
115: ; preds = %104
%116 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 %106
store i8 %108, i8* %116
%117 = add nuw nsw i64 %106, 1
%118 = add nuw nsw i64 %105, 1
%119 = icmp eq i64 %117, %103
br i1 %119, label %120, label %104
120: ; preds = %115, %98
%121 = icmp eq i32 %69, 0
br i1 %121, label %125, label %122
122: ; preds = %110, %120
%123 = phi i32 [ 1, %110 ], [ %69, %120 ]
%124 = call i32 @puts(i8* %57)
br label %125
125: ; preds = %122, %120
%126 = phi i32 [ %123, %122 ], [ 0, %120 ]
br label %127
127: ; preds = %65, %74, %78, %83, %88, %93, %125
%128 = phi i32 [ %69, %74 ], [ %69, %78 ], [ %69, %83 ], [ %69, %88 ], [ %69, %93 ], [ %126, %125 ], [ %69, %65 ]
%129 = add nuw nsw i64 %68, 1
%130 = add i32 %67, -1
%131 = icmp eq i64 %73, %64
br i1 %131, label %132, label %65
132: ; preds = %127
%133 = icmp eq i32 %128, 0
br i1 %133, label %134, label %313
134: ; preds = %132
%135 = icmp sgt i32 %60, 0
br i1 %135, label %136, label %257
136: ; preds = %134
%137 = zext i32 %60 to i64
%138 = zext i32 %60 to i64
br label %139
139: ; preds = %136, %233
%140 = phi i64 [ 0, %136 ], [ %145, %233 ]
%141 = phi i1 [ true, %136 ], [ %234, %233 ]
%142 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 %140
%143 = load i8, i8* %142
%144 = icmp eq i8 %143, 76
%145 = add nuw nsw i64 %140, 1
br i1 %144, label %146, label %233
146: ; preds = %139
%147 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 %145
%148 = load i8, i8* %147
%149 = icmp eq i8 %148, 105
br i1 %149, label %150, label %233
150: ; preds = %146
%151 = add nuw nsw i64 %140, 2
%152 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 %151
%153 = load i8, i8* %152
%154 = icmp eq i8 %153, 110
br i1 %154, label %155, label %233
155: ; preds = %150
%156 = add nuw nsw i64 %140, 3
%157 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 %156
%158 = load i8, i8* %157
%159 = icmp eq i8 %158, 117
br i1 %159, label %160, label %233
160: ; preds = %155
%161 = add nuw nsw i64 %140, 4
%162 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 %161
%163 = load i8, i8* %162
%164 = icmp eq i8 %163, 120
br i1 %164, label %165, label %233
165: ; preds = %160
%166 = add nuw nsw i64 %140, 5
%167 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 %166
%168 = load i8, i8* %167
%169 = icmp eq i8 %168, 32
br i1 %169, label %170, label %233
170: ; preds = %165
%171 = add nuw nsw i64 %140, 6
%172 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 %171
%173 = load i8, i8* %172
%174 = icmp eq i8 %173, 118
br i1 %174, label %175, label %233
175: ; preds = %170
%176 = add nuw nsw i64 %140, 7
%177 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 %176
%178 = load i8, i8* %177
%179 = icmp eq i8 %178, 101
br i1 %179, label %180, label %233
180: ; preds = %175
%181 = add nuw nsw i64 %140, 8
%182 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 %181
%183 = load i8, i8* %182
%184 = icmp eq i8 %183, 114
br i1 %184, label %185, label %233
185: ; preds = %180
%186 = add nuw nsw i64 %140, 9
%187 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 %186
%188 = load i8, i8* %187
%189 = icmp eq i8 %188, 115
br i1 %189, label %190, label %233
190: ; preds = %185
%191 = add nuw nsw i64 %140, 10
%192 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 %191
%193 = load i8, i8* %192
%194 = icmp eq i8 %193, 105
br i1 %194, label %195, label %233
195: ; preds = %190
%196 = add nuw nsw i64 %140, 11
%197 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 %196
%198 = load i8, i8* %197
%199 = icmp eq i8 %198, 111
br i1 %199, label %200, label %233
200: ; preds = %195
%201 = add nuw nsw i64 %140, 12
%202 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 %201
%203 = load i8, i8* %202
%204 = icmp eq i8 %203, 110
br i1 %204, label %205, label %233
205: ; preds = %200
%206 = add nuw nsw i64 %140, 13
%207 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 %206
%208 = load i8, i8* %207
%209 = icmp eq i8 %208, 32
br i1 %209, label %210, label %233
210: ; preds = %205
%211 = add nuw nsw i64 %140, 15
br label %212
212: ; preds = %230, %210
%213 = phi i64 [ %232, %230 ], [ %211, %210 ]
%214 = phi i32 [ %231, %230 ], [ 0, %210 ]
%215 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 %213
%216 = load i8, i8* %215
switch i8 %216, label %219 [
i8 32, label %236
i8 46, label %217
]
217: ; preds = %212
%218 = add nsw i32 %214, 1
br label %230
219: ; preds = %212
%220 = icmp slt i32 %214, 2
br i1 %220, label %221, label %224
221: ; preds = %219
%222 = call i32 @isdigit(i8 signext %216)
%223 = icmp eq i32 %222, 0
br i1 %223, label %227, label %230
224: ; preds = %219
%225 = call i32 @my_is_alnum_punct(i8 signext %216)
%226 = icmp eq i32 %225, 0
br i1 %226, label %227, label %230
227: ; preds = %221, %224
%228 = sext i8 %216 to i32
%229 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), i32 %228)
br label %236
230: ; preds = %217, %224, %221
%231 = phi i32 [ %214, %221 ], [ %214, %224 ], [ %218, %217 ]
%232 = add nuw i64 %213, 1
br label %212
233: ; preds = %139, %146, %150, %155, %160, %165, %170, %175, %180, %185, %190, %195, %200, %205
%234 = icmp ult i64 %145, %137
%235 = icmp eq i64 %145, %138
br i1 %235, label %251, label %139
236: ; preds = %212, %227
br i1 %141, label %237, label %251
237: ; preds = %236
%238 = add nuw nsw i64 %140, 14
br label %239
239: ; preds = %239, %237
%240 = phi i64 [ %244, %239 ], [ %238, %237 ]
%241 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 %240
%242 = load i8, i8* %241
%243 = icmp eq i8 %242, 32
%244 = add nuw i64 %240, 1
br i1 %243, label %245, label %239
245: ; preds = %239
%246 = add nuw i64 %140, 14
%247 = and i64 %240, 4294967295
%248 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 %247
store i8 0, i8* %248
%249 = and i64 %246, 4294967295
%250 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 %249
br label %310
251: ; preds = %233, %236
%252 = phi i1 [ false, %236 ], [ true, %233 ]
%253 = icmp slt i32 %60, 4096
br i1 %253, label %257, label %254
254: ; preds = %251
%255 = call i32 @memcpy(i8* %8, i8* %58, i32 80)
%256 = call i32 @memset(i8* %56, i32 0, i32 4096)
br i1 %252, label %59, label %313
257: ; preds = %134, %251, %59
%258 = load i32, i32* @SEEK_SET
%259 = call i32 @fseek(i32* %53, i32 514, i32 %258)
%260 = icmp eq i32 %259, 0
br i1 %260, label %261, label %313
261: ; preds = %257
%262 = call i32 @fread(i8* %8, i32 1, i32 4, i32* %53)
%263 = icmp eq i32 %262, 4
%264 = load i8, i8* %8
%265 = icmp eq i8 %264, 72
%266 = select i1 %263, i1 %265, i1 false
%267 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 1
%268 = load i8, i8* %267
%269 = icmp eq i8 %268, 100
%270 = select i1 %266, i1 %269, i1 false
%271 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 2
%272 = load i8, i8* %271
%273 = icmp eq i8 %272, 114
%274 = select i1 %270, i1 %273, i1 false
%275 = getelementptr inbounds [4176 x i8], [4176 x i8]* %3, i64 0, i64 3
%276 = load i8, i8* %275
%277 = icmp eq i8 %276, 83
%278 = select i1 %274, i1 %277, i1 false
br i1 %278, label %279, label %313
279: ; preds = %261
%280 = load i32, i32* @SEEK_SET
%281 = call i32 @fseek(i32* %53, i32 526, i32 %280)
%282 = icmp eq i32 %281, 0
br i1 %282, label %283, label %313
283: ; preds = %279
%284 = call i32 @fread(i8* %8, i32 1, i32 2, i32* %53)
%285 = icmp eq i32 %284, 2
br i1 %285, label %286, label %313
286: ; preds = %283
%287 = load i8, i8* %8
%288 = zext i8 %287 to i32
%289 = or i32 %288, 512
%290 = load i8, i8* %267
%291 = zext i8 %290 to i32
%292 = shl nuw nsw i32 %291, 8
%293 = add nuw nsw i32 %289, %292
%294 = load i32, i32* @SEEK_SET
%295 = call i32 @fseek(i32* %53, i32 %293, i32 %294)
%296 = icmp eq i32 %295, 0
br i1 %296, label %297, label %313
297: ; preds = %286
%298 = call i32 @fread(i8* %8, i32 1, i32 80, i32* %53)
%299 = icmp eq i32 %298, 80
br i1 %299, label %300, label %313
300: ; preds = %297
store i8 0, i8* %56
br label %301
301: ; preds = %305, %300
%302 = phi i8* [ %8, %300 ], [ %306, %305 ]
%303 = load i8, i8* %302
switch i8 %303, label %305 [
i8 0, label %307
i8 32, label %304
]
304: ; preds = %301
store i8 0, i8* %302
br label %307
305: ; preds = %301
%306 = getelementptr inbounds i8, i8* %302, i64 1
br label %301
307: ; preds = %301, %304
%308 = load i8, i8* %8
%309 = icmp eq i8 %308, 0
br i1 %309, label %313, label %310
310: ; preds = %307, %245
%311 = phi i8* [ %250, %245 ], [ %8, %307 ]
%312 = call i32 @puts(i8* %311)
br label %313
313: ; preds = %254, %132, %310, %286, %297, %307, %257, %261, %279, %283
%314 = phi i32 [ 1, %286 ], [ 1, %297 ], [ 1, %307 ], [ 1, %257 ], [ 1, %261 ], [ 1, %279 ], [ 1, %283 ], [ 0, %310 ], [ 0, %132 ], [ 0, %254 ]
%315 = load i8, i8* %9
%316 = icmp eq i8 %315, 0
br i1 %316, label %319, label %317
317: ; preds = %313
%318 = call i32 @pclose(i32* %53)
br label %321
319: ; preds = %313
%320 = call i32 @fclose(i32* %53)
br label %321
321: ; preds = %317, %319, %51, %11
%322 = phi i32 [ 1, %11 ], [ 1, %51 ], [ %314, %319 ], [ %314, %317 ]
ret i32 %322
}