#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*/ plaintext_filename;
typedef int /*<<< orphan*/ key;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
char getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ *stdin;
char *strchr(char *, char);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int main(int argc, char *argv[]) {
  int status = 0;
  char key[256] = {0};
  size_t index = 0;
  char plaintext_filename[256] = {0};
  for (int curarg = 1; curarg < argc && strcmp(argv[curarg], "-"); curarg++) {
    if (!strcmp(argv[curarg], "-k")) {
      strncpy(key, argv[++curarg], sizeof(key) - 1);
    } else if (!strcmp(argv[curarg], "-f")) {
      strncpy(plaintext_filename, argv[++curarg],
              sizeof(plaintext_filename) - 1);
    }
  }
  if (key[0] == 0) {
    if (fgets(key, sizeof(key) - 1, stdin) == NULL) {
      fprintf(stderr, "Could not read inputted key.\n");
      status = 1;
      return status;
    }
    char *p;
    if ((p = strchr(key, '\n')) != NULL && *(p + 1) == '\0') {
      *p = '\0';
    }
  }
  FILE *fp;
  if (plaintext_filename[0] != 0) {
    fp = fopen(plaintext_filename, "r");
  } else {
    fp = stdin;
  }
  char next_char = 0;
  next_char = getc(fp);
  while (next_char >= 0) {
    char cipher = next_char ^ key[index];
    if (!key[++index]) {
      index = 0;
    }
    next_char = getc(fp);
    if (next_char >= 0) {
      printf("%02x", cipher);
    }
  }
  printf("\n");
  fclose(fp);
  return status;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x250,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x120(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1070 <memset@plt>
movq   $0x0,-0x128(%rbp)
lea    -0x230(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1070 <memset@plt>
movl   $0x1,-0x234(%rbp)
mov    -0x234(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0x24b(%rbp)
jge    123a <main+0x9a>
mov    -0x10(%rbp),%rax
movslq -0x234(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdd8(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x24b(%rbp)
mov    -0x24b(%rbp),%al
test   $0x1,%al
jne    124d <main+0xad>
jmp    1310 <main+0x170>
mov    -0x10(%rbp),%rax
movslq -0x234(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd9f(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    12a2 <main+0x102>
lea    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x234(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x234(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rsi
mov    $0xff,%edx
call   1030 <strncpy@plt>
jmp    12f7 <main+0x157>
mov    -0x10(%rbp),%rax
movslq -0x234(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd4d(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    12f2 <main+0x152>
lea    -0x230(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x234(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x234(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rsi
mov    $0xff,%edx
call   1030 <strncpy@plt>
jmp    12f7 <main+0x157>
jmp    12fc <main+0x15c>
mov    -0x234(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x234(%rbp)
jmp    11fb <main+0x5b>
movsbl -0x120(%rbp),%eax
cmp    $0x0,%eax
jne    13b1 <main+0x211>
lea    -0x120(%rbp),%rdi
mov    0x2cba(%rip),%rax
mov    (%rax),%rdx
mov    $0xff,%esi
call   1080 <fgets@plt>
cmp    $0x0,%rax
jne    136c <main+0x1cc>
mov    0x2c8c(%rip),%rax
mov    (%rax),%edi
lea    0xcb3(%rip),%rsi
call   10a0 <fprintf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    14c2 <main+0x322>
lea    -0x120(%rbp),%rdi
mov    $0xa,%esi
call   1050 <strchr@plt>
mov    %rax,-0x240(%rbp)
cmp    $0x0,%rax
je     13ac <main+0x20c>
mov    -0x240(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    13ac <main+0x20c>
mov    -0x240(%rbp),%rax
movb   $0x0,(%rax)
jmp    13b1 <main+0x211>
movsbl -0x230(%rbp),%eax
cmp    $0x0,%eax
je     13e0 <main+0x240>
lea    -0x230(%rbp),%rdi
lea    0xc57(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x248(%rbp)
jmp    13f1 <main+0x251>
mov    0x2c01(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x248(%rbp)
movb   $0x0,-0x249(%rbp)
mov    -0x248(%rbp),%rdi
call   10c0 <getc@plt>
mov    %al,-0x249(%rbp)
movsbl -0x249(%rbp),%eax
cmp    $0x0,%eax
jl     14a2 <main+0x302>
movsbl -0x249(%rbp),%eax
mov    -0x128(%rbp),%rcx
movsbl -0x120(%rbp,%rcx,1),%ecx
ff
xor    %ecx,%eax
mov    %al,-0x24a(%rbp)
mov    -0x128(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x128(%rbp)
cmpb   $0x0,-0x11f(%rbp,%rax,1)
jne    1466 <main+0x2c6>
movq   $0x0,-0x128(%rbp)
mov    -0x248(%rbp),%rdi
call   10c0 <getc@plt>
mov    %al,-0x249(%rbp)
movsbl -0x249(%rbp),%eax
cmp    $0x0,%eax
jl     149d <main+0x2fd>
movsbl -0x24a(%rbp),%esi
lea    0xb92(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    140a <main+0x26a>
lea    0xb7b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x248(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x250,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x208,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movaps %xmm0,0x1f0(%rsp)
movaps %xmm0,0x1e0(%rsp)
movaps %xmm0,0x1d0(%rsp)
movaps %xmm0,0x1c0(%rsp)
movaps %xmm0,0x1b0(%rsp)
movaps %xmm0,0x1a0(%rsp)
movaps %xmm0,0x190(%rsp)
movaps %xmm0,0x180(%rsp)
movaps %xmm0,0x170(%rsp)
movaps %xmm0,0x160(%rsp)
movaps %xmm0,0x150(%rsp)
movaps %xmm0,0x140(%rsp)
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x100(%rsp)
cmp    $0x2,%edi
jl     1329 <main+0x189>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x1,%r12d
lea    0xd4a(%rip),%r14
lea    0xd45(%rip),%r15
jmp    12dc <main+0x13c>
nop
lea    0x1(%r13),%r12d
mov    0x8(%rbx,%r13,8),%rsi
mov    $0xff,%edx
call   1040 <strncpy@plt>
add    $0x1,%r12d
cmp    %ebp,%r12d
jge    1323 <main+0x183>
movslq %r12d,%r13
mov    (%rbx,%r13,8),%rdi
mov    %r14,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1323 <main+0x183>
mov    (%rbx,%r13,8),%rdi
mov    %r15,%rsi
call   1090 <strcmp@plt>
mov    %rsp,%rdi
test   %rax,%rax
je     12c0 <main+0x120>
mov    (%rbx,%r13,8),%rdi
lea    0xcf6(%rip),%rsi
call   1090 <strcmp@plt>
lea    0x100(%rsp),%rdi
test   %rax,%rax
jne    12d3 <main+0x133>
jmp    12c0 <main+0x120>
cmpb   $0x0,(%rsp)
jne    135d <main+0x1bd>
mov    0x2cb8(%rip),%rax
mov    (%rax),%rdx
mov    %rsp,%rdi
mov    $0xff,%esi
call   1080 <fgets@plt>
test   %rax,%rax
je     1380 <main+0x1e0>
mov    %rsp,%rdi
mov    $0xa,%esi
call   1060 <strchr@plt>
test   %rax,%rax
je     135d <main+0x1bd>
cmpb   $0x0,0x1(%rax)
je     139f <main+0x1ff>
cmpb   $0x0,0x100(%rsp)
je     13ac <main+0x20c>
lea    0xcb8(%rip),%rsi
lea    0x100(%rsp),%rdi
call   10b0 <fopen@plt>
mov    %rax,%rbp
jmp    13b6 <main+0x216>
mov    0x2c51(%rip),%rax
mov    (%rax),%edi
lea    0xc78(%rip),%rsi
call   10a0 <fprintf@plt>
mov    $0x1,%eax
jmp    1439 <main+0x299>
movb   $0x0,(%rax)
cmpb   $0x0,0x100(%rsp)
jne    1367 <main+0x1c7>
mov    0x2c35(%rip),%rax
mov    (%rax),%rbp
mov    %rbp,%rdi
call   10c0 <getc@plt>
test   %al,%al
js     1425 <main+0x285>
mov    %eax,%r15d
mov    (%rsp),%bl
mov    0x1(%rsp),%r12b
mov    %rbp,%rdi
call   10c0 <getc@plt>
test   %al,%al
js     1425 <main+0x285>
mov    $0x1,%ecx
xchg   %ax,%ax
mov    %eax,%r13d
test   %r12b,%r12b
mov    $0x0,%r14d
cmovne %rcx,%r14
xor    %r15b,%bl
movsbl %bl,%esi
lea    0xc2b(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
movzbl (%rsp,%r14,1),%ebx
movzbl 0x1(%rsp,%r14,1),%r12d
add    $0x1,%r14
mov    %rbp,%rdi
call   10c0 <getc@plt>
mov    %r14,%rcx
mov    %r13d,%r15d
test   %al,%al
jns    13e0 <main+0x240>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbp,%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
add    $0x208,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
@.str.1 = [3 x i8] c"-k\00"
@.str.2 = [3 x i8] c"-f\00"
@stdin = global i32* null
@stderr = global i32 0
@.str.3 = [30 x i8] c"Could not read inputted key.\0A\00"
@.str.4 = [2 x i8] c"r\00"
@.str.5 = [5 x i8] c"%02x\00"
@.str.6 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [256 x i8]
%8 = alloca i64
%9 = alloca [256 x i8]
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32*
%13 = alloca i8
%14 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%15 = bitcast [256 x i8]* %7 to i8*
store i64 0, i64* %8
%16 = bitcast [256 x i8]* %9 to i8*
store i32 1, i32* %10
br label %17
17: ; preds = %67, %2
%18 = load i32, i32* %10
%19 = load i32, i32* %4
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %29
21: ; preds = %17
%22 = load i8**, i8*** %5
%23 = load i32, i32* %10
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8*, i8** %22, i64 %24
%26 = load i8*, i8** %25
%27 = call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%28 = icmp ne i64 %27, 0
br label %29
29: ; preds = %21, %17
%30 = phi i1 [ false, %17 ], [ %28, %21 ]
br i1 %30, label %31, label %70
31: ; preds = %29
%32 = load i8**, i8*** %5
%33 = load i32, i32* %10
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8*, i8** %32, i64 %34
%36 = load i8*, i8** %35
%37 = call i64 @strcmp(i8* %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%38 = icmp ne i64 %37, 0
br i1 %38, label %48, label %39
39: ; preds = %31
%40 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%41 = load i8**, i8*** %5
%42 = load i32, i32* %10
%43 = add nsw i32 %42, 1
store i32 %43, i32* %10
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i8*, i8** %41, i64 %44
%46 = load i8*, i8** %45
%47 = call i32 @strncpy(i8* %40, i8* %46, i32 255)
br label %66
48: ; preds = %31
%49 = load i8**, i8*** %5
%50 = load i32, i32* %10
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i8*, i8** %49, i64 %51
%53 = load i8*, i8** %52
%54 = call i64 @strcmp(i8* %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%55 = icmp ne i64 %54, 0
br i1 %55, label %65, label %56
56: ; preds = %48
%57 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%58 = load i8**, i8*** %5
%59 = load i32, i32* %10
%60 = add nsw i32 %59, 1
store i32 %60, i32* %10
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds i8*, i8** %58, i64 %61
%63 = load i8*, i8** %62
%64 = call i32 @strncpy(i8* %57, i8* %63, i32 255)
br label %65
65: ; preds = %56, %48
br label %66
66: ; preds = %65, %39
br label %67
67: ; preds = %66
%68 = load i32, i32* %10
%69 = add nsw i32 %68, 1
store i32 %69, i32* %10
br label %17
70: ; preds = %29
%71 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%72 = load i8, i8* %71
%73 = sext i8 %72 to i32
%74 = icmp eq i32 %73, 0
br i1 %74, label %75, label %97
75: ; preds = %70
%76 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%77 = load i32*, i32** @stdin
%78 = call i32* @fgets(i8* %76, i32 255, i32* %77)
%79 = icmp eq i32* %78, null
br i1 %79, label %80, label %84
80: ; preds = %75
%81 = load i32, i32* @stderr
%82 = call i32 @fprintf(i32 %81, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %6
%83 = load i32, i32* %6
store i32 %83, i32* %3
br label %145
84: ; preds = %75
%85 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%86 = call i8* @strchr(i8* %85, i8 signext 10)
store i8* %86, i8** %11
%87 = icmp ne i8* %86, null
br i1 %87, label %88, label %96
88: ; preds = %84
%89 = load i8*, i8** %11
%90 = getelementptr inbounds i8, i8* %89, i64 1
%91 = load i8, i8* %90
%92 = sext i8 %91 to i32
%93 = icmp eq i32 %92, 0
br i1 %93, label %94, label %96
94: ; preds = %88
%95 = load i8*, i8** %11
store i8 0, i8* %95
br label %96
96: ; preds = %94, %88, %84
br label %97
97: ; preds = %96, %70
%98 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%99 = load i8, i8* %98
%100 = sext i8 %99 to i32
%101 = icmp ne i32 %100, 0
br i1 %101, label %102, label %105
102: ; preds = %97
%103 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%104 = call i32* @fopen(i8* %103, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %104, i32** %12
br label %107
105: ; preds = %97
%106 = load i32*, i32** @stdin
store i32* %106, i32** %12
br label %107
107: ; preds = %105, %102
store i8 0, i8* %13
%108 = load i32*, i32** %12
%109 = call signext i8 @getc(i32* %108)
store i8 %109, i8* %13
br label %110
110: ; preds = %139, %107
%111 = load i8, i8* %13
%112 = sext i8 %111 to i32
%113 = icmp sge i32 %112, 0
br i1 %113, label %114, label %140
114: ; preds = %110
%115 = load i8, i8* %13
%116 = sext i8 %115 to i32
%117 = load i64, i64* %8
%118 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 %117
%119 = load i8, i8* %118
%120 = sext i8 %119 to i32
%121 = xor i32 %116, %120
%122 = trunc i32 %121 to i8
store i8 %122, i8* %14
%123 = load i64, i64* %8
%124 = add i64 %123, 1
store i64 %124, i64* %8
%125 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 %124
%126 = load i8, i8* %125
%127 = icmp ne i8 %126, 0
br i1 %127, label %129, label %128
128: ; preds = %114
store i64 0, i64* %8
br label %129
129: ; preds = %128, %114
%130 = load i32*, i32** %12
%131 = call signext i8 @getc(i32* %130)
store i8 %131, i8* %13
%132 = load i8, i8* %13
%133 = sext i8 %132 to i32
%134 = icmp sge i32 %133, 0
br i1 %134, label %135, label %139
135: ; preds = %129
%136 = load i8, i8* %14
%137 = sext i8 %136 to i32
%138 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %137)
br label %139
139: ; preds = %135, %129
br label %110
140: ; preds = %110
%141 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%142 = load i32*, i32** %12
%143 = call i32 @fclose(i32* %142)
%144 = load i32, i32* %6
store i32 %144, i32* %3
br label %145
145: ; preds = %140, %80
%146 = load i32, i32* %3
ret i32 %146
}

LLVM IR (-O2):
@.str = [2 x i8] c"-\00"
@.str.1 = [3 x i8] c"-k\00"
@.str.2 = [3 x i8] c"-f\00"
@stdin = global i32* null
@stderr = global i32 0
@.str.3 = [30 x i8] c"Could not read inputted key.\0A\00"
@.str.4 = [2 x i8] c"r\00"
@.str.5 = [5 x i8] c"%02x\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = alloca [256 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%7 = icmp sgt i32 %0, 1
br i1 %7, label %8, label %37
8: ; preds = %2, %33
%9 = phi i32 [ %35, %33 ], [ 1, %2 ]
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8*, i8** %1, i64 %10
%12 = load i8*, i8** %11
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %8, %33
%16 = load i8, i8* %5
%17 = icmp eq i8 %16, 0
br i1 %17, label %37, label %52
18: ; preds = %8
%19 = load i8*, i8** %11
%20 = call i64 @strcmp(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %26, label %22
22: ; preds = %18
%23 = load i8*, i8** %11
%24 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %33
26: ; preds = %22, %18
%27 = phi i8* [ %5, %18 ], [ %6, %22 ]
%28 = add nsw i32 %9, 1
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8*, i8** %1, i64 %29
%31 = load i8*, i8** %30
%32 = call i32 @strncpy(i8* %27, i8* %31, i32 255)
br label %33
33: ; preds = %26, %22
%34 = phi i32 [ %9, %22 ], [ %28, %26 ]
%35 = add nsw i32 %34, 1
%36 = icmp slt i32 %35, %0
br i1 %36, label %8, label %15
37: ; preds = %2, %15
%38 = load i32*, i32** @stdin
%39 = call i32* @fgets(i8* %5, i32 255, i32* %38)
%40 = icmp eq i32* %39, null
br i1 %40, label %41, label %44
41: ; preds = %37
%42 = load i32, i32* @stderr
%43 = call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
br label %91
44: ; preds = %37
%45 = call i8* @strchr(i8* %5, i8 signext 10)
%46 = icmp eq i8* %45, null
br i1 %46, label %52, label %47
47: ; preds = %44
%48 = getelementptr inbounds i8, i8* %45, i64 1
%49 = load i8, i8* %48
%50 = icmp eq i8 %49, 0
br i1 %50, label %51, label %52
51: ; preds = %47
store i8 0, i8* %45
br label %52
52: ; preds = %44, %47, %51, %15
%53 = load i8, i8* %6
%54 = icmp eq i8 %53, 0
br i1 %54, label %57, label %55
55: ; preds = %52
%56 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %59
57: ; preds = %52
%58 = load i32*, i32** @stdin
br label %59
59: ; preds = %57, %55
%60 = phi i32* [ %56, %55 ], [ %58, %57 ]
%61 = call signext i8 @getc(i32* %60)
%62 = icmp sgt i8 %61, -1
br i1 %62, label %63, label %88
63: ; preds = %59
%64 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%65 = load i8, i8* %64
%66 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 1
%67 = load i8, i8* %66
%68 = call signext i8 @getc(i32* %60)
%69 = icmp sgt i8 %68, -1
br i1 %69, label %70, label %88
70: ; preds = %63, %70
%71 = phi i8 [ %86, %70 ], [ %68, %63 ]
%72 = phi i8 [ %85, %70 ], [ %67, %63 ]
%73 = phi i64 [ %83, %70 ], [ 1, %63 ]
%74 = phi i8 [ %82, %70 ], [ %65, %63 ]
%75 = phi i8 [ %71, %70 ], [ %61, %63 ]
%76 = icmp eq i8 %72, 0
%77 = select i1 %76, i64 0, i64 %73
%78 = xor i8 %74, %75
%79 = sext i8 %78 to i32
%80 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %79)
%81 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %77
%82 = load i8, i8* %81
%83 = add i64 %77, 1
%84 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %83
%85 = load i8, i8* %84
%86 = call signext i8 @getc(i32* %60)
%87 = icmp sgt i8 %86, -1
br i1 %87, label %70, label %88
88: ; preds = %70, %63, %59
%89 = call i32 @putchar(i32 10)
%90 = call i32 @fclose(i32* %60)
br label %91
91: ; preds = %88, %41
%92 = phi i32 [ 1, %41 ], [ 0, %88 ]
ret i32 %92
}