// File: /workspace/github_c_makefile_star2_O1/Orycterope[P]corewar/src/vm/instructions_p4.c
// Function: store_index
int			store_index(t_process *process, int i)
{
	t_parameters	param;

	param.o = 11;
	decode_ocp(process, &param, i);
	param.jump = 1 + g_op_tab[i].has_ocp;
	if (g_op_tab[i].has_ocp == 0)
		return (1);
	params_value(process, &param, i);
	if (check_registers(&param, process, i) == 1 || g_op_tab[i].param_nbr < 3
	|| check_param_error(param, i) == 1 || g_op_tab[i].param_nbr > 4)
		return (param.jump);
	if (param.type[0] == REG_CODE)
		PV[0] = ft_read_big_endian(PR[PV[0] - 1], REG_SIZE);
	else if (param.type[0] == IND_CODE)
		PV[0] = rm(mem(process->pc + PV[0], 1, PA, process), REG_SIZE, PP);
	if (param.type[1] == REG_CODE)
		PV[1] = ft_read_big_endian(PR[PV[1] - 1], REG_SIZE);
	else if (param.type[1] == IND_CODE)
		PV[1] = rm(mem(process->pc + PV[1], 1, PA, process), REG_SIZE, PP);
	if (param.type[2] == REG_CODE)
		PV[2] = ft_read_big_endian(PR[PV[2] - 1], REG_SIZE);
	else if (param.type[2] == IND_CODE)
		PV[2] = rm(mem(process->pc + PV[2], 1, PA, process), REG_SIZE, PP);
	wm(PV[0], mem(process->pc + PV[1] + PV[2], 1, PA, process), REG_SIZE, PP);
	return (param.jump);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x30(%rsp), %r14
movb $0xb, 0x2c(%r14)
movq %r14, %rsi
movl %ebp, %edx
callq 0x2d4c
movslq %ebp, %rax
leaq (%rax,%rax,4), %r15
leaq 0x6ef5(%rip), %r12      # 0xb120
movl 0x20(%r12,%r15,8), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x28(%r14)
testl %eax, %eax
je 0x42d2
leaq 0x30(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x2dd5
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x2eb0
cmpl $0x1, %eax
je 0x43e8
leaq (%r12,%r15,8), %r14
cmpl $0x3, 0x8(%r14)
jl 0x43e8
movups 0x30(%rsp), %xmm0
movups 0x40(%rsp), %xmm1
movups 0x50(%rsp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movl %ebp, %edi
callq 0x2f47
cmpl $0x1, %eax
je 0x43e8
cmpl $0x5, 0x8(%r14)
jge 0x43e8
movzbl 0x30(%rsp), %eax
cmpl $0x3, %eax
je 0x42dc
cmpl $0x1, %eax
jne 0x430b
movq 0x38(%rsp), %rax
leaq (%rbx,%rax,4), %rdi
movl $0x4, %esi
callq 0x53e5
jmp 0x4306
movl $0x1, %eax
jmp 0x43ec
movq 0x48(%rbx), %rdi
movq 0x68(%rbx), %rdx
addq 0x38(%rsp), %rdi
movl $0x1, %esi
movq %rbx, %rcx
callq 0x231c
movl $0x4, %esi
movq %rax, %rdi
movq %rbx, %rdx
callq 0x462c
movq %rax, 0x38(%rsp)
movzbl 0x31(%rsp), %eax
cmpl $0x3, %eax
je 0x432f
cmpl $0x1, %eax
jne 0x435e
movq 0x40(%rsp), %rax
leaq (%rbx,%rax,4), %rdi
movl $0x4, %esi
callq 0x53e5
jmp 0x4359
movq 0x48(%rbx), %rdi
movq 0x68(%rbx), %rdx
addq 0x40(%rsp), %rdi
movl $0x1, %esi
movq %rbx, %rcx
callq 0x231c
movl $0x4, %esi
movq %rax, %rdi
movq %rbx, %rdx
callq 0x462c
movq %rax, 0x40(%rsp)
movzbl 0x32(%rsp), %eax
cmpl $0x3, %eax
je 0x4382
cmpl $0x1, %eax
jne 0x43b1
movq 0x48(%rsp), %rax
leaq (%rbx,%rax,4), %rdi
movl $0x4, %esi
callq 0x53e5
jmp 0x43ac
movq 0x48(%rbx), %rdi
movq 0x68(%rbx), %rdx
addq 0x48(%rsp), %rdi
movl $0x1, %esi
movq %rbx, %rcx
callq 0x231c
movl $0x4, %esi
movq %rax, %rdi
movq %rbx, %rdx
callq 0x462c
movq %rax, 0x48(%rsp)
movq 0x38(%rsp), %r14
movq 0x48(%rbx), %rdi
movq 0x68(%rbx), %rdx
addq 0x40(%rsp), %rdi
addq 0x48(%rsp), %rdi
movl $0x1, %esi
movq %rbx, %rcx
callq 0x231c
movl $0x4, %edx
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rcx
callq 0x4570
movl 0x58(%rsp), %eax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq