#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 */
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, char *, ...);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *strtok(char *, char *);
int main(int argc, char *argv[]) {
  FILE *in, *out;
  char file_name[64];
  char buf[128];
  char outbuf[128];
  char head[28];
  char *p;
  int len;
  if (argc != 2) {
    printf("wrong usage\n");
    exit(1);
  }
  len = strlen(argv[1]);
  if (strcmp(&argv[1][len - 3], "ini") != 0) {
    printf("source file error\n");
    exit(1);
  }
  in = fopen(argv[1], "r");
  if (in == NULL) {
    perror("fail to open");
    exit(1);
  }
  strcpy(file_name, argv[1]);
  strcpy(&file_name[len - 3], "xml");
  out = fopen(file_name, "w");
  if (out == NULL) {
    perror("fail to open");
    exit(1);
  }
  while (fgets(buf, 128, in) != NULL) {
    len = strlen(buf);
    printf("%d\n", len);
    buf[len - 1] = '\0';
    if (buf[0] == '#')
      sprintf(outbuf, "<!-- %s -->\n", buf);
    else if (buf[0] == '!') {
      sprintf(outbuf, "<%s>\n", &buf[1]);
      strcpy(head, buf);
    } else if (buf[0] == '\0')
      sprintf(outbuf, "</%s>\n\n", &head[1]);
    else {
      p = strtok(buf, "=");
      sprintf(outbuf, "\t<%s>%s</%s>\n", buf, p, buf);
    }
    if (fputs(outbuf, out) == -1) {
      perror("fail to write");
      exit(1);
    }
  }
  if (errno != 0) {
    perror("fail to read");
    exit(1);
  }
  fclose(in);
  fclose(out);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11fb <main+0x3b>
lea    0xe16(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x18c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x18c(%rbp),%eax
sub    $0x3,%eax
cltq
add    %rax,%rdi
lea    0xde2(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     1252 <main+0x92>
lea    0xdd0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdc3(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    128b <main+0xcb>
lea    0xdaa(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
mov    -0x18c(%rbp),%eax
sub    $0x3,%eax
cltq
lea    -0x60(%rbp),%rdi
add    %rax,%rdi
lea    0xd7e(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x60(%rbp),%rdi
lea    0xd72(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    12ef <main+0x12f>
lea    0xd46(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
jmp    12f4 <main+0x134>
lea    -0xe0(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x80,%esi
call   1080 <fgets@plt>
cmp    $0x0,%rax
je     147c <main+0x2bc>
lea    -0xe0(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x18c(%rbp)
mov    -0x18c(%rbp),%esi
lea    0xd07(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18c(%rbp),%eax
sub    $0x1,%eax
cltq
movb   $0x0,-0xe0(%rbp,%rax,1)
movsbl -0xe0(%rbp),%eax
cmp    $0x23,%eax
jne    137d <main+0x1bd>
lea    -0x160(%rbp),%rdi
lea    -0xe0(%rbp),%rdx
lea    0xccc(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
jmp    1448 <main+0x288>
movsbl -0xe0(%rbp),%eax
cmp    $0x21,%eax
jne    13c5 <main+0x205>
lea    -0x160(%rbp),%rdi
lea    -0xe0(%rbp),%rdx
add    $0x1,%rdx
lea    0xca4(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
lea    -0x180(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    1443 <main+0x283>
movsbl -0xe0(%rbp),%eax
cmp    $0x0,%eax
jne    13fa <main+0x23a>
lea    -0x160(%rbp),%rdi
lea    -0x180(%rbp),%rdx
add    $0x1,%rdx
lea    0xc62(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
jmp    143e <main+0x27e>
lea    -0xe0(%rbp),%rdi
lea    0xc50(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x188(%rbp)
lea    -0x160(%rbp),%rdi
lea    -0xe0(%rbp),%rdx
mov    -0x188(%rbp),%rcx
lea    -0xe0(%rbp),%r8
lea    0xc23(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
jmp    1443 <main+0x283>
jmp    1448 <main+0x288>
lea    -0x160(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1070 <fputs@plt>
cmp    $0xffffffff,%eax
jne    1477 <main+0x2b7>
lea    0xc00(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
jmp    12f4 <main+0x134>
mov    0x2b5d(%rip),%rax
cmpq   $0x0,(%rax)
je     14a3 <main+0x2e3>
lea    0xbe2(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x168,%rsp
cmp    $0x2,%edi
jne    13be <main+0x1ee>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1060 <strlen@plt>
movslq %eax,%rbp
add    $0xfffffffffffffffd,%rbp
mov    0x8(%rbx),%rdi
add    %rbp,%rdi
lea    0xdf5(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
jne    13c7 <main+0x1f7>
mov    0x8(%rbx),%rdi
lea    0xe4d(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     13b5 <main+0x1e5>
mov    %rax,%r14
mov    0x8(%rbx),%rsi
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    (%rsp,%rbp,1),%rdi
add    $0x20,%rdi
lea    0xdbc(%rip),%rsi
call   1030 <strcpy@plt>
lea    0xdb4(%rip),%rsi
mov    %rbx,%rdi
call   10b0 <fopen@plt>
test   %rax,%rax
je     13b5 <main+0x1e5>
mov    %rax,%r13
lea    0x60(%rsp),%rbx
lea    0xd96(%rip),%rbp
lea    0xe0(%rsp),%r12
jmp    12c5 <main+0xf5>
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
lea    0xd8e(%rip),%rsi
lea    0x61(%rsp),%rdx
xor    %eax,%eax
call   10e0 <sprintf@plt>
mov    %rsp,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   1080 <fputs@plt>
cmp    $0xffffffff,%eax
je     139f <main+0x1cf>
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %r14,%rdx
call   1090 <fgets@plt>
test   %rax,%rax
je     136e <main+0x19e>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %eax,%r15d
mov    %rbp,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
movslq %r15d,%rax
movb   $0x0,-0x1(%rax,%rbx,1)
movzbl 0x60(%rsp),%eax
test   %al,%al
je     1320 <main+0x150>
cmp    $0x21,%al
je     1290 <main+0xc0>
cmp    $0x23,%al
jne    1340 <main+0x170>
mov    %r12,%rdi
lea    0xd03(%rip),%rsi
mov    %rbx,%rdx
jmp    132f <main+0x15f>
nopl   (%rax)
mov    %r12,%rdi
lea    0xd04(%rip),%rsi
lea    0x1(%rsp),%rdx
xor    %eax,%eax
call   10e0 <sprintf@plt>
jmp    12b1 <main+0xe1>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
lea    0xcec(%rip),%rsi
call   10d0 <strtok@plt>
mov    %r12,%rdi
lea    0xcdf(%rip),%rsi
mov    %rbx,%rdx
mov    %rax,%rcx
mov    %rbx,%r8
xor    %eax,%eax
call   10e0 <sprintf@plt>
jmp    12b1 <main+0xe1>
mov    0x2c6b(%rip),%rax
cmpq   $0x0,(%rax)
jne    13dd <main+0x20d>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %r13,%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
add    $0x168,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xca0(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
lea    0xc48(%rip),%rdi
jmp    13a6 <main+0x1d6>
lea    0xcae(%rip),%rdi
jmp    13ce <main+0x1fe>
lea    0xc93(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
lea    0xc70(%rip),%rdi
jmp    13a6 <main+0x1d6>

LLVM IR (-O0):
@.str = [13 x i8] c"wrong usage\0A\00"
@.str.1 = [4 x i8] c"ini\00"
@.str.2 = [19 x i8] c"source file error\0A\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [13 x i8] c"fail to open\00"
@.str.5 = [4 x i8] c"xml\00"
@.str.6 = [2 x i8] c"w\00"
@.str.7 = [4 x i8] c"%d\0A\00"
@.str.8 = [13 x i8] c"<!-- %s -->\0A\00"
@.str.9 = [6 x i8] c"<%s>\0A\00"
@.str.10 = [8 x i8] c"</%s>\0A\0A\00"
@.str.11 = [2 x i8] c"=\00"
@.str.12 = [14 x i8] c"\09<%s>%s</%s>\0A\00"
@.str.13 = [14 x i8] c"fail to write\00"
@errno = global i64 0
@.str.14 = [13 x i8] c"fail to read\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 [64 x i8]
%9 = alloca [128 x i8]
%10 = alloca [128 x i8]
%11 = alloca [28 x i8]
%12 = alloca i8*
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 2
br i1 %15, label %16, label %19
16: ; preds = %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32 @strlen(i8* %22)
store i32 %23, i32* %13
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = load i32, i32* %13
%28 = sub nsw i32 %27, 3
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %26, i64 %29
%31 = call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%32 = icmp ne i64 %31, 0
br i1 %32, label %33, label %36
33: ; preds = %19
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%35 = call i32 @exit(i32 1)
unreachable
36: ; preds = %19
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 1
%39 = load i8*, i8** %38
%40 = call i32* @fopen(i8* %39, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %40, i32** %6
%41 = load i32*, i32** %6
%42 = icmp eq i32* %41, null
br i1 %42, label %43, label %46
43: ; preds = %36
%44 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%45 = call i32 @exit(i32 1)
unreachable
46: ; preds = %36
%47 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 1
%50 = load i8*, i8** %49
%51 = call i32 @strcpy(i8* %47, i8* %50)
%52 = load i32, i32* %13
%53 = sub nsw i32 %52, 3
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 %54
%56 = call i32 @strcpy(i8* %55, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%57 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%58 = call i32* @fopen(i8* %57, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32* %58, i32** %7
%59 = load i32*, i32** %7
%60 = icmp eq i32* %59, null
br i1 %60, label %61, label %64
61: ; preds = %46
%62 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%63 = call i32 @exit(i32 1)
unreachable
64: ; preds = %46
br label %65
65: ; preds = %126, %64
%66 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%67 = load i32*, i32** %6
%68 = call i32* @fgets(i8* %66, i32 128, i32* %67)
%69 = icmp ne i32* %68, null
br i1 %69, label %70, label %127
70: ; preds = %65
%71 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%72 = call i32 @strlen(i8* %71)
store i32 %72, i32* %13
%73 = load i32, i32* %13
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 %73)
%75 = load i32, i32* %13
%76 = sub nsw i32 %75, 1
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 %77
store i8 0, i8* %78
%79 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%80 = load i8, i8* %79
%81 = sext i8 %80 to i32
%82 = icmp eq i32 %81, 35
br i1 %82, label %83, label %87
83: ; preds = %70
%84 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%85 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%86 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %84, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8* %85)
br label %118
87: ; preds = %70
%88 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%89 = load i8, i8* %88
%90 = sext i8 %89 to i32
%91 = icmp eq i32 %90, 33
br i1 %91, label %92, label %99
92: ; preds = %87
%93 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%94 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 1
%95 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %93, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* %94)
%96 = getelementptr inbounds [28 x i8], [28 x i8]* %11, i64 0, i64 0
%97 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%98 = call i32 @strcpy(i8* %96, i8* %97)
br label %117
99: ; preds = %87
%100 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%101 = load i8, i8* %100
%102 = sext i8 %101 to i32
%103 = icmp eq i32 %102, 0
br i1 %103, label %104, label %108
104: ; preds = %99
%105 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%106 = getelementptr inbounds [28 x i8], [28 x i8]* %11, i64 0, i64 1
%107 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %105, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i8* %106)
br label %116
108: ; preds = %99
%109 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%110 = call i8* @strtok(i8* %109, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
store i8* %110, i8** %12
%111 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%112 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%113 = load i8*, i8** %12
%114 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%115 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %111, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0), i8* %112, i8* %113, i8* %114)
br label %116
116: ; preds = %108, %104
br label %117
117: ; preds = %116, %92
br label %118
118: ; preds = %117, %83
%119 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%120 = load i32*, i32** %7
%121 = call i32 @fputs(i8* %119, i32* %120)
%122 = icmp eq i32 %121, -1
br i1 %122, label %123, label %126
123: ; preds = %118
%124 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0))
%125 = call i32 @exit(i32 1)
unreachable
126: ; preds = %118
br label %65
127: ; preds = %65
%128 = load i64, i64* @errno
%129 = icmp ne i64 %128, 0
br i1 %129, label %130, label %133
130: ; preds = %127
%131 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0))
%132 = call i32 @exit(i32 1)
unreachable
133: ; preds = %127
%134 = load i32*, i32** %6
%135 = call i32 @fclose(i32* %134)
%136 = load i32*, i32** %7
%137 = call i32 @fclose(i32* %136)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"ini\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [13 x i8] c"fail to open\00"
@.str.5 = [4 x i8] c"xml\00"
@.str.6 = [2 x i8] c"w\00"
@.str.7 = [4 x i8] c"%d\0A\00"
@.str.8 = [13 x i8] c"<!-- %s -->\0A\00"
@.str.9 = [6 x i8] c"<%s>\0A\00"
@.str.10 = [8 x i8] c"</%s>\0A\0A\00"
@.str.11 = [2 x i8] c"=\00"
@.str.12 = [14 x i8] c"\09<%s>%s</%s>\0A\00"
@.str.13 = [14 x i8] c"fail to write\00"
@errno = global i64 0
@.str.14 = [13 x i8] c"fail to read\00"
@str = [18 x i8] c"source file error\00"
@str.15 = [12 x i8] c"wrong usage\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [64 x i8]
%4 = alloca [128 x i8]
%5 = alloca [128 x i8]
%6 = alloca [28 x i8]
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%10 = getelementptr inbounds [28 x i8], [28 x i8]* %6, i64 0, i64 0
%11 = icmp eq i32 %0, 2
br i1 %11, label %15, label %12
12: ; preds = %2
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.15, i64 0, i64 0))
%14 = tail call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = getelementptr inbounds i8*, i8** %1, i64 1
%17 = load i8*, i8** %16
%18 = tail call i32 @strlen(i8* %17)
%19 = load i8*, i8** %16
%20 = add nsw i32 %18, -3
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
%23 = tail call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %28, label %25
25: ; preds = %15
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%27 = tail call i32 @exit(i32 1)
unreachable
28: ; preds = %15
%29 = load i8*, i8** %16
%30 = tail call i32* @fopen(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%31 = icmp eq i32* %30, null
br i1 %31, label %32, label %35
32: ; preds = %28
%33 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%34 = tail call i32 @exit(i32 1)
unreachable
35: ; preds = %28
%36 = load i8*, i8** %16
%37 = call i32 @strcpy(i8* %7, i8* %36)
%38 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 %21
%39 = call i32 @strcpy(i8* %38, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%40 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%41 = icmp eq i32* %40, null
br i1 %41, label %45, label %42
42: ; preds = %35
%43 = getelementptr inbounds [28 x i8], [28 x i8]* %6, i64 0, i64 1
%44 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 1
br label %48
45: ; preds = %35
%46 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%47 = call i32 @exit(i32 1)
unreachable
48: ; preds = %42, %68
%49 = call i32* @fgets(i8* %8, i32 128, i32* %30)
%50 = icmp eq i32* %49, null
br i1 %50, label %74, label %51
51: ; preds = %48
%52 = call i32 @strlen(i8* %8)
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 %52)
%54 = add nsw i32 %52, -1
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 %55
store i8 0, i8* %56
%57 = load i8, i8* %8
switch i8 %57, label %65 [
i8 35, label %58
i8 33, label %60
i8 0, label %63
]
58: ; preds = %51
%59 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %9, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8* %8)
br label %68
60: ; preds = %51
%61 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %9, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* %44)
%62 = call i32 @strcpy(i8* %10, i8* %8)
br label %68
63: ; preds = %51
%64 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %9, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i8* %43)
br label %68
65: ; preds = %51
%66 = call i8* @strtok(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%67 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %9, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0), i8* %8, i8* %66, i8* %8)
br label %68
68: ; preds = %60, %65, %63, %58
%69 = call i32 @fputs(i8* %9, i32* %40)
%70 = icmp eq i32 %69, -1
br i1 %70, label %71, label %48
71: ; preds = %68
%72 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0))
%73 = call i32 @exit(i32 1)
unreachable
74: ; preds = %48
%75 = load i64, i64* @errno
%76 = icmp eq i64 %75, 0
br i1 %76, label %80, label %77
77: ; preds = %74
%78 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0))
%79 = call i32 @exit(i32 1)
unreachable
80: ; preds = %74
%81 = call i32 @fclose(i32* %30)
%82 = call i32 @fclose(i32* %40)
ret i32 0
}