#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*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
char *strchr(char *, char);
char *strdup(char *);
int strlen(char *);
int /*<<< orphan*/ strncmp(char *, char *, int);
void read_csv(char *filename, char **InRand, char **MasterCombKey,
              char **SlaveCombKey, char **MasterAuRand, char **SlaveAuRand,
              char **MasterSres, char **SlaveSres, char *buf) {
  FILE *fh;
  char *tmp;
  char *temp[6] = {
      0,
  };
  int start = 0;
  int count = 0;
  int who = 0;
  int what = 0;
  int i;
  fh = fopen(filename, "r");
  if (!fh) {
    printf("Cant open file: %s\n", filename);
    free(buf);
    exit(-1);
  }
  while (fgets(buf, 1024, fh)) {
    switch (start) {
    case 0:
      if (!strncmp(buf, "L,0,PPP,Type,Identifier,Length,Protocol", 39)) {
        start = 2;
      } else if (!strncmp(buf, "Index,Slave/Master,Type,Description", 35)) {
        start = 1;
      }
      break;
    case 1:
      tmp = strchr(buf, ',');
      if (!tmp)
        continue;
      if (!*(++tmp))
        continue;
      if (!strncmp(tmp, "Master,", 7)) {
        tmp += 7;
        tmp = strchr(tmp, ',');
        if (!tmp++)
          continue;
        if (!strncmp(tmp, "LMP_comb_key,", 13)) {
          tmp += 16;
          *MasterCombKey = strdup(tmp);
        } else if (!strncmp(tmp, "LMP_au_rand,", 12)) {
          tmp += 15;
          *MasterAuRand = strdup(tmp);
        } else if (!strncmp(tmp, "LMP_sres,", 9)) {
          tmp += 12;
          *MasterSres = strdup(tmp);
        } else if (!strncmp(tmp, "LMP_in_rand,", 12)) {
          tmp += 15;
          *InRand = strdup(tmp);
        }
      } else if (!strncmp(tmp, "Slave,", 6)) {
        tmp += 6;
        tmp = strchr(tmp, ',');
        if (!tmp++)
          continue;
        if (!strncmp(tmp, "LMP_comb_key,", 13)) {
          tmp += 16;
          *SlaveCombKey = strdup(tmp);
        } else if (!strncmp(tmp, "LMP_au_rand,", 12)) {
          tmp += 15;
          *SlaveAuRand = strdup(tmp);
        } else if (!strncmp(tmp, "LMP_sres,", 9)) {
          tmp += 12;
          *SlaveSres = strdup(tmp);
        }
      }
      break;
    case 2:
      tmp = buf;
      for (i = 0; i < 6; i++) {
        temp[i] = tmp;
        tmp = strchr(tmp, ',');
        if (!tmp)
          break;
        *tmp = '\0';
        tmp++;
      }
      if (atoi(temp[1]) != count) {
        count = atoi(temp[1]);
        who = 0;
        what = 0;
      }
      if ((*temp[0] == 'S') && (!strncmp(temp[2], "Frame", 5))) {
        if (!strncmp(temp[3], "Master", 6))
          who = 1;
        else if (!strncmp(temp[3], "Slave", 5))
          who = 2;
      } else if ((*temp[0] == 'D') && (*temp[2] == '1') &&
                 (!strncmp(temp[3], "Opcode", 6))) {
        if (!strncmp(temp[4], "LMP_comb_key", 13))
          what = 1;
        else if (!strncmp(temp[4], "LMP_au_rand", 12))
          what = 2;
        else if (!strncmp(temp[4], "LMP_sres", 9))
          what = 3;
        else if (!strncmp(temp[4], "LMP_in_rand", 12))
          what = 4;
      } else if ((*temp[0] == 'D') && (*temp[2] == '1') &&
                 (!strncmp(temp[3], "Random Number", 13)) &&
                 (strlen(temp[4]) > 5)) {
        if (who == 1) {
          switch (what) {
          case 1:
            *MasterCombKey = strdup(temp[4] + 3);
            break;
          case 2:
            *MasterAuRand = strdup(temp[4] + 3);
            break;
          case 3:
            *MasterSres = strdup(temp[4] + 3);
            printf("%s\n", *MasterSres);
            break;
          case 4:
            *InRand = strdup(temp[4] + 3);
            break;
          }
        } else if (who == 2) {
          switch (what) {
          case 1:
            *SlaveCombKey = strdup(temp[4] + 3);
            break;
          case 2:
            *SlaveAuRand = strdup(temp[4] + 3);
            break;
          case 3:
            *SlaveSres = strdup(temp[4] + 3);
            break;
          case 4:
            *InRand = strdup(temp[4] + 3);
            break;
          }
        }
      } else if ((*temp[0] == 'D') && (*temp[2] == '1') &&
                 (!strncmp(temp[3], "Authentication Response", 23)) &&
                 (strlen(temp[4]) > 5)) {
        if (who == 1)
          *MasterSres = strdup(temp[4] + 2);
        else if (who == 2)
          *SlaveSres = strdup(temp[4] + 2);
      }
      break;
    }
  }
  fclose(fh);
  return;
}


