// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]Dsuite/./Dsuite_utils.h
// Function: TrioDinfo::assignTreeArrangement(std::vector<int, std::allocator<int>> const&, int, int, int)
int assignTreeArrangement(const std::vector<int>& treeLevels, const int loc1, const int loc2, const int loc3) {
        int midLoc = std::max(std::min(loc1,loc2), std::min(std::max(loc1,loc2),loc3));
        int arrangement = 0;
        if (midLoc == loc1) {
            if (loc2 < loc1) {
                int m1 = *std::min_element(treeLevels.begin()+loc2, treeLevels.begin()+loc1);
                int m2 = *std::min_element(treeLevels.begin()+loc1, treeLevels.begin()+loc3);
                if (m1 < m2) { if (D2 >= 0) { arrangement = P3isTrios1_Dpositive; } else { arrangement = P3isTrios1_Dnegative;}}
                else { if (D1 >= 0) { arrangement = P3isTrios2_Dpositive; } else { arrangement = P3isTrios2_Dnegative; } }
            } else {
                int m1 = *std::min_element(treeLevels.begin()+loc3, treeLevels.begin()+loc1);
                int m2 = *std::min_element(treeLevels.begin()+loc1, treeLevels.begin()+loc2);
                if (m1 < m2) { if (D1 >= 0) { arrangement = P3isTrios2_Dpositive; } else { arrangement = P3isTrios2_Dnegative; }}
                else { if (D2 >= 0) arrangement = P3isTrios1_Dpositive; else arrangement = P3isTrios1_Dnegative;}
            }
        } else if (midLoc == loc2) {
            if (loc1 < loc2) {
                int m1 = *std::min_element(treeLevels.begin()+loc1, treeLevels.begin()+loc2);
                int m2 = *std::min_element(treeLevels.begin()+loc2, treeLevels.begin()+loc3);
                if (m1 < m2) { if (D3 >= 0) arrangement = P3isTrios0_Dpositive; else arrangement = P3isTrios0_Dnegative; }
                else { if (D1 >= 0) { arrangement = P3isTrios2_Dpositive; } else { arrangement = P3isTrios2_Dnegative; }}
            } else {
                int m1 = *std::min_element(treeLevels.begin()+loc3, treeLevels.begin()+loc2);
                int m2 = *std::min_element(treeLevels.begin()+loc2, treeLevels.begin()+loc1);
                if (m1 < m2) { if (D1 >= 0) { arrangement = P3isTrios2_Dpositive;} else {arrangement = P3isTrios2_Dnegative;} }
                else { if (D3 >= 0) arrangement = P3isTrios0_Dpositive; else arrangement = P3isTrios0_Dnegative; }
            }
        } else if (midLoc == loc3) {
            if (loc1 < loc3) {
                int m1 = *std::min_element(treeLevels.begin()+loc1, treeLevels.begin()+loc3);
                int m2 = *std::min_element(treeLevels.begin()+loc3, treeLevels.begin()+loc2);
                if (m1 < m2) { if (D3 >= 0) arrangement = P3isTrios0_Dpositive; else arrangement = P3isTrios0_Dnegative; }
                else { if (D2 >= 0) arrangement = P3isTrios1_Dpositive; else arrangement = P3isTrios1_Dnegative;}
                
            } else {
                int m1 = *std::min_element(treeLevels.begin()+loc2, treeLevels.begin()+loc3);
                int m2 = *std::min_element(treeLevels.begin()+loc3, treeLevels.begin()+loc1);
                if (m1 < m2) { if (D2 >= 0) arrangement = P3isTrios1_Dpositive; else arrangement = P3isTrios1_Dnegative;}
                else { if (D3 >= 0) arrangement = P3isTrios0_Dpositive; else arrangement = P3isTrios0_Dnegative; }
            }
        }
        return arrangement;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movl %ecx, %r15d
movl %edx, %r12d
cmpl %ecx, %edx
cmovgl %edx, %ecx
movq %rsi, %r14
movl %edx, %eax
cmovgl %r15d, %eax
movq %rdi, %rbx
cmpl %r8d, %ecx
cmovgel %r8d, %ecx
cmpl %ecx, %eax
cmovgl %eax, %ecx
cmpl %edx, %ecx
jne 0x1a494
movq (%r14), %rax
movslq %r12d, %r13
leaq (%rax,%r13,4), %rsi
cmpl %r12d, %r15d
jge 0x1a4dc
movslq %r15d, %rcx
leaq (%rax,%rcx,4), %rdi
callq 0x1bacf
movl (%rax), %r15d
movq (%r14), %rax
leaq (%rax,%r13,4), %rdi
movslq %ebp, %rcx
leaq (%rax,%rcx,4), %rsi
callq 0x1bacf
cmpl (%rax), %r15d
jl 0x1a501
jmp 0x1a57d
cmpl %r15d, %ecx
jne 0x1a518
movq (%r14), %rax
movslq %r15d, %r13
leaq (%rax,%r13,4), %rsi
cmpl %r15d, %r12d
jge 0x1a558
movslq %r12d, %rcx
leaq (%rax,%rcx,4), %rdi
callq 0x1bacf
movl (%rax), %r15d
movq (%r14), %rax
leaq (%rax,%r13,4), %rdi
movslq %ebp, %rcx
leaq (%rax,%rcx,4), %rsi
callq 0x1bacf
cmpl (%rax), %r15d
jge 0x1a57d
jmp 0x1a5ba
movslq %ebp, %rcx
leaq (%rax,%rcx,4), %rdi
callq 0x1bacf
movl (%rax), %ebp
movq (%r14), %rax
leaq (%rax,%r13,4), %rdi
movslq %r15d, %rcx
leaq (%rax,%rcx,4), %rsi
callq 0x1bacf
cmpl (%rax), %ebp
jl 0x1a57d
movsd 0x20(%rbx), %xmm0
xorl %eax, %eax
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
adcl $0x3, %eax
jmp 0x1a5cc
xorl %eax, %eax
cmpl %ebp, %ecx
jne 0x1a5cc
movq (%r14), %rax
movslq %ebp, %r13
leaq (%rax,%r13,4), %rsi
cmpl %ebp, %r12d
jge 0x1a591
movslq %r12d, %rcx
leaq (%rax,%rcx,4), %rdi
callq 0x1bacf
movl (%rax), %ebp
movq (%r14), %rax
leaq (%rax,%r13,4), %rdi
movslq %r15d, %rcx
leaq (%rax,%rcx,4), %rsi
callq 0x1bacf
cmpl (%rax), %ebp
jge 0x1a501
jmp 0x1a5ba
movslq %ebp, %rcx
leaq (%rax,%rcx,4), %rdi
callq 0x1bacf
movl (%rax), %ebp
movq (%r14), %rax
leaq (%rax,%r13,4), %rdi
movslq %r12d, %rcx
leaq (%rax,%rcx,4), %rsi
callq 0x1bacf
cmpl (%rax), %ebp
jge 0x1a5ba
movsd 0x18(%rbx), %xmm0
xorl %eax, %eax
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
adcl $0x1, %eax
jmp 0x1a5cc
movslq %r15d, %rcx
leaq (%rax,%rcx,4), %rdi
callq 0x1bacf
movl (%rax), %ebp
movq (%r14), %rax
leaq (%rax,%r13,4), %rdi
movslq %r12d, %rcx
leaq (%rax,%rcx,4), %rsi
callq 0x1bacf
cmpl (%rax), %ebp
jl 0x1a501
movsd 0x28(%rbx), %xmm0
xorl %eax, %eax
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
adcl $0x5, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop