// File: dcarrey[P]hgt-detection/./utils_tree.cpp
// Function: odp1(double**, int*, int*, int*, int)
void odp1(double **D, int *X, int *i1, int *j1, int n)
{
	double S1,S;
	int i,j,k,a,*Y1;

	Y1=(int *) malloc((n+1)*sizeof(int));

	for(i=1;i<=n;i++)
		Y1[i]=1;

	X[1]=*i1;
	X[n]=*j1;
	if (n==2){
		free(Y1);
		return;
	}
	Y1[*i1]=0;
	Y1[*j1]=0;
	for(i=0;i<=n-3;i++)
	{ a=2;
	S=0;
	for(j=1;j<=n;j++)
	{ if (Y1[j]>0)
	{
		S1= D[X[n-i]][X[1]]-D[j][X[1]]+D[X[n-i]][j];
		if ((a==2)||(S1<=S))
		{
			S=S1;
			a=1;
			X[n-i-1]=j;
			k=j;
		}
	}
	}
	Y1[k]=0;
	}     
	free(Y1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x1110
movq %rax, -0x50(%rbp)
movl $0x1, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jg 0x33db
movq -0x50(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x33b9
movq -0x18(%rbp), %rax
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x20(%rbp), %rax
movl (%rax), %edx
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
cmpl $0x2, -0x24(%rbp)
jne 0x340d
movq -0x50(%rbp), %rdi
callq 0x10e0
jmp 0x355e
movq -0x50(%rbp), %rax
movq -0x18(%rbp), %rcx
movslq (%rcx), %rcx
movl $0x0, (%rax,%rcx,4)
movq -0x50(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq (%rcx), %rcx
movl $0x0, (%rax,%rcx,4)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl -0x24(%rbp), %ecx
subl $0x3, %ecx
cmpl %ecx, %eax
jg 0x3555
movl $0x2, -0x48(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
movl $0x1, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x24(%rbp), %eax
jg 0x3538
movq -0x50(%rbp), %rax
movslq -0x40(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jle 0x3528
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x24(%rbp), %edx
subl -0x3c(%rbp), %edx
movslq %edx, %rdx
movslq (%rcx,%rdx,4), %rcx
movq (%rax,%rcx,8), %rax
movq -0x10(%rbp), %rcx
movslq 0x4(%rcx), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x8(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x10(%rbp), %rcx
movslq 0x4(%rcx), %rcx
subsd (%rax,%rcx,8), %xmm0
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x24(%rbp), %edx
subl -0x3c(%rbp), %edx
movslq %edx, %rdx
movslq (%rcx,%rdx,4), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x40(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x30(%rbp)
cmpl $0x2, -0x48(%rbp)
je 0x34f9
movsd -0x30(%rbp), %xmm1
movsd -0x38(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x3526
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movl $0x1, -0x48(%rbp)
movl -0x40(%rbp), %edx
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
subl -0x3c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl -0x40(%rbp), %eax
movl %eax, -0x44(%rbp)
jmp 0x3528
jmp 0x352a
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x345f
movq -0x50(%rbp), %rax
movslq -0x44(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x3438
movq -0x50(%rbp), %rdi
callq 0x10e0
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)