#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*/ printf(char *, char *);
void wildcards_aux(char *str, size_t str_i) {
  if (str[str_i] == '\0') {
    printf("%s\n", str);
    return;
  }
  if (str[str_i] != '?') {
    wildcards_aux(str, str_i + 1);
  } else {
    str[str_i] = '0';
    wildcards_aux(str, str_i);
    str[str_i] = '1';
    wildcards_aux(str, str_i);
    str[str_i] = '?';
  }
}


x86 assembly (clang, -O0):
<wildcards_aux>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    115a <wildcards_aux+0x3a>
mov    -0x8(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
jmp    11c3 <wildcards_aux+0xa3>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3f,%eax
je     1185 <wildcards_aux+0x65>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
call   1030 <wildcards_aux@plt>
jmp    11c3 <wildcards_aux+0xa3>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x30,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <wildcards_aux@plt>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x31,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <wildcards_aux@plt>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x3f,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wildcards_aux>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
nopw   0x0(%rax,%rax,1)
movzbl (%r14,%rbx,1),%eax
cmp    $0x3f,%al
je     1143 <wildcards_aux+0x23>
test   %al,%al
je     1170 <wildcards_aux+0x50>
add    $0x1,%rbx
jmp    1130 <wildcards_aux+0x10>
movb   $0x30,(%r14,%rbx,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <wildcards_aux@plt>
movb   $0x31,(%r14,%rbx,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <wildcards_aux@plt>
movb   $0x3f,(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe89(%rip),%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @wildcards_aux(i8* %0, i64 %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i64 [ %1, %2 ], [ %10, %9 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 0, label %7
i8 63, label %12
]
7: ; preds = %3
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %11
9: ; preds = %3
%10 = add i64 %4, 1
br label %3
11: ; preds = %7, %12
ret void
12: ; preds = %3
%13 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 48, i8* %13
tail call void @wildcards_aux(i8* %0, i64 %4)
store i8 49, i8* %13
tail call void @wildcards_aux(i8* %0, i64 %4)
store i8 63, i8* %13
br label %11
}