#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 /*<<< orphan*/ addprop(char *, char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, ...);
unsigned char getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ isalnum(unsigned char);
int /*<<< orphan*/ isalpha(unsigned char);
int /*<<< orphan*/ stderr;
int readprops(char *filename) {
  FILE *ifp;
  unsigned char c;
  int state = 0;
  int linenum = 1;
  char namebuf[128];
  char valbuf[512];
  int i;
  ifp = fopen(filename, "r");
  if (ifp == NULL)
    return (-1);
  while (1) {
  readchar:
    c = getc(ifp);
  again:
    switch (state) {
    case 0:
      if (feof(ifp)) {
        fclose(ifp);
        return (0);
      }
      if (c == ' ' || c == '\t')
        goto readchar;
      if (c == '\n') {
        linenum++;
        goto readchar;
      }
      if (isalpha(c) || (c == '_')) {
        state = 1;
        goto again;
      }
      if (c == '/') {
        c = getc(ifp);
        if (c == '/') {
          state = 4;
          goto readchar;
        } else if (c == '*') {
          state = 3;
          goto readchar;
        } else {
          fprintf(stderr, "unknown token '/' line %d\n", linenum);
          exit(1);
        }
      }
      fprintf(stderr, "unknown token '%c' line %d\n", c, linenum);
      exit(1);
      break;
    case 4:
      while (1) {
        c = getc(ifp);
        if (feof(ifp))
          return (0);
        if (c == '\n') {
          linenum++;
          state = 0;
          goto readchar;
        }
      }
      break;
    case 3:
      while (1) {
        c = getc(ifp);
        if (feof(ifp)) {
          fprintf(stderr, "unterminated comment, line %d\n", linenum);
          exit(1);
        }
        if (c == '*') {
        staragain:
          c = getc(ifp);
          if (c == '/') {
            state = 0;
            goto readchar;
          }
          if (c == '*')
            goto staragain;
        }
      }
      break;
    case 1:
      i = 0;
      namebuf[i++] = c;
      while (1) {
        c = getc(ifp);
        if (feof(ifp)) {
          fprintf(stderr, "EOF while reading a name, line %d\n", linenum);
          exit(1);
        }
        if ((!isalnum(c)) && (c != '_')) {
          namebuf[i] = 0;
          state = 2;
          goto again;
        }
        namebuf[i++] = c;
      }
      break;
    case 2:
      i = 0;
      while ((c == ' ') || (c == '\t') || (c == '=')) {
        c = getc(ifp);
        if (feof(ifp)) {
          fprintf(stderr, "EOF while reading a value, line %d\n", linenum);
          exit(1);
        }
      }
      goto firsttime;
      while (1) {
        c = getc(ifp);
      firsttime:
        if (c == '\\') {
          c = getc(ifp);
          if (feof(ifp)) {
            fprintf(stderr, "EOF after '\\', line %d\n", linenum);
            exit(1);
          }
          valbuf[i++] = c;
          continue;
        }
        if (c == '\n') {
          linenum++;
          while (valbuf[i - 1] == ' ' || valbuf[i - 1] == '\t')
            i--;
          valbuf[i] = 0;
          addprop(namebuf, valbuf);
          state = 0;
          goto readchar;
        }
        valbuf[i++] = c;
      }
    }
  }
}


