#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*/ fprintf(int /*<<< orphan*/, char *, double);
int /*<<< orphan*/ isfinite(double);
scalar_t__ isnan(double);
int /*<<< orphan*/ stdout;
double eval_print(double x, double y) {
  if (!isfinite(y) || isnan(y)) {
    fprintf(stdout, "<%g>\n", y);
  } else {
    fprintf(stdout, "%g\n", y);
  }
  return y;
}


x86 assembly (clang, -O0):
<eval_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <isfinite@plt>
cmp    $0x0,%eax
je     1169 <eval_print+0x39>
movsd  -0x10(%rbp),%xmm0
call   1050 <isnan@plt>
cmp    $0x0,%rax
je     1188 <eval_print+0x58>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
movsd  -0x10(%rbp),%xmm0
lea    0xe82(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11a2 <eval_print+0x72>
mov    0x2e51(%rip),%rax
mov    (%rax),%edi
movsd  -0x10(%rbp),%xmm0
lea    0xe69(%rip),%rsi
call   1030 <fprintf@plt>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_print>:
push   %rax
movaps %xmm1,%xmm0
movsd  %xmm1,(%rsp)
call   1040 <isfinite@plt>
test   %eax,%eax
je     1163 <eval_print+0x33>
movsd  (%rsp),%xmm0
call   1050 <isnan@plt>
test   %rax,%rax
lea    0xeb0(%rip),%rax
lea    0xea3(%rip),%rsi
cmove  %rax,%rsi
jmp    116a <eval_print+0x3a>
lea    0xe96(%rip),%rsi
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
movsd  (%rsp),%xmm0
call   1030 <fprintf@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [6 x i8] c"<%g>\0A\00"
@.str.1 = [4 x i8] c"%g\0A\00"
define double @eval_print(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = call i32 @isfinite(double %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load double, double* %4
%10 = call i64 @isnan(double %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %8, %2
%13 = load i32, i32* @stdout
%14 = load double, double* %4
%15 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %14)
br label %20
16: ; preds = %8
%17 = load i32, i32* @stdout
%18 = load double, double* %4
%19 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %18)
br label %20
20: ; preds = %16, %12
%21 = load double, double* %4
ret double %21
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [6 x i8] c"<%g>\0A\00"
@.str.1 = [4 x i8] c"%g\0A\00"
define double @eval_print(double %0, double returned %1) {
%3 = tail call i32 @isfinite(double %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @isnan(double %1)
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
br label %9
9: ; preds = %5, %2
%10 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %2 ], [ %8, %5 ]
%11 = load i32, i32* @stdout
%12 = tail call i32 @fprintf(i32 %11, i8* %10, double %1)
ret double %1
}