#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 EXIT_SUCCESS;
int /*<<< orphan*/ freeStrArr(int, char **);
int /*<<< orphan*/ getArr(int, char **);
int /*<<< orphan*/ getInt(int, int *);
int /*<<< orphan*/ mergeSort(int, char **);
int /*<<< orphan*/ prnArr(int, char **);
char **strArrAlloc(int, int);
int main(int argc, char **argv) {
  int num;
  char **arr;
  getInt(1, &num);
  arr = strArrAlloc(num, 101);
  getArr(num, arr);
  mergeSort(num, arr);
  prnArr(num, arr);
  freeStrArr(num, arr);
  return EXIT_SUCCESS;
}


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    $0x1,%edi
lea    -0x14(%rbp),%rsi
call   1080 <getInt@plt>
mov    -0x14(%rbp),%edi
mov    $0x65,%esi
call   1060 <strArrAlloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1040 <getArr@plt>
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1050 <mergeSort@plt>
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1070 <prnArr@plt>
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1030 <freeStrArr@plt>
mov    0x2e14(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rsi
mov    $0x1,%edi
call   1080 <getInt@plt>
mov    0xc(%rsp),%edi
mov    $0x65,%esi
call   1060 <strArrAlloc@plt>
mov    %rax,%rbx
mov    0xc(%rsp),%edi
mov    %rax,%rsi
call   1040 <getArr@plt>
mov    0xc(%rsp),%edi
mov    %rbx,%rsi
call   1050 <mergeSort@plt>
mov    0xc(%rsp),%edi
mov    %rbx,%rsi
call   1070 <prnArr@plt>
mov    0xc(%rsp),%edi
mov    %rbx,%rsi
call   1030 <freeStrArr@plt>
mov    0x2e24(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @getInt(i32 1, i32* %6)
%9 = load i32, i32* %6
%10 = call i8** @strArrAlloc(i32 %9, i32 101)
store i8** %10, i8*** %7
%11 = load i32, i32* %6
%12 = load i8**, i8*** %7
%13 = call i32 @getArr(i32 %11, i8** %12)
%14 = load i32, i32* %6
%15 = load i8**, i8*** %7
%16 = call i32 @mergeSort(i32 %14, i8** %15)
%17 = load i32, i32* %6
%18 = load i8**, i8*** %7
%19 = call i32 @prnArr(i32 %17, i8** %18)
%20 = load i32, i32* %6
%21 = load i8**, i8*** %7
%22 = call i32 @freeStrArr(i32 %20, i8** %21)
%23 = load i32, i32* @EXIT_SUCCESS
ret i32 %23
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @getInt(i32 1, i32* %3)
%6 = load i32, i32* %3
%7 = call i8** @strArrAlloc(i32 %6, i32 101)
%8 = load i32, i32* %3
%9 = call i32 @getArr(i32 %8, i8** %7)
%10 = load i32, i32* %3
%11 = call i32 @mergeSort(i32 %10, i8** %7)
%12 = load i32, i32* %3
%13 = call i32 @prnArr(i32 %12, i8** %7)
%14 = load i32, i32* %3
%15 = call i32 @freeStrArr(i32 %14, i8** %7)
%16 = load i32, i32* @EXIT_SUCCESS
ret i32 %16
}