#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 */

/* Variables and functions */
int /*<<< orphan*/ nway_merge(char **, int, int);
int main(void) {
  char *files[] = {
      "bucket-0",  "bucket-1",  "bucket-2",  "bucket-3",  "bucket-4",
      "bucket-5",  "bucket-6",  "bucket-7",  "bucket-8",  "bucket-9",
      "bucket-10", "bucket-11", "bucket-12", "bucket-13", "bucket-14",
      "bucket-15", "bucket-16", "bucket-17", "bucket-18", "bucket-19",
      "bucket-20", "bucket-21", "bucket-22", "bucket-23", "bucket-24",
  };
  nway_merge(files, 25, 4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rdi
lea    0x2c10(%rip),%rsi
mov    $0xc8,%edx
call   1030 <memcpy@plt>
lea    -0xd0(%rbp),%rdi
mov    $0x19,%esi
mov    $0x4,%edx
call   1040 <nway_merge@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
lea    0x2c21(%rip),%rsi
mov    %rsp,%rbx
mov    $0xc8,%edx
mov    %rbx,%rdi
call   1030 <memcpy@plt>
mov    %rbx,%rdi
mov    $0x19,%esi
mov    $0x4,%edx
call   1040 <nway_merge@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"bucket-0\00"
@.str.1 = [9 x i8] c"bucket-1\00"
@.str.2 = [9 x i8] c"bucket-2\00"
@.str.3 = [9 x i8] c"bucket-3\00"
@.str.4 = [9 x i8] c"bucket-4\00"
@.str.5 = [9 x i8] c"bucket-5\00"
@.str.6 = [9 x i8] c"bucket-6\00"
@.str.7 = [9 x i8] c"bucket-7\00"
@.str.8 = [9 x i8] c"bucket-8\00"
@.str.9 = [9 x i8] c"bucket-9\00"
@.str.10 = [10 x i8] c"bucket-10\00"
@.str.11 = [10 x i8] c"bucket-11\00"
@.str.12 = [10 x i8] c"bucket-12\00"
@.str.13 = [10 x i8] c"bucket-13\00"
@.str.14 = [10 x i8] c"bucket-14\00"
@.str.15 = [10 x i8] c"bucket-15\00"
@.str.16 = [10 x i8] c"bucket-16\00"
@.str.17 = [10 x i8] c"bucket-17\00"
@.str.18 = [10 x i8] c"bucket-18\00"
@.str.19 = [10 x i8] c"bucket-19\00"
@.str.20 = [10 x i8] c"bucket-20\00"
@.str.21 = [10 x i8] c"bucket-21\00"
@.str.22 = [10 x i8] c"bucket-22\00"
@.str.23 = [10 x i8] c"bucket-23\00"
@.str.24 = [10 x i8] c"bucket-24\00"
@__const.main.files = [25 x i8*] [i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.24, i32 0, i32 0)]
define i32 @main() {
%1 = alloca i32
%2 = alloca [25 x i8*]
store i32 0, i32* %1
%3 = bitcast [25 x i8*]* %2 to i8*
%4 = getelementptr inbounds [25 x i8*], [25 x i8*]* %2, i64 0, i64 0
%5 = call i32 @nway_merge(i8** %4, i32 25, i32 4)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"bucket-0\00"
@.str.1 = [9 x i8] c"bucket-1\00"
@.str.2 = [9 x i8] c"bucket-2\00"
@.str.3 = [9 x i8] c"bucket-3\00"
@.str.4 = [9 x i8] c"bucket-4\00"
@.str.5 = [9 x i8] c"bucket-5\00"
@.str.6 = [9 x i8] c"bucket-6\00"
@.str.7 = [9 x i8] c"bucket-7\00"
@.str.8 = [9 x i8] c"bucket-8\00"
@.str.9 = [9 x i8] c"bucket-9\00"
@.str.10 = [10 x i8] c"bucket-10\00"
@.str.11 = [10 x i8] c"bucket-11\00"
@.str.12 = [10 x i8] c"bucket-12\00"
@.str.13 = [10 x i8] c"bucket-13\00"
@.str.14 = [10 x i8] c"bucket-14\00"
@.str.15 = [10 x i8] c"bucket-15\00"
@.str.16 = [10 x i8] c"bucket-16\00"
@.str.17 = [10 x i8] c"bucket-17\00"
@.str.18 = [10 x i8] c"bucket-18\00"
@.str.19 = [10 x i8] c"bucket-19\00"
@.str.20 = [10 x i8] c"bucket-20\00"
@.str.21 = [10 x i8] c"bucket-21\00"
@.str.22 = [10 x i8] c"bucket-22\00"
@.str.23 = [10 x i8] c"bucket-23\00"
@.str.24 = [10 x i8] c"bucket-24\00"
@__const.main.files = [25 x i8*] [i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.24, i32 0, i32 0)]
define i32 @main() {
%1 = alloca [25 x i8*]
%2 = bitcast [25 x i8*]* %1 to i8*
%3 = getelementptr inbounds [25 x i8*], [25 x i8*]* %1, i64 0, i64 0
%4 = call i32 @nway_merge(i8** %3, i32 25, i32 4)
ret i32 0
}