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

/* Variables and functions */
int __WORDSIZE;
int __bitmap_full(unsigned long const *, int);
int bitmap_full(const unsigned long *src, int nbits) {
  if (nbits <= __WORDSIZE)
    return !(
        ~(*src) &
        (((nbits) % __WORDSIZE) ? (1UL << ((nbits) % __WORDSIZE)) - 1 : ~0UL));
  else
    return __bitmap_full(src, nbits);
}


x86 assembly (clang, -O0):
<bitmap_full>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2ebf(%rip),%rcx
cmp    (%rcx),%eax
jg     11ad <bitmap_full+0x9d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
xor    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e9e(%rip),%rcx
cltd
idivl  (%rcx)
cmp    $0x0,%edx
je     117c <bitmap_full+0x6c>
mov    -0x14(%rbp),%eax
mov    0x2e88(%rip),%rcx
cltd
idivl  (%rcx)
mov    %edx,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
sub    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    118c <bitmap_full+0x7c>
mov    $0xffffffffffffffff,%rax
mov    %rax,-0x28(%rbp)
jmp    118c <bitmap_full+0x7c>
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
and    %rcx,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    11bc <bitmap_full+0xac>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <__bitmap_full@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_full>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%ecx
cmp    %esi,%ecx
jge    1122 <bitmap_full+0x12>
jmp    1030 <__bitmap_full@plt>
mov    (%rdi),%rdi
not    %rdi
mov    %esi,%eax
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0xffffffffffffffff,%rax
shl    %cl,%rax
not    %rax
cmp    $0x1,%edx
sbb    %rcx,%rcx
or     %rax,%rcx
xor    %eax,%eax
test   %rdi,%rcx
sete   %al
ret

LLVM IR (-O0):
@__WORDSIZE = global i32 0
define i32 @bitmap_full(i64* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i32
store i64* %0, i64** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = load i32, i32* @__WORDSIZE
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %31
9: ; preds = %2
%10 = load i64*, i64** %4
%11 = load i64, i64* %10
%12 = xor i64 %11, -1
%13 = load i32, i32* %5
%14 = load i32, i32* @__WORDSIZE
%15 = srem i32 %13, %14
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %24
17: ; preds = %9
%18 = load i32, i32* %5
%19 = load i32, i32* @__WORDSIZE
%20 = srem i32 %18, %19
%21 = zext i32 %20 to i64
%22 = shl i64 1, %21
%23 = sub i64 %22, 1
br label %25
24: ; preds = %9
br label %25
25: ; preds = %24, %17
%26 = phi i64 [ %23, %17 ], [ -1, %24 ]
%27 = and i64 %12, %26
%28 = icmp ne i64 %27, 0
%29 = xor i1 %28, true
%30 = zext i1 %29 to i32
store i32 %30, i32* %3
br label %35
31: ; preds = %2
%32 = load i64*, i64** %4
%33 = load i32, i32* %5
%34 = call i32 @__bitmap_full(i64* %32, i32 %33)
store i32 %34, i32* %3
br label %35
35: ; preds = %31, %25
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
@__WORDSIZE = global i32 0
define i32 @bitmap_full(i64* %0, i32 %1) {
%3 = load i32, i32* @__WORDSIZE
%4 = icmp slt i32 %3, %1
br i1 %4, label %17, label %5
5: ; preds = %2
%6 = load i64, i64* %0
%7 = xor i64 %6, -1
%8 = srem i32 %1, %3
%9 = icmp eq i32 %8, 0
%10 = zext i32 %8 to i64
%11 = shl nsw i64 -1, %10
%12 = xor i64 %11, -1
%13 = select i1 %9, i64 -1, i64 %12
%14 = and i64 %13, %7
%15 = icmp eq i64 %14, 0
%16 = zext i1 %15 to i32
br label %19
17: ; preds = %2
%18 = tail call i32 @__bitmap_full(i64* %0, i32 %1)
br label %19
19: ; preds = %17, %5
%20 = phi i32 [ %16, %5 ], [ %18, %17 ]
ret i32 %20
}