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

/* Variables and functions */
int /*<<< orphan*/ copy_content(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fread(int *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *freopen(int /*<<< orphan*/, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(int *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int /*<<< orphan*/ *tmpfile();
void fmerge(FILE *f, FILE **file_list, size_t buffer_size, int begin, int end) {
  int len = end - begin;
  FILE *f1 = 0;
  FILE *f2 = 0;
  FILE *f3 = 0;
  int a = 0;
  int read_a = 0;
  int b = 0;
  int read_b = 0;
  if (len < 1) {
    return;
  }
  if (len == 1) {
    f = freopen(0, "wb", f);
    copy_content(file_list[begin], f);
    fclose(file_list[begin]);
    return;
  }
  f1 = file_list[begin];
  f2 = file_list[begin + 1];
  f3 = tmpfile();
  read_a = (int)fread(&a, sizeof(a), 1, f1);
  read_b = (int)fread(&b, sizeof(b), 1, f2);
  while (1) {
    if (read_a && !read_b) {
      fwrite(&a, sizeof(a), 1, f3);
      read_a = (int)fread(&a, sizeof(a), 1, f1);
    } else if (read_b && !read_a) {
      fwrite(&b, sizeof(b), 1, f3);
      read_b = (int)fread(&b, sizeof(b), 1, f2);
    } else if (read_a && read_b) {
      if (a < b) {
        fwrite(&a, sizeof(a), 1, f3);
        read_a = (int)fread(&a, sizeof(a), 1, f1);
      } else {
        fwrite(&b, sizeof(b), 1, f3);
        read_b = (int)fread(&b, sizeof(b), 1, f2);
      }
    } else {
      break;
    }
  }
  fclose(f1);
  fclose(f2);
  f2 = tmpfile();
  rewind(f3);
  copy_content(f3, f2);
  fclose(f3);
  rewind(f2);
  file_list[begin + 1] = f2;
  fmerge(f, file_list, buffer_size, begin + 1, end);
}


x86 assembly (clang, -O0):
<fmerge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x20(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
movl   $0x0,-0x50(%rbp)
cmpl   $0x1,-0x24(%rbp)
jge    11e7 <fmerge+0x67>
jmp    143f <fmerge+0x2bf>
cmpl   $0x1,-0x24(%rbp)
jne    1232 <fmerge+0xb2>
mov    -0x8(%rbp),%rdx
xor    %edi,%edi
lea    0xe02(%rip),%rsi
call   1060 <freopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x8(%rbp),%rsi
call   1090 <copy_content@plt>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <fclose@plt>
jmp    143f <fmerge+0x2bf>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x38(%rbp)
mov    $0x0,%al
call   1070 <tmpfile@plt>
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rcx
lea    -0x44(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    %eax,-0x48(%rbp)
mov    -0x38(%rbp),%rcx
lea    -0x4c(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    %eax,-0x50(%rbp)
cmpl   $0x0,-0x48(%rbp)
je     12e0 <fmerge+0x160>
cmpl   $0x0,-0x50(%rbp)
jne    12e0 <fmerge+0x160>
mov    -0x40(%rbp),%rcx
lea    -0x44(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   10a0 <fwrite@plt>
mov    -0x30(%rbp),%rcx
lea    -0x44(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    %eax,-0x48(%rbp)
jmp    13c5 <fmerge+0x245>
cmpl   $0x0,-0x50(%rbp)
je     132a <fmerge+0x1aa>
cmpl   $0x0,-0x48(%rbp)
jne    132a <fmerge+0x1aa>
mov    -0x40(%rbp),%rcx
lea    -0x4c(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   10a0 <fwrite@plt>
mov    -0x38(%rbp),%rcx
lea    -0x4c(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    %eax,-0x50(%rbp)
jmp    13c0 <fmerge+0x240>
cmpl   $0x0,-0x48(%rbp)
je     13b6 <fmerge+0x236>
cmpl   $0x0,-0x50(%rbp)
je     13b6 <fmerge+0x236>
mov    -0x44(%rbp),%eax
cmp    -0x4c(%rbp),%eax
jge    1380 <fmerge+0x200>
mov    -0x40(%rbp),%rcx
lea    -0x44(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   10a0 <fwrite@plt>
mov    -0x30(%rbp),%rcx
lea    -0x44(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    %eax,-0x48(%rbp)
jmp    13b1 <fmerge+0x231>
mov    -0x40(%rbp),%rcx
lea    -0x4c(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   10a0 <fwrite@plt>
mov    -0x38(%rbp),%rcx
lea    -0x4c(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    %eax,-0x50(%rbp)
jmp    13bb <fmerge+0x23b>
jmp    13ca <fmerge+0x24a>
jmp    13c0 <fmerge+0x240>
jmp    13c5 <fmerge+0x245>
jmp    1296 <fmerge+0x116>
mov    -0x30(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x38(%rbp),%rdi
call   1040 <fclose@plt>
mov    $0x0,%al
call   1070 <tmpfile@plt>
mov    %rax,-0x38(%rbp)
mov    -0x40(%rbp),%rdi
call   1050 <rewind@plt>
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   1090 <copy_content@plt>
mov    -0x40(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x38(%rbp),%rdi
call   1050 <rewind@plt>
mov    -0x38(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
mov    -0x20(%rbp),%r8d
call   1080 <fmerge@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmerge>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %ecx,%ebp
mov    %r8d,%eax
movl   $0x0,(%rsp)
movl   $0x0,0x4(%rsp)
sub    %ecx,%eax
jle    11e8 <fmerge+0x68>
mov    %rsi,%rbx
mov    %rdi,%rcx
cmp    $0x1,%eax
jne    11f7 <fmerge+0x77>
lea    0xe48(%rip),%rsi
xor    %edi,%edi
mov    %rcx,%rdx
call   1060 <freopen@plt>
movslq %ebp,%rbp
mov    (%rbx,%rbp,8),%rdi
mov    %rax,%rsi
call   1090 <copy_content@plt>
mov    (%rbx,%rbp,8),%rdi
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fclose@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rdx,0x20(%rsp)
mov    %rcx,0x28(%rsp)
mov    %r8d,0x14(%rsp)
movslq %ebp,%rax
mov    (%rbx,%rax,8),%r14
mov    %rbx,0x30(%rsp)
mov    0x8(%rbx,%rax,8),%r15
add    $0x1,%rax
mov    %rax,0x18(%rsp)
xor    %eax,%eax
call   1070 <tmpfile@plt>
mov    %rax,%rbp
mov    %rsp,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r14,0x8(%rsp)
mov    %r14,%rcx
call   1030 <fread@plt>
mov    %rax,%r12
lea    0x4(%rsp),%r14
mov    %r14,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1030 <fread@plt>
mov    %rax,%r13
mov    (%rsp),%ebx
test   %r12d,%r12d
je     1275 <fmerge+0xf5>
nopl   0x0(%rax)
test   %r13d,%r13d
je     12e0 <fmerge+0x160>
test   %r13d,%r13d
je     1283 <fmerge+0x103>
test   %r12d,%r12d
je     1320 <fmerge+0x1a0>
test   %r12d,%r12d
je     1397 <fmerge+0x217>
test   %r13d,%r13d
je     1397 <fmerge+0x217>
cmp    0x4(%rsp),%ebx
jl     1360 <fmerge+0x1e0>
mov    %r14,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   10a0 <fwrite@plt>
mov    %r14,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1030 <fread@plt>
mov    %rax,%r13
test   %r12d,%r12d
jne    1270 <fmerge+0xf0>
jmp    1275 <fmerge+0xf5>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   10a0 <fwrite@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    0x8(%rsp),%rcx
call   1030 <fread@plt>
mov    %rax,%r12
xor    %r13d,%r13d
jmp    1264 <fmerge+0xe4>
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   10a0 <fwrite@plt>
mov    %r14,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1030 <fread@plt>
mov    %rax,%r13
xor    %r12d,%r12d
jmp    1264 <fmerge+0xe4>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   10a0 <fwrite@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    0x8(%rsp),%rcx
call   1030 <fread@plt>
mov    %rax,%r12
jmp    1264 <fmerge+0xe4>
mov    0x8(%rsp),%rdi
call   1040 <fclose@plt>
mov    %r15,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
call   1070 <tmpfile@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
call   1050 <rewind@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1090 <copy_content@plt>
mov    %rbp,%rdi
call   1040 <fclose@plt>
mov    %rbx,%rdi
call   1050 <rewind@plt>
mov    0x30(%rsp),%rsi
mov    0x18(%rsp),%rcx
mov    %rbx,(%rsi,%rcx,8)
mov    0x28(%rsp),%rdi
mov    0x20(%rsp),%rdx
mov    0x14(%rsp),%r8d
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1080 <fmerge@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"wb\00"
define void @fmerge(i32* %0, i32** nocapture %1, i64 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = sub nsw i32 %4, %3
%9 = bitcast i32* %6 to i8*
store i32 0, i32* %6
%10 = bitcast i32* %7 to i8*
store i32 0, i32* %7
%11 = icmp slt i32 %8, 1
br i1 %11, label %80, label %12
12: ; preds = %5
%13 = icmp eq i32 %8, 1
br i1 %13, label %14, label %22
14: ; preds = %12
%15 = tail call i32* @freopen(i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %0)
%16 = sext i32 %3 to i64
%17 = getelementptr inbounds i32*, i32** %1, i64 %16
%18 = load i32*, i32** %17
%19 = tail call i32 @copy_content(i32* %18, i32* %15)
%20 = load i32*, i32** %17
%21 = tail call i32 @fclose(i32* %20)
br label %80
22: ; preds = %12
%23 = sext i32 %3 to i64
%24 = getelementptr inbounds i32*, i32** %1, i64 %23
%25 = load i32*, i32** %24
%26 = add nsw i32 %3, 1
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32*, i32** %1, i64 %27
%29 = load i32*, i32** %28
%30 = tail call i32* (...) @tmpfile()
%31 = call i64 @fread(i32* %6, i32 4, i32 1, i32* %25)
%32 = trunc i64 %31 to i32
%33 = call i64 @fread(i32* %7, i32 4, i32 1, i32* %29)
%34 = trunc i64 %33 to i32
br label %35
35: ; preds = %65, %22
%36 = phi i32 [ %32, %22 ], [ %66, %65 ]
%37 = phi i32 [ %34, %22 ], [ %67, %65 ]
%38 = icmp eq i32 %36, 0
%39 = icmp ne i32 %36, 0
%40 = load i32, i32* %6
br label %41
41: ; preds = %35, %68
%42 = phi i32 [ %71, %68 ], [ %37, %35 ]
%43 = icmp ne i32 %42, 0
%44 = select i1 %38, i1 true, i1 %43
br i1 %44, label %49, label %45
45: ; preds = %41
%46 = call i32 @fwrite(i32* %6, i32 4, i32 1, i32* %30)
%47 = call i64 @fread(i32* %6, i32 4, i32 1, i32* %25)
%48 = trunc i64 %47 to i32
br label %65
49: ; preds = %41
%50 = icmp eq i32 %42, 0
%51 = or i1 %50, %39
br i1 %51, label %56, label %52
52: ; preds = %49
%53 = call i32 @fwrite(i32* %7, i32 4, i32 1, i32* %30)
%54 = call i64 @fread(i32* %7, i32 4, i32 1, i32* %29)
%55 = trunc i64 %54 to i32
br label %65
56: ; preds = %49
%57 = select i1 %39, i1 %43, i1 false
br i1 %57, label %58, label %72
58: ; preds = %56
%59 = load i32, i32* %7
%60 = icmp slt i32 %40, %59
br i1 %60, label %61, label %68
61: ; preds = %58
%62 = call i32 @fwrite(i32* %6, i32 4, i32 1, i32* %30)
%63 = call i64 @fread(i32* %6, i32 4, i32 1, i32* %25)
%64 = trunc i64 %63 to i32
br label %65
65: ; preds = %61, %52, %45
%66 = phi i32 [ %48, %45 ], [ 0, %52 ], [ %64, %61 ]
%67 = phi i32 [ 0, %45 ], [ %55, %52 ], [ %42, %61 ]
br label %35
68: ; preds = %58
%69 = call i32 @fwrite(i32* %7, i32 4, i32 1, i32* %30)
%70 = call i64 @fread(i32* %7, i32 4, i32 1, i32* %29)
%71 = trunc i64 %70 to i32
br label %41
72: ; preds = %56
%73 = tail call i32 @fclose(i32* %25)
%74 = tail call i32 @fclose(i32* %29)
%75 = tail call i32* (...) @tmpfile()
%76 = tail call i32 @rewind(i32* %30)
%77 = tail call i32 @copy_content(i32* %30, i32* %75)
%78 = tail call i32 @fclose(i32* %30)
%79 = tail call i32 @rewind(i32* %75)
store i32* %75, i32** %28
tail call void @fmerge(i32* %0, i32** %1, i64 %2, i32 %26, i32 %4)
br label %80
80: ; preds = %5, %72, %14
ret void
}