#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 */
struct gstr {
  int dummy;
};
struct expr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ expr_gstr_print(struct expr *, struct gstr *);
int /*<<< orphan*/ expr_is_yes(struct expr *);
int /*<<< orphan*/ str_append(struct gstr *, char const *);
void get_dep_str(struct gstr *r, struct expr *expr, const char *prefix) {
  if (!expr_is_yes(expr)) {
    str_append(r, prefix);
    expr_gstr_print(expr, r);
    str_append(r, "\n");
  }
}


x86 assembly (clang, -O0):
<get_dep_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <expr_is_yes@plt>
cmp    $0x0,%eax
jne    1180 <get_dep_str+0x50>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <str_append@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <expr_gstr_print@plt>
mov    -0x8(%rbp),%rdi
lea    0xe85(%rip),%rsi
call   1040 <str_append@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dep_str>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <expr_is_yes@plt>
test   %eax,%eax
je     1150 <get_dep_str+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <str_append@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <expr_gstr_print@plt>
lea    0xe93(%rip),%rsi
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <str_append@plt>

LLVM IR (-O0):
%struct.gstr = type { i32 }
%struct.expr = type { i32 }
@.str = [2 x i8] c"\0A\00"
define void @get_dep_str(%struct.gstr* %0, %struct.expr* %1, i8* %2) {
%4 = alloca %struct.gstr*
%5 = alloca %struct.expr*
%6 = alloca i8*
store %struct.gstr* %0, %struct.gstr** %4
store %struct.expr* %1, %struct.expr** %5
store i8* %2, i8** %6
%7 = load %struct.expr*, %struct.expr** %5
%8 = call i32 @expr_is_yes(%struct.expr* %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %19, label %10
10: ; preds = %3
%11 = load %struct.gstr*, %struct.gstr** %4
%12 = load i8*, i8** %6
%13 = call i32 @str_append(%struct.gstr* %11, i8* %12)
%14 = load %struct.expr*, %struct.expr** %5
%15 = load %struct.gstr*, %struct.gstr** %4
%16 = call i32 @expr_gstr_print(%struct.expr* %14, %struct.gstr* %15)
%17 = load %struct.gstr*, %struct.gstr** %4
%18 = call i32 @str_append(%struct.gstr* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %10, %3
ret void
}

LLVM IR (-O2):
%struct.gstr = type { i32 }
%struct.expr = type { i32 }
@.str = [2 x i8] c"\0A\00"
define void @get_dep_str(%struct.gstr* %0, %struct.expr* %1, i8* %2) {
%4 = tail call i32 @expr_is_yes(%struct.expr* %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i32 @str_append(%struct.gstr* %0, i8* %2)
%8 = tail call i32 @expr_gstr_print(%struct.expr* %1, %struct.gstr* %0)
%9 = tail call i32 @str_append(%struct.gstr* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %6, %3
ret void
}