#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*/ advance();
int /*<<< orphan*/ freename(char *);
scalar_t__ match(int);
int /*<<< orphan*/ printf(char *, char *, char *);
char *term();
char *expression() {
  char *tempvar, *tempvar2;
  tempvar = term();
  while (match(2)) {
    advance();
    tempvar2 = term();
    printf("    %s += %s\n", tempvar, tempvar2);
    freename(tempvar2);
  }
  return tempvar;
}


x86 assembly (clang, -O0):
<expression>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <term@plt>
mov    %rax,-0x8(%rbp)
mov    $0x2,%edi
call   1070 <match@plt>
cmp    $0x0,%rax
je     11ab <expression+0x5b>
mov    $0x0,%al
call   1060 <advance@plt>
mov    $0x0,%al
call   1050 <term@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xe68(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <freename@plt>
jmp    1163 <expression+0x13>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expression>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1050 <term@plt>
mov    %rax,%r15
mov    $0x2,%edi
call   1070 <match@plt>
test   %rax,%rax
je     11b6 <expression+0x66>
lea    0xe8b(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1060 <advance@plt>
xor    %eax,%eax
call   1050 <term@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rax,%rdx
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <freename@plt>
mov    $0x2,%edi
call   1070 <match@plt>
test   %rax,%rax
jne    1180 <expression+0x30>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [14 x i8] c" %s += %s\0A\00"
define i8* @expression() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* (...) @term()
store i8* %3, i8** %1
br label %4
4: ; preds = %7, %0
%5 = call i64 @match(i32 2)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = call i32 (...) @advance()
%9 = call i8* (...) @term()
store i8* %9, i8** %2
%10 = load i8*, i8** %1
%11 = load i8*, i8** %2
%12 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11)
%13 = load i8*, i8** %2
%14 = call i32 @freename(i8* %13)
br label %4
15: ; preds = %4
%16 = load i8*, i8** %1
ret i8* %16
}

LLVM IR (-O2):
@.str = [14 x i8] c" %s += %s\0A\00"
define i8* @expression() {
%1 = tail call i8* (...) @term()
%2 = tail call i64 @match(i32 2)
%3 = icmp eq i64 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %0, %4
%5 = tail call i32 (...) @advance()
%6 = tail call i8* (...) @term()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %6)
%8 = tail call i32 @freename(i8* %6)
%9 = tail call i64 @match(i32 2)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %0
ret i8* %1
}