// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlbsp/tjunc.cpp
// Function: tjunc_fix_r(node_s*)
static void     tjunc_fix_r(node_t* node)
{
    face_t*         f;
    face_t*         next;

    if (node->planenum == PLANENUM_LEAF)
    {
        return;
    }

    newlist = NULL;

    for (f = node->faces; f; f = next)
    {
        next = f->next;
        FixFaceEdges(f);
    }

    node->faces = newlist;

    tjunc_fix_r(node->children[0]);
    tjunc_fix_r(node->children[1]);
}

// Assembly:
cmpl $-0x1, 0x80(%rdi)
je 0x18c40
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
andq $0x0, 0x4a32494(%rip)   # 0x4a4ab10
movq %rdi, 0x48(%rsp)
movq 0x98(%rdi), %rsi
xorl %eax, %eax
leaq 0x4a3248f(%rip), %rbp   # 0x4a4ab20
movq %rsp, %r14
testq %rsi, %rsi
je 0x18c0e
movq (%rsi), %rax
movq %rax, 0x38(%rsp)
movl $0x4b8, %edx            # imm = 0x4B8
movq %rbp, %rdi
movq %rsi, 0x40(%rsp)
callq 0x4260
xorl %esi, %esi
movslq 0x4a3248c(%rip), %rcx   # 0x4a4ab4c
cmpq %rcx, %rsi
jge 0x187df
leaq 0x1(%rsi), %rbx
movl %ebx, %eax
cltd
idivl %ecx
movl %edx, %r13d
imulq $0x18, %rsi, %rax
leaq (%rax,%rbp), %rdi
addq $0x38, %rdi
imulq $0x18, %r13, %r15
leaq (%r15,%rbp), %r12
addq $0x38, %r12
movq %r12, %rsi
leaq 0x60(%rsp), %rdx
leaq 0x58(%rsp), %rcx
callq 0x18c41
movq %rax, %rdx
addq $0x48, %rdx
movsd 0x60(%rsp), %xmm0
addsd 0x5ccc(%rip), %xmm0     # 0x1e3e0
movq (%rdx), %rcx
movsd (%rcx), %xmm1
leaq 0x10(%rcx), %rdx
ucomisd %xmm1, %xmm0
ja 0x18714
movsd 0x58(%rsp), %xmm0
addsd 0x5ccd(%rip), %xmm0     # 0x1e400
ucomisd %xmm1, %xmm0
movq %rbx, %rsi
jbe 0x186b9
incl 0x3a32376(%rip)         # 0x3a4aabc
movslq 0x4a323ff(%rip), %rdx   # 0x4a4ab4c
movslq %r13d, %rsi
imulq $0x18, %rdx, %rdi
addq %rbp, %rdi
addq $0x48, %rdi
cmpq %rsi, %rdx
jle 0x1877a
decq %rdx
movups -0x28(%rdi), %xmm0
movups %xmm0, -0x10(%rdi)
movsd -0x18(%rdi), %xmm0
movsd %xmm0, (%rdi)
addq $-0x18, %rdi
jmp 0x1875b
movsd (%rcx), %xmm0
mulsd 0x8(%rax), %xmm0
addsd 0x20(%rax), %xmm0
movsd %xmm0, (%r12)
movsd (%rcx), %xmm0
mulsd 0x10(%rax), %xmm0
addsd 0x28(%rax), %xmm0
movsd %xmm0, 0x40(%r15,%rbp)
movsd (%rcx), %xmm0
mulsd 0x18(%rax), %xmm0
addsd 0x30(%rax), %xmm0
movsd %xmm0, 0x48(%r15,%rbp)
movl 0x4a3238e(%rip), %eax   # 0x4a4ab4c
leal 0x1(%rax), %ecx
movl %ecx, 0x4a32385(%rip)   # 0x4a4ab4c
xorl %edi, %edi
cmpl $0x2a7, %eax            # imm = 0x2A7
setl %dil
pushq $0x15
popq %rsi
callq 0x92bb
jmp 0x186b7
cmpl $0x1c, %ecx
jg 0x187fe
movl $0x4b8, %edx            # imm = 0x4B8
movq 0x40(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x4260
jmp 0x18bf0
xorl %r12d, %r12d
xorl %edi, %edi
cmpq $0x0, 0x4a32335(%rip)   # 0x4a4ab40
sete %dil
pushq $0x2
popq %rsi
callq 0x92bb
movl 0x4a3232f(%rip), %eax   # 0x4a4ab4c
cmpl $0x1d, %eax
jl 0x18bd7
movq %r12, 0x50(%rsp)
incl 0x3a32287(%rip)         # 0x3a4aab8
decl %eax
cltq
imulq $0x18, %rax, %rax
movupd 0x38(%rax,%rbp), %xmm0
movupd 0x4a32311(%rip), %xmm1  # 0x4a4ab58
subpd %xmm1, %xmm0
movapd %xmm0, 0x20(%rsp)
movsd 0x48(%rax,%rbp), %xmm0
subsd 0x4a32309(%rip), %xmm0  # 0x4a4ab68
movsd %xmm0, 0x30(%rsp)
leaq 0x20(%rsp), %rdi
callq 0xc073
movl 0x4a322d7(%rip), %eax   # 0x4a4ab4c
testl %eax, %eax
pushq $0x1
popq %rcx
movl %ecx, %r13d
cmovlel %eax, %r13d
imulq $0x18, %rax, %rbx
leal -0x1(%rax), %ecx
imulq $0x18, %rcx, %r15
movq %rbp, %r12
movl %eax, %ebp
cmpl $0x2, %eax
jl 0x18920
movupd 0x8(%r12,%rbx), %xmm0
movupd 0x38(%r12,%r15), %xmm1
subpd %xmm1, %xmm0
movapd %xmm0, (%rsp)
movsd 0x18(%r12,%rbx), %xmm0
subsd 0x48(%r12,%r15), %xmm0
movsd %xmm0, 0x10(%rsp)
movq %r14, %rdi
callq 0xc073
movsd (%rsp), %xmm1
movsd 0x8(%rsp), %xmm0
mulsd 0x28(%rsp), %xmm0
mulsd 0x20(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
mulsd 0x30(%rsp), %xmm0
addsd %xmm1, %xmm0
leal -0x1(%rbp), %eax
movsd 0x6945(%rip), %xmm1     # 0x1f248
ucomisd %xmm0, %xmm1
ja 0x1891b
addq $-0x18, %r12
ucomisd 0x832b(%rip), %xmm0     # 0x20c40
jbe 0x1888f
incl %eax
movl %eax, %r13d
movapd 0x4a32248(%rip), %xmm0  # 0x4a4ab70
movupd 0x4a32228(%rip), %xmm1  # 0x4a4ab58
subpd %xmm1, %xmm0
movapd %xmm0, 0x20(%rsp)
movsd 0x4a3223e(%rip), %xmm0  # 0x4a4ab80
subsd 0x4a3221e(%rip), %xmm0  # 0x4a4ab68
movsd %xmm0, 0x30(%rsp)
leaq 0x20(%rsp), %rdi
callq 0xc073
leaq 0x4a32237(%rip), %r12   # 0x4a4ab98
pushq $0x3
popq %rax
pushq $0x1
popq %rcx
movq %rcx, %r15
movl %eax, %ebx
movslq 0x4a321d9(%rip), %rax   # 0x4a4ab4c
decq %rax
cmpq %rax, %rcx
jge 0x18a03
movupd -0x28(%r12), %xmm0
movupd -0x10(%r12), %xmm1
subpd %xmm0, %xmm1
movapd %xmm1, (%rsp)
movsd (%r12), %xmm0
subsd -0x18(%r12), %xmm0
movsd %xmm0, 0x10(%rsp)
movq %r14, %rdi
callq 0xc073
movsd (%rsp), %xmm1
movsd 0x8(%rsp), %xmm2
mulsd 0x28(%rsp), %xmm2
mulsd 0x20(%rsp), %xmm1
movsd 0x10(%rsp), %xmm0
mulsd 0x30(%rsp), %xmm0
addsd %xmm2, %xmm1
addsd %xmm1, %xmm0
movsd 0x6864(%rip), %xmm1     # 0x1f248
ucomisd %xmm0, %xmm1
ja 0x18a03
leaq 0x1(%r15), %rcx
leal 0x1(%rbx), %eax
addq $0x18, %r12
ucomisd 0x8243(%rip), %xmm0     # 0x20c40
jbe 0x18967
cmpq $0x1a, %r15
jb 0x18a9a
movupd 0x4a32143(%rip), %xmm1  # 0x4a4ab58
movapd %xmm1, (%rsp)
movsd 0x4a32146(%rip), %xmm0  # 0x4a4ab68
movsd %xmm0, 0x10(%rsp)
movslq 0x4a3211d(%rip), %rax   # 0x4a4ab4c
leaq 0x4a3214a(%rip), %rcx   # 0x4a4ab80
pushq $0x1
popq %rdx
leaq 0x4a320e0(%rip), %rbp   # 0x4a4ab20
cmpq %rax, %rdx
jge 0x18a5f
movups -0x10(%rcx), %xmm2
movups %xmm2, -0x28(%rcx)
movsd (%rcx), %xmm2
movsd %xmm2, -0x18(%rcx)
incq %rdx
addq $0x18, %rcx
jmp 0x18a40
decl %eax
cltq
imulq $0x18, %rax, %rax
movlpd %xmm1, 0x38(%rax,%rbp)
movslq 0x4a320d8(%rip), %rax   # 0x4a4ab4c
imulq $0x18, %rax, %rax
movhpd %xmm1, 0x28(%rax,%rbp)
movslq 0x4a320c7(%rip), %rax   # 0x4a4ab4c
imulq $0x18, %rax, %rax
movsd %xmm0, 0x30(%rax,%rbp)
movl 0x4a320b7(%rip), %eax   # 0x4a4ab4c
jmp 0x18831
leaq 0x4a3207f(%rip), %rdi   # 0x4a4ab20
callq 0x128f6
movq %rax, %r12
xorl %edi, %edi
cmpq $0x0, 0x4a3208d(%rip)   # 0x4a4ab40
sete %dil
pushq $0x2
popq %rsi
callq 0x92bb
movq 0x50(%rsp), %rax
movq %rax, 0x20(%r12)
movq 0x4a32040(%rip), %rax   # 0x4a4ab10
movq %rax, (%r12)
movq %r12, 0x4a32035(%rip)   # 0x4a4ab10
movl 0x4a3206b(%rip), %eax   # 0x4a4ab4c
movl %eax, %ecx
subl %r15d, %ecx
cmpl $0x1d, %ecx
jl 0x18b03
subl %ebp, %eax
incl %eax
leal 0x1(%r13), %ebx
cmpl $0x1d, %eax
pushq $0x1c
popq %rax
cmovgel %eax, %ebx
cmpl $0x1b, %r13d
cmovgel %eax, %ebx
movl %ebx, 0x2c(%r12)
testl %ebx, %ebx
movl $0x0, %eax
cmovgl %ebx, %eax
imulq $0x18, %rax, %rax
xorl %ecx, %ecx
leaq 0x4a32001(%rip), %rbp   # 0x4a4ab20
cmpq %rcx, %rax
je 0x18b51
movsd 0x38(%rcx,%rbp), %xmm0
movsd %xmm0, 0x38(%r12,%rcx)
movsd 0x40(%rcx,%rbp), %xmm0
movsd %xmm0, 0x40(%r12,%rcx)
movsd 0x48(%rcx,%rbp), %xmm0
movsd %xmm0, 0x48(%r12,%rcx)
addq $0x18, %rcx
jmp 0x18b1f
leal -0x1(%rbx), %eax
cltq
incl %ebx
imulq $0x18, %rax, %rcx
addq %rbp, %rcx
addq $0x48, %rcx
movslq 0x4a31fe2(%rip), %rdx   # 0x4a4ab4c
cmpq %rdx, %rax
jge 0x18bc4
movsd -0x10(%rcx), %xmm0
movl %ebx, %edx
subl 0x2c(%r12), %edx
movslq %edx, %rdx
imulq $0x18, %rdx, %rdx
movsd %xmm0, 0x38(%rdx,%rbp)
movsd -0x8(%rcx), %xmm0
movl %ebx, %edx
subl 0x2c(%r12), %edx
movslq %edx, %rdx
imulq $0x18, %rdx, %rdx
movsd %xmm0, 0x40(%rdx,%rbp)
movsd (%rcx), %xmm0
movl %ebx, %edx
subl 0x2c(%r12), %edx
movslq %edx, %rdx
imulq $0x18, %rdx, %rdx
movsd %xmm0, 0x48(%rdx,%rbp)
incq %rax
incl %ebx
addq $0x18, %rcx
jmp 0x18b63
subl 0x2c(%r12), %edx
addl $0x2, %edx
movl %edx, 0x4a31f7a(%rip)   # 0x4a4ab4c
jmp 0x18801
movl $0x4b8, %edx            # imm = 0x4B8
movq 0x40(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x4260
movq %r12, 0x20(%rbx)
movq 0x4a31f19(%rip), %rax   # 0x4a4ab10
movq %rax, (%rbx)
movq %rbx, 0x4a31f0f(%rip)   # 0x4a4ab10
movq %rbx, %rax
movq 0x38(%rsp), %rsi
jmp 0x18694
movq 0x48(%rsp), %rbx
movq %rax, 0x98(%rbx)
movq 0x88(%rbx), %rdi
callq 0x18659
movq 0x90(%rbx), %rdi
callq 0x18659
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq