#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 *);
void check_is_inc_arr(int *arr, int len) {
  int i = 0;
  for (i = 0; i < len; i++) {
    if (arr[i] < arr[i - 1]) {
      printf("check_is_inc_arr fail.\n");
      return;
    }
  }
}


x86 assembly (clang, -O0):
<check_is_inc_arr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    117e <check_is_inc_arr+0x6e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jge    116b <check_is_inc_arr+0x5b>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
jmp    117e <check_is_inc_arr+0x6e>
jmp    1170 <check_is_inc_arr+0x60>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <check_is_inc_arr+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_is_inc_arr>:
test   %esi,%esi
jle    1132 <check_is_inc_arr+0x22>
mov    %esi,%eax
mov    -0x4(%rdi),%ecx
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %ecx,%esi
mov    (%rdi,%rdx,4),%ecx
cmp    %esi,%ecx
jl     1133 <check_is_inc_arr+0x23>
add    $0x1,%rdx
cmp    %rdx,%rax
jne    1120 <check_is_inc_arr+0x10>
ret
lea    0xec6(%rip),%rdi
jmp    1030 <puts@plt>

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

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