// File: /workspace/github_c_makefile_star2_O0/mohuangrui[P]ArtraCFD/initialization.c
// Function: ApplyInitializer
static void ApplyInitializer(const int n, const Real pc[restrict], Real U[restrict],
        const Partition *const part, const Model *model)
{
    const Real zero = 0.0;
    const RealVec p1 = {part->posIC[n][0], part->posIC[n][1], part->posIC[n][2]};
    const RealVec p2 = {part->posIC[n][3], part->posIC[n][4], part->posIC[n][5]};
    const Real r = part->posIC[n][6];
    CalcVar var = {.t = zero, .x = pc[X], .y = pc[Y], .z = pc[Z], .ans = zero, .pi = PI};
    const Real Uo[DIMUo] = {
        ComputeExpression(&var, part->varIC[n][0]),
        ComputeExpression(&var, part->varIC[n][1]),
        ComputeExpression(&var, part->varIC[n][2]),
        ComputeExpression(&var, part->varIC[n][3]),
        ComputeExpression(&var, part->varIC[n][4])};
    const RealVec P1P2 = {p2[X] - p1[X], p2[Y] - p1[Y], p2[Z] - p1[Z]};
    const Real l2_P1P2 = Dot(P1P2, P1P2);
    RealVec P1Pc = {pc[X] - p1[X], pc[Y] - p1[Y], pc[Z] - p1[Z]};
    Real proj = zero; /* projection length */
    /* apply initial values for nodes that meets condition */
    int flag = 0; /* control flag for whether current node in the region */
    switch (part->typeIC[n]) {
        case ICGLOBAL:
            flag = 1;
            break;
        case ICPLANE:
            if (zero <= Dot(P1Pc, p2)) { /* on the normal direction or the plane */
                flag = 1;
            }
            break;
        case ICSPHERE:
            if (r * r >= Dot(P1Pc, P1Pc)) { /* in or on the sphere */
                flag = 1;
            }
            break;
        case ICBOX:
            P1Pc[X] = P1Pc[X] * (pc[X] - p2[X]);
            P1Pc[Y] = P1Pc[Y] * (pc[Y] - p2[Y]);
            P1Pc[Z] = P1Pc[Z] * (pc[Z] - p2[Z]);
            if ((zero >= P1Pc[X]) && (zero >= P1Pc[Y]) && (zero >= P1Pc[Z])) { /* in or on the box */
                flag = 1;
            }
            break;
        case ICCYLINDER:
            proj = Dot(P1Pc, P1P2);
            if ((zero > proj) || (l2_P1P2 < proj)) { /* outside the two ends */
                break;
            }
            proj = Dot(P1Pc, P1Pc) - proj * proj / l2_P1P2;
            if (r * r >= proj) { /* in or on the cylinder */
                flag = 1;
            }
            break;
        default:
            break;
    }
    if (1 == flag) { /* current node meets the condition */
        MapConservative(model->gamma, Uo, U);
    }
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq 0x3b8(%rax), %rax
movslq -0x4(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
movq -0x20(%rbp), %rax
movq 0x3b8(%rax), %rax
movslq -0x4(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq 0x3b8(%rax), %rax
movslq -0x4(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x20(%rbp), %rax
movq 0x3b8(%rax), %rax
movslq -0x4(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, -0x70(%rbp)
movq -0x20(%rbp), %rax
movq 0x3b8(%rax), %rax
movslq -0x4(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movsd 0x20(%rax), %xmm0
movsd %xmm0, -0x68(%rbp)
movq -0x20(%rbp), %rax
movq 0x3b8(%rax), %rax
movslq -0x4(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movsd 0x28(%rax), %xmm0
movsd %xmm0, -0x60(%rbp)
movq -0x20(%rbp), %rax
movq 0x3b8(%rax), %rax
movslq -0x4(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movsd 0x30(%rax), %xmm0
movsd %xmm0, -0x78(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xa8(%rbp)
movq -0x10(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0xa0(%rbp)
movq -0x10(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x98(%rbp)
movq -0x10(%rbp), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0x90(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x88(%rbp)
leaq 0xbee4(%rip), %rax      # 0x277a8
movsd (%rax), %xmm0
movsd %xmm0, -0x80(%rbp)
movq -0x20(%rbp), %rax
movq 0x3c0(%rax), %rsi
movslq -0x4(%rbp), %rax
imulq $0x1f4, %rax, %rax      # imm = 0x1F4
addq %rax, %rsi
leaq -0xa8(%rbp), %rdi
callq 0x32d0
movsd %xmm0, -0xe0(%rbp)
movq -0x20(%rbp), %rax
movq 0x3c0(%rax), %rsi
movslq -0x4(%rbp), %rax
imulq $0x1f4, %rax, %rax      # imm = 0x1F4
addq %rax, %rsi
addq $0x64, %rsi
leaq -0xa8(%rbp), %rdi
callq 0x32d0
movsd %xmm0, -0xd8(%rbp)
movq -0x20(%rbp), %rax
movq 0x3c0(%rax), %rsi
movslq -0x4(%rbp), %rax
imulq $0x1f4, %rax, %rax      # imm = 0x1F4
addq %rax, %rsi
addq $0xc8, %rsi
leaq -0xa8(%rbp), %rdi
callq 0x32d0
movsd %xmm0, -0xd0(%rbp)
movq -0x20(%rbp), %rax
movq 0x3c0(%rax), %rsi
movslq -0x4(%rbp), %rax
imulq $0x1f4, %rax, %rax      # imm = 0x1F4
addq %rax, %rsi
addq $0x12c, %rsi            # imm = 0x12C
leaq -0xa8(%rbp), %rdi
callq 0x32d0
movsd %xmm0, -0xc8(%rbp)
movq -0x20(%rbp), %rax
movq 0x3c0(%rax), %rsi
movslq -0x4(%rbp), %rax
imulq $0x1f4, %rax, %rax      # imm = 0x1F4
addq %rax, %rsi
addq $0x190, %rsi            # imm = 0x190
leaq -0xa8(%rbp), %rdi
callq 0x32d0
movsd %xmm0, -0xc0(%rbp)
leaq -0xe0(%rbp), %rax
addq $0x28, %rax
leaq -0xe0(%rbp), %rcx
addq $0x30, %rcx
movq %rcx, -0x140(%rbp)
movq %rax, -0x138(%rbp)
movq -0x138(%rbp), %rax
movq -0x140(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
addq $0x8, %rax
cmpq %rcx, %rax
movq %rax, -0x138(%rbp)
jne 0x1b9eb
movsd -0x70(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x100(%rbp)
movsd -0x68(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0xf8(%rbp)
movsd -0x60(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0xf0(%rbp)
leaq -0x100(%rbp), %rsi
movq %rsi, %rdi
callq 0x9880
movsd %xmm0, -0x108(%rbp)
movq -0x10(%rbp), %rax
movsd (%rax), %xmm0
movsd -0x50(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x120(%rbp)
movq -0x10(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd -0x48(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x118(%rbp)
movq -0x10(%rbp), %rax
movsd 0x10(%rax), %xmm0
movsd -0x40(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x110(%rbp)
movq $0x0, -0x128(%rbp)
movl $0x0, -0x12c(%rbp)
movq -0x20(%rbp), %rax
movq 0x3b0(%rax), %rax
movslq -0x4(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq %rax, -0x148(%rbp)
subq $0x4, %rax
ja 0x1bcb3
movq -0x148(%rbp), %rax
leaq 0xd44c(%rip), %rcx      # 0x28f48
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x1, -0x12c(%rbp)
jmp 0x1bcb5
leaq -0x120(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x9880
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x1bb37
movl $0x1, -0x12c(%rbp)
jmp 0x1bcb5
movsd -0x78(%rbp), %xmm0
mulsd -0x78(%rbp), %xmm0
movsd %xmm0, -0x150(%rbp)
leaq -0x120(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x9880
movaps %xmm0, %xmm1
movsd -0x150(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x1bb7c
movl $0x1, -0x12c(%rbp)
jmp 0x1bcb5
movsd -0x120(%rbp), %xmm0
movq -0x10(%rbp), %rax
movsd (%rax), %xmm1
subsd -0x70(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x120(%rbp)
movsd -0x118(%rbp), %xmm0
movq -0x10(%rbp), %rax
movsd 0x8(%rax), %xmm1
subsd -0x68(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x118(%rbp)
movsd -0x110(%rbp), %xmm0
movq -0x10(%rbp), %rax
movsd 0x10(%rax), %xmm1
subsd -0x60(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x110(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x120(%rbp), %xmm0
jb 0x1bc17
xorps %xmm0, %xmm0
ucomisd -0x118(%rbp), %xmm0
jb 0x1bc17
xorps %xmm0, %xmm0
ucomisd -0x110(%rbp), %xmm0
jb 0x1bc17
movl $0x1, -0x12c(%rbp)
jmp 0x1bcb5
leaq -0x120(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x9880
movsd %xmm0, -0x128(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x128(%rbp), %xmm0
ja 0x1bc5a
movsd -0x108(%rbp), %xmm1
movsd -0x128(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x1bc5c
jmp 0x1bcb5
leaq -0x120(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x9880
movsd -0x128(%rbp), %xmm1
mulsd -0x128(%rbp), %xmm1
divsd -0x108(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x128(%rbp)
movsd -0x78(%rbp), %xmm0
mulsd -0x78(%rbp), %xmm0
ucomisd -0x128(%rbp), %xmm0
jb 0x1bcb1
movl $0x1, -0x12c(%rbp)
jmp 0x1bcb5
jmp 0x1bcb5
movl $0x1, %eax
cmpl -0x12c(%rbp), %eax
jne 0x1bcdb
movq -0x28(%rbp), %rax
movsd 0x40(%rax), %xmm0
leaq -0xe0(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x9400
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop