#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 const *);
int /*<<< orphan*/ putchar(char const);
void print_solution(const char *expr_str, int vars[]) {
  size_t expr_i = 0;
  size_t var_i = 0;
  while (expr_str[expr_i] != '=') {
    if (expr_str[expr_i] == '_') {
      putchar(vars[var_i++] + '0');
    } else {
      putchar(expr_str[expr_i]);
    }
    expr_i++;
  }
  printf("%s\n", &expr_str[expr_i]);
}


x86 assembly (clang, -O0):
<print_solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3d,%eax
je     11b2 <print_solution+0x92>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5f,%eax
jne    1190 <print_solution+0x70>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    (%rax,%rcx,4),%eax
add    $0x30,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    11a1 <print_solution+0x81>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1140 <print_solution+0x20>
mov    -0x8(%rbp),%rsi
add    -0x18(%rbp),%rsi
lea    0xe3f(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_solution>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %r15d,%r15d
jmp    1147 <print_solution+0x27>
movzbl (%r14,%r15,4),%eax
add    $0x1,%r15
add    $0x30,%al
movsbl %al,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0x5f,%al
je     1130 <print_solution+0x10>
cmp    $0x3d,%al
jne    113b <print_solution+0x1b>
lea    0xea7(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print_solution(i8* %0, i32* nocapture %1) {
br label %3
3: ; preds = %14, %2
%4 = phi i64 [ 0, %2 ], [ %18, %14 ]
%5 = phi i64 [ 0, %2 ], [ %16, %14 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %4
%7 = load i8, i8* %6
switch i8 %7, label %14 [
i8 61, label %19
i8 95, label %8
]
8: ; preds = %3
%9 = add i64 %5, 1
%10 = getelementptr inbounds i32, i32* %1, i64 %5
%11 = load i32, i32* %10
%12 = trunc i32 %11 to i8
%13 = add i8 %12, 48
br label %14
14: ; preds = %3, %8
%15 = phi i8 [ %13, %8 ], [ %7, %3 ]
%16 = phi i64 [ %9, %8 ], [ %5, %3 ]
%17 = tail call i32 @putchar(i8 signext %15)
%18 = add i64 %4, 1
br label %3
19: ; preds = %3
%20 = getelementptr inbounds i8, i8* %0, i64 %4
%21 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %20)
ret void
}