#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 compile_state {
  int dummy;
};

/* Variables and functions */
unsigned int attribute_list(struct compile_state *, unsigned int);
int /*<<< orphan*/ eat(struct compile_state *, int);
int peek(struct compile_state *);
unsigned int attributes_opt(struct compile_state *state, unsigned type) {
  if (peek(state) == 93) {
    eat(state, 93);
    eat(state, 10);
    eat(state, 10);
    type = attribute_list(state, type);
    eat(state, 11);
    eat(state, 11);
  }
  return type;
}


x86 assembly (clang, -O0):
<attributes_opt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <peek@plt>
cmp    $0x5d,%eax
jne    11a6 <attributes_opt+0x76>
mov    -0x8(%rbp),%rdi
mov    $0x5d,%esi
call   1040 <eat@plt>
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1040 <eat@plt>
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1040 <eat@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <attribute_list@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xb,%esi
call   1040 <eat@plt>
mov    -0x8(%rbp),%rdi
mov    $0xb,%esi
call   1040 <eat@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<attributes_opt>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <peek@plt>
cmp    $0x5d,%eax
jne    118f <attributes_opt+0x5f>
mov    %rbx,%rdi
mov    $0x5d,%esi
call   1040 <eat@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <eat@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <eat@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <attribute_list@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0xb,%esi
call   1040 <eat@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
call   1040 <eat@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.compile_state = type { i32 }
define i32 @attributes_opt(%struct.compile_state* %0, i32 %1) {
%3 = alloca %struct.compile_state*
%4 = alloca i32
store %struct.compile_state* %0, %struct.compile_state** %3
store i32 %1, i32* %4
%5 = load %struct.compile_state*, %struct.compile_state** %3
%6 = call i32 @peek(%struct.compile_state* %5)
%7 = icmp eq i32 %6, 93
br i1 %7, label %8, label %22
8: ; preds = %2
%9 = load %struct.compile_state*, %struct.compile_state** %3
%10 = call i32 @eat(%struct.compile_state* %9, i32 93)
%11 = load %struct.compile_state*, %struct.compile_state** %3
%12 = call i32 @eat(%struct.compile_state* %11, i32 10)
%13 = load %struct.compile_state*, %struct.compile_state** %3
%14 = call i32 @eat(%struct.compile_state* %13, i32 10)
%15 = load %struct.compile_state*, %struct.compile_state** %3
%16 = load i32, i32* %4
%17 = call i32 @attribute_list(%struct.compile_state* %15, i32 %16)
store i32 %17, i32* %4
%18 = load %struct.compile_state*, %struct.compile_state** %3
%19 = call i32 @eat(%struct.compile_state* %18, i32 11)
%20 = load %struct.compile_state*, %struct.compile_state** %3
%21 = call i32 @eat(%struct.compile_state* %20, i32 11)
br label %22
22: ; preds = %8, %2
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
%struct.compile_state = type { i32 }
define i32 @attributes_opt(%struct.compile_state* %0, i32 %1) {
%3 = tail call i32 @peek(%struct.compile_state* %0)
%4 = icmp eq i32 %3, 93
br i1 %4, label %5, label %12
5: ; preds = %2
%6 = tail call i32 @eat(%struct.compile_state* %0, i32 93)
%7 = tail call i32 @eat(%struct.compile_state* %0, i32 10)
%8 = tail call i32 @eat(%struct.compile_state* %0, i32 10)
%9 = tail call i32 @attribute_list(%struct.compile_state* %0, i32 %1)
%10 = tail call i32 @eat(%struct.compile_state* %0, i32 11)
%11 = tail call i32 @eat(%struct.compile_state* %0, i32 11)
br label %12
12: ; preds = %5, %2
%13 = phi i32 [ %9, %5 ], [ %1, %2 ]
ret i32 %13
}