#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*/ printf(char *, ...);
int main(int argc, char const *argv[]) {
  int pila[5] = {742, 32, 5, 41, 3};
  int i;
  printf("Numeros sin ordenar\n\n");
  for (int i = 0; i < 5; i++)
    printf("%i\t", pila[i]);
  printf("\n\n");
  for (int i = 0; i < 4; i++) {
    for (int b = 0; b < 4 - i; b++) {
      if (pila[b] > pila[b + 1]) {
        int inter;
        inter = pila[b];
        pila[b] = pila[b + 1];
        pila[b + 1] = inter;
      }
    }
  }
  printf("Numeros ordenados\n\n");
  for (i = 0; i < 5; i++)
    printf("%i\t", pila[i]);
  printf("\n\n");
  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)
mov    0xed3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xece(%rip),%eax
mov    %eax,-0x20(%rbp)
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x38(%rbp)
cmpl   $0x5,-0x38(%rbp)
jge    1188 <main+0x78>
movslq -0x38(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    115a <main+0x4a>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x3c(%rbp)
cmpl   $0x4,-0x3c(%rbp)
jge    1230 <main+0x120>
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
mov    $0x4,%ecx
sub    -0x3c(%rbp),%ecx
cmp    %ecx,%eax
jge    121d <main+0x10d>
movslq -0x40(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
mov    -0x40(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
cmp    -0x30(%rbp,%rcx,4),%eax
jle    120a <main+0xfa>
movslq -0x40(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
mov    %eax,-0x44(%rbp)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
cltq
mov    -0x30(%rbp,%rax,4),%ecx
movslq -0x40(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x44(%rbp),%ecx
mov    -0x40(%rbp),%eax
add    $0x1,%eax
cltq
mov    %ecx,-0x30(%rbp,%rax,4)
jmp    120f <main+0xff>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    11ae <main+0x9e>
jmp    1222 <main+0x112>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    119d <main+0x8d>
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0x5,-0x34(%rbp)
jge    1273 <main+0x163>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xdcc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1245 <main+0x135>
lea    0xdad(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2e6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x20,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x29,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe8e(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xe81(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x20,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x29,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2e6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.pila = [5 x i32] [i32 742, i32 32, i32 5, i32 41, i32 3]
@.str = [22 x i8] c"Numeros sin ordenar\0A\0A\00"
@.str.1 = [4 x i8] c"%i\09\00"
@.str.2 = [3 x i8] c"\0A\0A\00"
@.str.3 = [20 x i8] c"Numeros ordenados\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [5 x i32]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = bitcast [5 x i32]* %6 to i8*
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %8
br label %14
14: ; preds = %23, %2
%15 = load i32, i32* %8
%16 = icmp slt i32 %15, 5
br i1 %16, label %17, label %26
17: ; preds = %14
%18 = load i32, i32* %8
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %21)
br label %23
23: ; preds = %17
%24 = load i32, i32* %8
%25 = add nsw i32 %24, 1
store i32 %25, i32* %8
br label %14
26: ; preds = %14
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %9
br label %28
28: ; preds = %71, %26
%29 = load i32, i32* %9
%30 = icmp slt i32 %29, 4
br i1 %30, label %31, label %74
31: ; preds = %28
store i32 0, i32* %10
br label %32
32: ; preds = %67, %31
%33 = load i32, i32* %10
%34 = load i32, i32* %9
%35 = sub nsw i32 4, %34
%36 = icmp slt i32 %33, %35
br i1 %36, label %37, label %70
37: ; preds = %32
%38 = load i32, i32* %10
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 %39
%41 = load i32, i32* %40
%42 = load i32, i32* %10
%43 = add nsw i32 %42, 1
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 %44
%46 = load i32, i32* %45
%47 = icmp sgt i32 %41, %46
br i1 %47, label %48, label %66
48: ; preds = %37
%49 = load i32, i32* %10
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 %50
%52 = load i32, i32* %51
store i32 %52, i32* %11
%53 = load i32, i32* %10
%54 = add nsw i32 %53, 1
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 %55
%57 = load i32, i32* %56
%58 = load i32, i32* %10
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 %59
store i32 %57, i32* %60
%61 = load i32, i32* %11
%62 = load i32, i32* %10
%63 = add nsw i32 %62, 1
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 %64
store i32 %61, i32* %65
br label %66
66: ; preds = %48, %37
br label %67
67: ; preds = %66
%68 = load i32, i32* %10
%69 = add nsw i32 %68, 1
store i32 %69, i32* %10
br label %32
70: ; preds = %32
br label %71
71: ; preds = %70
%72 = load i32, i32* %9
%73 = add nsw i32 %72, 1
store i32 %73, i32* %9
br label %28
74: ; preds = %28
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %7
br label %76
76: ; preds = %85, %74
%77 = load i32, i32* %7
%78 = icmp slt i32 %77, 5
br i1 %78, label %79, label %88
79: ; preds = %76
%80 = load i32, i32* %7
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 %81
%83 = load i32, i32* %82
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %83)
br label %85
85: ; preds = %79
%86 = load i32, i32* %7
%87 = add nsw i32 %86, 1
store i32 %87, i32* %7
br label %76
88: ; preds = %76
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%i\09\00"
@str = [21 x i8] c"Numeros sin ordenar\0A\00"
@str.5 = [19 x i8] c"Numeros ordenados\0A\00"
@str.6 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 742)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 32)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 5)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 41)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.6, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.5, i64 0, i64 0))
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 5)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 32)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 41)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 742)
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}