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

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, unsigned char *);
scalar_t__ isdigit(unsigned char);
int /*<<< orphan*/ isxdigit(unsigned char);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ store_data(int /*<<< orphan*/, int /*<<< orphan*/);
int tolower(unsigned char);
int read_srec(char *filename) {
  FILE *fd;
  unsigned char buf[256];
  unsigned char *data;
  unsigned address;
  int bytes;
  fd = fopen(filename, "r");
  if (!fd) {
    perror(filename);
    exit(1);
  }
  while (fgets((char *)buf, sizeof(buf), fd)) {
    if (buf[0] == '\n')
      continue;
    if (buf[0] != 'S') {
      fclose(fd);
      return 0;
    }
    if (buf[1] == '7' || buf[1] == '8' || buf[1] == '9')
      break;
    if (!isxdigit(buf[2]) || !isxdigit(buf[3])) {
      fprintf(stderr, ("%s: bad SREC record: %s\n"), filename, buf);
      exit(1);
    }
    bytes = (((isdigit((buf + 2)[0]) ? ((buf + 2)[0]) - '0'
                                     : tolower((buf + 2)[0]) + 10 - 'a')
              << 4) +
             (isdigit((buf + 2)[1]) ? ((buf + 2)[1]) - '0'
                                    : tolower((buf + 2)[1]) + 10 - 'a'));
    --bytes;
    address = 0;
    data = buf + 4;
    switch (buf[1]) {
    case '3':
      address = (((isdigit((data)[0]) ? ((data)[0]) - '0'
                                      : tolower((data)[0]) + 10 - 'a')
                  << 4) +
                 (isdigit((data)[1]) ? ((data)[1]) - '0'
                                     : tolower((data)[1]) + 10 - 'a'));
      data += 2;
      --bytes;
    case '2':
      address = (address << 8) |
                (((isdigit((data)[0]) ? ((data)[0]) - '0'
                                      : tolower((data)[0]) + 10 - 'a')
                  << 4) +
                 (isdigit((data)[1]) ? ((data)[1]) - '0'
                                     : tolower((data)[1]) + 10 - 'a'));
      data += 2;
      --bytes;
    case '1':
      address = (address << 8) |
                (((isdigit((data)[0]) ? ((data)[0]) - '0'
                                      : tolower((data)[0]) + 10 - 'a')
                  << 4) +
                 (isdigit((data)[1]) ? ((data)[1]) - '0'
                                     : tolower((data)[1]) + 10 - 'a'));
      data += 2;
      address = (address << 8) |
                (((isdigit((data)[0]) ? ((data)[0]) - '0'
                                      : tolower((data)[0]) + 10 - 'a')
                  << 4) +
                 (isdigit((data)[1]) ? ((data)[1]) - '0'
                                     : tolower((data)[1]) + 10 - 'a'));
      data += 2;
      bytes -= 2;
      while (bytes-- > 0) {
        store_data(address++,
                   (((isdigit((data)[0]) ? ((data)[0]) - '0'
                                         : tolower((data)[0]) + 10 - 'a')
                     << 4) +
                    (isdigit((data)[1]) ? ((data)[1]) - '0'
                                        : tolower((data)[1]) + 10 - 'a')));
        data += 2;
      }
      break;
    }
  }
  fclose(fd);
  return 1;
}


