#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 atoi(char *);
int /*<<< orphan*/ bubbleSort(int *, int);
int /*<<< orphan*/ heapSort(int *, int);
int /*<<< orphan*/ insertionSort(int *, int);
scalar_t__ isdigit(char);
int /*<<< orphan*/ mergeSort(int *, int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printerr(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ quickSort(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ selectionSort(int *, int);
int /*<<< orphan*/ shellSort(int *, int);
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  int a[32], temp[32], i, j = 0, n;
  char *option = "";
  if (argc == 1 || argc > 33) {
    printerr(argv[0]);
  }
  for (i = 1; i < argc; i++) {
    if (isdigit(argv[i][0])) {
      a[j++] = atoi(argv[i]);
      ++n;
    } else {
      option = argv[i];
    }
  }
  for (i = 0; i < n; i++) {
    printf("%d ", a[i]);
  }
  printf("\n");
  if (strcmp(option, "-b") == 0)
    bubbleSort(a, n);
  else if (strcmp(option, "-i") == 0)
    insertionSort(a, n);
  else if (strcmp(option, "-s") == 0)
    selectionSort(a, n);
  else if (strcmp(option, "-q") == 0)
    quickSort(a, 0, n - 1);
  else if (strcmp(option, "-m") == 0)
    mergeSort(a, temp, 0, n - 1);
  else if (strcmp(option, "-h") == 0)
    heapSort(a, n);
  else if (strcmp(option, "-sh") == 0)
    shellSort(a, n);
  else if (option == "")
    bubbleSort(a, n);
  else
    printerr(argv[0]);
  for (i = 0; i < n; i++) {
    printf("%d ", a[i]);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x118(%rbp)
lea    0xe1b(%rip),%rax
mov    %rax,-0x128(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     1205 <main+0x45>
cmpl   $0x21,-0x8(%rbp)
jle    1211 <main+0x51>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1090 <printerr@plt>
movl   $0x1,-0x114(%rbp)
mov    -0x114(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12be <main+0xfe>
mov    -0x10(%rbp),%rax
movslq -0x114(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%rax
je     128f <main+0xcf>
mov    -0x10(%rbp),%rax
movslq -0x114(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   10e0 <atoi@plt>
mov    %eax,%ecx
mov    -0x118(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x118(%rbp)
cltq
mov    %ecx,-0x90(%rbp,%rax,4)
mov    -0x11c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x11c(%rbp)
jmp    12a5 <main+0xe5>
mov    -0x10(%rbp),%rax
movslq -0x114(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x128(%rbp)
jmp    12aa <main+0xea>
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    121b <main+0x5b>
movl   $0x0,-0x114(%rbp)
mov    -0x114(%rbp),%eax
cmp    -0x11c(%rbp),%eax
jge    130a <main+0x14a>
movslq -0x114(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%esi
lea    0xd11(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    12c8 <main+0x108>
lea    0xcf3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x128(%rbp),%rdi
lea    0xce0(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    134c <main+0x18c>
lea    -0x90(%rbp),%rdi
mov    -0x11c(%rbp),%esi
call   1080 <bubbleSort@plt>
jmp    14ef <main+0x32f>
mov    -0x128(%rbp),%rdi
lea    0xcaf(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1380 <main+0x1c0>
lea    -0x90(%rbp),%rdi
mov    -0x11c(%rbp),%esi
call   10c0 <insertionSort@plt>
jmp    14ea <main+0x32a>
mov    -0x128(%rbp),%rdi
lea    0xc7e(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    13b4 <main+0x1f4>
lea    -0x90(%rbp),%rdi
mov    -0x11c(%rbp),%esi
call   1070 <selectionSort@plt>
jmp    14e5 <main+0x325>
mov    -0x128(%rbp),%rdi
lea    0xc4d(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    13ed <main+0x22d>
lea    -0x90(%rbp),%rdi
mov    -0x11c(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   10d0 <quickSort@plt>
jmp    14e0 <main+0x320>
mov    -0x128(%rbp),%rdi
lea    0xc17(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    142d <main+0x26d>
lea    -0x90(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    -0x11c(%rbp),%ecx
sub    $0x1,%ecx
xor    %edx,%edx
call   10b0 <mergeSort@plt>
jmp    14db <main+0x31b>
mov    -0x128(%rbp),%rdi
lea    0xbda(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1461 <main+0x2a1>
lea    -0x90(%rbp),%rdi
mov    -0x11c(%rbp),%esi
call   1050 <heapSort@plt>
jmp    14d6 <main+0x316>
mov    -0x128(%rbp),%rdi
lea    0xba9(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1495 <main+0x2d5>
lea    -0x90(%rbp),%rdi
mov    -0x11c(%rbp),%esi
call   1030 <shellSort@plt>
jmp    14d1 <main+0x311>
lea    0xb69(%rip),%rax
cmp    %rax,-0x128(%rbp)
jne    14c0 <main+0x300>
lea    -0x90(%rbp),%rdi
mov    -0x11c(%rbp),%esi
call   1080 <bubbleSort@plt>
jmp    14cc <main+0x30c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1090 <printerr@plt>
jmp    14d1 <main+0x311>
jmp    14d6 <main+0x316>
jmp    14db <main+0x31b>
jmp    14e0 <main+0x320>
jmp    14e5 <main+0x325>
jmp    14ea <main+0x32a>
jmp    14ef <main+0x32f>
movl   $0x0,-0x114(%rbp)
mov    -0x114(%rbp),%eax
cmp    -0x11c(%rbp),%eax
jge    153b <main+0x37b>
movslq -0x114(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%esi
lea    0xae0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    14f9 <main+0x339>
lea    0xac2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
mov    %rsi,%r13
mov    %edi,%ebp
cmp    $0x1,%edi
je     11f0 <main+0x20>
cmp    $0x22,%ebp
jl     11f9 <main+0x29>
mov    0x0(%r13),%rdi
call   10a0 <printerr@plt>
xor    %r12d,%r12d
cmp    $0x2,%ebp
jl     1259 <main+0x89>
mov    %ebp,%ebp
lea    0xdf9(%rip),%r15
mov    $0x1,%ebx
jmp    123d <main+0x6d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
call   10f0 <atoi@plt>
movslq %r12d,%rcx
add    $0x1,%r12d
mov    %eax,0x10(%rsp,%rcx,4)
add    $0x1,%r14d
add    $0x1,%rbx
cmp    %rbx,%rbp
je     1262 <main+0x92>
mov    0x0(%r13,%rbx,8),%rax
movsbl (%rax),%edi
call   1050 <isdigit@plt>
mov    0x0(%r13,%rbx,8),%rdi
test   %rax,%rax
jne    1220 <main+0x50>
mov    %rdi,%r15
jmp    1234 <main+0x64>
lea    0xda3(%rip),%r15
jmp    12a2 <main+0xd2>
test   %r14d,%r14d
setg   %r12b
jle    129f <main+0xcf>
mov    %r15,0x8(%rsp)
mov    %r14d,%ebx
lea    0xd86(%rip),%rbp
xor    %r15d,%r15d
nopl   (%rax)
mov    0x10(%rsp,%r15,4),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
add    $0x1,%r15
cmp    %r15,%rbx
jne    1280 <main+0xb0>
mov    0x8(%rsp),%r15
jmp    12a2 <main+0xd2>
xor    %r12d,%r12d
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd51(%rip),%rsi
mov    %r15,%rdi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     1377 <main+0x1a7>
lea    0xd3c(%rip),%rsi
mov    %r15,%rdi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     1392 <main+0x1c2>
lea    0xd27(%rip),%rsi
mov    %r15,%rdi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     13a9 <main+0x1d9>
lea    0xd12(%rip),%rsi
mov    %r15,%rdi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     13c0 <main+0x1f0>
lea    0xcfd(%rip),%rsi
mov    %r15,%rdi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     13d7 <main+0x207>
lea    0xce8(%rip),%rsi
mov    %r15,%rdi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     13f6 <main+0x226>
lea    0xcd3(%rip),%rsi
mov    %r15,%rdi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     140a <main+0x23a>
lea    0xca8(%rip),%rax
cmp    %rax,%r15
je     1377 <main+0x1a7>
mov    0x0(%r13),%rdi
call   10a0 <printerr@plt>
test   %r12b,%r12b
jne    141c <main+0x24c>
jmp    1447 <main+0x277>
lea    0x10(%rsp),%rdi
mov    %r14d,%esi
call   1090 <bubbleSort@plt>
test   %r12b,%r12b
jne    141c <main+0x24c>
jmp    1447 <main+0x277>
lea    0x10(%rsp),%rdi
mov    %r14d,%esi
call   10d0 <insertionSort@plt>
test   %r12b,%r12b
jne    141c <main+0x24c>
jmp    1447 <main+0x277>
lea    0x10(%rsp),%rdi
mov    %r14d,%esi
call   1080 <selectionSort@plt>
test   %r12b,%r12b
jne    141c <main+0x24c>
jmp    1447 <main+0x277>
lea    -0x1(%r14),%edx
lea    0x10(%rsp),%rdi
xor    %esi,%esi
call   10e0 <quickSort@plt>
test   %r12b,%r12b
jne    141c <main+0x24c>
jmp    1447 <main+0x277>
lea    -0x1(%r14),%ecx
lea    0x10(%rsp),%rdi
lea    0x90(%rsp),%rsi
xor    %edx,%edx
call   10c0 <mergeSort@plt>
test   %r12b,%r12b
jne    141c <main+0x24c>
jmp    1447 <main+0x277>
lea    0x10(%rsp),%rdi
mov    %r14d,%esi
call   1060 <heapSort@plt>
test   %r12b,%r12b
jne    141c <main+0x24c>
jmp    1447 <main+0x277>
lea    0x10(%rsp),%rdi
mov    %r14d,%esi
call   1040 <shellSort@plt>
test   %r12b,%r12b
je     1447 <main+0x277>
mov    %r14d,%ebp
lea    0xbda(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    0x10(%rsp,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1430 <main+0x260>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [3 x i8] c"-b\00"
@.str.4 = [3 x i8] c"-i\00"
@.str.5 = [3 x i8] c"-s\00"
@.str.6 = [3 x i8] c"-q\00"
@.str.7 = [3 x i8] c"-m\00"
@.str.8 = [3 x i8] c"-h\00"
@.str.9 = [4 x i8] c"-sh\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [32 x i32]
%7 = alloca [32 x i32]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %9
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %11
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 1
br i1 %13, label %17, label %14
14: ; preds = %2
%15 = load i32, i32* %4
%16 = icmp sgt i32 %15, 33
br i1 %16, label %17, label %22
17: ; preds = %14, %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 0
%20 = load i8*, i8** %19
%21 = call i32 @printerr(i8* %20)
br label %22
22: ; preds = %17, %14
store i32 1, i32* %8
br label %23
23: ; preds = %57, %22
%24 = load i32, i32* %8
%25 = load i32, i32* %4
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %60
27: ; preds = %23
%28 = load i8**, i8*** %5
%29 = load i32, i32* %8
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8*, i8** %28, i64 %30
%32 = load i8*, i8** %31
%33 = getelementptr inbounds i8, i8* %32, i64 0
%34 = load i8, i8* %33
%35 = call i64 @isdigit(i8 signext %34)
%36 = icmp ne i64 %35, 0
br i1 %36, label %37, label %50
37: ; preds = %27
%38 = load i8**, i8*** %5
%39 = load i32, i32* %8
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8*, i8** %38, i64 %40
%42 = load i8*, i8** %41
%43 = call i32 @atoi(i8* %42)
%44 = load i32, i32* %9
%45 = add nsw i32 %44, 1
store i32 %45, i32* %9
%46 = sext i32 %44 to i64
%47 = getelementptr inbounds [32 x i32], [32 x i32]* %6, i64 0, i64 %46
store i32 %43, i32* %47
%48 = load i32, i32* %10
%49 = add nsw i32 %48, 1
store i32 %49, i32* %10
br label %56
50: ; preds = %27
%51 = load i8**, i8*** %5
%52 = load i32, i32* %8
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i8*, i8** %51, i64 %53
%55 = load i8*, i8** %54
store i8* %55, i8** %11
br label %56
56: ; preds = %50, %37
br label %57
57: ; preds = %56
%58 = load i32, i32* %8
%59 = add nsw i32 %58, 1
store i32 %59, i32* %8
br label %23
60: ; preds = %23
store i32 0, i32* %8
br label %61
61: ; preds = %71, %60
%62 = load i32, i32* %8
%63 = load i32, i32* %10
%64 = icmp slt i32 %62, %63
br i1 %64, label %65, label %74
65: ; preds = %61
%66 = load i32, i32* %8
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [32 x i32], [32 x i32]* %6, i64 0, i64 %67
%69 = load i32, i32* %68
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %69)
br label %71
71: ; preds = %65
%72 = load i32, i32* %8
%73 = add nsw i32 %72, 1
store i32 %73, i32* %8
br label %61
74: ; preds = %61
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%76 = load i8*, i8** %11
%77 = call i64 @strcmp(i8* %76, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%78 = icmp eq i64 %77, 0
br i1 %78, label %79, label %83
79: ; preds = %74
%80 = getelementptr inbounds [32 x i32], [32 x i32]* %6, i64 0, i64 0
%81 = load i32, i32* %10
%82 = call i32 @bubbleSort(i32* %80, i32 %81)
br label %153
83: ; preds = %74
%84 = load i8*, i8** %11
%85 = call i64 @strcmp(i8* %84, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%86 = icmp eq i64 %85, 0
br i1 %86, label %87, label %91
87: ; preds = %83
%88 = getelementptr inbounds [32 x i32], [32 x i32]* %6, i64 0, i64 0
%89 = load i32, i32* %10
%90 = call i32 @insertionSort(i32* %88, i32 %89)
br label %152
91: ; preds = %83
%92 = load i8*, i8** %11
%93 = call i64 @strcmp(i8* %92, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%94 = icmp eq i64 %93, 0
br i1 %94, label %95, label %99
95: ; preds = %91
%96 = getelementptr inbounds [32 x i32], [32 x i32]* %6, i64 0, i64 0
%97 = load i32, i32* %10
%98 = call i32 @selectionSort(i32* %96, i32 %97)
br label %151
99: ; preds = %91
%100 = load i8*, i8** %11
%101 = call i64 @strcmp(i8* %100, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%102 = icmp eq i64 %101, 0
br i1 %102, label %103, label %108
103: ; preds = %99
%104 = getelementptr inbounds [32 x i32], [32 x i32]* %6, i64 0, i64 0
%105 = load i32, i32* %10
%106 = sub nsw i32 %105, 1
%107 = call i32 @quickSort(i32* %104, i32 0, i32 %106)
br label %150
108: ; preds = %99
%109 = load i8*, i8** %11
%110 = call i64 @strcmp(i8* %109, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%111 = icmp eq i64 %110, 0
br i1 %111, label %112, label %118
112: ; preds = %108
%113 = getelementptr inbounds [32 x i32], [32 x i32]* %6, i64 0, i64 0
%114 = getelementptr inbounds [32 x i32], [32 x i32]* %7, i64 0, i64 0
%115 = load i32, i32* %10
%116 = sub nsw i32 %115, 1
%117 = call i32 @mergeSort(i32* %113, i32* %114, i32 0, i32 %116)
br label %149
118: ; preds = %108
%119 = load i8*, i8** %11
%120 = call i64 @strcmp(i8* %119, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%121 = icmp eq i64 %120, 0
br i1 %121, label %122, label %126
122: ; preds = %118
%123 = getelementptr inbounds [32 x i32], [32 x i32]* %6, i64 0, i64 0
%124 = load i32, i32* %10
%125 = call i32 @heapSort(i32* %123, i32 %124)
br label %148
126: ; preds = %118
%127 = load i8*, i8** %11
%128 = call i64 @strcmp(i8* %127, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%129 = icmp eq i64 %128, 0
br i1 %129, label %130, label %134
130: ; preds = %126
%131 = getelementptr inbounds [32 x i32], [32 x i32]* %6, i64 0, i64 0
%132 = load i32, i32* %10
%133 = call i32 @shellSort(i32* %131, i32 %132)
br label %147
134: ; preds = %126
%135 = load i8*, i8** %11
%136 = icmp eq i8* %135, getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
br i1 %136, label %137, label %141
137: ; preds = %134
%138 = getelementptr inbounds [32 x i32], [32 x i32]* %6, i64 0, i64 0
%139 = load i32, i32* %10
%140 = call i32 @bubbleSort(i32* %138, i32 %139)
br label %146
141: ; preds = %134
%142 = load i8**, i8*** %5
%143 = getelementptr inbounds i8*, i8** %142, i64 0
%144 = load i8*, i8** %143
%145 = call i32 @printerr(i8* %144)
br label %146
146: ; preds = %141, %137
br label %147
147: ; preds = %146, %130
br label %148
148: ; preds = %147, %122
br label %149
149: ; preds = %148, %112
br label %150
150: ; preds = %149, %103
br label %151
151: ; preds = %150, %95
br label %152
152: ; preds = %151, %87
br label %153
153: ; preds = %152, %79
store i32 0, i32* %8
br label %154
154: ; preds = %164, %153
%155 = load i32, i32* %8
%156 = load i32, i32* %10
%157 = icmp slt i32 %155, %156
br i1 %157, label %158, label %167
158: ; preds = %154
%159 = load i32, i32* %8
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds [32 x i32], [32 x i32]* %6, i64 0, i64 %160
%162 = load i32, i32* %161
%163 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %162)
br label %164
164: ; preds = %158
%165 = load i32, i32* %8
%166 = add nsw i32 %165, 1
store i32 %166, i32* %8
br label %154
167: ; preds = %154
%168 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [4 x i8] c"%d \00"
@.str.3 = [3 x i8] c"-b\00"
@.str.4 = [3 x i8] c"-i\00"
@.str.5 = [3 x i8] c"-s\00"
@.str.6 = [3 x i8] c"-q\00"
@.str.7 = [3 x i8] c"-m\00"
@.str.8 = [3 x i8] c"-h\00"
@.str.9 = [4 x i8] c"-sh\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [32 x i32]
%4 = alloca [32 x i32]
%5 = bitcast [32 x i32]* %3 to i8*
%6 = bitcast [32 x i32]* %4 to i8*
%7 = icmp eq i32 %0, 1
%8 = icmp sgt i32 %0, 33
%9 = or i1 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8*, i8** %1
%12 = tail call i32 @printerr(i8* %11)
br label %13
13: ; preds = %2, %10
%14 = icmp sgt i32 %0, 1
br i1 %14, label %15, label %51
15: ; preds = %13
%16 = zext i32 %0 to i64
br label %21
17: ; preds = %38
%18 = icmp sgt i32 %40, 0
br i1 %18, label %19, label %51
19: ; preds = %17
%20 = zext i32 %40 to i64
br label %44
21: ; preds = %15, %38
%22 = phi i64 [ 1, %15 ], [ %42, %38 ]
%23 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %15 ], [ %41, %38 ]
%24 = phi i32 [ undef, %15 ], [ %40, %38 ]
%25 = phi i32 [ 0, %15 ], [ %39, %38 ]
%26 = getelementptr inbounds i8*, i8** %1, i64 %22
%27 = load i8*, i8** %26
%28 = load i8, i8* %27
%29 = tail call i64 @isdigit(i8 signext %28)
%30 = icmp eq i64 %29, 0
%31 = load i8*, i8** %26
br i1 %30, label %38, label %32
32: ; preds = %21
%33 = tail call i32 @atoi(i8* %31)
%34 = add nsw i32 %25, 1
%35 = sext i32 %25 to i64
%36 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 %35
store i32 %33, i32* %36
%37 = add nsw i32 %24, 1
br label %38
38: ; preds = %21, %32
%39 = phi i32 [ %34, %32 ], [ %25, %21 ]
%40 = phi i32 [ %37, %32 ], [ %24, %21 ]
%41 = phi i8* [ %23, %32 ], [ %31, %21 ]
%42 = add nuw nsw i64 %22, 1
%43 = icmp eq i64 %42, %16
br i1 %43, label %17, label %21
44: ; preds = %19, %44
%45 = phi i64 [ 0, %19 ], [ %49, %44 ]
%46 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 %45
%47 = load i32, i32* %46
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %47)
%49 = add nuw nsw i64 %45, 1
%50 = icmp eq i64 %49, %20
br i1 %50, label %51, label %44
51: ; preds = %44, %13, %17
%52 = phi i1 [ false, %17 ], [ false, %13 ], [ %18, %44 ]
%53 = phi i8* [ %41, %17 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %13 ], [ %41, %44 ]
%54 = phi i32 [ %40, %17 ], [ undef, %13 ], [ %40, %44 ]
%55 = tail call i32 @putchar(i32 10)
%56 = tail call i64 @strcmp(i8* %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%57 = icmp eq i64 %56, 0
br i1 %57, label %58, label %61
58: ; preds = %51
%59 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 0
%60 = call i32 @bubbleSort(i32* %59, i32 %54)
br label %108
61: ; preds = %51
%62 = tail call i64 @strcmp(i8* %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%63 = icmp eq i64 %62, 0
br i1 %63, label %64, label %67
64: ; preds = %61
%65 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 0
%66 = call i32 @insertionSort(i32* %65, i32 %54)
br label %108
67: ; preds = %61
%68 = tail call i64 @strcmp(i8* %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%69 = icmp eq i64 %68, 0
br i1 %69, label %70, label %73
70: ; preds = %67
%71 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 0
%72 = call i32 @selectionSort(i32* %71, i32 %54)
br label %108
73: ; preds = %67
%74 = tail call i64 @strcmp(i8* %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%75 = icmp eq i64 %74, 0
br i1 %75, label %76, label %80
76: ; preds = %73
%77 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 0
%78 = add nsw i32 %54, -1
%79 = call i32 @quickSort(i32* %77, i32 0, i32 %78)
br label %108
80: ; preds = %73
%81 = tail call i64 @strcmp(i8* %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%82 = icmp eq i64 %81, 0
br i1 %82, label %83, label %88
83: ; preds = %80
%84 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 0
%85 = getelementptr inbounds [32 x i32], [32 x i32]* %4, i64 0, i64 0
%86 = add nsw i32 %54, -1
%87 = call i32 @mergeSort(i32* %84, i32* %85, i32 0, i32 %86)
br label %108
88: ; preds = %80
%89 = tail call i64 @strcmp(i8* %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%90 = icmp eq i64 %89, 0
br i1 %90, label %91, label %94
91: ; preds = %88
%92 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 0
%93 = call i32 @heapSort(i32* %92, i32 %54)
br label %108
94: ; preds = %88
%95 = tail call i64 @strcmp(i8* %53, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%96 = icmp eq i64 %95, 0
br i1 %96, label %97, label %100
97: ; preds = %94
%98 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 0
%99 = call i32 @shellSort(i32* %98, i32 %54)
br label %108
100: ; preds = %94
%101 = icmp eq i8* %53, getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
br i1 %101, label %102, label %105
102: ; preds = %100
%103 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 0
%104 = call i32 @bubbleSort(i32* %103, i32 %54)
br label %108
105: ; preds = %100
%106 = load i8*, i8** %1
%107 = tail call i32 @printerr(i8* %106)
br label %108
108: ; preds = %64, %76, %91, %102, %105, %97, %83, %70, %58
br i1 %52, label %109, label %118
109: ; preds = %108
%110 = zext i32 %54 to i64
br label %111
111: ; preds = %109, %111
%112 = phi i64 [ 0, %109 ], [ %116, %111 ]
%113 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 %112
%114 = load i32, i32* %113
%115 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %114)
%116 = add nuw nsw i64 %112, 1
%117 = icmp eq i64 %116, %110
br i1 %117, label %118, label %111
118: ; preds = %111, %108
%119 = call i32 @putchar(i32 10)
ret i32 0
}