#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*/ getPowm(unsigned char *, unsigned long *, int /*<<< orphan*/,
                           unsigned char const *, unsigned long);
int /*<<< orphan*/ mpz_clear(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_import(int /*<<< orphan*/, unsigned long, int, int, int,
                              int /*<<< orphan*/, void *);
int /*<<< orphan*/ mpz_init(int /*<<< orphan*/);
void getKey(unsigned char *key, unsigned long *keylen,
            const unsigned char *public, unsigned long publen,
            const unsigned char *private, unsigned long prilen) {
  mpz_t base;
  mpz_init(base);
  mpz_import(base, publen, -1, 1, 1, 0, (void *)public);
  getPowm(key, keylen, base, private, prilen);
  mpz_clear(base);
}


x86 assembly (clang, -O0):
<getKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x34(%rbp),%edi
call   1040 <mpz_init@plt>
mov    -0x34(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    $0xffffffff,%edx
mov    $0x1,%r8d
xor    %r9d,%r9d
mov    %r8d,%ecx
mov    %rax,(%rsp)
call   1060 <mpz_import@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x34(%rbp),%edx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
call   1030 <getPowm@plt>
mov    -0x34(%rbp),%edi
call   1050 <mpz_clear@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getKey>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%rbx
mov    %rsi,%r13
mov    %rdi,%rbp
call   1040 <mpz_init@plt>
mov    %rbx,(%rsp)
mov    %r12,%rsi
mov    $0xffffffff,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
xor    %r9d,%r9d
call   1060 <mpz_import@plt>
mov    %rbp,%rdi
mov    %r13,%rsi
mov    %r15,%rcx
mov    %r14,%r8
call   1030 <getPowm@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <mpz_clear@plt>

LLVM IR (-O0):
define void @getKey(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i64 %5) {
%7 = alloca i8*
%8 = alloca i64*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i32
store i8* %0, i8** %7
store i64* %1, i64** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i8* %4, i8** %11
store i64 %5, i64* %12
%14 = load i32, i32* %13
%15 = call i32 @mpz_init(i32 %14)
%16 = load i32, i32* %13
%17 = load i64, i64* %10
%18 = load i8*, i8** %9
%19 = call i32 @mpz_import(i32 %16, i64 %17, i32 -1, i32 1, i32 1, i32 0, i8* %18)
%20 = load i8*, i8** %7
%21 = load i64*, i64** %8
%22 = load i32, i32* %13
%23 = load i8*, i8** %11
%24 = load i64, i64* %12
%25 = call i32 @getPowm(i8* %20, i64* %21, i32 %22, i8* %23, i64 %24)
%26 = load i32, i32* %13
%27 = call i32 @mpz_clear(i32 %26)
ret void
}

LLVM IR (-O2):
define void @getKey(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i64 %5) {
%7 = tail call i32 @mpz_init(i32 undef)
%8 = tail call i32 @mpz_import(i32 undef, i64 %3, i32 -1, i32 1, i32 1, i32 0, i8* %2)
%9 = tail call i32 @getPowm(i8* %0, i64* %1, i32 undef, i8* %4, i64 %5)
%10 = tail call i32 @mpz_clear(i32 undef)
ret void
}