#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 *, size_t);
void verify(int *dst, const size_t size) {
  size_t i;
  for (i = 1; i < size; i++) {
    if (dst[i - 1] > dst[i]) {
      printf("Verify failed! at %zd\n", i);
      break;
    }
  }
}


x86 assembly (clang, -O0):
<verify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1181 <verify+0x71>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jle    116b <verify+0x5b>
mov    -0x18(%rbp),%rsi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
jmp    1181 <verify+0x71>
jmp    1170 <verify+0x60>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <verify+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify>:
cmp    $0x2,%rsi
jb     1132 <verify+0x22>
mov    (%rdi),%ecx
mov    $0x1,%eax
nopl   (%rax)
mov    %ecx,%edx
mov    (%rdi,%rax,4),%ecx
cmp    %ecx,%edx
jg     1133 <verify+0x23>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1120 <verify+0x10>
ret
lea    0xec6(%rip),%rdi
mov    %rax,%rsi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [23 x i8] c"Verify failed! at %zd\0A\00"
define void @verify(i32* nocapture %0, i64 %1) {
%3 = icmp ugt i64 %1, 1
br i1 %3, label %4, label %17
4: ; preds = %2
%5 = load i32, i32* %0
br label %6
6: ; preds = %4, %14
%7 = phi i32 [ %10, %14 ], [ %5, %4 ]
%8 = phi i64 [ %15, %14 ], [ 1, %4 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp sgt i32 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %6
%13 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 %8)
br label %17
14: ; preds = %6
%15 = add nuw i64 %8, 1
%16 = icmp eq i64 %15, %1
br i1 %16, label %17, label %6
17: ; preds = %14, %2, %12
ret void
}