#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*/ ft_putchar_fd(char const, int);
int /*<<< orphan*/ ft_putendl_fd(char *, int);
int /*<<< orphan*/ ft_putstr_fd(char *, int);
int token_error(const char c) {
  ft_putstr_fd("Syntax error near unexpected token `", 2);
  if (c == '\n')
    ft_putstr_fd("newline", 2);
  else
    ft_putchar_fd(c, 2);
  ft_putendl_fd("'", 2);
  return (-1);
}


x86 assembly (clang, -O0):
<token_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xebb(%rip),%rdi
mov    $0x2,%esi
call   1030 <ft_putstr_fd@plt>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    1172 <token_error+0x42>
lea    0xec2(%rip),%rdi
mov    $0x2,%esi
call   1030 <ft_putstr_fd@plt>
jmp    1180 <token_error+0x50>
mov    $0x2,%esi
movsbl -0x1(%rbp),%edi
call   1040 <ft_putchar_fd@plt>
lea    0xea6(%rip),%rdi
mov    $0x2,%esi
call   1050 <ft_putendl_fd@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<token_error>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
mov    $0x2,%esi
call   1030 <ft_putstr_fd@plt>
cmp    $0xa,%bl
jne    115c <token_error+0x2c>
lea    0xed5(%rip),%rdi
mov    $0x2,%esi
call   1030 <ft_putstr_fd@plt>
jmp    1169 <token_error+0x39>
movsbl %bl,%edi
mov    $0x2,%esi
call   1040 <ft_putchar_fd@plt>
lea    0xebd(%rip),%rdi
mov    $0x2,%esi
call   1050 <ft_putendl_fd@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Syntax error near unexpected token `\00"
@.str.1 = [8 x i8] c"newline\00"
@.str.2 = [2 x i8] c"'\00"
define i32 @token_error(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @ft_putstr_fd(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 2)
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 10
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @ft_putstr_fd(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 2)
br label %12
9: ; preds = %1
%10 = load i8, i8* %2
%11 = call i32 @ft_putchar_fd(i8 signext %10, i32 2)
br label %12
12: ; preds = %9, %7
%13 = call i32 @ft_putendl_fd(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 2)
ret i32 -1
}

LLVM IR (-O2):
@.str = [37 x i8] c"Syntax error near unexpected token `\00"
@.str.1 = [8 x i8] c"newline\00"
@.str.2 = [2 x i8] c"'\00"
define i32 @token_error(i8 signext %0) {
%2 = tail call i32 @ft_putstr_fd(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = icmp eq i8 %0, 10
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @ft_putstr_fd(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 2)
br label %8
6: ; preds = %1
%7 = tail call i32 @ft_putchar_fd(i8 signext %0, i32 2)
br label %8
8: ; preds = %6, %4
%9 = tail call i32 @ft_putendl_fd(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 2)
ret i32 -1
}