#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(void) {
  int a[10] = {100, -250, 400, 125, 550, 900, 689, 450, 347, 700};
  int j, k, gecici;
  printf("Once : ");
  for (k = 0; k < 10; k++)
    printf("%5d ", a[k]);
  for (k = 0; k < 10 - 1; k++)
    for (j = 0; j < 10 - 1; j++)
      if (a[j] < a[j + 1]) {
        gecici = a[j];
        a[j] = a[j + 1];
        a[j + 1] = gecici;
      }
  printf("\nSonra: ");
  for (k = 0; k < 10; k++)
    printf("%5d ", a[k]);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x38(%rbp)
cmpl   $0xa,-0x38(%rbp)
jge    1187 <main+0x67>
movslq -0x38(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1159 <main+0x39>
movl   $0x0,-0x38(%rbp)
cmpl   $0x9,-0x38(%rbp)
jge    1218 <main+0xf8>
movl   $0x0,-0x34(%rbp)
cmpl   $0x9,-0x34(%rbp)
jge    1205 <main+0xe5>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
cmp    -0x30(%rbp,%rcx,4),%eax
jge    11f2 <main+0xd2>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
cltq
mov    -0x30(%rbp,%rax,4),%ecx
movslq -0x34(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x3c(%rbp),%ecx
mov    -0x34(%rbp),%eax
add    $0x1,%eax
cltq
mov    %ecx,-0x30(%rbp,%rax,4)
jmp    11f7 <main+0xd7>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    119f <main+0x7f>
jmp    120a <main+0xea>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    118e <main+0x6e>
lea    0xe16(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x38(%rbp)
cmpl   $0xa,-0x38(%rbp)
jge    125b <main+0x13b>
movslq -0x38(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xdea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    122d <main+0x10d>
lea    0xddc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec5(%rip),%r12
mov    %r12,%rdi
mov    $0x64,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    $0xffffff06,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    $0x190,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x7d,%ebp
mov    %r12,%rdi
mov    $0x7d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x226,%ebx
mov    %r12,%rdi
mov    $0x226,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x384,%r13d
mov    %r12,%rdi
mov    $0x384,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2b1,%r14d
mov    %r12,%rdi
mov    $0x2b1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1c2,%r15d
mov    %r12,%rdi
mov    $0x1c2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x15b,%r12d
lea    0xe24(%rip),%rdi
mov    $0x15b,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe11(%rip),%rdi
mov    $0x2bc,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2bc,%r8d
mov    $0x190,%edx
mov    $0xffffff06,%edi
mov    $0x64,%esi
mov    $0x9,%eax
nopl   (%rax)
cmp    %edi,%esi
mov    %edi,%ecx
cmovl  %esi,%ecx
cmovl  %edi,%esi
cmp    %edx,%ecx
mov    %ecx,%edi
cmovl  %edx,%edi
cmovl  %ecx,%edx
cmp    %ebp,%edx
mov    %ebp,%ecx
cmovl  %edx,%ecx
cmovl  %ebp,%edx
cmp    %ebx,%ecx
mov    %ecx,%ebp
cmovl  %ebx,%ebp
cmovl  %ecx,%ebx
cmp    %r13d,%ebx
mov    %r13d,%ecx
cmovl  %ebx,%ecx
cmovl  %r13d,%ebx
cmp    %r14d,%ecx
mov    %ecx,%r13d
cmovl  %r14d,%r13d
cmovl  %ecx,%r14d
cmp    %r15d,%r14d
mov    %r15d,%ecx
cmovl  %r14d,%ecx
cmovl  %r15d,%r14d
cmp    %r12d,%ecx
mov    %ecx,%r15d
cmovl  %r12d,%r15d
cmovl  %ecx,%r12d
mov    %r8d,%ecx
cmp    %r8d,%r12d
cmovl  %r12d,%r8d
cmovl  %ecx,%r12d
add    $0xffffffff,%eax
jne    1220 <main+0x100>
mov    %edi,0xc(%rsp)
lea    0xd70(%rip),%rdi
xor    %eax,%eax
mov    %esi,0x8(%rsp)
mov    %edx,0x10(%rsp)
mov    %r8d,0x14(%rsp)
call   1040 <printf@plt>
lea    0xd50(%rip),%rdi
mov    0x8(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd3e(%rip),%rdi
mov    0xc(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd2c(%rip),%rdi
mov    0x10(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd1a(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd0a(%rip),%rbp
mov    %rbp,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    0x14(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.a = [10 x i32] [i32 100, i32 -250, i32 400, i32 125, i32 550, i32 900, i32 689, i32 450, i32 347, i32 700]
@.str = [8 x i8] c"Once : \00"
@.str.1 = [5 x i8] c"%5d \00"
@.str.2 = [9 x i8] c"\0ASonra: \00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [10 x i32]* %2 to i8*
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %8
8: ; preds = %17, %0
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 10
br i1 %10, label %11, label %20
11: ; preds = %8
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %11
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %8
20: ; preds = %8
store i32 0, i32* %4
br label %21
21: ; preds = %62, %20
%22 = load i32, i32* %4
%23 = icmp slt i32 %22, 9
br i1 %23, label %24, label %65
24: ; preds = %21
store i32 0, i32* %3
br label %25
25: ; preds = %58, %24
%26 = load i32, i32* %3
%27 = icmp slt i32 %26, 9
br i1 %27, label %28, label %61
28: ; preds = %25
%29 = load i32, i32* %3
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %30
%32 = load i32, i32* %31
%33 = load i32, i32* %3
%34 = add nsw i32 %33, 1
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %35
%37 = load i32, i32* %36
%38 = icmp slt i32 %32, %37
br i1 %38, label %39, label %57
39: ; preds = %28
%40 = load i32, i32* %3
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %41
%43 = load i32, i32* %42
store i32 %43, i32* %5
%44 = load i32, i32* %3
%45 = add nsw i32 %44, 1
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %46
%48 = load i32, i32* %47
%49 = load i32, i32* %3
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %50
store i32 %48, i32* %51
%52 = load i32, i32* %5
%53 = load i32, i32* %3
%54 = add nsw i32 %53, 1
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %55
store i32 %52, i32* %56
br label %57
57: ; preds = %39, %28
br label %58
58: ; preds = %57
%59 = load i32, i32* %3
%60 = add nsw i32 %59, 1
store i32 %60, i32* %3
br label %25
61: ; preds = %25
br label %62
62: ; preds = %61
%63 = load i32, i32* %4
%64 = add nsw i32 %63, 1
store i32 %64, i32* %4
br label %21
65: ; preds = %21
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %4
br label %67
67: ; preds = %76, %65
%68 = load i32, i32* %4
%69 = icmp slt i32 %68, 10
br i1 %69, label %70, label %79
70: ; preds = %67
%71 = load i32, i32* %4
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %72
%74 = load i32, i32* %73
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %74)
br label %76
76: ; preds = %70
%77 = load i32, i32* %4
%78 = add nsw i32 %77, 1
store i32 %78, i32* %4
br label %67
79: ; preds = %67
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"Once : \00"
@.str.1 = [5 x i8] c"%5d \00"
@.str.2 = [9 x i8] c"\0ASonra: \00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 100)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 -250)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 400)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 125)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 550)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 900)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 689)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 450)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 347)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 700)
br label %12
12: ; preds = %0, %12
%13 = phi i32 [ 700, %0 ], [ %49, %12 ]
%14 = phi i32 [ 347, %0 ], [ %50, %12 ]
%15 = phi i32 [ 450, %0 ], [ %47, %12 ]
%16 = phi i32 [ 689, %0 ], [ %44, %12 ]
%17 = phi i32 [ 900, %0 ], [ %41, %12 ]
%18 = phi i32 [ 550, %0 ], [ %38, %12 ]
%19 = phi i32 [ 125, %0 ], [ %35, %12 ]
%20 = phi i32 [ 400, %0 ], [ %32, %12 ]
%21 = phi i32 [ -250, %0 ], [ %29, %12 ]
%22 = phi i32 [ 100, %0 ], [ %26, %12 ]
%23 = phi i32 [ 0, %0 ], [ %51, %12 ]
%24 = icmp slt i32 %22, %21
%25 = select i1 %24, i32 %22, i32 %21
%26 = select i1 %24, i32 %21, i32 %22
%27 = icmp slt i32 %25, %20
%28 = select i1 %27, i32 %25, i32 %20
%29 = select i1 %27, i32 %20, i32 %25
%30 = icmp slt i32 %28, %19
%31 = select i1 %30, i32 %28, i32 %19
%32 = select i1 %30, i32 %19, i32 %28
%33 = icmp slt i32 %31, %18
%34 = select i1 %33, i32 %31, i32 %18
%35 = select i1 %33, i32 %18, i32 %31
%36 = icmp slt i32 %34, %17
%37 = select i1 %36, i32 %34, i32 %17
%38 = select i1 %36, i32 %17, i32 %34
%39 = icmp slt i32 %37, %16
%40 = select i1 %39, i32 %37, i32 %16
%41 = select i1 %39, i32 %16, i32 %37
%42 = icmp slt i32 %40, %15
%43 = select i1 %42, i32 %40, i32 %15
%44 = select i1 %42, i32 %15, i32 %40
%45 = icmp slt i32 %43, %14
%46 = select i1 %45, i32 %43, i32 %14
%47 = select i1 %45, i32 %14, i32 %43
%48 = icmp slt i32 %46, %13
%49 = select i1 %48, i32 %46, i32 %13
%50 = select i1 %48, i32 %13, i32 %46
%51 = add nuw nsw i32 %23, 1
%52 = icmp eq i32 %51, 9
br i1 %52, label %53, label %12
53: ; preds = %12
%54 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %26)
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %29)
%57 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %32)
%58 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %35)
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %38)
%60 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %41)
%61 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %44)
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %47)
%63 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %50)
%64 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %49)
%65 = tail call i32 @putchar(i32 10)
ret i32 0
}