#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 /*<<< orphan*/ ungetc(char, int /*<<< orphan*/ *);
size_t wf_next_token(char *, size_t, int /*<<< orphan*/ *);
size_t wf_next_argument(char *buffer, size_t size, FILE *fp) {
  size_t n;
  n = wf_next_token(buffer, size, fp);
  if (n > 0 && (buffer[0] == '\n' || buffer[0] == '#')) {
    ungetc(buffer[0], fp);
    return 0;
  }
  return n;
}


x86 assembly (clang, -O0):
<wf_next_argument>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <wf_next_token@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jbe    1193 <wf_next_argument+0x73>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1174 <wf_next_argument+0x54>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    1193 <wf_next_argument+0x73>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x20(%rbp),%rsi
movsbl %al,%edi
call   1040 <ungetc@plt>
movq   $0x0,-0x8(%rbp)
jmp    119b <wf_next_argument+0x7b>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wf_next_argument>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <wf_next_token@plt>
test   %rax,%rax
je     114b <wf_next_argument+0x2b>
mov    (%rbx),%cl
cmp    $0x23,%cl
je     1140 <wf_next_argument+0x20>
cmp    $0xa,%cl
jne    114d <wf_next_argument+0x2d>
movsbl %cl,%edi
mov    %r14,%rsi
call   1040 <ungetc@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @wf_next_argument(i8* %0, i64 %1, i32* %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32*
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i32* %2, i32** %7
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i32*, i32** %7
%12 = call i64 @wf_next_token(i8* %9, i64 %10, i32* %11)
store i64 %12, i64* %8
%13 = load i64, i64* %8
%14 = icmp ugt i64 %13, 0
br i1 %14, label %15, label %33
15: ; preds = %3
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 10
br i1 %20, label %27, label %21
21: ; preds = %15
%22 = load i8*, i8** %5
%23 = getelementptr inbounds i8, i8* %22, i64 0
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 35
br i1 %26, label %27, label %33
27: ; preds = %21, %15
%28 = load i8*, i8** %5
%29 = getelementptr inbounds i8, i8* %28, i64 0
%30 = load i8, i8* %29
%31 = load i32*, i32** %7
%32 = call i32 @ungetc(i8 signext %30, i32* %31)
store i64 0, i64* %4
br label %35
33: ; preds = %21, %3
%34 = load i64, i64* %8
store i64 %34, i64* %4
br label %35
35: ; preds = %33, %27
%36 = load i64, i64* %4
ret i64 %36
}

LLVM IR (-O2):
define i64 @wf_next_argument(i8* %0, i64 %1, i32* %2) {
%4 = tail call i64 @wf_next_token(i8* %0, i64 %1, i32* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = load i8, i8* %0
switch i8 %7, label %10 [
i8 10, label %8
i8 35, label %8
]
8: ; preds = %6, %6
%9 = tail call i32 @ungetc(i8 signext %7, i32* %2)
br label %10
10: ; preds = %3, %6, %8
%11 = phi i64 [ 0, %8 ], [ %4, %6 ], [ 0, %3 ]
ret i64 %11
}