int main() {
  int teste[100];
  int eleito, i, j, a;
  for (i = 0; i < 100; i++)
    teste[i] = 100 - i;
  for (i = 1; i < 100; i++) {
    eleito = teste[i];
    j = i - 1;
    while ((j >= 0) && (eleito < teste[j])) {
      teste[j + 1] = teste[j];
      j--;
    }
    teste[j + 1] = eleito;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1a8(%rbp)
cmpl   $0x64,-0x1a8(%rbp)
jge    1156 <main+0x56>
mov    $0x64,%ecx
sub    -0x1a8(%rbp),%ecx
movslq -0x1a8(%rbp),%rax
mov    %ecx,-0x1a0(%rbp,%rax,4)
mov    -0x1a8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a8(%rbp)
jmp    111c <main+0x1c>
movl   $0x1,-0x1a8(%rbp)
cmpl   $0x64,-0x1a8(%rbp)
jge    1235 <main+0x135>
movslq -0x1a8(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%eax
mov    %eax,-0x1a4(%rbp)
mov    -0x1a8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x1ac(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x1ac(%rbp)
mov    %al,-0x1b1(%rbp)
jl     11c2 <main+0xc2>
mov    -0x1a4(%rbp),%eax
movslq -0x1ac(%rbp),%rcx
cmp    -0x1a0(%rbp,%rcx,4),%eax
setl   %al
mov    %al,-0x1b1(%rbp)
mov    -0x1b1(%rbp),%al
test   $0x1,%al
jne    11d5 <main+0xd5>
jmp    1209 <main+0x109>
movslq -0x1ac(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%ecx
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
cltq
mov    %ecx,-0x1a0(%rbp,%rax,4)
mov    -0x1ac(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1ac(%rbp)
jmp    1190 <main+0x90>
mov    -0x1a4(%rbp),%ecx
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
cltq
mov    %ecx,-0x1a0(%rbp,%rax,4)
mov    -0x1a8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a8(%rbp)
jmp    1160 <main+0x60>
xor    %eax,%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x118,%rsp
movaps 0xef2(%rip),%xmm0
movaps %xmm0,-0x80(%rsp)
movaps 0xef6(%rip),%xmm0
movaps %xmm0,-0x70(%rsp)
movaps 0xefa(%rip),%xmm0
movaps %xmm0,-0x60(%rsp)
movaps 0xefe(%rip),%xmm0
movaps %xmm0,-0x50(%rsp)
movaps 0xf02(%rip),%xmm0
movaps %xmm0,-0x40(%rsp)
movaps 0xf06(%rip),%xmm0
movaps %xmm0,-0x30(%rsp)
movaps 0xf0a(%rip),%xmm0
movaps %xmm0,-0x20(%rsp)
movaps 0xf0e(%rip),%xmm0
movaps %xmm0,-0x10(%rsp)
movaps 0xf12(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xf17(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xf1b(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xf1f(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xf23(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xf27(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xf2b(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xf2f(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xf33(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xf34(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xf35(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xf36(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0xf37(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0xf38(%rip),%xmm0
movaps %xmm0,0xd0(%rsp)
movaps 0xf39(%rip),%xmm0
movaps %xmm0,0xe0(%rsp)
movaps 0xf3a(%rip),%xmm0
movaps %xmm0,0xf0(%rsp)
movaps 0xf3b(%rip),%xmm0
movaps %xmm0,0x100(%rsp)
mov    $0x1,%eax
jmp    1271 <main+0x171>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movslq %edx,%rdx
mov    %ecx,-0x80(%rsp,%rdx,4)
add    $0x1,%rax
cmp    $0x64,%rax
je     12a3 <main+0x1a3>
mov    -0x80(%rsp,%rax,4),%ecx
mov    %rax,%rdx
nopl   0x0(%rax,%rax,1)
lea    -0x1(%rdx),%rsi
mov    %esi,%edi
mov    -0x80(%rsp,%rdi,4),%edi
cmp    %edi,%ecx
jge    1260 <main+0x160>
mov    %edi,-0x80(%rsp,%rdx,4)
lea    0x1(%rsi),%rdi
mov    %rsi,%rdx
cmp    $0x1,%rdi
jg     1280 <main+0x180>
xor    %edx,%edx
jmp    1260 <main+0x160>
xor    %eax,%eax
add    $0x118,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
br label %7
7: ; preds = %16, %0
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 100
br i1 %9, label %10, label %19
10: ; preds = %7
%11 = load i32, i32* %4
%12 = sub nsw i32 100, %11
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %14
store i32 %12, i32* %15
br label %16
16: ; preds = %10
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %7
19: ; preds = %7
store i32 1, i32* %4
br label %20
20: ; preds = %59, %19
%21 = load i32, i32* %4
%22 = icmp slt i32 %21, 100
br i1 %22, label %23, label %62
23: ; preds = %20
%24 = load i32, i32* %4
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %25
%27 = load i32, i32* %26
store i32 %27, i32* %3
%28 = load i32, i32* %4
%29 = sub nsw i32 %28, 1
store i32 %29, i32* %5
br label %30
30: ; preds = %42, %23
%31 = load i32, i32* %5
%32 = icmp sge i32 %31, 0
br i1 %32, label %33, label %40
33: ; preds = %30
%34 = load i32, i32* %3
%35 = load i32, i32* %5
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %36
%38 = load i32, i32* %37
%39 = icmp slt i32 %34, %38
br label %40
40: ; preds = %33, %30
%41 = phi i1 [ false, %30 ], [ %39, %33 ]
br i1 %41, label %42, label %53
42: ; preds = %40
%43 = load i32, i32* %5
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %44
%46 = load i32, i32* %45
%47 = load i32, i32* %5
%48 = add nsw i32 %47, 1
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %49
store i32 %46, i32* %50
%51 = load i32, i32* %5
%52 = add nsw i32 %51, -1
store i32 %52, i32* %5
br label %30
53: ; preds = %40
%54 = load i32, i32* %3
%55 = load i32, i32* %5
%56 = add nsw i32 %55, 1
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %57
store i32 %54, i32* %58
br label %59
59: ; preds = %53
%60 = load i32, i32* %4
%61 = add nsw i32 %60, 1
store i32 %61, i32* %4
br label %20
62: ; preds = %20
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [100 x i32]
%2 = bitcast [100 x i32]* %1 to i8*
%3 = bitcast [100 x i32]* %1 to <4 x i32>*
store <4 x i32> <i32 100, i32 99, i32 98, i32 97>, <4 x i32>* %3
%4 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 4
%5 = bitcast i32* %4 to <4 x i32>*
store <4 x i32> <i32 96, i32 95, i32 94, i32 93>, <4 x i32>* %5
%6 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 8
%7 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> <i32 92, i32 91, i32 90, i32 89>, <4 x i32>* %7
%8 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 12
%9 = bitcast i32* %8 to <4 x i32>*
store <4 x i32> <i32 88, i32 87, i32 86, i32 85>, <4 x i32>* %9
%10 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 16
%11 = bitcast i32* %10 to <4 x i32>*
store <4 x i32> <i32 84, i32 83, i32 82, i32 81>, <4 x i32>* %11
%12 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 20
%13 = bitcast i32* %12 to <4 x i32>*
store <4 x i32> <i32 80, i32 79, i32 78, i32 77>, <4 x i32>* %13
%14 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 24
%15 = bitcast i32* %14 to <4 x i32>*
store <4 x i32> <i32 76, i32 75, i32 74, i32 73>, <4 x i32>* %15
%16 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 28
%17 = bitcast i32* %16 to <4 x i32>*
store <4 x i32> <i32 72, i32 71, i32 70, i32 69>, <4 x i32>* %17
%18 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 32
%19 = bitcast i32* %18 to <4 x i32>*
store <4 x i32> <i32 68, i32 67, i32 66, i32 65>, <4 x i32>* %19
%20 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 36
%21 = bitcast i32* %20 to <4 x i32>*
store <4 x i32> <i32 64, i32 63, i32 62, i32 61>, <4 x i32>* %21
%22 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 40
%23 = bitcast i32* %22 to <4 x i32>*
store <4 x i32> <i32 60, i32 59, i32 58, i32 57>, <4 x i32>* %23
%24 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 44
%25 = bitcast i32* %24 to <4 x i32>*
store <4 x i32> <i32 56, i32 55, i32 54, i32 53>, <4 x i32>* %25
%26 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 48
%27 = bitcast i32* %26 to <4 x i32>*
store <4 x i32> <i32 52, i32 51, i32 50, i32 49>, <4 x i32>* %27
%28 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 52
%29 = bitcast i32* %28 to <4 x i32>*
store <4 x i32> <i32 48, i32 47, i32 46, i32 45>, <4 x i32>* %29
%30 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 56
%31 = bitcast i32* %30 to <4 x i32>*
store <4 x i32> <i32 44, i32 43, i32 42, i32 41>, <4 x i32>* %31
%32 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 60
%33 = bitcast i32* %32 to <4 x i32>*
store <4 x i32> <i32 40, i32 39, i32 38, i32 37>, <4 x i32>* %33
%34 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 64
%35 = bitcast i32* %34 to <4 x i32>*
store <4 x i32> <i32 36, i32 35, i32 34, i32 33>, <4 x i32>* %35
%36 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 68
%37 = bitcast i32* %36 to <4 x i32>*
store <4 x i32> <i32 32, i32 31, i32 30, i32 29>, <4 x i32>* %37
%38 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 72
%39 = bitcast i32* %38 to <4 x i32>*
store <4 x i32> <i32 28, i32 27, i32 26, i32 25>, <4 x i32>* %39
%40 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 76
%41 = bitcast i32* %40 to <4 x i32>*
store <4 x i32> <i32 24, i32 23, i32 22, i32 21>, <4 x i32>* %41
%42 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 80
%43 = bitcast i32* %42 to <4 x i32>*
store <4 x i32> <i32 20, i32 19, i32 18, i32 17>, <4 x i32>* %43
%44 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 84
%45 = bitcast i32* %44 to <4 x i32>*
store <4 x i32> <i32 16, i32 15, i32 14, i32 13>, <4 x i32>* %45
%46 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 88
%47 = bitcast i32* %46 to <4 x i32>*
store <4 x i32> <i32 12, i32 11, i32 10, i32 9>, <4 x i32>* %47
%48 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 92
%49 = bitcast i32* %48 to <4 x i32>*
store <4 x i32> <i32 8, i32 7, i32 6, i32 5>, <4 x i32>* %49
%50 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 96
%51 = bitcast i32* %50 to <4 x i32>*
store <4 x i32> <i32 4, i32 3, i32 2, i32 1>, <4 x i32>* %51
br label %52
52: ; preds = %0, %66
%53 = phi i64 [ %71, %66 ], [ 1, %0 ]
%54 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %53
%55 = load i32, i32* %54
br label %56
56: ; preds = %52, %63
%57 = phi i64 [ %53, %52 ], [ %58, %63 ]
%58 = add nsw i64 %57, -1
%59 = and i64 %58, 4294967295
%60 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %59
%61 = load i32, i32* %60
%62 = icmp slt i32 %55, %61
br i1 %62, label %63, label %66
63: ; preds = %56
%64 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %57
store i32 %61, i32* %64
%65 = icmp sgt i64 %57, 1
br i1 %65, label %56, label %66
66: ; preds = %63, %56
%67 = phi i64 [ 0, %63 ], [ %57, %56 ]
%68 = shl i64 %67, 32
%69 = ashr exact i64 %68, 32
%70 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %69
store i32 %55, i32* %70
%71 = add nuw nsw i64 %53, 1
%72 = icmp eq i64 %71, 100
br i1 %72, label %73, label %52
73: ; preds = %66
ret i32 0
}