// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/arch/arm32/assembler.c
// Function: prv_parse_def
static void prv_parse_def(subtilis_arm_ass_context_t *c, subtilis_error_t *err)
{
	const char *tbuf;
	subtilis_arm_ass_def_t *new_defs;
	size_t new_max_defs;
	const char *id_name;
	subtilis_arm_exp_val_t *val1 = NULL;
	subtilis_arm_exp_val_t *val2 = NULL;

	subtilis_lexer_get(c->l, c->t, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	tbuf = subtilis_token_get_text(c->t);
	if (c->t->type != SUBTILIS_TOKEN_IDENTIFIER) {
		subtilis_error_set_expected(err, "identifier", tbuf,
					    c->l->stream->name, c->l->line);
		goto cleanup;
	}

	tbuf = subtilis_token_get_text(c->t);
	val1 = subtilis_arm_exp_process_id(c, tbuf, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	if (val1->type != SUBTILIS_ARM_EXP_TYPE_ID) {
		subtilis_error_set_expected(err, "identifier",
					    subtilis_arm_exp_type_name(val1),
					    c->l->stream->name, c->l->line);
		goto cleanup;
	}

	subtilis_lexer_get(c->l, c->t, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	tbuf = subtilis_token_get_text(c->t);
	if (c->t->type != SUBTILIS_TOKEN_OPERATOR || strcmp(tbuf, "=")) {
		subtilis_error_set_expected(err, "=", tbuf, c->l->stream->name,
					    c->l->line);
		goto cleanup;
	}

	val2 = subtilis_arm_exp_val_get(c, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	if (c->def_count == c->max_defs) {
		new_max_defs = c->max_defs + SUBTILIS_CONFIG_CONSTANT_POOL_GRAN;
		new_defs = realloc(c->defs, sizeof(*new_defs) * new_max_defs);
		if (!new_defs) {
			subtilis_error_set_oom(err);
			goto cleanup;
		}
		c->defs = new_defs;
		c->max_defs = new_max_defs;
	}

	id_name = subtilis_buffer_get_string(&val1->val.buf);
	c->defs[c->def_count].name =
	    malloc(subtilis_buffer_get_size(&val1->val.buf));
	if (!c->defs[c->def_count].name) {
		subtilis_error_set_oom(err);
		goto cleanup;
	}
	strcpy(c->defs[c->def_count].name, id_name);
	c->defs[c->def_count++].val = val2;
	val2 = NULL;

cleanup:

	subtilis_arm_exp_val_free(val2);
	subtilis_arm_exp_val_free(val1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x10(%rbp), %rdx
callq 0x133f0
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x91f77
jmp 0x92292
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x12d70
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
cmpl $0x6, (%rax)
je 0x91fde
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x30(%rax), %r8
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x38(%rax), %r9d
movl $0x1d, %esi
leaq 0x1c181(%rip), %rdx     # 0xae142
leaq 0x1c158(%rip), %rax     # 0xae120
movq %rax, (%rsp)
movl $0xf90, 0x8(%rsp)       # imm = 0xF90
callq 0x156d0
jmp 0x92280
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x12d70
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x9b050
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x92012
jmp 0x92292
movq -0x38(%rbp), %rax
cmpl $0x9, (%rax)
je 0x92074
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rdi
callq 0x9b550
movq -0x48(%rbp), %rdi
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x30(%rax), %r8
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x38(%rax), %r9d
movl $0x1d, %esi
leaq 0x1c0eb(%rip), %rdx     # 0xae142
leaq 0x1c0c2(%rip), %rax     # 0xae120
movq %rax, (%rsp)
movl $0xf9c, 0x8(%rsp)       # imm = 0xF9C
callq 0x156d0
jmp 0x92280
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x10(%rbp), %rdx
callq 0x133f0
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x9209b
jmp 0x92292
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x12d70
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
cmpl $0x2, (%rax)
jne 0x920ce
movq -0x18(%rbp), %rdi
leaq 0x18550(%rip), %rsi     # 0xaa614
callq 0x12140
cmpl $0x0, %eax
je 0x92117
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x30(%rax), %r8
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x38(%rax), %r9d
movl $0x1d, %esi
leaq 0x1851a(%rip), %rdx     # 0xaa614
leaq 0x1c01f(%rip), %rax     # 0xae120
movq %rax, (%rsp)
movl $0xfa7, 0x8(%rsp)       # imm = 0xFA7
callq 0x156d0
jmp 0x92280
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x9b4f0
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x92136
jmp 0x92292
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x60(%rcx), %rax
jne 0x921af
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
addq $0x20, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdi
movq -0x28(%rbp), %rsi
shlq $0x4, %rsi
callq 0x121e0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x92197
movq -0x10(%rbp), %rdi
movl $0x1, %esi
leaq 0x1bf98(%rip), %rdx     # 0xae120
movl $0xfb3, %ecx            # imm = 0xFB3
callq 0x158e0
jmp 0x92280
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x28(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x38(%rbp), %rdi
addq $0x8, %rdi
callq 0x16760
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %rdi
addq $0x8, %rdi
callq 0x16270
movq %rax, %rdi
callq 0x121b0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x8(%rbp), %rdx
movq 0x58(%rdx), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x58(%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
jne 0x9222b
movq -0x10(%rbp), %rdi
movl $0x1, %esi
leaq 0x1bf01(%rip), %rdx     # 0xae120
movl $0xfbe, %ecx            # imm = 0xFBE
callq 0x158e0
jmp 0x92280
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x58(%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq -0x30(%rbp), %rsi
callq 0x12060
movq -0x40(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x8(%rbp), %rsi
movq 0x58(%rsi), %rdx
movq %rdx, %rdi
addq $0x1, %rdi
movq %rdi, 0x58(%rsi)
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rdi
callq 0x9a4c0
movq -0x38(%rbp), %rdi
callq 0x9a4c0
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)