#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 additive_expr();
int /*<<< orphan*/ binary1(int);
int binary2(int, int, char *);
int shift_expr() {
  int type = additive_expr();
  while (1) {
    if (accept("<<")) {
      binary1(type);
      type = binary2(additive_expr(), 5, "\x89\xc1\x58\xd3\xe0");
    } else if (accept(">>")) {
      binary1(type);
      type = binary2(additive_expr(), 5, "\x89\xc1\x58\xd3\xf8");
    } else
      return type;
  }
}


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

x86 assembly (clang, -O2):
<shift_expr>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <additive_expr@plt>
mov    %eax,%ebp
lea    0xea5(%rip),%r15
lea    0xea1(%rip),%r12
lea    0xea0(%rip),%r14
lea    0xe9c(%rip),%r13
jmp    119f <shift_expr+0x5f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebp,%edi
call   1040 <binary1@plt>
xor    %eax,%eax
call   1030 <additive_expr@plt>
mov    %eax,%edi
mov    $0x5,%esi
mov    %rbx,%rdx
call   1060 <binary2@plt>
mov    %eax,%ebp
mov    %r15,%rdi
call   1050 <accept@plt>
mov    %r12,%rbx
test   %rax,%rax
jne    1180 <shift_expr+0x40>
mov    %r14,%rdi
call   1050 <accept@plt>
mov    %r13,%rbx
test   %rax,%rax
jne    1180 <shift_expr+0x40>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"<<\00"
@.str.1 = [6 x i8] c"\89\C1X\D3\E0\00"
@.str.2 = [3 x i8] c">>\00"
@.str.3 = [6 x i8] c"\89\C1X\D3\F8\00"
define i32 @shift_expr() {
%1 = alloca i32
%2 = call i32 (...) @additive_expr()
store i32 %2, i32* %1
br label %3
3: ; preds = %0, %22
%4 = call i64 @accept(i8* getelementptr inbounds ([3 x i8], [3 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 (...) @additive_expr()
%10 = call i32 @binary2(i32 %9, i32 5, i8* getelementptr inbounds ([6 x i8], [6 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 ([3 x i8], [3 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 (...) @additive_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 = [3 x i8] c"<<\00"
@.str.1 = [6 x i8] c"\89\C1X\D3\E0\00"
@.str.2 = [3 x i8] c">>\00"
@.str.3 = [6 x i8] c"\89\C1X\D3\F8\00"
define i32 @shift_expr() {
%1 = tail call i32 (...) @additive_expr()
br label %2
2: ; preds = %10, %0
%3 = phi i32 [ %1, %0 ], [ %14, %10 ]
%4 = tail call i64 @accept(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i64 @accept(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %6
ret i32 %3
10: ; preds = %6, %2
%11 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), %6 ]
%12 = tail call i32 @binary1(i32 %3)
%13 = tail call i32 (...) @additive_expr()
%14 = tail call i32 @binary2(i32 %13, i32 5, i8* %11)
br label %2
}