#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*/ bubblesort(int *);
int /*<<< orphan*/ imprimir(int *);
int /*<<< orphan*/ leer(int *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  int nums[5];
  printf("\n\tBubble Sort\n");
  leer(nums);
  printf("Ordenando...\n");
  bubblesort(nums);
  printf("El arreglo resultante es:\n\n");
  imprimir(nums);
  printf("\nFin del Programa\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1050 <leer@plt>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1060 <bubblesort@plt>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <imprimir@plt>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <leer@plt>
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1060 <bubblesort@plt>
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <imprimir@plt>
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"\0A\09Bubble Sort\0A\00"
@.str.1 = [14 x i8] c"Ordenando...\0A\00"
@.str.2 = [28 x i8] c"El arreglo resultante es:\0A\0A\00"
@.str.3 = [19 x i8] c"\0AFin del Programa\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%5 = call i32 @leer(i32* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%8 = call i32 @bubblesort(i32* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%11 = call i32 @imprimir(i32* %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"\0A\09Bubble Sort\00"
@str.4 = [13 x i8] c"Ordenando...\00"
@str.5 = [27 x i8] c"El arreglo resultante es:\0A\00"
@str.6 = [18 x i8] c"\0AFin del Programa\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%5 = call i32 @leer(i32* %4)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.4, i64 0, i64 0))
%7 = call i32 @bubblesort(i32* %4)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.5, i64 0, i64 0))
%9 = call i32 @imprimir(i32* %4)
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}