#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;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
scalar_t__ strchr(char *, char);
int main(int ac, char **av) {
  int in_comm1 = 0;
  int in_comm2 = 0;
  int in_str1 = 0;
  int in_str2 = 0;
  int ch0, ch1, ch2;
  int wr, rd;
  char buf[128];
  int slen;
  char *p;
  int a;
  rd = 3;
  wr = 0;
  while (1) {
    while (wr-- > 0) {
      putchar(ch0);
      {
        ch0 = ch1;
        ch1 = ch2;
        ch2 = getchar();
      };
    }
    while (rd-- > 0) {
      {
        ch0 = ch1;
        ch1 = ch2;
        ch2 = getchar();
      };
    }
    if (ch0 < 0)
      break;
    if (in_comm1) {
      if (ch0 == '*' && ch1 == '/') {
        wr = 2;
        in_comm1 = 0;
        continue;
      }
      wr = 1;
      continue;
    }
    if (in_comm2) {
      if (ch0 == '\n') {
        putchar(' ');
        putchar('*');
        putchar('/');
        wr = 1;
        in_comm2 = 0;
        continue;
      }
      wr = 1;
      continue;
    }
    if (in_str1) {
      if (ch0 == '\\') {
        wr = 2;
        continue;
      }
      if (ch0 == '"') {
        wr = 1;
        in_str1 = 0;
        continue;
      }
      wr = 1;
      continue;
    }
    if (in_str2) {
      if (ch0 == '\'') {
        rd = 1;
        in_str2 = 0;
        buf[slen] = 0;
        if (slen <= 1 || strchr(buf, '\\')) {
          putchar('\'');
          fputs(buf, stdout);
          putchar('\'');
          continue;
        }
        for (a = 0, p = buf; *p; p++)
          a = (a << 8) | (*p & 255);
        printf("0x%08X", a);
        continue;
      }
      if (slen + 3 > sizeof(buf)) {
        fprintf(stderr, "jim_pp: Bad '' string -- too long\n");
        exit(1);
      }
      if (ch0 == '\\') {
        buf[slen++] = ch0;
        buf[slen++] = ch1;
        rd = 2;
        continue;
      }
      buf[slen++] = ch0;
      rd = 1;
      continue;
    }
    if (ch0 == '/' && ch1 == '*') {
      wr = 2;
      in_comm1 = 1;
      continue;
    }
    if (ch0 == '/' && ch1 == '/') {
      putchar('/');
      putchar('*');
      rd = 2;
      in_comm2 = 1;
      continue;
    }
    if (ch0 == '"') {
      wr = 1;
      in_str1 = 1;
      continue;
    }
    if (ch0 == '\'') {
      rd = 1;
      slen = 0;
      in_str2 = 1;
      continue;
    }
    wr = 1;
    continue;
  }
  if (in_comm1) {
    fprintf(stderr, "Unterminated /* */ comment at end of file\n");
    exit(1);
  }
  if (in_comm2) {
    printf(" */");
  }
  if (in_str1) {
    fprintf(stderr, "Unterminated \"\" string at end of file\n");
    exit(1);
  }
  if (in_str2) {
    fprintf(stderr, "Unterminated '' string at end of file\n");
    exit(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x3,-0x34(%rbp)
movl   $0x0,-0x30(%rbp)
jmp    11b8 <main+0x48>
mov    -0x30(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x30(%rbp)
cmp    $0x0,%eax
jle    11f2 <main+0x82>
mov    -0x24(%rbp),%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    -0x28(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    $0x0,%al
call   1070 <getchar@plt>
mov    %eax,-0x2c(%rbp)
jmp    11b8 <main+0x48>
jmp    11f7 <main+0x87>
mov    -0x34(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x34(%rbp)
cmp    $0x0,%eax
jle    1226 <main+0xb6>
mov    -0x28(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    $0x0,%al
call   1070 <getchar@plt>
mov    %eax,-0x2c(%rbp)
jmp    11f7 <main+0x87>
cmpl   $0x0,-0x24(%rbp)
jge    1235 <main+0xc5>
jmp    1573 <main+0x403>
cmpl   $0x0,-0x14(%rbp)
je     1272 <main+0x102>
cmpl   $0x2a,-0x24(%rbp)
jne    1266 <main+0xf6>
cmpl   $0x2f,-0x28(%rbp)
jne    1266 <main+0xf6>
movl   $0x2,-0x30(%rbp)
movl   $0x0,-0x14(%rbp)
jmp    11b3 <main+0x43>
movl   $0x1,-0x30(%rbp)
jmp    11b3 <main+0x43>
cmpl   $0x0,-0x18(%rbp)
je     12c3 <main+0x153>
cmpl   $0xa,-0x24(%rbp)
jne    12b7 <main+0x147>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2f,%edi
call   1030 <putchar@plt>
movl   $0x1,-0x30(%rbp)
movl   $0x0,-0x18(%rbp)
jmp    11b3 <main+0x43>
movl   $0x1,-0x30(%rbp)
jmp    11b3 <main+0x43>
cmpl   $0x0,-0x1c(%rbp)
je     130c <main+0x19c>
cmpl   $0x5c,-0x24(%rbp)
jne    12e3 <main+0x173>
movl   $0x2,-0x30(%rbp)
jmp    11b3 <main+0x43>
cmpl   $0x22,-0x24(%rbp)
jne    1300 <main+0x190>
movl   $0x1,-0x30(%rbp)
movl   $0x0,-0x1c(%rbp)
jmp    11b3 <main+0x43>
movl   $0x1,-0x30(%rbp)
jmp    11b3 <main+0x43>
cmpl   $0x0,-0x20(%rbp)
je     14c1 <main+0x351>
cmpl   $0x27,-0x24(%rbp)
jne    140c <main+0x29c>
movl   $0x1,-0x34(%rbp)
movl   $0x0,-0x20(%rbp)
movslq -0xc4(%rbp),%rax
movb   $0x0,-0xc0(%rbp,%rax,1)
cmpl   $0x1,-0xc4(%rbp)
jle    1365 <main+0x1f5>
lea    -0xc0(%rbp),%rdi
mov    $0x5c,%esi
call   1040 <strchr@plt>
cmp    $0x0,%rax
je     1393 <main+0x223>
mov    $0x27,%edi
call   1030 <putchar@plt>
lea    -0xc0(%rbp),%rdi
mov    0x2c5b(%rip),%rax
mov    (%rax),%esi
call   1060 <fputs@plt>
mov    $0x27,%edi
call   1030 <putchar@plt>
jmp    11b3 <main+0x43>
movl   $0x0,-0xd4(%rbp)
lea    -0xc0(%rbp),%rax
mov    %rax,-0xd0(%rbp)
mov    -0xd0(%rbp),%rax
cmpb   $0x0,(%rax)
je     13f3 <main+0x283>
mov    -0xd4(%rbp),%eax
shl    $0x8,%eax
mov    -0xd0(%rbp),%rcx
movsbl (%rcx),%ecx
and    $0xff,%ecx
or     %ecx,%eax
mov    %eax,-0xd4(%rbp)
mov    -0xd0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xd0(%rbp)
jmp    13ab <main+0x23b>
mov    -0xd4(%rbp),%esi
lea    0xc00(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    11b3 <main+0x43>
mov    -0xc4(%rbp),%eax
add    $0x3,%eax
cltq
cmp    $0x80,%rax
jbe    1442 <main+0x2d2>
mov    0x2bb6(%rip),%rax
mov    (%rax),%edi
lea    0xbd4(%rip),%rsi
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
cmpl   $0x5c,-0x24(%rbp)
jne    1496 <main+0x326>
mov    -0x24(%rbp),%eax
mov    %al,%cl
mov    -0xc4(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0xc4(%rbp)
cltq
mov    %cl,-0xc0(%rbp,%rax,1)
mov    -0x28(%rbp),%eax
mov    %al,%cl
mov    -0xc4(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0xc4(%rbp)
cltq
mov    %cl,-0xc0(%rbp,%rax,1)
movl   $0x2,-0x34(%rbp)
jmp    11b3 <main+0x43>
mov    -0x24(%rbp),%eax
mov    %al,%cl
mov    -0xc4(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0xc4(%rbp)
cltq
mov    %cl,-0xc0(%rbp,%rax,1)
movl   $0x1,-0x34(%rbp)
jmp    11b3 <main+0x43>
cmpl   $0x2f,-0x24(%rbp)
jne    14e8 <main+0x378>
cmpl   $0x2a,-0x28(%rbp)
jne    14e8 <main+0x378>
movl   $0x2,-0x30(%rbp)
movl   $0x1,-0x14(%rbp)
jmp    11b3 <main+0x43>
cmpl   $0x2f,-0x24(%rbp)
jne    1523 <main+0x3b3>
cmpl   $0x2f,-0x28(%rbp)
jne    1523 <main+0x3b3>
mov    $0x2f,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
movl   $0x2,-0x34(%rbp)
movl   $0x1,-0x18(%rbp)
jmp    11b3 <main+0x43>
cmpl   $0x22,-0x24(%rbp)
jne    1540 <main+0x3d0>
movl   $0x1,-0x30(%rbp)
movl   $0x1,-0x1c(%rbp)
jmp    11b3 <main+0x43>
cmpl   $0x27,-0x24(%rbp)
jne    1567 <main+0x3f7>
movl   $0x1,-0x34(%rbp)
movl   $0x0,-0xc4(%rbp)
movl   $0x1,-0x20(%rbp)
jmp    11b3 <main+0x43>
movl   $0x1,-0x30(%rbp)
jmp    11b3 <main+0x43>
cmpl   $0x0,-0x14(%rbp)
je     159c <main+0x42c>
mov    0x2a5c(%rip),%rax
mov    (%rax),%edi
lea    0xa9d(%rip),%rsi
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
cmpl   $0x0,-0x18(%rbp)
je     15b4 <main+0x444>
lea    0xaa8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpl   $0x0,-0x1c(%rbp)
je     15dd <main+0x46d>
mov    0x2a1b(%rip),%rax
mov    (%rax),%edi
lea    0xa8b(%rip),%rsi
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
cmpl   $0x0,-0x20(%rbp)
je     1606 <main+0x496>
mov    0x29f2(%rip),%rax
mov    (%rax),%edi
lea    0xa89(%rip),%rsi
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
mov    $0x3,%r12d
mov    $0x1,%al
mov    %eax,(%rsp)
movl   $0x0,0x4(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0xc(%rsp)
xor    %r15d,%r15d
mov    %rax,0x10(%rsp)
jmp    11e0 <main+0x70>
xchg   %ax,%ax
mov    %r13d,%eax
xor    $0x2a,%eax
mov    %ebp,%ecx
xor    $0x2f,%ecx
xor    %r15d,%r15d
or     %eax,%ecx
mov    $0x2a,%eax
cmove  %eax,%r13d
sete   %r15b
mov    $0x2f,%eax
cmove  %eax,%ebp
mov    %r15d,(%rsp)
add    $0x1,%r15d
mov    %r13d,%ebx
test   %r15d,%r15d
jle    1220 <main+0xb0>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%eax
mov    %ebp,%ebx
mov    %r14d,%ebp
movsbl %al,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1070 <getchar@plt>
mov    %eax,%r14d
add    $0xffffffff,%r15d
jne    11f0 <main+0x80>
mov    $0xffffffff,%r15d
test   %r12d,%r12d
jg     1230 <main+0xc0>
jmp    1260 <main+0xf0>
nopl   0x0(%rax)
add    $0xffffffff,%r15d
test   %r12d,%r12d
jle    1260 <main+0xf0>
nopl   0x0(%rax)
mov    %ebp,%r13d
mov    %r14d,%ebp
xor    %eax,%eax
call   1070 <getchar@plt>
mov    %eax,%r14d
add    $0xffffffff,%r12d
jne    1230 <main+0xc0>
mov    $0xffffffff,%r12d
test   %r13d,%r13d
jns    1270 <main+0x100>
jmp    15ea <main+0x47a>
cs nopw 0x0(%rax,%rax,1)
add    $0xffffffff,%r12d
mov    %ebx,%r13d
test   %r13d,%r13d
js     15ea <main+0x47a>
testb  $0x1,(%rsp)
je     11b0 <main+0x40>
cmpl   $0x0,0x4(%rsp)
je     12d6 <main+0x166>
mov    $0x1,%r15d
mov    $0x1,%al
mov    %eax,(%rsp)
movl   $0x1,0x4(%rsp)
mov    %r13d,%ebx
cmp    $0xa,%r13d
jne    11e0 <main+0x70>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2f,%edi
call   1030 <putchar@plt>
mov    $0xa,%ebx
mov    $0x1,%al
mov    %eax,(%rsp)
movl   $0x0,0x4(%rsp)
jmp    11e0 <main+0x70>
cmpl   $0x0,0x8(%rsp)
je     1321 <main+0x1b1>
mov    $0x2,%r15d
movl   $0x1,0x8(%rsp)
mov    $0x1,%al
mov    %eax,(%rsp)
movl   $0x0,0x4(%rsp)
mov    %r13d,%ebx
cmp    $0x5c,%r13d
je     11e0 <main+0x70>
mov    %ebp,%eax
cmp    $0x22,%r13d
jne    13b4 <main+0x244>
mov    $0x1,%r15d
mov    $0x22,%ebx
jmp    14b8 <main+0x348>
cmpl   $0x0,0xc(%rsp)
je     13d7 <main+0x267>
cmp    $0x27,%r13d
jne    1472 <main+0x302>
mov    0x10(%rsp),%rcx
movslq %ecx,%rax
movb   $0x0,0x20(%rsp,%rax,1)
cmp    $0x2,%ecx
jl     1360 <main+0x1f0>
lea    0x20(%rsp),%rdi
mov    $0x5c,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1561 <main+0x3f1>
mov    $0x27,%ebx
mov    $0x27,%edi
call   1030 <putchar@plt>
mov    0x2c62(%rip),%rax
mov    (%rax),%esi
lea    0x20(%rsp),%rdi
call   1060 <fputs@plt>
mov    $0x27,%edi
call   1030 <putchar@plt>
mov    $0x1,%r12d
mov    $0x1,%al
mov    %eax,(%rsp)
movl   $0x0,0x4(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0xc(%rsp)
jmp    11e0 <main+0x70>
movl   $0x1,0x8(%rsp)
mov    $0x1,%al
mov    %eax,(%rsp)
movl   $0x0,0x4(%rsp)
mov    %r13d,%ebx
mov    $0x1,%r15d
jmp    11e0 <main+0x70>
mov    %r15d,0x1c(%rsp)
movl   $0x0,0xc(%rsp)
cmp    $0x2f,%r13d
mov    %ebp,%eax
jne    141c <main+0x2ac>
mov    $0x2,%r15d
mov    $0x2a,%ebp
mov    $0x2f,%ebx
movl   $0x0,(%rsp)
movl   $0x0,0x4(%rsp)
movl   $0x0,0x8(%rsp)
cmp    $0x2a,%eax
je     11e0 <main+0x70>
cmp    $0x2f,%r13d
jne    1512 <main+0x3a2>
cmp    $0x2f,%eax
jne    1512 <main+0x3a2>
mov    $0x2f,%ebx
mov    $0x2f,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2,%r12d
movl   $0x1,0x4(%rsp)
mov    $0x1,%al
mov    %eax,(%rsp)
movl   $0x0,0x8(%rsp)
mov    $0x2f,%ebp
mov    0x1c(%rsp),%r15d
jmp    11e0 <main+0x70>
mov    0x10(%rsp),%rax
add    $0xffffff82,%eax
cmp    $0xffffff7e,%eax
jbe    165d <main+0x4ed>
cmp    $0x5c,%r13d
jne    14d2 <main+0x362>
mov    0x10(%rsp),%rcx
movslq %ecx,%rax
movb   $0x5c,0x20(%rsp,%rax,1)
add    $0x2,%ecx
mov    %rcx,0x10(%rsp)
mov    %bpl,0x21(%rsp,%rax,1)
mov    $0x2,%r12d
mov    $0x5c,%ebx
movl   $0x1,0xc(%rsp)
mov    $0x1,%al
mov    %eax,(%rsp)
movl   $0x0,0x4(%rsp)
movl   $0x0,0x8(%rsp)
jmp    11e0 <main+0x70>
mov    0x10(%rsp),%rcx
movslq %ecx,%rax
add    $0x1,%ecx
mov    %rcx,0x10(%rsp)
mov    %r13b,0x20(%rsp,%rax,1)
movl   $0x1,0xc(%rsp)
mov    $0x1,%al
mov    %eax,(%rsp)
movl   $0x0,0x4(%rsp)
movl   $0x0,0x8(%rsp)
mov    %r13d,%ebx
mov    $0x1,%r12d
jmp    11e0 <main+0x70>
mov    $0x1,%r15d
mov    $0x1,%cl
mov    %ecx,(%rsp)
movl   $0x0,0x4(%rsp)
movl   $0x1,0x8(%rsp)
mov    %r13d,%ebx
mov    %eax,%ebp
cmp    $0x22,%r13d
je     11e0 <main+0x70>
mov    %eax,%ebp
cmp    $0x27,%r13d
je     15b6 <main+0x446>
mov    $0x1,%al
mov    %eax,(%rsp)
movl   $0x0,0x4(%rsp)
movl   $0x0,0x8(%rsp)
mov    %r13d,%ebx
jmp    11e0 <main+0x70>
mov    0x20(%rsp),%al
movl   $0x0,0x4(%rsp)
mov    $0x0,%esi
test   %al,%al
je     1593 <main+0x423>
xor    %esi,%esi
lea    0x21(%rsp),%rcx
nopl   (%rax)
shl    $0x8,%esi
movzbl %al,%eax
or     %eax,%esi
movzbl (%rcx),%eax
add    $0x1,%rcx
test   %al,%al
jne    1580 <main+0x410>
lea    0xa66(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%r12d
mov    $0x27,%ebx
mov    $0x1,%al
mov    %eax,(%rsp)
jmp    139f <main+0x22f>
mov    $0x27,%ebx
movl   $0x1,0xc(%rsp)
movl   $0x0,0x4(%rsp)
mov    $0x1,%al
mov    %eax,(%rsp)
movl   $0x0,0x8(%rsp)
mov    0x1c(%rsp),%r15d
mov    $0x1,%r12d
xor    %eax,%eax
jmp    11a7 <main+0x37>
testb  $0x1,(%rsp)
je     1627 <main+0x4b7>
cmpl   $0x0,0x4(%rsp)
je     1605 <main+0x495>
lea    0xa57(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0x8(%rsp)
jne    1639 <main+0x4c9>
cmpl   $0x0,0xc(%rsp)
jne    164b <main+0x4db>
xor    %eax,%eax
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x29b2(%rip),%rax
mov    (%rax),%edi
lea    0x9f3(%rip),%rsi
jmp    166d <main+0x4fd>
mov    0x29a0(%rip),%rax
mov    (%rax),%edi
lea    0xa10(%rip),%rsi
jmp    166d <main+0x4fd>
mov    0x298e(%rip),%rax
mov    (%rax),%edi
lea    0xa25(%rip),%rsi
jmp    166d <main+0x4fd>
mov    0x297c(%rip),%rax
mov    (%rax),%edi
lea    0x99a(%rip),%rsi
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [7 x i8] c"0x%08X\00"
@stderr = global i32 0
@.str.1 = [35 x i8] c"jim_pp: Bad '' string -- too long\0A\00"
@.str.2 = [43 x i8] c"Unterminated /* */ comment at end of file\0A\00"
@.str.3 = [4 x i8] c" */\00"
@.str.4 = [39 x i8] c"Unterminated \22\22 string at end of file\0A\00"
@.str.5 = [39 x i8] c"Unterminated '' string at end of file\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca [128 x i8]
%16 = alloca i32
%17 = alloca i8*
%18 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 3, i32* %14
store i32 0, i32* %13
br label %19
19: ; preds = %2, %53, %54, %61, %65, %72, %76, %77, %94, %117, %132, %145, %158, %165, %171, %175, %176
br label %20
20: ; preds = %24, %19
%21 = load i32, i32* %13
%22 = add nsw i32 %21, -1
store i32 %22, i32* %13
%23 = icmp sgt i32 %21, 0
br i1 %23, label %24, label %31
24: ; preds = %20
%25 = load i32, i32* %10
%26 = trunc i32 %25 to i8
%27 = call i32 @putchar(i8 signext %26)
%28 = load i32, i32* %11
store i32 %28, i32* %10
%29 = load i32, i32* %12
store i32 %29, i32* %11
%30 = call i32 (...) @getchar()
store i32 %30, i32* %12
br label %20
31: ; preds = %20
br label %32
32: ; preds = %36, %31
%33 = load i32, i32* %14
%34 = add nsw i32 %33, -1
store i32 %34, i32* %14
%35 = icmp sgt i32 %33, 0
br i1 %35, label %36, label %40
36: ; preds = %32
%37 = load i32, i32* %11
store i32 %37, i32* %10
%38 = load i32, i32* %12
store i32 %38, i32* %11
%39 = call i32 (...) @getchar()
store i32 %39, i32* %12
br label %32
40: ; preds = %32
%41 = load i32, i32* %10
%42 = icmp slt i32 %41, 0
br i1 %42, label %43, label %44
43: ; preds = %40
br label %177
44: ; preds = %40
%45 = load i32, i32* %6
%46 = icmp ne i32 %45, 0
br i1 %46, label %47, label %55
47: ; preds = %44
%48 = load i32, i32* %10
%49 = icmp eq i32 %48, 42
br i1 %49, label %50, label %54
50: ; preds = %47
%51 = load i32, i32* %11
%52 = icmp eq i32 %51, 47
br i1 %52, label %53, label %54
53: ; preds = %50
store i32 2, i32* %13
store i32 0, i32* %6
br label %19
54: ; preds = %50, %47
store i32 1, i32* %13
br label %19
55: ; preds = %44
%56 = load i32, i32* %7
%57 = icmp ne i32 %56, 0
br i1 %57, label %58, label %66
58: ; preds = %55
%59 = load i32, i32* %10
%60 = icmp eq i32 %59, 10
br i1 %60, label %61, label %65
61: ; preds = %58
%62 = call i32 @putchar(i8 signext 32)
%63 = call i32 @putchar(i8 signext 42)
%64 = call i32 @putchar(i8 signext 47)
store i32 1, i32* %13
store i32 0, i32* %7
br label %19
65: ; preds = %58
store i32 1, i32* %13
br label %19
66: ; preds = %55
%67 = load i32, i32* %8
%68 = icmp ne i32 %67, 0
br i1 %68, label %69, label %78
69: ; preds = %66
%70 = load i32, i32* %10
%71 = icmp eq i32 %70, 92
br i1 %71, label %72, label %73
72: ; preds = %69
store i32 2, i32* %13
br label %19
73: ; preds = %69
%74 = load i32, i32* %10
%75 = icmp eq i32 %74, 34
br i1 %75, label %76, label %77
76: ; preds = %73
store i32 1, i32* %13
store i32 0, i32* %8
br label %19
77: ; preds = %73
store i32 1, i32* %13
br label %19
78: ; preds = %66
%79 = load i32, i32* %9
%80 = icmp ne i32 %79, 0
br i1 %80, label %81, label %152
81: ; preds = %78
%82 = load i32, i32* %10
%83 = icmp eq i32 %82, 39
br i1 %83, label %84, label %120
84: ; preds = %81
store i32 1, i32* %14
store i32 0, i32* %9
%85 = load i32, i32* %16
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 %86
store i8 0, i8* %87
%88 = load i32, i32* %16
%89 = icmp sle i32 %88, 1
br i1 %89, label %94, label %90
90: ; preds = %84
%91 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 0
%92 = call i64 @strchr(i8* %91, i8 signext 92)
%93 = icmp ne i64 %92, 0
br i1 %93, label %94, label %100
94: ; preds = %90, %84
%95 = call i32 @putchar(i8 signext 39)
%96 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 0
%97 = load i32, i32* @stdout
%98 = call i32 @fputs(i8* %96, i32 %97)
%99 = call i32 @putchar(i8 signext 39)
br label %19
100: ; preds = %90
store i32 0, i32* %18
%101 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 0
store i8* %101, i8** %17
br label %102
102: ; preds = %114, %100
%103 = load i8*, i8** %17
%104 = load i8, i8* %103
%105 = icmp ne i8 %104, 0
br i1 %105, label %106, label %117
106: ; preds = %102
%107 = load i32, i32* %18
%108 = shl i32 %107, 8
%109 = load i8*, i8** %17
%110 = load i8, i8* %109
%111 = sext i8 %110 to i32
%112 = and i32 %111, 255
%113 = or i32 %108, %112
store i32 %113, i32* %18
br label %114
114: ; preds = %106
%115 = load i8*, i8** %17
%116 = getelementptr inbounds i8, i8* %115, i32 1
store i8* %116, i8** %17
br label %102
117: ; preds = %102
%118 = load i32, i32* %18
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %118)
br label %19
120: ; preds = %81
%121 = load i32, i32* %16
%122 = add nsw i32 %121, 3
%123 = sext i32 %122 to i64
%124 = icmp ugt i64 %123, 128
br i1 %124, label %125, label %129
125: ; preds = %120
%126 = load i32, i32* @stderr
%127 = call i32 @fprintf(i32 %126, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%128 = call i32 @exit(i32 1)
unreachable
129: ; preds = %120
%130 = load i32, i32* %10
%131 = icmp eq i32 %130, 92
br i1 %131, label %132, label %145
132: ; preds = %129
%133 = load i32, i32* %10
%134 = trunc i32 %133 to i8
%135 = load i32, i32* %16
%136 = add nsw i32 %135, 1
store i32 %136, i32* %16
%137 = sext i32 %135 to i64
%138 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 %137
store i8 %134, i8* %138
%139 = load i32, i32* %11
%140 = trunc i32 %139 to i8
%141 = load i32, i32* %16
%142 = add nsw i32 %141, 1
store i32 %142, i32* %16
%143 = sext i32 %141 to i64
%144 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 %143
store i8 %140, i8* %144
store i32 2, i32* %14
br label %19
145: ; preds = %129
%146 = load i32, i32* %10
%147 = trunc i32 %146 to i8
%148 = load i32, i32* %16
%149 = add nsw i32 %148, 1
store i32 %149, i32* %16
%150 = sext i32 %148 to i64
%151 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 %150
store i8 %147, i8* %151
store i32 1, i32* %14
br label %19
152: ; preds = %78
%153 = load i32, i32* %10
%154 = icmp eq i32 %153, 47
br i1 %154, label %155, label %159
155: ; preds = %152
%156 = load i32, i32* %11
%157 = icmp eq i32 %156, 42
br i1 %157, label %158, label %159
158: ; preds = %155
store i32 2, i32* %13
store i32 1, i32* %6
br label %19
159: ; preds = %155, %152
%160 = load i32, i32* %10
%161 = icmp eq i32 %160, 47
br i1 %161, label %162, label %168
162: ; preds = %159
%163 = load i32, i32* %11
%164 = icmp eq i32 %163, 47
br i1 %164, label %165, label %168
165: ; preds = %162
%166 = call i32 @putchar(i8 signext 47)
%167 = call i32 @putchar(i8 signext 42)
store i32 2, i32* %14
store i32 1, i32* %7
br label %19
168: ; preds = %162, %159
%169 = load i32, i32* %10
%170 = icmp eq i32 %169, 34
br i1 %170, label %171, label %172
171: ; preds = %168
store i32 1, i32* %13
store i32 1, i32* %8
br label %19
172: ; preds = %168
%173 = load i32, i32* %10
%174 = icmp eq i32 %173, 39
br i1 %174, label %175, label %176
175: ; preds = %172
store i32 1, i32* %14
store i32 0, i32* %16
store i32 1, i32* %9
br label %19
176: ; preds = %172
store i32 1, i32* %13
br label %19
177: ; preds = %43
%178 = load i32, i32* %6
%179 = icmp ne i32 %178, 0
br i1 %179, label %180, label %184
180: ; preds = %177
%181 = load i32, i32* @stderr
%182 = call i32 @fprintf(i32 %181, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%183 = call i32 @exit(i32 1)
unreachable
184: ; preds = %177
%185 = load i32, i32* %7
%186 = icmp ne i32 %185, 0
br i1 %186, label %187, label %189
187: ; preds = %184
%188 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %189
189: ; preds = %187, %184
%190 = load i32, i32* %8
%191 = icmp ne i32 %190, 0
br i1 %191, label %192, label %196
192: ; preds = %189
%193 = load i32, i32* @stderr
%194 = call i32 @fprintf(i32 %193, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0))
%195 = call i32 @exit(i32 1)
unreachable
196: ; preds = %189
%197 = load i32, i32* %9
%198 = icmp ne i32 %197, 0
br i1 %198, label %199, label %203
199: ; preds = %196
%200 = load i32, i32* @stderr
%201 = call i32 @fprintf(i32 %200, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0))
%202 = call i32 @exit(i32 1)
unreachable
203: ; preds = %196
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [7 x i8] c"0x%08X\00"
@stderr = global i32 0
@.str.1 = [35 x i8] c"jim_pp: Bad '' string -- too long\0A\00"
@.str.2 = [43 x i8] c"Unterminated /* */ comment at end of file\0A\00"
@.str.3 = [4 x i8] c" */\00"
@.str.4 = [39 x i8] c"Unterminated \22\22 string at end of file\0A\00"
@.str.5 = [39 x i8] c"Unterminated '' string at end of file\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
br label %5
5: ; preds = %64, %2
%6 = phi i1 [ true, %2 ], [ %65, %64 ]
%7 = phi i32 [ 0, %2 ], [ %66, %64 ]
%8 = phi i32 [ 0, %2 ], [ %67, %64 ]
%9 = phi i32 [ 0, %2 ], [ %68, %64 ]
%10 = phi i32 [ undef, %2 ], [ %69, %64 ]
%11 = phi i32 [ undef, %2 ], [ %70, %64 ]
%12 = phi i32 [ undef, %2 ], [ %45, %64 ]
%13 = phi i32 [ 0, %2 ], [ %71, %64 ]
%14 = phi i32 [ 3, %2 ], [ %72, %64 ]
%15 = phi i32 [ undef, %2 ], [ %73, %64 ]
%16 = add nsw i32 %13, -1
%17 = icmp sgt i32 %13, 0
br i1 %17, label %25, label %18
18: ; preds = %25, %5
%19 = phi i32 [ %10, %5 ], [ %28, %25 ]
%20 = phi i32 [ %11, %5 ], [ %27, %25 ]
%21 = phi i32 [ %12, %5 ], [ %32, %25 ]
%22 = phi i32 [ %16, %5 ], [ -1, %25 ]
%23 = add nsw i32 %14, -1
%24 = icmp sgt i32 %14, 0
br i1 %24, label %35, label %42
25: ; preds = %5, %25
%26 = phi i32 [ %33, %25 ], [ %16, %5 ]
%27 = phi i32 [ %32, %25 ], [ %12, %5 ]
%28 = phi i32 [ %27, %25 ], [ %11, %5 ]
%29 = phi i32 [ %28, %25 ], [ %10, %5 ]
%30 = trunc i32 %29 to i8
%31 = call i32 @putchar(i8 signext %30)
%32 = call i32 (...) @getchar()
%33 = add nsw i32 %26, -1
%34 = icmp eq i32 %26, 0
br i1 %34, label %18, label %25
35: ; preds = %18, %35
%36 = phi i32 [ %40, %35 ], [ %23, %18 ]
%37 = phi i32 [ %39, %35 ], [ %21, %18 ]
%38 = phi i32 [ %37, %35 ], [ %20, %18 ]
%39 = call i32 (...) @getchar()
%40 = add nsw i32 %36, -1
%41 = icmp eq i32 %36, 0
br i1 %41, label %42, label %35
42: ; preds = %35, %18
%43 = phi i32 [ %19, %18 ], [ %38, %35 ]
%44 = phi i32 [ %20, %18 ], [ %37, %35 ]
%45 = phi i32 [ %21, %18 ], [ %39, %35 ]
%46 = phi i32 [ %23, %18 ], [ -1, %35 ]
%47 = icmp slt i32 %43, 0
br i1 %47, label %146, label %48
48: ; preds = %42
br i1 %6, label %56, label %49
49: ; preds = %48
%50 = icmp eq i32 %43, 42
%51 = icmp eq i32 %44, 47
%52 = select i1 %50, i1 %51, i1 false
%53 = select i1 %52, i32 42, i32 %43
%54 = select i1 %52, i32 47, i32 %44
%55 = select i1 %52, i32 2, i32 1
br label %64
56: ; preds = %48
%57 = icmp eq i32 %7, 0
br i1 %57, label %74, label %58
58: ; preds = %56
%59 = icmp eq i32 %43, 10
br i1 %59, label %60, label %64
60: ; preds = %58
%61 = call i32 @putchar(i8 signext 32)
%62 = call i32 @putchar(i8 signext 42)
%63 = call i32 @putchar(i8 signext 47)
br label %64
64: ; preds = %60, %77, %78, %93, %108, %120, %128, %140, %144, %145, %49, %58, %76, %133, %143
%65 = phi i1 [ true, %145 ], [ true, %144 ], [ true, %140 ], [ true, %128 ], [ true, %120 ], [ true, %108 ], [ true, %93 ], [ true, %78 ], [ true, %77 ], [ true, %60 ], [ %52, %49 ], [ true, %58 ], [ true, %76 ], [ false, %133 ], [ true, %143 ]
%66 = phi i32 [ 0, %145 ], [ 0, %144 ], [ 1, %140 ], [ 0, %128 ], [ 0, %120 ], [ 0, %108 ], [ 0, %93 ], [ 0, %78 ], [ 0, %77 ], [ 0, %60 ], [ %7, %49 ], [ 1, %58 ], [ 0, %76 ], [ 0, %133 ], [ 0, %143 ]
%67 = phi i32 [ 0, %145 ], [ 0, %144 ], [ 0, %140 ], [ 0, %128 ], [ 0, %120 ], [ 0, %108 ], [ 0, %93 ], [ 1, %78 ], [ 0, %77 ], [ %8, %60 ], [ %8, %49 ], [ %8, %58 ], [ 1, %76 ], [ 0, %133 ], [ 1, %143 ]
%68 = phi i32 [ 0, %145 ], [ 1, %144 ], [ 0, %140 ], [ 1, %128 ], [ 1, %120 ], [ 0, %108 ], [ 0, %93 ], [ %9, %78 ], [ %9, %77 ], [ %9, %60 ], [ %9, %49 ], [ %9, %58 ], [ %9, %76 ], [ 0, %133 ], [ 0, %143 ]
%69 = phi i32 [ %43, %145 ], [ 39, %144 ], [ 47, %140 ], [ %43, %128 ], [ 92, %120 ], [ 39, %108 ], [ 39, %93 ], [ %43, %78 ], [ 34, %77 ], [ 10, %60 ], [ %53, %49 ], [ %43, %58 ], [ %43, %76 ], [ 47, %133 ], [ %43, %143 ]
%70 = phi i32 [ %44, %145 ], [ %44, %144 ], [ 47, %140 ], [ %44, %128 ], [ %44, %120 ], [ %44, %108 ], [ %44, %93 ], [ %44, %78 ], [ %44, %77 ], [ %44, %60 ], [ %54, %49 ], [ %44, %58 ], [ %44, %76 ], [ 42, %133 ], [ %44, %143 ]
%71 = phi i32 [ 1, %145 ], [ %22, %144 ], [ %22, %140 ], [ %22, %128 ], [ %22, %120 ], [ %22, %108 ], [ %22, %93 ], [ 1, %78 ], [ 1, %77 ], [ 1, %60 ], [ %55, %49 ], [ 1, %58 ], [ 2, %76 ], [ 2, %133 ], [ 1, %143 ]
%72 = phi i32 [ %46, %145 ], [ 1, %144 ], [ 2, %140 ], [ 1, %128 ], [ 2, %120 ], [ 1, %108 ], [ 1, %93 ], [ %46, %78 ], [ %46, %77 ], [ %46, %60 ], [ %46, %49 ], [ %46, %58 ], [ %46, %76 ], [ %46, %133 ], [ %46, %143 ]
%73 = phi i32 [ %15, %145 ], [ 0, %144 ], [ %15, %140 ], [ %130, %128 ], [ %125, %120 ], [ %15, %108 ], [ %15, %93 ], [ %15, %78 ], [ %15, %77 ], [ %15, %60 ], [ %15, %49 ], [ %15, %58 ], [ %15, %76 ], [ %15, %133 ], [ %15, %143 ]
br label %5
74: ; preds = %56
%75 = icmp eq i32 %8, 0
br i1 %75, label %79, label %76
76: ; preds = %74
switch i32 %43, label %78 [
i32 92, label %64
i32 34, label %77
]
77: ; preds = %76
br label %64
78: ; preds = %76
br label %64
79: ; preds = %74
%80 = icmp eq i32 %9, 0
br i1 %80, label %133, label %81
81: ; preds = %79
%82 = icmp eq i32 %43, 39
br i1 %82, label %83, label %111
83: ; preds = %81
%84 = sext i32 %15 to i64
%85 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 %84
store i8 0, i8* %85
%86 = icmp slt i32 %15, 2
br i1 %86, label %93, label %87
87: ; preds = %83
%88 = call i64 @strchr(i8* %4, i8 signext 92)
%89 = icmp eq i64 %88, 0
br i1 %89, label %90, label %93
90: ; preds = %87
%91 = load i8, i8* %4
%92 = icmp eq i8 %91, 0
br i1 %92, label %108, label %98
93: ; preds = %87, %83
%94 = call i32 @putchar(i8 signext 39)
%95 = load i32, i32* @stdout
%96 = call i32 @fputs(i8* %4, i32 %95)
%97 = call i32 @putchar(i8 signext 39)
br label %64
98: ; preds = %90, %98
%99 = phi i8 [ %106, %98 ], [ %91, %90 ]
%100 = phi i32 [ %104, %98 ], [ 0, %90 ]
%101 = phi i8* [ %105, %98 ], [ %4, %90 ]
%102 = shl i32 %100, 8
%103 = zext i8 %99 to i32
%104 = or i32 %102, %103
%105 = getelementptr inbounds i8, i8* %101, i64 1
%106 = load i8, i8* %105
%107 = icmp eq i8 %106, 0
br i1 %107, label %108, label %98
108: ; preds = %98, %90
%109 = phi i32 [ 0, %90 ], [ %104, %98 ]
%110 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %109)
br label %64
111: ; preds = %81
%112 = add i32 %15, -126
%113 = icmp ult i32 %112, -129
br i1 %113, label %114, label %118
114: ; preds = %111
%115 = load i32, i32* @stderr
%116 = call i32 @fprintf(i32 %115, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%117 = call i32 @exit(i32 1)
unreachable
118: ; preds = %111
%119 = icmp eq i32 %43, 92
br i1 %119, label %120, label %128
120: ; preds = %118
%121 = add nsw i32 %15, 1
%122 = sext i32 %15 to i64
%123 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 %122
store i8 92, i8* %123
%124 = trunc i32 %44 to i8
%125 = add nsw i32 %15, 2
%126 = sext i32 %121 to i64
%127 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 %126
store i8 %124, i8* %127
br label %64
128: ; preds = %118
%129 = trunc i32 %43 to i8
%130 = add nsw i32 %15, 1
%131 = sext i32 %15 to i64
%132 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 %131
store i8 %129, i8* %132
br label %64
133: ; preds = %79
%134 = icmp eq i32 %43, 47
%135 = icmp eq i32 %44, 42
%136 = select i1 %134, i1 %135, i1 false
br i1 %136, label %64, label %137
137: ; preds = %133
%138 = icmp eq i32 %44, 47
%139 = select i1 %134, i1 %138, i1 false
br i1 %139, label %140, label %143
140: ; preds = %137
%141 = call i32 @putchar(i8 signext 47)
%142 = call i32 @putchar(i8 signext 42)
br label %64
143: ; preds = %137
switch i32 %43, label %145 [
i32 34, label %64
i32 39, label %144
]
144: ; preds = %143
br label %64
145: ; preds = %143
br label %64
146: ; preds = %42
br i1 %6, label %151, label %147
147: ; preds = %146
%148 = load i32, i32* @stderr
%149 = call i32 @fprintf(i32 %148, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%150 = call i32 @exit(i32 1)
unreachable
151: ; preds = %146
%152 = icmp eq i32 %7, 0
br i1 %152, label %155, label %153
153: ; preds = %151
%154 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %155
155: ; preds = %153, %151
%156 = icmp eq i32 %8, 0
br i1 %156, label %161, label %157
157: ; preds = %155
%158 = load i32, i32* @stderr
%159 = call i32 @fprintf(i32 %158, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0))
%160 = call i32 @exit(i32 1)
unreachable
161: ; preds = %155
%162 = icmp eq i32 %9, 0
br i1 %162, label %167, label %163
163: ; preds = %161
%164 = load i32, i32* @stderr
%165 = call i32 @fprintf(i32 %164, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0))
%166 = call i32 @exit(i32 1)
unreachable
167: ; preds = %161
ret i32 0
}