int main() {
  printf(EstaOrdemCrescente((int[]){-1, 2, 3, 4, 5}, 5)
             ? "Esta em ordem crescente\n"
             : "Nao esta em ordem crescente\n");
  printf(EstaOrdemCrescente((int[]){-1, 2, 0, 4, 5}, 5)
             ? "Esta em ordem crescente\n"
             : "Nao esta em ordem crescente\n");
  printf(EstaOrdemCrescente((int[]){1}, 0) ? "Esta em ordem crescente\n"
                                           : "Nao esta em ordem crescente\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x2f01(%rip),%rax
mov    %rax,-0x14(%rbp)
mov    0x2efe(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0x2efc(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x14(%rbp),%rdi
mov    $0x5,%esi
mov    $0x0,%al
call   1040 <EstaOrdemCrescente@plt>
mov    %eax,%ecx
lea    0xeb9(%rip),%rdi
lea    0xe99(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2ec8(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0x2ec5(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2ec3(%rip),%eax
mov    %eax,-0x18(%rbp)
lea    -0x28(%rbp),%rdi
mov    $0x5,%esi
mov    $0x0,%al
call   1040 <EstaOrdemCrescente@plt>
mov    %eax,%ecx
lea    0xe6c(%rip),%rdi
lea    0xe4c(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x2c(%rbp)
lea    -0x2c(%rbp),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <EstaOrdemCrescente@plt>
mov    %eax,%ecx
lea    0xe3a(%rip),%rdi
lea    0xe1a(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    0xee3(%rip),%eax
mov    %eax,0x40(%rsp)
movups 0xec8(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
lea    0x30(%rsp),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <EstaOrdemCrescente@plt>
test   %eax,%eax
lea    0xeea(%rip),%r14
lea    0xeca(%rip),%rbx
mov    %rbx,%rdi
cmove  %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movups 0xea1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
mov    0xea6(%rip),%eax
mov    %eax,0x20(%rsp)
lea    0x10(%rsp),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <EstaOrdemCrescente@plt>
test   %eax,%eax
mov    %rbx,%rdi
cmove  %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0x1,0xc(%rsp)
lea    0xc(%rsp),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <EstaOrdemCrescente@plt>
test   %eax,%eax
cmove  %r14,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@constinit = private global [5 x i32] [i32 -1, i32 2, i32 3, i32 4, i32 5]
@.str = [25 x i8] c"Esta em ordem crescente\0A\00"
@.str.1 = [29 x i8] c"Nao esta em ordem crescente\0A\00"
@constinit.2 = private global [5 x i32] [i32 -1, i32 2, i32 0, i32 4, i32 5]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = alloca [5 x i32]
%3 = alloca [1 x i32]
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%5 = bitcast [5 x i32]* %1 to i8*
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%7 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @EstaOrdemCrescente to i32 (i32*, i32, ...)*)(i32* %6, i32 5)
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0)
%11 = call i32 (i8*, ...) @printf(i8* %10)
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%13 = bitcast [5 x i32]* %2 to i8*
%14 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%15 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @EstaOrdemCrescente to i32 (i32*, i32, ...)*)(i32* %14, i32 5)
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i64
%18 = select i1 %16, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0)
%19 = call i32 (i8*, ...) @printf(i8* %18)
%20 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
store i32 1, i32* %20
%21 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
%22 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @EstaOrdemCrescente to i32 (i32*, i32, ...)*)(i32* %21, i32 0)
%23 = icmp ne i32 %22, 0
%24 = zext i1 %23 to i64
%25 = select i1 %23, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0)
%26 = call i32 (i8*, ...) @printf(i8* %25)
ret i32 0
}

LLVM IR (-O2):
@constinit = [5 x i32] [i32 -1, i32 2, i32 3, i32 4, i32 5]
@.str = [25 x i8] c"Esta em ordem crescente\0A\00"
@.str.1 = [29 x i8] c"Nao esta em ordem crescente\0A\00"
@constinit.2 = [5 x i32] [i32 -1, i32 2, i32 0, i32 4, i32 5]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = alloca [5 x i32]
%3 = alloca [1 x i32]
%4 = bitcast [5 x i32]* %1 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%6 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @EstaOrdemCrescente to i32 (i32*, i32, ...)*)(i32* %5, i32 5)
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %8)
%10 = bitcast [5 x i32]* %2 to i8*
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%12 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @EstaOrdemCrescente to i32 (i32*, i32, ...)*)(i32* %11, i32 5)
%13 = icmp eq i32 %12, 0
%14 = select i1 %13, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %14)
%16 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
store i32 1, i32* %16
%17 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @EstaOrdemCrescente to i32 (i32*, i32, ...)*)(i32* %16, i32 0)
%18 = icmp eq i32 %17, 0
%19 = select i1 %18, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %19)
ret i32 0
}