#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*/ bubble(int *, int);
int /*<<< orphan*/ gera(int *, int);
int /*<<< orphan*/ mostra(int *, int, char *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/);
int main() {
  int v[10];
  srand(time(0));
  gera(v, 10);
  mostra(v, 10, "Vetor original");
  bubble(v, 10);
  mostra(v, 10, "Vetor Ordenado");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1070 <gera@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
lea    0xe75(%rip),%rdx
call   1040 <mostra@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <bubble@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
lea    0xe61(%rip),%rdx
call   1040 <mostra@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1070 <gera@plt>
lea    0xe86(%rip),%rdx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <mostra@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <bubble@plt>
lea    0xe74(%rip),%rdx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <mostra@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Vetor original\00"
@.str.1 = [15 x i8] c"Vetor Ordenado\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = call i32 @time(i32 0)
%4 = call i32 @srand(i32 %3)
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%6 = call i32 @gera(i32* %5, i32 10)
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%8 = call i32 @mostra(i32* %7, i32 10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%10 = call i32 @bubble(i32* %9, i32 10)
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%12 = call i32 @mostra(i32* %11, i32 10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Vetor original\00"
@.str.1 = [15 x i8] c"Vetor Ordenado\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = tail call i32 @time(i32 0)
%4 = tail call i32 @srand(i32 %3)
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i32 @gera(i32* %5, i32 10)
%7 = call i32 @mostra(i32* %5, i32 10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @bubble(i32* %5, i32 10)
%9 = call i32 @mostra(i32* %5, i32 10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}