// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/pre-process.c
// Function: parse_arguments
static struct token *parse_arguments(struct token *list)
{
	struct token *arg = list->next, *next = list;
	struct argcount *count = &list->count;

	set_arg_count(list);

	if (match_op(arg, ')')) {
		next = arg->next;
		list->next = &eof_token_entry;
		return next;
	}

	while (token_type(arg) == TOKEN_IDENT) {
		if (arg->ident == &__VA_ARGS___ident)
			goto Eva_args;
		if (!++count->normal)
			goto Eargs;
		next = arg->next;

		if (match_op(next, ',')) {
			set_arg_count(next);
			arg = next->next;
			continue;
		}

		if (match_op(next, ')')) {
			set_arg_count(next);
			next = next->next;
			arg->next->next = &eof_token_entry;
			return next;
		}

		/* normal cases are finished here */

		if (match_op(next, SPECIAL_ELLIPSIS)) {
			if (match_op(next->next, ')')) {
				set_arg_count(next);
				next->count.vararg = 1;
				next = next->next;
				arg->next->next = &eof_token_entry;
				return next->next;
			}

			arg = next;
			goto Enotclosed;
		}

		if (eof_token(next)) {
			goto Enotclosed;
		} else {
			arg = next;
			goto Ebadstuff;
		}
	}

	if (match_op(arg, SPECIAL_ELLIPSIS)) {
		next = arg->next;
		token_type(arg) = TOKEN_IDENT;
		arg->ident = &__VA_ARGS___ident;
		if (!match_op(next, ')'))
			goto Enotclosed;
		if (!++count->normal)
			goto Eargs;
		set_arg_count(next);
		next->count.vararg = 1;
		next = next->next;
		arg->next->next = &eof_token_entry;
		return next;
	}

	if (eof_token(arg)) {
		arg = next;
		goto Enotclosed;
	}
	if (match_op(arg, ','))
		goto Emissing;
	else
		goto Ebadstuff;


Emissing:
	sparse_error(arg->pos, "parameter name missing");
	return NULL;
Ebadstuff:
	sparse_error(arg->pos, "\"%s\" may not appear in macro parameter list",
		show_token(arg));
	return NULL;
Enotclosed:
	sparse_error(arg->pos, "missing ')' in macro parameter list");
	return NULL;
Eva_args:
	sparse_error(arg->pos, "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro");
	return NULL;
Eargs:
	sparse_error(arg->pos, "too many arguments in macro definition");
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2e1d0
movq -0x18(%rbp), %rdi
movl $0x29, %esi
callq 0x2c380
cmpl $0x0, %eax
je 0x2de90
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
leaq 0x7eb41(%rip), %rcx     # 0xac9c0
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x2e1b9
jmp 0x2de92
movq -0x18(%rbp), %rax
movq (%rax), %rax
andq $0x3f, %rax
cmpl $0x3, %eax
jne 0x2e00b
movq -0x18(%rbp), %rax
leaq 0x5c547(%rip), %rcx     # 0x8a3f8
cmpq %rcx, 0x10(%rax)
jne 0x2debc
jmp 0x2e17d
movq -0x28(%rbp), %rcx
movl (%rcx), %eax
andl $0x3ff, %eax            # imm = 0x3FF
addl $0x1, %eax
movl (%rcx), %edx
andl $0x3ff, %eax            # imm = 0x3FF
andl $0xfffffc00, %edx       # imm = 0xFFFFFC00
orl %eax, %edx
movl %edx, (%rcx)
cmpl $0x0, %eax
jne 0x2dee5
jmp 0x2e19c
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movl $0x2c, %esi
callq 0x2c380
cmpl $0x0, %eax
je 0x2df1e
movq -0x20(%rbp), %rdi
callq 0x2e1d0
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x2de92
movq -0x20(%rbp), %rdi
movl $0x29, %esi
callq 0x2c380
cmpl $0x0, %eax
je 0x2df66
movq -0x20(%rbp), %rdi
callq 0x2e1d0
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
leaq 0x7ea6b(%rip), %rcx     # 0xac9c0
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x2e1b9
movq -0x20(%rbp), %rdi
movl $0x117, %esi            # imm = 0x117
callq 0x2c380
cmpl $0x0, %eax
je 0x2dfec
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0x29, %esi
callq 0x2c380
cmpl $0x0, %eax
je 0x2dfdf
movq -0x20(%rbp), %rdi
callq 0x2e1d0
movq -0x20(%rbp), %rax
movl 0x10(%rax), %ecx
andl $0xbfffffff, %ecx       # imm = 0xBFFFFFFF
orl $0x40000000, %ecx       # imm = 0x40000000
movl %ecx, 0x10(%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
leaq 0x7e9f6(%rip), %rcx     # 0xac9c0
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x2e1b9
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x2e15e
leaq 0x7e9cd(%rip), %rax     # 0xac9c0
cmpq %rax, -0x20(%rbp)
jne 0x2dffe
jmp 0x2e15e
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x2e12b
movq -0x18(%rbp), %rdi
movl $0x117, %esi            # imm = 0x117
callq 0x2c380
cmpl $0x0, %eax
je 0x2e0db
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
andq $-0x40, %rcx
orq $0x3, %rcx
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
leaq 0x5c3ad(%rip), %rcx     # 0x8a3f8
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rdi
movl $0x29, %esi
callq 0x2c380
cmpl $0x0, %eax
jne 0x2e067
jmp 0x2e15e
movq -0x28(%rbp), %rcx
movl (%rcx), %eax
andl $0x3ff, %eax            # imm = 0x3FF
addl $0x1, %eax
movl (%rcx), %edx
andl $0x3ff, %eax            # imm = 0x3FF
andl $0xfffffc00, %edx       # imm = 0xFFFFFC00
orl %eax, %edx
movl %edx, (%rcx)
cmpl $0x0, %eax
jne 0x2e090
jmp 0x2e19c
movq -0x20(%rbp), %rdi
callq 0x2e1d0
movq -0x20(%rbp), %rax
movl 0x10(%rax), %ecx
andl $0xbfffffff, %ecx       # imm = 0xBFFFFFFF
orl $0x40000000, %ecx       # imm = 0x40000000
movl %ecx, 0x10(%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
leaq 0x7e8f6(%rip), %rcx     # 0xac9c0
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x2e1b9
leaq 0x7e8de(%rip), %rax     # 0xac9c0
cmpq %rax, -0x18(%rbp)
jne 0x2e0f2
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x2e15e
movq -0x18(%rbp), %rdi
movl $0x2c, %esi
callq 0x2c380
cmpl $0x0, %eax
je 0x2e107
jmp 0x2e109
jmp 0x2e12b
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x39903(%rip), %rsi     # 0x67a1a
movb $0x0, %al
callq 0x16f90
movq $0x0, -0x8(%rbp)
jmp 0x2e1b9
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0x44420
movq %rax, %rdx
movq -0x30(%rbp), %rax
movq (%rax), %rdi
leaq 0x398e4(%rip), %rsi     # 0x67a31
movb $0x0, %al
callq 0x16f90
movq $0x0, -0x8(%rbp)
jmp 0x2e1b9
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x398f1(%rip), %rsi     # 0x67a5d
movb $0x0, %al
callq 0x16f90
movq $0x0, -0x8(%rbp)
jmp 0x2e1b9
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x398f6(%rip), %rsi     # 0x67a81
movb $0x0, %al
callq 0x16f90
movq $0x0, -0x8(%rbp)
jmp 0x2e1b9
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x3991c(%rip), %rsi     # 0x67ac6
movb $0x0, %al
callq 0x16f90
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)