// File: /workspace/github_c_makefile_star2_O1/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 0x19906
leaq 0x90(%rsp), %r15
movslq 0x4(%r15), %rax
movq %rax, 0x38(%rsp)
testq %rax, %rax
setg %al
jle 0x198d8
movl (%r15), %r12d
movq 0x10(%r15), %rcx
movq %rcx, 0x40(%rsp)
movq 0x38(%rsp), %rcx
imull %r12d, %ecx
movq %rcx, 0x28(%rsp)
addl %ecx, %ecx
movl %ecx, 0x1c(%rsp)
movq $0x0, 0x20(%rsp)
xorl %ebx, %ebx
testl %r12d, %r12d
jle 0x198a2
testb $0x1, %al
je 0x198e7
movslq 0x1c(%rsp), %rax
movq 0x40(%rsp), %rcx
leaq (%rcx,%rax,4), %rax
movq %rax, 0x48(%rsp)
movslq 0x28(%rsp), %rax
leaq (%rcx,%rax,4), %rbp
movslq 0x20(%rsp), %rax
leaq (%rcx,%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 0x15476
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 0x15476
movsd 0x3bce6(%rip), %xmm5    # 0x554b0
movsd 0x3bcd6(%rip), %xmm4    # 0x554a8
movsd 0x3bcc6(%rip), %xmm3    # 0x554a0
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 0x3bcb1(%rip), %xmm5    # 0x554c0
movsd 0x3bca1(%rip), %xmm4    # 0x554b8
addsd %xmm3, %xmm2
cvtsd2ss %xmm2, %xmm2
movaps %xmm1, %xmm3
mulsd %xmm4, %xmm3
movapd %xmm6, %xmm4
mulsd %xmm5, %xmm4
movsd 0x3bc92(%rip), %xmm5    # 0x554c8
addsd %xmm3, %xmm4
movaps %xmm0, %xmm3
mulsd %xmm5, %xmm3
addsd %xmm4, %xmm3
movsd 0x3bc83(%rip), %xmm4    # 0x554d0
cvtsd2ss %xmm3, %xmm3
mulsd %xmm4, %xmm1
movsd 0x3bc7b(%rip), %xmm4    # 0x554d8
movapd %xmm6, %xmm5
mulsd %xmm4, %xmm5
addsd %xmm1, %xmm5
movsd 0x3bc6f(%rip), %xmm1    # 0x554e0
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 0x1976c
incq %rbx
movq 0x38(%rsp), %rcx
cmpq %rcx, %rbx
setb %al
addl %r12d, 0x1c(%rsp)
movq 0x28(%rsp), %rsi
addl %r12d, %esi
movq %rsi, 0x28(%rsp)
movq 0x20(%rsp), %rsi
addl %r12d, %esi
movq %rsi, 0x20(%rsp)
cmpq %rcx, %rbx
jne 0x19733
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3cbcf(%rip), %rdi     # 0x564bd
leaq 0x3bdcf(%rip), %rsi     # 0x556c4
leaq 0x3cbdf(%rip), %rcx     # 0x564db
movl $0x31, %edx
callq 0x31c0
leaq 0x3be7b(%rip), %rdi     # 0x55788
leaq 0x3bdb0(%rip), %rsi     # 0x556c4
leaq 0x3be8e(%rip), %rcx     # 0x557a9
movl $0x3a9, %edx            # imm = 0x3A9
callq 0x31c0