#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 dizi[10] = {10, 20, 12, 45, 62, 124, 5, 1, 523, 5};
  printf("Dizideki sayilarin orjinal sirasi\n");
  int sira;
  for (sira = 0; sira <= 10 - 1; sira++) {
    printf("%d  ", dizi[sira]);
  }
  int tur_sayisi, ara_deger_tutucu;
  for (tur_sayisi = 1; tur_sayisi <= 10 - 1; tur_sayisi++) {
    for (sira = 0; sira <= 10 - 2; sira++) {
      if (dizi[sira] > dizi[sira + 1]) {
        ara_deger_tutucu = dizi[sira];
        dizi[sira] = dizi[sira + 1];
        dizi[sira + 1] = ara_deger_tutucu;
      }
    }
  }
  printf("\nVerilerin kucukten buyuge siralanmis hali\n");
  for (sira = 0; sira <= 10 - 1; sira++) {
    printf("%d  ", dizi[sira]);
  }
  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,-0x34(%rbp)
cmpl   $0x9,-0x34(%rbp)
jg     1187 <main+0x67>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1159 <main+0x39>
movl   $0x1,-0x38(%rbp)
cmpl   $0x9,-0x38(%rbp)
jg     1218 <main+0xf8>
movl   $0x0,-0x34(%rbp)
cmpl   $0x8,-0x34(%rbp)
jg     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
jle    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    0xe31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0x9,-0x34(%rbp)
jg     125b <main+0x13b>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xe05(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    122d <main+0x10d>
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    0xed0(%rip),%rdi
call   1030 <puts@plt>
lea    0xebf(%rip),%r13
mov    %r13,%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r13,%rdi
mov    $0x14,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r13,%rdi
mov    $0xc,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2d,%ebx
mov    %r13,%rdi
mov    $0x2d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x3e,%ebp
mov    %r13,%rdi
mov    $0x3e,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x7c,%r14d
mov    %r13,%rdi
mov    $0x7c,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r13,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%r15d
mov    %r13,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x20b,%r12d
mov    %r13,%rdi
mov    $0x20b,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r13,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xc,%edx
mov    $0x14,%eax
mov    $0xa,%edi
mov    $0x5,%esi
mov    $0x9,%r8d
mov    $0x5,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    %eax,%edi
mov    %eax,%ecx
cmovg  %edi,%ecx
cmovg  %eax,%edi
cmp    %edx,%ecx
mov    %ecx,%eax
cmovg  %edx,%eax
cmovg  %ecx,%edx
cmp    %ebx,%edx
mov    %ebx,%ecx
cmovg  %edx,%ecx
cmovg  %ebx,%edx
cmp    %ebp,%ecx
mov    %ecx,%ebx
cmovg  %ebp,%ebx
cmovg  %ecx,%ebp
cmp    %r14d,%ebp
mov    %r14d,%ecx
cmovg  %ebp,%ecx
cmovg  %r14d,%ebp
cmp    %r13d,%ecx
mov    %ecx,%r14d
cmovg  %r13d,%r14d
cmovg  %ecx,%r13d
cmp    %r15d,%r13d
mov    %r15d,%ecx
cmovg  %r13d,%ecx
cmovg  %r15d,%r13d
cmp    %r12d,%ecx
mov    %ecx,%r15d
cmovg  %r12d,%r15d
cmovg  %ecx,%r12d
mov    %esi,%ecx
cmp    %esi,%r12d
cmovg  %r12d,%esi
cmovg  %ecx,%r12d
add    $0xffffffff,%r8d
jne    1220 <main+0x100>
mov    %edi,0x8(%rsp)
lea    0xd8a(%rip),%rdi
mov    %esi,0x14(%rsp)
mov    %eax,0xc(%rsp)
mov    %edx,0x10(%rsp)
call   1030 <puts@plt>
lea    0xd4b(%rip),%rdi
mov    0x8(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd39(%rip),%rdi
mov    0xc(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd27(%rip),%rdi
mov    0x10(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd15(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd05(%rip),%rbx
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    0x14(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@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.dizi = [10 x i32] [i32 10, i32 20, i32 12, i32 45, i32 62, i32 124, i32 5, i32 1, i32 523, i32 5]
@.str = [35 x i8] c"Dizideki sayilarin orjinal sirasi\0A\00"
@.str.1 = [5 x i8] c"%d \00"
@.str.2 = [44 x i8] c"\0AVerilerin kucukten buyuge siralanmis hali\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 ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %8
8: ; preds = %17, %0
%9 = load i32, i32* %3
%10 = icmp sle i32 %9, 9
br i1 %10, label %11, label %20
11: ; preds = %8
%12 = load i32, i32* %3
%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* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %8
20: ; preds = %8
store i32 1, i32* %4
br label %21
21: ; preds = %62, %20
%22 = load i32, i32* %4
%23 = icmp sle 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 sle i32 %26, 8
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 sgt 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 ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %67
67: ; preds = %76, %65
%68 = load i32, i32* %3
%69 = icmp sle i32 %68, 9
br i1 %69, label %70, label %79
70: ; preds = %67
%71 = load i32, i32* %3
%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* %3
%78 = add nsw i32 %77, 1
store i32 %78, i32* %3
br label %67
79: ; preds = %67
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"%d \00"
@str = [34 x i8] c"Dizideki sayilarin orjinal sirasi\00"
@str.3 = [43 x i8] c"\0AVerilerin kucukten buyuge siralanmis hali\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 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 10)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 20)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 12)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 45)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 62)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 124)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 5)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 1)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 523)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 5)
br label %12
12: ; preds = %0, %12
%13 = phi i32 [ 5, %0 ], [ %49, %12 ]
%14 = phi i32 [ 523, %0 ], [ %50, %12 ]
%15 = phi i32 [ 1, %0 ], [ %47, %12 ]
%16 = phi i32 [ 5, %0 ], [ %44, %12 ]
%17 = phi i32 [ 124, %0 ], [ %41, %12 ]
%18 = phi i32 [ 62, %0 ], [ %38, %12 ]
%19 = phi i32 [ 45, %0 ], [ %35, %12 ]
%20 = phi i32 [ 12, %0 ], [ %32, %12 ]
%21 = phi i32 [ 20, %0 ], [ %29, %12 ]
%22 = phi i32 [ 10, %0 ], [ %26, %12 ]
%23 = phi i32 [ 1, %0 ], [ %51, %12 ]
%24 = icmp sgt i32 %22, %21
%25 = select i1 %24, i32 %22, i32 %21
%26 = select i1 %24, i32 %21, i32 %22
%27 = icmp sgt i32 %25, %20
%28 = select i1 %27, i32 %25, i32 %20
%29 = select i1 %27, i32 %20, i32 %25
%30 = icmp sgt i32 %28, %19
%31 = select i1 %30, i32 %28, i32 %19
%32 = select i1 %30, i32 %19, i32 %28
%33 = icmp sgt i32 %31, %18
%34 = select i1 %33, i32 %31, i32 %18
%35 = select i1 %33, i32 %18, i32 %31
%36 = icmp sgt i32 %34, %17
%37 = select i1 %36, i32 %34, i32 %17
%38 = select i1 %36, i32 %17, i32 %34
%39 = icmp sgt i32 %37, %16
%40 = select i1 %39, i32 %37, i32 %16
%41 = select i1 %39, i32 %16, i32 %37
%42 = icmp sgt i32 %40, %15
%43 = select i1 %42, i32 %40, i32 %15
%44 = select i1 %42, i32 %15, i32 %40
%45 = icmp sgt i32 %43, %14
%46 = select i1 %45, i32 %43, i32 %14
%47 = select i1 %45, i32 %14, i32 %43
%48 = icmp sgt 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, 10
br i1 %52, label %53, label %12
53: ; preds = %12
%54 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.3, 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)
ret i32 0
}