#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*/ countSort(int *, int, int);
int /*<<< orphan*/ qSort(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ refillArray(int *, int);
int /*<<< orphan*/ shellSort(int *, int);
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  int arr1[10];
  if (strcmp(argv[1], "ss") == 0) {
    refillArray(arr1, 10);
    shellSort(arr1, 10);
  }
  if (strcmp(argv[1], "qs") == 0) {
    refillArray(arr1, 10);
    qSort(arr1, 0, 9);
  }
  if (strcmp(argv[1], "cs") == 0) {
    refillArray(arr1, 10);
    countSort(arr1, 10, 11);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe8b(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    11a0 <main+0x50>
lea    -0x40(%rbp),%rdi
mov    $0xa,%esi
call   1060 <refillArray@plt>
lea    -0x40(%rbp),%rdi
mov    $0xa,%esi
call   1040 <shellSort@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe54(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    11dc <main+0x8c>
lea    -0x40(%rbp),%rdi
mov    $0xa,%esi
call   1060 <refillArray@plt>
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x9,%edx
call   1050 <qSort@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe1b(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    121b <main+0xcb>
lea    -0x40(%rbp),%rdi
mov    $0xa,%esi
call   1060 <refillArray@plt>
lea    -0x40(%rbp),%rdi
mov    $0xa,%esi
mov    $0xb,%edx
call   1030 <countSort@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xe9b(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    118c <main+0x3c>
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0xa,%esi
call   1060 <refillArray@plt>
mov    %r14,%rdi
mov    $0xa,%esi
call   1040 <shellSort@plt>
mov    0x8(%rbx),%rdi
lea    0xe6c(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    11c0 <main+0x70>
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0xa,%esi
call   1060 <refillArray@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x9,%edx
call   1050 <qSort@plt>
mov    0x8(%rbx),%rdi
lea    0xe3b(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    11f7 <main+0xa7>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1060 <refillArray@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0xb,%edx
call   1030 <countSort@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"ss\00"
@.str.1 = [3 x i8] c"qs\00"
@.str.2 = [3 x i8] c"cs\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 0
%14 = call i32 @refillArray(i32* %13, i32 10)
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 0
%16 = call i32 @shellSort(i32* %15, i32 10)
br label %17
17: ; preds = %12, %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %28
23: ; preds = %17
%24 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 0
%25 = call i32 @refillArray(i32* %24, i32 10)
%26 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 0
%27 = call i32 @qSort(i32* %26, i32 0, i32 9)
br label %28
28: ; preds = %23, %17
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 1
%31 = load i8*, i8** %30
%32 = call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %39
34: ; preds = %28
%35 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 0
%36 = call i32 @refillArray(i32* %35, i32 10)
%37 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 0
%38 = call i32 @countSort(i32* %37, i32 10, i32 11)
br label %39
39: ; preds = %34, %28
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"ss\00"
@.str.1 = [3 x i8] c"qs\00"
@.str.2 = [3 x i8] c"cs\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [10 x i32]
%4 = bitcast [10 x i32]* %3 to i8*
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%11 = call i32 @refillArray(i32* %10, i32 10)
%12 = call i32 @shellSort(i32* %10, i32 10)
br label %13
13: ; preds = %9, %2
%14 = load i8*, i8** %5
%15 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %13
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%19 = call i32 @refillArray(i32* %18, i32 10)
%20 = call i32 @qSort(i32* %18, i32 0, i32 9)
br label %21
21: ; preds = %17, %13
%22 = load i8*, i8** %5
%23 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %29
25: ; preds = %21
%26 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%27 = call i32 @refillArray(i32* %26, i32 10)
%28 = call i32 @countSort(i32* %26, i32 10, i32 11)
br label %29
29: ; preds = %25, %21
ret i32 0
}