x86 assembly (clang, -O0):
<read_csv>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1090 <memset@plt>
movl   $0x0,-0x74(%rbp)
movl   $0x0,-0x78(%rbp)
movl   $0x0,-0x7c(%rbp)
movl   $0x0,-0x80(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeef(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    125d <read_csv+0x9d>
mov    -0x8(%rbp),%rsi
lea    0xddb(%rip),%rdi
call   1080 <printf@plt>
mov    0x20(%rbp),%rdi
call   1030 <free@plt>
mov    $0xffffffff,%edi
call   10d0 <exit@plt>
jmp    1262 <read_csv+0xa2>
mov    0x20(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    $0x400,%esi
call   10a0 <fgets@plt>
cmp    $0x0,%rax
je     1a93 <read_csv+0x8d3>
mov    -0x74(%rbp),%eax
mov    %eax,-0x88(%rbp)
test   %eax,%eax
je     12bc <read_csv+0xfc>
jmp    1294 <read_csv+0xd4>
mov    -0x88(%rbp),%eax
sub    $0x1,%eax
je     1315 <read_csv+0x155>
jmp    12a8 <read_csv+0xe8>
mov    -0x88(%rbp),%eax
sub    $0x2,%eax
je     15fa <read_csv+0x43a>
jmp    1a8e <read_csv+0x8ce>
mov    0x20(%rbp),%rdi
lea    0xd6d(%rip),%rsi
mov    $0x27,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    12e6 <read_csv+0x126>
movl   $0x2,-0x74(%rbp)
jmp    1310 <read_csv+0x150>
mov    0x20(%rbp),%rdi
lea    0xd6b(%rip),%rsi
mov    $0x23,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    130b <read_csv+0x14b>
movl   $0x1,-0x74(%rbp)
jmp    1310 <read_csv+0x150>
jmp    1a8e <read_csv+0x8ce>
mov    0x20(%rbp),%rdi
mov    $0x2c,%esi
call   1070 <strchr@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    1337 <read_csv+0x177>
jmp    1262 <read_csv+0xa2>
mov    -0x40(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x40(%rbp)
cmpb   $0x0,0x1(%rax)
jne    1355 <read_csv+0x195>
jmp    1262 <read_csv+0xa2>
mov    -0x40(%rbp),%rdi
lea    0xd20(%rip),%rsi
mov    $0x7,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    14c6 <read_csv+0x306>
mov    -0x40(%rbp),%rax
add    $0x7,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
mov    $0x2c,%esi
call   1070 <strchr@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x40(%rbp)
cmp    $0x0,%rax
jne    13af <read_csv+0x1ef>
jmp    1262 <read_csv+0xa2>
mov    -0x40(%rbp),%rdi
lea    0xcce(%rip),%rsi
mov    $0xd,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    13f1 <read_csv+0x231>
mov    -0x40(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
call   10e0 <strdup@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
jmp    14c1 <read_csv+0x301>
mov    -0x40(%rbp),%rdi
lea    0xc9a(%rip),%rsi
mov    $0xc,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1433 <read_csv+0x273>
mov    -0x40(%rbp),%rax
add    $0xf,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
call   10e0 <strdup@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
jmp    14bc <read_csv+0x2fc>
mov    -0x40(%rbp),%rdi
lea    0xc65(%rip),%rsi
mov    $0x9,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1475 <read_csv+0x2b5>
mov    -0x40(%rbp),%rax
add    $0xc,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
call   10e0 <strdup@plt>
mov    %rax,%rcx
mov    0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    14b7 <read_csv+0x2f7>
mov    -0x40(%rbp),%rdi
lea    0xc2d(%rip),%rsi
mov    $0xc,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    14b2 <read_csv+0x2f2>
mov    -0x40(%rbp),%rax
add    $0xf,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
call   10e0 <strdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    14b7 <read_csv+0x2f7>
jmp    14bc <read_csv+0x2fc>
jmp    14c1 <read_csv+0x301>
jmp    15f5 <read_csv+0x435>
mov    -0x40(%rbp),%rdi
lea    0xbe9(%rip),%rsi
mov    $0x6,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    15f0 <read_csv+0x430>
mov    -0x40(%rbp),%rax
add    $0x6,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
mov    $0x2c,%esi
call   1070 <strchr@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x40(%rbp)
cmp    $0x0,%rax
jne    1520 <read_csv+0x360>
jmp    1262 <read_csv+0xa2>
mov    -0x40(%rbp),%rdi
lea    0xb5d(%rip),%rsi
mov    $0xd,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1562 <read_csv+0x3a2>
mov    -0x40(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
call   10e0 <strdup@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
jmp    15eb <read_csv+0x42b>
mov    -0x40(%rbp),%rdi
lea    0xb29(%rip),%rsi
mov    $0xc,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    15a4 <read_csv+0x3e4>
mov    -0x40(%rbp),%rax
add    $0xf,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
call   10e0 <strdup@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
jmp    15e6 <read_csv+0x426>
mov    -0x40(%rbp),%rdi
lea    0xaf4(%rip),%rsi
mov    $0x9,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    15e1 <read_csv+0x421>
mov    -0x40(%rbp),%rax
add    $0xc,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
call   10e0 <strdup@plt>
mov    %rax,%rcx
mov    0x18(%rbp),%rax
mov    %rcx,(%rax)
jmp    15e6 <read_csv+0x426>
jmp    15eb <read_csv+0x42b>
jmp    15f0 <read_csv+0x430>
jmp    15f5 <read_csv+0x435>
jmp    1a8e <read_csv+0x8ce>
mov    0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x84(%rbp)
cmpl   $0x6,-0x84(%rbp)
jge    1672 <read_csv+0x4b2>
mov    -0x40(%rbp),%rcx
movslq -0x84(%rbp),%rax
mov    %rcx,-0x70(%rbp,%rax,8)
mov    -0x40(%rbp),%rdi
mov    $0x2c,%esi
call   1070 <strchr@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    164b <read_csv+0x48b>
jmp    1672 <read_csv+0x4b2>
mov    -0x40(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    160c <read_csv+0x44c>
mov    -0x68(%rbp),%rdi
call   10c0 <atoi@plt>
cmp    -0x78(%rbp),%eax
je     169e <read_csv+0x4de>
mov    -0x68(%rbp),%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x78(%rbp)
movl   $0x0,-0x7c(%rbp)
movl   $0x0,-0x80(%rbp)
mov    -0x70(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x53,%eax
jne    1725 <read_csv+0x565>
mov    -0x60(%rbp),%rdi
lea    0xa08(%rip),%rsi
mov    $0x5,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1725 <read_csv+0x565>
mov    -0x58(%rbp),%rdi
lea    0x9f0(%rip),%rsi
mov    $0x6,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    16f6 <read_csv+0x536>
movl   $0x1,-0x7c(%rbp)
jmp    1720 <read_csv+0x560>
mov    -0x58(%rbp),%rdi
lea    0x9cd(%rip),%rsi
mov    $0x5,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    171b <read_csv+0x55b>
movl   $0x2,-0x7c(%rbp)
jmp    1720 <read_csv+0x560>
jmp    1a89 <read_csv+0x8c9>
mov    -0x70(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x44,%eax
jne    181a <read_csv+0x65a>
mov    -0x60(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x31,%eax
jne    181a <read_csv+0x65a>
mov    -0x58(%rbp),%rdi
lea    0x984(%rip),%rsi
mov    $0x6,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    181a <read_csv+0x65a>
mov    -0x50(%rbp),%rdi
lea    0x96d(%rip),%rsi
mov    $0xd,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    178d <read_csv+0x5cd>
movl   $0x1,-0x80(%rbp)
jmp    1815 <read_csv+0x655>
mov    -0x50(%rbp),%rdi
lea    0x950(%rip),%rsi
mov    $0xc,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    17b7 <read_csv+0x5f7>
movl   $0x2,-0x80(%rbp)
jmp    1810 <read_csv+0x650>
mov    -0x50(%rbp),%rdi
lea    0x932(%rip),%rsi
mov    $0x9,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    17e1 <read_csv+0x621>
movl   $0x3,-0x80(%rbp)
jmp    180b <read_csv+0x64b>
mov    -0x50(%rbp),%rdi
lea    0x911(%rip),%rsi
mov    $0xc,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1806 <read_csv+0x646>
movl   $0x4,-0x80(%rbp)
jmp    180b <read_csv+0x64b>
jmp    1810 <read_csv+0x650>
jmp    1815 <read_csv+0x655>
jmp    1a84 <read_csv+0x8c4>
mov    -0x70(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x44,%eax
jne    19d9 <read_csv+0x819>
mov    -0x60(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x31,%eax
jne    19d9 <read_csv+0x819>
mov    -0x58(%rbp),%rdi
lea    0x8c4(%rip),%rsi
mov    $0xd,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    19d9 <read_csv+0x819>
mov    -0x50(%rbp),%rdi
call   1060 <strlen@plt>
cmp    $0x5,%eax
jle    19d9 <read_csv+0x819>
cmpl   $0x1,-0x7c(%rbp)
jne    1926 <read_csv+0x766>
mov    -0x80(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x90(%rbp)
sub    $0x3,%eax
ja     1921 <read_csv+0x761>
mov    -0x90(%rbp),%rax
lea    0x776(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x50(%rbp),%rdi
add    $0x3,%rdi
call   10e0 <strdup@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
jmp    1921 <read_csv+0x761>
mov    -0x50(%rbp),%rdi
add    $0x3,%rdi
call   10e0 <strdup@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
jmp    1921 <read_csv+0x761>
mov    -0x50(%rbp),%rdi
add    $0x3,%rdi
call   10e0 <strdup@plt>
mov    %rax,%rcx
mov    0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0x730(%rip),%rdi
call   1080 <printf@plt>
jmp    1921 <read_csv+0x761>
mov    -0x50(%rbp),%rdi
add    $0x3,%rdi
call   10e0 <strdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    19d4 <read_csv+0x814>
cmpl   $0x2,-0x7c(%rbp)
jne    19cf <read_csv+0x80f>
mov    -0x80(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x98(%rbp)
sub    $0x3,%eax
ja     19ca <read_csv+0x80a>
mov    -0x98(%rbp),%rax
lea    0x6aa(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x50(%rbp),%rdi
add    $0x3,%rdi
call   10e0 <strdup@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
jmp    19ca <read_csv+0x80a>
mov    -0x50(%rbp),%rdi
add    $0x3,%rdi
call   10e0 <strdup@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
jmp    19ca <read_csv+0x80a>
mov    -0x50(%rbp),%rdi
add    $0x3,%rdi
call   10e0 <strdup@plt>
mov    %rax,%rcx
mov    0x18(%rbp),%rax
mov    %rcx,(%rax)
jmp    19ca <read_csv+0x80a>
mov    -0x50(%rbp),%rdi
add    $0x3,%rdi
call   10e0 <strdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    19cf <read_csv+0x80f>
jmp    19d4 <read_csv+0x814>
jmp    1a7f <read_csv+0x8bf>
mov    -0x70(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x44,%eax
jne    1a7a <read_csv+0x8ba>
mov    -0x60(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x31,%eax
jne    1a7a <read_csv+0x8ba>
mov    -0x58(%rbp),%rdi
lea    0x713(%rip),%rsi
mov    $0x17,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1a7a <read_csv+0x8ba>
mov    -0x50(%rbp),%rdi
call   1060 <strlen@plt>
cmp    $0x5,%eax
jle    1a7a <read_csv+0x8ba>
cmpl   $0x1,-0x7c(%rbp)
jne    1a4f <read_csv+0x88f>
mov    -0x50(%rbp),%rdi
add    $0x2,%rdi
call   10e0 <strdup@plt>
mov    %rax,%rcx
mov    0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    1a75 <read_csv+0x8b5>
cmpl   $0x2,-0x7c(%rbp)
jne    1a70 <read_csv+0x8b0>
mov    -0x50(%rbp),%rdi
add    $0x2,%rdi
call   10e0 <strdup@plt>
mov    %rax,%rcx
mov    0x18(%rbp),%rax
mov    %rcx,(%rax)
jmp    1a75 <read_csv+0x8b5>
jmp    1a7a <read_csv+0x8ba>
jmp    1a7f <read_csv+0x8bf>
jmp    1a84 <read_csv+0x8c4>
jmp    1a89 <read_csv+0x8c9>
jmp    1a8e <read_csv+0x8ce>
jmp    1262 <read_csv+0xa2>
mov    -0x38(%rbp),%rdi
call   1050 <fclose@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_csv>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %r9,0x68(%rsp)
mov    %r8,0x58(%rsp)
mov    %rcx,0x70(%rsp)
mov    %rdx,0x60(%rsp)
mov    %rsi,0x40(%rsp)
mov    %rdi,%rbp
mov    0xc0(%rsp),%r12
mov    0xb8(%rsp),%rax
mov    %rax,0x50(%rsp)
mov    0xb0(%rsp),%rax
mov    %rax,0x48(%rsp)
lea    0xf12(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1b6d <read_csv+0x9bd>
mov    %rax,%r13
mov    %r12,%rdi
mov    $0x400,%esi
mov    %rax,%rdx
call   1090 <fgets@plt>
test   %rax,%rax
je     1b57 <read_csv+0x9a7>
lea    0xe86(%rip),%r14
xor    %eax,%eax
mov    %rax,0x18(%rsp)
xor    %eax,%eax
mov    %rax,0x10(%rsp)
xor    %eax,%eax
mov    %rax,0x28(%rsp)
xor    %eax,%eax
mov    %rax,0x30(%rsp)
xor    %r15d,%r15d
movl   $0x0,0xc(%rsp)
movl   $0x0,0x24(%rsp)
xor    %ebx,%ebx
jmp    12ae <read_csv+0xfe>
add    $0x8,%rbp
mov    %rbp,%rdi
mov    $0x2c,%esi
call   1070 <strchr@plt>
test   %rax,%rax
jne    16f7 <read_csv+0x547>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    $0x400,%esi
mov    %r13,%rdx
call   1090 <fgets@plt>
mov    $0x1,%ebx
test   %rax,%rax
je     1b57 <read_csv+0x9a7>
cmp    $0x1,%ebx
jne    139a <read_csv+0x1ea>
mov    %r12,%rdi
mov    $0x2c,%esi
call   1070 <strchr@plt>
test   %rax,%rax
je     1290 <read_csv+0xe0>
mov    %rax,%rbp
cmpb   $0x0,0x1(%rax)
je     1290 <read_csv+0xe0>
lea    0x1(%rbp),%rbx
mov    %rbx,%rdi
lea    0xda0(%rip),%rsi
mov    $0x7,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     1267 <read_csv+0xb7>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x6,%edx
call   1040 <strncmp@plt>
mov    $0x1,%ebx
test   %eax,%eax
jne    1862 <read_csv+0x6b2>
add    $0x7,%rbp
mov    %rbp,%rdi
mov    $0x2c,%esi
call   1070 <strchr@plt>
test   %rax,%rax
je     1290 <read_csv+0xe0>
mov    %rax,%rbp
lea    0x1(%rax),%r14
mov    %r14,%rdi
lea    0xd4e(%rip),%rsi
mov    $0xd,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     177f <read_csv+0x5cf>
mov    %r14,%rdi
lea    0xd40(%rip),%rsi
mov    $0xc,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     1880 <read_csv+0x6d0>
mov    %r14,%rdi
lea    0xd31(%rip),%rsi
mov    $0x9,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
jne    1773 <read_csv+0x5c3>
add    $0xd,%rbp
mov    %rbp,%rdi
call   10d0 <strdup@plt>
mov    0x50(%rsp),%rcx
jmp    1891 <read_csv+0x6e1>
test   %ebx,%ebx
je     146a <read_csv+0x2ba>
cmp    $0x2,%ebx
jne    1862 <read_csv+0x6b2>
mov    %r12,%rdi
mov    $0x2c,%esi
call   1070 <strchr@plt>
test   %rax,%rax
je     14a2 <read_csv+0x2f2>
mov    %rax,%r14
mov    %r15,0x38(%rsp)
movb   $0x0,(%rax)
add    $0x1,%r14
mov    %r14,%rdi
mov    $0x2c,%esi
call   1070 <strchr@plt>
test   %rax,%rax
mov    0xc(%rsp),%ebx
je     14c6 <read_csv+0x316>
mov    %rax,%r15
movb   $0x0,(%rax)
add    $0x1,%r15
mov    %r15,%rdi
mov    $0x2c,%esi
call   1070 <strchr@plt>
test   %rax,%rax
je     14cb <read_csv+0x31b>
mov    %rax,%rbp
movb   $0x0,(%rax)
add    $0x1,%rbp
mov    %rbp,%rdi
mov    $0x2c,%esi
call   1070 <strchr@plt>
test   %rax,%rax
je     14d0 <read_csv+0x320>
movb   $0x0,(%rax)
add    $0x1,%rax
mov    %rax,0x30(%rsp)
mov    %rax,%rdi
mov    $0x2c,%esi
call   1070 <strchr@plt>
test   %rax,%rax
je     14d0 <read_csv+0x320>
movb   $0x0,(%rax)
add    $0x1,%rax
mov    %rax,%rdi
mov    $0x2c,%esi
call   1070 <strchr@plt>
test   %rax,%rax
je     14d0 <read_csv+0x320>
movb   $0x0,(%rax)
jmp    14d0 <read_csv+0x320>
mov    %r12,%rdi
lea    0xbc0(%rip),%rsi
mov    $0x27,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     14bc <read_csv+0x30c>
mov    %r12,%rdi
lea    0xbd0(%rip),%rsi
mov    $0x23,%edx
call   1040 <strncmp@plt>
xor    %ebx,%ebx
test   %eax,%eax
sete   %bl
jmp    1862 <read_csv+0x6b2>
mov    %r15,0x38(%rsp)
mov    0x18(%rsp),%r14
mov    0x10(%rsp),%r15
mov    0x28(%rsp),%rbp
mov    0xc(%rsp),%ebx
jmp    14d0 <read_csv+0x320>
mov    $0x2,%ebx
jmp    1862 <read_csv+0x6b2>
mov    0x10(%rsp),%r15
mov    0x28(%rsp),%rbp
mov    %r14,%rdi
call   10b0 <atoi@plt>
mov    %eax,%ecx
cmp    0x24(%rsp),%eax
mov    $0x0,%eax
cmovne %eax,%ebx
mov    0x38(%rsp),%rdx
cmovne %eax,%edx
mov    %rdx,0x38(%rsp)
movzbl (%r12),%eax
cmp    $0x53,%al
jne    1525 <read_csv+0x375>
mov    %ecx,0x24(%rsp)
mov    %r15,%rdi
lea    0xbb7(%rip),%rsi
mov    $0x5,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     16b2 <read_csv+0x502>
movzbl (%r12),%eax
mov    0x24(%rsp),%ecx
mov    %ebx,0xc(%rsp)
mov    $0x2,%ebx
cmp    $0x44,%al
jne    169a <read_csv+0x4ea>
cmpb   $0x31,(%r15)
jne    1621 <read_csv+0x471>
mov    %ecx,0x24(%rsp)
mov    %rbp,%rdi
lea    0xb86(%rip),%rsi
mov    $0x6,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     1795 <read_csv+0x5e5>
cmpb   $0x44,(%r12)
jne    1847 <read_csv+0x697>
cmpb   $0x31,(%r15)
jne    1847 <read_csv+0x697>
mov    %rbp,%rdi
lea    0xb8a(%rip),%rsi
mov    $0xd,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    0x24(%rsp),%ecx
jne    1621 <read_csv+0x471>
mov    0x30(%rsp),%rdi
call   1060 <strlen@plt>
mov    0x24(%rsp),%ecx
cmp    $0x6,%eax
jl     1621 <read_csv+0x471>
mov    0xc(%rsp),%eax
cmp    $0x2,%eax
je     1995 <read_csv+0x7e5>
cmp    $0x1,%eax
jne    169a <read_csv+0x4ea>
mov    %rbp,0x28(%rsp)
movl   $0x1,0xc(%rsp)
mov    0x38(%rsp),%rbp
lea    -0x1(%rbp),%eax
cmp    $0x3,%eax
ja     19eb <read_csv+0x83b>
lea    0xa2d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x30(%rsp),%rbp
lea    0x3(%rbp),%rdi
call   10d0 <strdup@plt>
mov    0x60(%rsp),%rcx
mov    %rax,(%rcx)
movl   $0x1,0xc(%rsp)
mov    %r14,0x18(%rsp)
mov    %r15,0x10(%rsp)
mov    %rbp,%rax
mov    %rbp,0x30(%rsp)
jmp    18d2 <read_csv+0x722>
cmpb   $0x44,(%r12)
jne    169a <read_csv+0x4ea>
cmpb   $0x31,(%r15)
jne    169a <read_csv+0x4ea>
mov    %ecx,0x24(%rsp)
mov    %rbp,%rdi
lea    0xadb(%rip),%rsi
mov    $0x17,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
jne    1847 <read_csv+0x697>
mov    0x30(%rsp),%rdi
call   1060 <strlen@plt>
cmp    $0x6,%eax
jl     1847 <read_csv+0x697>
mov    0xc(%rsp),%eax
cmp    $0x2,%eax
je     195e <read_csv+0x7ae>
cmp    $0x1,%eax
jne    1847 <read_csv+0x697>
mov    0x30(%rsp),%rax
lea    0x2(%rax),%rdi
call   10d0 <strdup@plt>
mov    0x48(%rsp),%rcx
mov    %rax,(%rcx)
movl   $0x1,0xc(%rsp)
jmp    1847 <read_csv+0x697>
mov    %r14,0x18(%rsp)
mov    %r15,0x10(%rsp)
mov    %rbp,0x28(%rsp)
mov    %ecx,0x24(%rsp)
jmp    1856 <read_csv+0x6a6>
mov    %rbp,%rdi
lea    0xa0b(%rip),%rsi
mov    $0x6,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     183a <read_csv+0x68a>
mov    %rbp,%rdi
lea    0x9f6(%rip),%rsi
mov    $0x5,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    %ebx,%eax
mov    $0x2,%ebx
cmove  %ebx,%eax
mov    %eax,0xc(%rsp)
jmp    1847 <read_csv+0x697>
mov    %rax,%rbp
lea    0x1(%rax),%r14
mov    %r14,%rdi
lea    0x980(%rip),%rsi
mov    $0xd,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     189d <read_csv+0x6ed>
mov    %r14,%rdi
lea    0x972(%rip),%rsi
mov    $0xc,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     18b0 <read_csv+0x700>
mov    %r14,%rdi
lea    0x963(%rip),%rsi
mov    $0x9,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     18e1 <read_csv+0x731>
mov    %r14,%rdi
lea    0x951(%rip),%rsi
mov    $0xc,%edx
call   1040 <strncmp@plt>
mov    $0x1,%ebx
test   %eax,%eax
je     1927 <read_csv+0x777>
lea    0x940(%rip),%r14
jmp    1862 <read_csv+0x6b2>
add    $0x11,%rbp
mov    %rbp,%rdi
call   10d0 <strdup@plt>
mov    0x70(%rsp),%rcx
jmp    1891 <read_csv+0x6e1>
mov    0x30(%rsp),%rdi
lea    0x93a(%rip),%rsi
mov    $0xd,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     18c3 <read_csv+0x713>
mov    0x30(%rsp),%rdi
lea    0x929(%rip),%rsi
mov    $0xc,%edx
call   1040 <strncmp@plt>
mov    $0x2,%ebx
test   %eax,%eax
je     1906 <read_csv+0x756>
mov    0x30(%rsp),%rdi
lea    0x912(%rip),%rsi
mov    $0x9,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     193d <read_csv+0x78d>
mov    0x30(%rsp),%rdi
lea    0x8fd(%rip),%rsi
mov    $0xc,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    $0x4,%eax
mov    %rbp,%rcx
mov    0x38(%rsp),%rbp
cmove  %eax,%ebp
mov    %r14,0x18(%rsp)
mov    %r15,0x10(%rsp)
mov    %rcx,%rax
mov    %rcx,0x28(%rsp)
mov    %rbp,%r15
lea    0x882(%rip),%r14
jmp    1862 <read_csv+0x6b2>
movl   $0x1,0xc(%rsp)
mov    $0x2,%ebx
mov    %r14,0x18(%rsp)
mov    %r15,0x10(%rsp)
mov    %rbp,0x28(%rsp)
lea    0x85d(%rip),%r14
mov    0x38(%rsp),%r15
mov    %r12,%rdi
mov    $0x400,%esi
mov    %r13,%rdx
call   1090 <fgets@plt>
test   %rax,%rax
jne    12ae <read_csv+0xfe>
jmp    1b57 <read_csv+0x9a7>
add    $0x10,%rbp
mov    %rbp,%rdi
call   10d0 <strdup@plt>
mov    0x68(%rsp),%rcx
mov    %rax,(%rcx)
lea    0x81f(%rip),%r14
jmp    1862 <read_csv+0x6b2>
add    $0x11,%rbp
mov    %rbp,%rdi
call   10d0 <strdup@plt>
mov    0x60(%rsp),%rcx
jmp    18f2 <read_csv+0x742>
add    $0x10,%rbp
mov    %rbp,%rdi
call   10d0 <strdup@plt>
mov    0x58(%rsp),%rcx
jmp    18f2 <read_csv+0x742>
mov    %r14,0x18(%rsp)
mov    %r15,0x10(%rsp)
mov    %rbp,0x28(%rsp)
mov    $0x1,%r15d
lea    0x7db(%rip),%r14
jmp    1862 <read_csv+0x6b2>
add    $0xd,%rbp
mov    %rbp,%rdi
call   10d0 <strdup@plt>
mov    0x48(%rsp),%rcx
mov    %rax,(%rcx)
mov    $0x1,%ebx
lea    0x7b9(%rip),%r14
jmp    1862 <read_csv+0x6b2>
mov    %r14,0x18(%rsp)
mov    %r15,0x10(%rsp)
mov    %rbp,0x28(%rsp)
mov    $0x2,%r15d
lea    0x798(%rip),%r14
jmp    1862 <read_csv+0x6b2>
add    $0x10,%rbp
mov    %rbp,%rdi
call   10d0 <strdup@plt>
mov    0x40(%rsp),%rcx
jmp    1891 <read_csv+0x6e1>
mov    %r14,0x18(%rsp)
mov    %r15,0x10(%rsp)
mov    %rbp,0x28(%rsp)
mov    $0x3,%r15d
lea    0x761(%rip),%r14
jmp    1862 <read_csv+0x6b2>
mov    0x30(%rsp),%rax
lea    0x2(%rax),%rdi
call   10d0 <strdup@plt>
mov    0x50(%rsp),%rcx
mov    %rax,(%rcx)
mov    $0x2,%ebx
mov    %r14,0x18(%rsp)
mov    %r15,0x10(%rsp)
mov    %rbp,0x28(%rsp)
movl   $0x2,0xc(%rsp)
jmp    1856 <read_csv+0x6a6>
mov    %rbp,0x28(%rsp)
mov    $0x2,%ebx
mov    0x38(%rsp),%rbp
lea    -0x1(%rbp),%eax
cmp    $0x3,%eax
ja     1a96 <read_csv+0x8e6>
lea    0x649(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x30(%rsp),%rax
lea    0x3(%rax),%rdi
call   10d0 <strdup@plt>
mov    0x70(%rsp),%rcx
mov    %rax,(%rcx)
mov    %r14,0x18(%rsp)
mov    %r15,0x10(%rsp)
mov    $0x1,%r15d
jmp    1b43 <read_csv+0x993>
mov    %r14,0x18(%rsp)
mov    %r15,0x10(%rsp)
mov    %ecx,0x24(%rsp)
jmp    1aac <read_csv+0x8fc>
mov    0x30(%rsp),%rbp
lea    0x3(%rbp),%rdi
call   10d0 <strdup@plt>
mov    0x58(%rsp),%rcx
mov    %rax,(%rcx)
mov    $0x2,%ebx
mov    %r14,0x18(%rsp)
mov    %r15,0x10(%rsp)
mov    %rbp,%rax
mov    %rbp,0x30(%rsp)
jmp    1915 <read_csv+0x765>
mov    0x30(%rsp),%rax
lea    0x3(%rax),%rdi
call   10d0 <strdup@plt>
mov    0x48(%rsp),%rcx
mov    %rax,(%rcx)
lea    0x5e3(%rip),%rdi
mov    %rax,%rsi
call   1080 <printf@plt>
mov    %r14,0x18(%rsp)
mov    %r15,0x10(%rsp)
jmp    194c <read_csv+0x79c>
mov    0x30(%rsp),%rax
lea    0x3(%rax),%rdi
call   10d0 <strdup@plt>
mov    0x40(%rsp),%rcx
mov    %rax,(%rcx)
mov    %r14,0x18(%rsp)
mov    %r15,0x10(%rsp)
mov    $0x4,%r15d
lea    0x629(%rip),%r14
jmp    1862 <read_csv+0x6b2>
mov    %r14,0x18(%rsp)
mov    %r15,0x10(%rsp)
mov    %ecx,0x24(%rsp)
movl   $0x2,0xc(%rsp)
lea    0x607(%rip),%r14
mov    %rbp,%r15
jmp    1862 <read_csv+0x6b2>
mov    0x30(%rsp),%rbp
lea    0x3(%rbp),%rdi
call   10d0 <strdup@plt>
mov    0x68(%rsp),%rcx
mov    %rax,(%rcx)
mov    $0x2,%ebx
mov    %r14,0x18(%rsp)
mov    %r15,0x10(%rsp)
mov    %rbp,%rax
mov    %rbp,0x30(%rsp)
movl   $0x2,0xc(%rsp)
jmp    1915 <read_csv+0x765>
mov    0x30(%rsp),%rax
lea    0x3(%rax),%rdi
call   10d0 <strdup@plt>
mov    0x50(%rsp),%rcx
mov    %rax,(%rcx)
mov    %r14,0x18(%rsp)
mov    %r15,0x10(%rsp)
mov    $0x3,%r15d
jmp    1b43 <read_csv+0x993>
mov    0x30(%rsp),%rax
lea    0x3(%rax),%rdi
call   10d0 <strdup@plt>
mov    0x40(%rsp),%rcx
mov    %rax,(%rcx)
mov    %r14,0x18(%rsp)
mov    %r15,0x10(%rsp)
mov    $0x4,%r15d
movl   $0x2,0xc(%rsp)
lea    0x568(%rip),%r14
jmp    1862 <read_csv+0x6b2>
mov    %r13,%rdi
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <fclose@plt>
lea    0x4ac(%rip),%rdi
mov    %rbp,%rsi
call   1080 <printf@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [20 x i8] c"Cant open file: %s\0A\00"
@.str.2 = [40 x i8] c"L,0,PPP,Type,Identifier,Length,Protocol\00"
@.str.3 = [36 x i8] c"Index,Slave/Master,Type,Description\00"
@.str.4 = [8 x i8] c"Master,\00"
@.str.5 = [14 x i8] c"LMP_comb_key,\00"
@.str.6 = [13 x i8] c"LMP_au_rand,\00"
@.str.7 = [10 x i8] c"LMP_sres,\00"
@.str.8 = [13 x i8] c"LMP_in_rand,\00"
@.str.9 = [7 x i8] c"Slave,\00"
@.str.10 = [6 x i8] c"Frame\00"
@.str.11 = [7 x i8] c"Master\00"
@.str.12 = [6 x i8] c"Slave\00"
@.str.13 = [7 x i8] c"Opcode\00"
@.str.14 = [13 x i8] c"LMP_comb_key\00"
@.str.15 = [12 x i8] c"LMP_au_rand\00"
@.str.16 = [9 x i8] c"LMP_sres\00"
@.str.17 = [12 x i8] c"LMP_in_rand\00"
@.str.18 = [14 x i8] c"Random Number\00"
@.str.19 = [4 x i8] c"%s\0A\00"
@.str.20 = [24 x i8] c"Authentication Response\00"
define void @read_csv(i8* %0, i8** %1, i8** %2, i8** %3, i8** %4, i8** %5, i8** %6, i8** %7, i8* %8) {
%10 = alloca i8*
%11 = alloca i8**
%12 = alloca i8**
%13 = alloca i8**
%14 = alloca i8**
%15 = alloca i8**
%16 = alloca i8**
%17 = alloca i8**
%18 = alloca i8*
%19 = alloca i32*
%20 = alloca i8*
%21 = alloca [6 x i8*]
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
store i8* %0, i8** %10
store i8** %1, i8*** %11
store i8** %2, i8*** %12
store i8** %3, i8*** %13
store i8** %4, i8*** %14
store i8** %5, i8*** %15
store i8** %6, i8*** %16
store i8** %7, i8*** %17
store i8* %8, i8** %18
%27 = bitcast [6 x i8*]* %21 to i8*
store i32 0, i32* %22
store i32 0, i32* %23
store i32 0, i32* %24
store i32 0, i32* %25
%28 = load i8*, i8** %10
%29 = call i32* @fopen(i8* %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %29, i32** %19
%30 = load i32*, i32** %19
%31 = icmp ne i32* %30, null
br i1 %31, label %38, label %32
32: ; preds = %9
%33 = load i8*, i8** %10
%34 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %33)
%35 = load i8*, i8** %18
%36 = call i32 @free(i8* %35)
%37 = call i32 @exit(i32 -1)
unreachable
38: ; preds = %9
br label %39
39: ; preds = %410, %139, %82, %69, %63, %38
%40 = load i8*, i8** %18
%41 = load i32*, i32** %19
%42 = call i64 @fgets(i8* %40, i32 1024, i32* %41)
%43 = icmp ne i64 %42, 0
br i1 %43, label %44, label %411
44: ; preds = %39
%45 = load i32, i32* %22
switch i32 %45, label %410 [
i32 0, label %46
i32 1, label %58
i32 2, label %175
]
46: ; preds = %44
%47 = load i8*, i8** %18
%48 = call i32 @strncmp(i8* %47, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32 39)
%49 = icmp ne i32 %48, 0
br i1 %49, label %51, label %50
50: ; preds = %46
store i32 2, i32* %22
br label %57
51: ; preds = %46
%52 = load i8*, i8** %18
%53 = call i32 @strncmp(i8* %52, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i32 35)
%54 = icmp ne i32 %53, 0
br i1 %54, label %56, label %55
55: ; preds = %51
store i32 1, i32* %22
br label %56
56: ; preds = %55, %51
br label %57
57: ; preds = %56, %50
br label %410
58: ; preds = %44
%59 = load i8*, i8** %18
%60 = call i8* @strchr(i8* %59, i8 signext 44)
store i8* %60, i8** %20
%61 = load i8*, i8** %20
%62 = icmp ne i8* %61, null
br i1 %62, label %64, label %63
63: ; preds = %58
br label %39
64: ; preds = %58
%65 = load i8*, i8** %20
%66 = getelementptr inbounds i8, i8* %65, i32 1
store i8* %66, i8** %20
%67 = load i8, i8* %66
%68 = icmp ne i8 %67, 0
br i1 %68, label %70, label %69
69: ; preds = %64
br label %39
70: ; preds = %64
%71 = load i8*, i8** %20
%72 = call i32 @strncmp(i8* %71, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 7)
%73 = icmp ne i32 %72, 0
br i1 %73, label %127, label %74
74: ; preds = %70
%75 = load i8*, i8** %20
%76 = getelementptr inbounds i8, i8* %75, i64 7
store i8* %76, i8** %20
%77 = load i8*, i8** %20
%78 = call i8* @strchr(i8* %77, i8 signext 44)
store i8* %78, i8** %20
%79 = load i8*, i8** %20
%80 = getelementptr inbounds i8, i8* %79, i32 1
store i8* %80, i8** %20
%81 = icmp ne i8* %79, null
br i1 %81, label %83, label %82
82: ; preds = %74
br label %39
83: ; preds = %74
%84 = load i8*, i8** %20
%85 = call i32 @strncmp(i8* %84, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 13)
%86 = icmp ne i32 %85, 0
br i1 %86, label %93, label %87
87: ; preds = %83
%88 = load i8*, i8** %20
%89 = getelementptr inbounds i8, i8* %88, i64 16
store i8* %89, i8** %20
%90 = load i8*, i8** %20
%91 = call i8* @strdup(i8* %90)
%92 = load i8**, i8*** %12
store i8* %91, i8** %92
br label %126
93: ; preds = %83
%94 = load i8*, i8** %20
%95 = call i32 @strncmp(i8* %94, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 12)
%96 = icmp ne i32 %95, 0
br i1 %96, label %103, label %97
97: ; preds = %93
%98 = load i8*, i8** %20
%99 = getelementptr inbounds i8, i8* %98, i64 15
store i8* %99, i8** %20
%100 = load i8*, i8** %20
%101 = call i8* @strdup(i8* %100)
%102 = load i8**, i8*** %14
store i8* %101, i8** %102
br label %125
103: ; preds = %93
%104 = load i8*, i8** %20
%105 = call i32 @strncmp(i8* %104, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 9)
%106 = icmp ne i32 %105, 0
br i1 %106, label %113, label %107
107: ; preds = %103
%108 = load i8*, i8** %20
%109 = getelementptr inbounds i8, i8* %108, i64 12
store i8* %109, i8** %20
%110 = load i8*, i8** %20
%111 = call i8* @strdup(i8* %110)
%112 = load i8**, i8*** %16
store i8* %111, i8** %112
br label %124
113: ; preds = %103
%114 = load i8*, i8** %20
%115 = call i32 @strncmp(i8* %114, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 12)
%116 = icmp ne i32 %115, 0
br i1 %116, label %123, label %117
117: ; preds = %113
%118 = load i8*, i8** %20
%119 = getelementptr inbounds i8, i8* %118, i64 15
store i8* %119, i8** %20
%120 = load i8*, i8** %20
%121 = call i8* @strdup(i8* %120)
%122 = load i8**, i8*** %11
store i8* %121, i8** %122
br label %123
123: ; preds = %117, %113
br label %124
124: ; preds = %123, %107
br label %125
125: ; preds = %124, %97
br label %126
126: ; preds = %125, %87
br label %174
127: ; preds = %70
%128 = load i8*, i8** %20
%129 = call i32 @strncmp(i8* %128, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 6)
%130 = icmp ne i32 %129, 0
br i1 %130, label %173, label %131
131: ; preds = %127
%132 = load i8*, i8** %20
%133 = getelementptr inbounds i8, i8* %132, i64 6
store i8* %133, i8** %20
%134 = load i8*, i8** %20
%135 = call i8* @strchr(i8* %134, i8 signext 44)
store i8* %135, i8** %20
%136 = load i8*, i8** %20
%137 = getelementptr inbounds i8, i8* %136, i32 1
store i8* %137, i8** %20
%138 = icmp ne i8* %136, null
br i1 %138, label %140, label %139
139: ; preds = %131
br label %39
140: ; preds = %131
%141 = load i8*, i8** %20
%142 = call i32 @strncmp(i8* %141, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 13)
%143 = icmp ne i32 %142, 0
br i1 %143, label %150, label %144
144: ; preds = %140
%145 = load i8*, i8** %20
%146 = getelementptr inbounds i8, i8* %145, i64 16
store i8* %146, i8** %20
%147 = load i8*, i8** %20
%148 = call i8* @strdup(i8* %147)
%149 = load i8**, i8*** %13
store i8* %148, i8** %149
br label %172
150: ; preds = %140
%151 = load i8*, i8** %20
%152 = call i32 @strncmp(i8* %151, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 12)
%153 = icmp ne i32 %152, 0
br i1 %153, label %160, label %154
154: ; preds = %150
%155 = load i8*, i8** %20
%156 = getelementptr inbounds i8, i8* %155, i64 15
store i8* %156, i8** %20
%157 = load i8*, i8** %20
%158 = call i8* @strdup(i8* %157)
%159 = load i8**, i8*** %15
store i8* %158, i8** %159
br label %171
160: ; preds = %150
%161 = load i8*, i8** %20
%162 = call i32 @strncmp(i8* %161, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 9)
%163 = icmp ne i32 %162, 0
br i1 %163, label %170, label %164
164: ; preds = %160
%165 = load i8*, i8** %20
%166 = getelementptr inbounds i8, i8* %165, i64 12
store i8* %166, i8** %20
%167 = load i8*, i8** %20
%168 = call i8* @strdup(i8* %167)
%169 = load i8**, i8*** %17
store i8* %168, i8** %169
br label %170
170: ; preds = %164, %160
br label %171
171: ; preds = %170, %154
br label %172
172: ; preds = %171, %144
br label %173
173: ; preds = %172, %127
br label %174
174: ; preds = %173, %126
br label %410
175: ; preds = %44
%176 = load i8*, i8** %18
store i8* %176, i8** %20
store i32 0, i32* %26
br label %177
177: ; preds = %194, %175
%178 = load i32, i32* %26
%179 = icmp slt i32 %178, 6
br i1 %179, label %180, label %197
180: ; preds = %177
%181 = load i8*, i8** %20
%182 = load i32, i32* %26
%183 = sext i32 %182 to i64
%184 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 %183
store i8* %181, i8** %184
%185 = load i8*, i8** %20
%186 = call i8* @strchr(i8* %185, i8 signext 44)
store i8* %186, i8** %20
%187 = load i8*, i8** %20
%188 = icmp ne i8* %187, null
br i1 %188, label %190, label %189
189: ; preds = %180
br label %197
190: ; preds = %180
%191 = load i8*, i8** %20
store i8 0, i8* %191
%192 = load i8*, i8** %20
%193 = getelementptr inbounds i8, i8* %192, i32 1
store i8* %193, i8** %20
br label %194
194: ; preds = %190
%195 = load i32, i32* %26
%196 = add nsw i32 %195, 1
store i32 %196, i32* %26
br label %177
197: ; preds = %189, %177
%198 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 1
%199 = load i8*, i8** %198
%200 = call i32 @atoi(i8* %199)
%201 = load i32, i32* %23
%202 = icmp ne i32 %200, %201
br i1 %202, label %203, label %207
203: ; preds = %197
%204 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 1
%205 = load i8*, i8** %204
%206 = call i32 @atoi(i8* %205)
store i32 %206, i32* %23
store i32 0, i32* %24
store i32 0, i32* %25
br label %207
207: ; preds = %203, %197
%208 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 0
%209 = load i8*, i8** %208
%210 = load i8, i8* %209
%211 = sext i8 %210 to i32
%212 = icmp eq i32 %211, 83
br i1 %212, label %213, label %232
213: ; preds = %207
%214 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 2
%215 = load i8*, i8** %214
%216 = call i32 @strncmp(i8* %215, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i32 5)
%217 = icmp ne i32 %216, 0
br i1 %217, label %232, label %218
218: ; preds = %213
%219 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 3
%220 = load i8*, i8** %219
%221 = call i32 @strncmp(i8* %220, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i32 6)
%222 = icmp ne i32 %221, 0
br i1 %222, label %224, label %223
223: ; preds = %218
store i32 1, i32* %24
br label %231
224: ; preds = %218
%225 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 3
%226 = load i8*, i8** %225
%227 = call i32 @strncmp(i8* %226, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 5)
%228 = icmp ne i32 %227, 0
br i1 %228, label %230, label %229
229: ; preds = %224
store i32 2, i32* %24
br label %230
230: ; preds = %229, %224
br label %231
231: ; preds = %230, %223
br label %409
232: ; preds = %213, %207
%233 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 0
%234 = load i8*, i8** %233
%235 = load i8, i8* %234
%236 = sext i8 %235 to i32
%237 = icmp eq i32 %236, 68
br i1 %237, label %238, label %277
238: ; preds = %232
%239 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 2
%240 = load i8*, i8** %239
%241 = load i8, i8* %240
%242 = sext i8 %241 to i32
%243 = icmp eq i32 %242, 49
br i1 %243, label %244, label %277
244: ; preds = %238
%245 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 3
%246 = load i8*, i8** %245
%247 = call i32 @strncmp(i8* %246, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), i32 6)
%248 = icmp ne i32 %247, 0
br i1 %248, label %277, label %249
249: ; preds = %244
%250 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%251 = load i8*, i8** %250
%252 = call i32 @strncmp(i8* %251, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0), i32 13)
%253 = icmp ne i32 %252, 0
br i1 %253, label %255, label %254
254: ; preds = %249
store i32 1, i32* %25
br label %276
255: ; preds = %249
%256 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%257 = load i8*, i8** %256
%258 = call i32 @strncmp(i8* %257, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.15, i64 0, i64 0), i32 12)
%259 = icmp ne i32 %258, 0
br i1 %259, label %261, label %260
260: ; preds = %255
store i32 2, i32* %25
br label %275
261: ; preds = %255
%262 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%263 = load i8*, i8** %262
%264 = call i32 @strncmp(i8* %263, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i64 0, i64 0), i32 9)
%265 = icmp ne i32 %264, 0
br i1 %265, label %267, label %266
266: ; preds = %261
store i32 3, i32* %25
br label %274
267: ; preds = %261
%268 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%269 = load i8*, i8** %268
%270 = call i32 @strncmp(i8* %269, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.17, i64 0, i64 0), i32 12)
%271 = icmp ne i32 %270, 0
br i1 %271, label %273, label %272
272: ; preds = %267
store i32 4, i32* %25
br label %273
273: ; preds = %272, %267
br label %274
274: ; preds = %273, %266
br label %275
275: ; preds = %274, %260
br label %276
276: ; preds = %275, %254
br label %408
277: ; preds = %244, %238, %232
%278 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 0
%279 = load i8*, i8** %278
%280 = load i8, i8* %279
%281 = sext i8 %280 to i32
%282 = icmp eq i32 %281, 68
br i1 %282, label %283, label %364
283: ; preds = %277
%284 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 2
%285 = load i8*, i8** %284
%286 = load i8, i8* %285
%287 = sext i8 %286 to i32
%288 = icmp eq i32 %287, 49
br i1 %288, label %289, label %364
289: ; preds = %283
%290 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 3
%291 = load i8*, i8** %290
%292 = call i32 @strncmp(i8* %291, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.18, i64 0, i64 0), i32 13)
%293 = icmp ne i32 %292, 0
br i1 %293, label %364, label %294
294: ; preds = %289
%295 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%296 = load i8*, i8** %295
%297 = call i32 @strlen(i8* %296)
%298 = icmp sgt i32 %297, 5
br i1 %298, label %299, label %364
299: ; preds = %294
%300 = load i32, i32* %24
%301 = icmp eq i32 %300, 1
br i1 %301, label %302, label %332
302: ; preds = %299
%303 = load i32, i32* %25
switch i32 %303, label %331 [
i32 1, label %304
i32 2, label %310
i32 3, label %316
i32 4, label %325
]
304: ; preds = %302
%305 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%306 = load i8*, i8** %305
%307 = getelementptr inbounds i8, i8* %306, i64 3
%308 = call i8* @strdup(i8* %307)
%309 = load i8**, i8*** %12
store i8* %308, i8** %309
br label %331
310: ; preds = %302
%311 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%312 = load i8*, i8** %311
%313 = getelementptr inbounds i8, i8* %312, i64 3
%314 = call i8* @strdup(i8* %313)
%315 = load i8**, i8*** %14
store i8* %314, i8** %315
br label %331
316: ; preds = %302
%317 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%318 = load i8*, i8** %317
%319 = getelementptr inbounds i8, i8* %318, i64 3
%320 = call i8* @strdup(i8* %319)
%321 = load i8**, i8*** %16
store i8* %320, i8** %321
%322 = load i8**, i8*** %16
%323 = load i8*, i8** %322
%324 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0), i8* %323)
br label %331
325: ; preds = %302
%326 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%327 = load i8*, i8** %326
%328 = getelementptr inbounds i8, i8* %327, i64 3
%329 = call i8* @strdup(i8* %328)
%330 = load i8**, i8*** %11
store i8* %329, i8** %330
br label %331
331: ; preds = %302, %325, %316, %310, %304
br label %363
332: ; preds = %299
%333 = load i32, i32* %24
%334 = icmp eq i32 %333, 2
br i1 %334, label %335, label %362
335: ; preds = %332
%336 = load i32, i32* %25
switch i32 %336, label %361 [
i32 1, label %337
i32 2, label %343
i32 3, label %349
i32 4, label %355
]
337: ; preds = %335
%338 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%339 = load i8*, i8** %338
%340 = getelementptr inbounds i8, i8* %339, i64 3
%341 = call i8* @strdup(i8* %340)
%342 = load i8**, i8*** %13
store i8* %341, i8** %342
br label %361
343: ; preds = %335
%344 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%345 = load i8*, i8** %344
%346 = getelementptr inbounds i8, i8* %345, i64 3
%347 = call i8* @strdup(i8* %346)
%348 = load i8**, i8*** %15
store i8* %347, i8** %348
br label %361
349: ; preds = %335
%350 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%351 = load i8*, i8** %350
%352 = getelementptr inbounds i8, i8* %351, i64 3
%353 = call i8* @strdup(i8* %352)
%354 = load i8**, i8*** %17
store i8* %353, i8** %354
br label %361
355: ; preds = %335
%356 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%357 = load i8*, i8** %356
%358 = getelementptr inbounds i8, i8* %357, i64 3
%359 = call i8* @strdup(i8* %358)
%360 = load i8**, i8*** %11
store i8* %359, i8** %360
br label %361
361: ; preds = %335, %355, %349, %343, %337
br label %362
362: ; preds = %361, %332
br label %363
363: ; preds = %362, %331
br label %407
364: ; preds = %294, %289, %283, %277
%365 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 0
%366 = load i8*, i8** %365
%367 = load i8, i8* %366
%368 = sext i8 %367 to i32
%369 = icmp eq i32 %368, 68
br i1 %369, label %370, label %406
370: ; preds = %364
%371 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 2
%372 = load i8*, i8** %371
%373 = load i8, i8* %372
%374 = sext i8 %373 to i32
%375 = icmp eq i32 %374, 49
br i1 %375, label %376, label %406
376: ; preds = %370
%377 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 3
%378 = load i8*, i8** %377
%379 = call i32 @strncmp(i8* %378, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.20, i64 0, i64 0), i32 23)
%380 = icmp ne i32 %379, 0
br i1 %380, label %406, label %381
381: ; preds = %376
%382 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%383 = load i8*, i8** %382
%384 = call i32 @strlen(i8* %383)
%385 = icmp sgt i32 %384, 5
br i1 %385, label %386, label %406
386: ; preds = %381
%387 = load i32, i32* %24
%388 = icmp eq i32 %387, 1
br i1 %388, label %389, label %395
389: ; preds = %386
%390 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%391 = load i8*, i8** %390
%392 = getelementptr inbounds i8, i8* %391, i64 2
%393 = call i8* @strdup(i8* %392)
%394 = load i8**, i8*** %16
store i8* %393, i8** %394
br label %405
395: ; preds = %386
%396 = load i32, i32* %24
%397 = icmp eq i32 %396, 2
br i1 %397, label %398, label %404
398: ; preds = %395
%399 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%400 = load i8*, i8** %399
%401 = getelementptr inbounds i8, i8* %400, i64 2
%402 = call i8* @strdup(i8* %401)
%403 = load i8**, i8*** %17
store i8* %402, i8** %403
br label %404
404: ; preds = %398, %395
br label %405
405: ; preds = %404, %389
br label %406
406: ; preds = %405, %381, %376, %370, %364
br label %407
407: ; preds = %406, %363
br label %408
408: ; preds = %407, %276
br label %409
409: ; preds = %408, %231
br label %410
410: ; preds = %44, %409, %174, %57
br label %39
411: ; preds = %39
%412 = load i32*, i32** %19
%413 = call i32 @fclose(i32* %412)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [20 x i8] c"Cant open file: %s\0A\00"
@.str.2 = [40 x i8] c"L,0,PPP,Type,Identifier,Length,Protocol\00"
@.str.3 = [36 x i8] c"Index,Slave/Master,Type,Description\00"
@.str.4 = [8 x i8] c"Master,\00"
@.str.5 = [14 x i8] c"LMP_comb_key,\00"
@.str.6 = [13 x i8] c"LMP_au_rand,\00"
@.str.7 = [10 x i8] c"LMP_sres,\00"
@.str.8 = [13 x i8] c"LMP_in_rand,\00"
@.str.9 = [7 x i8] c"Slave,\00"
@.str.10 = [6 x i8] c"Frame\00"
@.str.11 = [7 x i8] c"Master\00"
@.str.12 = [6 x i8] c"Slave\00"
@.str.13 = [7 x i8] c"Opcode\00"
@.str.14 = [13 x i8] c"LMP_comb_key\00"
@.str.15 = [12 x i8] c"LMP_au_rand\00"
@.str.16 = [9 x i8] c"LMP_sres\00"
@.str.17 = [12 x i8] c"LMP_in_rand\00"
@.str.18 = [14 x i8] c"Random Number\00"
@.str.19 = [4 x i8] c"%s\0A\00"
@.str.20 = [24 x i8] c"Authentication Response\00"
define void @read_csv(i8* %0, i8** nocapture writeonly %1, i8** nocapture writeonly %2, i8** nocapture writeonly %3, i8** nocapture writeonly %4, i8** nocapture writeonly %5, i8** nocapture writeonly %6, i8** nocapture writeonly %7, i8* %8) {
%10 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i32* %10, null
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = tail call i64 @fgets(i8* %8, i32 1024, i32* %10)
%14 = icmp eq i64 %13, 0
br i1 %14, label %244, label %235
15: ; preds = %9
%16 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%17 = tail call i32 @free(i8* %8)
%18 = tail call i32 @exit(i32 -1)
unreachable
19: ; preds = %235, %34
%20 = phi i32 [ %243, %235 ], [ 1, %34 ]
switch i32 %20, label %224 [
i32 0, label %24
i32 1, label %31
i32 2, label %21
]
21: ; preds = %19
%22 = tail call i8* @strchr(i8* dereferenceable(1) %8, i8 signext 44)
%23 = icmp eq i8* %22, null
br i1 %23, label %120, label %99
24: ; preds = %19
%25 = tail call i32 @strncmp(i8* %8, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32 39)
%26 = icmp eq i32 %25, 0
br i1 %26, label %224, label %27
27: ; preds = %24
%28 = tail call i32 @strncmp(i8* %8, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i32 35)
%29 = icmp eq i32 %28, 0
%30 = zext i1 %29 to i32
br label %224
31: ; preds = %19
%32 = tail call i8* @strchr(i8* dereferenceable(1) %8, i8 signext 44)
%33 = icmp eq i8* %32, null
br i1 %33, label %34, label %37
34: ; preds = %31, %37, %44, %76
%35 = tail call i64 @fgets(i8* %8, i32 1024, i32* %10)
%36 = icmp eq i64 %35, 0
br i1 %36, label %244, label %19
37: ; preds = %31
%38 = getelementptr inbounds i8, i8* %32, i64 1
%39 = load i8, i8* %38
%40 = icmp eq i8 %39, 0
br i1 %40, label %34, label %41
41: ; preds = %37
%42 = tail call i32 @strncmp(i8* %38, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 7)
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %73
44: ; preds = %41
%45 = getelementptr inbounds i8, i8* %32, i64 8
%46 = tail call i8* @strchr(i8* %45, i8 signext 44)
%47 = icmp eq i8* %46, null
br i1 %47, label %34, label %48
48: ; preds = %44
%49 = getelementptr inbounds i8, i8* %46, i64 1
%50 = tail call i32 @strncmp(i8* %49, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 13)
%51 = icmp eq i32 %50, 0
br i1 %51, label %52, label %55
52: ; preds = %48
%53 = getelementptr inbounds i8, i8* %46, i64 17
%54 = tail call i8* @strdup(i8* %53)
store i8* %54, i8** %2
br label %224
55: ; preds = %48
%56 = tail call i32 @strncmp(i8* %49, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 12)
%57 = icmp eq i32 %56, 0
br i1 %57, label %58, label %61
58: ; preds = %55
%59 = getelementptr inbounds i8, i8* %46, i64 16
%60 = tail call i8* @strdup(i8* %59)
store i8* %60, i8** %4
br label %224
61: ; preds = %55
%62 = tail call i32 @strncmp(i8* %49, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 9)
%63 = icmp eq i32 %62, 0
br i1 %63, label %64, label %67
64: ; preds = %61
%65 = getelementptr inbounds i8, i8* %46, i64 13
%66 = tail call i8* @strdup(i8* %65)
store i8* %66, i8** %6
br label %224
67: ; preds = %61
%68 = tail call i32 @strncmp(i8* %49, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 12)
%69 = icmp eq i32 %68, 0
br i1 %69, label %70, label %224
70: ; preds = %67
%71 = getelementptr inbounds i8, i8* %46, i64 16
%72 = tail call i8* @strdup(i8* %71)
store i8* %72, i8** %1
br label %224
73: ; preds = %41
%74 = tail call i32 @strncmp(i8* %38, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 6)
%75 = icmp eq i32 %74, 0
br i1 %75, label %76, label %224
76: ; preds = %73
%77 = getelementptr inbounds i8, i8* %32, i64 7
%78 = tail call i8* @strchr(i8* %77, i8 signext 44)
%79 = icmp eq i8* %78, null
br i1 %79, label %34, label %80
80: ; preds = %76
%81 = getelementptr inbounds i8, i8* %78, i64 1
%82 = tail call i32 @strncmp(i8* %81, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 13)
%83 = icmp eq i32 %82, 0
br i1 %83, label %84, label %87
84: ; preds = %80
%85 = getelementptr inbounds i8, i8* %78, i64 17
%86 = tail call i8* @strdup(i8* %85)
store i8* %86, i8** %3
br label %224
87: ; preds = %80
%88 = tail call i32 @strncmp(i8* %81, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 12)
%89 = icmp eq i32 %88, 0
br i1 %89, label %90, label %93
90: ; preds = %87
%91 = getelementptr inbounds i8, i8* %78, i64 16
%92 = tail call i8* @strdup(i8* %91)
store i8* %92, i8** %5
br label %224
93: ; preds = %87
%94 = tail call i32 @strncmp(i8* %81, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 9)
%95 = icmp eq i32 %94, 0
br i1 %95, label %96, label %224
96: ; preds = %93
%97 = getelementptr inbounds i8, i8* %78, i64 13
%98 = tail call i8* @strdup(i8* %97)
store i8* %98, i8** %7
br label %224
99: ; preds = %21
store i8 0, i8* %22
%100 = getelementptr inbounds i8, i8* %22, i64 1
%101 = tail call i8* @strchr(i8* dereferenceable(1) %100, i8 signext 44)
%102 = icmp eq i8* %101, null
br i1 %102, label %120, label %103
103: ; preds = %99
store i8 0, i8* %101
%104 = getelementptr inbounds i8, i8* %101, i64 1
%105 = tail call i8* @strchr(i8* dereferenceable(1) %104, i8 signext 44)
%106 = icmp eq i8* %105, null
br i1 %106, label %120, label %107
107: ; preds = %103
store i8 0, i8* %105
%108 = getelementptr inbounds i8, i8* %105, i64 1
%109 = tail call i8* @strchr(i8* dereferenceable(1) %108, i8 signext 44)
%110 = icmp eq i8* %109, null
br i1 %110, label %120, label %111
111: ; preds = %107
store i8 0, i8* %109
%112 = getelementptr inbounds i8, i8* %109, i64 1
%113 = tail call i8* @strchr(i8* dereferenceable(1) %112, i8 signext 44)
%114 = icmp eq i8* %113, null
br i1 %114, label %120, label %115
115: ; preds = %111
store i8 0, i8* %113
%116 = getelementptr inbounds i8, i8* %113, i64 1
%117 = tail call i8* @strchr(i8* dereferenceable(1) %116, i8 signext 44)
%118 = icmp eq i8* %117, null
br i1 %118, label %120, label %119
119: ; preds = %115
store i8 0, i8* %117
br label %120
120: ; preds = %119, %115, %111, %107, %103, %99, %21
%121 = phi i8* [ %236, %21 ], [ %100, %99 ], [ %100, %103 ], [ %100, %107 ], [ %100, %111 ], [ %100, %115 ], [ %100, %119 ]
%122 = phi i8* [ %237, %21 ], [ %237, %99 ], [ %104, %103 ], [ %104, %107 ], [ %104, %111 ], [ %104, %115 ], [ %104, %119 ]
%123 = phi i8* [ %238, %21 ], [ %238, %99 ], [ %238, %103 ], [ %108, %107 ], [ %108, %111 ], [ %108, %115 ], [ %108, %119 ]
%124 = phi i8* [ %239, %21 ], [ %239, %99 ], [ %239, %103 ], [ %239, %107 ], [ %112, %111 ], [ %112, %115 ], [ %112, %119 ]
%125 = tail call i32 @atoi(i8* %121)
%126 = icmp eq i32 %125, %242
%127 = select i1 %126, i32 %241, i32 0
%128 = select i1 %126, i32 %240, i32 0
%129 = load i8, i8* %8
%130 = icmp eq i8 %129, 83
br i1 %130, label %131, label %143
131: ; preds = %120
%132 = tail call i32 @strncmp(i8* %122, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i32 5)
%133 = icmp eq i32 %132, 0
br i1 %133, label %134, label %141
134: ; preds = %131
%135 = tail call i32 @strncmp(i8* %123, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i32 6)
%136 = icmp eq i32 %135, 0
br i1 %136, label %224, label %137
137: ; preds = %134
%138 = tail call i32 @strncmp(i8* %123, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 5)
%139 = icmp eq i32 %138, 0
%140 = select i1 %139, i32 2, i32 %127
br label %224
141: ; preds = %131
%142 = load i8, i8* %8
br label %143
143: ; preds = %141, %120
%144 = phi i8 [ %142, %141 ], [ %129, %120 ]
%145 = icmp eq i8 %144, 68
br i1 %145, label %146, label %224
146: ; preds = %143
%147 = load i8, i8* %122
%148 = icmp eq i8 %147, 49
br i1 %148, label %149, label %205
149: ; preds = %146
%150 = tail call i32 @strncmp(i8* %123, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), i32 6)
%151 = icmp eq i32 %150, 0
br i1 %151, label %152, label %165
152: ; preds = %149
%153 = tail call i32 @strncmp(i8* %124, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0), i32 13)
%154 = icmp eq i32 %153, 0
br i1 %154, label %224, label %155
155: ; preds = %152
%156 = tail call i32 @strncmp(i8* %124, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.15, i64 0, i64 0), i32 12)
%157 = icmp eq i32 %156, 0
br i1 %157, label %224, label %158
158: ; preds = %155
%159 = tail call i32 @strncmp(i8* %124, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i64 0, i64 0), i32 9)
%160 = icmp eq i32 %159, 0
br i1 %160, label %224, label %161
161: ; preds = %158
%162 = tail call i32 @strncmp(i8* %124, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.17, i64 0, i64 0), i32 12)
%163 = icmp eq i32 %162, 0
%164 = select i1 %163, i32 4, i32 %128
br label %224
165: ; preds = %149
%166 = load i8, i8* %8
%167 = icmp eq i8 %166, 68
br i1 %167, label %168, label %224
168: ; preds = %165
%169 = load i8, i8* %122
%170 = icmp eq i8 %169, 49
br i1 %170, label %171, label %224
171: ; preds = %168
%172 = tail call i32 @strncmp(i8* %123, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.18, i64 0, i64 0), i32 13)
%173 = icmp eq i32 %172, 0
br i1 %173, label %174, label %205
174: ; preds = %171
%175 = tail call i32 @strlen(i8* %124)
%176 = icmp sgt i32 %175, 5
br i1 %176, label %177, label %205
177: ; preds = %174
switch i32 %127, label %224 [
i32 1, label %178
i32 2, label %192
]
178: ; preds = %177
switch i32 %128, label %224 [
i32 1, label %179
i32 2, label %182
i32 3, label %185
i32 4, label %189
]
179: ; preds = %178
%180 = getelementptr inbounds i8, i8* %124, i64 3
%181 = tail call i8* @strdup(i8* %180)
store i8* %181, i8** %2
br label %224
182: ; preds = %178
%183 = getelementptr inbounds i8, i8* %124, i64 3
%184 = tail call i8* @strdup(i8* %183)
store i8* %184, i8** %4
br label %224
185: ; preds = %178
%186 = getelementptr inbounds i8, i8* %124, i64 3
%187 = tail call i8* @strdup(i8* %186)
store i8* %187, i8** %6
%188 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0), i8* %187)
br label %224
189: ; preds = %178
%190 = getelementptr inbounds i8, i8* %124, i64 3
%191 = tail call i8* @strdup(i8* %190)
store i8* %191, i8** %1
br label %224
192: ; preds = %177
switch i32 %128, label %224 [
i32 1, label %193
i32 2, label %196
i32 3, label %199
i32 4, label %202
]
193: ; preds = %192
%194 = getelementptr inbounds i8, i8* %124, i64 3
%195 = tail call i8* @strdup(i8* %194)
store i8* %195, i8** %3
br label %224
196: ; preds = %192
%197 = getelementptr inbounds i8, i8* %124, i64 3
%198 = tail call i8* @strdup(i8* %197)
store i8* %198, i8** %5
br label %224
199: ; preds = %192
%200 = getelementptr inbounds i8, i8* %124, i64 3
%201 = tail call i8* @strdup(i8* %200)
store i8* %201, i8** %7
br label %224
202: ; preds = %192
%203 = getelementptr inbounds i8, i8* %124, i64 3
%204 = tail call i8* @strdup(i8* %203)
store i8* %204, i8** %1
br label %224
205: ; preds = %146, %174, %171
%206 = load i8, i8* %8
%207 = icmp eq i8 %206, 68
br i1 %207, label %208, label %224
208: ; preds = %205
%209 = load i8, i8* %122
%210 = icmp eq i8 %209, 49
br i1 %210, label %211, label %224
211: ; preds = %208
%212 = tail call i32 @strncmp(i8* %123, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.20, i64 0, i64 0), i32 23)
%213 = icmp eq i32 %212, 0
br i1 %213, label %214, label %224
214: ; preds = %211
%215 = tail call i32 @strlen(i8* %124)
%216 = icmp sgt i32 %215, 5
br i1 %216, label %217, label %224
217: ; preds = %214
switch i32 %127, label %224 [
i32 1, label %218
i32 2, label %221
]
218: ; preds = %217
%219 = getelementptr inbounds i8, i8* %124, i64 2
%220 = tail call i8* @strdup(i8* %219)
store i8* %220, i8** %6
br label %224
221: ; preds = %217
%222 = getelementptr inbounds i8, i8* %124, i64 2
%223 = tail call i8* @strdup(i8* %222)
store i8* %223, i8** %7
br label %224
224: ; preds = %73, %19, %168, %143, %165, %161, %137, %27, %217, %177, %158, %155, %152, %134, %24, %192, %202, %199, %196, %193, %179, %182, %185, %189, %178, %218, %221, %214, %211, %208, %205, %58, %67, %70, %64, %52, %84, %93, %96, %90
%225 = phi i8* [ %121, %134 ], [ %121, %137 ], [ %121, %152 ], [ %121, %155 ], [ %121, %158 ], [ %121, %161 ], [ %121, %177 ], [ %121, %192 ], [ %121, %202 ], [ %121, %199 ], [ %121, %196 ], [ %121, %193 ], [ %121, %178 ], [ %121, %189 ], [ %121, %185 ], [ %121, %182 ], [ %121, %179 ], [ %121, %217 ], [ %121, %221 ], [ %121, %218 ], [ %121, %214 ], [ %121, %211 ], [ %121, %208 ], [ %121, %205 ], [ %121, %165 ], [ %236, %52 ], [ %236, %58 ], [ %236, %64 ], [ %236, %70 ], [ %236, %67 ], [ %236, %84 ], [ %236, %90 ], [ %236, %96 ], [ %236, %93 ], [ %236, %24 ], [ %236, %27 ], [ %121, %143 ], [ %121, %168 ], [ %236, %19 ], [ %236, %73 ]
%226 = phi i8* [ %122, %134 ], [ %122, %137 ], [ %122, %152 ], [ %122, %155 ], [ %122, %158 ], [ %122, %161 ], [ %122, %177 ], [ %122, %192 ], [ %122, %202 ], [ %122, %199 ], [ %122, %196 ], [ %122, %193 ], [ %122, %178 ], [ %122, %189 ], [ %122, %185 ], [ %122, %182 ], [ %122, %179 ], [ %122, %217 ], [ %122, %221 ], [ %122, %218 ], [ %122, %214 ], [ %122, %211 ], [ %122, %208 ], [ %122, %205 ], [ %122, %165 ], [ %237, %52 ], [ %237, %58 ], [ %237, %64 ], [ %237, %70 ], [ %237, %67 ], [ %237, %84 ], [ %237, %90 ], [ %237, %96 ], [ %237, %93 ], [ %237, %24 ], [ %237, %27 ], [ %122, %143 ], [ %122, %168 ], [ %237, %19 ], [ %237, %73 ]
%227 = phi i8* [ %123, %134 ], [ %123, %137 ], [ %123, %152 ], [ %123, %155 ], [ %123, %158 ], [ %123, %161 ], [ %123, %177 ], [ %123, %192 ], [ %123, %202 ], [ %123, %199 ], [ %123, %196 ], [ %123, %193 ], [ %123, %178 ], [ %123, %189 ], [ %123, %185 ], [ %123, %182 ], [ %123, %179 ], [ %123, %217 ], [ %123, %221 ], [ %123, %218 ], [ %123, %214 ], [ %123, %211 ], [ %123, %208 ], [ %123, %205 ], [ %123, %165 ], [ %238, %52 ], [ %238, %58 ], [ %238, %64 ], [ %238, %70 ], [ %238, %67 ], [ %238, %84 ], [ %238, %90 ], [ %238, %96 ], [ %238, %93 ], [ %238, %24 ], [ %238, %27 ], [ %123, %143 ], [ %123, %168 ], [ %238, %19 ], [ %238, %73 ]
%228 = phi i8* [ %124, %134 ], [ %124, %137 ], [ %124, %152 ], [ %124, %155 ], [ %124, %158 ], [ %124, %161 ], [ %124, %177 ], [ %124, %192 ], [ %124, %202 ], [ %124, %199 ], [ %124, %196 ], [ %124, %193 ], [ %124, %178 ], [ %124, %189 ], [ %124, %185 ], [ %124, %182 ], [ %124, %179 ], [ %124, %217 ], [ %124, %221 ], [ %124, %218 ], [ %124, %214 ], [ %124, %211 ], [ %124, %208 ], [ %124, %205 ], [ %124, %165 ], [ %239, %52 ], [ %239, %58 ], [ %239, %64 ], [ %239, %70 ], [ %239, %67 ], [ %239, %84 ], [ %239, %90 ], [ %239, %96 ], [ %239, %93 ], [ %239, %24 ], [ %239, %27 ], [ %124, %143 ], [ %124, %168 ], [ %239, %19 ], [ %239, %73 ]
%229 = phi i32 [ 2, %134 ], [ 2, %137 ], [ 2, %152 ], [ 2, %155 ], [ 2, %158 ], [ 2, %161 ], [ 2, %177 ], [ 2, %192 ], [ 2, %202 ], [ 2, %199 ], [ 2, %196 ], [ 2, %193 ], [ 2, %178 ], [ 2, %189 ], [ 2, %185 ], [ 2, %182 ], [ 2, %179 ], [ 2, %217 ], [ 2, %221 ], [ 2, %218 ], [ 2, %214 ], [ 2, %211 ], [ 2, %208 ], [ 2, %205 ], [ 2, %165 ], [ 1, %52 ], [ 1, %58 ], [ 1, %64 ], [ 1, %70 ], [ 1, %67 ], [ 1, %84 ], [ 1, %90 ], [ 1, %96 ], [ 1, %93 ], [ 2, %24 ], [ %30, %27 ], [ 2, %143 ], [ 2, %168 ], [ 1, %73 ], [ %20, %19 ]
%230 = phi i32 [ %125, %134 ], [ %125, %137 ], [ %125, %152 ], [ %125, %155 ], [ %125, %158 ], [ %125, %161 ], [ %125, %177 ], [ %125, %192 ], [ %125, %202 ], [ %125, %199 ], [ %125, %196 ], [ %125, %193 ], [ %125, %178 ], [ %125, %189 ], [ %125, %185 ], [ %125, %182 ], [ %125, %179 ], [ %125, %217 ], [ %125, %221 ], [ %125, %218 ], [ %125, %214 ], [ %125, %211 ], [ %125, %208 ], [ %125, %205 ], [ %125, %165 ], [ %242, %52 ], [ %242, %58 ], [ %242, %64 ], [ %242, %70 ], [ %242, %67 ], [ %242, %84 ], [ %242, %90 ], [ %242, %96 ], [ %242, %93 ], [ %242, %24 ], [ %242, %27 ], [ %125, %143 ], [ %125, %168 ], [ %242, %19 ], [ %242, %73 ]
%231 = phi i32 [ 1, %134 ], [ %140, %137 ], [ %127, %152 ], [ %127, %155 ], [ %127, %158 ], [ %127, %161 ], [ %127, %177 ], [ 2, %192 ], [ 2, %202 ], [ 2, %199 ], [ 2, %196 ], [ 2, %193 ], [ 1, %178 ], [ 1, %189 ], [ 1, %185 ], [ 1, %182 ], [ 1, %179 ], [ %127, %217 ], [ 2, %221 ], [ 1, %218 ], [ %127, %214 ], [ %127, %211 ], [ %127, %208 ], [ %127, %205 ], [ %127, %165 ], [ %241, %52 ], [ %241, %58 ], [ %241, %64 ], [ %241, %70 ], [ %241, %67 ], [ %241, %84 ], [ %241, %90 ], [ %241, %96 ], [ %241, %93 ], [ %241, %24 ], [ %241, %27 ], [ %127, %143 ], [ %127, %168 ], [ %241, %19 ], [ %241, %73 ]
%232 = phi i32 [ %128, %134 ], [ %128, %137 ], [ 1, %152 ], [ 2, %155 ], [ 3, %158 ], [ %164, %161 ], [ %128, %177 ], [ %128, %192 ], [ 4, %202 ], [ 3, %199 ], [ 2, %196 ], [ 1, %193 ], [ %128, %178 ], [ 4, %189 ], [ 3, %185 ], [ 2, %182 ], [ 1, %179 ], [ %128, %217 ], [ %128, %221 ], [ %128, %218 ], [ %128, %214 ], [ %128, %211 ], [ %128, %208 ], [ %128, %205 ], [ %128, %165 ], [ %240, %52 ], [ %240, %58 ], [ %240, %64 ], [ %240, %70 ], [ %240, %67 ], [ %240, %84 ], [ %240, %90 ], [ %240, %96 ], [ %240, %93 ], [ %240, %24 ], [ %240, %27 ], [ %128, %143 ], [ %128, %168 ], [ %240, %19 ], [ %240, %73 ]
%233 = tail call i64 @fgets(i8* %8, i32 1024, i32* %10)
%234 = icmp eq i64 %233, 0
br i1 %234, label %244, label %235
235: ; preds = %12, %224
%236 = phi i8* [ %225, %224 ], [ null, %12 ]
%237 = phi i8* [ %226, %224 ], [ null, %12 ]
%238 = phi i8* [ %227, %224 ], [ null, %12 ]
%239 = phi i8* [ %228, %224 ], [ null, %12 ]
%240 = phi i32 [ %232, %224 ], [ 0, %12 ]
%241 = phi i32 [ %231, %224 ], [ 0, %12 ]
%242 = phi i32 [ %230, %224 ], [ 0, %12 ]
%243 = phi i32 [ %229, %224 ], [ 0, %12 ]
br label %19
244: ; preds = %224, %34, %12
%245 = tail call i32 @fclose(i32* %10)
ret void
}