// File: /workspace/github_c_makefile_star2_O0/Paxa[P]fast_excel/libxlsxwriter/src/worksheet.c
// Function: process_png
STATIC lxw_error
_process_png(lxw_object_properties *object_props)
{
    uint32_t length;
    uint32_t offset;
    char type[4];
    uint32_t width = 0;
    uint32_t height = 0;
    double x_dpi = 96;
    double y_dpi = 96;
    int fseek_err;

    FILE *stream = object_props->stream;

    /* Skip another 4 bytes to the end of the PNG header. */
    fseek_err = fseek(stream, 4, SEEK_CUR);
    if (fseek_err)
        goto file_error;

    while (!feof(stream)) {

        /* Read the PNG length and type fields for the sub-section. */
        if (fread(&length, sizeof(length), 1, stream) < 1)
            break;

        if (fread(&type, 1, 4, stream) < 4)
            break;

        /* Convert the length to network order. */
        length = LXW_UINT32_NETWORK(length);

        /* The offset for next fseek() is the field length + type length. */
        offset = length + 4;

        if (memcmp(type, "IHDR", 4) == 0) {
            if (fread(&width, sizeof(width), 1, stream) < 1)
                break;

            if (fread(&height, sizeof(height), 1, stream) < 1)
                break;

            width = LXW_UINT32_NETWORK(width);
            height = LXW_UINT32_NETWORK(height);

            /* Reduce the offset by the length of previous freads(). */
            offset -= 8;
        }

        if (memcmp(type, "pHYs", 4) == 0) {
            uint32_t x_ppu = 0;
            uint32_t y_ppu = 0;
            uint8_t units = 1;

            if (fread(&x_ppu, sizeof(x_ppu), 1, stream) < 1)
                break;

            if (fread(&y_ppu, sizeof(y_ppu), 1, stream) < 1)
                break;

            if (fread(&units, sizeof(units), 1, stream) < 1)
                break;

            if (units == 1) {
                x_ppu = LXW_UINT32_NETWORK(x_ppu);
                y_ppu = LXW_UINT32_NETWORK(y_ppu);

                x_dpi = (double) x_ppu *0.0254;
                y_dpi = (double) y_ppu *0.0254;
            }

            /* Reduce the offset by the length of previous freads(). */
            offset -= 9;
        }

        if (memcmp(type, "IEND", 4) == 0)
            break;

        if (!feof(stream)) {
            fseek_err = fseek(stream, offset, SEEK_CUR);
            if (fseek_err)
                goto file_error;
        }
    }

    /* Ensure that we read some valid data from the file. */
    if (width == 0)
        goto file_error;

    /* Set the image metadata. */
    object_props->image_type = LXW_IMAGE_PNG;
    object_props->width = width;
    object_props->height = height;
    object_props->x_dpi = x_dpi ? x_dpi : 96;
    object_props->y_dpi = y_dpi ? y_dpi : 96;
    object_props->extension = lxw_strdup("png");

    return LXW_NO_ERROR;

file_error:
    LXW_WARN_FORMAT1("worksheet image insertion: "
                     "no size data found in: %s.", object_props->filename);

    return LXW_ERROR_IMAGE_DIMENSIONS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movsd 0xfd46(%rip), %xmm0     # 0x6afe8
movsd %xmm0, -0x30(%rbp)
movsd 0xfd39(%rip), %xmm0     # 0x6afe8
movsd %xmm0, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0xcbe0
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x5b2e1
jmp 0x5b6a4
jmp 0x5b2e3
movq -0x48(%rbp), %rdi
callq 0xc920
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x5b2fd
jmp 0x5b5d3
movq -0x48(%rbp), %rcx
leaq -0x14(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0xc320
cmpq $0x1, %rax
jae 0x5b31f
jmp 0x5b5d3
movq -0x48(%rbp), %rcx
leaq -0x1c(%rbp), %rdi
movl $0x1, %esi
movl $0x4, %edx
callq 0xc320
cmpq $0x4, %rax
jae 0x5b341
jmp 0x5b5d3
movl -0x14(%rbp), %eax
andl $0xff, %eax
shll $0x18, %eax
movl -0x14(%rbp), %ecx
andl $0xff00, %ecx           # imm = 0xFF00
shll $0x8, %ecx
orl %ecx, %eax
movl -0x14(%rbp), %ecx
andl $0xff0000, %ecx         # imm = 0xFF0000
shrl $0x8, %ecx
orl %ecx, %eax
movl -0x14(%rbp), %ecx
andl $0xff000000, %ecx       # imm = 0xFF000000
shrl $0x18, %ecx
orl %ecx, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x18(%rbp)
leaq -0x1c(%rbp), %rax
movl (%rax), %eax
subl $0x52444849, %eax       # imm = 0x52444849
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x5b459
movq -0x48(%rbp), %rcx
leaq -0x20(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0xc320
cmpq $0x1, %rax
jae 0x5b3be
jmp 0x5b5d3
movq -0x48(%rbp), %rcx
leaq -0x24(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0xc320
cmpq $0x1, %rax
jae 0x5b3e0
jmp 0x5b5d3
movl -0x20(%rbp), %eax
andl $0xff, %eax
shll $0x18, %eax
movl -0x20(%rbp), %ecx
andl $0xff00, %ecx           # imm = 0xFF00
shll $0x8, %ecx
orl %ecx, %eax
movl -0x20(%rbp), %ecx
andl $0xff0000, %ecx         # imm = 0xFF0000
shrl $0x8, %ecx
orl %ecx, %eax
movl -0x20(%rbp), %ecx
andl $0xff000000, %ecx       # imm = 0xFF000000
shrl $0x18, %ecx
orl %ecx, %eax
movl %eax, -0x20(%rbp)
movl -0x24(%rbp), %eax
andl $0xff, %eax
shll $0x18, %eax
movl -0x24(%rbp), %ecx
andl $0xff00, %ecx           # imm = 0xFF00
shll $0x8, %ecx
orl %ecx, %eax
movl -0x24(%rbp), %ecx
andl $0xff0000, %ecx         # imm = 0xFF0000
shrl $0x8, %ecx
orl %ecx, %eax
movl -0x24(%rbp), %ecx
andl $0xff000000, %ecx       # imm = 0xFF000000
shrl $0x18, %ecx
orl %ecx, %eax
movl %eax, -0x24(%rbp)
movl -0x18(%rbp), %eax
subl $0x8, %eax
movl %eax, -0x18(%rbp)
leaq -0x1c(%rbp), %rax
movl (%rax), %eax
subl $0x73594870, %eax       # imm = 0x73594870
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x5b585
movl $0x0, -0x4c(%rbp)
movl $0x0, -0x50(%rbp)
movb $0x1, -0x51(%rbp)
movq -0x48(%rbp), %rcx
leaq -0x4c(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0xc320
cmpq $0x1, %rax
jae 0x5b4a7
jmp 0x5b5d3
movq -0x48(%rbp), %rcx
leaq -0x50(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0xc320
cmpq $0x1, %rax
jae 0x5b4c9
jmp 0x5b5d3
movq -0x48(%rbp), %rcx
leaq -0x51(%rbp), %rdi
movl $0x1, %edx
movq %rdx, %rsi
callq 0xc320
cmpq $0x1, %rax
jae 0x5b4e9
jmp 0x5b5d3
movzbl -0x51(%rbp), %eax
cmpl $0x1, %eax
jne 0x5b57c
movl -0x4c(%rbp), %ecx
movl %ecx, %eax
shll $0x18, %eax
movl %ecx, %edx
andl $0xff00, %edx           # imm = 0xFF00
shll $0x8, %edx
orl %edx, %eax
movl %ecx, %edx
andl $0xff0000, %edx         # imm = 0xFF0000
shrl $0x8, %edx
orl %edx, %eax
shrl $0x18, %ecx
orl %ecx, %eax
movl %eax, -0x4c(%rbp)
movl -0x50(%rbp), %ecx
movl %ecx, %eax
shll $0x18, %eax
movl %ecx, %edx
andl $0xff00, %edx           # imm = 0xFF00
shll $0x8, %edx
orl %edx, %eax
movl %ecx, %edx
andl $0xff0000, %edx         # imm = 0xFF0000
shrl $0x8, %edx
orl %edx, %eax
shrl $0x18, %ecx
orl %ecx, %eax
movl %eax, -0x50(%rbp)
movl -0x4c(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd 0x10dc6(%rip), %xmm1    # 0x6c320
mulsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movl -0x50(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd 0x10dad(%rip), %xmm1    # 0x6c320
mulsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movl -0x18(%rbp), %eax
subl $0x9, %eax
movl %eax, -0x18(%rbp)
leaq -0x1c(%rbp), %rax
movl (%rax), %eax
subl $0x444e4549, %eax       # imm = 0x444E4549
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x5b59d
jmp 0x5b5d3
movq -0x48(%rbp), %rdi
callq 0xc920
cmpl $0x0, %eax
jne 0x5b5ce
movq -0x48(%rbp), %rdi
movl -0x18(%rbp), %eax
movl %eax, %esi
movl $0x1, %edx
callq 0xcbe0
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x5b5cc
jmp 0x5b6a4
jmp 0x5b5ce
jmp 0x5b2e3
cmpl $0x0, -0x20(%rbp)
jne 0x5b5de
jmp 0x5b6a4
movq -0x10(%rbp), %rax
movb $0x1, 0x50(%rax)
movl -0x20(%rbp), %eax
cvtsi2sd %rax, %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, 0x68(%rax)
movl -0x24(%rbp), %eax
cvtsi2sd %rax, %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, 0x70(%rax)
movsd -0x30(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x5b61a
jp 0x5b61a
jmp 0x5b626
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
jmp 0x5b635
movsd 0xf9ba(%rip), %xmm0     # 0x6afe8
movsd %xmm0, -0x60(%rbp)
jmp 0x5b635
movsd -0x60(%rbp), %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, 0x80(%rax)
movsd -0x38(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x5b658
jp 0x5b658
jmp 0x5b664
movsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
jmp 0x5b673
movsd 0xf97c(%rip), %xmm0     # 0x6afe8
movsd %xmm0, -0x68(%rbp)
jmp 0x5b673
movsd -0x68(%rbp), %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, 0x88(%rax)
leaq 0xd40a(%rip), %rdi      # 0x68a95
callq 0xcd80
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x78(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x5b6cb
movq 0x2194d(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdx
leaq 0x12bf8(%rip), %rsi     # 0x6e2b5
movb $0x0, %al
callq 0xc8f0
movl $0x1a, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)