void and (int *bits, int *known) {
  int i, j;
  scanf("%d %d", &i, &j);
  if (true(bits, known, i) && true(bits, known, j)) {
    set_bit(bits, i);
    set_bit(known, i);
  } else if (false(bits, known, i) || false(bits, known, j)) {
    unset_bit(bits, i);
    set_bit(known, i);
  } else {
    unset_bit(known, i);
  }
}


x86 assembly (clang, -O0):
<and>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe99(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1060 <true@plt>
cmp    $0x0,%eax
je     11cd <and+0x7d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%edx
mov    $0x0,%al
call   1060 <true@plt>
cmp    $0x0,%eax
je     11cd <and+0x7d>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x0,%al
call   1030 <set_bit@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x0,%al
call   1030 <set_bit@plt>
jmp    1237 <and+0xe7>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1040 <false@plt>
cmp    $0x0,%eax
jne    1203 <and+0xb3>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%edx
mov    $0x0,%al
call   1040 <false@plt>
cmp    $0x0,%eax
je     1224 <and+0xd4>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x0,%al
call   1070 <unset_bit@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x0,%al
call   1030 <set_bit@plt>
jmp    1232 <and+0xe2>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x0,%al
call   1070 <unset_bit@plt>
jmp    1237 <and+0xe7>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<and>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xe9f(%rip),%rdi
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
mov    (%rsp),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <true@plt>
test   %eax,%eax
je     11a8 <and+0x58>
mov    0x4(%rsp),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <true@plt>
test   %eax,%eax
je     11a8 <and+0x58>
mov    (%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <set_bit@plt>
jmp    11de <and+0x8e>
mov    (%rsp),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <false@plt>
test   %eax,%eax
jne    11d1 <and+0x81>
mov    0x4(%rsp),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <false@plt>
test   %eax,%eax
je     11f3 <and+0xa3>
mov    (%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <unset_bit@plt>
mov    (%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <set_bit@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    (%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <unset_bit@plt>
jmp    11eb <and+0x9b>

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
define void @and(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %5, i32* %6)
%8 = load i32*, i32** %3
%9 = load i32*, i32** %4
%10 = load i32, i32* %5
%11 = call i32 (i32*, i32*, i32, ...) bitcast (i32 (...)* @true to i32 (i32*, i32*, i32, ...)*)(i32* %8, i32* %9, i32 %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %26
13: ; preds = %2
%14 = load i32*, i32** %3
%15 = load i32*, i32** %4
%16 = load i32, i32* %6
%17 = call i32 (i32*, i32*, i32, ...) bitcast (i32 (...)* @true to i32 (i32*, i32*, i32, ...)*)(i32* %14, i32* %15, i32 %16)
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %26
19: ; preds = %13
%20 = load i32*, i32** %3
%21 = load i32, i32* %5
%22 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @set_bit to i32 (i32*, i32, ...)*)(i32* %20, i32 %21)
%23 = load i32*, i32** %4
%24 = load i32, i32* %5
%25 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @set_bit to i32 (i32*, i32, ...)*)(i32* %23, i32 %24)
br label %50
26: ; preds = %13, %2
%27 = load i32*, i32** %3
%28 = load i32*, i32** %4
%29 = load i32, i32* %5
%30 = call i32 (i32*, i32*, i32, ...) bitcast (i32 (...)* @false to i32 (i32*, i32*, i32, ...)*)(i32* %27, i32* %28, i32 %29)
%31 = icmp ne i32 %30, 0
br i1 %31, label %38, label %32
32: ; preds = %26
%33 = load i32*, i32** %3
%34 = load i32*, i32** %4
%35 = load i32, i32* %6
%36 = call i32 (i32*, i32*, i32, ...) bitcast (i32 (...)* @false to i32 (i32*, i32*, i32, ...)*)(i32* %33, i32* %34, i32 %35)
%37 = icmp ne i32 %36, 0
br i1 %37, label %38, label %45
38: ; preds = %32, %26
%39 = load i32*, i32** %3
%40 = load i32, i32* %5
%41 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @unset_bit to i32 (i32*, i32, ...)*)(i32* %39, i32 %40)
%42 = load i32*, i32** %4
%43 = load i32, i32* %5
%44 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @set_bit to i32 (i32*, i32, ...)*)(i32* %42, i32 %43)
br label %49
45: ; preds = %32
%46 = load i32*, i32** %4
%47 = load i32, i32* %5
%48 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @unset_bit to i32 (i32*, i32, ...)*)(i32* %46, i32 %47)
br label %49
49: ; preds = %45, %38
br label %50
50: ; preds = %49, %19
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
define void @and(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%8 = load i32, i32* %3
%9 = call i32 (i32*, i32*, i32, ...) bitcast (i32 (...)* @true to i32 (i32*, i32*, i32, ...)*)(i32* %0, i32* %1, i32 %8)
%10 = icmp eq i32 %9, 0
br i1 %10, label %20, label %11
11: ; preds = %2
%12 = load i32, i32* %4
%13 = call i32 (i32*, i32*, i32, ...) bitcast (i32 (...)* @true to i32 (i32*, i32*, i32, ...)*)(i32* %0, i32* %1, i32 %12)
%14 = icmp eq i32 %13, 0
br i1 %14, label %20, label %15
15: ; preds = %11
%16 = load i32, i32* %3
%17 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @set_bit to i32 (i32*, i32, ...)*)(i32* %0, i32 %16)
%18 = load i32, i32* %3
%19 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @set_bit to i32 (i32*, i32, ...)*)(i32* %1, i32 %18)
br label %36
20: ; preds = %11, %2
%21 = load i32, i32* %3
%22 = call i32 (i32*, i32*, i32, ...) bitcast (i32 (...)* @false to i32 (i32*, i32*, i32, ...)*)(i32* %0, i32* %1, i32 %21)
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %28
24: ; preds = %20
%25 = load i32, i32* %4
%26 = call i32 (i32*, i32*, i32, ...) bitcast (i32 (...)* @false to i32 (i32*, i32*, i32, ...)*)(i32* %0, i32* %1, i32 %25)
%27 = icmp eq i32 %26, 0
br i1 %27, label %33, label %28
28: ; preds = %24, %20
%29 = load i32, i32* %3
%30 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @unset_bit to i32 (i32*, i32, ...)*)(i32* %0, i32 %29)
%31 = load i32, i32* %3
%32 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @set_bit to i32 (i32*, i32, ...)*)(i32* %1, i32 %31)
br label %36
33: ; preds = %24
%34 = load i32, i32* %3
%35 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @unset_bit to i32 (i32*, i32, ...)*)(i32* %1, i32 %34)
br label %36
36: ; preds = %28, %33, %15
ret void
}