#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 check_arr_increase(int *arr, int len) {
  int i = 0;
  for (; i < len - 1; i++) {
    if (arr[i] <= arr[i + 1])
      continue;
    else {
      printf("array isn't increase!!!\n");
      return -1;
    }
  }
  printf("array is increase!!!!\n");
  return 0;
}


x86 assembly (clang, -O0):
<check_arr_increase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1183 <check_arr_increase+0x73>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jg     115d <check_arr_increase+0x4d>
jmp    1175 <check_arr_increase+0x65>
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1196 <check_arr_increase+0x86>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1126 <check_arr_increase+0x16>
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_arr_increase>:
push   %r14
push   %rbx
push   %rax
add    $0xffffffff,%esi
xor    %r14d,%r14d
test   %esi,%esi
cmovle %r14d,%esi
mov    %rdi,%rax
lea    0xed6(%rip),%r8
lea    0xee5(%rip),%rdi
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    %rdx,%rsi
je     115d <check_arr_increase+0x4d>
mov    (%rax,%rdx,4),%ecx
lea    0x1(%rdx),%rbx
cmp    0x4(%rax,%rdx,4),%ecx
mov    %rbx,%rdx
jle    1140 <check_arr_increase+0x30>
mov    $0xffffffff,%r14d
jmp    1160 <check_arr_increase+0x50>
mov    %r8,%rdi
call   1030 <puts@plt>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [25 x i8] c"array isn't increase!!!\0A\00"
@.str.1 = [23 x i8] c"array is increase!!!!\0A\00"
define i32 @check_arr_increase(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %28, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = sub nsw i32 %9, 1
%11 = icmp slt i32 %8, %10
br i1 %11, label %12, label %31
12: ; preds = %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %18, i64 %21
%23 = load i32, i32* %22
%24 = icmp sle i32 %17, %23
br i1 %24, label %25, label %26
25: ; preds = %12
br label %28
26: ; preds = %12
%27 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %33
28: ; preds = %25
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
store i32 %30, i32* %6
br label %7
31: ; preds = %7
%32 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %33
33: ; preds = %31, %26
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
@str = [22 x i8] c"array is increase!!!!\00"
@str.2 = [24 x i8] c"array isn't increase!!!\00"
define i32 @check_arr_increase(i32* nocapture %0, i32 %1) {
%3 = add i32 %1, -1
%4 = call i32 @llvm.smax.i32(i32 %3, i32 0)
%5 = zext i32 %4 to i64
br label %6
6: ; preds = %9, %2
%7 = phi i64 [ %12, %9 ], [ 0, %2 ]
%8 = icmp eq i64 %7, %5
br i1 %8, label %16, label %9
9: ; preds = %6
%10 = getelementptr inbounds i32, i32* %0, i64 %7
%11 = load i32, i32* %10
%12 = add nuw nsw i64 %7, 1
%13 = getelementptr inbounds i32, i32* %0, i64 %12
%14 = load i32, i32* %13
%15 = icmp sgt i32 %11, %14
br i1 %15, label %16, label %6
16: ; preds = %6, %9
%17 = phi i8* [ getelementptr inbounds ([24 x i8], [24 x i8]* @str.2, i64 0, i64 0), %9 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0), %6 ]
%18 = phi i32 [ -1, %9 ], [ 0, %6 ]
%19 = tail call i32 @puts(i8* dereferenceable(1) %17)
ret i32 %18
}