#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;
typedef int /*<<< orphan*/ gmp_randstate_t;

/* Variables and functions */
int /*<<< orphan*/ GetPrime(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ GetU(int /*<<< orphan*/, int /*<<< orphan*/,
                        int /*<<< orphan*/, int /*<<< orphan*/,
                        int /*<<< orphan*/);
int /*<<< orphan*/ gmp_randinit_mt(int /*<<< orphan*/);
int /*<<< orphan*/ gmp_randseed_ui(int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ mpz_cmp(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpz_mul(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void GetParameters(mpz_t p, mpz_t q, mpz_t n, mpz_t u) {
  gmp_randstate_t r_state;
  gmp_randinit_mt(r_state);
  gmp_randseed_ui(r_state, time(NULL));
  GetPrime(p, r_state);
  do {
    GetPrime(q, r_state);
  } while (mpz_cmp(p, q) == 0);
  mpz_mul(n, p, q);
  GetU(u, n, p, q, r_state);
}


x86 assembly (clang, -O0):
<GetParameters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x14(%rbp),%edi
call   1090 <gmp_randinit_mt@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    -0x18(%rbp),%edi
mov    %eax,%esi
call   1080 <gmp_randseed_ui@plt>
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <GetPrime@plt>
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <GetPrime@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1070 <mpz_cmp@plt>
cmp    $0x0,%rax
je     11b0 <GetParameters+0x40>
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1050 <mpz_mul@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0x14(%rbp),%r8d
call   1040 <GetU@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetParameters>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebx
mov    %edi,%ebp
call   1090 <gmp_randinit_mt@plt>
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%esi
call   1080 <gmp_randseed_ui@plt>
mov    %ebp,%edi
call   1030 <GetPrime@plt>
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <GetPrime@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1070 <mpz_cmp@plt>
test   %rax,%rax
je     11a0 <GetParameters+0x30>
mov    %r15d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
call   1050 <mpz_mul@plt>
mov    %r14d,%edi
mov    %r15d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <GetU@plt>

LLVM IR (-O0):
define void @GetParameters(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %9
%11 = call i32 @gmp_randinit_mt(i32 %10)
%12 = load i32, i32* %9
%13 = call i32 @time(i32* null)
%14 = call i32 @gmp_randseed_ui(i32 %12, i32 %13)
%15 = load i32, i32* %5
%16 = load i32, i32* %9
%17 = call i32 @GetPrime(i32 %15, i32 %16)
br label %18
18: ; preds = %22, %4
%19 = load i32, i32* %6
%20 = load i32, i32* %9
%21 = call i32 @GetPrime(i32 %19, i32 %20)
br label %22
22: ; preds = %18
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = call i64 @mpz_cmp(i32 %23, i32 %24)
%26 = icmp eq i64 %25, 0
br i1 %26, label %18, label %27
27: ; preds = %22
%28 = load i32, i32* %7
%29 = load i32, i32* %5
%30 = load i32, i32* %6
%31 = call i32 @mpz_mul(i32 %28, i32 %29, i32 %30)
%32 = load i32, i32* %8
%33 = load i32, i32* %7
%34 = load i32, i32* %5
%35 = load i32, i32* %6
%36 = load i32, i32* %9
%37 = call i32 @GetU(i32 %32, i32 %33, i32 %34, i32 %35, i32 %36)
ret void
}

LLVM IR (-O2):
define void @GetParameters(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @gmp_randinit_mt(i32 undef)
%6 = tail call i32 @time(i32* null)
%7 = tail call i32 @gmp_randseed_ui(i32 undef, i32 %6)
%8 = tail call i32 @GetPrime(i32 %0, i32 undef)
br label %9
9: ; preds = %9, %4
%10 = tail call i32 @GetPrime(i32 %1, i32 undef)
%11 = tail call i64 @mpz_cmp(i32 %0, i32 %1)
%12 = icmp eq i64 %11, 0
br i1 %12, label %9, label %13
13: ; preds = %9
%14 = tail call i32 @mpz_mul(i32 %2, i32 %0, i32 %1)
%15 = tail call i32 @GetU(i32 %3, i32 %2, i32 %0, i32 %1, i32 undef)
ret void
}