#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_prec_t;

/* Variables and functions */
int /*<<< orphan*/ MPFR_RNDN;
int /*<<< orphan*/ m_clear(int /*<<< orphan*/);
int /*<<< orphan*/ m_init2(int /*<<< orphan*/, int /*<<< orphan*/ const);
int /*<<< orphan*/ mpfr_set(int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/);
int /*<<< orphan*/ mpfr_set_prec(int /*<<< orphan*/, int /*<<< orphan*/ const);
int m_setPrecision(mpfr_t *value, const mpfr_prec_t pre) {
  int roundingDirection = 0;
  mpfr_t result;
  m_init2(result, pre);
  mpfr_set(result, *value, MPFR_RNDN);
  mpfr_set_prec(*value, pre);
  mpfr_set(*value, result, MPFR_RNDN);
  m_clear(result);
  return roundingDirection;
}


x86 assembly (clang, -O0):
<m_setPrecision>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x14(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1060 <m_init2@plt>
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    0x2e77(%rip),%rax
mov    (%rax),%edx
call   1040 <mpfr_set@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%esi
call   1030 <mpfr_set_prec@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%esi
mov    0x2e52(%rip),%rax
mov    (%rax),%edx
call   1040 <mpfr_set@plt>
mov    -0x14(%rbp),%edi
call   1050 <m_clear@plt>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_setPrecision>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
call   1060 <m_init2@plt>
mov    (%rbx),%esi
mov    0x2e91(%rip),%r14
mov    (%r14),%edx
call   1040 <mpfr_set@plt>
mov    (%rbx),%edi
mov    %ebp,%esi
call   1030 <mpfr_set_prec@plt>
mov    (%rbx),%edi
mov    (%r14),%edx
call   1040 <mpfr_set@plt>
call   1050 <m_clear@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@MPFR_RNDN = global i32 0
define i32 @m_setPrecision(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = call i32 @m_init2(i32 %7, i32 %8)
%10 = load i32, i32* %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = load i32, i32* @MPFR_RNDN
%14 = call i32 @mpfr_set(i32 %10, i32 %12, i32 %13)
%15 = load i32*, i32** %3
%16 = load i32, i32* %15
%17 = load i32, i32* %4
%18 = call i32 @mpfr_set_prec(i32 %16, i32 %17)
%19 = load i32*, i32** %3
%20 = load i32, i32* %19
%21 = load i32, i32* %6
%22 = load i32, i32* @MPFR_RNDN
%23 = call i32 @mpfr_set(i32 %20, i32 %21, i32 %22)
%24 = load i32, i32* %6
%25 = call i32 @m_clear(i32 %24)
%26 = load i32, i32* %5
ret i32 %26
}

LLVM IR (-O2):
@MPFR_RNDN = global i32 0
define i32 @m_setPrecision(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @m_init2(i32 undef, i32 %1)
%4 = load i32, i32* %0
%5 = load i32, i32* @MPFR_RNDN
%6 = tail call i32 @mpfr_set(i32 undef, i32 %4, i32 %5)
%7 = load i32, i32* %0
%8 = tail call i32 @mpfr_set_prec(i32 %7, i32 %1)
%9 = load i32, i32* %0
%10 = load i32, i32* @MPFR_RNDN
%11 = tail call i32 @mpfr_set(i32 %9, i32 undef, i32 %10)
%12 = tail call i32 @m_clear(i32 undef)
ret i32 0
}