// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dec/frame_dec.c
// Function: ReconstructRow
static void ReconstructRow(const VP8Decoder* const dec,
                           const VP8ThreadContext* ctx) {
  int j;
  int mb_x;
  const int mb_y = ctx->mb_y_;
  const int cache_id = ctx->id_;
  uint8_t* const y_dst = dec->yuv_b_ + Y_OFF;
  uint8_t* const u_dst = dec->yuv_b_ + U_OFF;
  uint8_t* const v_dst = dec->yuv_b_ + V_OFF;

  // Initialize left-most block.
  for (j = 0; j < 16; ++j) {
    y_dst[j * BPS - 1] = 129;
  }
  for (j = 0; j < 8; ++j) {
    u_dst[j * BPS - 1] = 129;
    v_dst[j * BPS - 1] = 129;
  }

  // Init top-left sample on left column too.
  if (mb_y > 0) {
    y_dst[-1 - BPS] = u_dst[-1 - BPS] = v_dst[-1 - BPS] = 129;
  } else {
    // we only need to do this init once at block (0,0).
    // Afterward, it remains valid for the whole topmost row.
    memset(y_dst - BPS - 1, 127, 16 + 4 + 1);
    memset(u_dst - BPS - 1, 127, 8 + 1);
    memset(v_dst - BPS - 1, 127, 8 + 1);
  }

  // Reconstruct one row.
  for (mb_x = 0; mb_x < dec->mb_w_; ++mb_x) {
    const VP8MBData* const block = ctx->mb_data_ + mb_x;

    // Rotate in the left samples from previously decoded block. We move four
    // pixels at a time for alignment reason, and because of in-loop filter.
    if (mb_x > 0) {
      for (j = -1; j < 16; ++j) {
        Copy32b(&y_dst[j * BPS - 4], &y_dst[j * BPS + 12]);
      }
      for (j = -1; j < 8; ++j) {
        Copy32b(&u_dst[j * BPS - 4], &u_dst[j * BPS + 4]);
        Copy32b(&v_dst[j * BPS - 4], &v_dst[j * BPS + 4]);
      }
    }
    {
      // bring top samples into the cache
      VP8TopSamples* const top_yuv = dec->yuv_t_ + mb_x;
      const int16_t* const coeffs = block->coeffs_;
      uint32_t bits = block->non_zero_y_;
      int n;

      if (mb_y > 0) {
        memcpy(y_dst - BPS, top_yuv[0].y, 16);
        memcpy(u_dst - BPS, top_yuv[0].u, 8);
        memcpy(v_dst - BPS, top_yuv[0].v, 8);
      }

      // predict and add residuals
      if (block->is_i4x4_) {   // 4x4
        uint32_t* const top_right = (uint32_t*)(y_dst - BPS + 16);

        if (mb_y > 0) {
          if (mb_x >= dec->mb_w_ - 1) {    // on rightmost border
            memset(top_right, top_yuv[0].y[15], sizeof(*top_right));
          } else {
            memcpy(top_right, top_yuv[1].y, sizeof(*top_right));
          }
        }
        // replicate the top-right pixels below
        top_right[BPS] = top_right[2 * BPS] = top_right[3 * BPS] = top_right[0];

        // predict and add residuals for all 4x4 blocks in turn.
        for (n = 0; n < 16; ++n, bits <<= 2) {
          uint8_t* const dst = y_dst + kScan[n];
          VP8PredLuma4[block->imodes_[n]](dst);
          DoTransform(bits, coeffs + n * 16, dst);
        }
      } else {    // 16x16
        const int pred_func = CheckMode(mb_x, mb_y, block->imodes_[0]);
        VP8PredLuma16[pred_func](y_dst);
        if (bits != 0) {
          for (n = 0; n < 16; ++n, bits <<= 2) {
            DoTransform(bits, coeffs + n * 16, y_dst + kScan[n]);
          }
        }
      }
      {
        // Chroma
        const uint32_t bits_uv = block->non_zero_uv_;
        const int pred_func = CheckMode(mb_x, mb_y, block->uvmode_);
        VP8PredChroma8[pred_func](u_dst);
        VP8PredChroma8[pred_func](v_dst);
        DoUVTransform(bits_uv >> 0, coeffs + 16 * 16, u_dst);
        DoUVTransform(bits_uv >> 8, coeffs + 20 * 16, v_dst);
      }

      // stash away top samples for next block
      if (mb_y < dec->mb_h_ - 1) {
        memcpy(top_yuv[0].y, y_dst + 15 * BPS, 16);
        memcpy(top_yuv[0].u, u_dst +  7 * BPS,  8);
        memcpy(top_yuv[0].v, v_dst +  7 * BPS,  8);
      }
    }
    // Transfer reconstructed samples from yuv_b_ cache to final destination.
    {
      const int y_offset = cache_id * 16 * dec->cache_y_stride_;
      const int uv_offset = cache_id * 8 * dec->cache_uv_stride_;
      uint8_t* const y_out = dec->cache_y_ + mb_x * 16 + y_offset;
      uint8_t* const u_out = dec->cache_u_ + mb_x * 8 + uv_offset;
      uint8_t* const v_out = dec->cache_v_ + mb_x * 8 + uv_offset;
      for (j = 0; j < 16; ++j) {
        memcpy(y_out + j * dec->cache_y_stride_, y_dst + j * BPS, 16);
      }
      for (j = 0; j < 8; ++j) {
        memcpy(u_out + j * dec->cache_uv_stride_, u_dst + j * BPS, 8);
        memcpy(v_out + j * dec->cache_uv_stride_, v_dst + j * BPS, 8);
      }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0xb20(%rax), %rax
addq $0x28, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0xb20(%rax), %rax
addq $0x248, %rax            # imm = 0x248
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0xb20(%rax), %rax
addq $0x258, %rax            # imm = 0x258
movq %rax, -0x38(%rbp)
movl $0x0, -0x14(%rbp)
cmpl $0x10, -0x14(%rbp)
jge 0x13e2bf
movq -0x28(%rbp), %rax
movl -0x14(%rbp), %ecx
shll $0x5, %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movb $-0x7f, (%rax,%rcx)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x13e29a
movl $0x0, -0x14(%rbp)
cmpl $0x8, -0x14(%rbp)
jge 0x13e2ff
movq -0x30(%rbp), %rax
movl -0x14(%rbp), %ecx
shll $0x5, %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movb $-0x7f, (%rax,%rcx)
movq -0x38(%rbp), %rax
movl -0x14(%rbp), %ecx
shll $0x5, %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movb $-0x7f, (%rax,%rcx)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x13e2c6
cmpl $0x0, -0x1c(%rbp)
jle 0x13e31f
movq -0x38(%rbp), %rax
movb $-0x7f, -0x21(%rax)
movq -0x30(%rbp), %rax
movb $-0x7f, -0x21(%rax)
movq -0x28(%rbp), %rax
movb $-0x7f, -0x21(%rax)
jmp 0x13e370
movq -0x28(%rbp), %rdi
addq $-0x20, %rdi
addq $-0x1, %rdi
movl $0x7f, %esi
movl $0x15, %edx
callq 0x5a200
movq -0x30(%rbp), %rdi
addq $-0x20, %rdi
addq $-0x1, %rdi
movl $0x7f, %esi
movl $0x9, %edx
callq 0x5a200
movq -0x38(%rbp), %rdi
addq $-0x20, %rdi
addq $-0x1, %rdi
movl $0x7f, %esi
movl $0x9, %edx
callq 0x5a200
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x198(%rcx), %eax
jge 0x13e8a2
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x18(%rbp), %rcx
imulq $0x320, %rcx, %rcx      # imm = 0x320
addq %rcx, %rax
movq %rax, -0x40(%rbp)
cmpl $0x0, -0x18(%rbp)
jle 0x13e45b
movl $0xffffffff, -0x14(%rbp) # imm = 0xFFFFFFFF
cmpl $0x10, -0x14(%rbp)
jge 0x13e3ef
movq -0x28(%rbp), %rdi
movl -0x14(%rbp), %eax
shll $0x5, %eax
subl $0x4, %eax
cltq
addq %rax, %rdi
movq -0x28(%rbp), %rsi
movl -0x14(%rbp), %eax
shll $0x5, %eax
addl $0xc, %eax
cltq
addq %rax, %rsi
callq 0x13fa10
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x13e3b5
movl $0xffffffff, -0x14(%rbp) # imm = 0xFFFFFFFF
cmpl $0x8, -0x14(%rbp)
jge 0x13e459
movq -0x30(%rbp), %rdi
movl -0x14(%rbp), %eax
shll $0x5, %eax
subl $0x4, %eax
cltq
addq %rax, %rdi
movq -0x30(%rbp), %rsi
movl -0x14(%rbp), %eax
shll $0x5, %eax
addl $0x4, %eax
cltq
addq %rax, %rsi
callq 0x13fa10
movq -0x38(%rbp), %rdi
movl -0x14(%rbp), %eax
shll $0x5, %eax
subl $0x4, %eax
cltq
addq %rax, %rdi
movq -0x38(%rbp), %rsi
movl -0x14(%rbp), %eax
shll $0x5, %eax
addl $0x4, %eax
cltq
addq %rax, %rsi
callq 0x13fa10
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x13e3f6
jmp 0x13e45b
movq -0x8(%rbp), %rax
movq 0xb08(%rax), %rax
movslq -0x18(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rax
movl 0x314(%rax), %eax
movl %eax, -0x54(%rbp)
cmpl $0x0, -0x1c(%rbp)
jle 0x13e4c7
movq -0x28(%rbp), %rax
movq -0x48(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, -0x20(%rax)
movq 0x8(%rcx), %rcx
movq %rcx, -0x18(%rax)
movq -0x30(%rbp), %rax
movq -0x48(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq %rcx, -0x20(%rax)
movq -0x38(%rbp), %rax
movq -0x48(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq %rcx, -0x20(%rax)
movq -0x40(%rbp), %rax
cmpb $0x0, 0x300(%rax)
je 0x13e5d4
movq -0x28(%rbp), %rax
addq $-0x20, %rax
addq $0x10, %rax
movq %rax, -0x60(%rbp)
cmpl $0x0, -0x1c(%rbp)
jle 0x13e52c
movl -0x18(%rbp), %eax
movq -0x8(%rbp), %rcx
movl 0x198(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jl 0x13e51d
movq -0x60(%rbp), %rdi
movq -0x48(%rbp), %rax
movzbl 0xf(%rax), %eax
movl $0x4, %edx
movzbl %al, %esi
callq 0x5a200
jmp 0x13e52a
movq -0x60(%rbp), %rax
movq -0x48(%rbp), %rcx
movl 0x20(%rcx), %ecx
movl %ecx, (%rax)
jmp 0x13e52c
movq -0x60(%rbp), %rax
movl (%rax), %ecx
movq -0x60(%rbp), %rax
movl %ecx, 0x180(%rax)
movq -0x60(%rbp), %rax
movl %ecx, 0x100(%rax)
movq -0x60(%rbp), %rax
movl %ecx, 0x80(%rax)
movl $0x0, -0x58(%rbp)
cmpl $0x10, -0x58(%rbp)
jge 0x13e5cf
movq -0x28(%rbp), %rax
movslq -0x58(%rbp), %rdx
leaq 0x7e774(%rip), %rcx     # 0x1bcce0
movzwl (%rcx,%rdx,2), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movq -0x40(%rbp), %rax
movslq -0x58(%rbp), %rcx
movzbl 0x301(%rax,%rcx), %eax
movl %eax, %ecx
leaq 0xda96d(%rip), %rax     # 0x218f00
movq (%rax,%rcx,8), %rax
movq -0x68(%rbp), %rdi
callq *%rax
movl -0x54(%rbp), %edi
movq -0x50(%rbp), %rsi
movl -0x58(%rbp), %eax
shll $0x4, %eax
cltq
shlq %rax
addq %rax, %rsi
movq -0x68(%rbp), %rdx
callq 0x13fa30
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
movl -0x54(%rbp), %eax
shll $0x2, %eax
movl %eax, -0x54(%rbp)
jmp 0x13e557
jmp 0x13e65f
movl -0x18(%rbp), %edi
movl -0x1c(%rbp), %esi
movq -0x40(%rbp), %rax
movzbl 0x301(%rax), %edx
callq 0x13fac0
movl %eax, -0x6c(%rbp)
movslq -0x6c(%rbp), %rcx
leaq 0xda8c8(%rip), %rax     # 0x218ec0
movq (%rax,%rcx,8), %rax
movq -0x28(%rbp), %rdi
callq *%rax
cmpl $0x0, -0x54(%rbp)
je 0x13e65d
movl $0x0, -0x58(%rbp)
cmpl $0x10, -0x58(%rbp)
jge 0x13e65b
movl -0x54(%rbp), %edi
movq -0x50(%rbp), %rsi
movl -0x58(%rbp), %eax
shll $0x4, %eax
cltq
shlq %rax
addq %rax, %rsi
movq -0x28(%rbp), %rdx
movslq -0x58(%rbp), %rcx
leaq 0x7e6a7(%rip), %rax     # 0x1bcce0
movzwl (%rax,%rcx,2), %eax
cltq
addq %rax, %rdx
callq 0x13fa30
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
movl -0x54(%rbp), %eax
shll $0x2, %eax
movl %eax, -0x54(%rbp)
jmp 0x13e60f
jmp 0x13e65d
jmp 0x13e65f
movq -0x40(%rbp), %rax
movl 0x318(%rax), %eax
movl %eax, -0x70(%rbp)
movl -0x18(%rbp), %edi
movl -0x1c(%rbp), %esi
movq -0x40(%rbp), %rax
movzbl 0x311(%rax), %edx
callq 0x13fac0
movl %eax, -0x74(%rbp)
movslq -0x74(%rbp), %rcx
leaq 0xda8c0(%rip), %rax     # 0x218f50
movq (%rax,%rcx,8), %rax
movq -0x30(%rbp), %rdi
callq *%rax
movslq -0x74(%rbp), %rcx
leaq 0xda8ab(%rip), %rax     # 0x218f50
movq (%rax,%rcx,8), %rax
movq -0x38(%rbp), %rdi
callq *%rax
movl -0x70(%rbp), %edi
shrl $0x0, %edi
movq -0x50(%rbp), %rsi
addq $0x200, %rsi            # imm = 0x200
movq -0x30(%rbp), %rdx
callq 0x13fb20
movl -0x70(%rbp), %edi
shrl $0x8, %edi
movq -0x50(%rbp), %rsi
addq $0x280, %rsi            # imm = 0x280
movq -0x38(%rbp), %rdx
callq 0x13fb20
movl -0x1c(%rbp), %eax
movq -0x8(%rbp), %rcx
movl 0x19c(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x13e73a
movq -0x48(%rbp), %rax
movq -0x28(%rbp), %rcx
movq 0x1e0(%rcx), %rdx
movq %rdx, (%rax)
movq 0x1e8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq -0x48(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0xe0(%rcx), %rcx
movq %rcx, 0x10(%rax)
movq -0x48(%rbp), %rax
movq -0x38(%rbp), %rcx
movq 0xe0(%rcx), %rcx
movq %rcx, 0x18(%rax)
movl -0x20(%rbp), %eax
shll $0x4, %eax
movq -0x8(%rbp), %rcx
imull 0xb40(%rcx), %eax
movl %eax, -0x78(%rbp)
movl -0x20(%rbp), %eax
shll $0x3, %eax
movq -0x8(%rbp), %rcx
imull 0xb44(%rcx), %eax
movl %eax, -0x7c(%rbp)
movq -0x8(%rbp), %rax
movq 0xb28(%rax), %rax
movl -0x18(%rbp), %ecx
shll $0x4, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movslq -0x78(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
movq -0x8(%rbp), %rax
movq 0xb30(%rax), %rax
movl -0x18(%rbp), %ecx
shll $0x3, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movslq -0x7c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x90(%rbp)
movq -0x8(%rbp), %rax
movq 0xb38(%rax), %rax
movl -0x18(%rbp), %ecx
shll $0x3, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movslq -0x7c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x98(%rbp)
movl $0x0, -0x14(%rbp)
cmpl $0x10, -0x14(%rbp)
jge 0x13e820
movq -0x88(%rbp), %rax
movl -0x14(%rbp), %ecx
movq -0x8(%rbp), %rdx
imull 0xb40(%rdx), %ecx
movslq %ecx, %rcx
movq -0x28(%rbp), %rdx
movl -0x14(%rbp), %esi
shll $0x5, %esi
movslq %esi, %rsi
movq (%rdx,%rsi), %rdi
movq %rdi, (%rax,%rcx)
movq 0x8(%rdx,%rsi), %rdx
movq %rdx, 0x8(%rax,%rcx)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x13e7d8
movl $0x0, -0x14(%rbp)
cmpl $0x8, -0x14(%rbp)
jge 0x13e892
movq -0x90(%rbp), %rax
movl -0x14(%rbp), %ecx
movq -0x8(%rbp), %rdx
imull 0xb44(%rdx), %ecx
movslq %ecx, %rcx
movq -0x30(%rbp), %rdx
movl -0x14(%rbp), %esi
shll $0x5, %esi
movslq %esi, %rsi
movq (%rdx,%rsi), %rdx
movq %rdx, (%rax,%rcx)
movq -0x98(%rbp), %rax
movl -0x14(%rbp), %ecx
movq -0x8(%rbp), %rdx
imull 0xb44(%rdx), %ecx
movslq %ecx, %rcx
movq -0x38(%rbp), %rdx
movl -0x14(%rbp), %esi
shll $0x5, %esi
movslq %esi, %rsi
movq (%rdx,%rsi), %rdx
movq %rdx, (%rax,%rcx)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x13e827
jmp 0x13e894
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x13e377
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax,%rax)