#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*/ input(int *, int);
int /*<<< orphan*/ output(int *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ swap(int *, int);
void main() {
  int array[10] = {0};
  input(array, 10);
  printf("The input number is:\n");
  output(array, 10);
  swap(array, 10);
  printf("The swaped number is:\n");
  output(array, 10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1060 <memset@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <input@plt>
lea    0xe83(%rip),%rdi
call   1050 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1040 <output@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1070 <swap@plt>
lea    0xe71(%rip),%rdi
call   1050 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1040 <output@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0x20(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <input@plt>
lea    0xe8f(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1050 <output@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1060 <swap@plt>
lea    0xe7e(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1050 <output@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"The input number is:\0A\00"
@.str.1 = [23 x i8] c"The swaped number is:\0A\00"
define void @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @input(i32* %3, i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%7 = call i32 @output(i32* %6, i32 10)
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%9 = call i32 @swap(i32* %8, i32 10)
%10 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%12 = call i32 @output(i32* %11, i32 10)
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"The input number is:\00"
@str.2 = [22 x i8] c"The swaped number is:\00"
define void @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @input(i32* %3, i32 10)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%6 = call i32 @output(i32* %3, i32 10)
%7 = call i32 @swap(i32* %3, i32 10)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.2, i64 0, i64 0))
%9 = call i32 @output(i32* %3, i32 10)
ret void
}