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

/* Variables and functions */
int /*<<< orphan*/ mpfr_div(int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/, int /*<<< orphan*/);
unsigned long mpfr_get_ui(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpfr_rint_floor(int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/);
int /*<<< orphan*/ mpfr_set(int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/);
unsigned long eval(mpfr_t x, mpfr_t y, mpfr_t z, mpfr_t t, mpfr_rnd_t rnd) {
  mpfr_div(t, x, y, rnd);
  mpfr_set(z, t, rnd);
  mpfr_rint_floor(z, z, rnd);
  return mpfr_get_ui(z, rnd);
}


x86 assembly (clang, -O0):
<eval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1060 <mpfr_div@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <mpfr_set@plt>
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1050 <mpfr_rint_floor@plt>
mov    -0xc(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <mpfr_get_ui@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval>:
push   %rbp
push   %r14
push   %rbx
mov    %r8d,%ebx
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %esi,%edx
mov    %edi,%esi
mov    %ecx,%edi
mov    %r8d,%ecx
call   1060 <mpfr_div@plt>
mov    %ebp,%edi
mov    %r14d,%esi
mov    %ebx,%edx
call   1040 <mpfr_set@plt>
mov    %ebp,%edi
mov    %ebp,%esi
mov    %ebx,%edx
call   1050 <mpfr_rint_floor@plt>
mov    %ebp,%edi
mov    %ebx,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <mpfr_get_ui@plt>

LLVM IR (-O0):
define i64 @eval(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %9
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = load i32, i32* %10
%15 = call i32 @mpfr_div(i32 %11, i32 %12, i32 %13, i32 %14)
%16 = load i32, i32* %8
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = call i32 @mpfr_set(i32 %16, i32 %17, i32 %18)
%20 = load i32, i32* %8
%21 = load i32, i32* %8
%22 = load i32, i32* %10
%23 = call i32 @mpfr_rint_floor(i32 %20, i32 %21, i32 %22)
%24 = load i32, i32* %8
%25 = load i32, i32* %10
%26 = call i64 @mpfr_get_ui(i32 %24, i32 %25)
ret i64 %26
}

LLVM IR (-O2):
define i64 @eval(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @mpfr_div(i32 %3, i32 %0, i32 %1, i32 %4)
%7 = tail call i32 @mpfr_set(i32 %2, i32 %3, i32 %4)
%8 = tail call i32 @mpfr_rint_floor(i32 %2, i32 %2, i32 %4)
%9 = tail call i64 @mpfr_get_ui(i32 %2, i32 %4)
ret i64 %9
}