#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_divexact(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/);
int /*<<< orphan*/ mpz_fac_ui(int /*<<< orphan*/, int);
int /*<<< orphan*/ mpz_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_mul(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int main(void) {
  mpz_t a, b;
  mpz_init(a);
  mpz_init(b);
  mpz_fac_ui(a, 40);
  mpz_fac_ui(b, 20);
  mpz_mul(b, b, b);
  mpz_divexact(a, a, b);
  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
call   1030 <mpz_init@plt>
mov    -0xc(%rbp),%edi
call   1030 <mpz_init@plt>
mov    -0x8(%rbp),%edi
mov    $0x28,%esi
call   1050 <mpz_fac_ui@plt>
mov    -0xc(%rbp),%edi
mov    $0x14,%esi
call   1050 <mpz_fac_ui@plt>
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <mpz_mul@plt>
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1060 <mpz_divexact@plt>
mov    -0x8(%rbp),%esi
lea    0xe51(%rip),%rdi
call   1070 <gmp_printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <mpz_init@plt>
call   1030 <mpz_init@plt>
mov    $0x28,%esi
call   1050 <mpz_fac_ui@plt>
mov    $0x14,%esi
call   1050 <mpz_fac_ui@plt>
call   1040 <mpz_mul@plt>
call   1060 <mpz_divexact@plt>
lea    0xe80(%rip),%rdi
call   1070 <gmp_printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [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(i32 %4)
%6 = load i32, i32* %3
%7 = call i32 @mpz_init(i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @mpz_fac_ui(i32 %8, i32 40)
%10 = load i32, i32* %3
%11 = call i32 @mpz_fac_ui(i32 %10, i32 20)
%12 = load i32, i32* %3
%13 = load i32, i32* %3
%14 = load i32, i32* %3
%15 = call i32 @mpz_mul(i32 %12, i32 %13, i32 %14)
%16 = load i32, i32* %2
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = call i32 @mpz_divexact(i32 %16, i32 %17, i32 %18)
%20 = load i32, i32* %2
%21 = call i32 @gmp_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%Zd\0A\00"
define i32 @main() {
%1 = tail call i32 @mpz_init(i32 undef)
%2 = tail call i32 @mpz_init(i32 undef)
%3 = tail call i32 @mpz_fac_ui(i32 undef, i32 40)
%4 = tail call i32 @mpz_fac_ui(i32 undef, i32 20)
%5 = tail call i32 @mpz_mul(i32 undef, i32 undef, i32 undef)
%6 = tail call i32 @mpz_divexact(i32 undef, i32 undef, i32 undef)
%7 = tail call i32 @gmp_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 undef)
ret i32 0
}