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

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ *fopen(char *, char *);
scalar_t__ fscanf(int /*<<< orphan*/ *, char *, unsigned long *);
int /*<<< orphan*/ mpz_add(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpz_bin_uiui(int /*<<< orphan*/, int, unsigned long);
int /*<<< orphan*/ mpz_clear(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_mul(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpz_mul_si(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/);
int /*<<< orphan*/ mpz_out_str(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int /*<<< orphan*/ mpz_set_ui(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ power(int, unsigned long);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ putchar(char);
int main(int argc, char *argv[]) {
  FILE *fp;
  unsigned long m, i;
  mpz_t r, t1, t2;
  mpz_init(r);
  mpz_init(t1);
  mpz_init(t2);
  if (argc != 2) {
    printf("Usage: %s [FILE]\n", argv[0]);
    return 1;
  }
  fp = fopen(*++argv, "r");
  while (fscanf(fp, "%lu", &m) != EOF) {
    mpz_set_ui(r, 0);
    for (i = 0; i < m / 2; i++) {
      mpz_bin_uiui(t1, m, i);
      mpz_bin_uiui(t2, 11 * m / 2 - 1 - 10 * i, m - 1);
      mpz_mul(t1, t1, t2);
      mpz_mul_si(t1, t1, power(-1, i));
      mpz_add(r, r, t1);
    }
    mpz_out_str(NULL, 10, r);
    putchar('\n');
  }
  mpz_clear(r);
  mpz_clear(t1);
  mpz_clear(t2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x2c(%rbp),%edi
call   1090 <mpz_init@plt>
mov    -0x30(%rbp),%edi
call   1090 <mpz_init@plt>
mov    -0x34(%rbp),%edi
call   1090 <mpz_init@plt>
cmpl   $0x2,-0x8(%rbp)
je     1227 <main+0x57>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xdea(%rip),%rdi
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1361 <main+0x191>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
lea    0xdd1(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xdbf(%rip),%rsi
lea    -0x20(%rbp),%rdx
call   1080 <fscanf@plt>
mov    0x2d83(%rip),%rcx
cmp    (%rcx),%rax
je     1342 <main+0x172>
mov    -0x2c(%rbp),%edi
xor    %esi,%esi
call   10d0 <mpz_set_ui@plt>
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
shr    $0x1,%rcx
cmp    %rcx,%rax
jae    1322 <main+0x152>
mov    -0x30(%rbp),%edi
mov    -0x20(%rbp),%rax
mov    %eax,%esi
mov    -0x28(%rbp),%rdx
call   1070 <mpz_bin_uiui@plt>
mov    -0x34(%rbp),%edi
imul   $0xb,-0x20(%rbp),%rax
shr    $0x1,%rax
sub    $0x1,%rax
imul   $0xa,-0x28(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%esi
mov    -0x20(%rbp),%rdx
sub    $0x1,%rdx
call   1070 <mpz_bin_uiui@plt>
mov    -0x30(%rbp),%edi
mov    -0x30(%rbp),%esi
mov    -0x34(%rbp),%edx
call   10b0 <mpz_mul@plt>
mov    -0x30(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x28(%rbp),%rsi
mov    $0xffffffff,%edi
call   1040 <power@plt>
mov    -0x3c(%rbp),%edi
mov    -0x38(%rbp),%esi
mov    %eax,%edx
call   1050 <mpz_mul_si@plt>
mov    -0x2c(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
call   10a0 <mpz_add@plt>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1280 <main+0xb0>
mov    -0x2c(%rbp),%edx
xor    %eax,%eax
mov    %eax,%edi
mov    $0xa,%esi
call   10c0 <mpz_out_str@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    124a <main+0x7a>
mov    -0x2c(%rbp),%edi
call   10e0 <mpz_clear@plt>
mov    -0x30(%rbp),%edi
call   10e0 <mpz_clear@plt>
mov    -0x34(%rbp),%edi
call   10e0 <mpz_clear@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1090 <mpz_init@plt>
call   1090 <mpz_init@plt>
call   1090 <mpz_init@plt>
cmp    $0x2,%ebp
jne    1239 <main+0x69>
mov    0x8(%rbx),%rdi
lea    0xe13(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,%r12
lea    0xe06(%rip),%rsi
mov    %rsp,%rdx
mov    %rax,%rdi
call   1080 <fscanf@plt>
mov    0x2dc8(%rip),%r13
cmp    0x0(%r13),%rax
jne    125c <main+0x8c>
call   10e0 <mpz_clear@plt>
call   10e0 <mpz_clear@plt>
call   10e0 <mpz_clear@plt>
xor    %eax,%eax
jmp    124d <main+0x7d>
mov    (%rbx),%rsi
lea    0xdbd(%rip),%rdi
call   1060 <printf@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xdb1(%rip),%r14
mov    %rsp,%r15
jmp    129a <main+0xca>
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
mov    $0xa,%esi
call   10c0 <mpz_out_str@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1080 <fscanf@plt>
cmp    0x0(%r13),%rax
je     1226 <main+0x56>
xor    %esi,%esi
call   10d0 <mpz_set_ui@plt>
mov    (%rsp),%rsi
cmp    $0x2,%rsi
jb     1270 <main+0xa0>
mov    $0xffffffff,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdx
call   1070 <mpz_bin_uiui@plt>
mov    (%rsp),%rdx
lea    (%rdx,%rdx,4),%rax
lea    (%rdx,%rax,2),%rsi
shr    %rsi
add    %ebp,%esi
add    $0xffffffffffffffff,%rdx
call   1070 <mpz_bin_uiui@plt>
call   10b0 <mpz_mul@plt>
mov    $0xffffffff,%edi
mov    %rbx,%rsi
call   1040 <power@plt>
mov    %eax,%edx
call   1050 <mpz_mul_si@plt>
call   10a0 <mpz_add@plt>
add    $0x1,%rbx
mov    (%rsp),%rsi
mov    %rsi,%rax
shr    %rax
add    $0xfffffff6,%ebp
cmp    %rax,%rbx
jb     12c0 <main+0xf0>
jmp    1270 <main+0xa0>

LLVM IR (-O0):
@.str = [18 x i8] c"Usage: %s [FILE]\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [4 x i8] c"%lu\00"
@EOF = global i64 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* %9
%13 = call i32 @mpz_init(i32 %12)
%14 = load i32, i32* %10
%15 = call i32 @mpz_init(i32 %14)
%16 = load i32, i32* %11
%17 = call i32 @mpz_init(i32 %16)
%18 = load i32, i32* %4
%19 = icmp ne i32 %18, 2
br i1 %19, label %20, label %25
20: ; preds = %2
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 0
%23 = load i8*, i8** %22
%24 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %23)
store i32 1, i32* %3
br label %88
25: ; preds = %2
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i32 1
store i8** %27, i8*** %5
%28 = load i8*, i8** %27
%29 = call i32* @fopen(i8* %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %29, i32** %6
br label %30
30: ; preds = %77, %25
%31 = load i32*, i32** %6
%32 = call i64 @fscanf(i32* %31, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64* %7)
%33 = load i64, i64* @EOF
%34 = icmp ne i64 %32, %33
br i1 %34, label %35, label %81
35: ; preds = %30
%36 = load i32, i32* %9
%37 = call i32 @mpz_set_ui(i32 %36, i32 0)
store i64 0, i64* %8
br label %38
38: ; preds = %74, %35
%39 = load i64, i64* %8
%40 = load i64, i64* %7
%41 = udiv i64 %40, 2
%42 = icmp ult i64 %39, %41
br i1 %42, label %43, label %77
43: ; preds = %38
%44 = load i32, i32* %10
%45 = load i64, i64* %7
%46 = trunc i64 %45 to i32
%47 = load i64, i64* %8
%48 = call i32 @mpz_bin_uiui(i32 %44, i32 %46, i64 %47)
%49 = load i32, i32* %11
%50 = load i64, i64* %7
%51 = mul i64 11, %50
%52 = udiv i64 %51, 2
%53 = sub i64 %52, 1
%54 = load i64, i64* %8
%55 = mul i64 10, %54
%56 = sub i64 %53, %55
%57 = trunc i64 %56 to i32
%58 = load i64, i64* %7
%59 = sub i64 %58, 1
%60 = call i32 @mpz_bin_uiui(i32 %49, i32 %57, i64 %59)
%61 = load i32, i32* %10
%62 = load i32, i32* %10
%63 = load i32, i32* %11
%64 = call i32 @mpz_mul(i32 %61, i32 %62, i32 %63)
%65 = load i32, i32* %10
%66 = load i32, i32* %10
%67 = load i64, i64* %8
%68 = call i32 @power(i32 -1, i64 %67)
%69 = call i32 @mpz_mul_si(i32 %65, i32 %66, i32 %68)
%70 = load i32, i32* %9
%71 = load i32, i32* %9
%72 = load i32, i32* %10
%73 = call i32 @mpz_add(i32 %70, i32 %71, i32 %72)
br label %74
74: ; preds = %43
%75 = load i64, i64* %8
%76 = add i64 %75, 1
store i64 %76, i64* %8
br label %38
77: ; preds = %38
%78 = load i32, i32* %9
%79 = call i32 @mpz_out_str(i32* null, i32 10, i32 %78)
%80 = call i32 @putchar(i8 signext 10)
br label %30
81: ; preds = %30
%82 = load i32, i32* %9
%83 = call i32 @mpz_clear(i32 %82)
%84 = load i32, i32* %10
%85 = call i32 @mpz_clear(i32 %84)
%86 = load i32, i32* %11
%87 = call i32 @mpz_clear(i32 %86)
store i32 0, i32* %3
br label %88
88: ; preds = %81, %20
%89 = load i32, i32* %3
ret i32 %89
}

LLVM IR (-O2):
@.str = [18 x i8] c"Usage: %s [FILE]\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [4 x i8] c"%lu\00"
@EOF = global i64 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%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 = icmp eq i32 %0, 2
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load i8*, i8** %1
%11 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %55
12: ; preds = %2
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = tail call i32* @fopen(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%16 = call i64 @fscanf(i32* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64* %3)
%17 = load i64, i64* @EOF
%18 = icmp eq i64 %16, %17
br i1 %18, label %51, label %19
19: ; preds = %12, %45
%20 = call i32 @mpz_set_ui(i32 undef, i32 0)
%21 = load i64, i64* %3
%22 = icmp ult i64 %21, 2
br i1 %22, label %45, label %23
23: ; preds = %19, %23
%24 = phi i64 [ %42, %23 ], [ %21, %19 ]
%25 = phi i64 [ %41, %23 ], [ 0, %19 ]
%26 = trunc i64 %24 to i32
%27 = call i32 @mpz_bin_uiui(i32 undef, i32 %26, i64 %25)
%28 = load i64, i64* %3
%29 = mul i64 %28, 11
%30 = lshr i64 %29, 1
%31 = mul i64 %25, -10
%32 = add i64 %31, 4294967295
%33 = add i64 %32, %30
%34 = trunc i64 %33 to i32
%35 = add i64 %28, -1
%36 = call i32 @mpz_bin_uiui(i32 undef, i32 %34, i64 %35)
%37 = call i32 @mpz_mul(i32 undef, i32 undef, i32 undef)
%38 = call i32 @power(i32 -1, i64 %25)
%39 = call i32 @mpz_mul_si(i32 undef, i32 undef, i32 %38)
%40 = call i32 @mpz_add(i32 undef, i32 undef, i32 undef)
%41 = add nuw nsw i64 %25, 1
%42 = load i64, i64* %3
%43 = lshr i64 %42, 1
%44 = icmp ult i64 %41, %43
br i1 %44, label %23, label %45
45: ; preds = %23, %19
%46 = call i32 @mpz_out_str(i32* null, i32 10, i32 undef)
%47 = call i32 @putchar(i8 signext 10)
%48 = call i64 @fscanf(i32* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64* %3)
%49 = load i64, i64* @EOF
%50 = icmp eq i64 %48, %49
br i1 %50, label %51, label %19
51: ; preds = %45, %12
%52 = call i32 @mpz_clear(i32 undef)
%53 = call i32 @mpz_clear(i32 undef)
%54 = call i32 @mpz_clear(i32 undef)
br label %55
55: ; preds = %51, %9
%56 = phi i32 [ 1, %9 ], [ 0, %51 ]
ret i32 %56
}