// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/expression.c
// Function: generic_selection
static struct token *generic_selection(struct token *token, struct expression **tree)
{
	struct expression *expr = alloc_expression(token->pos, EXPR_GENERIC);
	struct type_expression **last = &expr->map;

	token = expect(token, '(', "after '_Generic'");
	token = assignment_expression(token, &expr->control);
	if (!match_op(token, ',')) {
		goto end;
	}
	while (match_op(token, ',')) {
		token = token->next;
		if (lookup_type(token)) {
			struct type_expression *map = __alloc_type_expression(0);
			token = typename(token, &map->type, NULL);
			token = expect(token, ':', "after typename");
			token = assignment_expression(token, &map->expr);
			*last = map;
			last = &map->next;
		} else if (match_ident(token, &default_ident)) {
			if (expr->def) {
				warning(token->pos, "multiple default in generic expression");
				info(expr->def->pos, "note: previous was here");
			}
			token = token->next;
			token = expect(token, ':', "after typename");
			token = assignment_expression(token, &expr->def);
		}
	}
end:
	*tree = expr;
	return expect(token, ')', "after expression");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl $0x1f, %esi
callq 0x55c50
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x20, %rax
addq $0x10, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl $0x28, %esi
leaq 0x15e60(%rip), %rdx     # 0x6cb85
callq 0x22eb0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x20, %rsi
callq 0x57130
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x2c, %esi
callq 0x55c10
cmpl $0x0, %eax
jne 0x56d5b
jmp 0x56e8e
jmp 0x56d5d
movq -0x8(%rbp), %rdi
movl $0x2c, %esi
callq 0x55c10
cmpl $0x0, %eax
je 0x56e8c
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x56ec0
cmpl $0x0, %eax
je 0x56df8
xorl %edi, %edi
callq 0x55a10
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x23160
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x3a, %esi
leaq 0x15dd8(%rip), %rdx     # 0x6cb96
callq 0x22eb0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
addq $0x8, %rsi
callq 0x57130
movq %rax, -0x8(%rbp)
movq -0x28(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x20(%rbp)
jmp 0x56e87
movq -0x8(%rbp), %rdi
leaq 0x3301d(%rip), %rsi     # 0x89e20
callq 0x57510
cmpl $0x0, %eax
je 0x56e85
movq -0x18(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x56e47
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x15d7f(%rip), %rsi     # 0x6cba5
movb $0x0, %al
callq 0x16d80
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x15d8c(%rip), %rsi     # 0x6cbcc
movb $0x0, %al
callq 0x16c10
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x3a, %esi
leaq 0x15d33(%rip), %rdx     # 0x6cb96
callq 0x22eb0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x20, %rsi
addq $0x8, %rsi
callq 0x57130
movq %rax, -0x8(%rbp)
jmp 0x56e87
jmp 0x56d5d
jmp 0x56e8e
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
movl $0x29, %esi
leaq 0x15d3b(%rip), %rdx     # 0x6cbe4
callq 0x22eb0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)