x86 assembly (clang, -O0):
<read_srec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe46(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11e1 <read_srec+0x41>
mov    -0x10(%rbp),%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
jmp    11e6 <read_srec+0x46>
lea    -0x120(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x100,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     18a0 <read_srec+0x700>
movzbl -0x120(%rbp),%eax
cmp    $0xa,%eax
jne    121a <read_srec+0x7a>
jmp    11e6 <read_srec+0x46>
movzbl -0x120(%rbp),%eax
cmp    $0x53,%eax
je     123f <read_srec+0x9f>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x0,-0x4(%rbp)
jmp    18b0 <read_srec+0x710>
movzbl -0x11f(%rbp),%eax
cmp    $0x37,%eax
je     126f <read_srec+0xcf>
movzbl -0x11f(%rbp),%eax
cmp    $0x38,%eax
je     126f <read_srec+0xcf>
movzbl -0x11f(%rbp),%eax
cmp    $0x39,%eax
jne    1274 <read_srec+0xd4>
jmp    18a0 <read_srec+0x700>
movzbl -0x11e(%rbp),%edi
call   10c0 <isxdigit@plt>
cmp    $0x0,%eax
je     129e <read_srec+0xfe>
movzbl -0x11d(%rbp),%edi
call   10c0 <isxdigit@plt>
cmp    $0x0,%eax
jne    12c8 <read_srec+0x128>
mov    0x2d3b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    -0x120(%rbp),%rcx
lea    0xd49(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
movzbl -0x11e(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     12f3 <read_srec+0x153>
movzbl -0x11e(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x134(%rbp)
jmp    130b <read_srec+0x16b>
movzbl -0x11e(%rbp),%edi
call   1080 <tolower@plt>
add    $0xa,%eax
sub    $0x61,%eax
mov    %eax,-0x134(%rbp)
mov    -0x134(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x138(%rbp)
movzbl -0x11d(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1345 <read_srec+0x1a5>
movzbl -0x11d(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x13c(%rbp)
jmp    135d <read_srec+0x1bd>
movzbl -0x11d(%rbp),%edi
call   1080 <tolower@plt>
add    $0xa,%eax
sub    $0x61,%eax
mov    %eax,-0x13c(%rbp)
mov    -0x138(%rbp),%eax
mov    -0x13c(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x130(%rbp)
mov    -0x130(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x130(%rbp)
movl   $0x0,-0x12c(%rbp)
lea    -0x11c(%rbp),%rax
mov    %rax,-0x128(%rbp)
movzbl -0x11f(%rbp),%eax
mov    %eax,-0x140(%rbp)
sub    $0x31,%eax
je     15b0 <read_srec+0x410>
jmp    13b3 <read_srec+0x213>
mov    -0x140(%rbp),%eax
sub    $0x32,%eax
je     14ba <read_srec+0x31a>
jmp    13c7 <read_srec+0x227>
mov    -0x140(%rbp),%eax
sub    $0x33,%eax
jne    189b <read_srec+0x6fb>
jmp    13db <read_srec+0x23b>
mov    -0x128(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     140c <read_srec+0x26c>
mov    -0x128(%rbp),%rax
movzbl (%rax),%eax
sub    $0x30,%eax
mov    %eax,-0x144(%rbp)
jmp    1427 <read_srec+0x287>
mov    -0x128(%rbp),%rax
movzbl (%rax),%edi
call   1080 <tolower@plt>
add    $0xa,%eax
sub    $0x61,%eax
mov    %eax,-0x144(%rbp)
mov    -0x144(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x148(%rbp)
mov    -0x128(%rbp),%rax
movzbl 0x1(%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1469 <read_srec+0x2c9>
mov    -0x128(%rbp),%rax
movzbl 0x1(%rax),%eax
sub    $0x30,%eax
mov    %eax,-0x14c(%rbp)
jmp    1485 <read_srec+0x2e5>
mov    -0x128(%rbp),%rax
movzbl 0x1(%rax),%edi
call   1080 <tolower@plt>
add    $0xa,%eax
sub    $0x61,%eax
mov    %eax,-0x14c(%rbp)
mov    -0x148(%rbp),%eax
mov    -0x14c(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x12c(%rbp)
mov    -0x128(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x128(%rbp)
mov    -0x130(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x130(%rbp)
mov    -0x12c(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x150(%rbp)
mov    -0x128(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     14fa <read_srec+0x35a>
mov    -0x128(%rbp),%rax
movzbl (%rax),%eax
sub    $0x30,%eax
mov    %eax,-0x154(%rbp)
jmp    1515 <read_srec+0x375>
mov    -0x128(%rbp),%rax
movzbl (%rax),%edi
call   1080 <tolower@plt>
add    $0xa,%eax
sub    $0x61,%eax
mov    %eax,-0x154(%rbp)
mov    -0x154(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x158(%rbp)
mov    -0x128(%rbp),%rax
movzbl 0x1(%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1557 <read_srec+0x3b7>
mov    -0x128(%rbp),%rax
movzbl 0x1(%rax),%eax
sub    $0x30,%eax
mov    %eax,-0x15c(%rbp)
jmp    1573 <read_srec+0x3d3>
mov    -0x128(%rbp),%rax
movzbl 0x1(%rax),%edi
call   1080 <tolower@plt>
add    $0xa,%eax
sub    $0x61,%eax
mov    %eax,-0x15c(%rbp)
mov    -0x150(%rbp),%eax
mov    -0x158(%rbp),%ecx
mov    -0x15c(%rbp),%edx
add    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x12c(%rbp)
mov    -0x128(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x128(%rbp)
mov    -0x130(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x130(%rbp)
mov    -0x12c(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x160(%rbp)
mov    -0x128(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     15f0 <read_srec+0x450>
mov    -0x128(%rbp),%rax
movzbl (%rax),%eax
sub    $0x30,%eax
mov    %eax,-0x164(%rbp)
jmp    160b <read_srec+0x46b>
mov    -0x128(%rbp),%rax
movzbl (%rax),%edi
call   1080 <tolower@plt>
add    $0xa,%eax
sub    $0x61,%eax
mov    %eax,-0x164(%rbp)
mov    -0x164(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x168(%rbp)
mov    -0x128(%rbp),%rax
movzbl 0x1(%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     164d <read_srec+0x4ad>
mov    -0x128(%rbp),%rax
movzbl 0x1(%rax),%eax
sub    $0x30,%eax
mov    %eax,-0x16c(%rbp)
jmp    1669 <read_srec+0x4c9>
mov    -0x128(%rbp),%rax
movzbl 0x1(%rax),%edi
call   1080 <tolower@plt>
add    $0xa,%eax
sub    $0x61,%eax
mov    %eax,-0x16c(%rbp)
mov    -0x160(%rbp),%eax
mov    -0x168(%rbp),%ecx
mov    -0x16c(%rbp),%edx
add    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x12c(%rbp)
mov    -0x128(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x128(%rbp)
mov    -0x12c(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x170(%rbp)
mov    -0x128(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     16d7 <read_srec+0x537>
mov    -0x128(%rbp),%rax
movzbl (%rax),%eax
sub    $0x30,%eax
mov    %eax,-0x174(%rbp)
jmp    16f2 <read_srec+0x552>
mov    -0x128(%rbp),%rax
movzbl (%rax),%edi
call   1080 <tolower@plt>
add    $0xa,%eax
sub    $0x61,%eax
mov    %eax,-0x174(%rbp)
mov    -0x174(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x178(%rbp)
mov    -0x128(%rbp),%rax
movzbl 0x1(%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1734 <read_srec+0x594>
mov    -0x128(%rbp),%rax
movzbl 0x1(%rax),%eax
sub    $0x30,%eax
mov    %eax,-0x17c(%rbp)
jmp    1750 <read_srec+0x5b0>
mov    -0x128(%rbp),%rax
movzbl 0x1(%rax),%edi
call   1080 <tolower@plt>
add    $0xa,%eax
sub    $0x61,%eax
mov    %eax,-0x17c(%rbp)
mov    -0x170(%rbp),%eax
mov    -0x178(%rbp),%ecx
mov    -0x17c(%rbp),%edx
add    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x12c(%rbp)
mov    -0x128(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x128(%rbp)
mov    -0x130(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x130(%rbp)
mov    -0x130(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x130(%rbp)
cmp    $0x0,%eax
jle    1896 <read_srec+0x6f6>
mov    -0x12c(%rbp),%eax
mov    %eax,-0x180(%rbp)
add    $0x1,%eax
mov    %eax,-0x12c(%rbp)
mov    -0x128(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     17ed <read_srec+0x64d>
mov    -0x128(%rbp),%rax
movzbl (%rax),%eax
sub    $0x30,%eax
mov    %eax,-0x184(%rbp)
jmp    1808 <read_srec+0x668>
mov    -0x128(%rbp),%rax
movzbl (%rax),%edi
call   1080 <tolower@plt>
add    $0xa,%eax
sub    $0x61,%eax
mov    %eax,-0x184(%rbp)
mov    -0x184(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x188(%rbp)
mov    -0x128(%rbp),%rax
movzbl 0x1(%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     184a <read_srec+0x6aa>
mov    -0x128(%rbp),%rax
movzbl 0x1(%rax),%eax
sub    $0x30,%eax
mov    %eax,-0x18c(%rbp)
jmp    1866 <read_srec+0x6c6>
mov    -0x128(%rbp),%rax
movzbl 0x1(%rax),%edi
call   1080 <tolower@plt>
add    $0xa,%eax
sub    $0x61,%eax
mov    %eax,-0x18c(%rbp)
mov    -0x180(%rbp),%edi
mov    -0x188(%rbp),%esi
mov    -0x18c(%rbp),%eax
add    %eax,%esi
call   1070 <store_data@plt>
mov    -0x128(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x128(%rbp)
jmp    178d <read_srec+0x5ed>
jmp    189b <read_srec+0x6fb>
jmp    11e6 <read_srec+0x46>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_srec>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x128,%rsp
mov    %rdi,%rbx
lea    0xe45(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     1545 <read_srec+0x3a5>
mov    %rax,%rbp
lea    0x20(%rsp),%rdi
mov    $0x100,%esi
mov    %rax,%rdx
call   1050 <fgets@plt>
movl   $0x1,0x4(%rsp)
test   %rax,%rax
je     14fe <read_srec+0x35e>
mov    %rbx,0x18(%rsp)
mov    %rbp,0x8(%rsp)
jmp    1220 <read_srec+0x80>
nopl   0x0(%rax,%rax,1)
lea    0x20(%rsp),%rdi
mov    $0x100,%esi
mov    0x8(%rsp),%rbp
mov    %rbp,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     14fe <read_srec+0x35e>
mov    0x20(%rsp),%al
cmp    $0xa,%al
je     1200 <read_srec+0x60>
cmp    $0x53,%al
jne    14f1 <read_srec+0x351>
mov    0x21(%rsp),%al
add    $0xc9,%al
cmp    $0x3,%al
jb     14f9 <read_srec+0x359>
movzbl 0x22(%rsp),%edi
call   10c0 <isxdigit@plt>
test   %eax,%eax
je     151c <read_srec+0x37c>
movzbl 0x23(%rsp),%edi
call   10c0 <isxdigit@plt>
test   %eax,%eax
je     151c <read_srec+0x37c>
movzbl 0x22(%rsp),%edi
call   1030 <isdigit@plt>
movzbl 0x22(%rsp),%ebp
test   %rax,%rax
je     127b <read_srec+0xdb>
add    $0xffffffd0,%ebp
jmp    1287 <read_srec+0xe7>
mov    %ebp,%edi
call   1080 <tolower@plt>
mov    %eax,%ebp
add    $0xffffffa9,%ebp
shl    $0x4,%ebp
movzbl 0x23(%rsp),%edi
call   1030 <isdigit@plt>
movzbl 0x23(%rsp),%ebx
test   %rax,%rax
je     12a3 <read_srec+0x103>
add    $0xffffffd0,%ebx
jmp    12af <read_srec+0x10f>
mov    %ebx,%edi
call   1080 <tolower@plt>
mov    %eax,%ebx
add    $0xffffffa9,%ebx
lea    (%rbx,%rbp,1),%r13d
add    $0xffffffff,%r13d
xor    %r12d,%r12d
mov    0x21(%rsp),%al
lea    0x24(%rsp),%r15
cmp    $0x31,%al
je     139c <read_srec+0x1fc>
cmp    $0x32,%al
je     133f <read_srec+0x19f>
cmp    $0x33,%al
jne    1200 <read_srec+0x60>
movzbl 0x24(%rsp),%edi
call   1030 <isdigit@plt>
movzbl 0x24(%rsp),%r14d
test   %rax,%rax
je     12f2 <read_srec+0x152>
add    $0xffffffd0,%r14d
jmp    1301 <read_srec+0x161>
mov    %r14d,%edi
call   1080 <tolower@plt>
mov    %eax,%r14d
add    $0xffffffa9,%r14d
add    %ebp,%ebx
shl    $0x4,%r14d
movzbl 0x25(%rsp),%edi
call   1030 <isdigit@plt>
movzbl 0x25(%rsp),%r12d
test   %rax,%rax
je     1322 <read_srec+0x182>
add    $0xffffffd0,%r12d
jmp    1331 <read_srec+0x191>
mov    %r12d,%edi
call   1080 <tolower@plt>
mov    %eax,%r12d
add    $0xffffffa9,%r12d
add    %r14d,%r12d
add    $0xfffffffe,%ebx
lea    0x26(%rsp),%r15
mov    %ebx,%r13d
movzbl (%r15),%edi
call   1030 <isdigit@plt>
movzbl (%r15),%ebx
test   %rax,%rax
je     1356 <read_srec+0x1b6>
add    $0xffffffd0,%ebx
jmp    1362 <read_srec+0x1c2>
mov    %ebx,%edi
call   1080 <tolower@plt>
mov    %eax,%ebx
add    $0xffffffa9,%ebx
shl    $0x8,%r12d
shl    $0x4,%ebx
movzbl 0x1(%r15),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
movzbl 0x1(%r15),%eax
test   %rcx,%rcx
je     1385 <read_srec+0x1e5>
add    $0xffffffd0,%eax
jmp    138f <read_srec+0x1ef>
mov    %eax,%edi
call   1080 <tolower@plt>
add    $0xffffffa9,%eax
add    %ebx,%eax
or     %eax,%r12d
add    $0x2,%r15
add    $0xffffffff,%r13d
movzbl (%r15),%edi
call   1030 <isdigit@plt>
movzbl (%r15),%r14d
test   %rax,%rax
je     13b4 <read_srec+0x214>
add    $0xffffffd0,%r14d
jmp    13c3 <read_srec+0x223>
mov    %r14d,%edi
call   1080 <tolower@plt>
mov    %eax,%r14d
add    $0xffffffa9,%r14d
movzbl 0x1(%r15),%edi
call   1030 <isdigit@plt>
movzbl 0x1(%r15),%ebp
test   %rax,%rax
mov    %r12d,0x14(%rsp)
je     13e1 <read_srec+0x241>
add    $0xffffffd0,%ebp
jmp    13ed <read_srec+0x24d>
mov    %ebp,%edi
call   1080 <tolower@plt>
mov    %eax,%ebp
add    $0xffffffa9,%ebp
movzbl 0x2(%r15),%edi
call   1030 <isdigit@plt>
movzbl 0x2(%r15),%r12d
test   %rax,%rax
je     1407 <read_srec+0x267>
add    $0xffffffd0,%r12d
jmp    1416 <read_srec+0x276>
mov    %r12d,%edi
call   1080 <tolower@plt>
mov    %eax,%r12d
add    $0xffffffa9,%r12d
movzbl 0x3(%r15),%edi
call   1030 <isdigit@plt>
movzbl 0x3(%r15),%ebx
test   %rax,%rax
je     1439 <read_srec+0x299>
add    $0xffffffd0,%ebx
cmp    $0x3,%r13d
jl     1200 <read_srec+0x60>
jmp    144f <read_srec+0x2af>
mov    %ebx,%edi
call   1080 <tolower@plt>
mov    %eax,%ebx
add    $0xffffffa9,%ebx
cmp    $0x3,%r13d
jl     1200 <read_srec+0x60>
shl    $0x4,%r14d
add    %r14d,%ebp
mov    0x14(%rsp),%eax
shl    $0x10,%eax
shl    $0x8,%ebp
or     %eax,%ebp
shl    $0x4,%r12d
add    %r12d,%ebx
or     %ebp,%ebx
add    $0x4,%r15
add    $0xfffffffe,%r13d
jmp    14a0 <read_srec+0x300>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0xffffffd0,%esi
add    %ebp,%esi
mov    %ebx,%edi
call   1070 <store_data@plt>
add    $0xffffffff,%r13d
add    $0x1,%ebx
add    $0x2,%r15
test   %r13d,%r13d
jle    1200 <read_srec+0x60>
movzbl (%r15),%edi
call   1030 <isdigit@plt>
movzbl (%r15),%ebp
test   %rax,%rax
je     14c0 <read_srec+0x320>
add    $0xffffffd0,%ebp
jmp    14cc <read_srec+0x32c>
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1080 <tolower@plt>
mov    %eax,%ebp
add    $0xffffffa9,%ebp
shl    $0x4,%ebp
movzbl 0x1(%r15),%edi
call   1030 <isdigit@plt>
movzbl 0x1(%r15),%esi
test   %rax,%rax
jne    1480 <read_srec+0x2e0>
mov    %esi,%edi
call   1080 <tolower@plt>
mov    %eax,%esi
add    $0xffffffa9,%esi
jmp    1483 <read_srec+0x2e3>
movl   $0x0,0x4(%rsp)
mov    0x8(%rsp),%rbp
mov    %rbp,%rdi
call   1040 <fclose@plt>
mov    0x4(%rsp),%eax
add    $0x128,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2abd(%rip),%rax
mov    (%rax),%edi
lea    0xad6(%rip),%rsi
lea    0x20(%rsp),%rcx
mov    0x18(%rsp),%rdx
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    %rbx,%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>

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

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