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

/* Variables and functions */
int /*<<< orphan*/ print(int *, int);
int /*<<< orphan*/ radixSort(int *, int);
int rand();
int main(int argc, char const *argv[]) {
  int vetor[10];
  int i, tam;
  for (i = 0; i < 10; i++) {
    vetor[i] = (rand() % 100) + 1;
  }
  tam = sizeof(vetor) / sizeof(vetor[0]);
  radixSort(vetor, tam);
  print(vetor, tam);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0xa,-0x44(%rbp)
jge    117f <main+0x4f>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
movslq -0x44(%rbp),%rax
mov    %edx,-0x40(%rbp,%rax,4)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    114d <main+0x1d>
movl   $0xa,-0x48(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%esi
call   1040 <radixSort@plt>
lea    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%esi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
xor    %eax,%eax
call   1050 <rand@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1050 <rand@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <rand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <rand@plt>
movd   %r14d,%xmm0
movd   %ebp,%xmm1
punpckldq %xmm1,%xmm0
movd   %ebx,%xmm1
movd   %eax,%xmm2
punpckldq %xmm2,%xmm1
punpcklqdq %xmm1,%xmm0
movdqa 0xe80(%rip),%xmm3
movdqa %xmm0,%xmm1
pmuludq %xmm3,%xmm1
pshufd $0xed,%xmm1,%xmm1
pshufd $0xf5,%xmm0,%xmm2
pmuludq %xmm3,%xmm2
pshufd $0xed,%xmm2,%xmm2
punpckldq %xmm2,%xmm1
pxor   %xmm2,%xmm2
pcmpgtd %xmm0,%xmm2
pand   %xmm3,%xmm2
psubd  %xmm2,%xmm1
movdqa %xmm1,%xmm2
psrld  $0x1f,%xmm2
psrad  $0x5,%xmm1
paddd  %xmm2,%xmm1
movdqa 0xe47(%rip),%xmm3
pshufd $0xf5,%xmm1,%xmm2
pmuludq %xmm3,%xmm1
pshufd $0xe8,%xmm1,%xmm1
pmuludq %xmm3,%xmm2
pshufd $0xe8,%xmm2,%xmm2
punpckldq %xmm2,%xmm1
psubd  %xmm1,%xmm0
pcmpeqd %xmm1,%xmm1
psubd  %xmm1,%xmm0
movdqa %xmm0,(%rsp)
xor    %eax,%eax
call   1050 <rand@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1050 <rand@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <rand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <rand@plt>
movd   %r14d,%xmm0
movd   %ebp,%xmm1
punpckldq %xmm1,%xmm0
movd   %ebx,%xmm1
movd   %eax,%xmm2
punpckldq %xmm2,%xmm1
punpcklqdq %xmm1,%xmm0
movdqa %xmm0,%xmm1
movdqa 0xdbf(%rip),%xmm3
pmuludq %xmm3,%xmm1
pshufd $0xed,%xmm1,%xmm1
pshufd $0xf5,%xmm0,%xmm2
pmuludq %xmm3,%xmm2
pshufd $0xed,%xmm2,%xmm2
punpckldq %xmm2,%xmm1
pxor   %xmm2,%xmm2
pcmpgtd %xmm0,%xmm2
pand   %xmm3,%xmm2
psubd  %xmm2,%xmm1
movdqa %xmm1,%xmm2
psrld  $0x1f,%xmm2
psrad  $0x5,%xmm1
paddd  %xmm2,%xmm1
pshufd $0xf5,%xmm1,%xmm2
movdqa 0xd85(%rip),%xmm3
pmuludq %xmm3,%xmm1
pshufd $0xe8,%xmm1,%xmm1
pmuludq %xmm3,%xmm2
pshufd $0xe8,%xmm2,%xmm2
punpckldq %xmm2,%xmm1
psubd  %xmm1,%xmm0
psubd  0xd73(%rip),%xmm0
movdqa %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,0x20(%rsp)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,0x24(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <radixSort@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x i32]
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
br label %9
9: ; preds = %19, %2
%10 = load i32, i32* %7
%11 = icmp slt i32 %10, 10
br i1 %11, label %12, label %22
12: ; preds = %9
%13 = call i32 (...) @rand()
%14 = srem i32 %13, 100
%15 = add nsw i32 %14, 1
%16 = load i32, i32* %7
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 %17
store i32 %15, i32* %18
br label %19
19: ; preds = %12
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 1
store i32 %21, i32* %7
br label %9
22: ; preds = %9
store i32 10, i32* %8
%23 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 0
%24 = load i32, i32* %8
%25 = call i32 @radixSort(i32* %23, i32 %24)
%26 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 0
%27 = load i32, i32* %8
%28 = call i32 @print(i32* %26, i32 %27)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x i32]
%4 = bitcast [10 x i32]* %3 to i8*
%5 = tail call i32 (...) @rand()
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%7 = tail call i32 (...) @rand()
%8 = tail call i32 (...) @rand()
%9 = tail call i32 (...) @rand()
%10 = insertelement <4 x i32> poison, i32 %5, i64 0
%11 = insertelement <4 x i32> %10, i32 %7, i64 1
%12 = insertelement <4 x i32> %11, i32 %8, i64 2
%13 = insertelement <4 x i32> %12, i32 %9, i64 3
%14 = srem <4 x i32> %13, <i32 100, i32 100, i32 100, i32 100>
%15 = add nsw <4 x i32> %14, <i32 1, i32 1, i32 1, i32 1>
%16 = bitcast [10 x i32]* %3 to <4 x i32>*
store <4 x i32> %15, <4 x i32>* %16
%17 = tail call i32 (...) @rand()
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 4
%19 = tail call i32 (...) @rand()
%20 = tail call i32 (...) @rand()
%21 = tail call i32 (...) @rand()
%22 = insertelement <4 x i32> poison, i32 %17, i64 0
%23 = insertelement <4 x i32> %22, i32 %19, i64 1
%24 = insertelement <4 x i32> %23, i32 %20, i64 2
%25 = insertelement <4 x i32> %24, i32 %21, i64 3
%26 = srem <4 x i32> %25, <i32 100, i32 100, i32 100, i32 100>
%27 = add nsw <4 x i32> %26, <i32 1, i32 1, i32 1, i32 1>
%28 = bitcast i32* %18 to <4 x i32>*
store <4 x i32> %27, <4 x i32>* %28
%29 = tail call i32 (...) @rand()
%30 = srem i32 %29, 100
%31 = add nsw i32 %30, 1
%32 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 8
store i32 %31, i32* %32
%33 = tail call i32 (...) @rand()
%34 = srem i32 %33, 100
%35 = add nsw i32 %34, 1
%36 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 9
store i32 %35, i32* %36
%37 = call i32 @radixSort(i32* %6, i32 10)
%38 = call i32 @print(i32* %6, i32 10)
ret i32 0
}