#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*/ mpf_t;

/* Variables and functions */
int /*<<< orphan*/ mpf_div(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpf_init2(int /*<<< orphan*/, int);
int /*<<< orphan*/ mpf_mul_ui(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ mpf_out_str(int /*<<< orphan*/, int, int /*<<< orphan*/,
                               int /*<<< orphan*/);
int /*<<< orphan*/ mpf_set_ui(int /*<<< orphan*/, int);
int /*<<< orphan*/ mpf_set_z(int /*<<< orphan*/, int /*<<< orphan*/);
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*/, unsigned long);
int /*<<< orphan*/ mpz_init2(int /*<<< orphan*/, int);
int /*<<< orphan*/ mpz_mul(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpz_mul_ui(int /*<<< orphan*/, int /*<<< orphan*/,
                              unsigned long);
int /*<<< orphan*/ mpz_set(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpz_set_ui(int /*<<< orphan*/, unsigned long);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
void circle(unsigned long size) {
  mpz_t in, temp, temp2, size2, x, y;
  mpz_init2(in, 1024);
  mpz_init2(temp, 1024);
  mpz_init2(temp2, 1024);
  mpz_init2(size2, 1024);
  mpz_init2(x, 1024);
  mpz_init2(y, 1024);
  mpz_set_ui(size2, size);
  mpz_mul_ui(size2, size2, size);
  mpz_set_ui(x, 0);
  mpz_set_ui(y, 0);
  while (1) {
    mpz_set(temp, x);
    mpz_mul(temp, temp, x);
    mpz_set(temp2, y);
    mpz_mul(temp2, temp2, y);
    mpz_add(temp, temp, temp2);
    if (mpz_cmp(temp, size2) <= 0) {
      mpz_add_ui(in, in, 1);
      mpz_add_ui(x, x, 1);
    } else {
      mpz_add_ui(y, y, 1);
      if (mpz_cmp_ui(y, size) > 0)
        break;
      mpz_set_ui(x, 0);
    }
  }
  mpf_t pi, tot;
  mpf_init2(pi, 1024);
  mpf_set_z(pi, in);
  mpf_init2(tot, 1024);
  mpf_set_ui(tot, ((int)(size + 1) * (size + 1)));
  mpf_div(pi, pi, tot);
  mpf_mul_ui(pi, pi, 4);
  printf("Size:%d\n", size);
  mpf_out_str(stdout, 10, 0, pi);
  printf("\n");
}


x86 assembly (clang, -O0):
<circle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x400,%esi
call   10f0 <mpz_init2@plt>
mov    -0x10(%rbp),%edi
mov    $0x400,%esi
call   10f0 <mpz_init2@plt>
mov    -0x14(%rbp),%edi
mov    $0x400,%esi
call   10f0 <mpz_init2@plt>
mov    -0x18(%rbp),%edi
mov    $0x400,%esi
call   10f0 <mpz_init2@plt>
mov    -0x1c(%rbp),%edi
mov    $0x400,%esi
call   10f0 <mpz_init2@plt>
mov    -0x20(%rbp),%edi
mov    $0x400,%esi
call   10f0 <mpz_init2@plt>
mov    -0x18(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   10e0 <mpz_set_ui@plt>
mov    -0x18(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x8(%rbp),%rdx
call   1110 <mpz_mul_ui@plt>
mov    -0x1c(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   10e0 <mpz_set_ui@plt>
mov    -0x20(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   10e0 <mpz_set_ui@plt>
mov    -0x10(%rbp),%edi
mov    -0x1c(%rbp),%esi
call   1030 <mpz_set@plt>
mov    -0x10(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1070 <mpz_mul@plt>
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1030 <mpz_set@plt>
mov    -0x14(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%edx
call   1070 <mpz_mul@plt>
mov    -0x10(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1060 <mpz_add@plt>
mov    -0x10(%rbp),%edi
mov    -0x18(%rbp),%esi
call   10d0 <mpz_cmp@plt>
cmp    $0x0,%rax
jg     1307 <circle+0x107>
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
call   1040 <mpz_add_ui@plt>
mov    -0x1c(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    $0x1,%edx
call   1040 <mpz_add_ui@plt>
jmp    133e <circle+0x13e>
mov    -0x20(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    $0x1,%edx
call   1040 <mpz_add_ui@plt>
mov    -0x20(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   10b0 <mpz_cmp_ui@plt>
cmp    $0x0,%rax
jle    1332 <circle+0x132>
jmp    1343 <circle+0x143>
mov    -0x1c(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   10e0 <mpz_set_ui@plt>
jmp    128d <circle+0x8d>
mov    -0x24(%rbp),%edi
mov    $0x400,%esi
call   1120 <mpf_init2@plt>
mov    -0x24(%rbp),%edi
mov    -0xc(%rbp),%esi
call   10a0 <mpf_set_z@plt>
mov    -0x28(%rbp),%edi
mov    $0x400,%esi
call   1120 <mpf_init2@plt>
mov    -0x28(%rbp),%edi
mov    -0x8(%rbp),%rax
add    $0x1,%rax
cltq
mov    -0x8(%rbp),%rcx
add    $0x1,%rcx
imul   %rcx,%rax
mov    %eax,%esi
call   1080 <mpf_set_ui@plt>
mov    -0x24(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
call   1100 <mpf_div@plt>
mov    -0x24(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    $0x4,%edx
call   1090 <mpf_mul_ui@plt>
mov    -0x8(%rbp),%rsi
lea    0xc4f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2c21(%rip),%rax
mov    (%rax),%edi
mov    -0x24(%rbp),%ecx
mov    $0xa,%esi
xor    %edx,%edx
call   10c0 <mpf_out_str@plt>
lea    0xc30(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circle>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x400,%esi
call   1100 <mpz_init2@plt>
mov    $0x400,%esi
call   1100 <mpz_init2@plt>
mov    $0x400,%esi
call   1100 <mpz_init2@plt>
mov    $0x400,%esi
call   1100 <mpz_init2@plt>
mov    $0x400,%esi
call   1100 <mpz_init2@plt>
mov    $0x400,%esi
call   1100 <mpz_init2@plt>
mov    %r14,%rsi
call   10f0 <mpz_set_ui@plt>
mov    %r14,%rdx
call   1120 <mpz_mul_ui@plt>
xor    %esi,%esi
call   10f0 <mpz_set_ui@plt>
jmp    127d <circle+0x6d>
nopl   0x0(%rax)
mov    %r14,%rsi
call   10c0 <mpz_cmp_ui@plt>
test   %rax,%rax
jg     12c0 <circle+0xb0>
xor    %esi,%esi
call   10f0 <mpz_set_ui@plt>
call   1040 <mpz_set@plt>
call   1080 <mpz_mul@plt>
call   1040 <mpz_set@plt>
call   1080 <mpz_mul@plt>
call   1070 <mpz_add@plt>
call   10e0 <mpz_cmp@plt>
mov    %rax,%rbx
mov    $0x1,%edx
call   1050 <mpz_add_ui@plt>
test   %rbx,%rbx
jg     1270 <circle+0x60>
mov    $0x1,%edx
call   1050 <mpz_add_ui@plt>
jmp    1284 <circle+0x74>
mov    $0x400,%esi
call   1130 <mpf_init2@plt>
call   10b0 <mpf_set_z@plt>
mov    $0x400,%esi
call   1130 <mpf_init2@plt>
lea    0x1(%r14),%esi
imul   %esi,%esi
call   1090 <mpf_set_ui@plt>
call   1110 <mpf_div@plt>
mov    $0x4,%edx
call   10a0 <mpf_mul_ui@plt>
lea    0xd05(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2cd4(%rip),%rax
mov    (%rax),%edi
mov    $0xa,%esi
xor    %edx,%edx
call   10d0 <mpf_out_str@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Size:%d\0A\00"
@stdout = global i32 0
@.str.1 = [2 x i8] c"\0A\00"
define void @circle(i64 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i64 %0, i64* %2
%11 = load i32, i32* %3
%12 = call i32 @mpz_init2(i32 %11, i32 1024)
%13 = load i32, i32* %4
%14 = call i32 @mpz_init2(i32 %13, i32 1024)
%15 = load i32, i32* %5
%16 = call i32 @mpz_init2(i32 %15, i32 1024)
%17 = load i32, i32* %6
%18 = call i32 @mpz_init2(i32 %17, i32 1024)
%19 = load i32, i32* %7
%20 = call i32 @mpz_init2(i32 %19, i32 1024)
%21 = load i32, i32* %8
%22 = call i32 @mpz_init2(i32 %21, i32 1024)
%23 = load i32, i32* %6
%24 = load i64, i64* %2
%25 = call i32 @mpz_set_ui(i32 %23, i64 %24)
%26 = load i32, i32* %6
%27 = load i32, i32* %6
%28 = load i64, i64* %2
%29 = call i32 @mpz_mul_ui(i32 %26, i32 %27, i64 %28)
%30 = load i32, i32* %7
%31 = call i32 @mpz_set_ui(i32 %30, i64 0)
%32 = load i32, i32* %8
%33 = call i32 @mpz_set_ui(i32 %32, i64 0)
br label %34
34: ; preds = %1, %76
%35 = load i32, i32* %4
%36 = load i32, i32* %7
%37 = call i32 @mpz_set(i32 %35, i32 %36)
%38 = load i32, i32* %4
%39 = load i32, i32* %4
%40 = load i32, i32* %7
%41 = call i32 @mpz_mul(i32 %38, i32 %39, i32 %40)
%42 = load i32, i32* %5
%43 = load i32, i32* %8
%44 = call i32 @mpz_set(i32 %42, i32 %43)
%45 = load i32, i32* %5
%46 = load i32, i32* %5
%47 = load i32, i32* %8
%48 = call i32 @mpz_mul(i32 %45, i32 %46, i32 %47)
%49 = load i32, i32* %4
%50 = load i32, i32* %4
%51 = load i32, i32* %5
%52 = call i32 @mpz_add(i32 %49, i32 %50, i32 %51)
%53 = load i32, i32* %4
%54 = load i32, i32* %6
%55 = call i64 @mpz_cmp(i32 %53, i32 %54)
%56 = icmp sle i64 %55, 0
br i1 %56, label %57, label %64
57: ; preds = %34
%58 = load i32, i32* %3
%59 = load i32, i32* %3
%60 = call i32 @mpz_add_ui(i32 %58, i32 %59, i32 1)
%61 = load i32, i32* %7
%62 = load i32, i32* %7
%63 = call i32 @mpz_add_ui(i32 %61, i32 %62, i32 1)
br label %76
64: ; preds = %34
%65 = load i32, i32* %8
%66 = load i32, i32* %8
%67 = call i32 @mpz_add_ui(i32 %65, i32 %66, i32 1)
%68 = load i32, i32* %8
%69 = load i64, i64* %2
%70 = call i64 @mpz_cmp_ui(i32 %68, i64 %69)
%71 = icmp sgt i64 %70, 0
br i1 %71, label %72, label %73
72: ; preds = %64
br label %77
73: ; preds = %64
%74 = load i32, i32* %7
%75 = call i32 @mpz_set_ui(i32 %74, i64 0)
br label %76
76: ; preds = %73, %57
br label %34
77: ; preds = %72
%78 = load i32, i32* %9
%79 = call i32 @mpf_init2(i32 %78, i32 1024)
%80 = load i32, i32* %9
%81 = load i32, i32* %3
%82 = call i32 @mpf_set_z(i32 %80, i32 %81)
%83 = load i32, i32* %10
%84 = call i32 @mpf_init2(i32 %83, i32 1024)
%85 = load i32, i32* %10
%86 = load i64, i64* %2
%87 = add i64 %86, 1
%88 = trunc i64 %87 to i32
%89 = sext i32 %88 to i64
%90 = load i64, i64* %2
%91 = add i64 %90, 1
%92 = mul i64 %89, %91
%93 = trunc i64 %92 to i32
%94 = call i32 @mpf_set_ui(i32 %85, i32 %93)
%95 = load i32, i32* %9
%96 = load i32, i32* %9
%97 = load i32, i32* %10
%98 = call i32 @mpf_div(i32 %95, i32 %96, i32 %97)
%99 = load i32, i32* %9
%100 = load i32, i32* %9
%101 = call i32 @mpf_mul_ui(i32 %99, i32 %100, i32 4)
%102 = load i64, i64* %2
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 %102)
%104 = load i32, i32* @stdout
%105 = load i32, i32* %9
%106 = call i32 @mpf_out_str(i32 %104, i32 10, i32 0, i32 %105)
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"Size:%d\0A\00"
@stdout = global i32 0
define void @circle(i64 %0) {
%2 = tail call i32 @mpz_init2(i32 undef, i32 1024)
%3 = tail call i32 @mpz_init2(i32 undef, i32 1024)
%4 = tail call i32 @mpz_init2(i32 undef, i32 1024)
%5 = tail call i32 @mpz_init2(i32 undef, i32 1024)
%6 = tail call i32 @mpz_init2(i32 undef, i32 1024)
%7 = tail call i32 @mpz_init2(i32 undef, i32 1024)
%8 = tail call i32 @mpz_set_ui(i32 undef, i64 %0)
%9 = tail call i32 @mpz_mul_ui(i32 undef, i32 undef, i64 %0)
%10 = tail call i32 @mpz_set_ui(i32 undef, i64 0)
%11 = tail call i32 @mpz_set_ui(i32 undef, i64 0)
br label %12
12: ; preds = %28, %1
%13 = tail call i32 @mpz_set(i32 undef, i32 undef)
%14 = tail call i32 @mpz_mul(i32 undef, i32 undef, i32 undef)
%15 = tail call i32 @mpz_set(i32 undef, i32 undef)
%16 = tail call i32 @mpz_mul(i32 undef, i32 undef, i32 undef)
%17 = tail call i32 @mpz_add(i32 undef, i32 undef, i32 undef)
%18 = tail call i64 @mpz_cmp(i32 undef, i32 undef)
%19 = icmp slt i64 %18, 1
%20 = tail call i32 @mpz_add_ui(i32 undef, i32 undef, i32 1)
br i1 %19, label %21, label %23
21: ; preds = %12
%22 = tail call i32 @mpz_add_ui(i32 undef, i32 undef, i32 1)
br label %28
23: ; preds = %12
%24 = tail call i64 @mpz_cmp_ui(i32 undef, i64 %0)
%25 = icmp sgt i64 %24, 0
br i1 %25, label %29, label %26
26: ; preds = %23
%27 = tail call i32 @mpz_set_ui(i32 undef, i64 0)
br label %28
28: ; preds = %26, %21
br label %12
29: ; preds = %23
%30 = tail call i32 @mpf_init2(i32 undef, i32 1024)
%31 = tail call i32 @mpf_set_z(i32 undef, i32 undef)
%32 = tail call i32 @mpf_init2(i32 undef, i32 1024)
%33 = add i64 %0, 1
%34 = shl i64 %33, 32
%35 = ashr exact i64 %34, 32
%36 = mul i64 %35, %33
%37 = trunc i64 %36 to i32
%38 = tail call i32 @mpf_set_ui(i32 undef, i32 %37)
%39 = tail call i32 @mpf_div(i32 undef, i32 undef, i32 undef)
%40 = tail call i32 @mpf_mul_ui(i32 undef, i32 undef, i32 4)
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 %0)
%42 = load i32, i32* @stdout
%43 = tail call i32 @mpf_out_str(i32 %42, i32 10, i32 0, i32 undef)
%44 = tail call i32 @putchar(i32 10)
ret void
}