#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*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ isnan(float);
int /*<<< orphan*/ printf(char *, char *);
void vectorCheckValid(float *vxptr, float *vyptr, char *text) {
  if (!vxptr || !vyptr || isnan(*vxptr) || isnan(*vyptr)) {
    printf("ERR: %s\n", text);
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<vectorCheckValid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1188 <vectorCheckValid+0x58>
cmpq   $0x0,-0x10(%rbp)
je     1188 <vectorCheckValid+0x58>
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
call   1040 <isnan@plt>
cmp    $0x0,%rax
jne    1188 <vectorCheckValid+0x58>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
call   1040 <isnan@plt>
cmp    $0x0,%rax
je     11a6 <vectorCheckValid+0x76>
mov    -0x18(%rbp),%rsi
lea    0xe6d(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e41(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vectorCheckValid>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
test   %rdi,%rdi
je     1168 <vectorCheckValid+0x38>
mov    %rsi,%rbx
test   %rsi,%rsi
je     1168 <vectorCheckValid+0x38>
movss  (%rdi),%xmm0
call   1040 <isnan@plt>
test   %rax,%rax
jne    1168 <vectorCheckValid+0x38>
movss  (%rbx),%xmm0
call   1040 <isnan@plt>
test   %rax,%rax
jne    1168 <vectorCheckValid+0x38>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe91(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"ERR: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @vectorCheckValid(float* %0, float* %1, i8* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca i8*
store float* %0, float** %4
store float* %1, float** %5
store i8* %2, i8** %6
%7 = load float*, float** %4
%8 = icmp ne float* %7, null
br i1 %8, label %9, label %22
9: ; preds = %3
%10 = load float*, float** %5
%11 = icmp ne float* %10, null
br i1 %11, label %12, label %22
12: ; preds = %9
%13 = load float*, float** %4
%14 = load float, float* %13
%15 = call i64 @isnan(float %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %22, label %17
17: ; preds = %12
%18 = load float*, float** %5
%19 = load float, float* %18
%20 = call i64 @isnan(float %19)
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %27
22: ; preds = %17, %12, %9, %3
%23 = load i8*, i8** %6
%24 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %23)
%25 = load i32, i32* @EXIT_FAILURE
%26 = call i32 @exit(i32 %25)
unreachable
27: ; preds = %17
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"ERR: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @vectorCheckValid(float* %0, float* %1, i8* %2) {
%4 = icmp ne float* %0, null
%5 = icmp ne float* %1, null
%6 = and i1 %4, %5
br i1 %6, label %7, label %15
7: ; preds = %3
%8 = load float, float* %0
%9 = tail call i64 @isnan(float %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load float, float* %1
%13 = tail call i64 @isnan(float %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %19, label %15
15: ; preds = %11, %7, %3
%16 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %2)
%17 = load i32, i32* @EXIT_FAILURE
%18 = tail call i32 @exit(i32 %17)
unreachable
19: ; preds = %11
ret void
}