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

/* Variables and functions */
int /*<<< orphan*/ cleanUp(int /*<<< orphan*/ *);
int /*<<< orphan*/ createLists(char *);
int /*<<< orphan*/ preprocess(int, char **);
int /*<<< orphan*/ printInput(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ *radixSort(char *);
int main(int argc, char **argv) {
  if (!preprocess(argc, argv) || !createLists(argv[1])) {
    return 1;
  }
  uint32_t *indexList = radixSort(argv[1]);
  printInput(argv[1], indexList);
  cleanUp(indexList);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <preprocess@plt>
cmp    $0x0,%eax
je     1191 <main+0x41>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <createLists@plt>
cmp    $0x0,%eax
jne    119d <main+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    11cf <main+0x7f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <radixSort@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <printInput@plt>
mov    -0x18(%rbp),%rdi
call   1070 <cleanUp@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1050 <preprocess@plt>
mov    $0x1,%ebp
test   %eax,%eax
je     1193 <main+0x43>
mov    0x8(%rbx),%rdi
call   1060 <createLists@plt>
test   %eax,%eax
je     1193 <main+0x43>
mov    0x8(%rbx),%rdi
call   1030 <radixSort@plt>
mov    %rax,%rbp
mov    0x8(%rbx),%rdi
mov    %rax,%rsi
call   1040 <printInput@plt>
mov    %rbp,%rdi
call   1070 <cleanUp@plt>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @preprocess(i32 %7, i8** %8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @createLists(i8* %14)
%16 = icmp ne i32 %15, 0
br i1 %16, label %18, label %17
17: ; preds = %11, %2
store i32 1, i32* %3
br label %30
18: ; preds = %11
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32* @radixSort(i8* %21)
store i32* %22, i32** %6
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = load i32*, i32** %6
%27 = call i32 @printInput(i8* %25, i32* %26)
%28 = load i32*, i32** %6
%29 = call i32 @cleanUp(i32* %28)
store i32 0, i32* %3
br label %30
30: ; preds = %18, %17
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @preprocess(i32 %0, i8** %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @createLists(i8* %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %16, label %10
10: ; preds = %5
%11 = load i8*, i8** %6
%12 = tail call i32* @radixSort(i8* %11)
%13 = load i8*, i8** %6
%14 = tail call i32 @printInput(i8* %13, i32* %12)
%15 = tail call i32 @cleanUp(i32* %12)
br label %16
16: ; preds = %2, %5, %10
%17 = phi i32 [ 0, %10 ], [ 1, %5 ], [ 1, %2 ]
ret i32 %17
}