// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movb $0xb, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %edx
leaq -0x48(%rbp), %rsi
callq 0x3650
movslq -0x14(%rbp), %rcx
leaq 0x7c2f(%rip), %rax      # 0xd120
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x20(%rax), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movslq -0x14(%rbp), %rcx
leaq 0x7c14(%rip), %rax      # 0xd120
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x20(%rax)
jne 0x5525
movl $0x1, -0x4(%rbp)
jmp 0x574b
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %edx
leaq -0x48(%rbp), %rsi
callq 0x3710
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
leaq -0x48(%rbp), %rdi
callq 0x38f0
cmpl $0x1, %eax
je 0x55a1
movslq -0x14(%rbp), %rcx
leaq 0x7bcb(%rip), %rax      # 0xd120
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
cmpl $0x3, 0x8(%rax)
jl 0x55a1
movl -0x14(%rbp), %edi
movups -0x48(%rbp), %xmm0
movups -0x38(%rbp), %xmm1
movups -0x28(%rbp), %xmm2
movq %rsp, %rax
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x3a70
cmpl $0x1, %eax
je 0x55a1
movslq -0x14(%rbp), %rcx
leaq 0x7b8c(%rip), %rax      # 0xd120
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
cmpl $0x4, 0x8(%rax)
jle 0x55ac
movl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x574b
movsbl -0x48(%rbp), %eax
cmpl $0x1, %eax
jne 0x55dc
movq -0x10(%rbp), %rdi
addq $0x4, %rdi
movq -0x40(%rbp), %rax
subq $0x1, %rax
shlq $0x2, %rax
addq %rax, %rdi
movl $0x4, %esi
callq 0x7280
movq %rax, -0x40(%rbp)
jmp 0x561e
movsbl -0x48(%rbp), %eax
cmpl $0x3, %eax
jne 0x561c
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
addq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rdx
movq -0x10(%rbp), %rcx
movl $0x1, %esi
callq 0x2310
movq %rax, %rdi
movq -0x10(%rbp), %rdx
movl $0x4, %esi
callq 0x5c10
movq %rax, -0x40(%rbp)
jmp 0x561e
movsbl -0x47(%rbp), %eax
cmpl $0x1, %eax
jne 0x564e
movq -0x10(%rbp), %rdi
addq $0x4, %rdi
movq -0x38(%rbp), %rax
subq $0x1, %rax
shlq $0x2, %rax
addq %rax, %rdi
movl $0x4, %esi
callq 0x7280
movq %rax, -0x38(%rbp)
jmp 0x5690
movsbl -0x47(%rbp), %eax
cmpl $0x3, %eax
jne 0x568e
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
addq -0x38(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rdx
movq -0x10(%rbp), %rcx
movl $0x1, %esi
callq 0x2310
movq %rax, %rdi
movq -0x10(%rbp), %rdx
movl $0x4, %esi
callq 0x5c10
movq %rax, -0x38(%rbp)
jmp 0x5690
movsbl -0x46(%rbp), %eax
cmpl $0x1, %eax
jne 0x56c0
movq -0x10(%rbp), %rdi
addq $0x4, %rdi
movq -0x30(%rbp), %rax
subq $0x1, %rax
shlq $0x2, %rax
addq %rax, %rdi
movl $0x4, %esi
callq 0x7280
movq %rax, -0x30(%rbp)
jmp 0x5702
movsbl -0x46(%rbp), %eax
cmpl $0x3, %eax
jne 0x5700
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
addq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rdx
movq -0x10(%rbp), %rcx
movl $0x1, %esi
callq 0x2310
movq %rax, %rdi
movq -0x10(%rbp), %rdx
movl $0x4, %esi
callq 0x5c10
movq %rax, -0x30(%rbp)
jmp 0x5702
movq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
addq -0x38(%rbp), %rdi
addq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rdx
movq -0x10(%rbp), %rcx
movl $0x1, %esi
callq 0x2310
movq -0x50(%rbp), %rdi
movq %rax, %rsi
movq -0x10(%rbp), %rcx
movl $0x4, %edx
callq 0x5a80
movl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw (%rax,%rax)