#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 *argv[]) {
  int a4[4] = {6, 7, 8, 9};
  int a10[10] = {1, 2, 3, 4, 5, 6};
  int i = 3, j = 5, k, l;
  for (l = 9; l >= 0;) {
    if (i >= 0) {
      if (a4[i] > a10[j])
        a10[l--] = a4[i--];
      else
        a10[l--] = a10[j--];
    } else
      a10[l--] = a10[j--];
    for (k = 0; k < 10; k++) {
      printf("%d ", a10[k]);
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movl   $0x1,-0x50(%rbp)
movl   $0x2,-0x4c(%rbp)
movl   $0x3,-0x48(%rbp)
movl   $0x4,-0x44(%rbp)
movl   $0x5,-0x40(%rbp)
movl   $0x6,-0x3c(%rbp)
movl   $0x3,-0x54(%rbp)
movl   $0x5,-0x58(%rbp)
movl   $0x9,-0x60(%rbp)
cmpl   $0x0,-0x60(%rbp)
jl     127d <main+0x15d>
cmpl   $0x0,-0x54(%rbp)
jl     1213 <main+0xf3>
movslq -0x54(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
movslq -0x58(%rbp),%rcx
cmp    -0x50(%rbp,%rcx,4),%eax
jle    11ec <main+0xcc>
mov    -0x54(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x54(%rbp)
cltq
mov    -0x20(%rbp,%rax,4),%ecx
mov    -0x60(%rbp),%eax
mov    %eax,%edx
add    $0xffffffff,%edx
mov    %edx,-0x60(%rbp)
cltq
mov    %ecx,-0x50(%rbp,%rax,4)
jmp    120e <main+0xee>
mov    -0x58(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x58(%rbp)
cltq
mov    -0x50(%rbp,%rax,4),%ecx
mov    -0x60(%rbp),%eax
mov    %eax,%edx
add    $0xffffffff,%edx
mov    %edx,-0x60(%rbp)
cltq
mov    %ecx,-0x50(%rbp,%rax,4)
jmp    1235 <main+0x115>
mov    -0x58(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x58(%rbp)
cltq
mov    -0x50(%rbp,%rax,4),%ecx
mov    -0x60(%rbp),%eax
mov    %eax,%edx
add    $0xffffffff,%edx
mov    %edx,-0x60(%rbp)
cltq
mov    %ecx,-0x50(%rbp,%rax,4)
movl   $0x0,-0x5c(%rbp)
cmpl   $0xa,-0x5c(%rbp)
jge    126a <main+0x14a>
movslq -0x5c(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%esi
lea    0xdbb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    123c <main+0x11c>
lea    0xda3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    119b <main+0x7b>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x30,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x20(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x600000005,%rax
mov    %rax,0x10(%rsp)
mov    $0x3,%r14d
mov    $0x5,%r15d
mov    $0x9,%ebp
lea    0xea1(%rip),%r12
lea    0xeaa(%rip),%rbx
jmp    1228 <main+0x108>
nopl   0x0(%rax,%rax,1)
movslq %r15d,%rax
add    $0xffffffff,%r15d
mov    (%rsp,%rax,4),%eax
mov    %eax,(%rsp,%rbp,4)
mov    (%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xffffffffffffffff,%rbp
jae    125b <main+0x13b>
test   %r14d,%r14d
js     1180 <main+0x60>
mov    %r14d,%eax
mov    (%r12,%rax,4),%eax
movslq %r15d,%rcx
mov    (%rsp,%rcx,4),%ecx
cmp    %ecx,%eax
jle    1250 <main+0x130>
add    $0xffffffff,%r14d
jmp    118a <main+0x6a>
nopl   0x0(%rax,%rax,1)
add    $0xffffffff,%r15d
mov    %ecx,%eax
jmp    118a <main+0x6a>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@__const.main.a4 = [4 x i32] [i32 6, i32 7, i32 8, i32 9]
@.str = [4 x i8] c"%d \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x i32]
%4 = bitcast [10 x i32]* %3 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 4
%6 = bitcast i32* %5 to i8*
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 1
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 2
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 3
%11 = bitcast [10 x i32]* %3 to <4 x i32>*
store <4 x i32> <i32 1, i32 2, i32 3, i32 4>, <4 x i32>* %11
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 4
store i32 5, i32* %12
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 5
store i32 6, i32* %13
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 6
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 7
%16 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 8
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 9
br label %18
18: ; preds = %2, %40
%19 = phi i64 [ 9, %2 ], [ %65, %40 ]
%20 = phi i32 [ 5, %2 ], [ %43, %40 ]
%21 = phi i32 [ 3, %2 ], [ %42, %40 ]
%22 = icmp sgt i32 %21, -1
br i1 %22, label %23, label %35
23: ; preds = %18
%24 = zext i32 %21 to i64
%25 = getelementptr inbounds [4 x i32], [4 x i32]* @__const.main.a4, i64 0, i64 %24
%26 = load i32, i32* %25
%27 = sext i32 %20 to i64
%28 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %27
%29 = load i32, i32* %28
%30 = icmp sgt i32 %26, %29
br i1 %30, label %31, label %33
31: ; preds = %23
%32 = add nsw i32 %21, -1
br label %40
33: ; preds = %23
%34 = add nsw i32 %20, -1
br label %40
35: ; preds = %18
%36 = add nsw i32 %20, -1
%37 = sext i32 %20 to i64
%38 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %37
%39 = load i32, i32* %38
br label %40
40: ; preds = %31, %33, %35
%41 = phi i32 [ %26, %31 ], [ %29, %33 ], [ %39, %35 ]
%42 = phi i32 [ %32, %31 ], [ %21, %33 ], [ %21, %35 ]
%43 = phi i32 [ %20, %31 ], [ %34, %33 ], [ %36, %35 ]
%44 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %19
store i32 %41, i32* %44
%45 = load i32, i32* %7
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %45)
%47 = load i32, i32* %8
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %47)
%49 = load i32, i32* %9
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %49)
%51 = load i32, i32* %10
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %51)
%53 = load i32, i32* %12
%54 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %53)
%55 = load i32, i32* %13
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %55)
%57 = load i32, i32* %14
%58 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %57)
%59 = load i32, i32* %15
%60 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %59)
%61 = load i32, i32* %16
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %61)
%63 = load i32, i32* %17
%64 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %63)
%65 = add nsw i64 %19, -1
%66 = tail call i32 @putchar(i32 10)
%67 = icmp eq i64 %19, 0
br i1 %67, label %68, label %18
68: ; preds = %40
ret i32 0
}