#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 LEN = 5;
  int A[5] = {1, 2, 3, 4, 5};
  int B[5] = {4, 5, 6, 7, 8};
  int C[LEN * 2];
  int i = 0, j = 0, temp = 0;
  for (j = 0; j < LEN; j++) {
    C[j] = A[j];
  }
  for (j = LEN; j < LEN * 2; j++) {
    C[j] = B[j - LEN];
  }
  for (i = 0; i < LEN * 2; i++) {
    for (j = 0; j < LEN * 2; j++) {
      if (C[j] < C[j - 1]) {
        temp = C[j - 1];
        C[j - 1] = C[j];
        C[j] = temp;
      }
    }
  }
  for (i = 0; i < LEN * 2; i++)
    printf("%d\t", C[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    0xee4(%rip),%eax
mov    %eax,-0x10(%rbp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,-0x20(%rbp)
mov    0xef0(%rip),%eax
mov    %eax,-0x30(%rbp)
movaps 0xed6(%rip),%xmm0
movaps %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%eax
add    %eax,%eax
mov    %rsp,%rcx
mov    %rcx,-0x48(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x68(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x50(%rbp)
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
movl   $0x0,-0x5c(%rbp)
movl   $0x0,-0x58(%rbp)
mov    -0x58(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11c0 <main+0xb0>
mov    -0x68(%rbp),%rax
movslq -0x58(%rbp),%rcx
mov    -0x20(%rbp,%rcx,4),%edx
movslq -0x58(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    1193 <main+0x83>
mov    -0x8(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x58(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    11fd <main+0xed>
mov    -0x68(%rbp),%rax
mov    -0x58(%rbp),%ecx
sub    -0x8(%rbp),%ecx
movslq %ecx,%rcx
mov    -0x40(%rbp,%rcx,4),%edx
movslq -0x58(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    11c6 <main+0xb6>
movl   $0x0,-0x54(%rbp)
mov    -0x54(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    12a0 <main+0x190>
movl   $0x0,-0x58(%rbp)
mov    -0x58(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    128d <main+0x17d>
mov    -0x68(%rbp),%rcx
movslq -0x58(%rbp),%rax
mov    (%rcx,%rax,4),%eax
mov    -0x58(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jge    127a <main+0x16a>
mov    -0x68(%rbp),%rax
mov    -0x58(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%ecx
mov    %ecx,-0x5c(%rbp)
movslq -0x58(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x58(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x5c(%rbp),%edx
movslq -0x58(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    127f <main+0x16f>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    121c <main+0x10c>
jmp    1292 <main+0x182>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1204 <main+0xf4>
movl   $0x0,-0x54(%rbp)
mov    -0x54(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    12df <main+0x1cf>
mov    -0x68(%rbp),%rax
movslq -0x54(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xd6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    12a7 <main+0x197>
lea    0xd52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x48(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%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    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.A = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@__const.main.B = [5 x i32] [i32 4, i32 5, i32 6, i32 7, i32 8]
@.str = [4 x i8] c"%d\09\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [5 x i32]
%4 = alloca [5 x i32]
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
%10 = bitcast [5 x i32]* %3 to i8*
%11 = bitcast [5 x i32]* %4 to i8*
%12 = load i32, i32* %2
%13 = mul nsw i32 %12, 2
%14 = zext i32 %13 to i64
%15 = call i8* @llvm.stacksave()
store i8* %15, i8** %5
%16 = alloca i32, i64 %14
store i64 %14, i64* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %8
br label %17
17: ; preds = %29, %0
%18 = load i32, i32* %8
%19 = load i32, i32* %2
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %32
21: ; preds = %17
%22 = load i32, i32* %8
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 %23
%25 = load i32, i32* %24
%26 = load i32, i32* %8
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %16, i64 %27
store i32 %25, i32* %28
br label %29
29: ; preds = %21
%30 = load i32, i32* %8
%31 = add nsw i32 %30, 1
store i32 %31, i32* %8
br label %17
32: ; preds = %17
%33 = load i32, i32* %2
store i32 %33, i32* %8
br label %34
34: ; preds = %49, %32
%35 = load i32, i32* %8
%36 = load i32, i32* %2
%37 = mul nsw i32 %36, 2
%38 = icmp slt i32 %35, %37
br i1 %38, label %39, label %52
39: ; preds = %34
%40 = load i32, i32* %8
%41 = load i32, i32* %2
%42 = sub nsw i32 %40, %41
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 %43
%45 = load i32, i32* %44
%46 = load i32, i32* %8
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i32, i32* %16, i64 %47
store i32 %45, i32* %48
br label %49
49: ; preds = %39
%50 = load i32, i32* %8
%51 = add nsw i32 %50, 1
store i32 %51, i32* %8
br label %34
52: ; preds = %34
store i32 0, i32* %7
br label %53
53: ; preds = %98, %52
%54 = load i32, i32* %7
%55 = load i32, i32* %2
%56 = mul nsw i32 %55, 2
%57 = icmp slt i32 %54, %56
br i1 %57, label %58, label %101
58: ; preds = %53
store i32 0, i32* %8
br label %59
59: ; preds = %94, %58
%60 = load i32, i32* %8
%61 = load i32, i32* %2
%62 = mul nsw i32 %61, 2
%63 = icmp slt i32 %60, %62
br i1 %63, label %64, label %97
64: ; preds = %59
%65 = load i32, i32* %8
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i32, i32* %16, i64 %66
%68 = load i32, i32* %67
%69 = load i32, i32* %8
%70 = sub nsw i32 %69, 1
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds i32, i32* %16, i64 %71
%73 = load i32, i32* %72
%74 = icmp slt i32 %68, %73
br i1 %74, label %75, label %93
75: ; preds = %64
%76 = load i32, i32* %8
%77 = sub nsw i32 %76, 1
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i32, i32* %16, i64 %78
%80 = load i32, i32* %79
store i32 %80, i32* %9
%81 = load i32, i32* %8
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds i32, i32* %16, i64 %82
%84 = load i32, i32* %83
%85 = load i32, i32* %8
%86 = sub nsw i32 %85, 1
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds i32, i32* %16, i64 %87
store i32 %84, i32* %88
%89 = load i32, i32* %9
%90 = load i32, i32* %8
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds i32, i32* %16, i64 %91
store i32 %89, i32* %92
br label %93
93: ; preds = %75, %64
br label %94
94: ; preds = %93
%95 = load i32, i32* %8
%96 = add nsw i32 %95, 1
store i32 %96, i32* %8
br label %59
97: ; preds = %59
br label %98
98: ; preds = %97
%99 = load i32, i32* %7
%100 = add nsw i32 %99, 1
store i32 %100, i32* %7
br label %53
101: ; preds = %53
store i32 0, i32* %7
br label %102
102: ; preds = %113, %101
%103 = load i32, i32* %7
%104 = load i32, i32* %2
%105 = mul nsw i32 %104, 2
%106 = icmp slt i32 %103, %105
br i1 %106, label %107, label %116
107: ; preds = %102
%108 = load i32, i32* %7
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds i32, i32* %16, i64 %109
%111 = load i32, i32* %110
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %111)
br label %113
113: ; preds = %107
%114 = load i32, i32* %7
%115 = add nsw i32 %114, 1
store i32 %115, i32* %7
br label %102
116: ; preds = %102
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%118 = load i8*, i8** %5
%119 = load i32, i32* %1
ret i32 %119
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\09\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 6)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 7)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
%11 = tail call i32 @putchar(i32 10)
ret i32 0
}