#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__ any_NaN(double *, int, int);
scalar_t__ any_negative(double *, int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ write_data_double(char *, int, int, double *);
void print_debug_NaN_negative(double *A, int n, int L, char *name) {
  printf("%s\n", name);
  write_data_double(name, n, L, A);
  if (any_NaN(A, n, L) || any_negative(A, n, L))
    exit(1);
}


x86 assembly (clang, -O0):
<print_debug_NaN_negative>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rcx
call   1050 <write_data_double@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1070 <any_NaN@plt>
cmp    $0x0,%rax
jne    11bb <print_debug_NaN_negative+0x6b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <any_negative@plt>
cmp    $0x0,%rax
je     11c5 <print_debug_NaN_negative+0x75>
mov    $0x1,%edi
call   1060 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_debug_NaN_negative>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%rbp
mov    %edx,%r14d
mov    %esi,%r15d
mov    %rdi,%rbx
lea    0xe96(%rip),%rdi
mov    %rcx,%rsi
call   1030 <printf@plt>
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %rbx,%rcx
call   1050 <write_data_double@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
call   1070 <any_NaN@plt>
test   %rax,%rax
jne    11b4 <print_debug_NaN_negative+0x64>
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
call   1040 <any_negative@plt>
test   %rax,%rax
jne    11b4 <print_debug_NaN_negative+0x64>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%edi
call   1060 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print_debug_NaN_negative(double* %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = tail call i32 @write_data_double(i8* %3, i32 %1, i32 %2, double* %0)
%7 = tail call i64 @any_NaN(double* %0, i32 %1, i32 %2)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = tail call i64 @any_negative(double* %0, i32 %1, i32 %2)
%11 = icmp eq i64 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %9, %4
%13 = tail call i32 @exit(i32 1)
unreachable
14: ; preds = %9
ret void
}