#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 */
char getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ putc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
void merge_sort(FILE *merge, FILE *sort1, FILE *sort2, int len) {
  int s1, s2;
  int i, j, k;
  char c, c1, c2;
  for (i = 1; i < len; i *= 2) {
    for (j = 0; j < len / 2; j++) {
      c = getc(merge);
      putc(c, sort1);
    }
    for (; j < len; j++) {
      c = getc(merge);
      putc(c, sort2);
    }
    rewind(merge);
    rewind(sort1);
    rewind(sort2);
    for (k = 0; k < len / 2; k += i) {
      c1 = getc(sort1);
      c2 = getc(sort2);
      s1 = s2 = 0;
      while (1) {
        if (c1 < c2) {
          putc(c1, merge);
          s1++;
          if (s1 < i)
            c1 = getc(sort1);
          else
            break;
        } else {
          putc(c2, merge);
          s2++;
          if (s2 < i) {
            c2 = getc(sort2);
          } else {
            break;
          }
        }
      }
      if (s1 < i) {
        putc(c1, merge);
        s1++;
      }
      if (s2 < i) {
        putc(c2, merge);
        s2++;
      }
      while (s1 < i) {
        c = getc(sort1);
        putc(c, merge);
        s1++;
      }
      while (s2 < i) {
        c = getc(sort2);
        putc(c, merge);
        s2++;
      }
    }
    rewind(merge);
    rewind(sort1);
    rewind(sort2);
  }
}


