// File: /workspace/github_c_makefile_star2_O0/minkcv[P]vm/machine/gpu.c
// Function: readSpritesFromMem
void readSpritesFromMem(GPU* gpu, uint8_t memory[MEMORY_SEGMENT_COUNT][MEMORY_SEGMENT_SIZE])
{
    int i;
    for (i = 0; i < NUM_SPRITES; i++)
    {
        uint8_t flags = memory[SPRITE_ATTR_SEG][i * SPRITE_ATTR_LENGTH];
        gpu->sprAttrs[i].active = flags >> 7;
        gpu->sprAttrs[i].flipHor = flags >> 6 & 0x1;
        gpu->sprAttrs[i].flipVer = flags >> 5 & 0x1;
        gpu->sprAttrs[i].color4Alpha = flags >> 4 & 0x1;
        gpu->sprAttrs[i].fullWidth = flags >> 3 & 0x1;
        gpu->sprAttrs[i].fullHeight = flags >> 2 & 0x1;
        gpu->sprAttrs[i].x = memory[SPRITE_ATTR_SEG][i * SPRITE_ATTR_LENGTH + 1];
        gpu->sprAttrs[i].y = memory[SPRITE_ATTR_SEG][i * SPRITE_ATTR_LENGTH + 2];
        gpu->sprAttrs[i].width = memory[SPRITE_ATTR_SEG][i * SPRITE_ATTR_LENGTH + 3];
        gpu->sprAttrs[i].height = memory[SPRITE_ATTR_SEG][i * SPRITE_ATTR_LENGTH + 4];
        gpu->sprAttrs[i].segmentAddr = memory[SPRITE_ATTR_SEG][i * SPRITE_ATTR_LENGTH + 5];
        gpu->sprAttrs[i].byteAddr = memory[SPRITE_ATTR_SEG][i * SPRITE_ATTR_LENGTH + 6];
        gpu->sprAttrs[i].colors[0] = memory[SPRITE_ATTR_SEG][i * SPRITE_ATTR_LENGTH + 7];
        gpu->sprAttrs[i].colors[1] = memory[SPRITE_ATTR_SEG][i * SPRITE_ATTR_LENGTH + 8];
        gpu->sprAttrs[i].colors[2] = memory[SPRITE_ATTR_SEG][i * SPRITE_ATTR_LENGTH + 9];
        gpu->sprAttrs[i].colors[3] = memory[SPRITE_ATTR_SEG][i * SPRITE_ATTR_LENGTH + 10];
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
cmpl $0x100, -0x14(%rbp)     # imm = 0x100
jge 0x2454
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
shll $0x4, %ecx
movslq %ecx, %rcx
movb 0x4000(%rax,%rcx), %al
movb %al, -0x15(%rbp)
movzbl -0x15(%rbp), %ecx
sarl $0x7, %ecx
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rdx
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movb %cl, %dl
movb (%rax), %cl
andb $0x1, %dl
andb $-0x2, %cl
orb %dl, %cl
movb %cl, (%rax)
movzbl -0x15(%rbp), %ecx
sarl $0x6, %ecx
andl $0x1, %ecx
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rdx
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movb %cl, %dl
movb (%rax), %cl
andb $0x1, %dl
shlb %dl
andb $-0x3, %cl
orb %dl, %cl
movb %cl, (%rax)
movzbl -0x15(%rbp), %ecx
sarl $0x5, %ecx
andl $0x1, %ecx
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rdx
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movb %cl, %dl
movb (%rax), %cl
andb $0x1, %dl
shlb $0x2, %dl
andb $-0x5, %cl
orb %dl, %cl
movb %cl, (%rax)
movzbl -0x15(%rbp), %ecx
sarl $0x4, %ecx
andl $0x1, %ecx
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rdx
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movb %cl, %dl
movb (%rax), %cl
andb $0x1, %dl
shlb $0x3, %dl
andb $-0x9, %cl
orb %dl, %cl
movb %cl, (%rax)
movzbl -0x15(%rbp), %ecx
sarl $0x3, %ecx
andl $0x1, %ecx
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rdx
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movb %cl, %dl
movb (%rax), %cl
andb $0x1, %dl
shlb $0x4, %dl
andb $-0x11, %cl
orb %dl, %cl
movb %cl, (%rax)
movzbl -0x15(%rbp), %ecx
sarl $0x2, %ecx
andl $0x1, %ecx
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rdx
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movb %cl, %dl
movb (%rax), %cl
andb $0x1, %dl
shlb $0x5, %dl
andb $-0x21, %cl
orb %dl, %cl
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
shll $0x4, %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movb 0x4000(%rax,%rcx), %cl
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rdx
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0x1(%rax)
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
shll $0x4, %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movb 0x4000(%rax,%rcx), %cl
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rdx
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0x2(%rax)
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
shll $0x4, %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movb 0x4000(%rax,%rcx), %cl
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rdx
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0x3(%rax)
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
shll $0x4, %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movb 0x4000(%rax,%rcx), %cl
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rdx
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0x4(%rax)
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
shll $0x4, %ecx
addl $0x5, %ecx
movslq %ecx, %rcx
movb 0x4000(%rax,%rcx), %cl
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rdx
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0x5(%rax)
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
shll $0x4, %ecx
addl $0x6, %ecx
movslq %ecx, %rcx
movb 0x4000(%rax,%rcx), %cl
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rdx
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0x6(%rax)
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
shll $0x4, %ecx
addl $0x7, %ecx
movslq %ecx, %rcx
movb 0x4000(%rax,%rcx), %cl
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rdx
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0x7(%rax)
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
shll $0x4, %ecx
addl $0x8, %ecx
movslq %ecx, %rcx
movb 0x4000(%rax,%rcx), %cl
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rdx
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0x8(%rax)
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
shll $0x4, %ecx
addl $0x9, %ecx
movslq %ecx, %rcx
movb 0x4000(%rax,%rcx), %cl
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rdx
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0x9(%rax)
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
shll $0x4, %ecx
addl $0xa, %ecx
movslq %ecx, %rcx
movb 0x4000(%rax,%rcx), %cl
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rdx
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0xa(%rax)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2193
popq %rbp
retq
nopw %cs:(%rax,%rax)