// File: /workspace/github_c_makefile_star2_O2/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, %rbp
movq %rsi, 0x10(%rsp)
movq %rdi, %r12
xorl %r14d, %r14d
xorl %r15d, %r15d
xorl %ecx, %ecx
movq %rdi, (%rsp)
movq %rcx, %rbx
movq %r12, %rdi
movq 0x8(%rsp), %r12
movq %r12, %rsi
callq 0x647a2
movq %rax, %r13
cmpl $0x0, (%r12)
jne 0x60b74
movl (%r13), %eax
cmpl $0x7, %eax
je 0x60a78
cmpl $0x6, %eax
jne 0x60b30
movl 0x8(%r13), %r12d
jmp 0x60a7e
cvttsd2si 0x8(%r13), %r12d
movq %r13, %rdi
callq 0x63ee7
testq %rbp, %rbp
je 0x60a94
movl %r12d, %edi
callq *%rbp
testb %al, %al
je 0x60af8
cmpq %r15, %rbx
jne 0x60ab9
leaq 0x80(,%r15,4), %rsi
movq %r14, %rdi
callq 0x12210
testq %rax, %rax
je 0x60b71
addq $0x20, %r15
movq %rax, %r14
movl %r12d, (%r14,%rbx,4)
movq (%rsp), %r12
movq 0x10(%r12), %rdi
callq 0x12a25
movq 0x10(%r12), %rcx
cmpl $0x2, (%rcx)
jne 0x60ae8
cmpb $0x2c, (%rax)
jne 0x60ae8
leaq 0x1(%rbx), %rcx
cmpb $0x0, 0x1(%rax)
je 0x60a3f
incq %rbx
movq 0x10(%rsp), %rax
movq %rbx, (%rax)
jmp 0x60b87
movq (%rsp), %rcx
movq 0x8(%rcx), %rax
movq 0x10(%rcx), %rcx
movl 0x8(%rcx), %edx
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0x101ca(%rip), %rax     # 0x70ce0
pushq $0x5f
popq %rsi
xorl %r13d, %r13d
movq 0x8(%rsp), %rdi
xorl %ecx, %ecx
pushq $0xe70                  # imm = 0xE70
pushq %rax
callq 0x14179
jmp 0x60b6d
movq %r13, %rdi
callq 0x647dd
movq (%rsp), %rcx
movq 0x8(%rcx), %rcx
movq 0x30(%rcx), %r8
movl 0x38(%rcx), %r9d
leaq 0x10191(%rip), %r10     # 0x70ce0
leaq 0xd26f(%rip), %rcx      # 0x6ddc5
pushq $0x17
popq %rsi
movq 0x8(%rsp), %rdi
movq %rax, %rdx
pushq $0xe66                  # imm = 0xE66
pushq %r10
callq 0x140cd
popq %rax
popq %rcx
jmp 0x60b74
xorl %r13d, %r13d
movq %r13, %rdi
callq 0x63ee7
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