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

/* Variables and functions */
int /*<<< orphan*/ lexer_next_char(struct lexer *);
char lexer_next_peek(struct lexer *);
int /*<<< orphan*/ lexer_roll_back(struct lexer *, int);
int lexer_peek_remote_rename_syntax(struct lexer *lx) {
  if (lexer_next_peek(lx) != '-')
    return 0;
  lexer_next_char(lx);
  int is_gt = (lexer_next_peek(lx) == '>');
  lexer_roll_back(lx, 1);
  return is_gt;
}


x86 assembly (clang, -O0):
<lexer_peek_remote_rename_syntax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <lexer_next_peek@plt>
movsbl %al,%eax
cmp    $0x2d,%eax
je     115d <lexer_peek_remote_rename_syntax+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    1194 <lexer_peek_remote_rename_syntax+0x64>
mov    -0x10(%rbp),%rdi
call   1040 <lexer_next_char@plt>
mov    -0x10(%rbp),%rdi
call   1030 <lexer_next_peek@plt>
movsbl %al,%eax
cmp    $0x3e,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1050 <lexer_roll_back@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lexer_peek_remote_rename_syntax>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <lexer_next_peek@plt>
xor    %ebp,%ebp
cmp    $0x2d,%al
jne    1166 <lexer_peek_remote_rename_syntax+0x36>
mov    %rbx,%rdi
call   1040 <lexer_next_char@plt>
mov    %rbx,%rdi
call   1030 <lexer_next_peek@plt>
xor    %ebp,%ebp
cmp    $0x3e,%al
sete   %bpl
mov    %rbx,%rdi
mov    $0x1,%esi
call   1050 <lexer_roll_back@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.lexer = type { i32 }
define i32 @lexer_peek_remote_rename_syntax(%struct.lexer* %0) {
%2 = alloca i32
%3 = alloca %struct.lexer*
%4 = alloca i32
store %struct.lexer* %0, %struct.lexer** %3
%5 = load %struct.lexer*, %struct.lexer** %3
%6 = call signext i8 @lexer_next_peek(%struct.lexer* %5)
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 45
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %2
br label %21
10: ; preds = %1
%11 = load %struct.lexer*, %struct.lexer** %3
%12 = call i32 @lexer_next_char(%struct.lexer* %11)
%13 = load %struct.lexer*, %struct.lexer** %3
%14 = call signext i8 @lexer_next_peek(%struct.lexer* %13)
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 62
%17 = zext i1 %16 to i32
store i32 %17, i32* %4
%18 = load %struct.lexer*, %struct.lexer** %3
%19 = call i32 @lexer_roll_back(%struct.lexer* %18, i32 1)
%20 = load i32, i32* %4
store i32 %20, i32* %2
br label %21
21: ; preds = %10, %9
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
%struct.lexer = type { i32 }
define i32 @lexer_peek_remote_rename_syntax(%struct.lexer* %0) {
%2 = tail call signext i8 @lexer_next_peek(%struct.lexer* %0)
%3 = icmp eq i8 %2, 45
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = tail call i32 @lexer_next_char(%struct.lexer* %0)
%6 = tail call signext i8 @lexer_next_peek(%struct.lexer* %0)
%7 = icmp eq i8 %6, 62
%8 = zext i1 %7 to i32
%9 = tail call i32 @lexer_roll_back(%struct.lexer* %0, i32 1)
br label %10
10: ; preds = %1, %4
%11 = phi i32 [ %8, %4 ], [ 0, %1 ]
ret i32 %11
}