#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;
typedef int /*<<< orphan*/ mpfr_rnd_t;
typedef int mpfr_prec_t;
typedef int mpfr_exp_t;

/* Variables and functions */
int /*<<< orphan*/ MPFR_RNDA;
int /*<<< orphan*/ MPFR_RNDD;
int /*<<< orphan*/ MPFR_RNDF;
int /*<<< orphan*/ MPFR_RNDN;
int /*<<< orphan*/ MPFR_RNDU;
int /*<<< orphan*/ MPFR_RNDZ;
int /*<<< orphan*/ all(int /*<<< orphan*/, int /*<<< orphan*/,
                       int /*<<< orphan*/, int, int);
int /*<<< orphan*/ mpfr_clear(int /*<<< orphan*/);
int /*<<< orphan*/ mpfr_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpfr_set_d(int /*<<< orphan*/, double, int /*<<< orphan*/);
int /*<<< orphan*/ mpfr_set_inf(int /*<<< orphan*/, int);
int /*<<< orphan*/ mpfr_set_nan(int /*<<< orphan*/);
int /*<<< orphan*/ mpfr_set_prec(int /*<<< orphan*/, int);
int /*<<< orphan*/ mpfr_set_str(int /*<<< orphan*/, char *, int,
                                int /*<<< orphan*/);
int main() {
  mpfr_t op;
  mpfr_prec_t prec;
  mpfr_rnd_t r1, r2;
  mpfr_exp_t err;
  mpfr_init(op);
  prec = 40;
  r1 = MPFR_RNDD;
  r2 = MPFR_RNDU;
  err = 1;
  mpfr_set_str(op, "1.101010111001001001100e17", 2, MPFR_RNDN);
  all(op, r1, r2, err, prec);
  prec = 80;
  r1 = MPFR_RNDD;
  r2 = MPFR_RNDZ;
  err = 400;
  mpfr_set_prec(op, prec);
  mpfr_set_d(op, 1. / 3., MPFR_RNDN);
  all(op, r1, r2, err, prec);
  prec = 800;
  r1 = MPFR_RNDA;
  r2 = MPFR_RNDZ;
  err = 400;
  mpfr_set_prec(op, prec);
  mpfr_set_d(op, 12345.78 / 3., MPFR_RNDN);
  all(op, r1, r2, err, prec);
  prec = 800;
  r1 = MPFR_RNDF;
  r2 = MPFR_RNDZ;
  err = 400;
  mpfr_set_prec(op, prec);
  mpfr_set_d(op, 12345.78 / 3., MPFR_RNDN);
  all(op, r1, r2, err, prec);
  prec = 80;
  r1 = MPFR_RNDA;
  r2 = MPFR_RNDZ;
  err = 40;
  mpfr_set_prec(op, prec);
  mpfr_set_nan(op);
  all(op, r1, r2, err, prec);
  prec = 80;
  r1 = MPFR_RNDA;
  r2 = MPFR_RNDZ;
  err = 40;
  mpfr_set_prec(op, prec);
  mpfr_set_inf(op, +1);
  all(op, r1, r2, err, prec);
  prec = 80;
  r1 = MPFR_RNDA;
  r2 = MPFR_RNDZ;
  err = 40;
  mpfr_set_prec(op, prec);
  mpfr_set_inf(op, -1);
  all(op, r1, r2, err, prec);
  mpfr_clear(op);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <mpfr_init@plt>
movl   $0x28,-0xc(%rbp)
mov    0x2e2b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    0x2e0f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2e21(%rip),%rax
mov    (%rax),%ecx
lea    0xe40(%rip),%rsi
mov    $0x2,%edx
call   10a0 <mpfr_set_str@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0xc(%rbp),%r8d
call   1030 <all@plt>
movl   $0x50,-0xc(%rbp)
mov    0x2dd3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    0x2dd7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
movl   $0x190,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1070 <mpfr_set_prec@plt>
mov    -0x8(%rbp),%edi
mov    0x2dbe(%rip),%rax
mov    (%rax),%esi
movsd  0xdd4(%rip),%xmm0
call   1060 <mpfr_set_d@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0xc(%rbp),%r8d
call   1030 <all@plt>
movl   $0x320,-0xc(%rbp)
mov    0x2d5c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    0x2d78(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
movl   $0x190,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1070 <mpfr_set_prec@plt>
mov    -0x8(%rbp),%edi
mov    0x2d5f(%rip),%rax
mov    (%rax),%esi
movsd  0xd6d(%rip),%xmm0
call   1060 <mpfr_set_d@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0xc(%rbp),%r8d
call   1030 <all@plt>
movl   $0x320,-0xc(%rbp)
mov    0x2d1d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    0x2d19(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
movl   $0x190,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1070 <mpfr_set_prec@plt>
mov    -0x8(%rbp),%edi
mov    0x2d00(%rip),%rax
mov    (%rax),%esi
movsd  0xd0e(%rip),%xmm0
call   1060 <mpfr_set_d@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0xc(%rbp),%r8d
call   1030 <all@plt>
movl   $0x50,-0xc(%rbp)
mov    0x2c9e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    0x2cba(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
movl   $0x28,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1070 <mpfr_set_prec@plt>
mov    -0x8(%rbp),%edi
call   1040 <mpfr_set_nan@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0xc(%rbp),%r8d
call   1030 <all@plt>
movl   $0x50,-0xc(%rbp)
mov    0x2c50(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    0x2c6c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
movl   $0x28,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1070 <mpfr_set_prec@plt>
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
call   1090 <mpfr_set_inf@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0xc(%rbp),%r8d
call   1030 <all@plt>
movl   $0x50,-0xc(%rbp)
mov    0x2bfd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    0x2c19(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
movl   $0x28,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1070 <mpfr_set_prec@plt>
mov    -0x8(%rbp),%edi
mov    $0xffffffff,%esi
call   1090 <mpfr_set_inf@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0xc(%rbp),%r8d
call   1030 <all@plt>
mov    -0x8(%rbp),%edi
call   1080 <mpfr_clear@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
call   1050 <mpfr_init@plt>
mov    0x2e3c(%rip),%r14
mov    (%r14),%ebx
mov    0x2e22(%rip),%rax
mov    (%rax),%ebp
mov    0x2e41(%rip),%r12
mov    (%r12),%ecx
lea    0xe5e(%rip),%rsi
mov    $0x2,%edx
call   10a0 <mpfr_set_str@plt>
mov    %ebx,%esi
mov    %ebp,%edx
mov    $0x1,%ecx
mov    $0x28,%r8d
call   1030 <all@plt>
mov    (%r14),%ebx
mov    0x2e06(%rip),%r14
mov    (%r14),%ebp
mov    $0x50,%esi
call   1070 <mpfr_set_prec@plt>
mov    (%r12),%esi
movsd  0xe0d(%rip),%xmm0
call   1060 <mpfr_set_d@plt>
mov    %ebx,%esi
mov    %ebp,%edx
mov    $0x190,%ecx
mov    $0x50,%r8d
call   1030 <all@plt>
mov    0x2da5(%rip),%r15
mov    (%r15),%ebx
mov    (%r14),%ebp
mov    $0x320,%esi
call   1070 <mpfr_set_prec@plt>
mov    (%r12),%esi
movsd  0xdd9(%rip),%xmm0
call   1060 <mpfr_set_d@plt>
mov    %ebx,%esi
mov    %ebp,%edx
mov    $0x190,%ecx
mov    $0x320,%r8d
call   1030 <all@plt>
mov    0x2d89(%rip),%rax
mov    (%rax),%ebx
mov    (%r14),%ebp
mov    $0x320,%esi
call   1070 <mpfr_set_prec@plt>
mov    (%r12),%esi
movsd  0xd9e(%rip),%xmm0
call   1060 <mpfr_set_d@plt>
mov    %ebx,%esi
mov    %ebp,%edx
mov    $0x190,%ecx
mov    $0x320,%r8d
call   1030 <all@plt>
mov    (%r15),%ebx
mov    (%r14),%ebp
mov    $0x50,%esi
call   1070 <mpfr_set_prec@plt>
call   1040 <mpfr_set_nan@plt>
mov    %ebx,%esi
mov    %ebp,%edx
mov    $0x28,%ecx
mov    $0x50,%r8d
call   1030 <all@plt>
mov    (%r15),%ebx
mov    (%r14),%ebp
mov    $0x50,%esi
call   1070 <mpfr_set_prec@plt>
mov    $0x1,%esi
call   1090 <mpfr_set_inf@plt>
mov    %ebx,%esi
mov    %ebp,%edx
mov    $0x28,%ecx
mov    $0x50,%r8d
call   1030 <all@plt>
mov    (%r15),%ebx
mov    (%r14),%ebp
mov    $0x50,%esi
call   1070 <mpfr_set_prec@plt>
mov    $0xffffffff,%esi
call   1090 <mpfr_set_inf@plt>
mov    %ebx,%esi
mov    %ebp,%edx
mov    $0x28,%ecx
mov    $0x50,%r8d
call   1030 <all@plt>
call   1080 <mpfr_clear@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@MPFR_RNDD = global i32 0
@MPFR_RNDU = global i32 0
@.str = [27 x i8] c"1.101010111001001001100e17\00"
@MPFR_RNDN = global i32 0
@MPFR_RNDZ = global i32 0
@MPFR_RNDA = global i32 0
@MPFR_RNDF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @mpfr_init(i32 %7)
store i32 40, i32* %3
%9 = load i32, i32* @MPFR_RNDD
store i32 %9, i32* %4
%10 = load i32, i32* @MPFR_RNDU
store i32 %10, i32* %5
store i32 1, i32* %6
%11 = load i32, i32* %2
%12 = load i32, i32* @MPFR_RNDN
%13 = call i32 @mpfr_set_str(i32 %11, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 2, i32 %12)
%14 = load i32, i32* %2
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = load i32, i32* %3
%19 = call i32 @all(i32 %14, i32 %15, i32 %16, i32 %17, i32 %18)
store i32 80, i32* %3
%20 = load i32, i32* @MPFR_RNDD
store i32 %20, i32* %4
%21 = load i32, i32* @MPFR_RNDZ
store i32 %21, i32* %5
store i32 400, i32* %6
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = call i32 @mpfr_set_prec(i32 %22, i32 %23)
%25 = load i32, i32* %2
%26 = load i32, i32* @MPFR_RNDN
%27 = call i32 @mpfr_set_d(i32 %25, double 0x3FD5555555555555, i32 %26)
%28 = load i32, i32* %2
%29 = load i32, i32* %4
%30 = load i32, i32* %5
%31 = load i32, i32* %6
%32 = load i32, i32* %3
%33 = call i32 @all(i32 %28, i32 %29, i32 %30, i32 %31, i32 %32)
store i32 800, i32* %3
%34 = load i32, i32* @MPFR_RNDA
store i32 %34, i32* %4
%35 = load i32, i32* @MPFR_RNDZ
store i32 %35, i32* %5
store i32 400, i32* %6
%36 = load i32, i32* %2
%37 = load i32, i32* %3
%38 = call i32 @mpfr_set_prec(i32 %36, i32 %37)
%39 = load i32, i32* %2
%40 = load i32, i32* @MPFR_RNDN
%41 = call i32 @mpfr_set_d(i32 %39, double 4.115260e+03, i32 %40)
%42 = load i32, i32* %2
%43 = load i32, i32* %4
%44 = load i32, i32* %5
%45 = load i32, i32* %6
%46 = load i32, i32* %3
%47 = call i32 @all(i32 %42, i32 %43, i32 %44, i32 %45, i32 %46)
store i32 800, i32* %3
%48 = load i32, i32* @MPFR_RNDF
store i32 %48, i32* %4
%49 = load i32, i32* @MPFR_RNDZ
store i32 %49, i32* %5
store i32 400, i32* %6
%50 = load i32, i32* %2
%51 = load i32, i32* %3
%52 = call i32 @mpfr_set_prec(i32 %50, i32 %51)
%53 = load i32, i32* %2
%54 = load i32, i32* @MPFR_RNDN
%55 = call i32 @mpfr_set_d(i32 %53, double 4.115260e+03, i32 %54)
%56 = load i32, i32* %2
%57 = load i32, i32* %4
%58 = load i32, i32* %5
%59 = load i32, i32* %6
%60 = load i32, i32* %3
%61 = call i32 @all(i32 %56, i32 %57, i32 %58, i32 %59, i32 %60)
store i32 80, i32* %3
%62 = load i32, i32* @MPFR_RNDA
store i32 %62, i32* %4
%63 = load i32, i32* @MPFR_RNDZ
store i32 %63, i32* %5
store i32 40, i32* %6
%64 = load i32, i32* %2
%65 = load i32, i32* %3
%66 = call i32 @mpfr_set_prec(i32 %64, i32 %65)
%67 = load i32, i32* %2
%68 = call i32 @mpfr_set_nan(i32 %67)
%69 = load i32, i32* %2
%70 = load i32, i32* %4
%71 = load i32, i32* %5
%72 = load i32, i32* %6
%73 = load i32, i32* %3
%74 = call i32 @all(i32 %69, i32 %70, i32 %71, i32 %72, i32 %73)
store i32 80, i32* %3
%75 = load i32, i32* @MPFR_RNDA
store i32 %75, i32* %4
%76 = load i32, i32* @MPFR_RNDZ
store i32 %76, i32* %5
store i32 40, i32* %6
%77 = load i32, i32* %2
%78 = load i32, i32* %3
%79 = call i32 @mpfr_set_prec(i32 %77, i32 %78)
%80 = load i32, i32* %2
%81 = call i32 @mpfr_set_inf(i32 %80, i32 1)
%82 = load i32, i32* %2
%83 = load i32, i32* %4
%84 = load i32, i32* %5
%85 = load i32, i32* %6
%86 = load i32, i32* %3
%87 = call i32 @all(i32 %82, i32 %83, i32 %84, i32 %85, i32 %86)
store i32 80, i32* %3
%88 = load i32, i32* @MPFR_RNDA
store i32 %88, i32* %4
%89 = load i32, i32* @MPFR_RNDZ
store i32 %89, i32* %5
store i32 40, i32* %6
%90 = load i32, i32* %2
%91 = load i32, i32* %3
%92 = call i32 @mpfr_set_prec(i32 %90, i32 %91)
%93 = load i32, i32* %2
%94 = call i32 @mpfr_set_inf(i32 %93, i32 -1)
%95 = load i32, i32* %2
%96 = load i32, i32* %4
%97 = load i32, i32* %5
%98 = load i32, i32* %6
%99 = load i32, i32* %3
%100 = call i32 @all(i32 %95, i32 %96, i32 %97, i32 %98, i32 %99)
%101 = load i32, i32* %2
%102 = call i32 @mpfr_clear(i32 %101)
ret i32 0
}

LLVM IR (-O2):
@MPFR_RNDD = global i32 0
@MPFR_RNDU = global i32 0
@.str = [27 x i8] c"1.101010111001001001100e17\00"
@MPFR_RNDN = global i32 0
@MPFR_RNDZ = global i32 0
@MPFR_RNDA = global i32 0
@MPFR_RNDF = global i32 0
define i32 @main() {
%1 = tail call i32 @mpfr_init(i32 undef)
%2 = load i32, i32* @MPFR_RNDD
%3 = load i32, i32* @MPFR_RNDU
%4 = load i32, i32* @MPFR_RNDN
%5 = tail call i32 @mpfr_set_str(i32 undef, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 2, i32 %4)
%6 = tail call i32 @all(i32 undef, i32 %2, i32 %3, i32 1, i32 40)
%7 = load i32, i32* @MPFR_RNDD
%8 = load i32, i32* @MPFR_RNDZ
%9 = tail call i32 @mpfr_set_prec(i32 undef, i32 80)
%10 = load i32, i32* @MPFR_RNDN
%11 = tail call i32 @mpfr_set_d(i32 undef, double 0x3FD5555555555555, i32 %10)
%12 = tail call i32 @all(i32 undef, i32 %7, i32 %8, i32 400, i32 80)
%13 = load i32, i32* @MPFR_RNDA
%14 = load i32, i32* @MPFR_RNDZ
%15 = tail call i32 @mpfr_set_prec(i32 undef, i32 800)
%16 = load i32, i32* @MPFR_RNDN
%17 = tail call i32 @mpfr_set_d(i32 undef, double 4.115260e+03, i32 %16)
%18 = tail call i32 @all(i32 undef, i32 %13, i32 %14, i32 400, i32 800)
%19 = load i32, i32* @MPFR_RNDF
%20 = load i32, i32* @MPFR_RNDZ
%21 = tail call i32 @mpfr_set_prec(i32 undef, i32 800)
%22 = load i32, i32* @MPFR_RNDN
%23 = tail call i32 @mpfr_set_d(i32 undef, double 4.115260e+03, i32 %22)
%24 = tail call i32 @all(i32 undef, i32 %19, i32 %20, i32 400, i32 800)
%25 = load i32, i32* @MPFR_RNDA
%26 = load i32, i32* @MPFR_RNDZ
%27 = tail call i32 @mpfr_set_prec(i32 undef, i32 80)
%28 = tail call i32 @mpfr_set_nan(i32 undef)
%29 = tail call i32 @all(i32 undef, i32 %25, i32 %26, i32 40, i32 80)
%30 = load i32, i32* @MPFR_RNDA
%31 = load i32, i32* @MPFR_RNDZ
%32 = tail call i32 @mpfr_set_prec(i32 undef, i32 80)
%33 = tail call i32 @mpfr_set_inf(i32 undef, i32 1)
%34 = tail call i32 @all(i32 undef, i32 %30, i32 %31, i32 40, i32 80)
%35 = load i32, i32* @MPFR_RNDA
%36 = load i32, i32* @MPFR_RNDZ
%37 = tail call i32 @mpfr_set_prec(i32 undef, i32 80)
%38 = tail call i32 @mpfr_set_inf(i32 undef, i32 -1)
%39 = tail call i32 @all(i32 undef, i32 %35, i32 %36, i32 40, i32 80)
%40 = tail call i32 @mpfr_clear(i32 undef)
ret i32 0
}