x86 assembly (clang, -O0):
<merge_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    13d3 <merge_sort+0x2a3>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x38(%rbp),%eax
cmp    %ecx,%eax
jge    11a8 <merge_sort+0x78>
mov    -0x8(%rbp),%rdi
call   1050 <getc@plt>
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1040 <putc@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1161 <merge_sort+0x31>
jmp    11ad <merge_sort+0x7d>
mov    -0x2c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11e2 <merge_sort+0xb2>
mov    -0x8(%rbp),%rdi
call   1050 <getc@plt>
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
mov    -0x18(%rbp),%rsi
movsbl %al,%edi
call   1040 <putc@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11ad <merge_sort+0x7d>
mov    -0x8(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0x10(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0x18(%rbp),%rdi
call   1030 <rewind@plt>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x3c(%rbp),%eax
cmp    %ecx,%eax
jge    13aa <merge_sort+0x27a>
mov    -0x10(%rbp),%rdi
call   1050 <getc@plt>
mov    %al,-0x32(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <getc@plt>
mov    %al,-0x33(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x20(%rbp)
movsbl -0x32(%rbp),%eax
movsbl -0x33(%rbp),%ecx
cmp    %ecx,%eax
jge    1297 <merge_sort+0x167>
mov    -0x32(%rbp),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1040 <putc@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    128d <merge_sort+0x15d>
mov    -0x10(%rbp),%rdi
call   1050 <getc@plt>
mov    %al,-0x32(%rbp)
jmp    1292 <merge_sort+0x162>
jmp    12db <merge_sort+0x1ab>
jmp    12d6 <merge_sort+0x1a6>
mov    -0x33(%rbp),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1040 <putc@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    12cc <merge_sort+0x19c>
mov    -0x18(%rbp),%rdi
call   1050 <getc@plt>
mov    %al,-0x33(%rbp)
jmp    12d1 <merge_sort+0x1a1>
jmp    12db <merge_sort+0x1ab>
jmp    12d6 <merge_sort+0x1a6>
jmp    1248 <merge_sort+0x118>
mov    -0x20(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    12ff <merge_sort+0x1cf>
mov    -0x32(%rbp),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1040 <putc@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    1323 <merge_sort+0x1f3>
mov    -0x33(%rbp),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1040 <putc@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1328 <merge_sort+0x1f8>
mov    -0x20(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    135d <merge_sort+0x22d>
mov    -0x10(%rbp),%rdi
call   1050 <getc@plt>
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1040 <putc@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1328 <merge_sort+0x1f8>
jmp    1362 <merge_sort+0x232>
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    1397 <merge_sort+0x267>
mov    -0x18(%rbp),%rdi
call   1050 <getc@plt>
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1040 <putc@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1362 <merge_sort+0x232>
jmp    139c <merge_sort+0x26c>
mov    -0x28(%rbp),%eax
add    -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
jmp    1204 <merge_sort+0xd4>
mov    -0x8(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0x10(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0x18(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0x28(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    114e <merge_sort+0x1e>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<merge_sort>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %ecx,0x8(%rsp)
cmp    $0x2,%ecx
jl     1374 <merge_sort+0x244>
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%rbp
mov    0x8(%rsp),%eax
mov    %eax,%ecx
shr    %ecx
mov    %ecx,0xc(%rsp)
sub    %ecx,%eax
mov    %eax,0x24(%rsp)
movl   $0x1,0x4(%rsp)
mov    %rsi,0x18(%rsp)
jmp    11ac <merge_sort+0x7c>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbp,%rdi
call   1030 <rewind@plt>
mov    %r14,%rdi
call   1030 <rewind@plt>
mov    %r12,%rdi
call   1030 <rewind@plt>
mov    0x4(%rsp),%eax
add    %eax,%eax
mov    %eax,0x4(%rsp)
cmp    0x8(%rsp),%eax
jge    1374 <merge_sort+0x244>
mov    0xc(%rsp),%ebx
mov    %rbp,%rdi
call   1050 <getc@plt>
movsbl %al,%edi
mov    %r14,%rsi
call   1040 <putc@plt>
add    $0xffffffff,%ebx
jne    11b0 <merge_sort+0x80>
mov    0x24(%rsp),%ebx
mov    0xc(%rsp),%eax
cmp    0x8(%rsp),%eax
jge    11f8 <merge_sort+0xc8>
cs nopw 0x0(%rax,%rax,1)
mov    %rbp,%rdi
call   1050 <getc@plt>
movsbl %al,%edi
mov    %r12,%rsi
call   1040 <putc@plt>
add    $0xffffffff,%ebx
jne    11e0 <merge_sort+0xb0>
mov    %rbp,%rdi
call   1030 <rewind@plt>
mov    %r14,%rdi
call   1030 <rewind@plt>
mov    %r12,%rdi
call   1030 <rewind@plt>
xor    %r13d,%r13d
jmp    1230 <merge_sort+0x100>
cs nopw 0x0(%rax,%rax,1)
nop
add    0x4(%rsp),%r13d
cmp    0xc(%rsp),%r13d
jge    1180 <merge_sort+0x50>
mov    %r13d,0x14(%rsp)
mov    %r14,%rdi
call   1050 <getc@plt>
mov    %eax,%r13d
mov    %r12,%rdi
call   1050 <getc@plt>
mov    %eax,%ebx
movl   $0x0,0x10(%rsp)
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %bl,%r13b
jl     128b <merge_sort+0x15b>
movsbl %bl,%edi
mov    %rbp,%rsi
call   1040 <putc@plt>
lea    0x1(%r14),%r15d
cmp    0x4(%rsp),%r15d
jge    12c0 <merge_sort+0x190>
mov    %r12,%rdi
call   1050 <getc@plt>
mov    %eax,%ebx
add    $0x1,%r14d
jmp    1260 <merge_sort+0x130>
movsbl %r13b,%edi
mov    %rbp,%rsi
call   1040 <putc@plt>
mov    0x10(%rsp),%eax
add    $0x1,%eax
cmp    0x4(%rsp),%eax
jge    135d <merge_sort+0x22d>
mov    %eax,0x10(%rsp)
mov    0x18(%rsp),%rdi
call   1050 <getc@plt>
mov    %eax,%r13d
jmp    1260 <merge_sort+0x130>
nopl   0x0(%rax,%rax,1)
mov    0x18(%rsp),%r14
mov    0x10(%rsp),%eax
cmp    0x4(%rsp),%eax
jge    12e4 <merge_sort+0x1b4>
movsbl %r13b,%edi
mov    %rbp,%rsi
mov    %eax,%r13d
call   1040 <putc@plt>
mov    %r13d,%eax
add    $0x1,%eax
mov    0x14(%rsp),%r13d
cmp    0x4(%rsp),%r15d
jge    1303 <merge_sort+0x1d3>
movsbl %bl,%edi
mov    %rbp,%rsi
mov    %eax,%ebx
call   1040 <putc@plt>
mov    %ebx,%eax
add    $0x1,%r15d
cmp    0x4(%rsp),%eax
jge    1328 <merge_sort+0x1f8>
mov    0x4(%rsp),%ebx
sub    %eax,%ebx
nop
mov    %r14,%rdi
call   1050 <getc@plt>
movsbl %al,%edi
mov    %rbp,%rsi
call   1040 <putc@plt>
add    $0xffffffff,%ebx
jne    1310 <merge_sort+0x1e0>
cmp    0x4(%rsp),%r15d
jge    1220 <merge_sort+0xf0>
mov    0x4(%rsp),%ebx
sub    %r15d,%ebx
nopw   0x0(%rax,%rax,1)
mov    %r12,%rdi
call   1050 <getc@plt>
movsbl %al,%edi
mov    %rbp,%rsi
call   1040 <putc@plt>
add    $0xffffffff,%ebx
jne    1340 <merge_sort+0x210>
jmp    1220 <merge_sort+0xf0>
mov    %r14d,%r15d
mov    0x18(%rsp),%r14
cmp    0x4(%rsp),%eax
jl     12cf <merge_sort+0x19f>
jmp    12e4 <merge_sort+0x1b4>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @merge_sort(i32* %0, i32* %1, i32* %2, i32 %3) {
%5 = alloca i32*
%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 i8
%15 = alloca i8
%16 = alloca i8
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
store i32 1, i32* %11
br label %17
17: ; preds = %160, %4
%18 = load i32, i32* %11
%19 = load i32, i32* %8
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %163
21: ; preds = %17
store i32 0, i32* %12
br label %22
22: ; preds = %33, %21
%23 = load i32, i32* %12
%24 = load i32, i32* %8
%25 = sdiv i32 %24, 2
%26 = icmp slt i32 %23, %25
br i1 %26, label %27, label %36
27: ; preds = %22
%28 = load i32*, i32** %5
%29 = call signext i8 @getc(i32* %28)
store i8 %29, i8* %14
%30 = load i8, i8* %14
%31 = load i32*, i32** %6
%32 = call i32 @putc(i8 signext %30, i32* %31)
br label %33
33: ; preds = %27
%34 = load i32, i32* %12
%35 = add nsw i32 %34, 1
store i32 %35, i32* %12
br label %22
36: ; preds = %22
br label %37
37: ; preds = %47, %36
%38 = load i32, i32* %12
%39 = load i32, i32* %8
%40 = icmp slt i32 %38, %39
br i1 %40, label %41, label %50
41: ; preds = %37
%42 = load i32*, i32** %5
%43 = call signext i8 @getc(i32* %42)
store i8 %43, i8* %14
%44 = load i8, i8* %14
%45 = load i32*, i32** %7
%46 = call i32 @putc(i8 signext %44, i32* %45)
br label %47
47: ; preds = %41
%48 = load i32, i32* %12
%49 = add nsw i32 %48, 1
store i32 %49, i32* %12
br label %37
50: ; preds = %37
%51 = load i32*, i32** %5
%52 = call i32 @rewind(i32* %51)
%53 = load i32*, i32** %6
%54 = call i32 @rewind(i32* %53)
%55 = load i32*, i32** %7
%56 = call i32 @rewind(i32* %55)
store i32 0, i32* %13
br label %57
57: ; preds = %149, %50
%58 = load i32, i32* %13
%59 = load i32, i32* %8
%60 = sdiv i32 %59, 2
%61 = icmp slt i32 %58, %60
br i1 %61, label %62, label %153
62: ; preds = %57
%63 = load i32*, i32** %6
%64 = call signext i8 @getc(i32* %63)
store i8 %64, i8* %15
%65 = load i32*, i32** %7
%66 = call signext i8 @getc(i32* %65)
store i8 %66, i8* %16
store i32 0, i32* %10
store i32 0, i32* %9
br label %67
67: ; preds = %62, %101
%68 = load i8, i8* %15
%69 = sext i8 %68 to i32
%70 = load i8, i8* %16
%71 = sext i8 %70 to i32
%72 = icmp slt i32 %69, %71
br i1 %72, label %73, label %87
73: ; preds = %67
%74 = load i8, i8* %15
%75 = load i32*, i32** %5
%76 = call i32 @putc(i8 signext %74, i32* %75)
%77 = load i32, i32* %9
%78 = add nsw i32 %77, 1
store i32 %78, i32* %9
%79 = load i32, i32* %9
%80 = load i32, i32* %11
%81 = icmp slt i32 %79, %80
br i1 %81, label %82, label %85
82: ; preds = %73
%83 = load i32*, i32** %6
%84 = call signext i8 @getc(i32* %83)
store i8 %84, i8* %15
br label %86
85: ; preds = %73
br label %102
86: ; preds = %82
br label %101
87: ; preds = %67
%88 = load i8, i8* %16
%89 = load i32*, i32** %5
%90 = call i32 @putc(i8 signext %88, i32* %89)
%91 = load i32, i32* %10
%92 = add nsw i32 %91, 1
store i32 %92, i32* %10
%93 = load i32, i32* %10
%94 = load i32, i32* %11
%95 = icmp slt i32 %93, %94
br i1 %95, label %96, label %99
96: ; preds = %87
%97 = load i32*, i32** %7
%98 = call signext i8 @getc(i32* %97)
store i8 %98, i8* %16
br label %100
99: ; preds = %87
br label %102
100: ; preds = %96
br label %101
101: ; preds = %100, %86
br label %67
102: ; preds = %99, %85
%103 = load i32, i32* %9
%104 = load i32, i32* %11
%105 = icmp slt i32 %103, %104
br i1 %105, label %106, label %112
106: ; preds = %102
%107 = load i8, i8* %15
%108 = load i32*, i32** %5
%109 = call i32 @putc(i8 signext %107, i32* %108)
%110 = load i32, i32* %9
%111 = add nsw i32 %110, 1
store i32 %111, i32* %9
br label %112
112: ; preds = %106, %102
%113 = load i32, i32* %10
%114 = load i32, i32* %11
%115 = icmp slt i32 %113, %114
br i1 %115, label %116, label %122
116: ; preds = %112
%117 = load i8, i8* %16
%118 = load i32*, i32** %5
%119 = call i32 @putc(i8 signext %117, i32* %118)
%120 = load i32, i32* %10
%121 = add nsw i32 %120, 1
store i32 %121, i32* %10
br label %122
122: ; preds = %116, %112
br label %123
123: ; preds = %127, %122
%124 = load i32, i32* %9
%125 = load i32, i32* %11
%126 = icmp slt i32 %124, %125
br i1 %126, label %127, label %135
127: ; preds = %123
%128 = load i32*, i32** %6
%129 = call signext i8 @getc(i32* %128)
store i8 %129, i8* %14
%130 = load i8, i8* %14
%131 = load i32*, i32** %5
%132 = call i32 @putc(i8 signext %130, i32* %131)
%133 = load i32, i32* %9
%134 = add nsw i32 %133, 1
store i32 %134, i32* %9
br label %123
135: ; preds = %123
br label %136
136: ; preds = %140, %135
%137 = load i32, i32* %10
%138 = load i32, i32* %11
%139 = icmp slt i32 %137, %138
br i1 %139, label %140, label %148
140: ; preds = %136
%141 = load i32*, i32** %7
%142 = call signext i8 @getc(i32* %141)
store i8 %142, i8* %14
%143 = load i8, i8* %14
%144 = load i32*, i32** %5
%145 = call i32 @putc(i8 signext %143, i32* %144)
%146 = load i32, i32* %10
%147 = add nsw i32 %146, 1
store i32 %147, i32* %10
br label %136
148: ; preds = %136
br label %149
149: ; preds = %148
%150 = load i32, i32* %11
%151 = load i32, i32* %13
%152 = add nsw i32 %151, %150
store i32 %152, i32* %13
br label %57
153: ; preds = %57
%154 = load i32*, i32** %5
%155 = call i32 @rewind(i32* %154)
%156 = load i32*, i32** %6
%157 = call i32 @rewind(i32* %156)
%158 = load i32*, i32** %7
%159 = call i32 @rewind(i32* %158)
br label %160
160: ; preds = %153
%161 = load i32, i32* %11
%162 = mul nsw i32 %161, 2
store i32 %162, i32* %11
br label %17
163: ; preds = %17
ret void
}

LLVM IR (-O2):
define void @merge_sort(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32 %3) {
%5 = icmp sgt i32 %3, 1
br i1 %5, label %6, label %92
6: ; preds = %4
%7 = lshr i32 %3, 1
%8 = icmp slt i32 %7, %3
br label %9
9: ; preds = %86, %6
%10 = phi i32 [ 1, %6 ], [ %90, %86 ]
br label %12
11: ; preds = %12
br i1 %8, label %18, label %24
12: ; preds = %9, %12
%13 = phi i32 [ %16, %12 ], [ 0, %9 ]
%14 = tail call signext i8 @getc(i32* %0)
%15 = tail call i32 @putc(i8 signext %14, i32* %1)
%16 = add nuw nsw i32 %13, 1
%17 = icmp eq i32 %16, %7
br i1 %17, label %11, label %12
18: ; preds = %11, %18
%19 = phi i32 [ %22, %18 ], [ %7, %11 ]
%20 = tail call signext i8 @getc(i32* %0)
%21 = tail call i32 @putc(i8 signext %20, i32* %2)
%22 = add i32 %19, 1
%23 = icmp eq i32 %22, %3
br i1 %23, label %24, label %18
24: ; preds = %18, %11
%25 = tail call i32 @rewind(i32* %0)
%26 = tail call i32 @rewind(i32* %1)
%27 = tail call i32 @rewind(i32* %2)
br label %28
28: ; preds = %24, %83
%29 = phi i32 [ %84, %83 ], [ 0, %24 ]
%30 = tail call signext i8 @getc(i32* %1)
%31 = tail call signext i8 @getc(i32* %2)
br label %32
32: ; preds = %45, %28
%33 = phi i32 [ %43, %45 ], [ 0, %28 ]
%34 = phi i32 [ %38, %45 ], [ 0, %28 ]
%35 = phi i8 [ %46, %45 ], [ %30, %28 ]
%36 = phi i8 [ %39, %45 ], [ %31, %28 ]
br label %37
37: ; preds = %32, %51
%38 = phi i32 [ %49, %51 ], [ %34, %32 ]
%39 = phi i8 [ %52, %51 ], [ %36, %32 ]
%40 = icmp slt i8 %35, %39
br i1 %40, label %41, label %47
41: ; preds = %37
%42 = tail call i32 @putc(i8 signext %35, i32* %0)
%43 = add nuw nsw i32 %33, 1
%44 = icmp slt i32 %43, %10
br i1 %44, label %45, label %53
45: ; preds = %41
%46 = tail call signext i8 @getc(i32* %1)
br label %32
47: ; preds = %37
%48 = tail call i32 @putc(i8 signext %39, i32* %0)
%49 = add nsw i32 %38, 1
%50 = icmp slt i32 %49, %10
br i1 %50, label %51, label %53
51: ; preds = %47
%52 = tail call signext i8 @getc(i32* %2)
br label %37
53: ; preds = %41, %47
%54 = phi i32 [ %33, %47 ], [ %43, %41 ]
%55 = phi i32 [ %49, %47 ], [ %38, %41 ]
%56 = icmp slt i32 %54, %10
br i1 %56, label %57, label %60
57: ; preds = %53
%58 = tail call i32 @putc(i8 signext %35, i32* %0)
%59 = add nsw i32 %54, 1
br label %60
60: ; preds = %57, %53
%61 = phi i32 [ %59, %57 ], [ %54, %53 ]
%62 = icmp slt i32 %55, %10
br i1 %62, label %63, label %66
63: ; preds = %60
%64 = tail call i32 @putc(i8 signext %39, i32* %0)
%65 = add nsw i32 %55, 1
br label %66
66: ; preds = %63, %60
%67 = phi i32 [ %65, %63 ], [ %55, %60 ]
%68 = icmp slt i32 %61, %10
br i1 %68, label %71, label %69
69: ; preds = %71, %66
%70 = icmp slt i32 %67, %10
br i1 %70, label %77, label %83
71: ; preds = %66, %71
%72 = phi i32 [ %75, %71 ], [ %61, %66 ]
%73 = tail call signext i8 @getc(i32* %1)
%74 = tail call i32 @putc(i8 signext %73, i32* %0)
%75 = add i32 %72, 1
%76 = icmp eq i32 %75, %10
br i1 %76, label %69, label %71
77: ; preds = %69, %77
%78 = phi i32 [ %81, %77 ], [ %67, %69 ]
%79 = tail call signext i8 @getc(i32* %2)
%80 = tail call i32 @putc(i8 signext %79, i32* %0)
%81 = add i32 %78, 1
%82 = icmp eq i32 %81, %10
br i1 %82, label %83, label %77
83: ; preds = %77, %69
%84 = add nsw i32 %29, %10
%85 = icmp slt i32 %84, %7
br i1 %85, label %28, label %86
86: ; preds = %83
%87 = tail call i32 @rewind(i32* %0)
%88 = tail call i32 @rewind(i32* %1)
%89 = tail call i32 @rewind(i32* %2)
%90 = shl nsw i32 %10, 1
%91 = icmp slt i32 %90, %3
br i1 %91, label %9, label %92
92: ; preds = %86, %4
ret void
}