// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/assembler.c
// Function: prv_get_uint32_list
static int32_t *prv_get_uint32_list(subtilis_arm_ass_context_t *c,
				    size_t *count,
				    subtilis_arm_ass_valid_int_fn_t fn,
				    subtilis_error_t *err)
{
	const char *tbuf;
	int32_t *new_nums;
	int32_t num;
	int32_t *nums = NULL;
	size_t max_nums = 0;
	size_t num_count = 0;
	subtilis_arm_exp_val_t *val = NULL;

	do {
		val = subtilis_arm_exp_val_get(c, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;

		if (val->type == SUBTILIS_ARM_EXP_TYPE_INT) {
			num = val->val.integer;
		} else if (val->type == SUBTILIS_ARM_EXP_TYPE_REAL) {
			num = (int32_t)val->val.real;
		} else {
			subtilis_error_set_integer_expected(
			    err, subtilis_arm_exp_type_name(val),
			    c->l->stream->name, c->l->line);
			goto cleanup;
		}

		subtilis_arm_exp_val_free(val);
		val = NULL;

		if (fn && !fn(num)) {
			subtilis_error_set_ass_integer_too_big(
			    err, c->t->tok.integer, c->l->stream->name,
			    c->l->line);
			goto cleanup;
		}

		if (num_count == max_nums) {
			max_nums += 32;
			new_nums = realloc(nums, max_nums * sizeof(*nums));
			if (!new_nums)
				goto cleanup;
			nums = new_nums;
		}

		nums[num_count++] = num;
		tbuf = subtilis_token_get_text(c->t);
	} while ((c->t->type == SUBTILIS_TOKEN_OPERATOR) && !strcmp(tbuf, ","));

	*count = num_count;

	return nums;

cleanup:

	subtilis_arm_exp_val_free(val);
	free(nums);

	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x8(%rsp)
movq %rdx, %r12
movq %rsi, 0x10(%rsp)
movq %rdi, %rbp
xorl %r14d, %r14d
xorl %r15d, %r15d
xorl %ecx, %ecx
movq %rdi, (%rsp)
movq %rcx, %rbx
movq %rbp, %rdi
movq 0x8(%rsp), %rbp
movq %rbp, %rsi
callq 0x69a84
movq %rax, %r13
cmpl $0x0, (%rbp)
jne 0x653dd
movl (%r13), %eax
cmpl $0x7, %eax
je 0x652d5
cmpl $0x6, %eax
jne 0x65395
movl 0x8(%r13), %ebp
jmp 0x652db
cvttsd2si 0x8(%r13), %ebp
movq %r13, %rdi
callq 0x69167
testq %r12, %r12
je 0x652f1
movl %ebp, %edi
callq *%r12
testb %al, %al
je 0x6535b
cmpq %r15, %rbx
jne 0x65316
leaq 0x80(,%r15,4), %rsi
movq %r14, %rdi
callq 0x12210
testq %rax, %rax
je 0x653da
addq $0x20, %r15
movq %rax, %r14
movl %ebp, (%r14,%rbx,4)
movq (%rsp), %rbp
movq 0x10(%rbp), %rdi
callq 0x12ad0
movq 0x10(%rbp), %rcx
cmpl $0x2, (%rcx)
jne 0x6534b
movq %rax, %rdi
leaq 0xe25e(%rip), %rsi      # 0x73598
callq 0x12160
leaq 0x1(%rbx), %rcx
testl %eax, %eax
je 0x6529d
incq %rbx
movq 0x10(%rsp), %rax
movq %rbx, (%rax)
jmp 0x653f0
movq (%rsp), %rcx
movq 0x8(%rcx), %rax
movq 0x10(%rcx), %rcx
movl 0x8(%rcx), %edx
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0x11997(%rip), %rax     # 0x76d10
xorl %r13d, %r13d
movq 0x8(%rsp), %rdi
movl $0x5f, %esi
xorl %ecx, %ecx
pushq $0xe70                  # imm = 0xE70
pushq %rax
callq 0x144d6
jmp 0x653d4
movq %r13, %rdi
callq 0x69abf
movq (%rsp), %rcx
movq 0x8(%rcx), %rcx
movq 0x30(%rcx), %r8
movl 0x38(%rcx), %r9d
leaq 0x1195c(%rip), %r10     # 0x76d10
leaq 0xea3a(%rip), %rcx      # 0x73df5
movq 0x8(%rsp), %rdi
movl $0x17, %esi
movq %rax, %rdx
pushq $0xe66                  # imm = 0xE66
pushq %r10
callq 0x1442a
addq $0x10, %rsp
jmp 0x653dd
xorl %r13d, %r13d
movq %r13, %rdi
callq 0x69167
movq %r14, %rdi
callq 0x122c0
xorl %r14d, %r14d
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq