#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 /*<<< orphan*/ assert(int);
void bloomFilterExtractLocation(unsigned int index, unsigned int *byteIndex,
                                unsigned int *bitIndex) {
  assert(index < 2048);
  assert(NULL != byteIndex && NULL != bitIndex);
  *byteIndex = (2048 - 1 - index) / 8;
  *bitIndex = index % 8;
}


x86 assembly (clang, -O0):
<bloomFilterExtractLocation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x800,-0x4(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
je     1154 <bloomFilterExtractLocation+0x44>
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x7ff,%ecx
sub    -0x4(%rbp),%ecx
shr    $0x3,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
and    $0x7,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bloomFilterExtractLocation>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x800,%ebp
setb   %dil
call   1030 <assert@plt>
test   %rbx,%rbx
setne  %al
test   %r14,%r14
setne  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
mov    $0x7ff,%eax
sub    %ebp,%eax
shr    $0x3,%eax
mov    %eax,(%rbx)
and    $0x7,%ebp
mov    %ebp,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @bloomFilterExtractLocation(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = icmp ult i32 %7, 2048
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32*, i32** %5
%12 = icmp ne i32* null, %11
br i1 %12, label %13, label %16
13: ; preds = %3
%14 = load i32*, i32** %6
%15 = icmp ne i32* null, %14
br label %16
16: ; preds = %13, %3
%17 = phi i1 [ false, %3 ], [ %15, %13 ]
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
%20 = load i32, i32* %4
%21 = sub i32 2047, %20
%22 = udiv i32 %21, 8
%23 = load i32*, i32** %5
store i32 %22, i32* %23
%24 = load i32, i32* %4
%25 = urem i32 %24, 8
%26 = load i32*, i32** %6
store i32 %25, i32* %26
ret void
}

LLVM IR (-O2):
define void @bloomFilterExtractLocation(i32 %0, i32* writeonly %1, i32* writeonly %2) {
%4 = icmp ult i32 %0, 2048
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = icmp ne i32* %1, null
%8 = icmp ne i32* %2, null
%9 = and i1 %7, %8
%10 = zext i1 %9 to i32
%11 = tail call i32 @assert(i32 %10)
%12 = sub i32 2047, %0
%13 = lshr i32 %12, 3
store i32 %13, i32* %1
%14 = and i32 %0, 7
store i32 %14, i32* %2
ret void
}