#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 */
scalar_t__ accept(char *);
int /*<<< orphan*/ binary1(int);
int binary2(int, int, char *);
int postfix_expr();
int additive_expr() {
  int type = postfix_expr();
  while (1) {
    if (accept("+")) {
      binary1(type);
      type = binary2(postfix_expr(), 3, "\x5b\x01\xd8");
    } else if (accept("-")) {
      binary1(type);
      type = binary2(postfix_expr(), 5, "\x5b\x29\xc3\x89\xd8");
    } else
      return type;
  }
}


x86 assembly (clang, -O0):
<additive_expr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <postfix_expr@plt>
mov    %eax,-0x4(%rbp)
lea    0xea7(%rip),%rdi
call   1050 <accept@plt>
cmp    $0x0,%rax
je     1192 <additive_expr+0x52>
mov    -0x4(%rbp),%edi
call   1030 <binary1@plt>
mov    $0x0,%al
call   1040 <postfix_expr@plt>
mov    %eax,%edi
mov    $0x3,%esi
lea    0xe7d(%rip),%rdx
call   1060 <binary2@plt>
mov    %eax,-0x4(%rbp)
jmp    11e0 <additive_expr+0xa0>
lea    0xe6d(%rip),%rdi
call   1050 <accept@plt>
cmp    $0x0,%rax
je     11d2 <additive_expr+0x92>
mov    -0x4(%rbp),%edi
call   1030 <binary1@plt>
mov    $0x0,%al
call   1040 <postfix_expr@plt>
mov    %eax,%edi
mov    $0x5,%esi
lea    0xe43(%rip),%rdx
call   1060 <binary2@plt>
mov    %eax,-0x4(%rbp)
jmp    11db <additive_expr+0x9b>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    11e0 <additive_expr+0xa0>
jmp    1152 <additive_expr+0x12>

x86 assembly (clang, -O2):
<additive_expr>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %eax,%eax
call   1040 <postfix_expr@plt>
mov    %eax,%ebp
lea    0xea8(%rip),%rbx
lea    0xea7(%rip),%r14
lea    0xea2(%rip),%r15
lea    0xe95(%rip),%r12
jmp    118f <additive_expr+0x4f>
nop
mov    %ebp,%edi
call   1030 <binary1@plt>
xor    %eax,%eax
call   1040 <postfix_expr@plt>
mov    %eax,%edi
mov    $0x3,%esi
mov    %r12,%rdx
call   1060 <binary2@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <accept@plt>
test   %rax,%rax
jne    1170 <additive_expr+0x30>
mov    %r14,%rdi
call   1050 <accept@plt>
test   %rax,%rax
je     11c3 <additive_expr+0x83>
mov    %ebp,%edi
call   1030 <binary1@plt>
xor    %eax,%eax
call   1040 <postfix_expr@plt>
mov    %eax,%edi
mov    $0x5,%esi
mov    %r15,%rdx
jmp    1188 <additive_expr+0x48>
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"+\00"
@.str.1 = [4 x i8] c"[\01\D8\00"
@.str.2 = [2 x i8] c"-\00"
@.str.3 = [6 x i8] c"[)\C3\89\D8\00"
define i32 @additive_expr() {
%1 = alloca i32
%2 = call i32 (...) @postfix_expr()
store i32 %2, i32* %1
br label %3
3: ; preds = %0, %22
%4 = call i64 @accept(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = load i32, i32* %1
%8 = call i32 @binary1(i32 %7)
%9 = call i32 (...) @postfix_expr()
%10 = call i32 @binary2(i32 %9, i32 3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i32 %10, i32* %1
br label %22
11: ; preds = %3
%12 = call i64 @accept(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = load i32, i32* %1
%16 = call i32 @binary1(i32 %15)
%17 = call i32 (...) @postfix_expr()
%18 = call i32 @binary2(i32 %17, i32 5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
store i32 %18, i32* %1
br label %21
19: ; preds = %11
%20 = load i32, i32* %1
ret i32 %20
21: ; preds = %14
br label %22
22: ; preds = %21, %6
br label %3
}

LLVM IR (-O2):
@.str = [2 x i8] c"+\00"
@.str.1 = [4 x i8] c"[\01\D8\00"
@.str.2 = [2 x i8] c"-\00"
@.str.3 = [6 x i8] c"[)\C3\89\D8\00"
define i32 @additive_expr() {
%1 = tail call i32 (...) @postfix_expr()
br label %2
2: ; preds = %17, %0
%3 = phi i32 [ %1, %0 ], [ %18, %17 ]
%4 = tail call i64 @accept(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i32 @binary1(i32 %3)
%8 = tail call i32 (...) @postfix_expr()
%9 = tail call i32 @binary2(i32 %8, i32 3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %17
10: ; preds = %2
%11 = tail call i64 @accept(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %19, label %13
13: ; preds = %10
%14 = tail call i32 @binary1(i32 %3)
%15 = tail call i32 (...) @postfix_expr()
%16 = tail call i32 @binary2(i32 %15, i32 5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %17
17: ; preds = %13, %6
%18 = phi i32 [ %9, %6 ], [ %16, %13 ]
br label %2
19: ; preds = %10
ret i32 %3
}