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


x86 assembly (clang, -O0):
<fp_poch_rising>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <mpf_init@plt>
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <mpf_set@plt>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1060 <mpf_set_ui@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    11d0 <fp_poch_rising+0x70>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1070 <mpf_mul@plt>
mov    -0x10(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    $0x1,%edx
call   1080 <mpf_add_ui@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1198 <fp_poch_rising+0x38>
mov    -0x10(%rbp),%edi
call   1040 <mpf_clear@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fp_poch_rising>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
call   1030 <mpf_init@plt>
mov    %r14d,%esi
call   1050 <mpf_set@plt>
mov    %ebp,%edi
mov    $0x1,%esi
call   1060 <mpf_set_ui@plt>
test   %ebx,%ebx
je     11a8 <fp_poch_rising+0x48>
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %ebp,%esi
call   1070 <mpf_mul@plt>
mov    $0x1,%edx
call   1080 <mpf_add_ui@plt>
add    $0xffffffff,%ebx
jne    1190 <fp_poch_rising+0x30>
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <mpf_clear@plt>

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

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