// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/assembler.c
// Function: prv_parse_label
static void prv_parse_label(subtilis_arm_ass_context_t *c, const char *name,
			    subtilis_error_t *err)
{
	size_t index;
	const char *tbuf;
	char *name_cpy;

	name_cpy = malloc(strlen(name) + 1);
	if (!name_cpy) {
		subtilis_error_set_oom(err);
		return;
	}
	strcpy(name_cpy, name);

	if (subtilis_string_pool_find(c->label_pool, name, &index)) {
		if (subtilis_bitset_isset(&c->pending_labels, index)) {
			subtilis_bitset_clear(&c->pending_labels, index);
		} else {
			subtilis_error_set_already_defined(
			    err, name, c->l->stream->name, c->l->line);
			goto cleanup;
		}
	} else {
		index = subtilis_string_pool_register(c->label_pool, name, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
	}

	subtilis_arm_section_add_label(c->arm_s, index, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

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

	subtilis_lexer_get(c->l, c->t, err);

cleanup:

	free(name_cpy);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
movq %rsi, %rdi
callq 0x120f0
leaq 0x1(%rax), %rdi
callq 0x121d0
testq %rax, %rax
je 0x655d0
movq %rax, %rbx
movq %rax, %rdi
movq %r12, %rsi
callq 0x12070
movq 0x30(%r15), %rdi
leaq 0x8(%rsp), %rdx
movq %r12, %rsi
callq 0x2f216
testb %al, %al
je 0x655f6
leaq 0x38(%r15), %r13
movq 0x8(%rsp), %rsi
movq %r13, %rdi
callq 0x5dc3d
testb %al, %al
je 0x6569b
movq 0x8(%rsp), %rsi
movq %r13, %rdi
callq 0x5dc6d
jmp 0x65614
leaq 0x11739(%rip), %rdx     # 0x76d10
movq %r14, %rdi
movl $0x1, %esi
movl $0x166, %ecx            # imm = 0x166
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x145f4
movq 0x30(%r15), %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x2f26d
movq %rax, 0x8(%rsp)
cmpl $0x0, (%r14)
jne 0x656cf
movq (%r15), %rdi
movq 0x8(%rsp), %rsi
movq %r14, %rdx
callq 0x4f587
cmpl $0x0, (%r14)
jne 0x656cf
movq 0x8(%r15), %rdi
movq 0x10(%r15), %rsi
movq %r14, %rdx
callq 0x12eda
cmpl $0x0, (%r14)
jne 0x656cf
movq 0x10(%r15), %rdi
callq 0x12ad0
movq 0x10(%r15), %r12
cmpl $0x2, (%r12)
jne 0x6566f
leaq 0xe2b6(%rip), %rsi      # 0x73919
movq %rax, %rdi
callq 0x12160
testl %eax, %eax
je 0x656e5
movq 0x8(%r15), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0x1168e(%rip), %rax     # 0x76d10
leaq 0xe76c(%rip), %rcx      # 0x73df5
movq %r14, %rdi
movl $0x64, %esi
movq %rbx, %rdx
pushq $0x183                  # imm = 0x183
jmp 0x656c5
movq 0x8(%r15), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0x11662(%rip), %rax     # 0x76d10
leaq 0xe740(%rip), %rcx      # 0x73df5
movq %r14, %rdi
movl $0x20, %esi
movq %r12, %rdx
pushq $0x170                  # imm = 0x170
pushq %rax
callq 0x1442a
addq $0x10, %rsp
movq %rbx, %rdi
callq 0x122c0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x8(%r15), %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x12eda
jmp 0x656cf