#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*/ gmp_printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ mpz_add(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpz_add_ui(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ mpz_clear(int /*<<< orphan*/);
scalar_t__ mpz_cmp_si(int /*<<< orphan*/, int);
int /*<<< orphan*/ mpz_gcd(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpz_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_invert(int /*<<< orphan*/, int /*<<< orphan*/,
                              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_mul_si(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ mpz_mul_ui(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ mpz_set_si(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpz_sub(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void Q(mpz_t a, mpz_t S, mpz_t s, mpz_t n, mpz_t x, mpz_t y,
       gmp_randstate_t r_state) {
  mpz_t t, tmp, inv_tmp, rgcd;
  mpz_init(t);
  mpz_init(tmp);
  mpz_init(inv_tmp);
  mpz_init(rgcd);
  mpz_set_si(t, 0);
  do {
    do {
      mpz_add_ui(t, t, 1);
      mpz_gcd(rgcd, t, n);
    } while (mpz_cmp_si(rgcd, 1) != 0);
    mpz_mod(t, t, n);
    mpz_mul(tmp, t, t);
    mpz_mul(tmp, tmp, S);
    mpz_add(tmp, tmp, a);
    mpz_gcd(rgcd, tmp, n);
  } while (mpz_cmp_si(rgcd, 1) != 0);
  mpz_mod(tmp, tmp, n);
  mpz_invert(inv_tmp, tmp, n);
  mpz_mul(x, inv_tmp, t);
  mpz_mod(x, x, n);
  mpz_mul(x, x, s);
  mpz_mod(x, x, n);
  mpz_mul_si(x, x, -2);
  mpz_mod(x, x, n);
  mpz_mul(inv_tmp, tmp, s);
  mpz_mod(inv_tmp, inv_tmp, n);
  mpz_invert(inv_tmp, inv_tmp, n);
  mpz_mul(y, t, t);
  mpz_mod(y, y, n);
  mpz_mul(y, y, S);
  mpz_mod(y, y, n);
  mpz_sub(y, a, y);
  mpz_mod(y, y, n);
  mpz_mul(y, y, inv_tmp);
  mpz_mod(y, y, n);
  mpz_t cx;
  mpz_init(cx);
  mpz_mul(cx, t, t);
  mpz_mod(cx, cx, n);
  mpz_mul(cx, cx, S);
  mpz_mod(cx, cx, n);
  mpz_sub(cx, a, cx);
  mpz_mod(cx, cx, n);
  mpz_invert(inv_tmp, tmp, n);
  mpz_mul(cx, cx, inv_tmp);
  mpz_mod(cx, cx, n);
  mpz_mul_ui(cx, cx, 2);
  mpz_mod(cx, cx, n);
  mpz_add_ui(cx, cx, 2);
  mpz_mod(cx, cx, n);
  gmp_printf("\nt=%Zd\n", cx);
  mpz_clear(cx);
  mpz_clear(rgcd);
  mpz_clear(inv_tmp);
  mpz_clear(tmp);
  mpz_clear(t);
}


x86 assembly (clang, -O0):
<Q>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x1c(%rbp),%edi
call   1080 <mpz_init@plt>
mov    -0x20(%rbp),%edi
call   1080 <mpz_init@plt>
mov    -0x24(%rbp),%edi
call   1080 <mpz_init@plt>
mov    -0x28(%rbp),%edi
call   1080 <mpz_init@plt>
mov    -0x1c(%rbp),%edi
xor    %esi,%esi
call   1030 <mpz_set_si@plt>
jmp    122e <Q+0x4e>
mov    -0x1c(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    $0x1,%edx
call   1050 <mpz_add_ui@plt>
mov    -0x28(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x10(%rbp),%edx
call   10e0 <mpz_gcd@plt>
mov    -0x28(%rbp),%edi
mov    $0x1,%esi
call   10b0 <mpz_cmp_si@plt>
cmp    $0x0,%rax
jne    122e <Q+0x4e>
mov    -0x1c(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x10(%rbp),%edx
call   10c0 <mpz_mod@plt>
mov    -0x20(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   10a0 <mpz_mul@plt>
mov    -0x20(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x8(%rbp),%edx
call   10a0 <mpz_mul@plt>
mov    -0x20(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x4(%rbp),%edx
call   1090 <mpz_add@plt>
mov    -0x28(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x10(%rbp),%edx
call   10e0 <mpz_gcd@plt>
mov    -0x28(%rbp),%edi
mov    $0x1,%esi
call   10b0 <mpz_cmp_si@plt>
cmp    $0x0,%rax
jne    1229 <Q+0x49>
mov    -0x20(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x10(%rbp),%edx
call   10c0 <mpz_mod@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1070 <mpz_invert@plt>
mov    -0x14(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   10a0 <mpz_mul@plt>
mov    -0x14(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
call   10c0 <mpz_mod@plt>
mov    -0x14(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0xc(%rbp),%edx
call   10a0 <mpz_mul@plt>
mov    -0x14(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
call   10c0 <mpz_mod@plt>
mov    -0x14(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    $0xfffffffe,%edx
call   1060 <mpz_mul_si@plt>
mov    -0x14(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
call   10c0 <mpz_mod@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0xc(%rbp),%edx
call   10a0 <mpz_mul@plt>
mov    -0x24(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    -0x10(%rbp),%edx
call   10c0 <mpz_mod@plt>
mov    -0x24(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1070 <mpz_invert@plt>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   10a0 <mpz_mul@plt>
mov    -0x18(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%edx
call   10c0 <mpz_mod@plt>
mov    -0x18(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x8(%rbp),%edx
call   10a0 <mpz_mul@plt>
mov    -0x18(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%edx
call   10c0 <mpz_mod@plt>
mov    -0x18(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1040 <mpz_sub@plt>
mov    -0x18(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%edx
call   10c0 <mpz_mod@plt>
mov    -0x18(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x24(%rbp),%edx
call   10a0 <mpz_mul@plt>
mov    -0x18(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%edx
call   10c0 <mpz_mod@plt>
mov    -0x2c(%rbp),%edi
call   1080 <mpz_init@plt>
mov    -0x2c(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   10a0 <mpz_mul@plt>
mov    -0x2c(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    -0x10(%rbp),%edx
call   10c0 <mpz_mod@plt>
mov    -0x2c(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    -0x8(%rbp),%edx
call   10a0 <mpz_mul@plt>
mov    -0x2c(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    -0x10(%rbp),%edx
call   10c0 <mpz_mod@plt>
mov    -0x2c(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x2c(%rbp),%edx
call   1040 <mpz_sub@plt>
mov    -0x2c(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    -0x10(%rbp),%edx
call   10c0 <mpz_mod@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1070 <mpz_invert@plt>
mov    -0x2c(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    -0x24(%rbp),%edx
call   10a0 <mpz_mul@plt>
mov    -0x2c(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    -0x10(%rbp),%edx
call   10c0 <mpz_mod@plt>
mov    -0x2c(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    $0x2,%edx
call   1100 <mpz_mul_ui@plt>
mov    -0x2c(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    -0x10(%rbp),%edx
call   10c0 <mpz_mod@plt>
mov    -0x2c(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    $0x2,%edx
call   1050 <mpz_add_ui@plt>
mov    -0x2c(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    -0x10(%rbp),%edx
call   10c0 <mpz_mod@plt>
mov    -0x2c(%rbp),%esi
lea    0xb68(%rip),%rdi
call   10f0 <gmp_printf@plt>
mov    -0x2c(%rbp),%edi
call   10d0 <mpz_clear@plt>
mov    -0x28(%rbp),%edi
call   10d0 <mpz_clear@plt>
mov    -0x24(%rbp),%edi
call   10d0 <mpz_clear@plt>
mov    -0x20(%rbp),%edi
call   10d0 <mpz_clear@plt>
mov    -0x1c(%rbp),%edi
call   10d0 <mpz_clear@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%r15d
mov    %r8d,%r13d
mov    %ecx,%ebx
mov    %edx,%r12d
mov    %esi,%ebp
mov    %edi,%r14d
call   1080 <mpz_init@plt>
call   1080 <mpz_init@plt>
call   1080 <mpz_init@plt>
call   1080 <mpz_init@plt>
xor    %esi,%esi
call   1030 <mpz_set_si@plt>
cs nopw 0x0(%rax,%rax,1)
mov    $0x1,%edx
call   1050 <mpz_add_ui@plt>
mov    %ebx,%edx
call   10e0 <mpz_gcd@plt>
mov    $0x1,%esi
call   10b0 <mpz_cmp_si@plt>
test   %rax,%rax
jne    1220 <Q+0x40>
mov    %ebx,%edx
call   10c0 <mpz_mod@plt>
call   10a0 <mpz_mul@plt>
mov    %ebp,%edx
call   10a0 <mpz_mul@plt>
mov    %r14d,%edx
call   1090 <mpz_add@plt>
mov    %ebx,%edx
call   10e0 <mpz_gcd@plt>
mov    $0x1,%esi
call   10b0 <mpz_cmp_si@plt>
test   %rax,%rax
jne    1220 <Q+0x40>
mov    %ebx,%edx
call   10c0 <mpz_mod@plt>
mov    %ebx,%edx
call   1070 <mpz_invert@plt>
mov    %r13d,%edi
call   10a0 <mpz_mul@plt>
mov    %r13d,%edi
mov    %r13d,%esi
mov    %ebx,%edx
call   10c0 <mpz_mod@plt>
mov    %r13d,%edi
mov    %r13d,%esi
mov    %r12d,%edx
call   10a0 <mpz_mul@plt>
mov    %r13d,%edi
mov    %r13d,%esi
mov    %ebx,%edx
call   10c0 <mpz_mod@plt>
mov    %r13d,%edi
mov    %r13d,%esi
mov    $0xfffffffe,%edx
call   1060 <mpz_mul_si@plt>
mov    %r13d,%edi
mov    %r13d,%esi
mov    %ebx,%edx
call   10c0 <mpz_mod@plt>
mov    %r12d,%edx
call   10a0 <mpz_mul@plt>
mov    %ebx,%edx
call   10c0 <mpz_mod@plt>
mov    %ebx,%edx
call   1070 <mpz_invert@plt>
mov    %r15d,%edi
call   10a0 <mpz_mul@plt>
mov    %r15d,%edi
mov    %r15d,%esi
mov    %ebx,%edx
call   10c0 <mpz_mod@plt>
mov    %r15d,%edi
mov    %r15d,%esi
mov    %ebp,%edx
call   10a0 <mpz_mul@plt>
mov    %r15d,%edi
mov    %r15d,%esi
mov    %ebx,%edx
call   10c0 <mpz_mod@plt>
mov    %r15d,%edi
mov    %r14d,%esi
mov    %r15d,%edx
call   1040 <mpz_sub@plt>
mov    %r15d,%edi
mov    %r15d,%esi
mov    %ebx,%edx
call   10c0 <mpz_mod@plt>
mov    %r15d,%edi
mov    %r15d,%esi
call   10a0 <mpz_mul@plt>
mov    %r15d,%edi
mov    %r15d,%esi
mov    %ebx,%edx
call   10c0 <mpz_mod@plt>
call   1080 <mpz_init@plt>
call   10a0 <mpz_mul@plt>
mov    %ebx,%edx
call   10c0 <mpz_mod@plt>
mov    %ebp,%edx
call   10a0 <mpz_mul@plt>
mov    %ebx,%edx
call   10c0 <mpz_mod@plt>
mov    %r14d,%esi
call   1040 <mpz_sub@plt>
mov    %ebx,%edx
call   10c0 <mpz_mod@plt>
mov    %ebx,%edx
call   1070 <mpz_invert@plt>
call   10a0 <mpz_mul@plt>
mov    %ebx,%edx
call   10c0 <mpz_mod@plt>
mov    $0x2,%edx
call   1100 <mpz_mul_ui@plt>
mov    %ebx,%edx
call   10c0 <mpz_mod@plt>
mov    $0x2,%edx
call   1050 <mpz_add_ui@plt>
mov    %ebx,%edx
call   10c0 <mpz_mod@plt>
lea    0xc52(%rip),%rdi
call   10f0 <gmp_printf@plt>
call   10d0 <mpz_clear@plt>
call   10d0 <mpz_clear@plt>
call   10d0 <mpz_clear@plt>
call   10d0 <mpz_clear@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    10d0 <mpz_clear@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"\0At=%Zd\0A\00"
define void @Q(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = tail call i32 @mpz_init(i32 undef)
%9 = tail call i32 @mpz_init(i32 undef)
%10 = tail call i32 @mpz_init(i32 undef)
%11 = tail call i32 @mpz_init(i32 undef)
%12 = tail call i32 @mpz_set_si(i32 undef, i32 0)
br label %13
13: ; preds = %18, %7
%14 = tail call i32 @mpz_add_ui(i32 undef, i32 undef, i32 1)
%15 = tail call i32 @mpz_gcd(i32 undef, i32 undef, i32 %3)
%16 = tail call i64 @mpz_cmp_si(i32 undef, i32 1)
%17 = icmp eq i64 %16, 0
br i1 %17, label %19, label %18
18: ; preds = %13, %19
br label %13
19: ; preds = %13
%20 = tail call i32 @mpz_mod(i32 undef, i32 undef, i32 %3)
%21 = tail call i32 @mpz_mul(i32 undef, i32 undef, i32 undef)
%22 = tail call i32 @mpz_mul(i32 undef, i32 undef, i32 %1)
%23 = tail call i32 @mpz_add(i32 undef, i32 undef, i32 %0)
%24 = tail call i32 @mpz_gcd(i32 undef, i32 undef, i32 %3)
%25 = tail call i64 @mpz_cmp_si(i32 undef, i32 1)
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %18
27: ; preds = %19
%28 = tail call i32 @mpz_mod(i32 undef, i32 undef, i32 %3)
%29 = tail call i32 @mpz_invert(i32 undef, i32 undef, i32 %3)
%30 = tail call i32 @mpz_mul(i32 %4, i32 undef, i32 undef)
%31 = tail call i32 @mpz_mod(i32 %4, i32 %4, i32 %3)
%32 = tail call i32 @mpz_mul(i32 %4, i32 %4, i32 %2)
%33 = tail call i32 @mpz_mod(i32 %4, i32 %4, i32 %3)
%34 = tail call i32 @mpz_mul_si(i32 %4, i32 %4, i32 -2)
%35 = tail call i32 @mpz_mod(i32 %4, i32 %4, i32 %3)
%36 = tail call i32 @mpz_mul(i32 undef, i32 undef, i32 %2)
%37 = tail call i32 @mpz_mod(i32 undef, i32 undef, i32 %3)
%38 = tail call i32 @mpz_invert(i32 undef, i32 undef, i32 %3)
%39 = tail call i32 @mpz_mul(i32 %5, i32 undef, i32 undef)
%40 = tail call i32 @mpz_mod(i32 %5, i32 %5, i32 %3)
%41 = tail call i32 @mpz_mul(i32 %5, i32 %5, i32 %1)
%42 = tail call i32 @mpz_mod(i32 %5, i32 %5, i32 %3)
%43 = tail call i32 @mpz_sub(i32 %5, i32 %0, i32 %5)
%44 = tail call i32 @mpz_mod(i32 %5, i32 %5, i32 %3)
%45 = tail call i32 @mpz_mul(i32 %5, i32 %5, i32 undef)
%46 = tail call i32 @mpz_mod(i32 %5, i32 %5, i32 %3)
%47 = tail call i32 @mpz_init(i32 undef)
%48 = tail call i32 @mpz_mul(i32 undef, i32 undef, i32 undef)
%49 = tail call i32 @mpz_mod(i32 undef, i32 undef, i32 %3)
%50 = tail call i32 @mpz_mul(i32 undef, i32 undef, i32 %1)
%51 = tail call i32 @mpz_mod(i32 undef, i32 undef, i32 %3)
%52 = tail call i32 @mpz_sub(i32 undef, i32 %0, i32 undef)
%53 = tail call i32 @mpz_mod(i32 undef, i32 undef, i32 %3)
%54 = tail call i32 @mpz_invert(i32 undef, i32 undef, i32 %3)
%55 = tail call i32 @mpz_mul(i32 undef, i32 undef, i32 undef)
%56 = tail call i32 @mpz_mod(i32 undef, i32 undef, i32 %3)
%57 = tail call i32 @mpz_mul_ui(i32 undef, i32 undef, i32 2)
%58 = tail call i32 @mpz_mod(i32 undef, i32 undef, i32 %3)
%59 = tail call i32 @mpz_add_ui(i32 undef, i32 undef, i32 2)
%60 = tail call i32 @mpz_mod(i32 undef, i32 undef, i32 %3)
%61 = tail call i32 @gmp_printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 undef)
%62 = tail call i32 @mpz_clear(i32 undef)
%63 = tail call i32 @mpz_clear(i32 undef)
%64 = tail call i32 @mpz_clear(i32 undef)
%65 = tail call i32 @mpz_clear(i32 undef)
%66 = tail call i32 @mpz_clear(i32 undef)
ret void
}