#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);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a[10] = {1, 3, 5, 7, 9};
  int data, pos, i;
  pos = 0;
  scanf("%d", &data);
  while (pos < 5) {
    if (a[pos] > data)
      break;
    pos++;
  }
  for (i = 4; i >= pos; i--)
    a[i + 1] = a[i];
  a[pos] = data;
  for (i = 0; i < 6; i++)
    printf("%3d", a[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movl   $0x1,-0x30(%rbp)
movl   $0x3,-0x2c(%rbp)
movl   $0x5,-0x28(%rbp)
movl   $0x7,-0x24(%rbp)
movl   $0x9,-0x20(%rbp)
movl   $0x0,-0x38(%rbp)
lea    0xe80(%rip),%rdi
lea    -0x34(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x5,-0x38(%rbp)
jge    11b7 <main+0x87>
movslq -0x38(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
cmp    -0x34(%rbp),%eax
jle    11a9 <main+0x79>
jmp    11b7 <main+0x87>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1189 <main+0x59>
movl   $0x4,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x38(%rbp),%eax
jl     11ec <main+0xbc>
movslq -0x3c(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%ecx
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
cltq
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x3c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x3c(%rbp)
jmp    11be <main+0x8e>
mov    -0x34(%rbp),%ecx
movslq -0x38(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
movl   $0x0,-0x3c(%rbp)
cmpl   $0x6,-0x3c(%rbp)
jge    122a <main+0xfa>
movslq -0x3c(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xdec(%rip),%rdi
call   1030 <printf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11fe <main+0xce>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x20(%rsp)
movaps 0xec3(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x9,0x10(%rsp)
lea    0xec0(%rip),%rdi
lea    0x2c(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2c(%rsp),%eax
mov    $0x1,%dl
test   %eax,%eax
jle    1177 <main+0x57>
cmp    $0x3,%eax
jae    1183 <main+0x63>
mov    $0x1,%ecx
xor    %esi,%esi
mov    $0x1,%bl
mov    $0x1,%dil
jmp    11b6 <main+0x96>
xor    %ecx,%ecx
mov    $0x1,%bl
mov    $0x1,%dil
mov    $0x1,%sil
jmp    11b6 <main+0x96>
cmp    $0x5,%eax
jae    1193 <main+0x73>
mov    $0x2,%ecx
xor    %edi,%edi
mov    $0x1,%bl
jmp    11b4 <main+0x94>
cmp    $0x7,%eax
jae    119f <main+0x7f>
mov    $0x3,%ecx
jmp    11b0 <main+0x90>
mov    $0x5,%ecx
cmp    $0x8,%eax
ja     11ef <main+0xcf>
mov    $0x4,%ecx
xor    %edx,%edx
xor    %ebx,%ebx
xor    %edi,%edi
xor    %esi,%esi
movl   $0x9,0x14(%rsp)
test   %dl,%dl
je     11ef <main+0xcf>
mov    0xc(%rsp),%edx
mov    %edx,0x10(%rsp)
test   %bl,%bl
je     11ef <main+0xcf>
mov    0x8(%rsp),%edx
mov    %edx,0xc(%rsp)
test   %dil,%dil
je     11ef <main+0xcf>
mov    0x4(%rsp),%edx
mov    %edx,0x8(%rsp)
test   %sil,%sil
je     11ef <main+0xcf>
mov    (%rsp),%edx
mov    %edx,0x4(%rsp)
mov    %eax,(%rsp,%rcx,4)
mov    (%rsp),%esi
lea    0xe17(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%3d\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 = bitcast i8* %6 to [10 x i32]*
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i32 0, i32 0
store i32 1, i32* %8
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i32 0, i32 1
store i32 3, i32* %9
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i32 0, i32 2
store i32 5, i32* %10
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i32 0, i32 3
store i32 7, i32* %11
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i32 0, i32 4
store i32 9, i32* %12
store i32 0, i32* %4
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
br label %14
14: ; preds = %25, %0
%15 = load i32, i32* %4
%16 = icmp slt i32 %15, 5
br i1 %16, label %17, label %28
17: ; preds = %14
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = load i32, i32* %3
%23 = icmp sgt i32 %21, %22
br i1 %23, label %24, label %25
24: ; preds = %17
br label %28
25: ; preds = %17
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %14
28: ; preds = %24, %14
store i32 4, i32* %5
br label %29
29: ; preds = %42, %28
%30 = load i32, i32* %5
%31 = load i32, i32* %4
%32 = icmp sge i32 %30, %31
br i1 %32, label %33, label %45
33: ; preds = %29
%34 = load i32, i32* %5
%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 = load i32, i32* %5
%39 = add nsw i32 %38, 1
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %40
store i32 %37, i32* %41
br label %42
42: ; preds = %33
%43 = load i32, i32* %5
%44 = add nsw i32 %43, -1
store i32 %44, i32* %5
br label %29
45: ; preds = %29
%46 = load i32, i32* %3
%47 = load i32, i32* %4
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %48
store i32 %46, i32* %49
store i32 0, i32* %5
br label %50
50: ; preds = %59, %45
%51 = load i32, i32* %5
%52 = icmp slt i32 %51, 6
br i1 %52, label %53, label %62
53: ; preds = %50
%54 = load i32, i32* %5
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %55
%57 = load i32, i32* %56
%58 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %57)
br label %59
59: ; preds = %53
%60 = load i32, i32* %5
%61 = add nsw i32 %60, 1
store i32 %61, i32* %5
br label %50
62: ; preds = %50
ret i32 0
}

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