#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 */
struct stat {
  size_t st_size;
};
typedef size_t off_t;
typedef scalar_t__ clock_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
double CLOCKS_PER_SEC;
int /*<<< orphan*/ EXIT_FAILURE;
scalar_t__ clock();
scalar_t__ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ external_merge_sort(int /*<<< orphan*/ *, size_t, char *, size_t);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
char *mkdtemp(char *);
int /*<<< orphan*/ perror(char *);
scalar_t__ stat(char const *, struct stat *);
int /*<<< orphan*/ stderr;
size_t strtol(char const *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int main(int argc, const char *argv[]) {
  FILE *f;
  char *dirpath;
  size_t bufsize;
  char dirname[] = "sort.XXXXXX";
  struct stat sb;
  off_t file_size;
  clock_t start, end;
  if (argc != 3) {
    fprintf(stderr, "Usage: %s <file to sort> <buffer size>\n", argv[0]);
    exit(EXIT_FAILURE);
  }
  errno = 0;
  bufsize = strtol(argv[2], NULL, 0);
  if (errno) {
    perror("strtol");
    exit(EXIT_FAILURE);
  }
  if (stat(argv[1], &sb)) {
    perror("stat");
    exit(EXIT_FAILURE);
  }
  file_size = sb.st_size;
  if (file_size % bufsize) {
    fprintf(stderr, "Buffer size %zu is not divisor of file size %zu ", bufsize,
            file_size);
    fprintf(stderr, "but this is required.\n");
    fprintf(stderr, "You may, for example, choose buffer size %zu\n",
            file_size / 10);
    exit(EXIT_FAILURE);
  }
  f = fopen(argv[1], "rb");
  if (f == NULL) {
    perror("fopen");
    exit(EXIT_FAILURE);
  }
  dirpath = mkdtemp(dirname);
  if (dirpath == NULL) {
    perror("mkdtemp");
    goto err;
  }
  start = clock();
  if (external_merge_sort(f, file_size, dirpath, bufsize)) {
    fprintf(stderr, "Failed to sort %s\n", argv[1]);
    goto err;
  }
  end = clock();
  fprintf(stderr, "%ld bytes sorted in %f seconds\n", file_size,
          (double)(end - start) / CLOCKS_PER_SEC);
err:
  fclose(f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xe43(%rip),%rax
mov    %rax,-0x34(%rbp)
mov    0xe41(%rip),%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1200 <main+0x60>
mov    0x2dfd(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe21(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2dcf(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    0x2dc9(%rip),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1070 <strtol@plt>
mov    %rax,-0x28(%rbp)
mov    0x2da4(%rip),%rax
cmpq   $0x0,(%rax)
je     1250 <main+0xb0>
lea    0xdf7(%rip),%rdi
call   10a0 <perror@plt>
mov    0x2d7f(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x40(%rbp),%rsi
call   1060 <stat@plt>
cmp    $0x0,%rax
je     1285 <main+0xe5>
lea    0xdc9(%rip),%rdi
call   10a0 <perror@plt>
mov    0x2d4a(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x28(%rbp)
cmp    $0x0,%rdx
je     130f <main+0x16f>
mov    0x2d2e(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rdx
mov    -0x48(%rbp),%rcx
lea    0xd85(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2d0f(%rip),%rax
mov    (%rax),%edi
lea    0xd9f(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2cf8(%rip),%rax
mov    (%rax),%edi
mov    -0x48(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rdx
lea    0xd8e(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2cc0(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd98(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    134c <main+0x1ac>
lea    0xd80(%rip),%rdi
call   10a0 <perror@plt>
mov    0x2c83(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
lea    -0x34(%rbp),%rdi
call   1080 <mkdtemp@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1375 <main+0x1d5>
lea    0xd54(%rip),%rdi
call   10a0 <perror@plt>
jmp    1401 <main+0x261>
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x50(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   10b0 <external_merge_sort@plt>
cmp    $0x0,%rax
je     13c3 <main+0x223>
mov    0x2c32(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xd10(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    1401 <main+0x261>
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x58(%rbp)
mov    0x2c03(%rip),%rax
mov    (%rax),%edi
mov    -0x48(%rbp),%rdx
mov    -0x58(%rbp),%rax
sub    -0x50(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    0x2bf9(%rip),%rax
divsd  (%rax),%xmm0
lea    0xce0(%rip),%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r15
movabs $0x5858582e74726f73,%rax
58 58 58
mov    %rax,0x8(%rsp)
movl   $0x585858,0x10(%rsp)
cmp    $0x3,%edi
jne    1351 <main+0x1b1>
mov    0x2df8(%rip),%rbx
movq   $0x0,(%rbx)
mov    0x10(%r15),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <strtol@plt>
cmpq   $0x0,(%rbx)
jne    136d <main+0x1cd>
mov    %rax,%r12
mov    0x8(%r15),%rdi
mov    %rsp,%rsi
call   1060 <stat@plt>
test   %rax,%rax
jne    1376 <main+0x1d6>
mov    (%rsp),%r14
mov    %r12,%rax
or     %r14,%rax
shr    $0x20,%rax
je     129d <main+0xfd>
mov    %r14,%rax
xor    %edx,%edx
div    %r12
test   %rdx,%rdx
jne    12aa <main+0x10a>
mov    0x8(%r15),%rdi
lea    0xe80(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     137f <main+0x1df>
mov    %rax,%rbx
lea    0x8(%rsp),%rdi
call   1080 <mkdtemp@plt>
test   %rax,%rax
je     1343 <main+0x1a3>
mov    %rax,%rbp
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%r13
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
mov    %r12,%rcx
call   10b0 <external_merge_sort@plt>
test   %rax,%rax
je     12f6 <main+0x156>
mov    0x2d54(%rip),%rax
mov    (%rax),%edi
mov    0x8(%r15),%rdx
lea    0xe36(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    132a <main+0x18a>
mov    %r14d,%eax
xor    %edx,%edx
div    %r12d
test   %rdx,%rdx
je     122b <main+0x8b>
mov    0x2d27(%rip),%rbx
mov    (%rbx),%edi
lea    0xd86(%rip),%rsi
mov    %r12,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%rbx),%edi
lea    0xda1(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%rbx),%edi
movabs $0xcccccccccccccccd,%rcx
cc cc cc
mov    %r14,%rax
mul    %rcx
shr    $0x3,%rdx
lea    0xd94(%rip),%rsi
jmp    1364 <main+0x1c4>
xor    %eax,%eax
call   1030 <clock@plt>
mov    0x2cd4(%rip),%rcx
sub    %r13,%rax
cvtsi2sd %rax,%xmm0
mov    (%rcx),%edi
mov    0x2cd3(%rip),%rax
divsd  (%rax),%xmm0
lea    0xdba(%rip),%rsi
mov    %r14,%rdx
mov    $0x1,%al
call   1050 <fprintf@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd75(%rip),%rdi
call   10a0 <perror@plt>
jmp    132a <main+0x18a>
mov    0x2c80(%rip),%rax
mov    (%rax),%edi
mov    (%r15),%rdx
lea    0xca8(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    138b <main+0x1eb>
lea    0xcc0(%rip),%rdi
jmp    1386 <main+0x1e6>
lea    0xcbe(%rip),%rdi
jmp    1386 <main+0x1e6>
lea    0xd33(%rip),%rdi
call   10a0 <perror@plt>
mov    0x2c36(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i64 }
@__const.main.dirname = [12 x i8] c"sort.XXXXXX\00"
@stderr = global i32 0
@.str = [40 x i8] c"Usage: %s <file to sort> <buffer size>\0A\00"
@EXIT_FAILURE = global i32 0
@errno = global i64 0
@.str.1 = [7 x i8] c"strtol\00"
@.str.2 = [5 x i8] c"stat\00"
@.str.3 = [49 x i8] c"Buffer size %zu is not divisor of file size %zu \00"
@.str.4 = [23 x i8] c"but this is required.\0A\00"
@.str.5 = [46 x i8] c"You may, for example, choose buffer size %zu\0A\00"
@.str.6 = [3 x i8] c"rb\00"
@.str.7 = [6 x i8] c"fopen\00"
@.str.8 = [8 x i8] c"mkdtemp\00"
@.str.9 = [19 x i8] c"Failed to sort %s\0A\00"
@.str.10 = [32 x i8] c"%ld bytes sorted in %f seconds\0A\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca [12 x i8]
%10 = alloca %struct.stat
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = bitcast [12 x i8]* %9 to i8*
%15 = load i32, i32* %4
%16 = icmp ne i32 %15, 3
br i1 %16, label %17, label %25
17: ; preds = %2
%18 = load i32, i32* @stderr
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 0
%21 = load i8*, i8** %20
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %21)
%23 = load i32, i32* @EXIT_FAILURE
%24 = call i32 @exit(i32 %23)
unreachable
25: ; preds = %2
store i64 0, i64* @errno
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 2
%28 = load i8*, i8** %27
%29 = call i64 @strtol(i8* %28, i32* null, i32 0)
store i64 %29, i64* %8
%30 = load i64, i64* @errno
%31 = icmp ne i64 %30, 0
br i1 %31, label %32, label %36
32: ; preds = %25
%33 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%34 = load i32, i32* @EXIT_FAILURE
%35 = call i32 @exit(i32 %34)
unreachable
36: ; preds = %25
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 1
%39 = load i8*, i8** %38
%40 = call i64 @stat(i8* %39, %struct.stat* %10)
%41 = icmp ne i64 %40, 0
br i1 %41, label %42, label %46
42: ; preds = %36
%43 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%44 = load i32, i32* @EXIT_FAILURE
%45 = call i32 @exit(i32 %44)
unreachable
46: ; preds = %36
%47 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 0
%48 = load i64, i64* %47
store i64 %48, i64* %11
%49 = load i64, i64* %11
%50 = load i64, i64* %8
%51 = urem i64 %49, %50
%52 = icmp ne i64 %51, 0
br i1 %52, label %53, label %66
53: ; preds = %46
%54 = load i32, i32* @stderr
%55 = load i64, i64* %8
%56 = load i64, i64* %11
%57 = call i32 (i32, i8*, ...) @fprintf(i32 %54, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0), i64 %55, i64 %56)
%58 = load i32, i32* @stderr
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
%60 = load i32, i32* @stderr
%61 = load i64, i64* %11
%62 = udiv i64 %61, 10
%63 = call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0), i64 %62)
%64 = load i32, i32* @EXIT_FAILURE
%65 = call i32 @exit(i32 %64)
unreachable
66: ; preds = %46
%67 = load i8**, i8*** %5
%68 = getelementptr inbounds i8*, i8** %67, i64 1
%69 = load i8*, i8** %68
%70 = call i32* @fopen(i8* %69, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
store i32* %70, i32** %6
%71 = load i32*, i32** %6
%72 = icmp eq i32* %71, null
br i1 %72, label %73, label %77
73: ; preds = %66
%74 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%75 = load i32, i32* @EXIT_FAILURE
%76 = call i32 @exit(i32 %75)
unreachable
77: ; preds = %66
%78 = getelementptr inbounds [12 x i8], [12 x i8]* %9, i64 0, i64 0
%79 = call i8* @mkdtemp(i8* %78)
store i8* %79, i8** %7
%80 = load i8*, i8** %7
%81 = icmp eq i8* %80, null
br i1 %81, label %82, label %84
82: ; preds = %77
%83 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
br label %109
84: ; preds = %77
%85 = call i64 (...) @clock()
store i64 %85, i64* %12
%86 = load i32*, i32** %6
%87 = load i64, i64* %11
%88 = load i8*, i8** %7
%89 = load i64, i64* %8
%90 = call i64 @external_merge_sort(i32* %86, i64 %87, i8* %88, i64 %89)
%91 = icmp ne i64 %90, 0
br i1 %91, label %92, label %98
92: ; preds = %84
%93 = load i32, i32* @stderr
%94 = load i8**, i8*** %5
%95 = getelementptr inbounds i8*, i8** %94, i64 1
%96 = load i8*, i8** %95
%97 = call i32 (i32, i8*, ...) @fprintf(i32 %93, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i8* %96)
br label %109
98: ; preds = %84
%99 = call i64 (...) @clock()
store i64 %99, i64* %13
%100 = load i32, i32* @stderr
%101 = load i64, i64* %11
%102 = load i64, i64* %13
%103 = load i64, i64* %12
%104 = sub nsw i64 %102, %103
%105 = sitofp i64 %104 to double
%106 = load double, double* @CLOCKS_PER_SEC
%107 = fdiv double %105, %106
%108 = call i32 (i32, i8*, ...) @fprintf(i32 %100, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0), i64 %101, double %107)
br label %109
109: ; preds = %98, %92, %82
%110 = load i32*, i32** %6
%111 = call i32 @fclose(i32* %110)
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { i64 }
@__const.main.dirname = [12 x i8] c"sort.XXXXXX\00"
@stderr = global i32 0
@.str = [40 x i8] c"Usage: %s <file to sort> <buffer size>\0A\00"
@EXIT_FAILURE = global i32 0
@errno = global i64 0
@.str.1 = [7 x i8] c"strtol\00"
@.str.2 = [5 x i8] c"stat\00"
@.str.3 = [49 x i8] c"Buffer size %zu is not divisor of file size %zu \00"
@.str.4 = [23 x i8] c"but this is required.\0A\00"
@.str.5 = [46 x i8] c"You may, for example, choose buffer size %zu\0A\00"
@.str.6 = [3 x i8] c"rb\00"
@.str.7 = [6 x i8] c"fopen\00"
@.str.8 = [8 x i8] c"mkdtemp\00"
@.str.9 = [19 x i8] c"Failed to sort %s\0A\00"
@.str.10 = [32 x i8] c"%ld bytes sorted in %f seconds\0A\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [12 x i8]
%4 = alloca %struct.stat
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%6 = bitcast %struct.stat* %4 to i8*
%7 = icmp eq i32 %0, 3
br i1 %7, label %14, label %8
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %1
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i32, i32* @EXIT_FAILURE
%13 = tail call i32 @exit(i32 %12)
unreachable
14: ; preds = %2
store i64 0, i64* @errno
%15 = getelementptr inbounds i8*, i8** %1, i64 2
%16 = load i8*, i8** %15
%17 = tail call i64 @strtol(i8* nocapture %16, i32* null, i32 0)
%18 = load i64, i64* @errno
%19 = icmp eq i64 %18, 0
br i1 %19, label %24, label %20
20: ; preds = %14
%21 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%22 = load i32, i32* @EXIT_FAILURE
%23 = tail call i32 @exit(i32 %22)
unreachable
24: ; preds = %14
%25 = getelementptr inbounds i8*, i8** %1, i64 1
%26 = load i8*, i8** %25
%27 = call i64 @stat(i8* %26, %struct.stat* %4)
%28 = icmp eq i64 %27, 0
br i1 %28, label %33, label %29
29: ; preds = %24
%30 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%31 = load i32, i32* @EXIT_FAILURE
%32 = call i32 @exit(i32 %31)
unreachable
33: ; preds = %24
%34 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 0
%35 = load i64, i64* %34
%36 = urem i64 %35, %17
%37 = icmp eq i64 %36, 0
br i1 %37, label %48, label %38
38: ; preds = %33
%39 = load i32, i32* @stderr
%40 = call i32 (i32, i8*, ...) @fprintf(i32 %39, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0), i64 %17, i64 %35)
%41 = load i32, i32* @stderr
%42 = call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
%43 = load i32, i32* @stderr
%44 = udiv i64 %35, 10
%45 = call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0), i64 %44)
%46 = load i32, i32* @EXIT_FAILURE
%47 = call i32 @exit(i32 %46)
unreachable
48: ; preds = %33
%49 = load i8*, i8** %25
%50 = call i32* @fopen(i8* %49, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%51 = icmp eq i32* %50, null
br i1 %51, label %52, label %56
52: ; preds = %48
%53 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%54 = load i32, i32* @EXIT_FAILURE
%55 = call i32 @exit(i32 %54)
unreachable
56: ; preds = %48
%57 = call i8* @mkdtemp(i8* %5)
%58 = icmp eq i8* %57, null
br i1 %58, label %59, label %61
59: ; preds = %56
%60 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
br label %77
61: ; preds = %56
%62 = call i64 (...) @clock()
%63 = call i64 @external_merge_sort(i32* %50, i64 %35, i8* %57, i64 %17)
%64 = icmp eq i64 %63, 0
br i1 %64, label %69, label %65
65: ; preds = %61
%66 = load i32, i32* @stderr
%67 = load i8*, i8** %25
%68 = call i32 (i32, i8*, ...) @fprintf(i32 %66, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i8* %67)
br label %77
69: ; preds = %61
%70 = call i64 (...) @clock()
%71 = load i32, i32* @stderr
%72 = sub nsw i64 %70, %62
%73 = sitofp i64 %72 to double
%74 = load double, double* @CLOCKS_PER_SEC
%75 = fdiv double %73, %74
%76 = call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0), i64 %35, double %75)
br label %77
77: ; preds = %69, %65, %59
%78 = call i32 @fclose(i32* %50)
ret i32 0
}