// File: /workspace/github_c_makefile_star2_O3/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 0x6549a
movq %rax, %rbx
movq %rax, %rdi
movq %r12, %rsi
callq 0x12070
movq 0x30(%r15), %rdi
leaq 0x8(%rsp), %rdx
movq %r12, %rsi
callq 0x2ef1a
testb %al, %al
je 0x654c0
leaq 0x38(%r15), %r13
movq 0x8(%rsp), %rsi
movq %r13, %rdi
callq 0x5dc45
testb %al, %al
je 0x65555
movq 0x8(%rsp), %rsi
movq %r13, %rdi
callq 0x5dc75
movq 0x8(%rsp), %rax
jmp 0x654de
leaq 0x118cf(%rip), %rdx     # 0x76d70
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 0x145a4
movq 0x30(%r15), %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x2ef6e
movq %rax, 0x8(%rsp)
cmpl $0x0, (%r14)
jne 0x65589
movq (%r15), %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x4f530
cmpl $0x0, (%r14)
jne 0x65589
movq 0x8(%r15), %rdi
movq 0x10(%r15), %rsi
movq %r14, %rdx
callq 0x12edc
cmpl $0x0, (%r14)
jne 0x65589
movq 0x10(%r15), %rdi
callq 0x12ad0
movq 0x10(%r15), %rsi
cmpl $0x2, (%rsi)
jne 0x65529
cmpb $0x3a, (%rax)
jne 0x65529
cmpb $0x0, 0x1(%rax)
je 0x6559f
movq 0x8(%r15), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0x11834(%rip), %rax     # 0x76d70
leaq 0xe8d2(%rip), %rcx      # 0x73e15
movq %r14, %rdi
movl $0x64, %esi
movq %rbx, %rdx
pushq $0x183                  # imm = 0x183
jmp 0x6557f
movq 0x8(%r15), %rax
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0x11808(%rip), %rax     # 0x76d70
leaq 0xe8a6(%rip), %rcx      # 0x73e15
movq %r14, %rdi
movl $0x20, %esi
movq %r12, %rdx
pushq $0x170                  # imm = 0x170
pushq %rax
callq 0x143da
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 %r14, %rdx
callq 0x12edc
jmp 0x65589