// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/parse.c
// Function: handle_bitfield
static struct token *handle_bitfield(struct token *token, struct decl_state *ctx)
{
	struct ctype *ctype = &ctx->ctype;
	struct expression *expr;
	struct symbol *bitfield;
	long long width;

	if (ctype->base_type != &int_type && !is_int_type(ctype->base_type)) {
		sparse_error(token->pos, "invalid bitfield specifier for type %s.",
			show_typename(ctype->base_type));
		// Parse this to recover gracefully.
		return conditional_expression(token->next, &expr);
	}

	bitfield = alloc_indirect_symbol(token->pos, ctype, SYM_BITFIELD);
	token = conditional_expression(token->next, &expr);
	width = const_expression_value(expr);
	bitfield->bit_size = width;

	if (width < 0 || width > INT_MAX || (*ctx->ident && width == 0)) {
		sparse_error(token->pos, "bitfield '%s' has invalid width (%lld)",
			show_ident(*ctx->ident), width);
		width = -1;
	} else if (*ctx->ident) {
		struct symbol *base_type = bitfield->ctype.base_type;
		struct symbol *bitfield_type = base_type == &int_type ? bitfield : base_type;
		int is_signed = !(bitfield_type->ctype.modifiers & MOD_UNSIGNED);
		if (Wone_bit_signed_bitfield && width == 1 && is_signed) {
			// Valid values are either {-1;0} or {0}, depending on integer
			// representation.  The latter makes for very efficient code...
			sparse_error(token->pos, "dubious one-bit signed bitfield");
		}
		if (Wdefault_bitfield_sign &&
		    bitfield_type->type != SYM_ENUM &&
		    !(bitfield_type->ctype.modifiers & MOD_EXPLICITLY_SIGNED) &&
		    is_signed) {
			// The sign of bitfields is unspecified by default.
			warning(token->pos, "dubious bitfield without explicit `signed' or `unsigned'");
		}
	}
	bitfield->bit_size = width;
	bitfield->endpos = token->pos;
	bitfield->ident = *ctx->ident;
	return token;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
leaq 0x6b5e5(%rip), %rcx     # 0x91258
cmpq %rcx, (%rax)
je 0x25ccf
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x25ea0
cmpl $0x0, %eax
jne 0x25ccf
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x33340
movq %rax, %rdx
movq -0x58(%rbp), %rax
movq (%rax), %rdi
leaq 0x3f198(%rip), %rsi     # 0x64e46
movb $0x0, %al
callq 0x16f90
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x56f40
movq %rax, -0x8(%rbp)
jmp 0x25e96
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rsi
movq (%rax), %rdi
movl $0xb, %edx
callq 0x25f20
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x56f40
movq %rax, -0x10(%rbp)
movq -0x28(%rbp), %rdi
callq 0x12170
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x50(%rax)
cmpq $0x0, -0x38(%rbp)
jl 0x25d3d
cmpq $0x7fffffff, -0x38(%rbp) # imm = 0x7FFFFFFF
jg 0x25d3d
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
cmpq $0x0, (%rax)
je 0x25d7e
cmpq $0x0, -0x38(%rbp)
jne 0x25d7e
movq -0x10(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rdi
callq 0x44150
movq %rax, %rdx
movq -0x60(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax), %rdi
leaq 0x3f104(%rip), %rsi     # 0x64e6e
movb $0x0, %al
callq 0x16f90
movq $-0x1, -0x38(%rbp)
jmp 0x25e5f
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
cmpq $0x0, (%rax)
je 0x25e5d
movq -0x30(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x40(%rbp)
leaq 0x6b4b5(%rip), %rax     # 0x91258
cmpq %rax, -0x40(%rbp)
jne 0x25db3
movq -0x30(%rbp), %rax
movq %rax, -0x68(%rbp)
jmp 0x25dbb
movq -0x40(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq 0x68(%rax), %rax
andq $0x4000, %rax           # imm = 0x4000
cmpq $0x0, %rax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4c(%rbp)
leaq 0x5ea63(%rip), %rax     # 0x8484c
cmpl $0x0, (%rax)
je 0x25e10
cmpq $0x1, -0x38(%rbp)
jne 0x25e10
cmpl $0x0, -0x4c(%rbp)
je 0x25e10
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0x3f08c(%rip), %rsi     # 0x64e95
movb $0x0, %al
callq 0x16f90
leaq 0x673c1(%rip), %rax     # 0x8d1d8
cmpl $0x0, (%rax)
je 0x25e5b
movq -0x48(%rbp), %rax
movl (%rax), %eax
andl $0xff, %eax
cmpl $0x9, %eax
je 0x25e5b
movq -0x48(%rbp), %rax
movq 0x68(%rax), %rax
andq $0x8000, %rax           # imm = 0x8000
cmpq $0x0, %rax
jne 0x25e5b
cmpl $0x0, -0x4c(%rbp)
je 0x25e5b
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0x3f061(%rip), %rsi     # 0x64eb5
movb $0x0, %al
callq 0x16d80
jmp 0x25e5d
jmp 0x25e5f
movq -0x38(%rbp), %rax
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x50(%rax)
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movq %rcx, 0xc(%rax)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq