#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];
  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)
movl   $0x0,-0x74(%rbp)
movl   $0x0,-0x78(%rbp)
movl   $0x0,-0x7c(%rbp)
movl   $0x0,-0x80(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xf0f(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    123d <read_csv+0x8d>
mov    -0x8(%rbp),%rsi
lea    0xdfb(%rip),%rdi
call   1080 <printf@plt>
mov    0x20(%rbp),%rdi
call   1030 <free@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
jmp    1242 <read_csv+0x92>
mov    0x20(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    $0x400,%esi
call   1090 <fgets@plt>
cmp    $0x0,%rax
je     1a73 <read_csv+0x8c3>
mov    -0x74(%rbp),%eax
mov    %eax,-0x88(%rbp)
test   %eax,%eax
je     129c <read_csv+0xec>
jmp    1274 <read_csv+0xc4>
mov    -0x88(%rbp),%eax
sub    $0x1,%eax
je     12f5 <read_csv+0x145>
jmp    1288 <read_csv+0xd8>
mov    -0x88(%rbp),%eax
sub    $0x2,%eax
je     15da <read_csv+0x42a>
jmp    1a6e <read_csv+0x8be>
mov    0x20(%rbp),%rdi
lea    0xd8d(%rip),%rsi
mov    $0x27,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    12c6 <read_csv+0x116>
movl   $0x2,-0x74(%rbp)
jmp    12f0 <read_csv+0x140>
mov    0x20(%rbp),%rdi
lea    0xd8b(%rip),%rsi
mov    $0x23,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    12eb <read_csv+0x13b>
movl   $0x1,-0x74(%rbp)
jmp    12f0 <read_csv+0x140>
jmp    1a6e <read_csv+0x8be>
mov    0x20(%rbp),%rdi
mov    $0x2c,%esi
call   1070 <strchr@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    1317 <read_csv+0x167>
jmp    1242 <read_csv+0x92>
mov    -0x40(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x40(%rbp)
cmpb   $0x0,0x1(%rax)
jne    1335 <read_csv+0x185>
jmp    1242 <read_csv+0x92>
mov    -0x40(%rbp),%rdi
lea    0xd40(%rip),%rsi
mov    $0x7,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    14a6 <read_csv+0x2f6>
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    138f <read_csv+0x1df>
jmp    1242 <read_csv+0x92>
mov    -0x40(%rbp),%rdi
lea    0xcee(%rip),%rsi
mov    $0xd,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    13d1 <read_csv+0x221>
mov    -0x40(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
call   10d0 <strdup@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
jmp    14a1 <read_csv+0x2f1>
mov    -0x40(%rbp),%rdi
lea    0xcba(%rip),%rsi
mov    $0xc,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1413 <read_csv+0x263>
mov    -0x40(%rbp),%rax
add    $0xf,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
call   10d0 <strdup@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
jmp    149c <read_csv+0x2ec>
mov    -0x40(%rbp),%rdi
lea    0xc85(%rip),%rsi
mov    $0x9,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1455 <read_csv+0x2a5>
mov    -0x40(%rbp),%rax
add    $0xc,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
call   10d0 <strdup@plt>
mov    %rax,%rcx
mov    0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    1497 <read_csv+0x2e7>
mov    -0x40(%rbp),%rdi
lea    0xc4d(%rip),%rsi
mov    $0xc,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1492 <read_csv+0x2e2>
mov    -0x40(%rbp),%rax
add    $0xf,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
call   10d0 <strdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    1497 <read_csv+0x2e7>
jmp    149c <read_csv+0x2ec>
jmp    14a1 <read_csv+0x2f1>
jmp    15d5 <read_csv+0x425>
mov    -0x40(%rbp),%rdi
lea    0xc09(%rip),%rsi
mov    $0x6,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    15d0 <read_csv+0x420>
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    1500 <read_csv+0x350>
jmp    1242 <read_csv+0x92>
mov    -0x40(%rbp),%rdi
lea    0xb7d(%rip),%rsi
mov    $0xd,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1542 <read_csv+0x392>
mov    -0x40(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
call   10d0 <strdup@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
jmp    15cb <read_csv+0x41b>
mov    -0x40(%rbp),%rdi
lea    0xb49(%rip),%rsi
mov    $0xc,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1584 <read_csv+0x3d4>
mov    -0x40(%rbp),%rax
add    $0xf,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
call   10d0 <strdup@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
jmp    15c6 <read_csv+0x416>
mov    -0x40(%rbp),%rdi
lea    0xb14(%rip),%rsi
mov    $0x9,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    15c1 <read_csv+0x411>
mov    -0x40(%rbp),%rax
add    $0xc,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
call   10d0 <strdup@plt>
mov    %rax,%rcx
mov    0x18(%rbp),%rax
mov    %rcx,(%rax)
jmp    15c6 <read_csv+0x416>
jmp    15cb <read_csv+0x41b>
jmp    15d0 <read_csv+0x420>
jmp    15d5 <read_csv+0x425>
jmp    1a6e <read_csv+0x8be>
mov    0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x84(%rbp)
cmpl   $0x6,-0x84(%rbp)
jge    1652 <read_csv+0x4a2>
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    162b <read_csv+0x47b>
jmp    1652 <read_csv+0x4a2>
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    15ec <read_csv+0x43c>
mov    -0x68(%rbp),%rdi
call   10b0 <atoi@plt>
cmp    -0x78(%rbp),%eax
je     167e <read_csv+0x4ce>
mov    -0x68(%rbp),%rdi
call   10b0 <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    1705 <read_csv+0x555>
mov    -0x60(%rbp),%rdi
lea    0xa28(%rip),%rsi
mov    $0x5,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1705 <read_csv+0x555>
mov    -0x58(%rbp),%rdi
lea    0xa10(%rip),%rsi
mov    $0x6,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    16d6 <read_csv+0x526>
movl   $0x1,-0x7c(%rbp)
jmp    1700 <read_csv+0x550>
mov    -0x58(%rbp),%rdi
lea    0x9ed(%rip),%rsi
mov    $0x5,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    16fb <read_csv+0x54b>
movl   $0x2,-0x7c(%rbp)
jmp    1700 <read_csv+0x550>
jmp    1a69 <read_csv+0x8b9>
mov    -0x70(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x44,%eax
jne    17fa <read_csv+0x64a>
mov    -0x60(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x31,%eax
jne    17fa <read_csv+0x64a>
mov    -0x58(%rbp),%rdi
lea    0x9a4(%rip),%rsi
mov    $0x6,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    17fa <read_csv+0x64a>
mov    -0x50(%rbp),%rdi
lea    0x98d(%rip),%rsi
mov    $0xd,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    176d <read_csv+0x5bd>
movl   $0x1,-0x80(%rbp)
jmp    17f5 <read_csv+0x645>
mov    -0x50(%rbp),%rdi
lea    0x970(%rip),%rsi
mov    $0xc,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1797 <read_csv+0x5e7>
movl   $0x2,-0x80(%rbp)
jmp    17f0 <read_csv+0x640>
mov    -0x50(%rbp),%rdi
lea    0x952(%rip),%rsi
mov    $0x9,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    17c1 <read_csv+0x611>
movl   $0x3,-0x80(%rbp)
jmp    17eb <read_csv+0x63b>
mov    -0x50(%rbp),%rdi
lea    0x931(%rip),%rsi
mov    $0xc,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    17e6 <read_csv+0x636>
movl   $0x4,-0x80(%rbp)
jmp    17eb <read_csv+0x63b>
jmp    17f0 <read_csv+0x640>
jmp    17f5 <read_csv+0x645>
jmp    1a64 <read_csv+0x8b4>
mov    -0x70(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x44,%eax
jne    19b9 <read_csv+0x809>
mov    -0x60(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x31,%eax
jne    19b9 <read_csv+0x809>
mov    -0x58(%rbp),%rdi
lea    0x8e4(%rip),%rsi
mov    $0xd,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    19b9 <read_csv+0x809>
mov    -0x50(%rbp),%rdi
call   1060 <strlen@plt>
cmp    $0x5,%eax
jle    19b9 <read_csv+0x809>
cmpl   $0x1,-0x7c(%rbp)
jne    1906 <read_csv+0x756>
mov    -0x80(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x90(%rbp)
sub    $0x3,%eax
ja     1901 <read_csv+0x751>
mov    -0x90(%rbp),%rax
lea    0x796(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x50(%rbp),%rdi
add    $0x3,%rdi
call   10d0 <strdup@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
jmp    1901 <read_csv+0x751>
mov    -0x50(%rbp),%rdi
add    $0x3,%rdi
call   10d0 <strdup@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
jmp    1901 <read_csv+0x751>
mov    -0x50(%rbp),%rdi
add    $0x3,%rdi
call   10d0 <strdup@plt>
mov    %rax,%rcx
mov    0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0x750(%rip),%rdi
call   1080 <printf@plt>
jmp    1901 <read_csv+0x751>
mov    -0x50(%rbp),%rdi
add    $0x3,%rdi
call   10d0 <strdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    19b4 <read_csv+0x804>
cmpl   $0x2,-0x7c(%rbp)
jne    19af <read_csv+0x7ff>
mov    -0x80(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x98(%rbp)
sub    $0x3,%eax
ja     19aa <read_csv+0x7fa>
mov    -0x98(%rbp),%rax
lea    0x6ca(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x50(%rbp),%rdi
add    $0x3,%rdi
call   10d0 <strdup@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
jmp    19aa <read_csv+0x7fa>
mov    -0x50(%rbp),%rdi
add    $0x3,%rdi
call   10d0 <strdup@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
jmp    19aa <read_csv+0x7fa>
mov    -0x50(%rbp),%rdi
add    $0x3,%rdi
call   10d0 <strdup@plt>
mov    %rax,%rcx
mov    0x18(%rbp),%rax
mov    %rcx,(%rax)
jmp    19aa <read_csv+0x7fa>
mov    -0x50(%rbp),%rdi
add    $0x3,%rdi
call   10d0 <strdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    19af <read_csv+0x7ff>
jmp    19b4 <read_csv+0x804>
jmp    1a5f <read_csv+0x8af>
mov    -0x70(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x44,%eax
jne    1a5a <read_csv+0x8aa>
mov    -0x60(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x31,%eax
jne    1a5a <read_csv+0x8aa>
mov    -0x58(%rbp),%rdi
lea    0x733(%rip),%rsi
mov    $0x17,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1a5a <read_csv+0x8aa>
mov    -0x50(%rbp),%rdi
call   1060 <strlen@plt>
cmp    $0x5,%eax
jle    1a5a <read_csv+0x8aa>
cmpl   $0x1,-0x7c(%rbp)
jne    1a2f <read_csv+0x87f>
mov    -0x50(%rbp),%rdi
add    $0x2,%rdi
call   10d0 <strdup@plt>
mov    %rax,%rcx
mov    0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    1a55 <read_csv+0x8a5>
cmpl   $0x2,-0x7c(%rbp)
jne    1a50 <read_csv+0x8a0>
mov    -0x50(%rbp),%rdi
add    $0x2,%rdi
call   10d0 <strdup@plt>
mov    %rax,%rcx
mov    0x18(%rbp),%rax
mov    %rcx,(%rax)
jmp    1a55 <read_csv+0x8a5>
jmp    1a5a <read_csv+0x8aa>
jmp    1a5f <read_csv+0x8af>
jmp    1a64 <read_csv+0x8b4>
jmp    1a69 <read_csv+0x8b9>
jmp    1a6e <read_csv+0x8be>
jmp    1242 <read_csv+0x92>
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),%r15
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     1b3c <read_csv+0x98c>
mov    %rax,%r12
mov    %r15,%rdi
mov    $0x400,%esi
mov    %rax,%rdx
call   1090 <fgets@plt>
test   %rax,%rax
je     1b26 <read_csv+0x976>
lea    0xe86(%rip),%r14
xor    %ebp,%ebp
movl   $0x0,0xc(%rsp)
movl   $0x0,0x2c(%rsp)
xor    %ebx,%ebx
jmp    1291 <read_csv+0xe1>
add    $0x8,%rbp
mov    %rbp,%rdi
mov    $0x2c,%esi
call   1070 <strchr@plt>
test   %rax,%rax
jne    1702 <read_csv+0x552>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r15,%rdi
mov    $0x400,%esi
mov    %r12,%rdx
call   1090 <fgets@plt>
mov    $0x1,%ebx
test   %rax,%rax
mov    %r13,%rbp
je     1b26 <read_csv+0x976>
cmp    $0x1,%ebx
jne    1383 <read_csv+0x1d3>
mov    %rbp,%r13
mov    %r15,%rdi
mov    $0x2c,%esi
call   1070 <strchr@plt>
test   %rax,%rax
je     1270 <read_csv+0xc0>
mov    %rax,%rbp
cmpb   $0x0,0x1(%rax)
je     1270 <read_csv+0xc0>
lea    0x1(%rbp),%rbx
mov    %rbx,%rdi
lea    0xdba(%rip),%rsi
mov    $0x7,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     124a <read_csv+0x9a>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x6,%edx
call   1040 <strncmp@plt>
mov    $0x1,%ebx
test   %eax,%eax
jne    18f9 <read_csv+0x749>
add    $0x7,%rbp
mov    %rbp,%rdi
mov    $0x2c,%esi
call   1070 <strchr@plt>
test   %rax,%rax
je     1270 <read_csv+0xc0>
mov    %rax,%rbp
lea    0x1(%rax),%r14
mov    %r14,%rdi
lea    0xd68(%rip),%rsi
mov    $0xd,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     17b0 <read_csv+0x600>
mov    %r14,%rdi
lea    0xd5a(%rip),%rsi
mov    $0xc,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     1889 <read_csv+0x6d9>
mov    %r14,%rdi
lea    0xd4b(%rip),%rsi
mov    $0x9,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
jne    18f2 <read_csv+0x742>
add    $0xd,%rbp
mov    %rbp,%rdi
call   10d0 <strdup@plt>
mov    0x50(%rsp),%rcx
mov    %rax,(%rcx)
jmp    18f2 <read_csv+0x742>
test   %ebx,%ebx
je     1453 <read_csv+0x2a3>
cmp    $0x2,%ebx
jne    18fc <read_csv+0x74c>
mov    %rbp,0x38(%rsp)
mov    %r15,%rdi
mov    $0x2c,%esi
call   1070 <strchr@plt>
test   %rax,%rax
je     148b <read_csv+0x2db>
mov    %rax,%r13
movb   $0x0,(%rax)
add    $0x1,%r13
mov    %r13,%rdi
mov    $0x2c,%esi
call   1070 <strchr@plt>
test   %rax,%rax
mov    0xc(%rsp),%ebx
je     14aa <read_csv+0x2fa>
mov    %rax,%rbp
movb   $0x0,(%rax)
add    $0x1,%rbp
mov    %rbp,%rdi
mov    $0x2c,%esi
call   1070 <strchr@plt>
test   %rax,%rax
je     14b6 <read_csv+0x306>
mov    %rax,%r14
movb   $0x0,(%rax)
add    $0x1,%r14
mov    %r14,%rdi
mov    $0x2c,%esi
call   1070 <strchr@plt>
test   %rax,%rax
je     14bb <read_csv+0x30b>
movb   $0x0,(%rax)
add    $0x1,%rax
mov    %rax,0x30(%rsp)
mov    %rax,%rdi
mov    $0x2c,%esi
call   1070 <strchr@plt>
test   %rax,%rax
je     14bb <read_csv+0x30b>
movb   $0x0,(%rax)
add    $0x1,%rax
mov    %rax,%rdi
mov    $0x2c,%esi
call   1070 <strchr@plt>
test   %rax,%rax
je     14bb <read_csv+0x30b>
movb   $0x0,(%rax)
jmp    14bb <read_csv+0x30b>
mov    %r15,%rdi
lea    0xbd7(%rip),%rsi
mov    $0x27,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     14a0 <read_csv+0x2f0>
mov    %r15,%rdi
lea    0xbe7(%rip),%rsi
mov    $0x23,%edx
call   1040 <strncmp@plt>
xor    %ebx,%ebx
test   %eax,%eax
sete   %bl
jmp    18fc <read_csv+0x74c>
mov    0x10(%rsp),%r14
mov    0x18(%rsp),%rbp
mov    0x20(%rsp),%r13
mov    0xc(%rsp),%ebx
jmp    14bb <read_csv+0x30b>
mov    $0x2,%ebx
jmp    18fc <read_csv+0x74c>
mov    0x10(%rsp),%r14
mov    0x18(%rsp),%rbp
jmp    14bb <read_csv+0x30b>
mov    0x10(%rsp),%r14
mov    %r13,%rdi
call   10b0 <atoi@plt>
mov    %eax,%edx
cmp    0x2c(%rsp),%eax
mov    $0x0,%eax
cmovne %eax,%ebx
mov    0x38(%rsp),%rcx
cmovne %eax,%ecx
mov    %rcx,0x38(%rsp)
movzbl (%r15),%eax
cmp    $0x53,%al
jne    1526 <read_csv+0x376>
mov    %r14,%rax
mov    %r13,%r14
mov    %rbp,%rdi
mov    %rax,%rbp
mov    %edx,0x2c(%rsp)
mov    %rdi,%r13
lea    0xbc1(%rip),%rsi
mov    $0x5,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     16bd <read_csv+0x50d>
movzbl (%r15),%eax
mov    0x2c(%rsp),%edx
mov    %rbp,%rcx
mov    %r13,%rbp
mov    %r14,%r13
mov    %rcx,%r14
mov    %ebx,0xc(%rsp)
mov    $0x2,%ebx
cmp    $0x44,%al
jne    16a5 <read_csv+0x4f5>
cmpb   $0x31,0x0(%rbp)
jne    162a <read_csv+0x47a>
mov    %edx,0x2c(%rsp)
mov    %r14,%rdi
lea    0xb85(%rip),%rsi
mov    $0x6,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     17c9 <read_csv+0x619>
cmpb   $0x44,(%r15)
mov    0x30(%rsp),%rax
jne    1797 <read_csv+0x5e7>
cmpb   $0x31,0x0(%rbp)
jne    1797 <read_csv+0x5e7>
mov    %r14,%rdi
lea    0xb85(%rip),%rsi
mov    $0xd,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    0x2c(%rsp),%edx
jne    162a <read_csv+0x47a>
mov    0x30(%rsp),%rdi
call   1060 <strlen@plt>
mov    0x2c(%rsp),%edx
cmp    $0x6,%eax
jl     162a <read_csv+0x47a>
mov    0xc(%rsp),%eax
cmp    $0x2,%eax
je     1951 <read_csv+0x7a1>
cmp    $0x1,%eax
jne    16a5 <read_csv+0x4f5>
movl   $0x1,0xc(%rsp)
mov    0x38(%rsp),%rcx
lea    -0x1(%rcx),%eax
cmp    $0x3,%eax
ja     19a1 <read_csv+0x7f1>
lea    0xa2d(%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    0x60(%rsp),%rcx
mov    %rax,(%rcx)
movl   $0x1,0xc(%rsp)
mov    %r14,0x10(%rsp)
mov    %rbp,0x18(%rsp)
mov    %r13,0x20(%rsp)
mov    $0x1,%ebp
lea    0xa95(%rip),%r14
jmp    18fc <read_csv+0x74c>
cmpb   $0x44,(%r15)
jne    16a5 <read_csv+0x4f5>
cmpb   $0x31,0x0(%rbp)
jne    16a5 <read_csv+0x4f5>
mov    %edx,0x2c(%rsp)
mov    %r14,%rdi
lea    0xad3(%rip),%rsi
mov    $0x17,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
jne    1691 <read_csv+0x4e1>
mov    0x30(%rsp),%rdi
call   1060 <strlen@plt>
cmp    $0x6,%eax
jl     1691 <read_csv+0x4e1>
mov    0xc(%rsp),%eax
cmp    $0x2,%eax
je     191a <read_csv+0x76a>
cmp    $0x1,%eax
jne    1691 <read_csv+0x4e1>
mov    0x30(%rsp),%rax
lea    0x2(%rax),%rdi
call   10d0 <strdup@plt>
mov    0x48(%rsp),%rcx
mov    %rax,(%rcx)
movl   $0x1,0xc(%rsp)
mov    %r14,0x10(%rsp)
mov    %rbp,0x18(%rsp)
mov    %r13,0x20(%rsp)
jmp    187b <read_csv+0x6cb>
mov    %r14,0x10(%rsp)
mov    %rbp,0x18(%rsp)
mov    %r13,0x20(%rsp)
mov    %edx,0x2c(%rsp)
jmp    187b <read_csv+0x6cb>
mov    %rbp,%rdi
lea    0xa00(%rip),%rsi
mov    $0x6,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     185f <read_csv+0x6af>
mov    %rbp,%rdi
lea    0x9eb(%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    186c <read_csv+0x6bc>
mov    %rax,%rbp
lea    0x1(%rax),%r14
mov    %r14,%rdi
lea    0x975(%rip),%rsi
mov    $0xd,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     189f <read_csv+0x6ef>
mov    %r14,%rdi
lea    0x967(%rip),%rsi
mov    $0xc,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     18b2 <read_csv+0x702>
mov    %r14,%rdi
lea    0x958(%rip),%rsi
mov    $0x9,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     18d9 <read_csv+0x729>
mov    %r14,%rdi
lea    0x946(%rip),%rsi
mov    $0xc,%edx
call   1040 <strncmp@plt>
mov    $0x1,%ebx
test   %eax,%eax
jne    18f2 <read_csv+0x742>
add    $0x10,%rbp
mov    %rbp,%rdi
call   10d0 <strdup@plt>
mov    0x40(%rsp),%rcx
mov    %rax,(%rcx)
jmp    18f2 <read_csv+0x742>
mov    %r14,0x10(%rsp)
mov    %rbp,0x18(%rsp)
mov    %r13,0x20(%rsp)
mov    %rax,0x30(%rsp)
jmp    187b <read_csv+0x6cb>
add    $0x11,%rbp
mov    %rbp,%rdi
call   10d0 <strdup@plt>
mov    0x70(%rsp),%rcx
mov    %rax,(%rcx)
jmp    18f2 <read_csv+0x742>
mov    0x30(%rsp),%rdi
lea    0x906(%rip),%rsi
mov    $0xd,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     18c5 <read_csv+0x715>
mov    0x30(%rsp),%rdi
lea    0x8f5(%rip),%rsi
mov    $0xc,%edx
call   1040 <strncmp@plt>
mov    $0x2,%ebx
test   %eax,%eax
je     19d4 <read_csv+0x824>
mov    0x30(%rsp),%rdi
lea    0x8de(%rip),%rsi
mov    $0x9,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     1a19 <read_csv+0x869>
mov    0x30(%rsp),%rdi
lea    0x8c9(%rip),%rsi
mov    $0xc,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    $0x4,%eax
mov    0x38(%rsp),%rcx
cmove  %eax,%ecx
mov    %r14,0x10(%rsp)
mov    %rbp,0x18(%rsp)
mov    %rcx,%rbp
jmp    1a28 <read_csv+0x878>
movl   $0x1,0xc(%rsp)
mov    $0x2,%ebx
mov    %rbp,0x10(%rsp)
mov    %r13,0x18(%rsp)
mov    %r14,0x20(%rsp)
lea    0x838(%rip),%r14
mov    0x38(%rsp),%rbp
jmp    18fc <read_csv+0x74c>
add    $0x10,%rbp
mov    %rbp,%rdi
call   10d0 <strdup@plt>
mov    0x68(%rsp),%rcx
mov    %rax,(%rcx)
jmp    18f2 <read_csv+0x742>
add    $0x11,%rbp
mov    %rbp,%rdi
call   10d0 <strdup@plt>
mov    0x60(%rsp),%rcx
jmp    18ea <read_csv+0x73a>
add    $0x10,%rbp
mov    %rbp,%rdi
call   10d0 <strdup@plt>
mov    0x58(%rsp),%rcx
jmp    18ea <read_csv+0x73a>
mov    %r14,0x10(%rsp)
mov    %rbp,0x18(%rsp)
mov    $0x1,%ebp
jmp    1a28 <read_csv+0x878>
add    $0xd,%rbp
mov    %rbp,%rdi
call   10d0 <strdup@plt>
mov    0x48(%rsp),%rcx
mov    %rax,(%rcx)
mov    $0x1,%ebx
lea    0x7c1(%rip),%r14
mov    %r13,%rbp
mov    %r15,%rdi
mov    $0x400,%esi
mov    %r12,%rdx
call   1090 <fgets@plt>
test   %rax,%rax
jne    1291 <read_csv+0xe1>
jmp    1b26 <read_csv+0x976>
mov    0x30(%rsp),%rax
lea    0x2(%rax),%rdi
call   10d0 <strdup@plt>
mov    0x50(%rsp),%rcx
mov    %rax,(%rcx)
mov    $0x2,%ebx
mov    %r14,0x10(%rsp)
mov    %rbp,0x18(%rsp)
mov    %r13,0x20(%rsp)
movl   $0x2,0xc(%rsp)
jmp    187b <read_csv+0x6cb>
mov    $0x2,%ebx
mov    0x38(%rsp),%rcx
lea    -0x1(%rcx),%eax
cmp    $0x3,%eax
ja     1a60 <read_csv+0x8b0>
lea    0x692(%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,0x10(%rsp)
mov    %rbp,0x18(%rsp)
mov    $0x1,%ebp
jmp    1b0d <read_csv+0x95d>
mov    %r14,0x10(%rsp)
mov    %rbp,0x18(%rsp)
mov    %r13,0x20(%rsp)
mov    %edx,0x2c(%rsp)
jmp    1a7b <read_csv+0x8cb>
mov    0x30(%rsp),%rax
lea    0x3(%rax),%rdi
call   10d0 <strdup@plt>
mov    0x58(%rsp),%rcx
mov    %rax,(%rcx)
mov    $0x2,%ebx
mov    %r14,0x10(%rsp)
mov    %rbp,0x18(%rsp)
mov    %r13,0x20(%rsp)
mov    $0x2,%ebp
lea    0x6cb(%rip),%r14
jmp    18fc <read_csv+0x74c>
mov    0x30(%rsp),%rax
lea    0x3(%rax),%rdi
call   10d0 <strdup@plt>
mov    0x48(%rsp),%rcx
mov    %rax,(%rcx)
lea    0x61f(%rip),%rdi
mov    %rax,%rsi
call   1080 <printf@plt>
mov    %r14,0x10(%rsp)
mov    %rbp,0x18(%rsp)
mov    $0x3,%ebp
mov    %r13,0x20(%rsp)
lea    0x686(%rip),%r14
jmp    18fc <read_csv+0x74c>
mov    0x30(%rsp),%rax
lea    0x3(%rax),%rdi
call   10d0 <strdup@plt>
mov    0x40(%rsp),%rcx
mov    %rax,(%rcx)
mov    %r14,0x10(%rsp)
mov    %rbp,0x18(%rsp)
mov    $0x4,%ebp
jmp    1a28 <read_csv+0x878>
mov    %r14,0x10(%rsp)
mov    %rbp,0x18(%rsp)
mov    %r13,0x20(%rsp)
mov    %edx,0x2c(%rsp)
movl   $0x2,0xc(%rsp)
lea    0x638(%rip),%r14
mov    %rcx,%rbp
jmp    18fc <read_csv+0x74c>
mov    0x30(%rsp),%rax
lea    0x3(%rax),%rdi
call   10d0 <strdup@plt>
mov    0x68(%rsp),%rcx
mov    %rax,(%rcx)
mov    $0x2,%ebx
mov    %r14,0x10(%rsp)
mov    %rbp,0x18(%rsp)
mov    %r13,0x20(%rsp)
movl   $0x2,0xc(%rsp)
jmp    19e3 <read_csv+0x833>
mov    0x30(%rsp),%rax
lea    0x3(%rax),%rdi
call   10d0 <strdup@plt>
mov    0x50(%rsp),%rcx
mov    %rax,(%rcx)
mov    %r14,0x10(%rsp)
mov    %rbp,0x18(%rsp)
mov    $0x3,%ebp
jmp    1b0d <read_csv+0x95d>
mov    0x30(%rsp),%rax
lea    0x3(%rax),%rdi
call   10d0 <strdup@plt>
mov    0x40(%rsp),%rcx
mov    %rax,(%rcx)
mov    %r14,0x10(%rsp)
mov    %rbp,0x18(%rsp)
mov    $0x4,%ebp
mov    %r13,0x20(%rsp)
movl   $0x2,0xc(%rsp)
lea    0x599(%rip),%r14
jmp    18fc <read_csv+0x74c>
mov    %r12,%rdi
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <fclose@plt>
lea    0x4dd(%rip),%rdi
mov    %rbp,%rsi
call   1080 <printf@plt>
mov    %r15,%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
store i32 0, i32* %22
store i32 0, i32* %23
store i32 0, i32* %24
store i32 0, i32* %25
%27 = load i8*, i8** %10
%28 = call i32* @fopen(i8* %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %28, i32** %19
%29 = load i32*, i32** %19
%30 = icmp ne i32* %29, null
br i1 %30, label %37, label %31
31: ; preds = %9
%32 = load i8*, i8** %10
%33 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %32)
%34 = load i8*, i8** %18
%35 = call i32 @free(i8* %34)
%36 = call i32 @exit(i32 -1)
unreachable
37: ; preds = %9
br label %38
38: ; preds = %409, %138, %81, %68, %62, %37
%39 = load i8*, i8** %18
%40 = load i32*, i32** %19
%41 = call i64 @fgets(i8* %39, i32 1024, i32* %40)
%42 = icmp ne i64 %41, 0
br i1 %42, label %43, label %410
43: ; preds = %38
%44 = load i32, i32* %22
switch i32 %44, label %409 [
i32 0, label %45
i32 1, label %57
i32 2, label %174
]
45: ; preds = %43
%46 = load i8*, i8** %18
%47 = call i32 @strncmp(i8* %46, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32 39)
%48 = icmp ne i32 %47, 0
br i1 %48, label %50, label %49
49: ; preds = %45
store i32 2, i32* %22
br label %56
50: ; preds = %45
%51 = load i8*, i8** %18
%52 = call i32 @strncmp(i8* %51, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i32 35)
%53 = icmp ne i32 %52, 0
br i1 %53, label %55, label %54
54: ; preds = %50
store i32 1, i32* %22
br label %55
55: ; preds = %54, %50
br label %56
56: ; preds = %55, %49
br label %409
57: ; preds = %43
%58 = load i8*, i8** %18
%59 = call i8* @strchr(i8* %58, i8 signext 44)
store i8* %59, i8** %20
%60 = load i8*, i8** %20
%61 = icmp ne i8* %60, null
br i1 %61, label %63, label %62
62: ; preds = %57
br label %38
63: ; preds = %57
%64 = load i8*, i8** %20
%65 = getelementptr inbounds i8, i8* %64, i32 1
store i8* %65, i8** %20
%66 = load i8, i8* %65
%67 = icmp ne i8 %66, 0
br i1 %67, label %69, label %68
68: ; preds = %63
br label %38
69: ; preds = %63
%70 = load i8*, i8** %20
%71 = call i32 @strncmp(i8* %70, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 7)
%72 = icmp ne i32 %71, 0
br i1 %72, label %126, label %73
73: ; preds = %69
%74 = load i8*, i8** %20
%75 = getelementptr inbounds i8, i8* %74, i64 7
store i8* %75, i8** %20
%76 = load i8*, i8** %20
%77 = call i8* @strchr(i8* %76, i8 signext 44)
store i8* %77, i8** %20
%78 = load i8*, i8** %20
%79 = getelementptr inbounds i8, i8* %78, i32 1
store i8* %79, i8** %20
%80 = icmp ne i8* %78, null
br i1 %80, label %82, label %81
81: ; preds = %73
br label %38
82: ; preds = %73
%83 = load i8*, i8** %20
%84 = call i32 @strncmp(i8* %83, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 13)
%85 = icmp ne i32 %84, 0
br i1 %85, label %92, label %86
86: ; preds = %82
%87 = load i8*, i8** %20
%88 = getelementptr inbounds i8, i8* %87, i64 16
store i8* %88, i8** %20
%89 = load i8*, i8** %20
%90 = call i8* @strdup(i8* %89)
%91 = load i8**, i8*** %12
store i8* %90, i8** %91
br label %125
92: ; preds = %82
%93 = load i8*, i8** %20
%94 = call i32 @strncmp(i8* %93, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 12)
%95 = icmp ne i32 %94, 0
br i1 %95, label %102, label %96
96: ; preds = %92
%97 = load i8*, i8** %20
%98 = getelementptr inbounds i8, i8* %97, i64 15
store i8* %98, i8** %20
%99 = load i8*, i8** %20
%100 = call i8* @strdup(i8* %99)
%101 = load i8**, i8*** %14
store i8* %100, i8** %101
br label %124
102: ; preds = %92
%103 = load i8*, i8** %20
%104 = call i32 @strncmp(i8* %103, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 9)
%105 = icmp ne i32 %104, 0
br i1 %105, label %112, label %106
106: ; preds = %102
%107 = load i8*, i8** %20
%108 = getelementptr inbounds i8, i8* %107, i64 12
store i8* %108, i8** %20
%109 = load i8*, i8** %20
%110 = call i8* @strdup(i8* %109)
%111 = load i8**, i8*** %16
store i8* %110, i8** %111
br label %123
112: ; preds = %102
%113 = load i8*, i8** %20
%114 = call i32 @strncmp(i8* %113, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 12)
%115 = icmp ne i32 %114, 0
br i1 %115, label %122, label %116
116: ; preds = %112
%117 = load i8*, i8** %20
%118 = getelementptr inbounds i8, i8* %117, i64 15
store i8* %118, i8** %20
%119 = load i8*, i8** %20
%120 = call i8* @strdup(i8* %119)
%121 = load i8**, i8*** %11
store i8* %120, i8** %121
br label %122
122: ; preds = %116, %112
br label %123
123: ; preds = %122, %106
br label %124
124: ; preds = %123, %96
br label %125
125: ; preds = %124, %86
br label %173
126: ; preds = %69
%127 = load i8*, i8** %20
%128 = call i32 @strncmp(i8* %127, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 6)
%129 = icmp ne i32 %128, 0
br i1 %129, label %172, label %130
130: ; preds = %126
%131 = load i8*, i8** %20
%132 = getelementptr inbounds i8, i8* %131, i64 6
store i8* %132, i8** %20
%133 = load i8*, i8** %20
%134 = call i8* @strchr(i8* %133, i8 signext 44)
store i8* %134, i8** %20
%135 = load i8*, i8** %20
%136 = getelementptr inbounds i8, i8* %135, i32 1
store i8* %136, i8** %20
%137 = icmp ne i8* %135, null
br i1 %137, label %139, label %138
138: ; preds = %130
br label %38
139: ; preds = %130
%140 = load i8*, i8** %20
%141 = call i32 @strncmp(i8* %140, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 13)
%142 = icmp ne i32 %141, 0
br i1 %142, label %149, label %143
143: ; preds = %139
%144 = load i8*, i8** %20
%145 = getelementptr inbounds i8, i8* %144, i64 16
store i8* %145, i8** %20
%146 = load i8*, i8** %20
%147 = call i8* @strdup(i8* %146)
%148 = load i8**, i8*** %13
store i8* %147, i8** %148
br label %171
149: ; preds = %139
%150 = load i8*, i8** %20
%151 = call i32 @strncmp(i8* %150, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 12)
%152 = icmp ne i32 %151, 0
br i1 %152, label %159, label %153
153: ; preds = %149
%154 = load i8*, i8** %20
%155 = getelementptr inbounds i8, i8* %154, i64 15
store i8* %155, i8** %20
%156 = load i8*, i8** %20
%157 = call i8* @strdup(i8* %156)
%158 = load i8**, i8*** %15
store i8* %157, i8** %158
br label %170
159: ; preds = %149
%160 = load i8*, i8** %20
%161 = call i32 @strncmp(i8* %160, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 9)
%162 = icmp ne i32 %161, 0
br i1 %162, label %169, label %163
163: ; preds = %159
%164 = load i8*, i8** %20
%165 = getelementptr inbounds i8, i8* %164, i64 12
store i8* %165, i8** %20
%166 = load i8*, i8** %20
%167 = call i8* @strdup(i8* %166)
%168 = load i8**, i8*** %17
store i8* %167, i8** %168
br label %169
169: ; preds = %163, %159
br label %170
170: ; preds = %169, %153
br label %171
171: ; preds = %170, %143
br label %172
172: ; preds = %171, %126
br label %173
173: ; preds = %172, %125
br label %409
174: ; preds = %43
%175 = load i8*, i8** %18
store i8* %175, i8** %20
store i32 0, i32* %26
br label %176
176: ; preds = %193, %174
%177 = load i32, i32* %26
%178 = icmp slt i32 %177, 6
br i1 %178, label %179, label %196
179: ; preds = %176
%180 = load i8*, i8** %20
%181 = load i32, i32* %26
%182 = sext i32 %181 to i64
%183 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 %182
store i8* %180, i8** %183
%184 = load i8*, i8** %20
%185 = call i8* @strchr(i8* %184, i8 signext 44)
store i8* %185, i8** %20
%186 = load i8*, i8** %20
%187 = icmp ne i8* %186, null
br i1 %187, label %189, label %188
188: ; preds = %179
br label %196
189: ; preds = %179
%190 = load i8*, i8** %20
store i8 0, i8* %190
%191 = load i8*, i8** %20
%192 = getelementptr inbounds i8, i8* %191, i32 1
store i8* %192, i8** %20
br label %193
193: ; preds = %189
%194 = load i32, i32* %26
%195 = add nsw i32 %194, 1
store i32 %195, i32* %26
br label %176
196: ; preds = %188, %176
%197 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 1
%198 = load i8*, i8** %197
%199 = call i32 @atoi(i8* %198)
%200 = load i32, i32* %23
%201 = icmp ne i32 %199, %200
br i1 %201, label %202, label %206
202: ; preds = %196
%203 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 1
%204 = load i8*, i8** %203
%205 = call i32 @atoi(i8* %204)
store i32 %205, i32* %23
store i32 0, i32* %24
store i32 0, i32* %25
br label %206
206: ; preds = %202, %196
%207 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 0
%208 = load i8*, i8** %207
%209 = load i8, i8* %208
%210 = sext i8 %209 to i32
%211 = icmp eq i32 %210, 83
br i1 %211, label %212, label %231
212: ; preds = %206
%213 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 2
%214 = load i8*, i8** %213
%215 = call i32 @strncmp(i8* %214, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i32 5)
%216 = icmp ne i32 %215, 0
br i1 %216, label %231, label %217
217: ; preds = %212
%218 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 3
%219 = load i8*, i8** %218
%220 = call i32 @strncmp(i8* %219, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i32 6)
%221 = icmp ne i32 %220, 0
br i1 %221, label %223, label %222
222: ; preds = %217
store i32 1, i32* %24
br label %230
223: ; preds = %217
%224 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 3
%225 = load i8*, i8** %224
%226 = call i32 @strncmp(i8* %225, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 5)
%227 = icmp ne i32 %226, 0
br i1 %227, label %229, label %228
228: ; preds = %223
store i32 2, i32* %24
br label %229
229: ; preds = %228, %223
br label %230
230: ; preds = %229, %222
br label %408
231: ; preds = %212, %206
%232 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 0
%233 = load i8*, i8** %232
%234 = load i8, i8* %233
%235 = sext i8 %234 to i32
%236 = icmp eq i32 %235, 68
br i1 %236, label %237, label %276
237: ; preds = %231
%238 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 2
%239 = load i8*, i8** %238
%240 = load i8, i8* %239
%241 = sext i8 %240 to i32
%242 = icmp eq i32 %241, 49
br i1 %242, label %243, label %276
243: ; preds = %237
%244 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 3
%245 = load i8*, i8** %244
%246 = call i32 @strncmp(i8* %245, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), i32 6)
%247 = icmp ne i32 %246, 0
br i1 %247, label %276, label %248
248: ; preds = %243
%249 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%250 = load i8*, i8** %249
%251 = call i32 @strncmp(i8* %250, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0), i32 13)
%252 = icmp ne i32 %251, 0
br i1 %252, label %254, label %253
253: ; preds = %248
store i32 1, i32* %25
br label %275
254: ; preds = %248
%255 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%256 = load i8*, i8** %255
%257 = call i32 @strncmp(i8* %256, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.15, i64 0, i64 0), i32 12)
%258 = icmp ne i32 %257, 0
br i1 %258, label %260, label %259
259: ; preds = %254
store i32 2, i32* %25
br label %274
260: ; preds = %254
%261 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%262 = load i8*, i8** %261
%263 = call i32 @strncmp(i8* %262, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i64 0, i64 0), i32 9)
%264 = icmp ne i32 %263, 0
br i1 %264, label %266, label %265
265: ; preds = %260
store i32 3, i32* %25
br label %273
266: ; preds = %260
%267 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%268 = load i8*, i8** %267
%269 = call i32 @strncmp(i8* %268, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.17, i64 0, i64 0), i32 12)
%270 = icmp ne i32 %269, 0
br i1 %270, label %272, label %271
271: ; preds = %266
store i32 4, i32* %25
br label %272
272: ; preds = %271, %266
br label %273
273: ; preds = %272, %265
br label %274
274: ; preds = %273, %259
br label %275
275: ; preds = %274, %253
br label %407
276: ; preds = %243, %237, %231
%277 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 0
%278 = load i8*, i8** %277
%279 = load i8, i8* %278
%280 = sext i8 %279 to i32
%281 = icmp eq i32 %280, 68
br i1 %281, label %282, label %363
282: ; preds = %276
%283 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 2
%284 = load i8*, i8** %283
%285 = load i8, i8* %284
%286 = sext i8 %285 to i32
%287 = icmp eq i32 %286, 49
br i1 %287, label %288, label %363
288: ; preds = %282
%289 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 3
%290 = load i8*, i8** %289
%291 = call i32 @strncmp(i8* %290, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.18, i64 0, i64 0), i32 13)
%292 = icmp ne i32 %291, 0
br i1 %292, label %363, label %293
293: ; preds = %288
%294 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%295 = load i8*, i8** %294
%296 = call i32 @strlen(i8* %295)
%297 = icmp sgt i32 %296, 5
br i1 %297, label %298, label %363
298: ; preds = %293
%299 = load i32, i32* %24
%300 = icmp eq i32 %299, 1
br i1 %300, label %301, label %331
301: ; preds = %298
%302 = load i32, i32* %25
switch i32 %302, label %330 [
i32 1, label %303
i32 2, label %309
i32 3, label %315
i32 4, label %324
]
303: ; preds = %301
%304 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%305 = load i8*, i8** %304
%306 = getelementptr inbounds i8, i8* %305, i64 3
%307 = call i8* @strdup(i8* %306)
%308 = load i8**, i8*** %12
store i8* %307, i8** %308
br label %330
309: ; preds = %301
%310 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%311 = load i8*, i8** %310
%312 = getelementptr inbounds i8, i8* %311, i64 3
%313 = call i8* @strdup(i8* %312)
%314 = load i8**, i8*** %14
store i8* %313, i8** %314
br label %330
315: ; preds = %301
%316 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%317 = load i8*, i8** %316
%318 = getelementptr inbounds i8, i8* %317, i64 3
%319 = call i8* @strdup(i8* %318)
%320 = load i8**, i8*** %16
store i8* %319, i8** %320
%321 = load i8**, i8*** %16
%322 = load i8*, i8** %321
%323 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0), i8* %322)
br label %330
324: ; preds = %301
%325 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%326 = load i8*, i8** %325
%327 = getelementptr inbounds i8, i8* %326, i64 3
%328 = call i8* @strdup(i8* %327)
%329 = load i8**, i8*** %11
store i8* %328, i8** %329
br label %330
330: ; preds = %301, %324, %315, %309, %303
br label %362
331: ; preds = %298
%332 = load i32, i32* %24
%333 = icmp eq i32 %332, 2
br i1 %333, label %334, label %361
334: ; preds = %331
%335 = load i32, i32* %25
switch i32 %335, label %360 [
i32 1, label %336
i32 2, label %342
i32 3, label %348
i32 4, label %354
]
336: ; preds = %334
%337 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%338 = load i8*, i8** %337
%339 = getelementptr inbounds i8, i8* %338, i64 3
%340 = call i8* @strdup(i8* %339)
%341 = load i8**, i8*** %13
store i8* %340, i8** %341
br label %360
342: ; preds = %334
%343 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%344 = load i8*, i8** %343
%345 = getelementptr inbounds i8, i8* %344, i64 3
%346 = call i8* @strdup(i8* %345)
%347 = load i8**, i8*** %15
store i8* %346, i8** %347
br label %360
348: ; preds = %334
%349 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%350 = load i8*, i8** %349
%351 = getelementptr inbounds i8, i8* %350, i64 3
%352 = call i8* @strdup(i8* %351)
%353 = load i8**, i8*** %17
store i8* %352, i8** %353
br label %360
354: ; preds = %334
%355 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%356 = load i8*, i8** %355
%357 = getelementptr inbounds i8, i8* %356, i64 3
%358 = call i8* @strdup(i8* %357)
%359 = load i8**, i8*** %11
store i8* %358, i8** %359
br label %360
360: ; preds = %334, %354, %348, %342, %336
br label %361
361: ; preds = %360, %331
br label %362
362: ; preds = %361, %330
br label %406
363: ; preds = %293, %288, %282, %276
%364 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 0
%365 = load i8*, i8** %364
%366 = load i8, i8* %365
%367 = sext i8 %366 to i32
%368 = icmp eq i32 %367, 68
br i1 %368, label %369, label %405
369: ; preds = %363
%370 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 2
%371 = load i8*, i8** %370
%372 = load i8, i8* %371
%373 = sext i8 %372 to i32
%374 = icmp eq i32 %373, 49
br i1 %374, label %375, label %405
375: ; preds = %369
%376 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 3
%377 = load i8*, i8** %376
%378 = call i32 @strncmp(i8* %377, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.20, i64 0, i64 0), i32 23)
%379 = icmp ne i32 %378, 0
br i1 %379, label %405, label %380
380: ; preds = %375
%381 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%382 = load i8*, i8** %381
%383 = call i32 @strlen(i8* %382)
%384 = icmp sgt i32 %383, 5
br i1 %384, label %385, label %405
385: ; preds = %380
%386 = load i32, i32* %24
%387 = icmp eq i32 %386, 1
br i1 %387, label %388, label %394
388: ; preds = %385
%389 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%390 = load i8*, i8** %389
%391 = getelementptr inbounds i8, i8* %390, i64 2
%392 = call i8* @strdup(i8* %391)
%393 = load i8**, i8*** %16
store i8* %392, i8** %393
br label %404
394: ; preds = %385
%395 = load i32, i32* %24
%396 = icmp eq i32 %395, 2
br i1 %396, label %397, label %403
397: ; preds = %394
%398 = getelementptr inbounds [6 x i8*], [6 x i8*]* %21, i64 0, i64 4
%399 = load i8*, i8** %398
%400 = getelementptr inbounds i8, i8* %399, i64 2
%401 = call i8* @strdup(i8* %400)
%402 = load i8**, i8*** %17
store i8* %401, i8** %402
br label %403
403: ; preds = %397, %394
br label %404
404: ; preds = %403, %388
br label %405
405: ; preds = %404, %380, %375, %369, %363
br label %406
406: ; preds = %405, %362
br label %407
407: ; preds = %406, %275
br label %408
408: ; preds = %407, %230
br label %409
409: ; preds = %43, %408, %173, %56
br label %38
410: ; preds = %38
%411 = load i32*, i32** %19
%412 = call i32 @fclose(i32* %411)
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 ], [ %236, %99 ], [ %236, %103 ], [ %108, %107 ], [ %108, %111 ], [ %108, %115 ], [ %108, %119 ]
%122 = phi i8* [ %237, %21 ], [ %237, %99 ], [ %104, %103 ], [ %104, %107 ], [ %104, %111 ], [ %104, %115 ], [ %104, %119 ]
%123 = phi i8* [ %238, %21 ], [ %100, %99 ], [ %100, %103 ], [ %100, %107 ], [ %100, %111 ], [ %100, %115 ], [ %100, %119 ]
%124 = phi i8* [ %239, %21 ], [ %239, %99 ], [ %239, %103 ], [ %239, %107 ], [ %112, %111 ], [ %112, %115 ], [ %112, %119 ]
%125 = tail call i32 @atoi(i8* %123)
%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* %121, 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* %121, 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* %121, 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* %121, 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* %121, 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 ], [ undef, %12 ]
%237 = phi i8* [ %226, %224 ], [ undef, %12 ]
%238 = phi i8* [ %227, %224 ], [ undef, %12 ]
%239 = phi i8* [ %228, %224 ], [ undef, %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
}