#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__ isnan(float);
int replaceable_bad_flags_(float *bad1, float *bad2) {
  if (isnan(*bad1) || isnan(*bad2))
    return 1;
  else if (*bad1 != *bad2)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<replaceable_bad_flags_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <isnan@plt>
cmp    $0x0,%rax
jne    114e <replaceable_bad_flags_+0x3e>
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <isnan@plt>
cmp    $0x0,%rax
je     115a <replaceable_bad_flags_+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    118d <replaceable_bad_flags_+0x7d>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomiss (%rax),%xmm0
jne    117a <replaceable_bad_flags_+0x6a>
jp     117a <replaceable_bad_flags_+0x6a>
jmp    1186 <replaceable_bad_flags_+0x76>
movl   $0x1,-0x4(%rbp)
jmp    118d <replaceable_bad_flags_+0x7d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replaceable_bad_flags_>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
movss  (%rdi),%xmm0
call   1030 <isnan@plt>
mov    $0x1,%ebp
test   %rax,%rax
jne    114d <replaceable_bad_flags_+0x3d>
movss  (%r14),%xmm0
call   1030 <isnan@plt>
test   %rax,%rax
jne    114d <replaceable_bad_flags_+0x3d>
movss  (%r14),%xmm0
cmpneqss (%rbx),%xmm0
movd   %xmm0,%ebp
and    $0x1,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @replaceable_bad_flags_(float* %0, float* %1) {
%3 = alloca i32
%4 = alloca float*
%5 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
%6 = load float*, float** %4
%7 = load float, float* %6
%8 = call i64 @isnan(float %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %2
%11 = load float*, float** %5
%12 = load float, float* %11
%13 = call i64 @isnan(float %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %10, %2
store i32 1, i32* %3
br label %24
16: ; preds = %10
%17 = load float*, float** %4
%18 = load float, float* %17
%19 = load float*, float** %5
%20 = load float, float* %19
%21 = fcmp une float %18, %20
br i1 %21, label %22, label %23
22: ; preds = %16
store i32 1, i32* %3
br label %24
23: ; preds = %16
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %15
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @replaceable_bad_flags_(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = tail call i64 @isnan(float %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %2
%7 = load float, float* %1
%8 = tail call i64 @isnan(float %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load float, float* %0
%12 = load float, float* %1
%13 = fcmp une float %11, %12
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %10, %2, %6
%16 = phi i32 [ 1, %6 ], [ 1, %2 ], [ %14, %10 ]
ret i32 %16
}