#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 EOF;
scalar_t__ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int fscanf(int /*<<< orphan*/ *, char *, char *);
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, unsigned int);
int /*<<< orphan*/ process_buf(int, char *, unsigned int);
int scanf(char *, int *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ *stdin;
scalar_t__ strncmp(char *, char *, int);
int main(void) {
  FILE *in = stdin;
  while (1) {
    int dir;
    int res;
    char buf[1048576];
    unsigned len = 0;
    memset(buf, 0, sizeof(buf));
    while (1) {
      char str[32];
      res = fscanf(in, "%30s", str);
      if (res != 1 && feof(in))
        return 0;
      if (res == 0)
        continue;
      if (strncmp(str, "read(", 5) == 0) {
        dir = 0;
        break;
      } else if (strncmp(str, "writev(", 7) == 0) {
        dir = 1;
        break;
      }
    }
    while (1) {
      int c = getc(in);
      if (c == '"') {
        while (1) {
          int val;
          c = getc(in);
          if (c == EOF) {
            fprintf(stderr, "eof in string\n");
            break;
          }
          if (c == '\n') {
            fprintf(stderr, "eol in string\n");
            break;
          }
          if (c == '"')
            break;
          if (c != '\\') {
            val = c;
          } else {
            c = getc(in);
            switch (c) {
            case 'n':
              val = '\n';
              break;
            case 'r':
              val = '\r';
              break;
            case 't':
              val = '\t';
              break;
            case '"':
              val = '"';
              break;
            case '\\':
              val = '\\';
              break;
            case 'x':
              res = scanf("%x", &val);
              if (res != 1) {
                fprintf(stderr, "parse error\n");
                continue;
              }
              break;
            default:
              fprintf(stderr, "unknown sequence: '\\%c'\n", c);
              continue;
            }
          }
          buf[len++] = val;
        }
      }
      if (c == '\n')
        break;
    }
    process_buf(dir, buf, len);
    memset(buf, 0, len);
    len = 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100060,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e4f(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x100024(%rbp)
lea    -0x100020(%rbp),%rdi
xor    %esi,%esi
mov    $0x100000,%edx
call   1040 <memset@plt>
mov    -0x10(%rbp),%rdi
lea    -0x100050(%rbp),%rdx
lea    0xe31(%rip),%rsi
call   1050 <fscanf@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x1,-0x18(%rbp)
je     11ff <main+0x7f>
mov    -0x10(%rbp),%rdi
call   1070 <feof@plt>
cmp    $0x0,%rax
je     11ff <main+0x7f>
xor    %eax,%eax
add    $0x100060,%rsp
pop    %rbp
ret
cmpl   $0x0,-0x18(%rbp)
jne    120e <main+0x8e>
jmp    11bd <main+0x3d>
lea    -0x100050(%rbp),%rdi
lea    0xde9(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    123c <main+0xbc>
movl   $0x0,-0x14(%rbp)
jmp    1274 <main+0xf4>
lea    -0x100050(%rbp),%rdi
lea    0xdc1(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    126a <main+0xea>
movl   $0x1,-0x14(%rbp)
jmp    1274 <main+0xf4>
jmp    126f <main+0xef>
jmp    11bd <main+0x3d>
jmp    1279 <main+0xf9>
mov    -0x10(%rbp),%rdi
call   10a0 <getc@plt>
mov    %eax,-0x100054(%rbp)
cmpl   $0x22,-0x100054(%rbp)
jne    149f <main+0x31f>
jmp    129a <main+0x11a>
mov    -0x10(%rbp),%rdi
call   10a0 <getc@plt>
mov    %eax,-0x100054(%rbp)
mov    -0x100054(%rbp),%eax
mov    0x2d2a(%rip),%rcx
cmp    (%rcx),%eax
jne    12da <main+0x15a>
mov    0x2d0b(%rip),%rax
mov    (%rax),%edi
lea    0xd45(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    149a <main+0x31a>
cmpl   $0xa,-0x100054(%rbp)
jne    1303 <main+0x183>
mov    0x2ce2(%rip),%rax
mov    (%rax),%edi
lea    0xd2b(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    149a <main+0x31a>
cmpl   $0x22,-0x100054(%rbp)
jne    1315 <main+0x195>
jmp    149a <main+0x31a>
cmpl   $0x5c,-0x100054(%rbp)
je     1333 <main+0x1b3>
mov    -0x100054(%rbp),%eax
mov    %eax,-0x100058(%rbp)
jmp    1473 <main+0x2f3>
mov    -0x10(%rbp),%rdi
call   10a0 <getc@plt>
mov    %eax,-0x100054(%rbp)
mov    -0x100054(%rbp),%eax
mov    %eax,-0x10005c(%rbp)
sub    $0x22,%eax
je     13ed <main+0x26d>
jmp    135c <main+0x1dc>
mov    -0x10005c(%rbp),%eax
sub    $0x5c,%eax
je     13fc <main+0x27c>
jmp    1370 <main+0x1f0>
mov    -0x10005c(%rbp),%eax
sub    $0x6e,%eax
je     13c0 <main+0x240>
jmp    1384 <main+0x204>
mov    -0x10005c(%rbp),%eax
sub    $0x72,%eax
je     13cf <main+0x24f>
jmp    1398 <main+0x218>
mov    -0x10005c(%rbp),%eax
sub    $0x74,%eax
je     13de <main+0x25e>
jmp    13ac <main+0x22c>
mov    -0x10005c(%rbp),%eax
sub    $0x78,%eax
je     140b <main+0x28b>
jmp    144c <main+0x2cc>
movl   $0xa,-0x100058(%rbp)
jmp    146e <main+0x2ee>
movl   $0xd,-0x100058(%rbp)
jmp    146e <main+0x2ee>
movl   $0x9,-0x100058(%rbp)
jmp    146e <main+0x2ee>
movl   $0x22,-0x100058(%rbp)
jmp    146e <main+0x2ee>
movl   $0x5c,-0x100058(%rbp)
jmp    146e <main+0x2ee>
lea    0xc1f(%rip),%rdi
lea    -0x100058(%rbp),%rsi
call   1080 <scanf@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x1,-0x18(%rbp)
je     1447 <main+0x2c7>
mov    0x2b9e(%rip),%rax
mov    (%rax),%edi
lea    0xbf9(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    129a <main+0x11a>
jmp    146e <main+0x2ee>
mov    0x2b7d(%rip),%rax
mov    (%rax),%edi
mov    -0x100054(%rbp),%edx
lea    0xbdf(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    129a <main+0x11a>
jmp    1473 <main+0x2f3>
mov    -0x100058(%rbp),%eax
mov    %al,%cl
mov    -0x100024(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x100024(%rbp)
mov    %eax,%eax
mov    %cl,-0x100020(%rbp,%rax,1)
jmp    129a <main+0x11a>
jmp    149f <main+0x31f>
cmpl   $0xa,-0x100054(%rbp)
jne    14b1 <main+0x331>
jmp    14b6 <main+0x336>
jmp    1279 <main+0xf9>
mov    -0x14(%rbp),%edi
lea    -0x100020(%rbp),%rsi
mov    -0x100024(%rbp),%edx
call   1090 <process_buf@plt>
lea    -0x100020(%rbp),%rdi
mov    -0x100024(%rbp),%edx
xor    %esi,%esi
call   1040 <memset@plt>
movl   $0x0,-0x100024(%rbp)
jmp    11a0 <main+0x20>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x100038,%rsp
mov    0x2e50(%rip),%rax
mov    (%rax),%rbx
lea    0x30(%rsp),%r13
lea    0x10(%rsp),%r12
mov    0x2e34(%rip),%r14
lea    0xe4d(%rip),%r15
jmp    11df <main+0x5f>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0xc(%rsp),%edi
lea    0x30(%rsp),%r13
mov    %r13,%rsi
mov    %ebp,%edx
call   1090 <process_buf@plt>
mov    %r13,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1040 <memset@plt>
mov    %r13,%rdi
xor    %esi,%esi
mov    $0x100000,%edx
call   1040 <memset@plt>
lea    0xe7f(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
call   1050 <fscanf@plt>
cmp    $0x1,%eax
je     122a <main+0xaa>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1070 <feof@plt>
test   %rax,%rax
jne    13a8 <main+0x228>
test   %ebp,%ebp
je     1200 <main+0x80>
mov    %r12,%rdi
lea    0xe45(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
xor    %ebp,%ebp
test   %rax,%rax
je     1270 <main+0xf0>
mov    %r12,%rdi
lea    0xe30(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    1200 <main+0x80>
movl   $0x1,0xc(%rsp)
jmp    128d <main+0x10d>
nopl   0x0(%rax,%rax,1)
movl   $0x0,0xc(%rsp)
jmp    128d <main+0x10d>
nopw   0x0(%rax,%rax,1)
mov    %eax,%r13d
cmp    $0xa,%r13d
je     11c0 <main+0x40>
mov    %rbx,%rdi
call   10a0 <getc@plt>
cmp    $0x22,%eax
jne    1280 <main+0x100>
mov    %rbx,%rdi
call   10a0 <getc@plt>
mov    %eax,%r13d
cmp    (%r14),%eax
jne    12d0 <main+0x150>
lea    0xdd6(%rip),%rsi
mov    0x2d18(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    1283 <main+0x103>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    $0x5c,%r13d
je     12f0 <main+0x170>
cmp    $0xa,%r13d
je     139c <main+0x21c>
cmp    $0x22,%r13d
jne    1360 <main+0x1e0>
jmp    1283 <main+0x103>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   10a0 <getc@plt>
lea    -0x5c(%rax),%ecx
cmp    $0x1c,%ecx
ja     1317 <main+0x197>
mov    $0xa,%r13d
movslq (%r15,%rcx,4),%rcx
add    %r15,%rcx
jmp    *%rcx
mov    $0xd,%r13d
jmp    1360 <main+0x1e0>
cmp    $0x22,%eax
jne    1321 <main+0x1a1>
mov    %eax,%r13d
jmp    1360 <main+0x1e0>
mov    0x2ca8(%rip),%rcx
mov    (%rcx),%edi
lea    0xd84(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    136a <main+0x1ea>
mov    $0x9,%r13d
jmp    1360 <main+0x1e0>
lea    0xd5a(%rip),%rdi
mov    %r12,%rsi
call   1080 <scanf@plt>
cmp    $0x1,%eax
jne    1383 <main+0x203>
mov    0x10(%rsp),%r13d
nopl   (%rax)
mov    %ebp,%eax
add    $0x1,%ebp
mov    %r13b,0x30(%rsp,%rax,1)
mov    %rbx,%rdi
call   10a0 <getc@plt>
mov    %eax,%r13d
cmp    (%r14),%eax
jne    12d0 <main+0x150>
jmp    12aa <main+0x12a>
mov    0x2c46(%rip),%rax
mov    (%rax),%edi
lea    0xd15(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    136a <main+0x1ea>
lea    0xcf3(%rip),%rsi
jmp    12b1 <main+0x131>
xor    %eax,%eax
add    $0x100038,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32* null
@.str = [5 x i8] c"%30s\00"
@.str.1 = [6 x i8] c"read(\00"
@.str.2 = [8 x i8] c"writev(\00"
@EOF = global i32 0
@stderr = global i32 0
@.str.3 = [15 x i8] c"eof in string\0A\00"
@.str.4 = [15 x i8] c"eol in string\0A\00"
@.str.5 = [3 x i8] c"%x\00"
@.str.6 = [13 x i8] c"parse error\0A\00"
@.str.7 = [25 x i8] c"unknown sequence: '\\%c'\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca [1048576 x i8]
%6 = alloca i32
%7 = alloca [32 x i8]
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
%10 = load i32*, i32** @stdin
store i32* %10, i32** %2
br label %11
11: ; preds = %0, %107
store i32 0, i32* %6
%12 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %5, i64 0, i64 0
%13 = call i32 @memset(i8* %12, i32 0, i32 1048576)
br label %14
14: ; preds = %11, %28, %40
%15 = load i32*, i32** %2
%16 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%17 = call i32 @fscanf(i32* %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %16)
store i32 %17, i32* %4
%18 = load i32, i32* %4
%19 = icmp ne i32 %18, 1
br i1 %19, label %20, label %25
20: ; preds = %14
%21 = load i32*, i32** %2
%22 = call i64 @feof(i32* %21)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %20
ret i32 0
25: ; preds = %20, %14
%26 = load i32, i32* %4
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %29
28: ; preds = %25
br label %14
29: ; preds = %25
%30 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%31 = call i64 @strncmp(i8* %30, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5)
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %34
33: ; preds = %29
store i32 0, i32* %3
br label %41
34: ; preds = %29
%35 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%36 = call i64 @strncmp(i8* %35, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 7)
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %39
38: ; preds = %34
store i32 1, i32* %3
br label %41
39: ; preds = %34
br label %40
40: ; preds = %39
br label %14
41: ; preds = %38, %33
br label %42
42: ; preds = %41, %106
%43 = load i32*, i32** %2
%44 = call i32 @getc(i32* %43)
store i32 %44, i32* %8
%45 = load i32, i32* %8
%46 = icmp eq i32 %45, 34
br i1 %46, label %47, label %102
47: ; preds = %42
br label %48
48: ; preds = %47, %85, %89, %94
%49 = load i32*, i32** %2
%50 = call i32 @getc(i32* %49)
store i32 %50, i32* %8
%51 = load i32, i32* %8
%52 = load i32, i32* @EOF
%53 = icmp eq i32 %51, %52
br i1 %53, label %54, label %57
54: ; preds = %48
%55 = load i32, i32* @stderr
%56 = call i32 (i32, i8*, ...) @fprintf(i32 %55, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
br label %101
57: ; preds = %48
%58 = load i32, i32* %8
%59 = icmp eq i32 %58, 10
br i1 %59, label %60, label %63
60: ; preds = %57
%61 = load i32, i32* @stderr
%62 = call i32 (i32, i8*, ...) @fprintf(i32 %61, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
br label %101
63: ; preds = %57
%64 = load i32, i32* %8
%65 = icmp eq i32 %64, 34
br i1 %65, label %66, label %67
66: ; preds = %63
br label %101
67: ; preds = %63
%68 = load i32, i32* %8
%69 = icmp ne i32 %68, 92
br i1 %69, label %70, label %72
70: ; preds = %67
%71 = load i32, i32* %8
store i32 %71, i32* %9
br label %94
72: ; preds = %67
%73 = load i32*, i32** %2
%74 = call i32 @getc(i32* %73)
store i32 %74, i32* %8
%75 = load i32, i32* %8
switch i32 %75, label %89 [
i32 110, label %76
i32 114, label %77
i32 116, label %78
i32 34, label %79
i32 92, label %80
i32 120, label %81
]
76: ; preds = %72
store i32 10, i32* %9
br label %93
77: ; preds = %72
store i32 13, i32* %9
br label %93
78: ; preds = %72
store i32 9, i32* %9
br label %93
79: ; preds = %72
store i32 34, i32* %9
br label %93
80: ; preds = %72
store i32 92, i32* %9
br label %93
81: ; preds = %72
%82 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %9)
store i32 %82, i32* %4
%83 = load i32, i32* %4
%84 = icmp ne i32 %83, 1
br i1 %84, label %85, label %88
85: ; preds = %81
%86 = load i32, i32* @stderr
%87 = call i32 (i32, i8*, ...) @fprintf(i32 %86, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
br label %48
88: ; preds = %81
br label %93
89: ; preds = %72
%90 = load i32, i32* @stderr
%91 = load i32, i32* %8
%92 = call i32 (i32, i8*, ...) @fprintf(i32 %90, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i32 %91)
br label %48
93: ; preds = %88, %80, %79, %78, %77, %76
br label %94
94: ; preds = %93, %70
%95 = load i32, i32* %9
%96 = trunc i32 %95 to i8
%97 = load i32, i32* %6
%98 = add i32 %97, 1
store i32 %98, i32* %6
%99 = zext i32 %97 to i64
%100 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %5, i64 0, i64 %99
store i8 %96, i8* %100
br label %48
101: ; preds = %66, %60, %54
br label %102
102: ; preds = %101, %42
%103 = load i32, i32* %8
%104 = icmp eq i32 %103, 10
br i1 %104, label %105, label %106
105: ; preds = %102
br label %107
106: ; preds = %102
br label %42
107: ; preds = %105
%108 = load i32, i32* %3
%109 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %5, i64 0, i64 0
%110 = load i32, i32* %6
%111 = call i32 @process_buf(i32 %108, i8* %109, i32 %110)
%112 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %5, i64 0, i64 0
%113 = load i32, i32* %6
%114 = call i32 @memset(i8* %112, i32 0, i32 %113)
store i32 0, i32* %6
br label %11
}

LLVM IR (-O2):
@stdin = global i32* null
@.str = [5 x i8] c"%30s\00"
@.str.1 = [6 x i8] c"read(\00"
@.str.2 = [8 x i8] c"writev(\00"
@EOF = global i32 0
@stderr = global i32 0
@.str.3 = [15 x i8] c"eof in string\0A\00"
@.str.4 = [15 x i8] c"eol in string\0A\00"
@.str.5 = [3 x i8] c"%x\00"
@.str.6 = [13 x i8] c"parse error\0A\00"
@.str.7 = [25 x i8] c"unknown sequence: '\\%c'\0A\00"
define i32 @main() {
%1 = alloca [1048576 x i8]
%2 = alloca [32 x i8]
%3 = alloca i32
%4 = load i32*, i32** @stdin
%5 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%7 = bitcast i32* %3 to i8*
br label %8
8: ; preds = %79, %0
%9 = call i32 @memset(i8* %5, i32 0, i32 1048576)
br label %10
10: ; preds = %24, %8
%11 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %6)
%12 = icmp eq i32 %11, 1
br i1 %12, label %18, label %13
13: ; preds = %10
%14 = call i64 @feof(i32* %4)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %82
16: ; preds = %13
%17 = icmp eq i32 %11, 0
br i1 %17, label %24, label %18
18: ; preds = %10, %16
%19 = call i64 @strncmp(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5)
%20 = icmp eq i64 %19, 0
br i1 %20, label %25, label %21
21: ; preds = %18
%22 = call i64 @strncmp(i8* %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 7)
%23 = icmp eq i64 %22, 0
br i1 %23, label %25, label %24
24: ; preds = %16, %21
br label %10
25: ; preds = %21, %18
%26 = phi i32 [ 0, %18 ], [ 1, %21 ]
br label %27
27: ; preds = %25, %75
%28 = phi i32 [ %76, %75 ], [ 0, %25 ]
%29 = call i32 @getc(i32* %4)
%30 = icmp eq i32 %29, 34
br i1 %30, label %31, label %75
31: ; preds = %27
%32 = call i32 @getc(i32* %4)
%33 = load i32, i32* @EOF
%34 = icmp eq i32 %32, %33
br i1 %34, label %61, label %35
35: ; preds = %31, %70
%36 = phi i32 [ %72, %70 ], [ %32, %31 ]
%37 = phi i32 [ %71, %70 ], [ %28, %31 ]
switch i32 %36, label %55 [
i32 10, label %61
i32 34, label %67
i32 92, label %38
]
38: ; preds = %35
%39 = call i32 @getc(i32* %4)
switch i32 %39, label %52 [
i32 110, label %55
i32 114, label %40
i32 116, label %41
i32 34, label %42
i32 92, label %43
i32 120, label %44
]
40: ; preds = %38
br label %55
41: ; preds = %38
br label %55
42: ; preds = %38
br label %55
43: ; preds = %38
br label %55
44: ; preds = %38
%45 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %3)
%46 = icmp eq i32 %45, 1
br i1 %46, label %47, label %49
47: ; preds = %44
%48 = load i32, i32* %3
br label %55
49: ; preds = %44
%50 = load i32, i32* @stderr
%51 = call i32 (i32, i8*, ...) @fprintf(i32 %50, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
br label %70
52: ; preds = %38
%53 = load i32, i32* @stderr
%54 = call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i32 %39)
br label %70
55: ; preds = %38, %35, %47, %40, %41, %42, %43
%56 = phi i32 [ %48, %47 ], [ 13, %40 ], [ 9, %41 ], [ %39, %42 ], [ %39, %43 ], [ %36, %35 ], [ 10, %38 ]
%57 = trunc i32 %56 to i8
%58 = add i32 %37, 1
%59 = zext i32 %37 to i64
%60 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %1, i64 0, i64 %59
store i8 %57, i8* %60
br label %70
61: ; preds = %35, %70, %31
%62 = phi i8* [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), %31 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), %70 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), %35 ]
%63 = phi i32 [ %28, %31 ], [ %71, %70 ], [ %37, %35 ]
%64 = phi i32 [ %32, %31 ], [ %72, %70 ], [ %36, %35 ]
%65 = load i32, i32* @stderr
%66 = call i32 (i32, i8*, ...) @fprintf(i32 %65, i8* %62)
br label %67
67: ; preds = %35, %61
%68 = phi i32 [ %63, %61 ], [ %37, %35 ]
%69 = phi i32 [ %64, %61 ], [ %36, %35 ]
br label %75
70: ; preds = %55, %52, %49
%71 = phi i32 [ %58, %55 ], [ %37, %52 ], [ %37, %49 ]
%72 = call i32 @getc(i32* %4)
%73 = load i32, i32* @EOF
%74 = icmp eq i32 %72, %73
br i1 %74, label %61, label %35
75: ; preds = %67, %27
%76 = phi i32 [ %28, %27 ], [ %68, %67 ]
%77 = phi i32 [ %29, %27 ], [ %69, %67 ]
%78 = icmp eq i32 %77, 10
br i1 %78, label %79, label %27
79: ; preds = %75
%80 = call i32 @process_buf(i32 %26, i8* %5, i32 %76)
%81 = call i32 @memset(i8* %5, i32 0, i32 %76)
br label %8
82: ; preds = %13
ret i32 0
}