#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*/ checkSort(int *, int);
int /*<<< orphan*/ genRand(int *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ xSort(int *, int);
int main() {
  int a[100000], i;
  genRand(a, 100000);
  xSort(a, 100000);
  if (!checkSort(a, 100000))
    printf("\nNon - descendingly sorted.");
  else
    printf("\nNot non - descendingly sorted.");
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x61aa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x61a90(%rbp),%rdi
mov    $0x186a0,%esi
call   1030 <genRand@plt>
lea    -0x61a90(%rbp),%rdi
mov    $0x186a0,%esi
call   1060 <xSort@plt>
lea    -0x61a90(%rbp),%rdi
mov    $0x186a0,%esi
call   1050 <checkSort@plt>
cmp    $0x0,%eax
jne    119f <main+0x5f>
lea    0xe6b(%rip),%rdi
call   1040 <printf@plt>
jmp    11ab <main+0x6b>
lea    0xe76(%rip),%rdi
call   1040 <printf@plt>
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x61aa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x61a80,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x186a0,%esi
call   1040 <genRand@plt>
mov    %rbx,%rdi
mov    $0x186a0,%esi
call   1070 <xSort@plt>
mov    %rbx,%rdi
mov    $0x186a0,%esi
call   1060 <checkSort@plt>
test   %eax,%eax
lea    0xe75(%rip),%rax
lea    0xe8a(%rip),%rdi
cmove  %rax,%rdi
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x61a80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"\0ANon - descendingly sorted.\00"
@.str.1 = [32 x i8] c"\0ANot non - descendingly sorted.\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100000 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [100000 x i32], [100000 x i32]* %2, i64 0, i64 0
%5 = call i32 @genRand(i32* %4, i32 100000)
%6 = getelementptr inbounds [100000 x i32], [100000 x i32]* %2, i64 0, i64 0
%7 = call i32 @xSort(i32* %6, i32 100000)
%8 = getelementptr inbounds [100000 x i32], [100000 x i32]* %2, i64 0, i64 0
%9 = call i32 @checkSort(i32* %8, i32 100000)
%10 = icmp ne i32 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %15
13: ; preds = %0
%14 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
%16 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"\0ANon - descendingly sorted.\00"
@.str.1 = [32 x i8] c"\0ANot non - descendingly sorted.\00"
define i32 @main() {
%1 = alloca [100000 x i32]
%2 = bitcast [100000 x i32]* %1 to i8*
%3 = getelementptr inbounds [100000 x i32], [100000 x i32]* %1, i64 0, i64 0
%4 = call i32 @genRand(i32* %3, i32 100000)
%5 = call i32 @xSort(i32* %3, i32 100000)
%6 = call i32 @checkSort(i32* %3, i32 100000)
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0)
%9 = call i32 @printf(i8* dereferenceable(1) %8)
%10 = call i32 @putchar(i32 10)
ret i32 0
}