#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 */
int /*<<< orphan*/ mpf_clear(int /*<<< orphan*/);
int /*<<< orphan*/ mpf_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpf_mul(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpf_set_d(int /*<<< orphan*/, double);
int /*<<< orphan*/ mpf_set_ui(int /*<<< orphan*/, int);
void fp_poch_rising_d(mpf_t poch, double x, unsigned int n) {
  mpf_t term;
  mpf_init(term);
  mpf_set_ui(poch, 1);
  unsigned int i;
  for (i = 0; i < n; i++) {
    mpf_set_d(term, x + i);
    mpf_mul(poch, poch, term);
  }
  mpf_clear(term);
}


x86 assembly (clang, -O0):
<fp_poch_rising_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x18(%rbp),%edi
call   1030 <mpf_init@plt>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1060 <mpf_set_ui@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    11c0 <fp_poch_rising_d+0x70>
mov    -0x18(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
mov    -0x1c(%rbp),%eax
cvtsi2sd %rax,%xmm1
addsd  %xmm1,%xmm0
call   1050 <mpf_set_d@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1070 <mpf_mul@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    117f <fp_poch_rising_d+0x2f>
mov    -0x18(%rbp),%edi
call   1040 <mpf_clear@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fp_poch_rising_d>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %esi,%ebx
movsd  %xmm0,0x10(%rsp)
mov    %edi,%ebp
call   1030 <mpf_init@plt>
mov    %ebp,%edi
mov    $0x1,%esi
call   1060 <mpf_set_ui@plt>
test   %ebx,%ebx
je     11b3 <fp_poch_rising_d+0x63>
xorpd  %xmm0,%xmm0
nopl   0x0(%rax)
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
call   1050 <mpf_set_d@plt>
mov    %ebp,%edi
mov    %ebp,%esi
call   1070 <mpf_mul@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xe52(%rip),%xmm0
add    $0xffffffff,%ebx
jne    1180 <fp_poch_rising_d+0x30>
add    $0x18,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <mpf_clear@plt>

LLVM IR (-O0):
define void @fp_poch_rising_d(i32 %0, double %1, i32 %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store double %1, double* %5
store i32 %2, i32* %6
%9 = load i32, i32* %7
%10 = call i32 @mpf_init(i32 %9)
%11 = load i32, i32* %4
%12 = call i32 @mpf_set_ui(i32 %11, i32 1)
store i32 0, i32* %8
br label %13
13: ; preds = %28, %3
%14 = load i32, i32* %8
%15 = load i32, i32* %6
%16 = icmp ult i32 %14, %15
br i1 %16, label %17, label %31
17: ; preds = %13
%18 = load i32, i32* %7
%19 = load double, double* %5
%20 = load i32, i32* %8
%21 = uitofp i32 %20 to double
%22 = fadd double %19, %21
%23 = call i32 @mpf_set_d(i32 %18, double %22)
%24 = load i32, i32* %4
%25 = load i32, i32* %4
%26 = load i32, i32* %7
%27 = call i32 @mpf_mul(i32 %24, i32 %25, i32 %26)
br label %28
28: ; preds = %17
%29 = load i32, i32* %8
%30 = add i32 %29, 1
store i32 %30, i32* %8
br label %13
31: ; preds = %13
%32 = load i32, i32* %7
%33 = call i32 @mpf_clear(i32 %32)
ret void
}

LLVM IR (-O2):
define void @fp_poch_rising_d(i32 %0, double %1, i32 %2) {
%4 = tail call i32 @mpf_init(i32 undef)
%5 = tail call i32 @mpf_set_ui(i32 %0, i32 1)
%6 = icmp eq i32 %2, 0
br i1 %6, label %15, label %7
7: ; preds = %3, %7
%8 = phi i32 [ %13, %7 ], [ 0, %3 ]
%9 = uitofp i32 %8 to double
%10 = fadd double %9, %1
%11 = tail call i32 @mpf_set_d(i32 undef, double %10)
%12 = tail call i32 @mpf_mul(i32 %0, i32 %0, i32 undef)
%13 = add nuw i32 %8, 1
%14 = icmp eq i32 %13, %2
br i1 %14, label %15, label %7
15: ; preds = %7, %3
%16 = tail call i32 @mpf_clear(i32 undef)
ret void
}