#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 test_min_prty(double *data, int N) {
  int i;
  double min = data[0];
  for (i = 1; i < N; i++)
    if (data[i] < min) {
      printf("Min propery violated\n");
      break;
    }
}


x86 assembly (clang, -O0):
<test_min_prty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    117f <test_min_prty+0x6f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    116c <test_min_prty+0x5c>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
jmp    117f <test_min_prty+0x6f>
jmp    1171 <test_min_prty+0x61>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1133 <test_min_prty+0x23>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_min_prty>:
cmp    $0x2,%esi
jl     1130 <test_min_prty+0x20>
movsd  (%rdi),%xmm0
mov    %esi,%eax
mov    $0x1,%ecx
ucomisd (%rdi,%rcx,8),%xmm0
ja     1131 <test_min_prty+0x21>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1120 <test_min_prty+0x10>
ret
lea    0xec8(%rip),%rdi
jmp    1030 <puts@plt>

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

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