#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_add_ui(int /*<<< orphan*/, int /*<<< orphan*/, long);
scalar_t__ mpz_cmp(int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ mpz_cmp_ui(int /*<<< orphan*/, int);
int /*<<< orphan*/ mpz_div(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpz_gcd(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpz_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_mod(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpz_mul(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpz_set(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpz_set_ui(int /*<<< orphan*/, int);
int /*<<< orphan*/ mpz_sub(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int prho(mpz_t factor1, mpz_t factor2, mpz_t n, long c, long maxIts) {
  static mpz_t a, b, oldA, oldB, tmp, tmp2;
  static int initialized = 0;
  long i, its;
  if (!(initialized)) {
    mpz_init(a);
    mpz_init(b);
    mpz_init(tmp);
    mpz_init(tmp2);
    mpz_init(oldA);
    mpz_init(oldB);
    initialized = 1;
  }
  if (c < 1)
    c = 1;
  if (c > 0x000000FF)
    c &= 0x000000FF;
  mpz_set_ui(a, 1);
  mpz_set_ui(b, 1);
  its = 0;
  do {
    mpz_set(oldA, a);
    mpz_set(oldB, b);
    mpz_set_ui(tmp2, 1);
    for (i = 25; i > 0; i--) {
      mpz_mul(tmp, a, a);
      mpz_add_ui(tmp, tmp, c);
      mpz_mod(a, tmp, n);
      mpz_mul(tmp, b, b);
      mpz_add_ui(tmp, tmp, c);
      mpz_mod(b, tmp, n);
      mpz_mul(tmp, b, b);
      mpz_add_ui(tmp, tmp, c);
      mpz_mod(b, tmp, n);
      mpz_sub(tmp, a, b);
      mpz_mul(tmp2, tmp2, tmp);
      mpz_mod(tmp2, tmp2, n);
    }
    its += 25;
    mpz_gcd(tmp, tmp2, n);
  } while ((mpz_cmp_ui(tmp, 1) == 0) && (its < maxIts));
  if (its >= maxIts)
    return -1;
  if (mpz_cmp(tmp, n) == 0) {
    mpz_set(a, oldA);
    mpz_set(b, oldB);
    do {
      mpz_mul(tmp, a, a);
      mpz_add_ui(tmp, tmp, c);
      mpz_mod(a, tmp, n);
      mpz_mul(tmp, b, b);
      mpz_add_ui(tmp, tmp, c);
      mpz_mod(b, tmp, n);
      mpz_mul(tmp, b, b);
      mpz_add_ui(tmp, tmp, c);
      mpz_mod(b, tmp, n);
      mpz_sub(tmp, a, b);
      mpz_gcd(tmp, tmp, n);
    } while (mpz_cmp_ui(tmp, 1) == 0);
  }
  if (mpz_cmp(tmp, n) < 0) {
    mpz_set(factor1, tmp);
    mpz_div(factor2, n, factor1);
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<prho>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
cmpl   $0x0,0x2ec4(%rip)
jne    1222 <prho+0x72>
mov    0x2ea0(%rip),%edi
call   1070 <mpz_init@plt>
mov    0x2e99(%rip),%edi
call   1070 <mpz_init@plt>
mov    0x2e9a(%rip),%edi
call   1070 <mpz_init@plt>
mov    0x2e93(%rip),%edi
call   1070 <mpz_init@plt>
mov    0x2e7c(%rip),%edi
call   1070 <mpz_init@plt>
mov    0x2e75(%rip),%edi
call   1070 <mpz_init@plt>
movl   $0x1,0x2e72(%rip)
cmpq   $0x1,-0x18(%rbp)
jge    1235 <prho+0x85>
movq   $0x1,-0x18(%rbp)
cmpq   $0xff,-0x18(%rbp)
jle    1251 <prho+0xa1>
mov    -0x18(%rbp),%rax
and    $0xff,%rax
mov    %rax,-0x18(%rbp)
mov    0x2e25(%rip),%edi
mov    $0x1,%esi
call   10b0 <mpz_set_ui@plt>
mov    0x2e19(%rip),%edi
mov    $0x1,%esi
call   10b0 <mpz_set_ui@plt>
movq   $0x0,-0x30(%rbp)
mov    0x2e05(%rip),%edi
mov    0x2df7(%rip),%esi
call   1040 <mpz_set@plt>
mov    0x2df8(%rip),%edi
mov    0x2dea(%rip),%esi
call   1040 <mpz_set@plt>
mov    0x2def(%rip),%edi
mov    $0x1,%esi
call   10b0 <mpz_set_ui@plt>
movq   $0x19,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jle    13d1 <prho+0x221>
mov    0x2dc8(%rip),%edi
mov    0x2db2(%rip),%esi
mov    0x2dac(%rip),%edx
call   1080 <mpz_mul@plt>
mov    0x2db1(%rip),%edi
mov    0x2dab(%rip),%esi
mov    -0x18(%rbp),%rdx
call   1060 <mpz_add_ui@plt>
mov    0x2d8c(%rip),%edi
mov    0x2d96(%rip),%esi
mov    -0x10(%rbp),%edx
call   10c0 <mpz_mod@plt>
mov    0x2d88(%rip),%edi
mov    0x2d76(%rip),%esi
mov    0x2d70(%rip),%edx
call   1080 <mpz_mul@plt>
mov    0x2d71(%rip),%edi
mov    0x2d6b(%rip),%esi
mov    -0x18(%rbp),%rdx
call   1060 <mpz_add_ui@plt>
mov    0x2d50(%rip),%edi
mov    0x2d56(%rip),%esi
mov    -0x10(%rbp),%edx
call   10c0 <mpz_mod@plt>
mov    0x2d48(%rip),%edi
mov    0x2d36(%rip),%esi
mov    0x2d30(%rip),%edx
call   1080 <mpz_mul@plt>
mov    0x2d31(%rip),%edi
mov    0x2d2b(%rip),%esi
mov    -0x18(%rbp),%rdx
call   1060 <mpz_add_ui@plt>
mov    0x2d10(%rip),%edi
mov    0x2d16(%rip),%esi
mov    -0x10(%rbp),%edx
call   10c0 <mpz_mod@plt>
mov    0x2d08(%rip),%edi
mov    0x2cf2(%rip),%esi
mov    0x2cf0(%rip),%edx
call   1050 <mpz_sub@plt>
mov    0x2cf5(%rip),%edi
mov    0x2cef(%rip),%esi
mov    0x2ce5(%rip),%edx
call   1080 <mpz_mul@plt>
mov    0x2cde(%rip),%edi
mov    0x2cd8(%rip),%esi
mov    -0x10(%rbp),%edx
call   10c0 <mpz_mod@plt>
mov    -0x28(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x28(%rbp)
jmp    12b3 <prho+0x103>
mov    -0x30(%rbp),%rax
add    $0x19,%rax
mov    %rax,-0x30(%rbp)
mov    0x2ca9(%rip),%edi
mov    0x2ca7(%rip),%esi
mov    -0x10(%rbp),%edx
call   10d0 <mpz_gcd@plt>
mov    0x2c95(%rip),%edi
mov    $0x1,%esi
call   1090 <mpz_cmp_ui@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x31(%rbp)
jne    1421 <prho+0x271>
mov    -0x30(%rbp),%rax
cmp    -0x20(%rbp),%rax
setl   %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
test   $0x1,%al
jne    1279 <prho+0xc9>
mov    -0x30(%rbp),%rax
cmp    -0x20(%rbp),%rax
jl     1446 <prho+0x296>
movl   $0xffffffff,-0x4(%rbp)
jmp    15d1 <prho+0x421>
mov    0x2c40(%rip),%edi
mov    -0x10(%rbp),%esi
call   10a0 <mpz_cmp@plt>
cmp    $0x0,%rax
jne    158a <prho+0x3da>
mov    0x2c18(%rip),%edi
mov    0x2c1a(%rip),%esi
call   1040 <mpz_set@plt>
mov    0x2c0b(%rip),%edi
mov    0x2c0d(%rip),%esi
call   1040 <mpz_set@plt>
mov    0x2c06(%rip),%edi
mov    0x2bf0(%rip),%esi
mov    0x2bea(%rip),%edx
call   1080 <mpz_mul@plt>
mov    0x2bef(%rip),%edi
mov    0x2be9(%rip),%esi
mov    -0x18(%rbp),%rdx
call   1060 <mpz_add_ui@plt>
mov    0x2bca(%rip),%edi
mov    0x2bd4(%rip),%esi
mov    -0x10(%rbp),%edx
call   10c0 <mpz_mod@plt>
mov    0x2bc6(%rip),%edi
mov    0x2bb4(%rip),%esi
mov    0x2bae(%rip),%edx
call   1080 <mpz_mul@plt>
mov    0x2baf(%rip),%edi
mov    0x2ba9(%rip),%esi
mov    -0x18(%rbp),%rdx
call   1060 <mpz_add_ui@plt>
mov    0x2b8e(%rip),%edi
mov    0x2b94(%rip),%esi
mov    -0x10(%rbp),%edx
call   10c0 <mpz_mod@plt>
mov    0x2b86(%rip),%edi
mov    0x2b74(%rip),%esi
mov    0x2b6e(%rip),%edx
call   1080 <mpz_mul@plt>
mov    0x2b6f(%rip),%edi
mov    0x2b69(%rip),%esi
mov    -0x18(%rbp),%rdx
call   1060 <mpz_add_ui@plt>
mov    0x2b4e(%rip),%edi
mov    0x2b54(%rip),%esi
mov    -0x10(%rbp),%edx
call   10c0 <mpz_mod@plt>
mov    0x2b46(%rip),%edi
mov    0x2b30(%rip),%esi
mov    0x2b2e(%rip),%edx
call   1050 <mpz_sub@plt>
mov    0x2b2f(%rip),%edi
mov    0x2b29(%rip),%esi
mov    -0x10(%rbp),%edx
call   10d0 <mpz_gcd@plt>
mov    0x2b1b(%rip),%edi
mov    $0x1,%esi
call   1090 <mpz_cmp_ui@plt>
cmp    $0x0,%rax
je     1480 <prho+0x2d0>
jmp    158a <prho+0x3da>
mov    0x2afc(%rip),%edi
mov    -0x10(%rbp),%esi
call   10a0 <mpz_cmp@plt>
cmp    $0x0,%rax
jge    15ca <prho+0x41a>
mov    -0x8(%rbp),%edi
mov    0x2ae1(%rip),%esi
call   1040 <mpz_set@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <mpz_div@plt>
movl   $0x0,-0x4(%rbp)
jmp    15d1 <prho+0x421>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prho>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,%r12
mov    %rcx,%rbp
mov    %edx,%ebx
mov    %esi,(%rsp)
mov    %edi,0x4(%rsp)
cmpb   $0x0,0x2eab(%rip)
jne    1204 <prho+0x54>
xor    %edi,%edi
call   1070 <mpz_init@plt>
xor    %edi,%edi
call   1070 <mpz_init@plt>
xor    %edi,%edi
call   1070 <mpz_init@plt>
xor    %edi,%edi
call   1070 <mpz_init@plt>
xor    %edi,%edi
call   1070 <mpz_init@plt>
xor    %edi,%edi
call   1070 <mpz_init@plt>
movb   $0x1,0x2e78(%rip)
test   %rbp,%rbp
mov    $0x1,%eax
cmovg  %rbp,%rax
movzbl %al,%r15d
xor    %r14d,%r14d
xor    %edi,%edi
mov    $0x1,%esi
call   10b0 <mpz_set_ui@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   10b0 <mpz_set_ui@plt>
nop
xor    %edi,%edi
xor    %esi,%esi
call   1040 <mpz_set@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1040 <mpz_set@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   10b0 <mpz_set_ui@plt>
mov    $0x1a,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1080 <mpz_mul@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %r15,%rdx
call   1060 <mpz_add_ui@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %ebx,%edx
call   10c0 <mpz_mod@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1080 <mpz_mul@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %r15,%rdx
call   1060 <mpz_add_ui@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %ebx,%edx
call   10c0 <mpz_mod@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1080 <mpz_mul@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %r15,%rdx
call   1060 <mpz_add_ui@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %ebx,%edx
call   10c0 <mpz_mod@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <mpz_sub@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1080 <mpz_mul@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %ebx,%edx
call   10c0 <mpz_mod@plt>
add    $0xffffffffffffffff,%rbp
cmp    $0x1,%rbp
ja     1260 <prho+0xb0>
add    $0x19,%r14
xor    %edi,%edi
xor    %esi,%esi
mov    %ebx,%edx
call   10d0 <mpz_gcd@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1090 <mpz_cmp_ui@plt>
test   %rax,%rax
jne    131e <prho+0x16e>
cmp    %r12,%r14
jl     1230 <prho+0x80>
mov    $0xffffffff,%r13d
cmp    %r12,%r14
jge    141b <prho+0x26b>
xor    %edi,%edi
mov    %ebx,%esi
call   10a0 <mpz_cmp@plt>
test   %rax,%rax
jne    13f1 <prho+0x241>
xor    %edi,%edi
xor    %esi,%esi
call   1040 <mpz_set@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1040 <mpz_set@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1080 <mpz_mul@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %r15,%rdx
call   1060 <mpz_add_ui@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %ebx,%edx
call   10c0 <mpz_mod@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1080 <mpz_mul@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %r15,%rdx
call   1060 <mpz_add_ui@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %ebx,%edx
call   10c0 <mpz_mod@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1080 <mpz_mul@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %r15,%rdx
call   1060 <mpz_add_ui@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %ebx,%edx
call   10c0 <mpz_mod@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <mpz_sub@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %ebx,%edx
call   10d0 <mpz_gcd@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1090 <mpz_cmp_ui@plt>
test   %rax,%rax
je     1360 <prho+0x1b0>
xor    %edi,%edi
mov    %ebx,%esi
call   10a0 <mpz_cmp@plt>
test   %rax,%rax
jns    141b <prho+0x26b>
mov    0x4(%rsp),%ebp
mov    %ebp,%edi
xor    %esi,%esi
call   1040 <mpz_set@plt>
mov    (%rsp),%edi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <mpz_div@plt>
xor    %r13d,%r13d
mov    %r13d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@prho.a = internal global i32 0
@prho.b = internal global i32 0
@prho.oldA = internal global i32 0
@prho.oldB = internal global i32 0
@prho.tmp = internal global i32 0
@prho.tmp2 = internal global i32 0
@prho.initialized = internal global i32 0
define i32 @prho(i32 %0, i32 %1, i32 %2, i64 %3, i64 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i64 %3, i64* %10
store i64 %4, i64* %11
%14 = load i32, i32* @prho.initialized
%15 = icmp ne i32 %14, 0
br i1 %15, label %29, label %16
16: ; preds = %5
%17 = load i32, i32* @prho.a
%18 = call i32 @mpz_init(i32 %17)
%19 = load i32, i32* @prho.b
%20 = call i32 @mpz_init(i32 %19)
%21 = load i32, i32* @prho.tmp
%22 = call i32 @mpz_init(i32 %21)
%23 = load i32, i32* @prho.tmp2
%24 = call i32 @mpz_init(i32 %23)
%25 = load i32, i32* @prho.oldA
%26 = call i32 @mpz_init(i32 %25)
%27 = load i32, i32* @prho.oldB
%28 = call i32 @mpz_init(i32 %27)
store i32 1, i32* @prho.initialized
br label %29
29: ; preds = %16, %5
%30 = load i64, i64* %10
%31 = icmp slt i64 %30, 1
br i1 %31, label %32, label %33
32: ; preds = %29
store i64 1, i64* %10
br label %33
33: ; preds = %32, %29
%34 = load i64, i64* %10
%35 = icmp sgt i64 %34, 255
br i1 %35, label %36, label %39
36: ; preds = %33
%37 = load i64, i64* %10
%38 = and i64 %37, 255
store i64 %38, i64* %10
br label %39
39: ; preds = %36, %33
%40 = load i32, i32* @prho.a
%41 = call i32 @mpz_set_ui(i32 %40, i32 1)
%42 = load i32, i32* @prho.b
%43 = call i32 @mpz_set_ui(i32 %42, i32 1)
store i64 0, i64* %13
br label %44
44: ; preds = %123, %39
%45 = load i32, i32* @prho.oldA
%46 = load i32, i32* @prho.a
%47 = call i32 @mpz_set(i32 %45, i32 %46)
%48 = load i32, i32* @prho.oldB
%49 = load i32, i32* @prho.b
%50 = call i32 @mpz_set(i32 %48, i32 %49)
%51 = load i32, i32* @prho.tmp2
%52 = call i32 @mpz_set_ui(i32 %51, i32 1)
store i64 25, i64* %12
br label %53
53: ; preds = %105, %44
%54 = load i64, i64* %12
%55 = icmp sgt i64 %54, 0
br i1 %55, label %56, label %108
56: ; preds = %53
%57 = load i32, i32* @prho.tmp
%58 = load i32, i32* @prho.a
%59 = load i32, i32* @prho.a
%60 = call i32 @mpz_mul(i32 %57, i32 %58, i32 %59)
%61 = load i32, i32* @prho.tmp
%62 = load i32, i32* @prho.tmp
%63 = load i64, i64* %10
%64 = call i32 @mpz_add_ui(i32 %61, i32 %62, i64 %63)
%65 = load i32, i32* @prho.a
%66 = load i32, i32* @prho.tmp
%67 = load i32, i32* %9
%68 = call i32 @mpz_mod(i32 %65, i32 %66, i32 %67)
%69 = load i32, i32* @prho.tmp
%70 = load i32, i32* @prho.b
%71 = load i32, i32* @prho.b
%72 = call i32 @mpz_mul(i32 %69, i32 %70, i32 %71)
%73 = load i32, i32* @prho.tmp
%74 = load i32, i32* @prho.tmp
%75 = load i64, i64* %10
%76 = call i32 @mpz_add_ui(i32 %73, i32 %74, i64 %75)
%77 = load i32, i32* @prho.b
%78 = load i32, i32* @prho.tmp
%79 = load i32, i32* %9
%80 = call i32 @mpz_mod(i32 %77, i32 %78, i32 %79)
%81 = load i32, i32* @prho.tmp
%82 = load i32, i32* @prho.b
%83 = load i32, i32* @prho.b
%84 = call i32 @mpz_mul(i32 %81, i32 %82, i32 %83)
%85 = load i32, i32* @prho.tmp
%86 = load i32, i32* @prho.tmp
%87 = load i64, i64* %10
%88 = call i32 @mpz_add_ui(i32 %85, i32 %86, i64 %87)
%89 = load i32, i32* @prho.b
%90 = load i32, i32* @prho.tmp
%91 = load i32, i32* %9
%92 = call i32 @mpz_mod(i32 %89, i32 %90, i32 %91)
%93 = load i32, i32* @prho.tmp
%94 = load i32, i32* @prho.a
%95 = load i32, i32* @prho.b
%96 = call i32 @mpz_sub(i32 %93, i32 %94, i32 %95)
%97 = load i32, i32* @prho.tmp2
%98 = load i32, i32* @prho.tmp2
%99 = load i32, i32* @prho.tmp
%100 = call i32 @mpz_mul(i32 %97, i32 %98, i32 %99)
%101 = load i32, i32* @prho.tmp2
%102 = load i32, i32* @prho.tmp2
%103 = load i32, i32* %9
%104 = call i32 @mpz_mod(i32 %101, i32 %102, i32 %103)
br label %105
105: ; preds = %56
%106 = load i64, i64* %12
%107 = add nsw i64 %106, -1
store i64 %107, i64* %12
br label %53
108: ; preds = %53
%109 = load i64, i64* %13
%110 = add nsw i64 %109, 25
store i64 %110, i64* %13
%111 = load i32, i32* @prho.tmp
%112 = load i32, i32* @prho.tmp2
%113 = load i32, i32* %9
%114 = call i32 @mpz_gcd(i32 %111, i32 %112, i32 %113)
br label %115
115: ; preds = %108
%116 = load i32, i32* @prho.tmp
%117 = call i64 @mpz_cmp_ui(i32 %116, i32 1)
%118 = icmp eq i64 %117, 0
br i1 %118, label %119, label %123
119: ; preds = %115
%120 = load i64, i64* %13
%121 = load i64, i64* %11
%122 = icmp slt i64 %120, %121
br label %123
123: ; preds = %119, %115
%124 = phi i1 [ false, %115 ], [ %122, %119 ]
br i1 %124, label %44, label %125
125: ; preds = %123
%126 = load i64, i64* %13
%127 = load i64, i64* %11
%128 = icmp sge i64 %126, %127
br i1 %128, label %129, label %130
129: ; preds = %125
store i32 -1, i32* %6
br label %206
130: ; preds = %125
%131 = load i32, i32* @prho.tmp
%132 = load i32, i32* %9
%133 = call i64 @mpz_cmp(i32 %131, i32 %132)
%134 = icmp eq i64 %133, 0
br i1 %134, label %135, label %192
135: ; preds = %130
%136 = load i32, i32* @prho.a
%137 = load i32, i32* @prho.oldA
%138 = call i32 @mpz_set(i32 %136, i32 %137)
%139 = load i32, i32* @prho.b
%140 = load i32, i32* @prho.oldB
%141 = call i32 @mpz_set(i32 %139, i32 %140)
br label %142
142: ; preds = %187, %135
%143 = load i32, i32* @prho.tmp
%144 = load i32, i32* @prho.a
%145 = load i32, i32* @prho.a
%146 = call i32 @mpz_mul(i32 %143, i32 %144, i32 %145)
%147 = load i32, i32* @prho.tmp
%148 = load i32, i32* @prho.tmp
%149 = load i64, i64* %10
%150 = call i32 @mpz_add_ui(i32 %147, i32 %148, i64 %149)
%151 = load i32, i32* @prho.a
%152 = load i32, i32* @prho.tmp
%153 = load i32, i32* %9
%154 = call i32 @mpz_mod(i32 %151, i32 %152, i32 %153)
%155 = load i32, i32* @prho.tmp
%156 = load i32, i32* @prho.b
%157 = load i32, i32* @prho.b
%158 = call i32 @mpz_mul(i32 %155, i32 %156, i32 %157)
%159 = load i32, i32* @prho.tmp
%160 = load i32, i32* @prho.tmp
%161 = load i64, i64* %10
%162 = call i32 @mpz_add_ui(i32 %159, i32 %160, i64 %161)
%163 = load i32, i32* @prho.b
%164 = load i32, i32* @prho.tmp
%165 = load i32, i32* %9
%166 = call i32 @mpz_mod(i32 %163, i32 %164, i32 %165)
%167 = load i32, i32* @prho.tmp
%168 = load i32, i32* @prho.b
%169 = load i32, i32* @prho.b
%170 = call i32 @mpz_mul(i32 %167, i32 %168, i32 %169)
%171 = load i32, i32* @prho.tmp
%172 = load i32, i32* @prho.tmp
%173 = load i64, i64* %10
%174 = call i32 @mpz_add_ui(i32 %171, i32 %172, i64 %173)
%175 = load i32, i32* @prho.b
%176 = load i32, i32* @prho.tmp
%177 = load i32, i32* %9
%178 = call i32 @mpz_mod(i32 %175, i32 %176, i32 %177)
%179 = load i32, i32* @prho.tmp
%180 = load i32, i32* @prho.a
%181 = load i32, i32* @prho.b
%182 = call i32 @mpz_sub(i32 %179, i32 %180, i32 %181)
%183 = load i32, i32* @prho.tmp
%184 = load i32, i32* @prho.tmp
%185 = load i32, i32* %9
%186 = call i32 @mpz_gcd(i32 %183, i32 %184, i32 %185)
br label %187
187: ; preds = %142
%188 = load i32, i32* @prho.tmp
%189 = call i64 @mpz_cmp_ui(i32 %188, i32 1)
%190 = icmp eq i64 %189, 0
br i1 %190, label %142, label %191
191: ; preds = %187
br label %192
192: ; preds = %191, %130
%193 = load i32, i32* @prho.tmp
%194 = load i32, i32* %9
%195 = call i64 @mpz_cmp(i32 %193, i32 %194)
%196 = icmp slt i64 %195, 0
br i1 %196, label %197, label %205
197: ; preds = %192
%198 = load i32, i32* %7
%199 = load i32, i32* @prho.tmp
%200 = call i32 @mpz_set(i32 %198, i32 %199)
%201 = load i32, i32* %8
%202 = load i32, i32* %9
%203 = load i32, i32* %7
%204 = call i32 @mpz_div(i32 %201, i32 %202, i32 %203)
store i32 0, i32* %6
br label %206
205: ; preds = %192
store i32 -1, i32* %6
br label %206
206: ; preds = %205, %197, %129
%207 = load i32, i32* %6
ret i32 %207
}

LLVM IR (-O2):
@prho.initialized = internal unnamed_addr global i1 false
define i32 @prho(i32 %0, i32 %1, i32 %2, i64 %3, i64 %4) {
%6 = load i1, i1* @prho.initialized
br i1 %6, label %14, label %7
7: ; preds = %5
%8 = tail call i32 @mpz_init(i32 0)
%9 = tail call i32 @mpz_init(i32 0)
%10 = tail call i32 @mpz_init(i32 0)
%11 = tail call i32 @mpz_init(i32 0)
%12 = tail call i32 @mpz_init(i32 0)
%13 = tail call i32 @mpz_init(i32 0)
store i1 true, i1* @prho.initialized
br label %14
14: ; preds = %7, %5
%15 = icmp sgt i64 %3, 1
%16 = select i1 %15, i64 %3, i64 1
%17 = and i64 %16, 255
%18 = tail call i32 @mpz_set_ui(i32 0, i32 1)
%19 = tail call i32 @mpz_set_ui(i32 0, i32 1)
br label %20
20: ; preds = %41, %14
%21 = phi i64 [ 0, %14 ], [ %42, %41 ]
%22 = tail call i32 @mpz_set(i32 0, i32 0)
%23 = tail call i32 @mpz_set(i32 0, i32 0)
%24 = tail call i32 @mpz_set_ui(i32 0, i32 1)
br label %25
25: ; preds = %20, %25
%26 = phi i64 [ 25, %20 ], [ %39, %25 ]
%27 = tail call i32 @mpz_mul(i32 0, i32 0, i32 0)
%28 = tail call i32 @mpz_add_ui(i32 0, i32 0, i64 %17)
%29 = tail call i32 @mpz_mod(i32 0, i32 0, i32 %2)
%30 = tail call i32 @mpz_mul(i32 0, i32 0, i32 0)
%31 = tail call i32 @mpz_add_ui(i32 0, i32 0, i64 %17)
%32 = tail call i32 @mpz_mod(i32 0, i32 0, i32 %2)
%33 = tail call i32 @mpz_mul(i32 0, i32 0, i32 0)
%34 = tail call i32 @mpz_add_ui(i32 0, i32 0, i64 %17)
%35 = tail call i32 @mpz_mod(i32 0, i32 0, i32 %2)
%36 = tail call i32 @mpz_sub(i32 0, i32 0, i32 0)
%37 = tail call i32 @mpz_mul(i32 0, i32 0, i32 0)
%38 = tail call i32 @mpz_mod(i32 0, i32 0, i32 %2)
%39 = add nsw i64 %26, -1
%40 = icmp ugt i64 %26, 1
br i1 %40, label %25, label %41
41: ; preds = %25
%42 = add nuw nsw i64 %21, 25
%43 = tail call i32 @mpz_gcd(i32 0, i32 0, i32 %2)
%44 = tail call i64 @mpz_cmp_ui(i32 0, i32 1)
%45 = icmp eq i64 %44, 0
%46 = icmp slt i64 %42, %4
%47 = select i1 %45, i1 %46, i1 false
br i1 %47, label %20, label %48
48: ; preds = %41
br i1 %46, label %49, label %75
49: ; preds = %48
%50 = tail call i64 @mpz_cmp(i32 0, i32 %2)
%51 = icmp eq i64 %50, 0
br i1 %51, label %52, label %69
52: ; preds = %49
%53 = tail call i32 @mpz_set(i32 0, i32 0)
%54 = tail call i32 @mpz_set(i32 0, i32 0)
br label %55
55: ; preds = %55, %52
%56 = tail call i32 @mpz_mul(i32 0, i32 0, i32 0)
%57 = tail call i32 @mpz_add_ui(i32 0, i32 0, i64 %17)
%58 = tail call i32 @mpz_mod(i32 0, i32 0, i32 %2)
%59 = tail call i32 @mpz_mul(i32 0, i32 0, i32 0)
%60 = tail call i32 @mpz_add_ui(i32 0, i32 0, i64 %17)
%61 = tail call i32 @mpz_mod(i32 0, i32 0, i32 %2)
%62 = tail call i32 @mpz_mul(i32 0, i32 0, i32 0)
%63 = tail call i32 @mpz_add_ui(i32 0, i32 0, i64 %17)
%64 = tail call i32 @mpz_mod(i32 0, i32 0, i32 %2)
%65 = tail call i32 @mpz_sub(i32 0, i32 0, i32 0)
%66 = tail call i32 @mpz_gcd(i32 0, i32 0, i32 %2)
%67 = tail call i64 @mpz_cmp_ui(i32 0, i32 1)
%68 = icmp eq i64 %67, 0
br i1 %68, label %55, label %69
69: ; preds = %55, %49
%70 = tail call i64 @mpz_cmp(i32 0, i32 %2)
%71 = icmp slt i64 %70, 0
br i1 %71, label %72, label %75
72: ; preds = %69
%73 = tail call i32 @mpz_set(i32 %0, i32 0)
%74 = tail call i32 @mpz_div(i32 %1, i32 %2, i32 %0)
br label %75
75: ; preds = %69, %48, %72
%76 = phi i32 [ 0, %72 ], [ -1, %48 ], [ -1, %69 ]
ret i32 %76
}