// File: /workspace/github_c_makefile_star2_O2/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 0x2cec
movslq %ebp, %rax
imulq $0x28, %rax, %r12
leaq 0x6ff5(%rip), %r15      # 0xb120
movl 0x20(%r15,%r12), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x28(%r14)
testl %eax, %eax
je 0x41cf
leaq 0x30(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x2d6d
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x2e44
cmpl $0x1, %eax
je 0x42d4
addq %r12, %r15
cmpl $0x3, 0x8(%r15)
jl 0x42d4
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 0x2ec6
cmpl $0x1, %eax
je 0x42d4
cmpl $0x5, 0x8(%r15)
jge 0x42d4
movzbl 0x30(%rsp), %eax
cmpl $0x3, %eax
je 0x41d7
cmpl $0x1, %eax
jne 0x4202
movq 0x38(%rsp), %rax
leaq (%rbx,%rax,4), %rdi
pushq $0x4
popq %rsi
callq 0x5232
jmp 0x41fd
pushq $0x1
popq %rax
jmp 0x42d8
movq 0x48(%rbx), %rdi
movq 0x68(%rbx), %rdx
addq 0x38(%rsp), %rdi
pushq $0x1
popq %rsi
movq %rbx, %rcx
callq 0x230c
pushq $0x4
popq %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0x450f
movq %rax, 0x38(%rsp)
movzbl 0x31(%rsp), %eax
cmpl $0x3, %eax
je 0x4224
cmpl $0x1, %eax
jne 0x424f
movq 0x40(%rsp), %rax
leaq (%rbx,%rax,4), %rdi
pushq $0x4
popq %rsi
callq 0x5232
jmp 0x424a
movq 0x48(%rbx), %rdi
movq 0x68(%rbx), %rdx
addq 0x40(%rsp), %rdi
pushq $0x1
popq %rsi
movq %rbx, %rcx
callq 0x230c
pushq $0x4
popq %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0x450f
movq %rax, 0x40(%rsp)
movzbl 0x32(%rsp), %eax
cmpl $0x1, %eax
je 0x4286
cmpl $0x3, %eax
jne 0x429e
movq 0x48(%rbx), %rdi
movq 0x68(%rbx), %rdx
addq 0x48(%rsp), %rdi
pushq $0x1
popq %rsi
movq %rbx, %rcx
callq 0x230c
pushq $0x4
popq %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0x450f
jmp 0x4297
movq 0x48(%rsp), %rax
leaq (%rbx,%rax,4), %rdi
pushq $0x4
popq %rsi
callq 0x5232
movq %rax, 0x48(%rsp)
jmp 0x42a3
movq 0x48(%rsp), %rax
movq 0x38(%rsp), %r14
movq 0x48(%rbx), %rdi
movq 0x68(%rbx), %rdx
addq 0x40(%rsp), %rdi
addq %rax, %rdi
pushq $0x1
popq %rsi
movq %rbx, %rcx
callq 0x230c
pushq $0x4
popq %rdx
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rcx
callq 0x4450
movl 0x58(%rsp), %eax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq