#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__ stdlib_base_is_nan(double const);
double stdlib_base_kronecker_delta(const double i, const double j) {
  if (stdlib_base_is_nan(i) || stdlib_base_is_nan(j)) {
    return 0.0 / 0.0;
  }
  if (i == j) {
    return 1.0;
  }
  return 0.0;
}


x86 assembly (clang, -O0):
<stdlib_base_kronecker_delta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <stdlib_base_is_nan@plt>
cmp    $0x0,%rax
jne    114a <stdlib_base_kronecker_delta+0x3a>
movsd  -0x18(%rbp),%xmm0
call   1030 <stdlib_base_is_nan@plt>
cmp    $0x0,%rax
je     115c <stdlib_base_kronecker_delta+0x4c>
movsd  0xeb6(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    118c <stdlib_base_kronecker_delta+0x7c>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    1184 <stdlib_base_kronecker_delta+0x74>
jp     1184 <stdlib_base_kronecker_delta+0x74>
movsd  0xe86(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    118c <stdlib_base_kronecker_delta+0x7c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_base_kronecker_delta>:
sub    $0x28,%rsp
movsd  %xmm1,0x8(%rsp)
movaps %xmm0,0x10(%rsp)
call   1030 <stdlib_base_is_nan@plt>
movsd  0xed4(%rip),%xmm0
test   %rax,%rax
je     1136 <stdlib_base_kronecker_delta+0x26>
add    $0x28,%rsp
ret
movsd  0x8(%rsp),%xmm0
call   1030 <stdlib_base_is_nan@plt>
movsd  0xeb7(%rip),%xmm0
test   %rax,%rax
jne    1131 <stdlib_base_kronecker_delta+0x21>
movapd 0x10(%rsp),%xmm1
cmpeqsd 0x8(%rsp),%xmm1
movsd  0xea5(%rip),%xmm0
andpd  %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @stdlib_base_kronecker_delta(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = call i64 @stdlib_base_is_nan(double %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %2
%10 = load double, double* %5
%11 = call i64 @stdlib_base_is_nan(double %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9, %2
store double 0x7FF8000000000000, double* %3
br label %20
14: ; preds = %9
%15 = load double, double* %4
%16 = load double, double* %5
%17 = fcmp oeq double %15, %16
br i1 %17, label %18, label %19
18: ; preds = %14
store double 1.000000e+00, double* %3
br label %20
19: ; preds = %14
store double 0.000000e+00, double* %3
br label %20
20: ; preds = %19, %18, %13
%21 = load double, double* %3
ret double %21
}

LLVM IR (-O2):
define double @stdlib_base_kronecker_delta(double %0, double %1) {
%3 = tail call i64 @stdlib_base_is_nan(double %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = tail call i64 @stdlib_base_is_nan(double %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = fcmp oeq double %0, %1
%10 = select i1 %9, double 1.000000e+00, double 0.000000e+00
br label %11
11: ; preds = %8, %2, %5
%12 = phi double [ 0x7FF8000000000000, %5 ], [ 0x7FF8000000000000, %2 ], [ %10, %8 ]
ret double %12
}