#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*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
size_t read_token(char *, size_t, char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
size_t wf_next_token(char *buffer, size_t size, FILE *fp) {
  size_t n;
  int ch;
again:
  n = read_token(buffer, size, " \t", "#\n\\", fp);
  if (n == 1 && buffer[0] == '\\') {
    ch = getc(fp);
    if (ch == '\n') {
      goto again;
    } else {
      ungetc(ch, fp);
    }
  }
  return n;
}


x86 assembly (clang, -O0):
<wf_next_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%r8
lea    0xea9(%rip),%rdx
lea    0xea5(%rip),%rcx
call   1030 <read_token@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x1,-0x20(%rbp)
jne    11ae <wf_next_token+0x7e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    11ae <wf_next_token+0x7e>
mov    -0x18(%rbp),%rdi
call   1050 <getc@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0xa,-0x24(%rbp)
jne    119d <wf_next_token+0x6d>
jmp    1144 <wf_next_token+0x14>
mov    -0x24(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1040 <ungetc@plt>
jmp    11ae <wf_next_token+0x7e>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wf_next_token>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xeb5(%rip),%r12
lea    0xeb1(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %r15,%r8
call   1030 <read_token@plt>
mov    %rax,%rbp
cmp    $0x1,%rax
jne    1199 <wf_next_token+0x69>
cmpb   $0x5c,(%rbx)
jne    1199 <wf_next_token+0x69>
mov    %r15,%rdi
call   1050 <getc@plt>
cmp    $0xa,%eax
je     1160 <wf_next_token+0x30>
mov    %eax,%edi
mov    %r15,%rsi
call   1040 <ungetc@plt>
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c" \09\00"
@.str.1 = [4 x i8] c"#\0A\\\00"
define i64 @wf_next_token(i8* %0, i64 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32* %2, i32** %6
br label %9
9: ; preds = %27, %3
%10 = load i8*, i8** %4
%11 = load i64, i64* %5
%12 = load i32*, i32** %6
%13 = call i64 @read_token(i8* %10, i64 %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %12)
store i64 %13, i64* %7
%14 = load i64, i64* %7
%15 = icmp eq i64 %14, 1
br i1 %15, label %16, label %33
16: ; preds = %9
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i64 0
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 92
br i1 %21, label %22, label %33
22: ; preds = %16
%23 = load i32*, i32** %6
%24 = call i32 @getc(i32* %23)
store i32 %24, i32* %8
%25 = load i32, i32* %8
%26 = icmp eq i32 %25, 10
br i1 %26, label %27, label %28
27: ; preds = %22
br label %9
28: ; preds = %22
%29 = load i32, i32* %8
%30 = load i32*, i32** %6
%31 = call i32 @ungetc(i32 %29, i32* %30)
br label %32
32: ; preds = %28
br label %33
33: ; preds = %32, %16, %9
%34 = load i64, i64* %7
ret i64 %34
}

LLVM IR (-O2):
@.str = [3 x i8] c" \09\00"
@.str.1 = [4 x i8] c"#\0A\\\00"
define i64 @wf_next_token(i8* %0, i64 %1, i32* %2) {
br label %4
4: ; preds = %10, %3
%5 = tail call i64 @read_token(i8* %0, i64 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = icmp eq i64 %5, 1
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i8, i8* %0
%9 = icmp eq i8 %8, 92
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = tail call i32 @getc(i32* %2)
%12 = icmp eq i32 %11, 10
br i1 %12, label %4, label %13
13: ; preds = %10
%14 = tail call i32 @ungetc(i32 %11, i32* %2)
br label %15
15: ; preds = %7, %4, %13
ret i64 %5
}