// File: /workspace/github_c_makefile_star2_O3/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 0x69632
movq %rax, %r13
cmpl $0x0, (%r12)
jne 0x652a8
movl (%r13), %eax
cmpl $0x7, %eax
je 0x651a6
cmpl $0x6, %eax
jne 0x65260
movl 0x8(%r13), %r12d
jmp 0x651ac
cvttsd2si 0x8(%r13), %r12d
movq %r13, %rdi
callq 0x68d41
testq %rbp, %rbp
je 0x651c2
movl %r12d, %edi
callq *%rbp
testb %al, %al
je 0x65226
cmpq %r15, %rbx
jne 0x651e7
leaq 0x80(,%r15,4), %rsi
movq %r14, %rdi
callq 0x12210
testq %rax, %rax
je 0x652a5
addq $0x20, %r15
movq %rax, %r14
movl %r12d, (%r14,%rbx,4)
movq (%rsp), %r12
movq 0x10(%r12), %rdi
callq 0x12ad0
movq 0x10(%r12), %rcx
cmpl $0x2, (%rcx)
jne 0x65216
cmpb $0x2c, (%rax)
jne 0x65216
leaq 0x1(%rbx), %rcx
cmpb $0x0, 0x1(%rax)
je 0x6516d
incq %rbx
movq 0x10(%rsp), %rax
movq %rbx, (%rax)
jmp 0x652bb
movq (%rsp), %rcx
movq 0x8(%rcx), %rax
movq 0x10(%rcx), %rcx
movl 0x8(%rcx), %edx
movq 0x30(%rax), %r8
movl 0x38(%rax), %r9d
leaq 0x11b2c(%rip), %rax     # 0x76d70
xorl %r13d, %r13d
movq 0x8(%rsp), %rdi
movl $0x5f, %esi
xorl %ecx, %ecx
pushq $0xe70                  # imm = 0xE70
pushq %rax
callq 0x14486
jmp 0x6529f
movq %r13, %rdi
callq 0x6966d
movq (%rsp), %rcx
movq 0x8(%rcx), %rcx
movq 0x30(%rcx), %r8
movl 0x38(%rcx), %r9d
leaq 0x11af1(%rip), %r10     # 0x76d70
leaq 0xeb8f(%rip), %rcx      # 0x73e15
movq 0x8(%rsp), %rdi
movl $0x17, %esi
movq %rax, %rdx
pushq $0xe66                  # imm = 0xE66
pushq %r10
callq 0x143da
addq $0x10, %rsp
jmp 0x652a8
xorl %r13d, %r13d
movq %r13, %rdi
callq 0x68d41
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