// File: /workspace/github_c_makefile_star2_O2/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 $0x48, %rsp
cmpl $0x3, 0x88(%rsp)
jne 0xf000
leaq 0x80(%rsp), %r12
movl (%r12), %eax
movl 0x4(%r12), %ecx
xorl %edx, %edx
testl %eax, %eax
movl $0x0, %esi
movl %eax, 0x20(%rsp)
cmovgl %eax, %esi
movq %rsi, 0x40(%rsp)
movq 0x10(%r12), %rax
movq %rax, 0x28(%rsp)
testl %ecx, %ecx
cmovlel %edx, %ecx
movq %rcx, 0x30(%rsp)
pushq $0x1
popq %rbx
pushq $0x2
popq %rbp
xorl %r14d, %r14d
cmpq 0x30(%rsp), %r14
je 0xeff1
movq %rdx, 0x38(%rsp)
movl %edx, %eax
movq 0x28(%rsp), %rcx
leaq (%rcx,%rax,4), %r13
xorl %r15d, %r15d
cmpq %r15, 0x40(%rsp)
je 0xefe0
movq 0x10(%r12), %rax
movq %rax, 0x10(%rsp)
movups (%r12), %xmm0
movups %xmm0, (%rsp)
movl %r15d, %edi
movl %r14d, %esi
xorl %edx, %edx
callq 0xb589
movss %xmm0, 0x1c(%rsp)
movq 0x10(%r12), %rax
movq %rax, 0x10(%rsp)
movups (%r12), %xmm0
movups %xmm0, (%rsp)
movl %r15d, %edi
movl %r14d, %esi
movl %ebx, %edx
callq 0xb589
movss %xmm0, 0x24(%rsp)
movq 0x10(%r12), %rax
movq %rax, 0x10(%rsp)
movups (%r12), %xmm0
movups %xmm0, (%rsp)
movl %r15d, %edi
movl %r14d, %esi
movl %ebp, %edx
callq 0xb589
cvtss2sd 0x1c(%rsp), %xmm1
cvtss2sd 0x24(%rsp), %xmm3
cvtss2sd %xmm0, %xmm2
movaps %xmm3, %xmm0
mulsd 0x3f586(%rip), %xmm0    # 0x4e498
movaps %xmm1, %xmm4
mulsd 0x3f583(%rip), %xmm4    # 0x4e4a0
addsd %xmm0, %xmm4
movaps %xmm2, %xmm0
mulsd 0x3f57c(%rip), %xmm0    # 0x4e4a8
addsd %xmm4, %xmm0
cvtsd2ss %xmm0, %xmm0
movaps %xmm3, %xmm4
mulsd 0x3f571(%rip), %xmm4    # 0x4e4b0
movaps %xmm1, %xmm5
mulsd 0x3f56e(%rip), %xmm5    # 0x4e4b8
addsd %xmm4, %xmm5
movaps %xmm2, %xmm4
mulsd 0x3f567(%rip), %xmm4    # 0x4e4c0
addsd %xmm5, %xmm4
cvtsd2ss %xmm4, %xmm4
movss %xmm4, 0x1c(%rsp)
mulsd 0x3f559(%rip), %xmm3    # 0x4e4c8
mulsd 0x3f559(%rip), %xmm1    # 0x4e4d0
addsd %xmm3, %xmm1
mulsd 0x3f555(%rip), %xmm2    # 0x4e4d8
addsd %xmm1, %xmm2
cvtsd2ss %xmm2, %xmm1
movss %xmm1, (%r13,%r15,4)
movq 0x10(%r12), %rax
movq %rax, 0x10(%rsp)
movups (%r12), %xmm1
movups %xmm1, (%rsp)
movl %r15d, %edi
movl %r14d, %esi
movl %ebx, %edx
callq 0xb5fe
movq 0x10(%r12), %rax
movq %rax, 0x10(%rsp)
movups (%r12), %xmm0
movups %xmm0, (%rsp)
movl %r15d, %edi
movl %r14d, %esi
movl %ebp, %edx
movss 0x1c(%rsp), %xmm0
callq 0xb5fe
incq %r15
jmp 0xee80
incq %r14
movq 0x38(%rsp), %rdx
addl 0x20(%rsp), %edx
jmp 0xee62
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3f779(%rip), %rdi     # 0x4e780
leaq 0x3f6ae(%rip), %rsi     # 0x4e6bc
leaq 0x3f78c(%rip), %rcx     # 0x4e7a1
movl $0x3a9, %edx            # imm = 0x3A9
callq 0x31b0