#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(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpz_add_ui(int /*<<< orphan*/, int /*<<< orphan*/, int);
scalar_t__ mpz_cmp(int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ mpz_cmp_ui(int /*<<< orphan*/, int);
int /*<<< orphan*/ mpz_divexact(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/);
int /*<<< orphan*/ mpz_fdiv_q(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/);
int /*<<< orphan*/ mpz_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_init_set_ui(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpz_mul(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpz_mul_ui(int /*<<< orphan*/, int /*<<< orphan*/, int);
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 /*<<< orphan*/ mpz_ui_sub(int /*<<< orphan*/, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
double sqrt(int);
int main(int argc, char **argv) {
  double x;
  int md = 0, d, a0, t;
  mpz_t m, P, Q, a, pp, pn, qp, qn, tr, tl;
  mpz_init_set_ui(m, 0);
  mpz_init(P);
  mpz_init(Q);
  mpz_init(a);
  mpz_init(pp);
  mpz_init(pn);
  mpz_init(qp);
  mpz_init(qn);
  mpz_init(tr);
  mpz_init(tl);
  for (d = 0; d <= 1000; d++) {
    x = sqrt(d);
    a0 = x;
    if (a0 == x)
      continue;
    mpz_set_ui(P, a0);
    t = d - a0 * a0;
    mpz_set_ui(Q, t);
    t = 2 * a0 / t;
    mpz_set_ui(a, t);
    mpz_set_ui(pp, a0);
    mpz_set_ui(pn, a0 * t + 1);
    mpz_set_ui(qp, 1);
    mpz_set_ui(qn, t);
    while (1) {
      mpz_mul(tr, qn, qn);
      mpz_mul_ui(tr, tr, d);
      mpz_mul(tl, pn, pn);
      mpz_sub(tl, tl, tr);
      if (mpz_cmp_ui(tl, 1) == 0) {
        mpz_set(qp, qn);
        mpz_set(qn, tr);
        if (mpz_cmp(pn, m) > 0) {
          mpz_set(m, pn);
          md = d;
        }
        break;
      }
      mpz_mul(tr, a, Q);
      mpz_sub(P, tr, P);
      mpz_mul(tr, P, P);
      mpz_ui_sub(tr, d, tr);
      mpz_divexact(Q, tr, Q);
      mpz_add_ui(a, P, a0);
      mpz_fdiv_q(a, a, Q);
      mpz_mul(tr, a, pn);
      mpz_add(tr, tr, pp);
      mpz_set(pp, pn);
      mpz_set(pn, tr);
      mpz_mul(tr, a, qn);
      mpz_add(tr, tr, qp);
      mpz_set(qp, qn);
      mpz_set(qn, tr);
    }
  }
  printf("%d\n", md);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x2c(%rbp),%edi
xor    %esi,%esi
call   10e0 <mpz_init_set_ui@plt>
mov    -0x30(%rbp),%edi
call   1080 <mpz_init@plt>
mov    -0x34(%rbp),%edi
call   1080 <mpz_init@plt>
mov    -0x38(%rbp),%edi
call   1080 <mpz_init@plt>
mov    -0x3c(%rbp),%edi
call   1080 <mpz_init@plt>
mov    -0x40(%rbp),%edi
call   1080 <mpz_init@plt>
mov    -0x44(%rbp),%edi
call   1080 <mpz_init@plt>
mov    -0x48(%rbp),%edi
call   1080 <mpz_init@plt>
mov    -0x4c(%rbp),%edi
call   1080 <mpz_init@plt>
mov    -0x50(%rbp),%edi
call   1080 <mpz_init@plt>
movl   $0x0,-0x20(%rbp)
cmpl   $0x3e8,-0x20(%rbp)
jg     1493 <main+0x293>
mov    -0x20(%rbp),%edi
call   1110 <sqrt@plt>
movsd  %xmm0,-0x18(%rbp)
cvttsd2si -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
cvtsi2sdl -0x24(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    12b3 <main+0xb3>
jp     12b3 <main+0xb3>
jmp    1485 <main+0x285>
mov    -0x30(%rbp),%edi
mov    -0x24(%rbp),%esi
call   1100 <mpz_set_ui@plt>
mov    -0x20(%rbp),%eax
mov    -0x24(%rbp),%ecx
imul   -0x24(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x28(%rbp)
mov    -0x34(%rbp),%edi
mov    -0x28(%rbp),%esi
call   1100 <mpz_set_ui@plt>
mov    -0x24(%rbp),%eax
shl    $0x1,%eax
cltd
idivl  -0x28(%rbp)
mov    %eax,-0x28(%rbp)
mov    -0x38(%rbp),%edi
mov    -0x28(%rbp),%esi
call   1100 <mpz_set_ui@plt>
mov    -0x3c(%rbp),%edi
mov    -0x24(%rbp),%esi
call   1100 <mpz_set_ui@plt>
mov    -0x40(%rbp),%edi
mov    -0x24(%rbp),%esi
imul   -0x28(%rbp),%esi
add    $0x1,%esi
call   1100 <mpz_set_ui@plt>
mov    -0x44(%rbp),%edi
mov    $0x1,%esi
call   1100 <mpz_set_ui@plt>
mov    -0x48(%rbp),%edi
mov    -0x28(%rbp),%esi
call   1100 <mpz_set_ui@plt>
mov    -0x4c(%rbp),%edi
mov    -0x48(%rbp),%esi
mov    -0x48(%rbp),%edx
call   10a0 <mpz_mul@plt>
mov    -0x4c(%rbp),%edi
mov    -0x4c(%rbp),%esi
mov    -0x20(%rbp),%edx
call   1120 <mpz_mul_ui@plt>
mov    -0x50(%rbp),%edi
mov    -0x40(%rbp),%esi
mov    -0x40(%rbp),%edx
call   10a0 <mpz_mul@plt>
mov    -0x50(%rbp),%edi
mov    -0x50(%rbp),%esi
mov    -0x4c(%rbp),%edx
call   1050 <mpz_sub@plt>
mov    -0x50(%rbp),%edi
mov    $0x1,%esi
call   10c0 <mpz_cmp_ui@plt>
cmp    $0x0,%rax
jne    13b5 <main+0x1b5>
mov    -0x44(%rbp),%edi
mov    -0x48(%rbp),%esi
call   1040 <mpz_set@plt>
mov    -0x48(%rbp),%edi
mov    -0x4c(%rbp),%esi
call   1040 <mpz_set@plt>
mov    -0x40(%rbp),%edi
mov    -0x2c(%rbp),%esi
call   10f0 <mpz_cmp@plt>
cmp    $0x0,%rax
jle    13b0 <main+0x1b0>
mov    -0x2c(%rbp),%edi
mov    -0x40(%rbp),%esi
call   1040 <mpz_set@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1480 <main+0x280>
mov    -0x4c(%rbp),%edi
mov    -0x38(%rbp),%esi
mov    -0x34(%rbp),%edx
call   10a0 <mpz_mul@plt>
mov    -0x30(%rbp),%edi
mov    -0x4c(%rbp),%esi
mov    -0x30(%rbp),%edx
call   1050 <mpz_sub@plt>
mov    -0x4c(%rbp),%edi
mov    -0x30(%rbp),%esi
mov    -0x30(%rbp),%edx
call   10a0 <mpz_mul@plt>
mov    -0x4c(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x4c(%rbp),%edx
call   1030 <mpz_ui_sub@plt>
mov    -0x34(%rbp),%edi
mov    -0x4c(%rbp),%esi
mov    -0x34(%rbp),%edx
call   10d0 <mpz_divexact@plt>
mov    -0x38(%rbp),%edi
mov    -0x30(%rbp),%esi
mov    -0x24(%rbp),%edx
call   1060 <mpz_add_ui@plt>
mov    -0x38(%rbp),%edi
mov    -0x38(%rbp),%esi
mov    -0x34(%rbp),%edx
call   10b0 <mpz_fdiv_q@plt>
mov    -0x4c(%rbp),%edi
mov    -0x38(%rbp),%esi
mov    -0x40(%rbp),%edx
call   10a0 <mpz_mul@plt>
mov    -0x4c(%rbp),%edi
mov    -0x4c(%rbp),%esi
mov    -0x3c(%rbp),%edx
call   1090 <mpz_add@plt>
mov    -0x3c(%rbp),%edi
mov    -0x40(%rbp),%esi
call   1040 <mpz_set@plt>
mov    -0x40(%rbp),%edi
mov    -0x4c(%rbp),%esi
call   1040 <mpz_set@plt>
mov    -0x4c(%rbp),%edi
mov    -0x38(%rbp),%esi
mov    -0x48(%rbp),%edx
call   10a0 <mpz_mul@plt>
mov    -0x4c(%rbp),%edi
mov    -0x4c(%rbp),%esi
mov    -0x44(%rbp),%edx
call   1090 <mpz_add@plt>
mov    -0x44(%rbp),%edi
mov    -0x48(%rbp),%esi
call   1040 <mpz_set@plt>
mov    -0x48(%rbp),%edi
mov    -0x4c(%rbp),%esi
call   1040 <mpz_set@plt>
jmp    1325 <main+0x125>
jmp    1485 <main+0x285>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1276 <main+0x76>
mov    -0x1c(%rbp),%esi
lea    0xb63(%rip),%rdi
call   1070 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
xor    %esi,%esi
call   10e0 <mpz_init_set_ui@plt>
call   1080 <mpz_init@plt>
call   1080 <mpz_init@plt>
call   1080 <mpz_init@plt>
call   1080 <mpz_init@plt>
call   1080 <mpz_init@plt>
call   1080 <mpz_init@plt>
call   1080 <mpz_init@plt>
call   1080 <mpz_init@plt>
call   1080 <mpz_init@plt>
xor    %ebp,%ebp
jmp    125f <main+0x5f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebp
cmp    $0x3e9,%ebp
je     1375 <main+0x175>
mov    %ebp,%edi
call   1110 <sqrt@plt>
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1276 <main+0x76>
jnp    1250 <main+0x50>
cvttsd2si %xmm0,%ebx
mov    %ebx,%esi
call   1100 <mpz_set_ui@plt>
mov    %ebx,%eax
imul   %ebx,%eax
mov    %ebp,%r15d
sub    %eax,%r15d
mov    %r15d,%esi
call   1100 <mpz_set_ui@plt>
lea    (%rbx,%rbx,1),%eax
cltd
idiv   %r15d
mov    %eax,%r15d
mov    %eax,%esi
call   1100 <mpz_set_ui@plt>
mov    %ebx,%esi
call   1100 <mpz_set_ui@plt>
mov    %r15d,%esi
imul   %ebx,%esi
add    $0x1,%esi
call   1100 <mpz_set_ui@plt>
mov    $0x1,%esi
call   1100 <mpz_set_ui@plt>
mov    %r15d,%esi
call   1100 <mpz_set_ui@plt>
nopl   0x0(%rax)
call   10a0 <mpz_mul@plt>
mov    %ebp,%edx
call   1120 <mpz_mul_ui@plt>
call   10a0 <mpz_mul@plt>
call   1050 <mpz_sub@plt>
mov    $0x1,%esi
call   10c0 <mpz_cmp_ui@plt>
test   %rax,%rax
je     1350 <main+0x150>
call   10a0 <mpz_mul@plt>
call   1050 <mpz_sub@plt>
call   10a0 <mpz_mul@plt>
mov    %ebp,%esi
call   1030 <mpz_ui_sub@plt>
call   10d0 <mpz_divexact@plt>
mov    %ebx,%edx
call   1060 <mpz_add_ui@plt>
call   10b0 <mpz_fdiv_q@plt>
call   10a0 <mpz_mul@plt>
call   1090 <mpz_add@plt>
call   1040 <mpz_set@plt>
call   1040 <mpz_set@plt>
call   10a0 <mpz_mul@plt>
call   1090 <mpz_add@plt>
call   1040 <mpz_set@plt>
call   1040 <mpz_set@plt>
jmp    12d0 <main+0xd0>
cs nopw 0x0(%rax,%rax,1)
call   1040 <mpz_set@plt>
call   1040 <mpz_set@plt>
call   10f0 <mpz_cmp@plt>
test   %rax,%rax
jle    1250 <main+0x50>
call   1040 <mpz_set@plt>
mov    %ebp,%r14d
jmp    1250 <main+0x50>
lea    0xc84(%rip),%rdi
mov    %r14d,%esi
call   1070 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca i32
%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
%20 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
%21 = load i32, i32* %11
%22 = call i32 @mpz_init_set_ui(i32 %21, i32 0)
%23 = load i32, i32* %12
%24 = call i32 @mpz_init(i32 %23)
%25 = load i32, i32* %13
%26 = call i32 @mpz_init(i32 %25)
%27 = load i32, i32* %14
%28 = call i32 @mpz_init(i32 %27)
%29 = load i32, i32* %15
%30 = call i32 @mpz_init(i32 %29)
%31 = load i32, i32* %16
%32 = call i32 @mpz_init(i32 %31)
%33 = load i32, i32* %17
%34 = call i32 @mpz_init(i32 %33)
%35 = load i32, i32* %18
%36 = call i32 @mpz_init(i32 %35)
%37 = load i32, i32* %19
%38 = call i32 @mpz_init(i32 %37)
%39 = load i32, i32* %20
%40 = call i32 @mpz_init(i32 %39)
store i32 0, i32* %8
br label %41
41: ; preds = %182, %2
%42 = load i32, i32* %8
%43 = icmp sle i32 %42, 1000
br i1 %43, label %44, label %185
44: ; preds = %41
%45 = load i32, i32* %8
%46 = call double @sqrt(i32 %45)
store double %46, double* %6
%47 = load double, double* %6
%48 = fptosi double %47 to i32
store i32 %48, i32* %9
%49 = load i32, i32* %9
%50 = sitofp i32 %49 to double
%51 = load double, double* %6
%52 = fcmp oeq double %50, %51
br i1 %52, label %53, label %54
53: ; preds = %44
br label %182
54: ; preds = %44
%55 = load i32, i32* %12
%56 = load i32, i32* %9
%57 = call i32 @mpz_set_ui(i32 %55, i32 %56)
%58 = load i32, i32* %8
%59 = load i32, i32* %9
%60 = load i32, i32* %9
%61 = mul nsw i32 %59, %60
%62 = sub nsw i32 %58, %61
store i32 %62, i32* %10
%63 = load i32, i32* %13
%64 = load i32, i32* %10
%65 = call i32 @mpz_set_ui(i32 %63, i32 %64)
%66 = load i32, i32* %9
%67 = mul nsw i32 2, %66
%68 = load i32, i32* %10
%69 = sdiv i32 %67, %68
store i32 %69, i32* %10
%70 = load i32, i32* %14
%71 = load i32, i32* %10
%72 = call i32 @mpz_set_ui(i32 %70, i32 %71)
%73 = load i32, i32* %15
%74 = load i32, i32* %9
%75 = call i32 @mpz_set_ui(i32 %73, i32 %74)
%76 = load i32, i32* %16
%77 = load i32, i32* %9
%78 = load i32, i32* %10
%79 = mul nsw i32 %77, %78
%80 = add nsw i32 %79, 1
%81 = call i32 @mpz_set_ui(i32 %76, i32 %80)
%82 = load i32, i32* %17
%83 = call i32 @mpz_set_ui(i32 %82, i32 1)
%84 = load i32, i32* %18
%85 = load i32, i32* %10
%86 = call i32 @mpz_set_ui(i32 %84, i32 %85)
br label %87
87: ; preds = %54, %124
%88 = load i32, i32* %19
%89 = load i32, i32* %18
%90 = load i32, i32* %18
%91 = call i32 @mpz_mul(i32 %88, i32 %89, i32 %90)
%92 = load i32, i32* %19
%93 = load i32, i32* %19
%94 = load i32, i32* %8
%95 = call i32 @mpz_mul_ui(i32 %92, i32 %93, i32 %94)
%96 = load i32, i32* %20
%97 = load i32, i32* %16
%98 = load i32, i32* %16
%99 = call i32 @mpz_mul(i32 %96, i32 %97, i32 %98)
%100 = load i32, i32* %20
%101 = load i32, i32* %20
%102 = load i32, i32* %19
%103 = call i32 @mpz_sub(i32 %100, i32 %101, i32 %102)
%104 = load i32, i32* %20
%105 = call i64 @mpz_cmp_ui(i32 %104, i32 1)
%106 = icmp eq i64 %105, 0
br i1 %106, label %107, label %124
107: ; preds = %87
%108 = load i32, i32* %17
%109 = load i32, i32* %18
%110 = call i32 @mpz_set(i32 %108, i32 %109)
%111 = load i32, i32* %18
%112 = load i32, i32* %19
%113 = call i32 @mpz_set(i32 %111, i32 %112)
%114 = load i32, i32* %16
%115 = load i32, i32* %11
%116 = call i64 @mpz_cmp(i32 %114, i32 %115)
%117 = icmp sgt i64 %116, 0
br i1 %117, label %118, label %123
118: ; preds = %107
%119 = load i32, i32* %11
%120 = load i32, i32* %16
%121 = call i32 @mpz_set(i32 %119, i32 %120)
%122 = load i32, i32* %8
store i32 %122, i32* %7
br label %123
123: ; preds = %118, %107
br label %181
124: ; preds = %87
%125 = load i32, i32* %19
%126 = load i32, i32* %14
%127 = load i32, i32* %13
%128 = call i32 @mpz_mul(i32 %125, i32 %126, i32 %127)
%129 = load i32, i32* %12
%130 = load i32, i32* %19
%131 = load i32, i32* %12
%132 = call i32 @mpz_sub(i32 %129, i32 %130, i32 %131)
%133 = load i32, i32* %19
%134 = load i32, i32* %12
%135 = load i32, i32* %12
%136 = call i32 @mpz_mul(i32 %133, i32 %134, i32 %135)
%137 = load i32, i32* %19
%138 = load i32, i32* %8
%139 = load i32, i32* %19
%140 = call i32 @mpz_ui_sub(i32 %137, i32 %138, i32 %139)
%141 = load i32, i32* %13
%142 = load i32, i32* %19
%143 = load i32, i32* %13
%144 = call i32 @mpz_divexact(i32 %141, i32 %142, i32 %143)
%145 = load i32, i32* %14
%146 = load i32, i32* %12
%147 = load i32, i32* %9
%148 = call i32 @mpz_add_ui(i32 %145, i32 %146, i32 %147)
%149 = load i32, i32* %14
%150 = load i32, i32* %14
%151 = load i32, i32* %13
%152 = call i32 @mpz_fdiv_q(i32 %149, i32 %150, i32 %151)
%153 = load i32, i32* %19
%154 = load i32, i32* %14
%155 = load i32, i32* %16
%156 = call i32 @mpz_mul(i32 %153, i32 %154, i32 %155)
%157 = load i32, i32* %19
%158 = load i32, i32* %19
%159 = load i32, i32* %15
%160 = call i32 @mpz_add(i32 %157, i32 %158, i32 %159)
%161 = load i32, i32* %15
%162 = load i32, i32* %16
%163 = call i32 @mpz_set(i32 %161, i32 %162)
%164 = load i32, i32* %16
%165 = load i32, i32* %19
%166 = call i32 @mpz_set(i32 %164, i32 %165)
%167 = load i32, i32* %19
%168 = load i32, i32* %14
%169 = load i32, i32* %18
%170 = call i32 @mpz_mul(i32 %167, i32 %168, i32 %169)
%171 = load i32, i32* %19
%172 = load i32, i32* %19
%173 = load i32, i32* %17
%174 = call i32 @mpz_add(i32 %171, i32 %172, i32 %173)
%175 = load i32, i32* %17
%176 = load i32, i32* %18
%177 = call i32 @mpz_set(i32 %175, i32 %176)
%178 = load i32, i32* %18
%179 = load i32, i32* %19
%180 = call i32 @mpz_set(i32 %178, i32 %179)
br label %87
181: ; preds = %123
br label %182
182: ; preds = %181, %53
%183 = load i32, i32* %8
%184 = add nsw i32 %183, 1
store i32 %184, i32* %8
br label %41
185: ; preds = %41
%186 = load i32, i32* %7
%187 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %186)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @mpz_init_set_ui(i32 undef, i32 0)
%4 = tail call i32 @mpz_init(i32 undef)
%5 = tail call i32 @mpz_init(i32 undef)
%6 = tail call i32 @mpz_init(i32 undef)
%7 = tail call i32 @mpz_init(i32 undef)
%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_init(i32 undef)
br label %13
13: ; preds = %2, %64
%14 = phi i32 [ 0, %2 ], [ %65, %64 ]
%15 = phi i32 [ 0, %2 ], [ %66, %64 ]
%16 = tail call double @sqrt(i32 %15)
%17 = fptosi double %16 to i32
%18 = sitofp i32 %17 to double
%19 = fcmp oeq double %16, %18
br i1 %19, label %64, label %20
20: ; preds = %13
%21 = tail call i32 @mpz_set_ui(i32 undef, i32 %17)
%22 = mul nsw i32 %17, %17
%23 = sub nsw i32 %15, %22
%24 = tail call i32 @mpz_set_ui(i32 undef, i32 %23)
%25 = shl nsw i32 %17, 1
%26 = sdiv i32 %25, %23
%27 = tail call i32 @mpz_set_ui(i32 undef, i32 %26)
%28 = tail call i32 @mpz_set_ui(i32 undef, i32 %17)
%29 = mul nsw i32 %26, %17
%30 = add nsw i32 %29, 1
%31 = tail call i32 @mpz_set_ui(i32 undef, i32 %30)
%32 = tail call i32 @mpz_set_ui(i32 undef, i32 1)
%33 = tail call i32 @mpz_set_ui(i32 undef, i32 %26)
br label %34
34: ; preds = %48, %20
%35 = tail call i32 @mpz_mul(i32 undef, i32 undef, i32 undef)
%36 = tail call i32 @mpz_mul_ui(i32 undef, i32 undef, i32 %15)
%37 = tail call i32 @mpz_mul(i32 undef, i32 undef, i32 undef)
%38 = tail call i32 @mpz_sub(i32 undef, i32 undef, i32 undef)
%39 = tail call i64 @mpz_cmp_ui(i32 undef, i32 1)
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %48
41: ; preds = %34
%42 = tail call i32 @mpz_set(i32 undef, i32 undef)
%43 = tail call i32 @mpz_set(i32 undef, i32 undef)
%44 = tail call i64 @mpz_cmp(i32 undef, i32 undef)
%45 = icmp sgt i64 %44, 0
br i1 %45, label %46, label %64
46: ; preds = %41
%47 = tail call i32 @mpz_set(i32 undef, i32 undef)
br label %64
48: ; preds = %34
%49 = tail call i32 @mpz_mul(i32 undef, i32 undef, i32 undef)
%50 = tail call i32 @mpz_sub(i32 undef, i32 undef, i32 undef)
%51 = tail call i32 @mpz_mul(i32 undef, i32 undef, i32 undef)
%52 = tail call i32 @mpz_ui_sub(i32 undef, i32 %15, i32 undef)
%53 = tail call i32 @mpz_divexact(i32 undef, i32 undef, i32 undef)
%54 = tail call i32 @mpz_add_ui(i32 undef, i32 undef, i32 %17)
%55 = tail call i32 @mpz_fdiv_q(i32 undef, i32 undef, i32 undef)
%56 = tail call i32 @mpz_mul(i32 undef, i32 undef, i32 undef)
%57 = tail call i32 @mpz_add(i32 undef, i32 undef, i32 undef)
%58 = tail call i32 @mpz_set(i32 undef, i32 undef)
%59 = tail call i32 @mpz_set(i32 undef, i32 undef)
%60 = tail call i32 @mpz_mul(i32 undef, i32 undef, i32 undef)
%61 = tail call i32 @mpz_add(i32 undef, i32 undef, i32 undef)
%62 = tail call i32 @mpz_set(i32 undef, i32 undef)
%63 = tail call i32 @mpz_set(i32 undef, i32 undef)
br label %34
64: ; preds = %46, %41, %13
%65 = phi i32 [ %14, %13 ], [ %15, %46 ], [ %14, %41 ]
%66 = add nuw nsw i32 %15, 1
%67 = icmp eq i32 %66, 1001
br i1 %67, label %68, label %13
68: ; preds = %64
%69 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %65)
ret i32 0
}