#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 */

/* Variables and functions */
int /*<<< orphan*/ exit(int);
char *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
char *strchr(char *, char);
int strlen(char *);
scalar_t__ strncmp(char *, char *, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
int main() {
  char line[512], *s, *p;
  char fname[512];
  int n;
  while ((s = fgets(line, 512, stdin)) != NULL) {
    if (strncmp(line, "Index: ", 7) == 0) {
      char prefix[5];
      n = strlen(line) - 7 - 1;
      strncpy(fname, line + 7, n);
      fname[n] = '\0';
      printf("%s", line);
      while (1) {
        if ((s = fgets(line, 512, stdin)) == NULL) {
          perror("fgets a");
          exit(1);
        }
        if ((strncmp(line, "*** ", 4) == 0) || (strncmp(line, "--- ", 4) == 0))
          break;
        printf("%s", line);
      }
      if ((p = strchr(line + 4, '\t')) == NULL) {
        perror("strchr");
        fprintf(stderr, "Line was '%s'\n", line);
        exit(1);
      }
      strncpy(prefix, line, 3);
      prefix[3] = '\0';
      printf("%s %s%s", prefix, fname, p);
      if ((s = fgets(line, 512, stdin)) == NULL) {
        perror("fgets b");
        exit(1);
      }
      if ((p = strchr(line + 4, '\t')) == NULL) {
        perror("strchr");
        fprintf(stderr, "Line was '%s'\n", line);
        exit(1);
      }
      strncpy(prefix, line, 3);
      prefix[3] = '\0';
      printf("%s %s%s", prefix, fname, p);
    } else {
      printf("%s", line);
    }
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x210(%rbp),%rdi
mov    0x2e38(%rip),%rax
mov    (%rax),%edx
mov    $0x200,%esi
call   1080 <fgets@plt>
mov    %rax,-0x218(%rbp)
cmp    $0x0,%rax
je     1480 <main+0x2f0>
lea    -0x210(%rbp),%rdi
lea    0xe25(%rip),%rsi
mov    $0x7,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1466 <main+0x2d6>
lea    -0x210(%rbp),%rdi
call   1050 <strlen@plt>
sub    $0x7,%eax
sub    $0x1,%eax
mov    %eax,-0x424(%rbp)
lea    -0x420(%rbp),%rdi
lea    -0x210(%rbp),%rsi
add    $0x7,%rsi
mov    -0x424(%rbp),%edx
call   1030 <strncpy@plt>
movslq -0x424(%rbp),%rax
movb   $0x0,-0x420(%rbp,%rax,1)
lea    -0x210(%rbp),%rsi
lea    0xdf4(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x210(%rbp),%rdi
mov    0x2d92(%rip),%rax
mov    (%rax),%edx
mov    $0x200,%esi
call   1080 <fgets@plt>
mov    %rax,-0x218(%rbp)
cmp    $0x0,%rax
jne    1289 <main+0xf9>
lea    0xd8e(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
lea    -0x210(%rbp),%rdi
lea    0xd79(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
je     12cd <main+0x13d>
lea    -0x210(%rbp),%rdi
lea    0xd5c(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    12d2 <main+0x142>
jmp    12ec <main+0x15c>
lea    -0x210(%rbp),%rsi
lea    0xd55(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1248 <main+0xb8>
lea    -0x210(%rbp),%rdi
add    $0x4,%rdi
mov    $0x9,%esi
call   1060 <strchr@plt>
mov    %rax,-0x220(%rbp)
cmp    $0x0,%rax
jne    1344 <main+0x1b4>
lea    0xd01(%rip),%rdi
call   10a0 <perror@plt>
mov    0x2cb3(%rip),%rax
mov    (%rax),%edi
lea    -0x210(%rbp),%rdx
lea    0xcec(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
lea    -0x429(%rbp),%rdi
lea    -0x210(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x426(%rbp)
lea    -0x429(%rbp),%rsi
lea    -0x420(%rbp),%rdx
mov    -0x220(%rbp),%rcx
lea    0xcb1(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x210(%rbp),%rdi
mov    0x2c54(%rip),%rax
mov    (%rax),%edx
mov    $0x200,%esi
call   1080 <fgets@plt>
mov    %rax,-0x218(%rbp)
cmp    $0x0,%rax
jne    13c7 <main+0x237>
lea    0xc80(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
lea    -0x210(%rbp),%rdi
add    $0x4,%rdi
mov    $0x9,%esi
call   1060 <strchr@plt>
mov    %rax,-0x220(%rbp)
cmp    $0x0,%rax
jne    141f <main+0x28f>
lea    0xc26(%rip),%rdi
call   10a0 <perror@plt>
mov    0x2bd8(%rip),%rax
mov    (%rax),%edi
lea    -0x210(%rbp),%rdx
lea    0xc11(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
lea    -0x429(%rbp),%rdi
lea    -0x210(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x426(%rbp)
lea    -0x429(%rbp),%rsi
lea    -0x420(%rbp),%rdx
mov    -0x220(%rbp),%rcx
lea    0xbd6(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    147b <main+0x2eb>
lea    -0x210(%rbp),%rsi
lea    0xbc1(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    11a2 <main+0x12>
xor    %edi,%edi
call   10b0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x418,%rsp
mov    0x2e40(%rip),%r12
mov    (%r12),%edx
lea    0x10(%rsp),%rdi
mov    $0x200,%esi
call   1080 <fgets@plt>
test   %rax,%rax
jne    11c7 <main+0x37>
xor    %edi,%edi
call   10b0 <exit@plt>
lea    0x14(%rsp),%r13
lea    0xe2d(%rip),%r14
lea    0x10(%rsp),%rbx
lea    0xe56(%rip),%rbp
lea    0xe2a(%rip),%r15
jmp    1213 <main+0x83>
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    (%r12),%edx
mov    %rbx,%rdi
mov    $0x200,%esi
call   1080 <fgets@plt>
test   %rax,%rax
je     11c0 <main+0x30>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x7,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
jne    11f0 <main+0x60>
mov    %rbx,%rdi
call   1050 <strlen@plt>
movslq %eax,%r14
lea    -0x8(%r14),%rdx
lea    0x210(%rsp),%rdi
lea    0x17(%rsp),%rsi
call   1030 <strncpy@plt>
movb   $0x0,0x208(%rsp,%r14,1)
mov    %rbp,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    (%r12),%edx
mov    %rbx,%rdi
mov    $0x200,%esi
call   1080 <fgets@plt>
test   %rax,%rax
lea    0xd9b(%rip),%r14
je     13b7 <main+0x227>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     12e0 <main+0x150>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     12e0 <main+0x150>
mov    %rbp,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    (%r12),%edx
mov    %rbx,%rdi
mov    $0x200,%esi
call   1080 <fgets@plt>
test   %rax,%rax
jne    1280 <main+0xf0>
jmp    13b7 <main+0x227>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r13,%r15
mov    %r13,%rdi
mov    $0x9,%esi
call   1060 <strchr@plt>
test   %rax,%rax
je     13cd <main+0x23d>
mov    %rax,%r13
mov    %r12,%rbp
lea    0xb(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x3,%edx
call   1030 <strncpy@plt>
movb   $0x0,0xe(%rsp)
lea    0xd10(%rip),%rdi
mov    %r14,%rsi
lea    0x210(%rsp),%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   1070 <printf@plt>
mov    (%r12),%edx
mov    %rbx,%rdi
mov    $0x200,%esi
call   1080 <fgets@plt>
test   %rax,%rax
je     13fd <main+0x26d>
mov    %r15,%r13
mov    %r15,%rdi
mov    $0x9,%esi
call   1060 <strchr@plt>
test   %rax,%rax
je     13cd <main+0x23d>
mov    %rax,%rbp
lea    0xb(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x3,%edx
call   1030 <strncpy@plt>
movb   $0x0,0xe(%rsp)
lea    0xca8(%rip),%rdi
mov    %r14,%rsi
lea    0x210(%rsp),%rdx
mov    %rbp,%rcx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xc5c(%rip),%r14
lea    0xc65(%rip),%r15
lea    0xc83(%rip),%rbp
jmp    11fd <main+0x6d>
lea    0xc4a(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
lea    0xc46(%rip),%rdi
call   10a0 <perror@plt>
mov    0x2bf8(%rip),%rax
mov    (%rax),%edi
lea    0xc38(%rip),%rsi
lea    0x10(%rsp),%rdx
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
lea    0xc34(%rip),%rdi
jmp    13be <main+0x22e>

LLVM IR (-O0):
@stdin = global i32 0
@.str = [8 x i8] c"Index: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [8 x i8] c"fgets a\00"
@.str.3 = [5 x i8] c"*** \00"
@.str.4 = [5 x i8] c"--- \00"
@.str.5 = [7 x i8] c"strchr\00"
@stderr = global i32 0
@.str.6 = [15 x i8] c"Line was '%s'\0A\00"
@.str.7 = [8 x i8] c"%s %s%s\00"
@.str.8 = [8 x i8] c"fgets b\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [512 x i8]
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [512 x i8]
%6 = alloca i32
%7 = alloca [5 x i8]
store i32 0, i32* %1
br label %8
8: ; preds = %102, %0
%9 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%10 = load i32, i32* @stdin
%11 = call i8* @fgets(i8* %9, i32 512, i32 %10)
store i8* %11, i8** %3
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %103
13: ; preds = %8
%14 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%15 = call i64 @strncmp(i8* %14, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %99
17: ; preds = %13
%18 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%19 = call i32 @strlen(i8* %18)
%20 = sub nsw i32 %19, 7
%21 = sub nsw i32 %20, 1
store i32 %21, i32* %6
%22 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%23 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%24 = getelementptr inbounds i8, i8* %23, i64 7
%25 = load i32, i32* %6
%26 = call i32 @strncpy(i8* %22, i8* %24, i32 %25)
%27 = load i32, i32* %6
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 %28
store i8 0, i8* %29
%30 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%31 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %30)
br label %32
32: ; preds = %17, %49
%33 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%34 = load i32, i32* @stdin
%35 = call i8* @fgets(i8* %33, i32 512, i32 %34)
store i8* %35, i8** %3
%36 = icmp eq i8* %35, null
br i1 %36, label %37, label %40
37: ; preds = %32
%38 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%39 = call i32 @exit(i32 1)
unreachable
40: ; preds = %32
%41 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%42 = call i64 @strncmp(i8* %41, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 4)
%43 = icmp eq i64 %42, 0
br i1 %43, label %48, label %44
44: ; preds = %40
%45 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%46 = call i64 @strncmp(i8* %45, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 4)
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %49
48: ; preds = %44, %40
br label %52
49: ; preds = %44
%50 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%51 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %50)
br label %32
52: ; preds = %48
%53 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%54 = getelementptr inbounds i8, i8* %53, i64 4
%55 = call i8* @strchr(i8* %54, i8 signext 9)
store i8* %55, i8** %4
%56 = icmp eq i8* %55, null
br i1 %56, label %57, label %63
57: ; preds = %52
%58 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%59 = load i32, i32* @stderr
%60 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%61 = call i32 @fprintf(i32 %59, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i8* %60)
%62 = call i32 @exit(i32 1)
unreachable
63: ; preds = %52
%64 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%65 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%66 = call i32 @strncpy(i8* %64, i8* %65, i32 3)
%67 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 3
store i8 0, i8* %67
%68 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%69 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%70 = load i8*, i8** %4
%71 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8* %68, i8* %69, i8* %70)
%72 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%73 = load i32, i32* @stdin
%74 = call i8* @fgets(i8* %72, i32 512, i32 %73)
store i8* %74, i8** %3
%75 = icmp eq i8* %74, null
br i1 %75, label %76, label %79
76: ; preds = %63
%77 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%78 = call i32 @exit(i32 1)
unreachable
79: ; preds = %63
%80 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%81 = getelementptr inbounds i8, i8* %80, i64 4
%82 = call i8* @strchr(i8* %81, i8 signext 9)
store i8* %82, i8** %4
%83 = icmp eq i8* %82, null
br i1 %83, label %84, label %90
84: ; preds = %79
%85 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%86 = load i32, i32* @stderr
%87 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%88 = call i32 @fprintf(i32 %86, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i8* %87)
%89 = call i32 @exit(i32 1)
unreachable
90: ; preds = %79
%91 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%92 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%93 = call i32 @strncpy(i8* %91, i8* %92, i32 3)
%94 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 3
store i8 0, i8* %94
%95 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%96 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%97 = load i8*, i8** %4
%98 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8* %95, i8* %96, i8* %97)
br label %102
99: ; preds = %13
%100 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%101 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %100)
br label %102
102: ; preds = %99, %90
br label %8
103: ; preds = %8
%104 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [8 x i8] c"Index: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [8 x i8] c"fgets a\00"
@.str.3 = [5 x i8] c"*** \00"
@.str.4 = [5 x i8] c"--- \00"
@.str.5 = [7 x i8] c"strchr\00"
@stderr = global i32 0
@.str.6 = [15 x i8] c"Line was '%s'\0A\00"
@.str.7 = [8 x i8] c"%s %s%s\00"
@.str.8 = [8 x i8] c"fgets b\00"
define i32 @main() {
%1 = alloca [512 x i8]
%2 = alloca [512 x i8]
%3 = alloca [5 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%6 = load i32, i32* @stdin
%7 = call i8* @fgets(i8* %4, i32 512, i32 %6)
%8 = icmp eq i8* %7, null
br i1 %8, label %75, label %9
9: ; preds = %0
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 7
%12 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 4
%13 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 3
br label %14
14: ; preds = %9, %71
%15 = call i64 @strncmp(i8* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %69
17: ; preds = %14
%18 = call i32 @strlen(i8* %4)
%19 = add nsw i32 %18, -8
%20 = call i32 @strncpy(i8* %5, i8* %11, i32 %19)
%21 = sext i32 %19 to i64
%22 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 %21
store i8 0, i8* %22
%23 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%24 = load i32, i32* @stdin
%25 = call i8* @fgets(i8* %4, i32 512, i32 %24)
%26 = icmp eq i8* %25, null
br i1 %26, label %27, label %30
27: ; preds = %17, %36
%28 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%29 = call i32 @exit(i32 1)
unreachable
30: ; preds = %17, %36
%31 = call i64 @strncmp(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 4)
%32 = icmp eq i64 %31, 0
br i1 %32, label %41, label %33
33: ; preds = %30
%34 = call i64 @strncmp(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 4)
%35 = icmp eq i64 %34, 0
br i1 %35, label %41, label %36
36: ; preds = %33
%37 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%38 = load i32, i32* @stdin
%39 = call i8* @fgets(i8* %4, i32 512, i32 %38)
%40 = icmp eq i8* %39, null
br i1 %40, label %27, label %30
41: ; preds = %30, %33
%42 = call i8* @strchr(i8* %12, i8 signext 9)
%43 = icmp eq i8* %42, null
br i1 %43, label %44, label %49
44: ; preds = %41
%45 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%46 = load i32, i32* @stderr
%47 = call i32 @fprintf(i32 %46, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i8* %4)
%48 = call i32 @exit(i32 1)
unreachable
49: ; preds = %41
%50 = call i32 @strncpy(i8* %10, i8* %4, i32 3)
store i8 0, i8* %13
%51 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8* %10, i8* %5, i8* %42)
%52 = load i32, i32* @stdin
%53 = call i8* @fgets(i8* %4, i32 512, i32 %52)
%54 = icmp eq i8* %53, null
br i1 %54, label %55, label %58
55: ; preds = %49
%56 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%57 = call i32 @exit(i32 1)
unreachable
58: ; preds = %49
%59 = call i8* @strchr(i8* %12, i8 signext 9)
%60 = icmp eq i8* %59, null
br i1 %60, label %61, label %66
61: ; preds = %58
%62 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%63 = load i32, i32* @stderr
%64 = call i32 @fprintf(i32 %63, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i8* %4)
%65 = call i32 @exit(i32 1)
unreachable
66: ; preds = %58
%67 = call i32 @strncpy(i8* %10, i8* %4, i32 3)
store i8 0, i8* %13
%68 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8* %10, i8* %5, i8* %59)
br label %71
69: ; preds = %14
%70 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
br label %71
71: ; preds = %69, %66
%72 = load i32, i32* @stdin
%73 = call i8* @fgets(i8* %4, i32 512, i32 %72)
%74 = icmp eq i8* %73, null
br i1 %74, label %75, label %14
75: ; preds = %71, %0
%76 = call i32 @exit(i32 0)
unreachable
}