#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*/ gmp_printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ mpz_add_ui(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ mpz_init_set_str(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ mpz_init_set_ui(int /*<<< orphan*/, int);
int /*<<< orphan*/ mpz_mod(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpz_mul_ui(int /*<<< orphan*/, int /*<<< orphan*/, long);
int /*<<< orphan*/ mpz_powm_ui(int /*<<< orphan*/, int /*<<< orphan*/, long,
                               int /*<<< orphan*/);
int main(void) {
  mpz_t a, _10;
  mpz_init_set_ui(a, 2);
  mpz_init_set_str(_10, "10000000000", 10);
  mpz_powm_ui(a, a, 7830457L, _10);
  mpz_mul_ui(a, a, 28433L);
  mpz_add_ui(a, a, 1);
  mpz_mod(a, a, _10);
  gmp_printf("%Zd\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
call   1050 <mpz_init_set_ui@plt>
mov    -0xc(%rbp),%edi
lea    0xe6a(%rip),%rsi
mov    $0xa,%edx
call   1040 <mpz_init_set_str@plt>
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%ecx
mov    $0x777bb9,%edx
call   1060 <mpz_powm_ui@plt>
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x6f11,%edx
call   1090 <mpz_mul_ui@plt>
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x1,%edx
call   1030 <mpz_add_ui@plt>
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1070 <mpz_mod@plt>
mov    -0x8(%rbp),%esi
lea    0xe21(%rip),%rdi
call   1080 <gmp_printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%esi
call   1050 <mpz_init_set_ui@plt>
lea    0xe7e(%rip),%rsi
mov    $0xa,%edx
call   1040 <mpz_init_set_str@plt>
mov    $0x777bb9,%edx
call   1060 <mpz_powm_ui@plt>
mov    $0x6f11,%edx
call   1090 <mpz_mul_ui@plt>
mov    $0x1,%edx
call   1030 <mpz_add_ui@plt>
call   1070 <mpz_mod@plt>
lea    0xe56(%rip),%rdi
call   1080 <gmp_printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"10000000000\00"
@.str.1 = [5 x i8] c"%Zd\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* %2
%5 = call i32 @mpz_init_set_ui(i32 %4, i32 2)
%6 = load i32, i32* %3
%7 = call i32 @mpz_init_set_str(i32 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 10)
%8 = load i32, i32* %2
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @mpz_powm_ui(i32 %8, i32 %9, i64 7830457, i32 %10)
%12 = load i32, i32* %2
%13 = load i32, i32* %2
%14 = call i32 @mpz_mul_ui(i32 %12, i32 %13, i64 28433)
%15 = load i32, i32* %2
%16 = load i32, i32* %2
%17 = call i32 @mpz_add_ui(i32 %15, i32 %16, i32 1)
%18 = load i32, i32* %2
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = call i32 @mpz_mod(i32 %18, i32 %19, i32 %20)
%22 = load i32, i32* %2
%23 = call i32 @gmp_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %22)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"10000000000\00"
@.str.1 = [5 x i8] c"%Zd\0A\00"
define i32 @main() {
%1 = tail call i32 @mpz_init_set_ui(i32 undef, i32 2)
%2 = tail call i32 @mpz_init_set_str(i32 undef, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 10)
%3 = tail call i32 @mpz_powm_ui(i32 undef, i32 undef, i64 7830457, i32 undef)
%4 = tail call i32 @mpz_mul_ui(i32 undef, i32 undef, i64 28433)
%5 = tail call i32 @mpz_add_ui(i32 undef, i32 undef, i32 1)
%6 = tail call i32 @mpz_mod(i32 undef, i32 undef, i32 undef)
%7 = tail call i32 @gmp_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 undef)
ret i32 0
}