// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/arch/arm32/assembler.c
// Function: prv_parse_adr
static void prv_parse_adr(subtilis_arm_ass_context_t *c,
			  subtilis_arm_ccode_type_t ccode,
			  subtilis_error_t *err)
{
	subtilis_arm_exp_val_t *val;
	const char *str;
	size_t index;
	subtilis_arm_reg_t dest;
	const char *tbuf;
	const char *bad_reg = "R15";

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

	if (val->type != SUBTILIS_ARM_EXP_TYPE_REG) {
		subtilis_error_set_expected(err, "register",
					    subtilis_arm_exp_type_name(val),
					    c->l->stream->name, c->l->line);
		goto cleanup;
	}

	dest = val->val.reg;
	if (dest == 15) {
		subtilis_error_set_ass_bad_reg(err, bad_reg, c->l->stream->name,
					       c->l->line);
		goto cleanup;
	}

	subtilis_arm_exp_val_free(val);
	val = NULL;

	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;
	}

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

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

	str = subtilis_buffer_get_string(&val->val.buf);
	if (!subtilis_string_pool_find(c->label_pool, str, &index)) {
		index = subtilis_string_pool_register(c->label_pool, str, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
		subtilis_bitset_set(&c->pending_labels, index, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
	}

	subtilis_add_adr(c->arm_s, ccode, dest, index, err);

cleanup:

	subtilis_arm_exp_val_free(val);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r15
movq %rdx, %rsi
callq 0x69632
cmpl $0x0, (%r14)
jne 0x67797
movq %rax, %rbx
cmpl $0x1, (%rax)
jne 0x676f4
movq 0x8(%rbx), %r12
cmpq $0xf, %r12
jne 0x67733
movq 0x8(%r15), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0xf69a(%rip), %rax      # 0x76d70
leaq 0xf725(%rip), %rdx      # 0x76e02
leaq 0xc731(%rip), %rcx      # 0x73e15
movq %r14, %rdi
movl $0x58, %esi
pushq $0x6d6                  # imm = 0x6D6
pushq %rax
jmp 0x67728
movq %rbx, %rdi
callq 0x6966d
movq 0x8(%r15), %rcx
movq 0x30(%rcx), %r8
movl 0x38(%rcx), %r9d
leaq 0xf661(%rip), %r10      # 0x76d70
leaq 0xf705(%rip), %rdx      # 0x76e1b
movq %r14, %rdi
movl $0x1d, %esi
movq %rax, %rcx
pushq $0x6cf                  # imm = 0x6CF
pushq %r10
callq 0x143da
addq $0x10, %rsp
jmp 0x6778f
movq %rbx, %rdi
callq 0x68d41
movq 0x10(%r15), %rdi
callq 0x12ad0
movq 0x10(%r15), %rcx
cmpl $0x2, (%rcx)
jne 0x67758
cmpb $0x2c, (%rax)
jne 0x67758
cmpb $0x0, 0x1(%rax)
je 0x677a6
movq 0x8(%r15), %rcx
movq 0x30(%rcx), %r8
movl 0x38(%rcx), %r9d
leaq 0xf605(%rip), %r10      # 0x76d70
leaq 0xbe20(%rip), %rdx      # 0x73592
movq %r14, %rdi
movl $0x1d, %esi
movq %rax, %rcx
pushq $0x6e0                  # imm = 0x6E0
pushq %r10
callq 0x143da
addq $0x10, %rsp
xorl %ebx, %ebx
movq %rbx, %rdi
callq 0x68d41
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
movq %r14, %rsi
callq 0x69632
cmpl $0x0, (%r14)
jne 0x67797
movq %rax, %rbx
cmpl $0x9, (%rax)
jne 0x677f7
movq %rbx, %rdi
addq $0x8, %rdi
callq 0x14db1
movq %rax, %r13
movq 0x30(%r15), %rdi
movq %rsp, %rdx
movq %rax, %rsi
callq 0x2ef1a
testb %al, %al
je 0x6782e
movq (%r15), %rdi
movq (%rsp), %rcx
movl %ebp, %esi
movq %r12, %rdx
movq %r14, %r8
callq 0x4fb14
jmp 0x6778f
movq %rbx, %rdi
callq 0x6966d
movq 0x8(%r15), %rcx
movq 0x30(%rcx), %r8
movl 0x38(%rcx), %r9d
leaq 0xf55e(%rip), %r10      # 0x76d70
leaq 0xf623(%rip), %rdx      # 0x76e3c
movq %r14, %rdi
movl $0x1d, %esi
movq %rax, %rcx
pushq $0x6eb                  # imm = 0x6EB
jmp 0x67726
movq 0x30(%r15), %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x2ef6e
movq %rax, (%rsp)
cmpl $0x0, (%r14)
jne 0x6778f
leaq 0x38(%r15), %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x5db68
cmpl $0x0, (%r14)
jne 0x6778f
jmp 0x677e1