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

/* Variables and functions */
int /*<<< orphan*/ mpfr_fprintf(int /*<<< orphan*/ *, char *, char *,
                                char const *);
scalar_t__ mpfr_inf_p(char *);
scalar_t__ mpfr_signbit(char *);
void print_fp(FILE *fout, mpfr_t f, const char *suffix) {
  if (mpfr_inf_p(f))
    mpfr_fprintf(fout, "\t%sINF%s", mpfr_signbit(f) ? "-" : "", suffix);
  else
    mpfr_fprintf(fout, "\t%Ra%s", f, suffix);
}


x86 assembly (clang, -O0):
<print_fp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <mpfr_inf_p@plt>
cmp    $0x0,%rax
je     119a <print_fp+0x6a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <mpfr_signbit@plt>
mov    -0x20(%rbp),%rdi
mov    %rax,%rcx
lea    0xe94(%rip),%rdx
lea    0xe8c(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdx
mov    -0x18(%rbp),%rcx
lea    0xe70(%rip),%rsi
call   1040 <mpfr_fprintf@plt>
jmp    11b2 <print_fp+0x82>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xe5e(%rip),%rsi
call   1040 <mpfr_fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_fp>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
call   1030 <mpfr_inf_p@plt>
test   %rax,%rax
je     1174 <print_fp+0x44>
mov    %rbx,%rdi
call   1050 <mpfr_signbit@plt>
test   %rax,%rax
lea    0xead(%rip),%rax
lea    0xea5(%rip),%rdx
cmove  %rax,%rdx
lea    0xe91(%rip),%rsi
mov    %r15,%rdi
jmp    1181 <print_fp+0x51>
lea    0xe90(%rip),%rsi
mov    %r15,%rdi
mov    %rbx,%rdx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <mpfr_fprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\09%sINF%s\00"
@.str.1 = [2 x i8] c"-\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [7 x i8] c"\09%Ra%s\00"
define void @print_fp(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = call i64 @mpfr_inf_p(i8* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %19
10: ; preds = %3
%11 = load i32*, i32** %4
%12 = load i8*, i8** %5
%13 = call i64 @mpfr_signbit(i8* %12)
%14 = icmp ne i64 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%17 = load i8*, i8** %6
%18 = call i32 @mpfr_fprintf(i32* %11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %16, i8* %17)
br label %24
19: ; preds = %3
%20 = load i32*, i32** %4
%21 = load i8*, i8** %5
%22 = load i8*, i8** %6
%23 = call i32 @mpfr_fprintf(i32* %20, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %21, i8* %22)
br label %24
24: ; preds = %19, %10
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\09%sINF%s\00"
@.str.1 = [2 x i8] c"-\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [7 x i8] c"\09%Ra%s\00"
define void @print_fp(i32* %0, i8* %1, i8* %2) {
%4 = tail call i64 @mpfr_inf_p(i8* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = tail call i64 @mpfr_signbit(i8* %1)
%8 = icmp eq i64 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%10 = tail call i32 @mpfr_fprintf(i32* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %2)
br label %13
11: ; preds = %3
%12 = tail call i32 @mpfr_fprintf(i32* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %1, i8* %2)
br label %13
13: ; preds = %11, %6
ret void
}