// File: /workspace/github_c_makefile_star2_O1/mohuangrui[P]ArtraCFD/computational_geometry.c
// Function: TransformVertex
static void TransformVertex(const Real O[restrict], const Real scale[restrict],
        const Real rotate[restrict][DIMS], const Real offset[restrict],
        Real box[restrict][LIMIT], const int vertN, Real v[restrict][DIMS])
{
    RealVec tmp = {0.0};
    for (int n = 0; n < vertN; ++n) {
        /* translate reference frame to a parallel frame at the reference point */
        v[n][X] = v[n][X] - O[X];
        v[n][Y] = v[n][Y] - O[Y];
        v[n][Z] = v[n][Z] - O[Z];
        /* scale */
        v[n][X] = v[n][X] * scale[X];
        v[n][Y] = v[n][Y] * scale[Y];
        v[n][Z] = v[n][Z] * scale[Z];
        /* rotate */
        tmp[X] = v[n][X];
        tmp[Y] = v[n][Y];
        tmp[Z] = v[n][Z];
        v[n][X] = Dot(rotate[X], tmp);
        v[n][Y] = Dot(rotate[Y], tmp);
        v[n][Z] = Dot(rotate[Z], tmp);
        /* translate with offset and then translate reference back to origin */
        v[n][X] = v[n][X] + offset[X] + O[X];
        v[n][Y] = v[n][Y] + offset[Y] + O[Y];
        v[n][Z] = v[n][Z] + offset[Z] + O[Z];
        for (int s = 0; s < DIMS; ++s) {
            box[s][MIN] = (box[s][MIN] < v[n][s]) ? box[s][MIN] : v[n][s];
            box[s][MAX] = (box[s][MAX] > v[n][s]) ? box[s][MAX] : v[n][s];
        }
    }
    return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rcx, 0x70(%rsp)
movq %rdx, (%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
testl %r9d, %r9d
jle 0xa004
movq %r8, %rbx
movq 0xc0(%rsp), %r13
movsd (%rdi), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x8(%rdi), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x10(%rdi), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd (%rsi), %xmm0
movsd %xmm0, 0x68(%rsp)
movsd 0x8(%rsi), %xmm0
movsd %xmm0, 0x60(%rsp)
movsd 0x10(%rsi), %xmm0
movsd %xmm0, 0x58(%rsp)
movq (%rsp), %rax
leaq 0x18(%rax), %rcx
movq %rcx, 0x50(%rsp)
addq $0x30, %rax
movq %rax, 0x48(%rsp)
movl %r9d, %eax
movq %rax, 0x40(%rsp)
xorl %r12d, %r12d
movq %r13, %r15
leaq (%r12,%r12,2), %rbp
movsd (%r13,%rbp,8), %xmm0
movsd 0x8(%r13,%rbp,8), %xmm1
subsd 0x18(%rsp), %xmm0
mulsd 0x68(%rsp), %xmm0
subsd 0x10(%rsp), %xmm1
mulsd 0x60(%rsp), %xmm1
movsd 0x10(%r13,%rbp,8), %xmm2
subsd 0x8(%rsp), %xmm2
mulsd 0x58(%rsp), %xmm2
movsd %xmm0, (%r13,%rbp,8)
movsd %xmm1, 0x8(%r13,%rbp,8)
movsd %xmm2, 0x10(%r13,%rbp,8)
movsd %xmm0, 0x20(%rsp)
movsd %xmm1, 0x28(%rsp)
movsd %xmm2, 0x30(%rsp)
movq (%rsp), %rdi
leaq 0x20(%rsp), %r14
movq %r14, %rsi
callq 0x7f86
movsd %xmm0, 0x80(%rsp)
movsd %xmm0, (%r13,%rbp,8)
movq 0x50(%rsp), %rdi
movq %r14, %rsi
callq 0x7f86
movsd %xmm0, 0x78(%rsp)
movsd %xmm0, 0x8(%r13,%rbp,8)
movq 0x48(%rsp), %rdi
movq %r14, %rsi
callq 0x7f86
movq 0x70(%rsp), %rax
movsd 0x80(%rsp), %xmm1
addsd (%rax), %xmm1
movsd %xmm0, 0x10(%r13,%rbp,8)
addsd 0x18(%rsp), %xmm1
movsd 0x78(%rsp), %xmm2
addsd 0x8(%rax), %xmm2
movsd %xmm1, (%r13,%rbp,8)
addsd 0x10(%rsp), %xmm2
addsd 0x10(%rax), %xmm0
movsd %xmm2, 0x8(%r13,%rbp,8)
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x10(%r13,%rbp,8)
xorl %eax, %eax
movsd (%r15,%rax), %xmm0
movsd (%rbx,%rax,2), %xmm1
movsd 0x8(%rbx,%rax,2), %xmm2
minsd %xmm0, %xmm1
movsd %xmm1, (%rbx,%rax,2)
maxsd %xmm0, %xmm2
movsd %xmm2, 0x8(%rbx,%rax,2)
addq $0x8, %rax
cmpq $0x18, %rax
jne 0x9fc4
incq %r12
addq $0x18, %r15
cmpq 0x40(%rsp), %r12
jne 0x9ec6
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq