#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 mp_limb_t;

/* Variables and functions */
int CHAR_BIT;
int GMP_LIMB_BITS;
scalar_t__ GMP_NAIL_BITS;
scalar_t__ GMP_NUMB_BITS;
int MPFR_VERSION_MAJOR;
int MPFR_VERSION_MINOR;
int MPFR_VERSION_PATCHLEVEL;
char *MPFR_VERSION_STRING;
int __GNU_MP_VERSION;
int __GNU_MP_VERSION_MINOR;
int __GNU_MP_VERSION_PATCHLEVEL;
int /*<<< orphan*/ failure_test();
char *gmp_version;
int mp_bits_per_limb;
char *mpfr_get_patches();
char *mpfr_get_version();
unsigned long mpn_popcount(int *, int);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  unsigned long c;
  mp_limb_t t[4] = {-1, -1, -1, -1};
  printf("GMP .....  Library: %-12s  Header: %d.%d.%d\n", gmp_version,
         __GNU_MP_VERSION, __GNU_MP_VERSION_MINOR, __GNU_MP_VERSION_PATCHLEVEL);
  printf("MPFR ....  Library: %-12s  Header: %s (based on %d.%d.%d)\n",
         mpfr_get_version(), MPFR_VERSION_STRING, MPFR_VERSION_MAJOR,
         MPFR_VERSION_MINOR, MPFR_VERSION_PATCHLEVEL);
  printf("MPFR patches: %s\n\n", mpfr_get_patches());
  printf("GMP_LIMB_BITS     = %d\n", (int)GMP_LIMB_BITS);
  printf("GMP_NAIL_BITS     = %d\n", (int)GMP_NAIL_BITS);
  printf("GMP_NUMB_BITS     = %d\n", (int)GMP_NUMB_BITS);
  printf("mp_bits_per_limb  = %d\n", (int)mp_bits_per_limb);
  printf("sizeof(mp_limb_t) = %d\n", (int)sizeof(mp_limb_t));
  if (mp_bits_per_limb != GMP_LIMB_BITS)
    printf("Warning! mp_bits_per_limb != GMP_LIMB_BITS\n");
  if (GMP_LIMB_BITS != sizeof(mp_limb_t) * CHAR_BIT)
    printf("Warning! GMP_LIMB_BITS != sizeof(mp_limb_t) * CHAR_BIT\n");
  c = mpn_popcount(t, 1);
  printf("The GMP library expects %lu bits in a mp_limb_t.\n", c);
  if (c != GMP_LIMB_BITS)
    printf("Warning! This is different from GMP_LIMB_BITS!\n"
           "Different ABI caused by a GMP library upgrade?\n");
  failure_test();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe9a(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe97(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e04(%rip),%rax
mov    (%rax),%rsi
mov    0x2e52(%rip),%rax
mov    (%rax),%edx
mov    0x2e09(%rip),%rax
mov    (%rax),%ecx
mov    0x2e08(%rip),%rax
mov    (%rax),%r8d
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <mpfr_get_version@plt>
mov    %rax,%rsi
mov    0x2e3e(%rip),%rax
mov    (%rax),%rdx
mov    0x2dfc(%rip),%rax
mov    (%rax),%ecx
mov    0x2dc3(%rip),%rax
mov    (%rax),%r8d
mov    0x2db1(%rip),%rax
mov    (%rax),%r9d
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <mpfr_get_patches@plt>
mov    %rax,%rsi
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2dc1(%rip),%rax
mov    (%rax),%esi
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2dc2(%rip),%rax
mov    (%rax),%rax
mov    %eax,%esi
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2d70(%rip),%rax
mov    (%rax),%rax
mov    %eax,%esi
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2d7e(%rip),%rax
mov    (%rax),%esi
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe82(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2d54(%rip),%rax
mov    (%rax),%eax
mov    0x2d43(%rip),%rcx
cmp    (%rcx),%eax
je     129b <main+0x14b>
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2d26(%rip),%rax
movslq (%rax),%rax
mov    0x2d04(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
cmp    %rcx,%rax
je     12ca <main+0x17a>
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x1,%esi
call   1060 <mpn_popcount@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x2ccf(%rip),%rcx
movslq (%rcx),%rcx
cmp    %rcx,%rax
je     1313 <main+0x1c3>
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <failure_test@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
pcmpeqd %xmm0,%xmm0
movdqa %xmm0,(%rsp)
mov    0x2e09(%rip),%rax
mov    (%rax),%rsi
mov    0x2e57(%rip),%rax
mov    (%rax),%edx
mov    0x2e0e(%rip),%rax
mov    (%rax),%ecx
mov    0x2e0d(%rip),%rax
mov    (%rax),%r8d
lea    0xe63(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1080 <mpfr_get_version@plt>
mov    0x2e46(%rip),%rcx
mov    (%rcx),%rdx
mov    0x2e04(%rip),%rcx
mov    (%rcx),%ecx
mov    0x2dcb(%rip),%rsi
mov    (%rsi),%r8d
mov    0x2db9(%rip),%rsi
mov    (%rsi),%r9d
lea    0xe54(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <mpfr_get_patches@plt>
lea    0xe77(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2dc6(%rip),%r14
mov    (%r14),%esi
lea    0xe6f(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2dc6(%rip),%rax
mov    (%rax),%esi
lea    0xe70(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2d77(%rip),%rax
mov    (%rax),%esi
lea    0xe71(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2d88(%rip),%rbx
mov    (%rbx),%esi
lea    0xe72(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe7c(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rbx),%eax
cmp    (%r14),%eax
je     1281 <main+0x121>
lea    0xf41(%rip),%rdi
call   1040 <puts@plt>
mov    (%r14),%eax
cltq
mov    0x2d26(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
cmp    %rax,%rcx
je     12a2 <main+0x142>
lea    0xee6(%rip),%rdi
call   1040 <puts@plt>
mov    %rsp,%rdi
mov    $0x1,%esi
call   1070 <mpn_popcount@plt>
mov    %rax,%rbx
lea    0xe3a(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
movslq (%r14),%rax
cmp    %rax,%rbx
je     12d7 <main+0x177>
lea    0xe53(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <failure_test@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.t = [4 x i32] [i32 -1, i32 -1, i32 -1, i32 -1]
@.str = [45 x i8] c"GMP ..... Library: %-12s Header: %d.%d.%d\0A\00"
@gmp_version = global i8* null
@__GNU_MP_VERSION = global i32 0
@__GNU_MP_VERSION_MINOR = global i32 0
@__GNU_MP_VERSION_PATCHLEVEL = global i32 0
@.str.1 = [59 x i8] c"MPFR .... Library: %-12s Header: %s (based on %d.%d.%d)\0A\00"
@MPFR_VERSION_STRING = global i8* null
@MPFR_VERSION_MAJOR = global i32 0
@MPFR_VERSION_MINOR = global i32 0
@MPFR_VERSION_PATCHLEVEL = global i32 0
@.str.2 = [19 x i8] c"MPFR patches: %s\0A\0A\00"
@.str.3 = [24 x i8] c"GMP_LIMB_BITS = %d\0A\00"
@GMP_LIMB_BITS = global i32 0
@.str.4 = [24 x i8] c"GMP_NAIL_BITS = %d\0A\00"
@GMP_NAIL_BITS = global i64 0
@.str.5 = [24 x i8] c"GMP_NUMB_BITS = %d\0A\00"
@GMP_NUMB_BITS = global i64 0
@.str.6 = [24 x i8] c"mp_bits_per_limb = %d\0A\00"
@mp_bits_per_limb = global i32 0
@.str.7 = [24 x i8] c"sizeof(mp_limb_t) = %d\0A\00"
@.str.8 = [44 x i8] c"Warning! mp_bits_per_limb != GMP_LIMB_BITS\0A\00"
@CHAR_BIT = global i32 0
@.str.9 = [56 x i8] c"Warning! GMP_LIMB_BITS != sizeof(mp_limb_t) * CHAR_BIT\0A\00"
@.str.10 = [50 x i8] c"The GMP library expects %lu bits in a mp_limb_t.\0A\00"
@.str.11 = [95 x i8] c"Warning! This is different from GMP_LIMB_BITS!\0ADifferent ABI caused by a GMP library upgrade?\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca [4 x i32]
store i32 0, i32* %1
%4 = bitcast [4 x i32]* %3 to i8*
%5 = load i8*, i8** @gmp_version
%6 = load i32, i32* @__GNU_MP_VERSION
%7 = load i32, i32* @__GNU_MP_VERSION_MINOR
%8 = load i32, i32* @__GNU_MP_VERSION_PATCHLEVEL
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6, i32 %7, i32 %8)
%10 = call i8* (...) @mpfr_get_version()
%11 = load i8*, i8** @MPFR_VERSION_STRING
%12 = load i32, i32* @MPFR_VERSION_MAJOR
%13 = load i32, i32* @MPFR_VERSION_MINOR
%14 = load i32, i32* @MPFR_VERSION_PATCHLEVEL
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0), i8* %10, i8* %11, i32 %12, i32 %13, i32 %14)
%16 = call i8* (...) @mpfr_get_patches()
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %16)
%18 = load i32, i32* @GMP_LIMB_BITS
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %18)
%20 = load i64, i64* @GMP_NAIL_BITS
%21 = trunc i64 %20 to i32
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %21)
%23 = load i64, i64* @GMP_NUMB_BITS
%24 = trunc i64 %23 to i32
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i32 %24)
%26 = load i32, i32* @mp_bits_per_limb
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i32 %26)
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i32 4)
%29 = load i32, i32* @mp_bits_per_limb
%30 = load i32, i32* @GMP_LIMB_BITS
%31 = icmp ne i32 %29, %30
br i1 %31, label %32, label %34
32: ; preds = %0
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0))
br label %34
34: ; preds = %32, %0
%35 = load i32, i32* @GMP_LIMB_BITS
%36 = sext i32 %35 to i64
%37 = load i32, i32* @CHAR_BIT
%38 = sext i32 %37 to i64
%39 = mul i64 4, %38
%40 = icmp ne i64 %36, %39
br i1 %40, label %41, label %43
41: ; preds = %34
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.9, i64 0, i64 0))
br label %43
43: ; preds = %41, %34
%44 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%45 = call i64 @mpn_popcount(i32* %44, i32 1)
store i64 %45, i64* %2
%46 = load i64, i64* %2
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.10, i64 0, i64 0), i64 %46)
%48 = load i64, i64* %2
%49 = load i32, i32* @GMP_LIMB_BITS
%50 = sext i32 %49 to i64
%51 = icmp ne i64 %48, %50
br i1 %51, label %52, label %54
52: ; preds = %43
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str.11, i64 0, i64 0))
br label %54
54: ; preds = %52, %43
%55 = call i32 (...) @failure_test()
ret i32 0
}

LLVM IR (-O2):
@.str = [45 x i8] c"GMP ..... Library: %-12s Header: %d.%d.%d\0A\00"
@gmp_version = global i8* null
@__GNU_MP_VERSION = global i32 0
@__GNU_MP_VERSION_MINOR = global i32 0
@__GNU_MP_VERSION_PATCHLEVEL = global i32 0
@.str.1 = [59 x i8] c"MPFR .... Library: %-12s Header: %s (based on %d.%d.%d)\0A\00"
@MPFR_VERSION_STRING = global i8* null
@MPFR_VERSION_MAJOR = global i32 0
@MPFR_VERSION_MINOR = global i32 0
@MPFR_VERSION_PATCHLEVEL = global i32 0
@.str.2 = [19 x i8] c"MPFR patches: %s\0A\0A\00"
@.str.3 = [24 x i8] c"GMP_LIMB_BITS = %d\0A\00"
@GMP_LIMB_BITS = global i32 0
@.str.4 = [24 x i8] c"GMP_NAIL_BITS = %d\0A\00"
@GMP_NAIL_BITS = global i64 0
@.str.5 = [24 x i8] c"GMP_NUMB_BITS = %d\0A\00"
@GMP_NUMB_BITS = global i64 0
@.str.6 = [24 x i8] c"mp_bits_per_limb = %d\0A\00"
@mp_bits_per_limb = global i32 0
@.str.7 = [24 x i8] c"sizeof(mp_limb_t) = %d\0A\00"
@CHAR_BIT = global i32 0
@.str.10 = [50 x i8] c"The GMP library expects %lu bits in a mp_limb_t.\0A\00"
@str = [94 x i8] c"Warning! This is different from GMP_LIMB_BITS!\0ADifferent ABI caused by a GMP library upgrade?\00"
@str.12 = [55 x i8] c"Warning! GMP_LIMB_BITS != sizeof(mp_limb_t) * CHAR_BIT\00"
@str.13 = [43 x i8] c"Warning! mp_bits_per_limb != GMP_LIMB_BITS\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = load i8*, i8** @gmp_version
%4 = load i32, i32* @__GNU_MP_VERSION
%5 = load i32, i32* @__GNU_MP_VERSION_MINOR
%6 = load i32, i32* @__GNU_MP_VERSION_PATCHLEVEL
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %4, i32 %5, i32 %6)
%8 = tail call i8* (...) @mpfr_get_version()
%9 = load i8*, i8** @MPFR_VERSION_STRING
%10 = load i32, i32* @MPFR_VERSION_MAJOR
%11 = load i32, i32* @MPFR_VERSION_MINOR
%12 = load i32, i32* @MPFR_VERSION_PATCHLEVEL
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0), i8* %8, i8* %9, i32 %10, i32 %11, i32 %12)
%14 = tail call i8* (...) @mpfr_get_patches()
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %14)
%16 = load i32, i32* @GMP_LIMB_BITS
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %16)
%18 = load i64, i64* @GMP_NAIL_BITS
%19 = trunc i64 %18 to i32
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %19)
%21 = load i64, i64* @GMP_NUMB_BITS
%22 = trunc i64 %21 to i32
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i32 %22)
%24 = load i32, i32* @mp_bits_per_limb
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i32 %24)
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i32 4)
%27 = load i32, i32* @mp_bits_per_limb
%28 = load i32, i32* @GMP_LIMB_BITS
%29 = icmp eq i32 %27, %28
br i1 %29, label %33, label %30
30: ; preds = %0
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.13, i64 0, i64 0))
%32 = load i32, i32* @GMP_LIMB_BITS
br label %33
33: ; preds = %30, %0
%34 = phi i32 [ %32, %30 ], [ %27, %0 ]
%35 = sext i32 %34 to i64
%36 = load i32, i32* @CHAR_BIT
%37 = sext i32 %36 to i64
%38 = shl nsw i64 %37, 2
%39 = icmp eq i64 %38, %35
br i1 %39, label %42, label %40
40: ; preds = %33
%41 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.12, i64 0, i64 0))
br label %42
42: ; preds = %40, %33
%43 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%44 = call i64 @mpn_popcount(i32* %43, i32 1)
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.10, i64 0, i64 0), i64 %44)
%46 = load i32, i32* @GMP_LIMB_BITS
%47 = sext i32 %46 to i64
%48 = icmp eq i64 %44, %47
br i1 %48, label %51, label %49
49: ; preds = %42
%50 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([94 x i8], [94 x i8]* @str, i64 0, i64 0))
br label %51
51: ; preds = %49, %42
%52 = call i32 (...) @failure_test()
ret i32 0
}