#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*/ printf(char *);
void printhelp(void) {
  printf(
      "Integer file sort test.\n"
      "Usage:\n"
      "  intfsort -t <heapsize> <filesize> <order>\n"
      "\n"
      "  intfsort --help\n"
      "  intfsort --version\n"
      "\n"
      "<heapsize> in [1:1000000] # records/heap\n"
      "<filesize> in [0:1000000] # records/file\n"
      "<order>    in [0:2]       # 0=random; 1=ascending; 2=descending\n"
      "\n"
      "This program creates a BINARY file of integers in random, ascending or\n"
      "descending order and sorts in ascending order.\n"
      "\n"
      "File sort method: balanced 2-way natural merge sort.\n"
      "Balanced: use an equal number of input and output files in each merge.\n"
      "Natural: exploit existing runs (ordered subsequences) within the file "
      "to be\n"
      "sorted.\n"
      "\n"
      "In general, the number of records in a file to be sorted is greater "
      "than\n"
      "the available main memory, and so the records cannot all be read into "
      "main\n"
      "memory and sorted there. Instead file sorting methods usually involve "
      "first\n"
      "distributing the records to a number of auxiliary files and then "
      "merging\n"
      "the records from these files to produce runs; this process continues "
      "with\n"
      "longer runs being formed until eventually a single run is formed. The "
      "more\n"
      "efficient methods usually take account of any existing order among the\n"
      "records of the file to be sorted.\n"
      "\n"
      "The number of disk drives critically affects the efficiency of the "
      "sort.\n"
      "The ideal situation is to have one auxiliary file associated with each "
      "disk\n"
      "drive.\n"
      "\n"
      "Each operation that treats the entire sequence of records constitutes "
      "a\n"
      "pass. A file sort is thus made up of a number of passes.\n"
      "\n"
      "This external sorting algorithm uses an internal sorting algorithm\n"
      "(heapsort) to increase the efficiency of the first pass, and hence of "
      "the\n"
      "file sorting process as a whole.\n"
      "\n"
      "Heapsort algorithm: If S records can be accomodated in main memory, "
      "then in\n"
      "general, these can be sorted to produce runs of length 2S for "
      "distribution\n"
      "in the first pass, assuming that the input file record keys are "
      "randomly\n"
      "distributed.\n");
}


x86 assembly (clang, -O0):
<printhelp>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printhelp>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [1843 x i8] c"Integer file sort test.\0AUsage:\0A intfsort -t <heapsize> <filesize> <order>\0A\0A intfsort --help\0A intfsort --version\0A\0A<heapsize> in [1:1000000] # records/heap\0A<filesize> in [0:1000000] # records/file\0A<order> in [0:2] # 0=random; 1=ascending; 2=descending\0A\0AThis program creates a BINARY file of integers in random, ascending or\0Adescending order and sorts in ascending order.\0A\0AFile sort method: balanced 2-way natural merge sort.\0ABalanced: use an equal number of input and output files in each merge.\0ANatural: exploit existing runs (ordered subsequences) within the file to be\0Asorted.\0A\0AIn general, the number of records in a file to be sorted is greater than\0Athe available main memory, and so the records cannot all be read into main\0Amemory and sorted there. Instead file sorting methods usually involve first\0Adistributing the records to a number of auxiliary files and then merging\0Athe records from these files to produce runs; this process continues with\0Alonger runs being formed until eventually a single run is formed. The more\0Aefficient methods usually take account of any existing order among the\0Arecords of the file to be sorted.\0A\0AThe number of disk drives critically affects the efficiency of the sort.\0AThe ideal situation is to have one auxiliary file associated with each disk\0Adrive.\0A\0AEach operation that treats the entire sequence of records constitutes a\0Apass. A file sort is thus made up of a number of passes.\0A\0AThis external sorting algorithm uses an internal sorting algorithm\0A(heapsort) to increase the efficiency of the first pass, and hence of the\0Afile sorting process as a whole.\0A\0AHeapsort algorithm: If S records can be accomodated in main memory, then in\0Ageneral, these can be sorted to produce runs of length 2S for distribution\0Ain the first pass, assuming that the input file record keys are randomly\0Adistributed.\0A\00"
define void @printhelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([1843 x i8], [1843 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [1842 x i8] c"Integer file sort test.\0AUsage:\0A intfsort -t <heapsize> <filesize> <order>\0A\0A intfsort --help\0A intfsort --version\0A\0A<heapsize> in [1:1000000] # records/heap\0A<filesize> in [0:1000000] # records/file\0A<order> in [0:2] # 0=random; 1=ascending; 2=descending\0A\0AThis program creates a BINARY file of integers in random, ascending or\0Adescending order and sorts in ascending order.\0A\0AFile sort method: balanced 2-way natural merge sort.\0ABalanced: use an equal number of input and output files in each merge.\0ANatural: exploit existing runs (ordered subsequences) within the file to be\0Asorted.\0A\0AIn general, the number of records in a file to be sorted is greater than\0Athe available main memory, and so the records cannot all be read into main\0Amemory and sorted there. Instead file sorting methods usually involve first\0Adistributing the records to a number of auxiliary files and then merging\0Athe records from these files to produce runs; this process continues with\0Alonger runs being formed until eventually a single run is formed. The more\0Aefficient methods usually take account of any existing order among the\0Arecords of the file to be sorted.\0A\0AThe number of disk drives critically affects the efficiency of the sort.\0AThe ideal situation is to have one auxiliary file associated with each disk\0Adrive.\0A\0AEach operation that treats the entire sequence of records constitutes a\0Apass. A file sort is thus made up of a number of passes.\0A\0AThis external sorting algorithm uses an internal sorting algorithm\0A(heapsort) to increase the efficiency of the first pass, and hence of the\0Afile sorting process as a whole.\0A\0AHeapsort algorithm: If S records can be accomodated in main memory, then in\0Ageneral, these can be sorted to produce runs of length 2S for distribution\0Ain the first pass, assuming that the input file record keys are randomly\0Adistributed.\00"
define void @printhelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([1842 x i8], [1842 x i8]* @str, i64 0, i64 0))
ret void
}