#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*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ radix_sort(int *, int, int);
int main(int argc, char *argv[]) {
  int i;
  int bit_number;
  if (argc < 0)
    exit(1);
  while (argc == 1)
    ;
  for (i = 0; i < argc; i++)
    printf("%s\n", argv[i]);
  bit_number = atoi(argv[1]);
  printf("bit_number:%d\n", bit_number);
  int num[10] = {12, 16, 13, 20, 32, 43, 50, 33, 45, 27};
  int num2[7] = {329, 457, 657, 839, 436, 720, 355};
  radix_sort(num, 10, bit_number);
  for (i = 0; i < 10; i++)
    printf("%d ", num[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    117a <main+0x2a>
mov    $0x1,%edi
call   1070 <exit@plt>
jmp    117f <main+0x2f>
cmpl   $0x1,-0x8(%rbp)
jne    118e <main+0x3e>
jmp    117f <main+0x2f>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11c9 <main+0x79>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe4c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1195 <main+0x45>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe21(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
lea    0xe2b(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
mov    0xe4a(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe47(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xe44(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe42(%rip),%eax
mov    %eax,-0x48(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%edx
mov    $0xa,%esi
call   1040 <radix_sort@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    126f <main+0x11f>
movslq -0x14(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%esi
lea    0xdb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1241 <main+0xf1>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
test   %edi,%edi
js     127d <main+0x12d>
mov    %rsi,%r14
je     1192 <main+0x42>
cmp    $0x1,%edi
jne    1172 <main+0x22>
nopl   0x0(%rax,%rax,1)
jmp    1170 <main+0x20>
mov    %edi,%r15d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <puts@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1180 <main+0x30>
mov    0x8(%r14),%rdi
call   1060 <atoi@plt>
mov    %eax,%ebx
lea    0xe5c(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xe8c(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xe70(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe54(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
mov    %ebx,%edx
call   1050 <radix_sort@plt>
mov    (%rsp),%esi
lea    0xe26(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [15 x i8] c"bit_number:%d\0A\00"
@__const.main.num = [10 x i32] [i32 12, i32 16, i32 13, i32 20, i32 32, i32 43, i32 50, i32 33, i32 45, i32 27]
@__const.main.num2 = [7 x i32] [i32 329, i32 457, i32 657, i32 839, i32 436, i32 720, i32 355]
@.str.2 = [4 x i8] c"%d \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca [10 x i32]
%9 = alloca [7 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
br label %15
15: ; preds = %18, %14
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %19
18: ; preds = %15
br label %15
19: ; preds = %15
store i32 0, i32* %6
br label %20
20: ; preds = %31, %19
%21 = load i32, i32* %6
%22 = load i32, i32* %4
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %34
24: ; preds = %20
%25 = load i8**, i8*** %5
%26 = load i32, i32* %6
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8*, i8** %25, i64 %27
%29 = load i8*, i8** %28
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %29)
br label %31
31: ; preds = %24
%32 = load i32, i32* %6
%33 = add nsw i32 %32, 1
store i32 %33, i32* %6
br label %20
34: ; preds = %20
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 1
%37 = load i8*, i8** %36
%38 = call i32 @atoi(i8* %37)
store i32 %38, i32* %7
%39 = load i32, i32* %7
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %39)
%41 = bitcast [10 x i32]* %8 to i8*
%42 = bitcast [7 x i32]* %9 to i8*
%43 = getelementptr inbounds [10 x i32], [10 x i32]* %8, i64 0, i64 0
%44 = load i32, i32* %7
%45 = call i32 @radix_sort(i32* %43, i32 10, i32 %44)
store i32 0, i32* %6
br label %46
46: ; preds = %55, %34
%47 = load i32, i32* %6
%48 = icmp slt i32 %47, 10
br i1 %48, label %49, label %58
49: ; preds = %46
%50 = load i32, i32* %6
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [10 x i32], [10 x i32]* %8, i64 0, i64 %51
%53 = load i32, i32* %52
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %53)
br label %55
55: ; preds = %49
%56 = load i32, i32* %6
%57 = add nsw i32 %56, 1
store i32 %57, i32* %6
br label %46
58: ; preds = %46
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [15 x i8] c"bit_number:%d\0A\00"
@__const.main.num = [10 x i32] [i32 12, i32 16, i32 13, i32 20, i32 32, i32 43, i32 50, i32 33, i32 45, i32 27]
@.str.2 = [4 x i8] c"%d \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [10 x i32]
%4 = icmp slt i32 %0, 0
br i1 %4, label %6, label %5
5: ; preds = %2
switch i32 %0, label %9 [
i32 1, label %8
i32 0, label %18
]
6: ; preds = %2
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %5, %8
br label %8
9: ; preds = %5
%10 = zext i32 %0 to i64
br label %11
11: ; preds = %9, %11
%12 = phi i64 [ 0, %9 ], [ %16, %11 ]
%13 = getelementptr inbounds i8*, i8** %1, i64 %12
%14 = load i8*, i8** %13
%15 = tail call i32 @puts(i8* dereferenceable(1) %14)
%16 = add nuw nsw i64 %12, 1
%17 = icmp eq i64 %16, %10
br i1 %17, label %18, label %11
18: ; preds = %11, %5
%19 = getelementptr inbounds i8*, i8** %1, i64 1
%20 = load i8*, i8** %19
%21 = tail call i32 @atoi(i8* %20)
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %21)
%23 = bitcast [10 x i32]* %3 to i8*
%24 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%25 = call i32 @radix_sort(i32* %24, i32 10, i32 %21)
%26 = load i32, i32* %24
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %26)
%28 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 1
%29 = load i32, i32* %28
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %29)
%31 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 2
%32 = load i32, i32* %31
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %32)
%34 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 3
%35 = load i32, i32* %34
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %35)
%37 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 4
%38 = load i32, i32* %37
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %38)
%40 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 5
%41 = load i32, i32* %40
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %41)
%43 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 6
%44 = load i32, i32* %43
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %44)
%46 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 7
%47 = load i32, i32* %46
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %47)
%49 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 8
%50 = load i32, i32* %49
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %50)
%52 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 9
%53 = load i32, i32* %52
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %53)
ret i32 0
}