// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: rgb_to_yuv
void rgb_to_yuv(image im)
{
    assert(im.c == 3);
    int i, j;
    float r, g, b;
    float y, u, v;
    for(j = 0; j < im.h; ++j){
        for(i = 0; i < im.w; ++i){
            r = get_pixel(im, i , j, 0);
            g = get_pixel(im, i , j, 1);
            b = get_pixel(im, i , j, 2);

            y = .299*r + .587*g + .114*b;
            u = -.14713*r + -.28886*g + .436*b;
            v = .615*r + -.51499*g + -.10001*b;

            set_pixel(im, i, j, 0, y);
            set_pixel(im, i, j, 1, u);
            set_pixel(im, i, j, 2, v);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
cmpl $0x3, 0x98(%rsp)
jne 0x1a24b
leaq 0x90(%rsp), %r15
movslq 0x4(%r15), %rax
movq %rax, 0x38(%rsp)
testq %rax, %rax
jle 0x1a23c
movl (%r15), %r12d
movq 0x10(%r15), %rax
movq %rax, 0x40(%rsp)
movq 0x38(%rsp), %rax
imull %r12d, %eax
movq %rax, 0x28(%rsp)
addl %eax, %eax
movl %eax, 0x1c(%rsp)
movq $0x0, 0x20(%rsp)
xorl %ebx, %ebx
testl %r12d, %r12d
jle 0x1a20f
movslq 0x1c(%rsp), %rax
movq 0x40(%rsp), %rdx
leaq (%rdx,%rax,4), %rax
movq %rax, 0x48(%rsp)
movslq 0x28(%rsp), %rax
leaq (%rdx,%rax,4), %rbp
movslq 0x20(%rsp), %rax
leaq (%rdx,%rax,4), %r13
xorl %r14d, %r14d
xorps %xmm0, %xmm0
cvtss2sd (%r13,%r14,4), %xmm0
movsd %xmm0, 0x50(%rsp)
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
movl %r14d, %edi
movl %ebx, %esi
movl $0x1, %edx
callq 0x15f12
movss %xmm0, 0x34(%rsp)
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
movl %r14d, %edi
movl %ebx, %esi
movl $0x2, %edx
callq 0x15f12
movsd 0x3d451(%rip), %xmm5    # 0x57588
movsd 0x3d441(%rip), %xmm4    # 0x57580
movsd 0x3d431(%rip), %xmm3    # 0x57578
xorps %xmm1, %xmm1
cvtss2sd 0x34(%rsp), %xmm1
cvtss2sd %xmm0, %xmm0
movaps %xmm1, %xmm2
mulsd %xmm3, %xmm2
movsd 0x50(%rsp), %xmm6
movapd %xmm6, %xmm3
mulsd %xmm4, %xmm3
addsd %xmm2, %xmm3
movaps %xmm0, %xmm2
mulsd %xmm5, %xmm2
movsd 0x3d41c(%rip), %xmm5    # 0x57598
movsd 0x3d40c(%rip), %xmm4    # 0x57590
addsd %xmm3, %xmm2
cvtsd2ss %xmm2, %xmm2
movaps %xmm1, %xmm3
mulsd %xmm4, %xmm3
movapd %xmm6, %xmm4
mulsd %xmm5, %xmm4
movsd 0x3d3fd(%rip), %xmm5    # 0x575a0
addsd %xmm3, %xmm4
movaps %xmm0, %xmm3
mulsd %xmm5, %xmm3
addsd %xmm4, %xmm3
movsd 0x3d3ee(%rip), %xmm4    # 0x575a8
cvtsd2ss %xmm3, %xmm3
mulsd %xmm4, %xmm1
movsd 0x3d3e6(%rip), %xmm4    # 0x575b0
movapd %xmm6, %xmm5
mulsd %xmm4, %xmm5
addsd %xmm1, %xmm5
movsd 0x3d3da(%rip), %xmm1    # 0x575b8
mulsd %xmm1, %xmm0
addsd %xmm5, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%r13,%r14,4)
movss %xmm2, (%rbp,%r14,4)
movq 0x48(%rsp), %rax
movss %xmm3, (%rax,%r14,4)
incq %r14
cmpq %r14, %r12
jne 0x1a0d9
incq %rbx
addl %r12d, 0x1c(%rsp)
movq 0x28(%rsp), %rax
addl %r12d, %eax
movq %rax, 0x28(%rsp)
movq 0x20(%rsp), %rax
addl %r12d, %eax
movq %rax, 0x20(%rsp)
cmpq 0x38(%rsp), %rbx
jne 0x1a0a8
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3d60e(%rip), %rdi     # 0x57860
leaq 0x3d543(%rip), %rsi     # 0x5779c
leaq 0x3d621(%rip), %rcx     # 0x57881
movl $0x3a9, %edx            # imm = 0x3A9
callq 0x31b0