// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dec/frame_dec.c
// Function: PrecomputeFilterStrengths
static void PrecomputeFilterStrengths(VP8Decoder* const dec) {
  if (dec->filter_type_ > 0) {
    int s;
    const VP8FilterHeader* const hdr = &dec->filter_hdr_;
    for (s = 0; s < NUM_MB_SEGMENTS; ++s) {
      int i4x4;
      // First, compute the initial level
      int base_level;
      if (dec->segment_hdr_.use_segment_) {
        base_level = dec->segment_hdr_.filter_strength_[s];
        if (!dec->segment_hdr_.absolute_delta_) {
          base_level += hdr->level_;
        }
      } else {
        base_level = hdr->level_;
      }
      for (i4x4 = 0; i4x4 <= 1; ++i4x4) {
        VP8FInfo* const info = &dec->fstrengths_[s][i4x4];
        int level = base_level;
        if (hdr->use_lf_delta_) {
          level += hdr->ref_lf_delta_[0];
          if (i4x4) {
            level += hdr->mode_lf_delta_[0];
          }
        }
        level = (level < 0) ? 0 : (level > 63) ? 63 : level;
        if (level > 0) {
          int ilevel = level;
          if (hdr->sharpness_ > 0) {
            if (hdr->sharpness_ > 4) {
              ilevel >>= 2;
            } else {
              ilevel >>= 1;
            }
            if (ilevel > 9 - hdr->sharpness_) {
              ilevel = 9 - hdr->sharpness_;
            }
          }
          if (ilevel < 1) ilevel = 1;
          info->f_ilevel_ = ilevel;
          info->f_limit_ = 2 * level + ilevel;
          info->hev_thresh_ = (level >= 40) ? 2 : (level >= 15) ? 1 : 0;
        } else {
          info->f_limit_ = 0;  // no filtering
        }
        info->f_inner_ = i4x4;
      }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0xb68(%rax)
jle 0x13f1ea
movq -0x8(%rbp), %rax
addq $0x54, %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0xc(%rbp)
cmpl $0x4, -0xc(%rbp)
jge 0x13f1e8
movq -0x8(%rbp), %rax
cmpl $0x0, 0x84(%rax)
je 0x13f062
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movsbl 0x94(%rax,%rcx), %eax
movl %eax, -0x20(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x8c(%rax)
jne 0x13f060
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
addl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
jmp 0x13f06c
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x20(%rbp)
movl $0x0, -0x1c(%rbp)
cmpl $0x1, -0x1c(%rbp)
jg 0x13f1d8
movq -0x8(%rbp), %rax
addq $0xb6c, %rax            # imm = 0xB6C
movslq -0xc(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq -0x1c(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0xc(%rax)
je 0x13f0d3
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x13f0d1
movq -0x18(%rbp), %rax
movl 0x20(%rax), %eax
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
jmp 0x13f0d3
cmpl $0x0, -0x2c(%rbp)
jge 0x13f0e0
xorl %eax, %eax
movl %eax, -0x34(%rbp)
jmp 0x13f0fc
cmpl $0x3f, -0x2c(%rbp)
jle 0x13f0f0
movl $0x3f, %eax
movl %eax, -0x38(%rbp)
jmp 0x13f0f6
movl -0x2c(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jle 0x13f1b7
movl -0x2c(%rbp), %eax
movl %eax, -0x30(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jle 0x13f15d
movq -0x18(%rbp), %rax
cmpl $0x4, 0x8(%rax)
jle 0x13f131
movl -0x30(%rbp), %eax
sarl $0x2, %eax
movl %eax, -0x30(%rbp)
jmp 0x13f139
movl -0x30(%rbp), %eax
sarl %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
movq -0x18(%rbp), %rdx
movl $0x9, %ecx
subl 0x8(%rdx), %ecx
cmpl %ecx, %eax
jle 0x13f15b
movq -0x18(%rbp), %rcx
movl $0x9, %eax
subl 0x8(%rcx), %eax
movl %eax, -0x30(%rbp)
jmp 0x13f15d
cmpl $0x1, -0x30(%rbp)
jge 0x13f16a
movl $0x1, -0x30(%rbp)
movl -0x30(%rbp), %eax
movb %al, %cl
movq -0x28(%rbp), %rax
movb %cl, 0x1(%rax)
movl -0x2c(%rbp), %eax
shll %eax
addl -0x30(%rbp), %eax
movb %al, %cl
movq -0x28(%rbp), %rax
movb %cl, (%rax)
cmpl $0x28, -0x2c(%rbp)
jl 0x13f196
movl $0x2, %eax
movl %eax, -0x3c(%rbp)
jmp 0x13f1a9
movl -0x2c(%rbp), %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0xf, %edx
cmovgel %ecx, %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movb %al, %cl
movq -0x28(%rbp), %rax
movb %cl, 0x3(%rax)
jmp 0x13f1be
movq -0x28(%rbp), %rax
movb $0x0, (%rax)
movl -0x1c(%rbp), %eax
movb %al, %cl
movq -0x28(%rbp), %rax
movb %cl, 0x2(%rax)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x13f073
jmp 0x13f1da
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x13f01c
jmp 0x13f1ea
popq %rbp
retq
nopl (%rax)