#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, double, double);
int check_results_priv(double *A, double *B) {
  for (int i = 0; i < (992); i++) {
    if (A[i] != (1) * 3) {
      printf("Error at A[%d], h = %lf, d = %lf\n", i, (double)(1) * 2, A[i]);
      return 0;
    }
    if (B[i] != (1) * 7) {
      printf("Error at B[%d], h = %lf, d = %lf\n", i, (double)(1) * 3, B[i]);
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<check_results_priv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3e0,-0x1c(%rbp)
jge    11fb <check_results_priv+0xeb>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xeb7(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    115e <check_results_priv+0x4e>
jp     115e <check_results_priv+0x4e>
jmp    118e <check_results_priv+0x7e>
mov    -0x1c(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
lea    0xea3(%rip),%rdi
movsd  0xe93(%rip),%xmm0
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1202 <check_results_priv+0xf2>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xe65(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11b8 <check_results_priv+0xa8>
jp     11b8 <check_results_priv+0xa8>
jmp    11e8 <check_results_priv+0xd8>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
lea    0xe6b(%rip),%rdi
movsd  0xe29(%rip),%xmm0
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1202 <check_results_priv+0xf2>
jmp    11ed <check_results_priv+0xdd>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1127 <check_results_priv+0x17>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_results_priv>:
push   %rax
mov    %rsi,%rax
mov    $0x1,%esi
movsd  0xedf(%rip),%xmm0
movsd  0xedf(%rip),%xmm2
nopl   0x0(%rax)
movsd  -0x8(%rdi,%rsi,8),%xmm1
ucomisd %xmm0,%xmm1
jne    117a <check_results_priv+0x6a>
jp     117a <check_results_priv+0x6a>
movsd  -0x8(%rax,%rsi,8),%xmm1
ucomisd %xmm2,%xmm1
jne    118f <check_results_priv+0x7f>
jp     118f <check_results_priv+0x7f>
movsd  (%rdi,%rsi,8),%xmm1
ucomisd %xmm0,%xmm1
jne    117e <check_results_priv+0x6e>
jp     117e <check_results_priv+0x6e>
movsd  (%rax,%rsi,8),%xmm1
ucomisd %xmm2,%xmm1
jne    1193 <check_results_priv+0x83>
jp     1193 <check_results_priv+0x83>
add    $0x2,%rsi
cmp    $0x3e1,%rsi
jne    1130 <check_results_priv+0x20>
mov    $0x1,%eax
pop    %rcx
ret
add    $0xffffffffffffffff,%rsi
lea    0xe93(%rip),%rdi
movsd  0xe83(%rip),%xmm0
jmp    11a2 <check_results_priv+0x92>
add    $0xffffffffffffffff,%rsi
lea    0xea0(%rip),%rdi
movsd  0xe5e(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Error at A[%d], h = %lf, d = %lf\0A\00"
@.str.1 = [34 x i8] c"Error at B[%d], h = %lf, d = %lf\0A\00"
define i32 @check_results_priv(double* %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 0, i32* %6
br label %7
7: ; preds = %41, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 992
br i1 %9, label %10, label %44
10: ; preds = %7
%11 = load double*, double** %4
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
%15 = load double, double* %14
%16 = fcmp une double %15, 3.000000e+00
br i1 %16, label %17, label %25
17: ; preds = %10
%18 = load i32, i32* %6
%19 = load double*, double** %4
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds double, double* %19, i64 %21
%23 = load double, double* %22
%24 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %18, double 2.000000e+00, double %23)
store i32 0, i32* %3
br label %45
25: ; preds = %10
%26 = load double*, double** %5
%27 = load i32, i32* %6
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds double, double* %26, i64 %28
%30 = load double, double* %29
%31 = fcmp une double %30, 7.000000e+00
br i1 %31, label %32, label %40
32: ; preds = %25
%33 = load i32, i32* %6
%34 = load double*, double** %5
%35 = load i32, i32* %6
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds double, double* %34, i64 %36
%38 = load double, double* %37
%39 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %33, double 3.000000e+00, double %38)
store i32 0, i32* %3
br label %45
40: ; preds = %25
br label %41
41: ; preds = %40
%42 = load i32, i32* %6
%43 = add nsw i32 %42, 1
store i32 %43, i32* %6
br label %7
44: ; preds = %7
store i32 1, i32* %3
br label %45
45: ; preds = %44, %32, %17
%46 = load i32, i32* %3
ret i32 %46
}

LLVM IR (-O2):
@.str = [34 x i8] c"Error at A[%d], h = %lf, d = %lf\0A\00"
@.str.1 = [34 x i8] c"Error at B[%d], h = %lf, d = %lf\0A\00"
define i32 @check_results_priv(double* nocapture %0, double* nocapture %1) {
br label %3
3: ; preds = %31, %2
%4 = phi i64 [ 0, %2 ], [ %32, %31 ]
%5 = getelementptr inbounds double, double* %0, i64 %4
%6 = load double, double* %5
%7 = fcmp une double %6, 3.000000e+00
br i1 %7, label %8, label %13
8: ; preds = %22, %3
%9 = phi i64 [ %4, %3 ], [ %23, %22 ]
%10 = phi double [ %6, %3 ], [ %25, %22 ]
%11 = trunc i64 %9 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %11, double 2.000000e+00, double %10)
br label %34
13: ; preds = %3
%14 = getelementptr inbounds double, double* %1, i64 %4
%15 = load double, double* %14
%16 = fcmp une double %15, 7.000000e+00
br i1 %16, label %17, label %22
17: ; preds = %27, %13
%18 = phi double [ %15, %13 ], [ %29, %27 ]
%19 = phi i64 [ %4, %13 ], [ %23, %27 ]
%20 = trunc i64 %19 to i32
%21 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %20, double 3.000000e+00, double %18)
br label %34
22: ; preds = %13
%23 = or i64 %4, 1
%24 = getelementptr inbounds double, double* %0, i64 %23
%25 = load double, double* %24
%26 = fcmp une double %25, 3.000000e+00
br i1 %26, label %8, label %27
27: ; preds = %22
%28 = getelementptr inbounds double, double* %1, i64 %23
%29 = load double, double* %28
%30 = fcmp une double %29, 7.000000e+00
br i1 %30, label %17, label %31
31: ; preds = %27
%32 = add nuw nsw i64 %4, 2
%33 = icmp eq i64 %32, 992
br i1 %33, label %34, label %3
34: ; preds = %31, %17, %8
%35 = phi i32 [ 0, %17 ], [ 0, %8 ], [ 1, %31 ]
ret i32 %35
}