#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*/ fnPrintArray(int *, int);
int /*<<< orphan*/ fnReadArray(int *, int);
int /*<<< orphan*/ fnSortArray(int *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int iNum, iaArr[10];
  printf("\nEnter no of elements\n");
  scanf("%d", &iNum);
  fnReadArray(iaArr, iNum);
  printf("\nInput Array is:\n");
  fnPrintArray(iaArr, iNum);
  fnSortArray(iaArr, iNum);
  printf("\nSorted Array is:\n");
  fnPrintArray(iaArr, iNum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
lea    0xea5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <fnReadArray@plt>
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1060 <fnPrintArray@plt>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1070 <fnSortArray@plt>
lea    0xe7a(%rip),%rdi
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1060 <fnPrintArray@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
lea    0xea7(%rip),%rdi
call   1030 <puts@plt>
lea    0xe98(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%esi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <fnReadArray@plt>
lea    0xe8f(%rip),%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1060 <fnPrintArray@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1070 <fnSortArray@plt>
lea    0xe7c(%rip),%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1060 <fnPrintArray@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"\0AEnter no of elements\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"\0AInput Array is:\0A\00"
@.str.3 = [19 x i8] c"\0ASorted Array is:\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x i32]
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%7 = load i32, i32* %2
%8 = call i32 @fnReadArray(i32* %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%11 = load i32, i32* %2
%12 = call i32 @fnPrintArray(i32* %10, i32 %11)
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%14 = load i32, i32* %2
%15 = call i32 @fnSortArray(i32* %13, i32 %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%18 = load i32, i32* %2
%19 = call i32 @fnPrintArray(i32* %17, i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [22 x i8] c"\0AEnter no of elements\00"
@str.4 = [17 x i8] c"\0AInput Array is:\00"
@str.5 = [18 x i8] c"\0ASorted Array is:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = bitcast i32* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%8 = load i32, i32* %1
%9 = call i32 @fnReadArray(i32* %7, i32 %8)
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.4, i64 0, i64 0))
%11 = load i32, i32* %1
%12 = call i32 @fnPrintArray(i32* %7, i32 %11)
%13 = load i32, i32* %1
%14 = call i32 @fnSortArray(i32* %7, i32 %13)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.5, i64 0, i64 0))
%16 = load i32, i32* %1
%17 = call i32 @fnPrintArray(i32* %7, i32 %16)
ret i32 0
}