#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*/ mpfr_t;

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


x86 assembly (clang, -O0):
<print_fp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <mpfr_inf_p@plt>
cmp    $0x0,%rax
je     118d <print_fp+0x5d>
mov    -0x4(%rbp),%edi
call   1040 <mpfr_signbit@plt>
mov    %rax,%rcx
lea    0xea8(%rip),%rsi
lea    0xea0(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
mov    -0x18(%rbp),%rdx
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1050 <mpfr_printf@plt>
jmp    11a7 <print_fp+0x77>
movslq -0x4(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1050 <mpfr_printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_fp>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %edi,%ebp
call   1030 <mpfr_inf_p@plt>
test   %rax,%rax
je     1177 <print_fp+0x47>
mov    %ebp,%edi
call   1040 <mpfr_signbit@plt>
test   %rax,%rax
lea    0xeb8(%rip),%rax
lea    0xeb0(%rip),%rsi
cmove  %rax,%rsi
lea    0xe97(%rip),%rdi
mov    %rbx,%rdx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <mpfr_printf@plt>
movslq %ebp,%rsi
lea    0xe8f(%rip),%rdi
mov    %r14,%rdx
mov    %rbx,%rcx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <mpfr_printf@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"\09%sINFINITY%s\00"
@.str.1 = [2 x i8] c"-\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [9 x i8] c"\09%Ra%s%s\00"
define void @print_fp(i32 %0, i8* %1, i8* %2) {
%4 = tail call i64 @mpfr_inf_p(i32 %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = tail call i64 @mpfr_signbit(i32 %0)
%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 (i8*, i8*, i8*, ...) @mpfr_printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %2)
br label %15
11: ; preds = %3
%12 = sext i32 %0 to i64
%13 = inttoptr i64 %12 to i8*
%14 = tail call i32 (i8*, i8*, i8*, ...) @mpfr_printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %13, i8* %1, i8* %2)
br label %15
15: ; preds = %11, %6
ret void
}