// File: /workspace/github_c_makefile_star2_O1/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, 0x18(%rsp)
movq %rsi, %r13
movq %rdi, %r15
movq %rsi, %rdi
callq 0x12ad0
movq %rax, %rbx
leaq 0x300(%rsp), %rbp
movl (%r13), %r12d
cmpl $0x1, %r12d
je 0x294da
cmpl $0x2, %r12d
jne 0x295c3
movq %rbx, %rdi
leaq 0x4a62a(%rip), %rsi     # 0x73aed
callq 0x12160
testl %eax, %eax
je 0x298a1
cmpl $0x1, %r12d
jne 0x295c3
cmpl $0x1f, 0x8(%r13)
jne 0x2986e
movb $0x0, 0x7(%rsp)
movq (%r15), %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x12eda
cmpl $0x0, (%r14)
jne 0x2964e
movq %r15, %rdi
movq %r13, %rsi
leaq 0x1b8(%rsp), %rdx
movq %r14, %rcx
callq 0x2ad90
cmpl $0x0, (%r14)
jne 0x2964e
movq %r13, %rdi
callq 0x12ad0
movq %rax, %rbx
movq %rax, %rdi
callq 0x120f0
leaq 0x1(%rax), %rdi
callq 0x121d0
testq %rax, %rax
movq %rax, 0x8(%rsp)
je 0x29668
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
callq 0x12070
movl $0xa, %ecx
movq %r15, %rdi
movq %r13, %rsi
leaq 0x20(%rsp), %rdx
leaq 0x7(%rsp), %r8
movq %r14, %r9
callq 0x16618
movq %rax, %rbx
movl (%r14), %eax
testl %eax, %eax
je 0x29686
cmpl $0x16, %eax
jne 0x29713
movq (%r15), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
movq %r14, %rdi
movl $0x36, %esi
movq %r12, %rdx
leaq 0x4a84a(%rip), %rcx     # 0x73df5
pushq $0x5a
leaq 0x4a51e(%rip), %rax     # 0x73ad2
pushq %rax
callq 0x1442a
addq $0x10, %rsp
jmp 0x29713
movq %r15, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movq %r14, %rcx
callq 0x2ad90
cmpl $0x0, (%r14)
jne 0x298a1
movq %rbp, %rdi
movq %r14, %rsi
callq 0x35ed8
cmpl $0x0, (%r14)
jne 0x29836
movq %rax, %r12
movq %rbp, %rdi
movq %r14, %rsi
callq 0x35f0e
cmpl $0x0, (%r14)
jne 0x29836
subq $0x8, %rsp
movq 0x20(%rsp), %rdi
movq %rbx, %rsi
movq %rbp, %rdx
movl %eax, %ecx
movl %r12d, %r8d
xorl %r9d, %r9d
pushq %r14
callq 0x2ff3c
addq $0x10, %rsp
movq %rbp, %rdi
callq 0x2f843
movl (%r14), %eax
testl %eax, %eax
jne 0x29845
movq (%r15), %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x12eda
cmpl $0x0, (%r14)
jne 0x298a1
movq %r13, %rdi
callq 0x12ad0
movq %rax, %rbx
jmp 0x294a5
movq %r14, %rdi
movl $0x1, %esi
leaq 0x4a45b(%rip), %rdx     # 0x73ad2
movl $0x51, %ecx
callq 0x145f4
jmp 0x29711
movb 0x7(%rsp), %al
testq %rbx, %rbx
setne %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x296ed
testq %rbx, %rbx
leaq 0x70(%rsp), %r12
je 0x296b9
xorl %ecx, %ecx
movq 0x20(%rsp,%rcx,8), %rdx
cmpl $0x1, (%rdx)
jne 0x29777
incq %rcx
cmpq %rcx, %rbx
jne 0x296a3
testb %al, %al
je 0x29749
leaq 0x1b8(%rsp), %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x41a71
testq %rbx, %rbx
je 0x297a0
movq 0x20(%rsp), %rax
movl 0x148(%rax), %eax
jmp 0x297a5
movq (%r15), %rax
movq 0x30(%rax), %rdx
movl 0x38(%rax), %ecx
movq %r14, %rdi
movl $0x43, %esi
leaq 0x4a3cc(%rip), %r8      # 0x73ad2
movl $0x63, %r9d
callq 0x14618
xorl %ebx, %ebx
testq %rbx, %rbx
je 0x2972d
xorl %r12d, %r12d
movq 0x20(%rsp,%r12,8), %rdi
callq 0x2b4c3
incq %r12
cmpq %r12, %rbx
jne 0x2971b
leaq 0x1b8(%rsp), %rdi
callq 0x2f843
movq 0x8(%rsp), %rdi
callq 0x122c0
jmp 0x2964e
subq $0x8, %rsp
movq %r15, %rdi
movq 0x10(%rsp), %rsi
leaq 0x1c0(%rsp), %rdx
movq %r12, %rcx
leaq 0x28(%rsp), %r8
movq %rbx, %r9
pushq %r14
callq 0x41994
addq $0x10, %rsp
xorl %eax, %eax
jmp 0x297a5
movq (%r15), %rax
movq 0x30(%rax), %rdx
movl 0x38(%rax), %ecx
movq %r14, %rdi
movl $0x43, %esi
leaq 0x4a342(%rip), %r8      # 0x73ad2
movl $0x6c, %r9d
callq 0x14618
jmp 0x29713
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0x0, (%r14)
jne 0x29713
movl %eax, 0x14(%rsp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x35ed8
movq %r12, %rdi
cmpl $0x0, (%r14)
jne 0x297dd
movq %rax, %r12
movq %r14, %rsi
callq 0x35f0e
cmpl $0x0, (%r14)
je 0x297e7
leaq 0x70(%rsp), %rdi
callq 0x2f843
jmp 0x29713
subq $0x8, %rsp
movq 0x20(%rsp), %rdi
movq 0x10(%rsp), %rsi
leaq 0x78(%rsp), %rdx
movl %eax, %ecx
movl %r12d, %r8d
movl 0x1c(%rsp), %r9d
pushq %r14
callq 0x2ff3c
addq $0x10, %rsp
leaq 0x70(%rsp), %rdi
callq 0x2f843
cmpl $0x0, (%r14)
jne 0x29713
movq (%r15), %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x12eda
jmp 0x29713
leaq 0x300(%rsp), %rdi
callq 0x2f843
jmp 0x298a1
cmpl $0x68, %eax
jne 0x298a1
movq (%r15), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0x4a599(%rip), %rcx     # 0x73df5
movq %r14, %rdi
movl $0x20, %esi
movq %rbx, %rdx
pushq $0xc1
jmp 0x29890
movq (%r15), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0x4a26d(%rip), %rdx     # 0x73aed
movq %r14, %rdi
movl $0x1d, %esi
movq %rbx, %rcx
pushq $0xa4
leaq 0x4a23b(%rip), %rax     # 0x73ad2
pushq %rax
callq 0x1442a
addq $0x10, %rsp
addq $0x448, %rsp            # imm = 0x448
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq