void print(int *bits, int *known) {
  char buffer[32 + 1];
  buffer[32] = '\0';
  for (int i = 0; i < 32; i++) {
    if (true(bits, known, i))
      buffer[32 - 1 - i] = '1';
    else if (false(bits, known, i))
      buffer[32 - 1 - i] = '0';
    else
      buffer[32 - 1 - i] = '?';
  }
  printf("%s\n", buffer);
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x0,-0x20(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0x20,-0x44(%rbp)
jge    11da <print+0xaa>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x44(%rbp),%edx
mov    $0x0,%al
call   1050 <true@plt>
cmp    $0x0,%eax
je     1184 <print+0x54>
mov    $0x1f,%eax
sub    -0x44(%rbp),%eax
cltq
movb   $0x31,-0x40(%rbp,%rax,1)
jmp    11c7 <print+0x97>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x44(%rbp),%edx
mov    $0x0,%al
call   1040 <false@plt>
cmp    $0x0,%eax
je     11b3 <print+0x83>
mov    $0x1f,%eax
sub    -0x44(%rbp),%eax
cltq
movb   $0x30,-0x40(%rbp,%rax,1)
jmp    11c2 <print+0x92>
mov    $0x1f,%eax
sub    -0x44(%rbp),%eax
cltq
movb   $0x3f,-0x40(%rbp,%rax,1)
jmp    11c7 <print+0x97>
jmp    11cc <print+0x9c>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    114b <print+0x1b>
lea    -0x40(%rbp),%rsi
lea    0xe1b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
movb   $0x0,0x20(%rsp)
lea    0x1f(%rsp),%r12
xor    %ebx,%ebx
jmp    1163 <print+0x33>
nop
movb   $0x31,(%r12)
add    $0x1,%rbx
add    $0xffffffffffffffff,%r12
cmp    $0x20,%rbx
je     1197 <print+0x67>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1050 <true@plt>
test   %eax,%eax
jne    1150 <print+0x20>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <false@plt>
test   %eax,%eax
je     1190 <print+0x60>
movb   $0x30,(%r12)
jmp    1155 <print+0x25>
movb   $0x3f,(%r12)
jmp    1155 <print+0x25>
mov    %rsp,%rdi
call   1030 <puts@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @print(i32* %0, i32* %1) {
%3 = alloca [33 x i8]
%4 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 32
store i8 0, i8* %5
br label %8
6: ; preds = %23
%7 = call i32 @puts(i8* %4)
ret void
8: ; preds = %2, %23
%9 = phi i64 [ 0, %2 ], [ %24, %23 ]
%10 = trunc i64 %9 to i32
%11 = tail call i32 (i32*, i32*, i32, ...) bitcast (i32 (...)* @true to i32 (i32*, i32*, i32, ...)*)(i32* %0, i32* %1, i32 %10)
%12 = icmp eq i32 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %8
%14 = sub nuw nsw i64 31, %9
%15 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 %14
store i8 49, i8* %15
br label %23
16: ; preds = %8
%17 = tail call i32 (i32*, i32*, i32, ...) bitcast (i32 (...)* @false to i32 (i32*, i32*, i32, ...)*)(i32* %0, i32* %1, i32 %10)
%18 = icmp eq i32 %17, 0
%19 = sub nuw nsw i64 31, %9
%20 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 %19
br i1 %18, label %22, label %21
21: ; preds = %16
store i8 48, i8* %20
br label %23
22: ; preds = %16
store i8 63, i8* %20
br label %23
23: ; preds = %13, %22, %21
%24 = add nuw nsw i64 %9, 1
%25 = icmp eq i64 %24, 32
br i1 %25, label %6, label %8
}