// File: /workspace/github_c_makefile_star2_O0/mmcco[P]sljit/regex_src/regexJIT.c
// Function: stack_push_copy
static int stack_push_copy(struct stack *stack, int items, int length)
{
	struct stack_fragment *frag1;
	int ind1;
	struct stack_fragment *frag2;
	int ind2;
	int counter;

	SLJIT_ASSERT(stack->count >= length && items <= length && items > 0);

	/* Allocate the necessary elements. */
	counter = items;
	frag1 = stack->last;
	ind1 = stack->index;
	while (counter > 0) {
		if (stack->index + counter >= STACK_FRAGMENT_SIZE) {
			counter -= STACK_FRAGMENT_SIZE - stack->index - 1 + 1;
			stack->index = 0;
			if (!stack->last->data.next) {
				stack->last->data.next = malloc(sizeof(struct stack_fragment));
				if (!stack->last->data.next)
					return 1;
				stack->last->data.next->data.next = NULL;
				stack->last->data.next->data.prev = stack->last;
			}
			stack->last = stack->last->data.next;
		}
		else {
			stack->index += counter;
			counter = 0;
		}
	}

	frag2 = stack->last;
	ind2 = stack->index;
	while (length > 0) {
		frag2->items[ind2--] = frag1->items[ind1--];
		if (ind1 < 0) {
			ind1 = STACK_FRAGMENT_SIZE - 1;
			frag1 = frag1->data.prev;
		}
		if (ind2 < 0) {
			ind2 = STACK_FRAGMENT_SIZE - 1;
			frag2 = frag2->data.prev;
		}
		length--;
	}

#if (defined SLJIT_DEBUG && SLJIT_DEBUG)
	stack_check(stack);
#endif
	stack->count += items;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl 0x14(%rax), %eax
cmpl -0x18(%rbp), %eax
jl 0x99ec
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
jg 0x99ec
cmpl $0x0, -0x14(%rbp)
jg 0x9a04
leaq 0x15e1d(%rip), %rdi     # 0x1f810
movl $0x12c, %esi            # imm = 0x12C
movb $0x0, %al
callq 0x2060
callq 0x2040
jmp 0x9a06
movl -0x14(%rbp), %eax
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x38(%rbp)
jle 0x9b06
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
addl -0x38(%rbp), %eax
cltq
cmpq $0x3e, %rax
jb 0x9aed
movq -0x10(%rbp), %rax
movslq 0x10(%rax), %rax
movl $0x3e, %ecx
subq %rax, %rcx
subq $0x1, %rcx
addq $0x1, %rcx
movslq -0x38(%rbp), %rax
subq %rcx, %rax
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
cmpq $0x0, (%rax)
jne 0x9ad8
movl $0x200, %edi            # imm = 0x200
callq 0x20b0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
cmpq $0x0, (%rax)
jne 0x9aaf
movl $0x1, -0x4(%rbp)
jmp 0x9baa
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x9b01
movl -0x38(%rbp), %ecx
movq -0x10(%rbp), %rax
addl 0x10(%rax), %ecx
movl %ecx, 0x10(%rax)
movl $0x0, -0x38(%rbp)
jmp 0x9a22
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x18(%rbp)
jle 0x9b8d
movq -0x30(%rbp), %rax
movl -0x34(%rbp), %ecx
movl %ecx, %edx
addl $-0x1, %edx
movl %edx, -0x34(%rbp)
movslq %ecx, %rcx
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %esi
movl %esi, %edi
addl $-0x1, %edi
movl %edi, -0x24(%rbp)
movslq %esi, %rsi
movq 0x10(%rdx,%rsi,8), %rdx
movq %rdx, 0x10(%rax,%rcx,8)
cmpl $0x0, -0x24(%rbp)
jge 0x9b69
movl $0x3d, -0x24(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
cmpl $0x0, -0x34(%rbp)
jge 0x9b82
movl $0x3d, -0x34(%rbp)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x9b1c
movq -0x10(%rbp), %rdi
callq 0x9270
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
addl 0x14(%rax), %ecx
movl %ecx, 0x14(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)