#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*/ block_begin();
int /*<<< orphan*/ block_end();
int /*<<< orphan*/ output(char const *, ...);
void output_cond(const char *condition, const char *true_stmt,
                 const char *false_stmt) {
  output("if (%s)", condition);
  block_begin();
  output(true_stmt);
  block_end();
  output("else");
  block_begin();
  output(false_stmt);
  block_end();
}


x86 assembly (clang, -O0):
<output_cond>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1050 <output@plt>
mov    $0x0,%al
call   1030 <block_begin@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1050 <output@plt>
mov    $0x0,%al
call   1040 <block_end@plt>
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1050 <output@plt>
mov    $0x0,%al
call   1030 <block_begin@plt>
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1050 <output@plt>
mov    $0x0,%al
call   1040 <block_end@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_cond>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1050 <output@plt>
xor    %eax,%eax
call   1030 <block_begin@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <output@plt>
xor    %eax,%eax
call   1040 <block_end@plt>
lea    0xe9e(%rip),%rdi
xor    %eax,%eax
call   1050 <output@plt>
xor    %eax,%eax
call   1030 <block_begin@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <output@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <block_end@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"if (%s)\00"
@.str.1 = [5 x i8] c"else\00"
define void @output_cond(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = call i32 (i8*, ...) @output(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = call i32 (...) @block_begin()
%10 = load i8*, i8** %5
%11 = call i32 (i8*, ...) @output(i8* %10)
%12 = call i32 (...) @block_end()
%13 = call i32 (i8*, ...) @output(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 (...) @block_begin()
%15 = load i8*, i8** %6
%16 = call i32 (i8*, ...) @output(i8* %15)
%17 = call i32 (...) @block_end()
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"if (%s)\00"
@.str.1 = [5 x i8] c"else\00"
define void @output_cond(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 (i8*, ...) @output(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i32 (...) @block_begin()
%6 = tail call i32 (i8*, ...) @output(i8* %1)
%7 = tail call i32 (...) @block_end()
%8 = tail call i32 (i8*, ...) @output(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 (...) @block_begin()
%10 = tail call i32 (i8*, ...) @output(i8* %2)
%11 = tail call i32 (...) @block_end()
ret void
}