#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 */
typedef int /*<<< orphan*/ result;

/* Variables and functions */
int /*<<< orphan*/ check_strs(char *, char const *, char *);
int /*<<< orphan*/ check_unsigned_ints(unsigned int, unsigned int, char *);
int /*<<< orphan*/ lex_look_ahead(char const *, unsigned int, unsigned int *,
                                  char *, int);
void check_token(const char *input, unsigned int input_size, unsigned int *pos,
                 const char *expected_result, unsigned int expected_pos) {
  char result[80];
  lex_look_ahead(input, input_size, pos, result, sizeof(result));
  check_unsigned_ints(*pos, expected_pos, "expected pos");
  check_strs(result, expected_result, "token");
}


x86 assembly (clang, -O0):
<check_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    -0x80(%rbp),%rcx
mov    $0x50,%r8d
call   1040 <lex_look_ahead@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    -0x24(%rbp),%esi
lea    0xe88(%rip),%rdx
call   1030 <check_unsigned_ints@plt>
lea    -0x80(%rbp),%rdi
mov    -0x20(%rbp),%rsi
lea    0xe81(%rip),%rdx
call   1050 <check_strs@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_token>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    %r8d,%ebp
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %rsp,%r15
mov    %r15,%rcx
mov    $0x50,%r8d
call   1040 <lex_look_ahead@plt>
mov    (%rbx),%edi
lea    0xea3(%rip),%rdx
mov    %ebp,%esi
call   1030 <check_unsigned_ints@plt>
lea    0xea2(%rip),%rdx
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <check_strs@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"expected pos\00"
@.str.1 = [6 x i8] c"token\00"
define void @check_token(i8* %0, i32 %1, i32* %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca [80 x i8]
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = load i32*, i32** %8
%15 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%16 = call i32 @lex_look_ahead(i8* %12, i32 %13, i32* %14, i8* %15, i32 80)
%17 = load i32*, i32** %8
%18 = load i32, i32* %17
%19 = load i32, i32* %10
%20 = call i32 @check_unsigned_ints(i32 %18, i32 %19, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%21 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%22 = load i8*, i8** %9
%23 = call i32 @check_strs(i8* %21, i8* %22, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"expected pos\00"
@.str.1 = [6 x i8] c"token\00"
define void @check_token(i8* %0, i32 %1, i32* %2, i8* %3, i32 %4) {
%6 = alloca [80 x i8]
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%8 = call i32 @lex_look_ahead(i8* %0, i32 %1, i32* %2, i8* %7, i32 80)
%9 = load i32, i32* %2
%10 = call i32 @check_unsigned_ints(i32 %9, i32 %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @check_strs(i8* %7, i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}