#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*/ get_hashv(char *, int /*<<< orphan*/, unsigned int *);
int /*<<< orphan*/ strlen(char *);
void bf_add(char *bf, char *line) {
  unsigned i, hashv[2];
  get_hashv(line, strlen(line), hashv);
  for (i = 0; i < 2; i++)
    (bf[hashv[i] / 8] |= (1 << (hashv[i] % 8)));
}


x86 assembly (clang, -O0):
<bf_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
lea    -0x1c(%rbp),%rdx
call   1040 <get_hashv@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jae    1199 <bf_add+0x79>
mov    -0x14(%rbp),%eax
mov    -0x1c(%rbp,%rax,4),%ecx
and    $0x7,%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    -0x1c(%rbp,%rcx,4),%ecx
shr    $0x3,%ecx
mov    %ecx,%ecx
movsbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1157 <bf_add+0x37>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bf_add>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rsp,%rdx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <get_hashv@plt>
mov    (%rsp),%eax
mov    %eax,%ecx
and    $0x7,%cl
mov    $0x1,%edx
mov    $0x1,%esi
shl    %cl,%esi
shr    $0x3,%rax
or     %sil,(%r14,%rax,1)
mov    0x4(%rsp),%eax
mov    %eax,%ecx
and    $0x7,%cl
shl    %cl,%edx
shr    $0x3,%rax
or     %dl,(%r14,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @bf_add(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca [2 x i32]
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%11 = call i32 @get_hashv(i8* %7, i32 %9, i32* %10)
store i32 0, i32* %5
br label %12
12: ; preds = %34, %2
%13 = load i32, i32* %5
%14 = icmp ult i32 %13, 2
br i1 %14, label %15, label %37
15: ; preds = %12
%16 = load i32, i32* %5
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = urem i32 %19, 8
%21 = shl i32 1, %20
%22 = load i8*, i8** %3
%23 = load i32, i32* %5
%24 = zext i32 %23 to i64
%25 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 %24
%26 = load i32, i32* %25
%27 = udiv i32 %26, 8
%28 = zext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %22, i64 %28
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = or i32 %31, %21
%33 = trunc i32 %32 to i8
store i8 %33, i8* %29
br label %34
34: ; preds = %15
%35 = load i32, i32* %5
%36 = add i32 %35, 1
store i32 %36, i32* %5
br label %12
37: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @bf_add(i8* nocapture %0, i8* %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = tail call i32 @strlen(i8* %1)
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%7 = call i32 @get_hashv(i8* %1, i32 %5, i32* %6)
%8 = load i32, i32* %6
%9 = and i32 %8, 7
%10 = shl nuw nsw i32 1, %9
%11 = lshr i32 %8, 3
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = trunc i32 %10 to i8
%16 = or i8 %14, %15
store i8 %16, i8* %13
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%18 = load i32, i32* %17
%19 = and i32 %18, 7
%20 = shl nuw nsw i32 1, %19
%21 = lshr i32 %18, 3
%22 = zext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %0, i64 %22
%24 = load i8, i8* %23
%25 = trunc i32 %20 to i8
%26 = or i8 %24, %25
store i8 %26, i8* %23
ret void
}