x86 assembly (clang, -O0):
<readprops>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2d0,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x1,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe5c(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11d8 <readprops+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    16e6 <readprops+0x556>
jmp    11dd <readprops+0x4d>
jmp    11e2 <readprops+0x52>
mov    -0x18(%rbp),%rdi
call   10b0 <getc@plt>
mov    %al,-0x19(%rbp)
mov    -0x20(%rbp),%eax
mov    %rax,-0x2c0(%rbp)
sub    $0x4,%rax
ja     16e1 <readprops+0x551>
mov    -0x2c0(%rbp),%rax
lea    0xdf0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x18(%rbp),%rdi
call   1060 <feof@plt>
cmp    $0x0,%eax
je     1240 <readprops+0xb0>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
jmp    16e6 <readprops+0x556>
movzbl -0x19(%rbp),%eax
cmp    $0x20,%eax
je     125a <readprops+0xca>
movzbl -0x19(%rbp),%eax
cmp    $0x9,%eax
jne    125f <readprops+0xcf>
jmp    11e2 <readprops+0x52>
movzbl -0x19(%rbp),%eax
cmp    $0xa,%eax
jne    127a <readprops+0xea>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11e2 <readprops+0x52>
movzbl -0x19(%rbp),%edi
call   1080 <isalpha@plt>
cmp    $0x0,%eax
jne    1299 <readprops+0x109>
movzbl -0x19(%rbp),%eax
cmp    $0x5f,%eax
jne    12a5 <readprops+0x115>
movl   $0x1,-0x20(%rbp)
jmp    11ee <readprops+0x5e>
movzbl -0x19(%rbp),%eax
cmp    $0x2f,%eax
jne    1314 <readprops+0x184>
mov    -0x18(%rbp),%rdi
call   10b0 <getc@plt>
mov    %al,-0x19(%rbp)
movzbl -0x19(%rbp),%eax
cmp    $0x2f,%eax
jne    12d7 <readprops+0x147>
movl   $0x4,-0x20(%rbp)
jmp    11e2 <readprops+0x52>
movzbl -0x19(%rbp),%eax
cmp    $0x2a,%eax
jne    12f0 <readprops+0x160>
movl   $0x3,-0x20(%rbp)
jmp    11e2 <readprops+0x52>
mov    0x2ce9(%rip),%rax
mov    (%rax),%edi
mov    -0x24(%rbp),%edx
lea    0xd13(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    0x2cc5(%rip),%rax
mov    (%rax),%edi
movzbl -0x19(%rbp),%edx
mov    -0x24(%rbp),%ecx
lea    0xd06(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
jmp    1341 <readprops+0x1b1>
mov    -0x18(%rbp),%rdi
call   10b0 <getc@plt>
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <feof@plt>
cmp    $0x0,%eax
je     136b <readprops+0x1db>
movl   $0x0,-0x4(%rbp)
jmp    16e6 <readprops+0x556>
movzbl -0x19(%rbp),%eax
cmp    $0xa,%eax
jne    138d <readprops+0x1fd>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
movl   $0x0,-0x20(%rbp)
jmp    11e2 <readprops+0x52>
jmp    1341 <readprops+0x1b1>
jmp    1397 <readprops+0x207>
mov    -0x18(%rbp),%rdi
call   10b0 <getc@plt>
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <feof@plt>
cmp    $0x0,%eax
je     13d9 <readprops+0x249>
mov    0x2c24(%rip),%rax
mov    (%rax),%edi
mov    -0x24(%rbp),%edx
lea    0xc85(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
movzbl -0x19(%rbp),%eax
cmp    $0x2a,%eax
jne    1427 <readprops+0x297>
jmp    13eb <readprops+0x25b>
mov    -0x18(%rbp),%rdi
call   10b0 <getc@plt>
mov    %al,-0x19(%rbp)
movzbl -0x19(%rbp),%eax
cmp    $0x2f,%eax
jne    1410 <readprops+0x280>
movl   $0x0,-0x20(%rbp)
jmp    11e2 <readprops+0x52>
movzbl -0x19(%rbp),%eax
cmp    $0x2a,%eax
jne    1422 <readprops+0x292>
jmp    13eb <readprops+0x25b>
jmp    1427 <readprops+0x297>
jmp    1397 <readprops+0x207>
movl   $0x0,-0x2b4(%rbp)
mov    -0x19(%rbp),%cl
mov    -0x2b4(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x2b4(%rbp)
cltq
mov    %cl,-0xb0(%rbp,%rax,1)
mov    -0x18(%rbp),%rdi
call   10b0 <getc@plt>
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <feof@plt>
cmp    $0x0,%eax
je     1495 <readprops+0x305>
mov    0x2b68(%rip),%rax
mov    (%rax),%edi
mov    -0x24(%rbp),%edx
lea    0xbe8(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
movzbl -0x19(%rbp),%edi
call   1040 <isalnum@plt>
cmp    $0x0,%eax
jne    14cf <readprops+0x33f>
movzbl -0x19(%rbp),%eax
cmp    $0x5f,%eax
je     14cf <readprops+0x33f>
movslq -0x2b4(%rbp),%rax
movb   $0x0,-0xb0(%rbp,%rax,1)
movl   $0x2,-0x20(%rbp)
jmp    11ee <readprops+0x5e>
mov    -0x19(%rbp),%cl
mov    -0x2b4(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x2b4(%rbp)
cltq
mov    %cl,-0xb0(%rbp,%rax,1)
jmp    1453 <readprops+0x2c3>
movl   $0x0,-0x2b4(%rbp)
movzbl -0x19(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2c1(%rbp)
je     1535 <readprops+0x3a5>
movzbl -0x19(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2c1(%rbp)
je     1535 <readprops+0x3a5>
movzbl -0x19(%rbp),%eax
cmp    $0x3d,%eax
sete   %al
mov    %al,-0x2c1(%rbp)
mov    -0x2c1(%rbp),%al
test   $0x1,%al
jne    1548 <readprops+0x3b8>
jmp    158f <readprops+0x3ff>
mov    -0x18(%rbp),%rdi
call   10b0 <getc@plt>
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <feof@plt>
cmp    $0x0,%eax
je     158a <readprops+0x3fa>
mov    0x2a73(%rip),%rax
mov    (%rax),%edi
mov    -0x24(%rbp),%edx
lea    0xb16(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
jmp    14fb <readprops+0x36b>
jmp    15a0 <readprops+0x410>
mov    -0x18(%rbp),%rdi
call   10b0 <getc@plt>
mov    %al,-0x19(%rbp)
movzbl -0x19(%rbp),%eax
cmp    $0x5c,%eax
jne    1611 <readprops+0x481>
mov    -0x18(%rbp),%rdi
call   10b0 <getc@plt>
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <feof@plt>
cmp    $0x0,%eax
je     15ef <readprops+0x45f>
mov    0x2a0e(%rip),%rax
mov    (%rax),%edi
mov    -0x24(%rbp),%edx
lea    0xad5(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    -0x19(%rbp),%cl
mov    -0x2b4(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x2b4(%rbp)
cltq
mov    %cl,-0x2b0(%rbp,%rax,1)
jmp    1594 <readprops+0x404>
movzbl -0x19(%rbp),%eax
cmp    $0xa,%eax
jne    16bf <readprops+0x52f>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x2b4(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x2b0(%rbp,%rax,1),%ecx
ff
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2c2(%rbp)
je     166a <readprops+0x4da>
mov    -0x2b4(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x2b0(%rbp,%rax,1),%eax
ff
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2c2(%rbp)
mov    -0x2c2(%rbp),%al
test   $0x1,%al
jne    167d <readprops+0x4ed>
jmp    1691 <readprops+0x501>
mov    -0x2b4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x2b4(%rbp)
jmp    1627 <readprops+0x497>
movslq -0x2b4(%rbp),%rax
movb   $0x0,-0x2b0(%rbp,%rax,1)
lea    -0xb0(%rbp),%rdi
lea    -0x2b0(%rbp),%rsi
call   1070 <addprop@plt>
movl   $0x0,-0x20(%rbp)
jmp    11e2 <readprops+0x52>
mov    -0x19(%rbp),%cl
mov    -0x2b4(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x2b4(%rbp)
cltq
mov    %cl,-0x2b0(%rbp,%rax,1)
jmp    1594 <readprops+0x404>
jmp    11dd <readprops+0x4d>
mov    -0x4(%rbp),%eax
add    $0x2d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readprops>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x298,%rsp
lea    0xe68(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     1459 <readprops+0x2c9>
mov    %rax,%r15
mov    $0x1,%r12d
xor    %ebp,%ebp
movabs $0x2000000100000200,%r14
jmp    11d2 <readprops+0x42>
nopl   (%rax)
xor    %ebp,%ebp
mov    %r15,%rdi
call   10b0 <getc@plt>
mov    %eax,%ebx
test   %ebp,%ebp
jne    1222 <readprops+0x92>
mov    %r15,%rdi
call   1060 <feof@plt>
test   %eax,%eax
jne    144d <readprops+0x2bd>
cmp    $0x9,%bl
je     11d0 <readprops+0x40>
cmp    $0xa,%bl
je     1412 <readprops+0x282>
cmp    $0x20,%bl
je     11d0 <readprops+0x40>
movzbl %bl,%r13d
mov    %r13d,%edi
call   1080 <isalpha@plt>
mov    $0x1,%ebp
test   %eax,%eax
jne    11dc <readprops+0x4c>
cmp    $0x5f,%bl
je     11dc <readprops+0x4c>
jmp    141d <readprops+0x28d>
lea    -0x1(%rbp),%eax
cmp    $0x3,%eax
ja     11d2 <readprops+0x42>
lea    0xdcf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    %r12d,%r13d
mov    %bl,0x10(%rsp)
mov    %r15,%rdi
call   10b0 <getc@plt>
mov    %eax,%ebx
mov    %r15,%rdi
call   1060 <feof@plt>
test   %eax,%eax
jne    1485 <readprops+0x2f5>
mov    $0x1,%ebp
jmp    1292 <readprops+0x102>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %bl,0x10(%rsp,%rbp,1)
add    $0x1,%rbp
mov    %r15,%rdi
call   10b0 <getc@plt>
mov    %eax,%ebx
mov    %r15,%rdi
call   1060 <feof@plt>
test   %eax,%eax
jne    1485 <readprops+0x2f5>
movzbl %bl,%r12d
mov    %r12d,%edi
call   1040 <isalnum@plt>
cmp    $0x5f,%r12b
je     1270 <readprops+0xe0>
test   %eax,%eax
jne    1270 <readprops+0xe0>
mov    %ebp,%eax
movb   $0x0,0x10(%rsp,%rax,1)
mov    $0x2,%ebp
mov    %r13d,%r12d
jmp    11dc <readprops+0x4c>
nopl   0x0(%rax)
mov    %r15,%rdi
call   10b0 <getc@plt>
mov    %eax,%ebx
mov    %r15,%rdi
call   1060 <feof@plt>
test   %eax,%eax
jne    1455 <readprops+0x2c5>
cmp    $0xa,%bl
jne    12c0 <readprops+0x130>
jmp    1412 <readprops+0x282>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r15,%rdi
call   10b0 <getc@plt>
mov    %eax,%ebx
mov    %r15,%rdi
call   1060 <feof@plt>
test   %eax,%eax
jne    14bf <readprops+0x32f>
cmp    $0x2a,%bl
jne    12f0 <readprops+0x160>
nop
mov    %r15,%rdi
call   10b0 <getc@plt>
cmp    $0x2a,%al
je     1310 <readprops+0x180>
cmp    $0x2f,%al
jne    12f0 <readprops+0x160>
jmp    11d0 <readprops+0x40>
mov    %r12d,0xc(%rsp)
nopw   0x0(%rax,%rax,1)
cmp    $0x3d,%bl
ja     1359 <readprops+0x1c9>
movzbl %bl,%eax
bt     %rax,%r14
jae    1359 <readprops+0x1c9>
mov    %r15,%rdi
call   10b0 <getc@plt>
mov    %eax,%ebx
mov    %r15,%rdi
call   1060 <feof@plt>
test   %eax,%eax
je     1330 <readprops+0x1a0>
jmp    1470 <readprops+0x2e0>
xor    %r13d,%r13d
lea    0x90(%rsp),%rbp
xor    %r12d,%r12d
jmp    13ac <readprops+0x21c>
nopl   0x0(%rax)
mov    %r15,%rdi
call   10b0 <getc@plt>
mov    %eax,%ebx
mov    %r15,%rdi
call   1060 <feof@plt>
test   %eax,%eax
jne    149a <readprops+0x30a>
mov    %bl,0x0(%rbp)
mov    %r15,%rdi
call   10b0 <getc@plt>
mov    %eax,%ebx
movabs $0x100000000,%rax
add    %rax,%r12
add    $0x1,%rbp
add    $0x1,%r13d
cmp    $0x5c,%bl
je     1370 <readprops+0x1e0>
cmp    $0xa,%bl
jne    138a <readprops+0x1fa>
movslq %r13d,%rax
lea    0x8f(%rsp),%rcx
add    %rax,%rcx
shl    $0x20,%rax
mov    0xc(%rsp),%r12d
movabs $0xffffffff00000000,%rsi
ff ff ff
jmp    13e7 <readprops+0x257>
nopl   0x0(%rax)
add    %rsi,%rax
add    $0xffffffffffffffff,%rcx
movzbl (%rcx),%edx
cmp    $0x20,%dl
je     13e0 <readprops+0x250>
cmp    $0x9,%dl
je     13e0 <readprops+0x250>
sar    $0x20,%rax
movb   $0x0,0x90(%rsp,%rax,1)
lea    0x10(%rsp),%rdi
lea    0x90(%rsp),%rsi
call   1070 <addprop@plt>
add    $0x1,%r12d
xor    %ebp,%ebp
jmp    11d2 <readprops+0x42>
cmp    $0x2f,%bl
jne    14d4 <readprops+0x344>
mov    %r15,%rdi
call   10b0 <getc@plt>
mov    $0x4,%ebp
cmp    $0x2f,%al
je     11d2 <readprops+0x42>
cmp    $0x2a,%al
jne    14fb <readprops+0x36b>
mov    $0x3,%ebp
jmp    11d2 <readprops+0x42>
mov    %r15,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
jmp    145e <readprops+0x2ce>
mov    $0xffffffff,%eax
add    $0x298,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2b69(%rip),%rax
mov    (%rax),%edi
lea    0xc0b(%rip),%rsi
mov    %r12d,%edx
jmp    14ae <readprops+0x31e>
mov    0x2b54(%rip),%rax
mov    (%rax),%edi
lea    0xbd3(%rip),%rsi
mov    %r13d,%edx
jmp    14ae <readprops+0x31e>
mov    0x2b3f(%rip),%rax
mov    (%rax),%edi
lea    0xc05(%rip),%rsi
mov    0xc(%rsp),%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    %r12d,%edx
mov    0x2b17(%rip),%rax
mov    (%rax),%edi
lea    0xb77(%rip),%rsi
jmp    14ae <readprops+0x31e>
mov    0x2b05(%rip),%rax
mov    (%rax),%edi
lea    0xb49(%rip),%rsi
mov    %r13d,%edx
mov    %r12d,%ecx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    0x2ade(%rip),%rax
mov    (%rax),%edi
lea    0xb07(%rip),%rsi
jmp    1480 <readprops+0x2f0>

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [27 x i8] c"unknown token '/' line %d\0A\00"
@.str.2 = [28 x i8] c"unknown token '%c' line %d\0A\00"
@.str.3 = [31 x i8] c"unterminated comment, line %d\0A\00"
@.str.4 = [35 x i8] c"EOF while reading a name, line %d\0A\00"
@.str.5 = [36 x i8] c"EOF while reading a value, line %d\0A\00"
@.str.6 = [24 x i8] c"EOF after '\\', line %d\0A\00"
define i32 @readprops(i8* nocapture %0) {
%2 = alloca [128 x i8]
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%6 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i32* %6, null
br i1 %7, label %136, label %8
8: ; preds = %1, %134
%9 = phi i32 [ %135, %134 ], [ 1, %1 ]
br label %10
10: ; preds = %19, %8
%11 = phi i32 [ 0, %8 ], [ %20, %19 ]
br label %12
12: ; preds = %40, %10
%13 = phi i32 [ %11, %10 ], [ %41, %40 ]
%14 = call zeroext i8 @getc(i32* %6)
br label %15
15: ; preds = %85, %12
%16 = phi i8 [ %80, %85 ], [ %14, %12 ]
%17 = phi i32 [ 2, %85 ], [ %13, %12 ]
%18 = icmp eq i8 %16, 95
br label %19
19: ; preds = %15, %31
%20 = phi i32 [ 1, %31 ], [ %17, %15 ]
switch i32 %20, label %10 [
i32 0, label %25
i32 4, label %51
i32 3, label %21
i32 1, label %70
i32 2, label %94
]
21: ; preds = %19
%22 = call zeroext i8 @getc(i32* %6)
%23 = call i32 @feof(i32* %6)
%24 = icmp eq i32 %23, 0
br i1 %24, label %61, label %57
25: ; preds = %19
%26 = call i32 @feof(i32* %6)
%27 = icmp eq i32 %26, 0
br i1 %27, label %30, label %28
28: ; preds = %25
%29 = call i32 @fclose(i32* %6)
br label %136
30: ; preds = %25
switch i8 %16, label %31 [
i8 32, label %40
i8 9, label %40
i8 10, label %134
]
31: ; preds = %30
%32 = call i32 @isalpha(i8 zeroext %16)
%33 = icmp ne i32 %32, 0
%34 = or i1 %33, %18
br i1 %34, label %19, label %35
35: ; preds = %31
%36 = icmp eq i8 %16, 47
br i1 %36, label %37, label %46
37: ; preds = %35
%38 = call zeroext i8 @getc(i32* %6)
switch i8 %38, label %42 [
i8 47, label %40
i8 42, label %39
]
39: ; preds = %37
br label %40
40: ; preds = %30, %30, %64, %39, %37
%41 = phi i32 [ 3, %39 ], [ 4, %37 ], [ 0, %64 ], [ 0, %30 ], [ 0, %30 ]
br label %12
42: ; preds = %37
%43 = load i32, i32* @stderr
%44 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%45 = call i32 @exit(i32 1)
unreachable
46: ; preds = %35
%47 = zext i8 %16 to i32
%48 = load i32, i32* @stderr
%49 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %47, i32 %9)
%50 = call i32 @exit(i32 1)
unreachable
51: ; preds = %19, %55
%52 = call zeroext i8 @getc(i32* %6)
%53 = call i32 @feof(i32* %6)
%54 = icmp eq i32 %53, 0
br i1 %54, label %55, label %136
55: ; preds = %51
%56 = icmp eq i8 %52, 10
br i1 %56, label %134, label %51
57: ; preds = %21, %66
%58 = load i32, i32* @stderr
%59 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 %9)
%60 = call i32 @exit(i32 1)
unreachable
61: ; preds = %21, %66
%62 = phi i8 [ %67, %66 ], [ %22, %21 ]
%63 = icmp eq i8 %62, 42
br i1 %63, label %64, label %66
64: ; preds = %61, %64
%65 = call zeroext i8 @getc(i32* %6)
switch i8 %65, label %66 [
i8 47, label %40
i8 42, label %64
]
66: ; preds = %64, %61
%67 = call zeroext i8 @getc(i32* %6)
%68 = call i32 @feof(i32* %6)
%69 = icmp eq i32 %68, 0
br i1 %69, label %61, label %57
70: ; preds = %19
store i8 %16, i8* %4
%71 = call zeroext i8 @getc(i32* %6)
%72 = call i32 @feof(i32* %6)
%73 = icmp eq i32 %72, 0
br i1 %73, label %78, label %74
74: ; preds = %70, %88
%75 = load i32, i32* @stderr
%76 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %75, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i32 %9)
%77 = call i32 @exit(i32 1)
unreachable
78: ; preds = %70, %88
%79 = phi i64 [ %89, %88 ], [ 1, %70 ]
%80 = phi i8 [ %91, %88 ], [ %71, %70 ]
%81 = call i32 @isalnum(i8 zeroext %80)
%82 = icmp eq i32 %81, 0
%83 = icmp ne i8 %80, 95
%84 = and i1 %83, %82
br i1 %84, label %85, label %88
85: ; preds = %78
%86 = and i64 %79, 4294967295
%87 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 %86
store i8 0, i8* %87
br label %15
88: ; preds = %78
%89 = add nuw i64 %79, 1
%90 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 %79
store i8 %80, i8* %90
%91 = call zeroext i8 @getc(i32* %6)
%92 = call i32 @feof(i32* %6)
%93 = icmp eq i32 %92, 0
br i1 %93, label %78, label %74
94: ; preds = %19, %96
%95 = phi i8 [ %97, %96 ], [ %16, %19 ]
switch i8 %95, label %109 [
i8 61, label %96
i8 32, label %96
i8 9, label %96
]
96: ; preds = %94, %94, %94
%97 = call zeroext i8 @getc(i32* %6)
%98 = call i32 @feof(i32* %6)
%99 = icmp eq i32 %98, 0
br i1 %99, label %94, label %100
100: ; preds = %96
%101 = load i32, i32* @stderr
%102 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %101, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i32 %9)
%103 = call i32 @exit(i32 1)
unreachable
104: ; preds = %109, %112
%105 = phi i8 [ %113, %112 ], [ %111, %109 ]
%106 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 %110
store i8 %105, i8* %106
%107 = add nuw i64 %110, 1
%108 = call zeroext i8 @getc(i32* %6)
br label %109
109: ; preds = %94, %104
%110 = phi i64 [ %107, %104 ], [ 0, %94 ]
%111 = phi i8 [ %108, %104 ], [ %95, %94 ]
switch i8 %111, label %104 [
i8 92, label %112
i8 10, label %120
]
112: ; preds = %109
%113 = call zeroext i8 @getc(i32* %6)
%114 = call i32 @feof(i32* %6)
%115 = icmp eq i32 %114, 0
br i1 %115, label %104, label %116
116: ; preds = %112
%117 = load i32, i32* @stderr
%118 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %117, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i32 %9)
%119 = call i32 @exit(i32 1)
unreachable
120: ; preds = %109
%121 = shl i64 %110, 32
%122 = ashr exact i64 %121, 32
br label %123
123: ; preds = %128, %120
%124 = phi i64 [ %122, %120 ], [ %125, %128 ]
%125 = add nsw i64 %124, -1
%126 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 %125
%127 = load i8, i8* %126
switch i8 %127, label %129 [
i8 32, label %128
i8 9, label %128
]
128: ; preds = %123, %123
br label %123
129: ; preds = %123
%130 = shl i64 %124, 32
%131 = ashr exact i64 %130, 32
%132 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 %131
store i8 0, i8* %132
%133 = call i32 @addprop(i8* %4, i8* %5)
br label %134
134: ; preds = %55, %30, %129
%135 = add nuw nsw i32 %9, 1
br label %8
136: ; preds = %51, %1, %28
%137 = phi i32 [ 0, %28 ], [ -1, %1 ], [ 0, %51 ]
ret i32 %137
}