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

/* Variables and functions */
scalar_t__ mp_bits_per_limb;
int /*<<< orphan*/ mpf_abs(int /*<<< orphan*/, int /*<<< orphan*/ const);
scalar_t__ mpf_cmp(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpf_div_2exp(int /*<<< orphan*/, int /*<<< orphan*/,
                                scalar_t__);
int /*<<< orphan*/ mpf_init(int /*<<< orphan*/);
int is_small(const mpf_t x, const mpf_t y) {
  static int init = 0;
  static mpf_t xa, ya;
  if (!init)
    init = 1, mpf_init(xa), mpf_init(ya);
  mpf_abs(xa, x);
  mpf_abs(ya, y);
  mpf_div_2exp(ya, ya, 256 - mp_bits_per_limb);
  return mpf_cmp(xa, ya) < 0;
}


x86 assembly (clang, -O0):
<is_small>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,0x2ef3(%rip)
jne    117b <is_small+0x3b>
movl   $0x1,0x2ee3(%rip)
mov    0x2ee1(%rip),%edi
call   1060 <mpf_init@plt>
mov    0x2eda(%rip),%edi
call   1060 <mpf_init@plt>
mov    0x2ecb(%rip),%edi
mov    -0x4(%rbp),%esi
call   1030 <mpf_abs@plt>
mov    0x2ec1(%rip),%edi
mov    -0x8(%rbp),%esi
call   1030 <mpf_abs@plt>
mov    0x2eb3(%rip),%edi
mov    0x2ead(%rip),%esi
mov    $0x100,%edx
mov    0x2e39(%rip),%rax
sub    (%rax),%rdx
call   1040 <mpf_div_2exp@plt>
mov    0x2e8f(%rip),%edi
mov    0x2e8d(%rip),%esi
call   1050 <mpf_cmp@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_small>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
cmpb   $0x0,0x2efa(%rip)
jne    1165 <is_small+0x25>
movb   $0x1,0x2ef1(%rip)
xor    %edi,%edi
call   1060 <mpf_init@plt>
xor    %edi,%edi
call   1060 <mpf_init@plt>
xor    %edi,%edi
mov    %ebp,%esi
call   1030 <mpf_abs@plt>
xor    %edi,%edi
mov    %ebx,%esi
call   1030 <mpf_abs@plt>
mov    0x2e6a(%rip),%rax
mov    $0x100,%edx
sub    (%rax),%rdx
xor    %edi,%edi
xor    %esi,%esi
call   1040 <mpf_div_2exp@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1050 <mpf_cmp@plt>
shr    $0x3f,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@is_small.init = internal global i32 0
@is_small.xa = internal global i32 0
@is_small.ya = internal global i32 0
@mp_bits_per_limb = global i64 0
define i32 @is_small(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @is_small.init
%6 = icmp ne i32 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %2
store i32 1, i32* @is_small.init
%8 = load i32, i32* @is_small.xa
%9 = call i32 @mpf_init(i32 %8)
%10 = load i32, i32* @is_small.ya
%11 = call i32 @mpf_init(i32 %10)
br label %12
12: ; preds = %7, %2
%13 = load i32, i32* @is_small.xa
%14 = load i32, i32* %3
%15 = call i32 @mpf_abs(i32 %13, i32 %14)
%16 = load i32, i32* @is_small.ya
%17 = load i32, i32* %4
%18 = call i32 @mpf_abs(i32 %16, i32 %17)
%19 = load i32, i32* @is_small.ya
%20 = load i32, i32* @is_small.ya
%21 = load i64, i64* @mp_bits_per_limb
%22 = sub nsw i64 256, %21
%23 = call i32 @mpf_div_2exp(i32 %19, i32 %20, i64 %22)
%24 = load i32, i32* @is_small.xa
%25 = load i32, i32* @is_small.ya
%26 = call i64 @mpf_cmp(i32 %24, i32 %25)
%27 = icmp slt i64 %26, 0
%28 = zext i1 %27 to i32
ret i32 %28
}

LLVM IR (-O2):
@is_small.init = internal unnamed_addr global i1 false
@mp_bits_per_limb = global i64 0
define i32 @is_small(i32 %0, i32 %1) {
%3 = load i1, i1* @is_small.init
br i1 %3, label %7, label %4
4: ; preds = %2
store i1 true, i1* @is_small.init
%5 = tail call i32 @mpf_init(i32 0)
%6 = tail call i32 @mpf_init(i32 0)
br label %7
7: ; preds = %4, %2
%8 = tail call i32 @mpf_abs(i32 0, i32 %0)
%9 = tail call i32 @mpf_abs(i32 0, i32 %1)
%10 = load i64, i64* @mp_bits_per_limb
%11 = sub nsw i64 256, %10
%12 = tail call i32 @mpf_div_2exp(i32 0, i32 0, i64 %11)
%13 = tail call i64 @mpf_cmp(i32 0, i32 0)
%14 = lshr i64 %13, 63
%15 = trunc i64 %14 to i32
ret i32 %15
}