// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/parser_rec.c
// Function: prv_parse_fields
static void prv_parse_fields(subtilis_parser_t *p, subtilis_token_t *t,
			     subtilis_type_t *type, subtilis_error_t *err)
{
	const char *tbuf;
	size_t size;
	size_t align;
	subtilis_type_t field;

	tbuf = subtilis_token_get_text(t);

	while (!((t->type == SUBTILIS_TOKEN_OPERATOR) && !strcmp(tbuf, ")"))) {
		if (t->type == SUBTILIS_TOKEN_KEYWORD) {
			if (t->tok.keyword.type != SUBTILIS_KEYWORD_DIM) {
				subtilis_error_set_expected(err, ")", tbuf,
							    p->l->stream->name,
							    p->l->line);
				return;
			}

			prv_parse_dim(p, t, type, err);
			if (err->type != SUBTILIS_ERROR_OK)
				return;
			tbuf = subtilis_token_get_text(t);
			continue;
		}

		prv_check_id(p, t, &field, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;

		size = subtilis_type_if_size(&field, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto on_error;

		align = subtilis_type_if_align(&field, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto on_error;

		subtilis_type_rec_add_field(type, tbuf, &field, align, size, 0,
					    err);
		subtilis_type_free(&field);
		if (err->type != SUBTILIS_ERROR_OK) {
			if (err->type == SUBTILIS_ERROR_TYPE_ALREADY_DEFINED)
				subtilis_error_set_already_defined(
				    err, tbuf, p->l->stream->name, p->l->line);
			return;
		}

		subtilis_lexer_get(p->l, t, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
		tbuf = subtilis_token_get_text(t);
	}

	return;

on_error:
	subtilis_type_free(&field);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x448, %rsp            # imm = 0x448
movq %rcx, %r14
movq %rdx, 0x8(%rsp)
movq %rsi, %r13
movq %rdi, %r15
movq %rsi, %rdi
callq 0x12ad0
movq %rax, %r12
leaq 0x300(%rsp), %rbp
movq %r15, 0x18(%rsp)
movl (%r13), %eax
cmpl $0x1, %eax
je 0x292fc
cmpl $0x2, %eax
leaq 0x1b8(%rsp), %rbx
jne 0x29262
cmpb $0x29, (%r12)
jne 0x29262
cmpb $0x0, 0x1(%r12)
je 0x29636
movq %r15, %rdi
movq %r13, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x2aa39
cmpl $0x0, (%r14)
jne 0x29636
movq %rbx, %rdi
movq %r14, %rsi
callq 0x35d88
cmpl $0x0, (%r14)
jne 0x295cb
movq %rax, %rbp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x35dbe
cmpl $0x0, (%r14)
jne 0x295cb
subq $0x8, %rsp
movq 0x10(%rsp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
movl %eax, %ecx
movl %ebp, %r8d
xorl %r9d, %r9d
pushq %r14
callq 0x2fc68
addq $0x10, %rsp
movq %rbx, %rdi
callq 0x2f56e
movl (%r14), %eax
testl %eax, %eax
jne 0x295da
movq (%r15), %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x12edc
cmpl $0x0, (%r14)
je 0x294bb
jmp 0x29636
cmpl $0x1f, 0x8(%r13)
jne 0x29603
movb $0x0, 0x3(%rsp)
movq (%r15), %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x12edc
cmpl $0x0, (%r14)
jne 0x29636
movq %r15, %rdi
movq %r13, %rsi
leaq 0x70(%rsp), %rdx
movq %r14, %rcx
callq 0x2aa39
cmpl $0x0, (%r14)
jne 0x29636
movq %r13, %rdi
callq 0x12ad0
movq %rax, %r12
movq %rax, %rdi
callq 0x120f0
leaq 0x1(%rax), %rdi
callq 0x121d0
movq %rax, %rbx
testq %rax, %rax
je 0x293f5
movq %rbx, %rdi
movq %r12, %rsi
callq 0x12070
movl $0xa, %ecx
movq %r15, %rdi
movq %r13, %rsi
leaq 0x20(%rsp), %rdx
leaq 0x3(%rsp), %r8
movq %r14, %r9
callq 0x16594
movq %rax, %r12
movl (%r14), %eax
testl %eax, %eax
je 0x29416
cmpl $0x16, %eax
jne 0x293d0
movq (%r15), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
movq %r14, %rdi
movl $0x36, %esi
movq %rbx, %rdx
leaq 0x4aa58(%rip), %rcx     # 0x73e15
pushq $0x5a
leaq 0x4a724(%rip), %rax     # 0x73aea
pushq %rax
callq 0x143da
addq $0x10, %rsp
movq %rbx, %r15
testq %r12, %r12
je 0x2949a
xorl %ebx, %ebx
movq 0x20(%rsp,%rbx,8), %rdi
callq 0x2b166
incq %rbx
cmpq %rbx, %r12
jne 0x293de
jmp 0x2949a
movq %rbx, %r15
movq %r14, %rdi
movl $0x1, %esi
leaq 0x4a6e3(%rip), %rdx     # 0x73aea
movl $0x51, %ecx
callq 0x145a4
jmp 0x2949a
movb 0x3(%rsp), %al
testq %r12, %r12
setne %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x29470
testq %r12, %r12
je 0x294d3
xorl %ecx, %ecx
movq 0x20(%rsp,%rcx,8), %rdx
cmpl $0x1, (%rdx)
jne 0x29557
incq %rcx
cmpq %rcx, %r12
jne 0x29432
testb %al, %al
je 0x294ee
leaq 0x70(%rsp), %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x41944
movq 0x20(%rsp), %rax
movl 0x148(%rax), %eax
jmp 0x29515
movq %r15, %rax
movq %rbx, %r15
movq (%rax), %rax
movq 0x30(%rax), %rdx
movl 0x38(%rax), %ecx
movq %r14, %rdi
movl $0x43, %esi
leaq 0x4a65b(%rip), %r8      # 0x73aea
movl $0x63, %r9d
callq 0x145c8
leaq 0x70(%rsp), %rdi
callq 0x2f56e
movq %r15, %rdi
callq 0x122c0
cmpl $0x0, (%r14)
movq 0x18(%rsp), %r15
jne 0x29636
movq %r13, %rdi
callq 0x12ad0
movq %rax, %r12
leaq 0x300(%rsp), %rbp
jmp 0x29235
testb %al, %al
je 0x294ee
leaq 0x70(%rsp), %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x41944
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x29515
subq $0x8, %rsp
movq %r15, %rdi
movq %rbx, %rsi
leaq 0x78(%rsp), %rdx
movq %rbp, %rcx
leaq 0x28(%rsp), %r8
movq %r12, %r9
pushq %r14
callq 0x41867
addq $0x10, %rsp
xorl %eax, %eax
cmpl $0x0, (%r14)
jne 0x293d0
movl %eax, 0x4(%rsp)
movq %rbp, %rdi
movq %r14, %rsi
callq 0x35d88
cmpl $0x0, (%r14)
jne 0x2954a
movq %rax, 0x10(%rsp)
movq %rbp, %rdi
movq %r14, %rsi
callq 0x35dbe
cmpl $0x0, (%r14)
je 0x29580
movq %rbp, %rdi
callq 0x2f56e
jmp 0x293d0
movq (%r15), %rax
movq 0x30(%rax), %rdx
movl 0x38(%rax), %ecx
movq %r14, %rdi
movl $0x43, %esi
leaq 0x4a57a(%rip), %r8      # 0x73aea
movl $0x6c, %r9d
callq 0x145c8
jmp 0x293d0
subq $0x8, %rsp
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
movq %rbp, %rdx
movl %eax, %ecx
movq 0x18(%rsp), %r8
movl 0xc(%rsp), %r9d
pushq %r14
callq 0x2fc68
addq $0x10, %rsp
movq %rbp, %rdi
callq 0x2f56e
cmpl $0x0, (%r14)
jne 0x293d0
movq (%r15), %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x12edc
jmp 0x293d0
leaq 0x1b8(%rsp), %rdi
callq 0x2f56e
jmp 0x29636
cmpl $0x68, %eax
jne 0x29636
movq (%r15), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0x4a824(%rip), %rcx     # 0x73e15
movq %r14, %rdi
movl $0x20, %esi
movq %r12, %rdx
pushq $0xc1
jmp 0x29625
movq (%r15), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0x4a4f0(%rip), %rdx     # 0x73b05
movq %r14, %rdi
movl $0x1d, %esi
movq %r12, %rcx
pushq $0xa4
leaq 0x4a4be(%rip), %rax     # 0x73aea
pushq %rax
callq 0x143da
addq $0x10, %rsp
addq $0x448, %rsp            # imm = 0x448
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq