#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
scalar_t__ isfinite(double);
void rsa_print_abs_rel(FILE *output, double abs, double rel) {
  fprintf(output, "%7.2f", abs);
  if (isfinite(rel))
    fprintf(output, "%6.1f", rel);
  else
    fprintf(output, "   N/A");
}


x86 assembly (clang, -O0):
<rsa_print_abs_rel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
lea    0xeba(%rip),%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
movsd  -0x18(%rbp),%xmm0
call   1040 <isfinite@plt>
cmp    $0x0,%rax
je     117d <rsa_print_abs_rel+0x5d>
mov    -0x8(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
lea    0xe95(%rip),%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
jmp    118f <rsa_print_abs_rel+0x6f>
mov    -0x8(%rbp),%rdi
lea    0xe84(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rsa_print_abs_rel>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,0x8(%rsp)
mov    %rdi,%rbx
lea    0xebb(%rip),%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
movsd  0x8(%rsp),%xmm0
call   1040 <isfinite@plt>
test   %rax,%rax
je     1178 <rsa_print_abs_rel+0x48>
lea    0xea3(%rip),%rsi
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
add    $0x10,%rsp
pop    %rbx
jmp    1030 <fprintf@plt>
lea    0xe8d(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
add    $0x10,%rsp
pop    %rbx
jmp    1050 <fwrite@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%7.2f\00"
@.str.1 = [6 x i8] c"%6.1f\00"
@.str.2 = [7 x i8] c" N/A\00"
define void @rsa_print_abs_rel(i32* nocapture %0, double %1, double %2) {
%4 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %1)
%5 = tail call i64 @isfinite(double %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %2)
br label %11
9: ; preds = %3
%10 = tail call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i64 6, i64 1, i32* %0)
br label %11
11: ; preds = %9, %7
ret void
}