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

/* Variables and functions */
int /*<<< orphan*/ mpz_clear(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_mul_ui(int /*<<< orphan*/, int /*<<< orphan*/,
                              unsigned int);
int /*<<< orphan*/ mpz_set(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpz_set_ui(int /*<<< orphan*/, int);
void i_poch_rising(mpz_t poch, unsigned int k, unsigned int n) {
  mpz_t acc;
  mpz_init(acc);
  mpz_set_ui(poch, 1);
  unsigned int i;
  for (i = 0; i < n; i++) {
    mpz_mul_ui(acc, poch, i + k);
    mpz_set(poch, acc);
  }
  mpz_clear(acc);
}


x86 assembly (clang, -O0):
<i_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   1040 <mpz_init@plt>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1050 <mpz_set_ui@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    11b3 <i_poch_rising+0x63>
mov    -0x10(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x14(%rbp),%edx
add    -0x8(%rbp),%edx
call   1070 <mpz_mul_ui@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <mpz_set@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    117d <i_poch_rising+0x2d>
mov    -0x10(%rbp),%edi
call   1060 <mpz_clear@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_poch_rising>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
call   1040 <mpz_init@plt>
mov    %r14d,%edi
mov    $0x1,%esi
call   1050 <mpz_set_ui@plt>
test   %ebx,%ebx
je     119a <i_poch_rising+0x4a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14d,%esi
mov    %ebp,%edx
call   1070 <mpz_mul_ui@plt>
mov    %r14d,%edi
call   1030 <mpz_set@plt>
add    $0x1,%ebp
add    $0xffffffff,%ebx
jne    1180 <i_poch_rising+0x30>
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <mpz_clear@plt>

LLVM IR (-O0):
define void @i_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 @mpz_init(i32 %9)
%11 = load i32, i32* %4
%12 = call i32 @mpz_set_ui(i32 %11, i32 1)
store i32 0, i32* %8
br label %13
13: ; preds = %27, %3
%14 = load i32, i32* %8
%15 = load i32, i32* %6
%16 = icmp ult i32 %14, %15
br i1 %16, label %17, label %30
17: ; preds = %13
%18 = load i32, i32* %7
%19 = load i32, i32* %4
%20 = load i32, i32* %8
%21 = load i32, i32* %5
%22 = add i32 %20, %21
%23 = call i32 @mpz_mul_ui(i32 %18, i32 %19, i32 %22)
%24 = load i32, i32* %4
%25 = load i32, i32* %7
%26 = call i32 @mpz_set(i32 %24, i32 %25)
br label %27
27: ; preds = %17
%28 = load i32, i32* %8
%29 = add i32 %28, 1
store i32 %29, i32* %8
br label %13
30: ; preds = %13
%31 = load i32, i32* %7
%32 = call i32 @mpz_clear(i32 %31)
ret void
}

LLVM IR (-O2):
define void @i_poch_rising(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @mpz_init(i32 undef)
%5 = tail call i32 @mpz_set_ui(i32 %0, i32 1)
%6 = icmp eq i32 %2, 0
br i1 %6, label %14, label %7
7: ; preds = %3, %7
%8 = phi i32 [ %12, %7 ], [ 0, %3 ]
%9 = add i32 %8, %1
%10 = tail call i32 @mpz_mul_ui(i32 undef, i32 %0, i32 %9)
%11 = tail call i32 @mpz_set(i32 %0, i32 undef)
%12 = add nuw i32 %8, 1
%13 = icmp eq i32 %12, %2
br i1 %13, label %14, label %7
14: ; preds = %7, %3
%15 = tail call i32 @mpz_clear(i32 undef)
ret void
}