#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 */
scalar_t__ fabs(double);
scalar_t__ fmin(double, double);
char canFinish(double *pre, double *rank, int length) {
  int i;
  for (i = 0; i < length; i++) {
    if (fabs(pre[i] - rank[i]) > fmin(1.0 / length / 100, 0.0000001)) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<canFinish>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11bf <canFinish+0x9f>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
call   1030 <fabs@plt>
mov    %rax,-0x28(%rbp)
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xe9a(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  0xe86(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe72(%rip),%xmm1
call   1040 <fmin@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
jle    11ac <canFinish+0x8c>
movb   $0x0,-0x1(%rbp)
jmp    11c3 <canFinish+0xa3>
jmp    11b1 <canFinish+0x91>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    113a <canFinish+0x1a>
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<canFinish>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x1,%r14b
test   %edx,%edx
jle    1199 <canFinish+0x79>
mov    %rsi,%r15
mov    %rdi,%r12
cvtsi2sd %edx,%xmm0
movsd  0xebc(%rip),%xmm1
divsd  %xmm0,%xmm1
divsd  0xeb8(%rip),%xmm1
movsd  %xmm1,(%rsp)
mov    %edx,%r13d
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
movsd  (%r12,%rbp,8),%xmm0
subsd  (%r15,%rbp,8),%xmm0
call   1030 <fabs@plt>
mov    %rax,%rbx
movsd  (%rsp),%xmm0
movsd  0xe8f(%rip),%xmm1
call   1040 <fmin@plt>
cmp    %rax,%rbx
jg     1196 <canFinish+0x76>
add    $0x1,%rbp
cmp    %rbp,%r13
jne    1160 <canFinish+0x40>
jmp    1199 <canFinish+0x79>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @canFinish(double* %0, double* %1, i32 %2) {
%4 = alloca i8
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32
store double* %0, double** %5
store double* %1, double** %6
store i32 %2, i32* %7
store i32 0, i32* %8
br label %9
9: ; preds = %34, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %7
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %37
13: ; preds = %9
%14 = load double*, double** %5
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %14, i64 %16
%18 = load double, double* %17
%19 = load double*, double** %6
%20 = load i32, i32* %8
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds double, double* %19, i64 %21
%23 = load double, double* %22
%24 = fsub double %18, %23
%25 = call i64 @fabs(double %24)
%26 = load i32, i32* %7
%27 = sitofp i32 %26 to double
%28 = fdiv double 1.000000e+00, %27
%29 = fdiv double %28, 1.000000e+02
%30 = call i64 @fmin(double %29, double 0x3E7AD7F29ABCAF48)
%31 = icmp sgt i64 %25, %30
br i1 %31, label %32, label %33
32: ; preds = %13
store i8 0, i8* %4
br label %38
33: ; preds = %13
br label %34
34: ; preds = %33
%35 = load i32, i32* %8
%36 = add nsw i32 %35, 1
store i32 %36, i32* %8
br label %9
37: ; preds = %9
store i8 1, i8* %4
br label %38
38: ; preds = %37, %32
%39 = load i8, i8* %4
ret i8 %39
}

LLVM IR (-O2):
define signext i8 @canFinish(double* nocapture %0, double* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %23
5: ; preds = %3
%6 = sitofp i32 %2 to double
%7 = fdiv double 1.000000e+00, %6
%8 = fdiv double %7, 1.000000e+02
%9 = zext i32 %2 to i64
br label %12
10: ; preds = %12
%11 = icmp eq i64 %22, %9
br i1 %11, label %23, label %12
12: ; preds = %5, %10
%13 = phi i64 [ 0, %5 ], [ %22, %10 ]
%14 = getelementptr inbounds double, double* %0, i64 %13
%15 = load double, double* %14
%16 = getelementptr inbounds double, double* %1, i64 %13
%17 = load double, double* %16
%18 = fsub double %15, %17
%19 = tail call i64 @fabs(double %18)
%20 = tail call i64 @fmin(double %8, double 0x3E7AD7F29ABCAF48)
%21 = icmp sgt i64 %19, %20
%22 = add nuw nsw i64 %13, 1
br i1 %21, label %23, label %10
23: ; preds = %12, %10, %3
%24 = phi i8 [ 1, %3 ], [ 1, %10 ], [ 0, %12 ]
ret i8 %24
}