#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 *, char *);
int /*<<< orphan*/ lex_look_ahead_n(char const *, unsigned int, unsigned int *,
                                    int, char *, int);
unsigned int strlen(char const *);
void test_lex_look_ahead_n_1() {
  const char *input = "foo= 2;int b;";
  unsigned int len, pos;
  char result[80];
  len = strlen(input);
  pos = 0;
  lex_look_ahead_n(input, len, &pos, 2, result, sizeof(result));
  check_strs(result, "=", "test_lex_look_ahead_n_1");
}


x86 assembly (clang, -O0):
<test_lex_look_ahead_n_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x60(%rbp),%r8
lea    -0x10(%rbp),%rdx
mov    $0x2,%ecx
mov    $0x50,%r9d
call   1040 <lex_look_ahead_n@plt>
lea    -0x60(%rbp),%rdi
lea    0xe8e(%rip),%rsi
lea    0xe89(%rip),%rdx
call   1050 <check_strs@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_lex_look_ahead_n_1>:
push   %r14
push   %rbx
sub    $0x68,%rsp
lea    0xec2(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rdx
lea    0x10(%rsp),%r14
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x2,%ecx
mov    %r14,%r8
mov    $0x50,%r9d
call   1040 <lex_look_ahead_n@plt>
lea    0xe97(%rip),%rsi
lea    0xe92(%rip),%rdx
mov    %r14,%rdi
call   1050 <check_strs@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"foo= 2;int b;\00"
@.str.1 = [2 x i8] c"=\00"
@.str.2 = [24 x i8] c"test_lex_look_ahead_n_1\00"
define void @test_lex_look_ahead_n_1() {
%1 = alloca i8*
%2 = alloca i32
%3 = alloca i32
%4 = alloca [80 x i8]
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %1
%5 = load i8*, i8** %1
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %2
store i32 0, i32* %3
%7 = load i8*, i8** %1
%8 = load i32, i32* %2
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%10 = call i32 @lex_look_ahead_n(i8* %7, i32 %8, i32* %3, i32 2, i8* %9, i32 80)
%11 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%12 = call i32 @check_strs(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"foo= 2;int b;\00"
@.str.1 = [2 x i8] c"=\00"
@.str.2 = [24 x i8] c"test_lex_look_ahead_n_1\00"
define void @test_lex_look_ahead_n_1() {
%1 = alloca i32
%2 = alloca [80 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
%6 = call i32 @lex_look_ahead_n(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %5, i32* %1, i32 2, i8* %4, i32 80)
%7 = call i32 @check_strs(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
ret void
}