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

/* Variables and functions */
double DBL_EPSILON;
int mp_get_nfft_init(int radix, int nfft_max) {
  int nfft_init;
  double r;
  r = radix;
  nfft_init = 1;
  do {
    r *= r;
    nfft_init <<= 1;
  } while (DBL_EPSILON * r < 1 && nfft_init < nfft_max);
  return nfft_init;
}


x86 assembly (clang, -O0):
<mp_get_nfft_init>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x1,-0xc(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    0x2eae(%rip),%rax
movsd  (%rax),%xmm1
mulsd  -0x18(%rbp),%xmm1
xor    %eax,%eax
movsd  0xeb3(%rip),%xmm0
ucomisd %xmm1,%xmm0
mov    %al,-0x19(%rbp)
jbe    1166 <mp_get_nfft_init+0x66>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    111b <mp_get_nfft_init+0x1b>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_get_nfft_init>:
cvtsi2sd %edi,%xmm0
mov    0x2edd(%rip),%rax
movsd  (%rax),%xmm1
mov    $0x1,%eax
movsd  0xee4(%rip),%xmm2
nopl   0x0(%rax)
mulsd  %xmm0,%xmm0
add    %eax,%eax
movapd %xmm1,%xmm3
mulsd  %xmm0,%xmm3
ucomisd %xmm3,%xmm2
jbe    1138 <mp_get_nfft_init+0x38>
cmp    %esi,%eax
jl     1120 <mp_get_nfft_init+0x20>
ret

LLVM IR (-O0):
@DBL_EPSILON = global double 0.000000e+00
define i32 @mp_get_nfft_init(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = sitofp i32 %7 to double
store double %8, double* %6
store i32 1, i32* %5
br label %9
9: ; preds = %24, %2
%10 = load double, double* %6
%11 = load double, double* %6
%12 = fmul double %11, %10
store double %12, double* %6
%13 = load i32, i32* %5
%14 = shl i32 %13, 1
store i32 %14, i32* %5
br label %15
15: ; preds = %9
%16 = load double, double* @DBL_EPSILON
%17 = load double, double* %6
%18 = fmul double %16, %17
%19 = fcmp olt double %18, 1.000000e+00
br i1 %19, label %20, label %24
20: ; preds = %15
%21 = load i32, i32* %5
%22 = load i32, i32* %4
%23 = icmp slt i32 %21, %22
br label %24
24: ; preds = %20, %15
%25 = phi i1 [ false, %15 ], [ %23, %20 ]
br i1 %25, label %9, label %26
26: ; preds = %24
%27 = load i32, i32* %5
ret i32 %27
}

LLVM IR (-O2):
@DBL_EPSILON = global double 0.000000e+00
define i32 @mp_get_nfft_init(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = load double, double* @DBL_EPSILON
br label %5
5: ; preds = %5, %2
%6 = phi i32 [ 1, %2 ], [ %9, %5 ]
%7 = phi double [ %3, %2 ], [ %8, %5 ]
%8 = fmul double %7, %7
%9 = shl i32 %6, 1
%10 = fmul double %4, %8
%11 = fcmp olt double %10, 1.000000e+00
%12 = icmp slt i32 %9, %1
%13 = select i1 %11, i1 %12, i1 false
br i1 %13, label %5, label %14
14: ; preds = %5
ret i32 %9
}