user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<util_format_unsigned_encode_rgtc_ubyte>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x90,%rsp
  mov    %rdi,-0x78(%rbp)
  mov    %rsi,-0x80(%rbp)
  mov    %edx,-0x84(%rbp)
  mov    %ecx,-0x88(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x50(%rbp)
  movl   $0x0,-0x58(%rbp)
  movl   $0x0,-0x54(%rbp)
  movb   $0xff,-0x4b(%rbp)
  movb   $0x0,-0x4a(%rbp)
  movb   $0x0,-0x6e(%rbp)
  jmp    L469
L157:
  movb   $0x0,-0x6f(%rbp)
  jmp    L997
L326:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  test   %al,%al
  jne    L924
  movl   $0x1,-0x58(%rbp)
  jmp    L535
L924:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  cmp    $0xff,%al
  jne    L50
  movl   $0x1,-0x54(%rbp)
  jmp    L535
L50:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%edx
  movzbl -0x4a(%rbp),%eax
  cmp    %al,%dl
  jbe    L853
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  mov    %al,-0x4a(%rbp)
L853:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%edx
  movzbl -0x4b(%rbp),%eax
  cmp    %al,%dl
  jae    L535
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  mov    %al,-0x4b(%rbp)
L535:
  movzbl -0x6f(%rbp),%eax
  add    $0x1,%eax
  mov    %al,-0x6f(%rbp)
L997:
  movzbl -0x6f(%rbp),%eax
  cmp    %eax,-0x84(%rbp)
  jg     L326
  movzbl -0x6e(%rbp),%eax
  add    $0x1,%eax
  mov    %al,-0x6e(%rbp)
L469:
  movzbl -0x6e(%rbp),%eax
  cmp    %eax,-0x88(%rbp)
  jg     L157
  movzbl -0x4b(%rbp),%edx
  movzbl -0x4a(%rbp),%eax
  cmp    %al,%dl
  jbe    L262
  cmpl   $0x0,-0x58(%rbp)
  je     L475
  cmpl   $0x0,-0x54(%rbp)
  je     L475
L262:
  movzbl -0x4b(%rbp),%edx
  movzbl -0x4a(%rbp),%eax
  cmp    %al,%dl
  jne    L664
  cmpl   $0x0,-0x58(%rbp)
  jne    L664
  cmpl   $0x0,-0x54(%rbp)
  jne    L664
L475:
  mov    -0x78(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x78(%rbp)
  mov    -0x80(%rbp),%rdx
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  addq   $0x1,-0x78(%rbp)
  mov    -0x78(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x78(%rbp)
  movb   $0x0,(%rax)
  mov    -0x78(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x78(%rbp)
  movb   $0x0,(%rax)
  mov    -0x78(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x78(%rbp)
  movb   $0x0,(%rax)
  mov    -0x78(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x78(%rbp)
  movb   $0x0,(%rax)
  mov    -0x78(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x78(%rbp)
  movb   $0x0,(%rax)
  mov    -0x78(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x78(%rbp)
  movb   $0x0,(%rax)
  jmp    L867
L664:
  movl   $0x0,-0x64(%rbp)
  movl   $0xffffffff,-0x60(%rbp)
  movl   $0xffffffff,-0x5c(%rbp)
  cmpl   $0x0,-0x58(%rbp)
  je     L222
  movb   $0x0,-0x49(%rbp)
  jmp    L1130
L222:
  movzbl -0x4b(%rbp),%eax
  mov    %al,-0x49(%rbp)
L1130:
  cmpl   $0x0,-0x54(%rbp)
  je     L958
  movb   $0xff,-0x48(%rbp)
  jmp    L465
L958:
  movzbl -0x4a(%rbp),%eax
  mov    %al,-0x48(%rbp)
L465:
  movb   $0x0,-0x6d(%rbp)
  jmp    L956
L127:
  movzbl -0x49(%rbp),%eax
  movzbl %al,%eax
  movzbl -0x6d(%rbp),%edx
  add    %edx,%edx
  add    $0x1,%edx
  imul   %edx,%eax
  mov    %eax,%ecx
  movzbl -0x48(%rbp),%eax
  movzbl %al,%eax
  movzbl -0x6d(%rbp),%edx
  lea    (%rdx,%rdx,1),%esi
  mov    $0xd,%edx
  sub    %esi,%edx
  imul   %edx,%eax
  add    %ecx,%eax
  movslq %eax,%rdx
  imul   $0xffffffff92492493,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x3,%edx
  sar    $0x1f,%eax
  sub    %eax,%edx
  movzbl -0x6d(%rbp),%eax
  cltq
  mov    %dl,-0x47(%rbp,%rax,1)
  movzbl -0x6d(%rbp),%eax
  add    $0x1,%eax
  mov    %al,-0x6d(%rbp)
L956:
  cmpb   $0x6,-0x6d(%rbp)
  jbe    L127
  movb   $0x0,-0x6e(%rbp)
  jmp    L564
L682:
  movb   $0x0,-0x6f(%rbp)
  jmp    L432
L1057:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%edx
  movzbl -0x47(%rbp),%eax
  cmp    %al,%dl
  jbe    L624
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%edx
  movzbl -0x6f(%rbp),%eax
  add    %edx,%eax
  cltq
  movb   $0x0,-0x40(%rbp,%rax,1)
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%eax
  movzbl -0x48(%rbp),%edx
  movzbl %dl,%edx
  sub    %edx,%eax
  mov    %ax,-0x6a(%rbp)
  jmp    L277
L624:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%edx
  movzbl -0x46(%rbp),%eax
  cmp    %al,%dl
  jbe    L643
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%edx
  movzbl -0x6f(%rbp),%eax
  add    %edx,%eax
  cltq
  movb   $0x2,-0x40(%rbp,%rax,1)
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%ecx
  movzbl -0x48(%rbp),%eax
  movzbl %al,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  movzbl -0x49(%rbp),%eax
  movzbl %al,%eax
  add    %edx,%eax
  movslq %eax,%rdx
  imul   $0xffffffff92492493,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  sub    %edx,%eax
  add    %ecx,%eax
  mov    %ax,-0x6a(%rbp)
  jmp    L277
L643:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%edx
  movzbl -0x45(%rbp),%eax
  cmp    %al,%dl
  jbe    L80
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%edx
  movzbl -0x6f(%rbp),%eax
  add    %edx,%eax
  cltq
  movb   $0x3,-0x40(%rbp,%rax,1)
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%ecx
  movzbl -0x48(%rbp),%eax
  movzbl %al,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %eax,%edx
  movzbl -0x49(%rbp),%eax
  movzbl %al,%eax
  add    %eax,%eax
  add    %edx,%eax
  movslq %eax,%rdx
  imul   $0xffffffff92492493,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  sub    %edx,%eax
  add    %ecx,%eax
  mov    %ax,-0x6a(%rbp)
  jmp    L277
L80:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%edx
  movzbl -0x44(%rbp),%eax
  cmp    %al,%dl
  jbe    L407
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%edx
  movzbl -0x6f(%rbp),%eax
  add    %edx,%eax
  cltq
  movb   $0x4,-0x40(%rbp,%rax,1)
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%ecx
  movzbl -0x48(%rbp),%eax
  movzbl %al,%eax
  lea    0x0(,%rax,4),%esi
  movzbl -0x49(%rbp),%eax
  movzbl %al,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %esi,%eax
  movslq %eax,%rdx
  imul   $0xffffffff92492493,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  sub    %edx,%eax
  add    %ecx,%eax
  mov    %ax,-0x6a(%rbp)
  jmp    L277
L407:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%edx
  movzbl -0x43(%rbp),%eax
  cmp    %al,%dl
  jbe    L10
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%edx
  movzbl -0x6f(%rbp),%eax
  add    %edx,%eax
  cltq
  movb   $0x5,-0x40(%rbp,%rax,1)
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%ecx
  movzbl -0x48(%rbp),%eax
  movzbl %al,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %eax,%edx
  movzbl -0x49(%rbp),%eax
  movzbl %al,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  movslq %eax,%rdx
  imul   $0xffffffff92492493,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  sub    %edx,%eax
  add    %ecx,%eax
  mov    %ax,-0x6a(%rbp)
  jmp    L277
L10:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%edx
  movzbl -0x42(%rbp),%eax
  cmp    %al,%dl
  jbe    L283
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%edx
  movzbl -0x6f(%rbp),%eax
  add    %edx,%eax
  cltq
  movb   $0x6,-0x40(%rbp,%rax,1)
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%ecx
  movzbl -0x48(%rbp),%eax
  movzbl %al,%eax
  lea    (%rax,%rax,1),%esi
  movzbl -0x49(%rbp),%eax
  movzbl %al,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %esi,%eax
  movslq %eax,%rdx
  imul   $0xffffffff92492493,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  sub    %edx,%eax
  add    %ecx,%eax
  mov    %ax,-0x6a(%rbp)
  jmp    L277
L283:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%edx
  movzbl -0x41(%rbp),%eax
  cmp    %al,%dl
  jbe    L479
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%edx
  movzbl -0x6f(%rbp),%eax
  add    %edx,%eax
  cltq
  movb   $0x7,-0x40(%rbp,%rax,1)
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%ecx
  movzbl -0x48(%rbp),%eax
  movzbl %al,%esi
  movzbl -0x49(%rbp),%eax
  movzbl %al,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %eax,%eax
  add    %esi,%eax
  movslq %eax,%rdx
  imul   $0xffffffff92492493,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  sub    %edx,%eax
  add    %ecx,%eax
  mov    %ax,-0x6a(%rbp)
  jmp    L277
L479:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%edx
  movzbl -0x6f(%rbp),%eax
  add    %edx,%eax
  cltq
  movb   $0x1,-0x40(%rbp,%rax,1)
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%eax
  movzbl -0x49(%rbp),%edx
  movzbl %dl,%edx
  sub    %edx,%eax
  mov    %ax,-0x6a(%rbp)
L277:
  movswl -0x6a(%rbp),%edx
  movswl -0x6a(%rbp),%eax
  imul   %edx,%eax
  add    %eax,-0x64(%rbp)
  movzbl -0x6f(%rbp),%eax
  add    $0x1,%eax
  mov    %al,-0x6f(%rbp)
L432:
  movzbl -0x6f(%rbp),%eax
  cmp    %eax,-0x84(%rbp)
  jg     L1057
  movzbl -0x6e(%rbp),%eax
  add    $0x1,%eax
  mov    %al,-0x6e(%rbp)
L564:
  movzbl -0x6e(%rbp),%eax
  cmp    %eax,-0x88(%rbp)
  jg     L682
  cmpl   $0x1f,-0x64(%rbp)
  jbe    L531
  movl   $0x0,-0x60(%rbp)
  movb   $0x0,-0x6d(%rbp)
  jmp    L203
L1118:
  movzbl -0x4b(%rbp),%eax
  movzbl %al,%eax
  movzbl -0x6d(%rbp),%edx
  lea    (%rdx,%rdx,1),%ecx
  mov    $0x9,%edx
  sub    %ecx,%edx
  imul   %edx,%eax
  mov    %eax,%ecx
  movzbl -0x4a(%rbp),%eax
  movzbl %al,%eax
  movzbl -0x6d(%rbp),%edx
  add    %edx,%edx
  add    $0x1,%edx
  imul   %edx,%eax
  add    %ecx,%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  sub    %eax,%edx
  movzbl -0x6d(%rbp),%eax
  cltq
  mov    %dl,-0x47(%rbp,%rax,1)
  movzbl -0x6d(%rbp),%eax
  add    $0x1,%eax
  mov    %al,-0x6d(%rbp)
L203:
  cmpb   $0x4,-0x6d(%rbp)
  jbe    L1118
  movb   $0x0,-0x6e(%rbp)
  jmp    L998
L187:
  movb   $0x0,-0x6f(%rbp)
  jmp    L436
L42:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  test   %al,%al
  jne    L910
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%edx
  movzbl -0x6f(%rbp),%eax
  add    %edx,%eax
  cltq
  movb   $0x6,-0x30(%rbp,%rax,1)
  movw   $0x0,-0x6a(%rbp)
  jmp    L1157
L910:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  cmp    $0xff,%al
  jne    L972
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%edx
  movzbl -0x6f(%rbp),%eax
  add    %edx,%eax
  cltq
  movb   $0x7,-0x30(%rbp,%rax,1)
  movw   $0x0,-0x6a(%rbp)
  jmp    L1157
L972:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%edx
  movzbl -0x47(%rbp),%eax
  cmp    %al,%dl
  ja     L64
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%edx
  movzbl -0x6f(%rbp),%eax
  add    %edx,%eax
  cltq
  movb   $0x0,-0x30(%rbp,%rax,1)
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%eax
  movzbl -0x4b(%rbp),%edx
  movzbl %dl,%edx
  sub    %edx,%eax
  mov    %ax,-0x6a(%rbp)
  jmp    L1157
L64:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%edx
  movzbl -0x46(%rbp),%eax
  cmp    %al,%dl
  ja     L574
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%edx
  movzbl -0x6f(%rbp),%eax
  add    %edx,%eax
  cltq
  movb   $0x2,-0x30(%rbp,%rax,1)
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%ecx
  movzbl -0x4b(%rbp),%eax
  movzbl %al,%eax
  lea    0x0(,%rax,4),%edx
  movzbl -0x4a(%rbp),%eax
  movzbl %al,%eax
  add    %edx,%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    %edx
  sar    $0x1f,%eax
  sub    %edx,%eax
  add    %ecx,%eax
  mov    %ax,-0x6a(%rbp)
  jmp    L1157
L574:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%edx
  movzbl -0x45(%rbp),%eax
  cmp    %al,%dl
  ja     L684
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%edx
  movzbl -0x6f(%rbp),%eax
  add    %edx,%eax
  cltq
  movb   $0x3,-0x30(%rbp,%rax,1)
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%ecx
  movzbl -0x4b(%rbp),%eax
  movzbl %al,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %eax,%edx
  movzbl -0x4a(%rbp),%eax
  movzbl %al,%eax
  add    %eax,%eax
  add    %edx,%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    %edx
  sar    $0x1f,%eax
  sub    %edx,%eax
  add    %ecx,%eax
  mov    %ax,-0x6a(%rbp)
  jmp    L1157
L684:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%edx
  movzbl -0x44(%rbp),%eax
  cmp    %al,%dl
  ja     L502
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%edx
  movzbl -0x6f(%rbp),%eax
  add    %edx,%eax
  cltq
  movb   $0x4,-0x30(%rbp,%rax,1)
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%ecx
  movzbl -0x4b(%rbp),%eax
  movzbl %al,%eax
  lea    (%rax,%rax,1),%esi
  movzbl -0x4a(%rbp),%eax
  movzbl %al,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %esi,%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    %edx
  sar    $0x1f,%eax
  sub    %edx,%eax
  add    %ecx,%eax
  mov    %ax,-0x6a(%rbp)
  jmp    L1157
L502:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%edx
  movzbl -0x43(%rbp),%eax
  cmp    %al,%dl
  ja     L179
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%edx
  movzbl -0x6f(%rbp),%eax
  add    %edx,%eax
  cltq
  movb   $0x5,-0x30(%rbp,%rax,1)
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%ecx
  movzbl -0x4b(%rbp),%eax
  movzbl %al,%edx
  movzbl -0x4a(%rbp),%eax
  movzbl %al,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    %edx
  sar    $0x1f,%eax
  sub    %edx,%eax
  add    %ecx,%eax
  mov    %ax,-0x6a(%rbp)
  jmp    L1157
L179:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%edx
  movzbl -0x6f(%rbp),%eax
  add    %edx,%eax
  cltq
  movb   $0x1,-0x30(%rbp,%rax,1)
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%eax
  movzbl -0x4a(%rbp),%edx
  movzbl %dl,%edx
  sub    %edx,%eax
  mov    %ax,-0x6a(%rbp)
L1157:
  movswl -0x6a(%rbp),%edx
  movswl -0x6a(%rbp),%eax
  imul   %edx,%eax
  add    %eax,-0x60(%rbp)
  movzbl -0x6f(%rbp),%eax
  add    $0x1,%eax
  mov    %al,-0x6f(%rbp)
L436:
  movzbl -0x6f(%rbp),%eax
  cmp    %eax,-0x84(%rbp)
  jg     L42
  movzbl -0x6e(%rbp),%eax
  add    $0x1,%eax
  mov    %al,-0x6e(%rbp)
L998:
  movzbl -0x6e(%rbp),%eax
  cmp    %eax,-0x88(%rbp)
  jg     L187
  cmpl   $0x60,-0x60(%rbp)
  jbe    L531
  cmpl   $0x60,-0x64(%rbp)
  jbe    L531
  movw   $0x0,-0x68(%rbp)
  movw   $0x0,-0x66(%rbp)
  movb   $0x0,-0x6c(%rbp)
  movb   $0x0,-0x6b(%rbp)
  movw   $0xff,-0x50(%rbp)
  movw   $0x0,-0x4e(%rbp)
  movb   $0x0,-0x6e(%rbp)
  jmp    L1095
L301:
  movb   $0x0,-0x6f(%rbp)
  jmp    L599
L486:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%edx
  movzwl -0x4e(%rbp),%eax
  cwtl
  cmp    %eax,%edx
  jle    L1206
  movzbl -0x4a(%rbp),%eax
  movzbl %al,%eax
  movzbl -0x4b(%rbp),%edx
  movzbl %dl,%edx
  sub    %edx,%eax
  movslq %eax,%rdx
  imul   $0xffffffff92492493,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x4,%edx
  sar    $0x1f,%eax
  sub    %edx,%eax
  lea    0xfe(%rax),%ecx
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%eax
  cmp    %eax,%ecx
  jl     L1206
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%eax
  mov    %ax,-0x4e(%rbp)
L1206:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%edx
  movzwl -0x50(%rbp),%eax
  cwtl
  cmp    %eax,%edx
  jge    L33
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%edx
  movzbl -0x4a(%rbp),%eax
  movzbl %al,%eax
  movzbl -0x4b(%rbp),%ecx
  movzbl %cl,%ecx
  sub    %ecx,%eax
  movslq %eax,%rcx
  imul   $0xffffffff92492493,%rcx,%rcx
  shr    $0x20,%rcx
  add    %eax,%ecx
  sar    $0x4,%ecx
  sar    $0x1f,%eax
  mov    %eax,%esi
  mov    %ecx,%eax
  sub    %esi,%eax
  cmp    %eax,%edx
  jle    L33
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%eax
  mov    %ax,-0x50(%rbp)
L33:
  movzbl -0x6f(%rbp),%eax
  add    $0x1,%eax
  mov    %al,-0x6f(%rbp)
L599:
  movzbl -0x6f(%rbp),%eax
  cmp    %eax,-0x84(%rbp)
  jg     L486
  movzbl -0x6e(%rbp),%eax
  add    $0x1,%eax
  mov    %al,-0x6e(%rbp)
L1095:
  movzbl -0x6e(%rbp),%eax
  cmp    %eax,-0x88(%rbp)
  jg     L301
  movzwl -0x4e(%rbp),%edx
  movzwl -0x50(%rbp),%eax
  cmp    %ax,%dx
  jg     L799
  movw   $0x1,-0x50(%rbp)
  movw   $0xfe,-0x4e(%rbp)
L799:
  movb   $0x0,-0x6d(%rbp)
  jmp    L791
L215:
  movzwl -0x50(%rbp),%eax
  cwtl
  movzbl -0x6d(%rbp),%edx
  lea    (%rdx,%rdx,1),%ecx
  mov    $0x9,%edx
  sub    %ecx,%edx
  imul   %edx,%eax
  mov    %eax,%ecx
  movzwl -0x4e(%rbp),%eax
  cwtl
  movzbl -0x6d(%rbp),%edx
  add    %edx,%edx
  add    $0x1,%edx
  imul   %edx,%eax
  add    %ecx,%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  sub    %eax,%edx
  movzbl -0x6d(%rbp),%eax
  cltq
  mov    %dl,-0x47(%rbp,%rax,1)
  movzbl -0x6d(%rbp),%eax
  add    $0x1,%eax
  mov    %al,-0x6d(%rbp)
L791:
  cmpb   $0x4,-0x6d(%rbp)
  jbe    L215
  movb   $0x0,-0x6e(%rbp)
  jmp    L601
L325:
  movb   $0x0,-0x6f(%rbp)
  jmp    L90
L19:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%edx
  movzwl -0x50(%rbp),%eax
  mov    %eax,%ecx
  shr    $0xf,%cx
  add    %ecx,%eax
  sar    %ax
  cwtl
  cmp    %eax,%edx
  jle    L619
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%eax
  movzwl -0x4e(%rbp),%edx
  movswl %dx,%edx
  add    $0xff,%edx
  mov    %edx,%ecx
  shr    $0x1f,%ecx
  add    %ecx,%edx
  sar    %edx
  cmp    %edx,%eax
  jg     L619
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%edx
  movzbl -0x47(%rbp),%eax
  cmp    %al,%dl
  ja     L308
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%eax
  movzwl -0x50(%rbp),%edx
  mov    %edx,%ecx
  sub    %ecx,%eax
  mov    %eax,%edx
  movzwl -0x68(%rbp),%eax
  add    %edx,%eax
  mov    %ax,-0x68(%rbp)
  addb   $0x1,-0x6c(%rbp)
  jmp    L619
L308:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%edx
  movzbl -0x46(%rbp),%eax
  cmp    %al,%dl
  ja     L757
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%ecx
  movzwl -0x50(%rbp),%eax
  cwtl
  lea    0x0(,%rax,4),%edx
  movzwl -0x4e(%rbp),%eax
  cwtl
  add    %edx,%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    %edx
  sar    $0x1f,%eax
  sub    %edx,%eax
  lea    (%rcx,%rax,1),%edx
  movzwl -0x68(%rbp),%eax
  add    %edx,%eax
  mov    %ax,-0x68(%rbp)
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%ecx
  movzwl -0x50(%rbp),%eax
  cwtl
  lea    0x0(,%rax,4),%edx
  movzwl -0x4e(%rbp),%eax
  cwtl
  add    %edx,%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    %edx
  sar    $0x1f,%eax
  sub    %edx,%eax
  lea    (%rcx,%rax,1),%edx
  movzwl -0x66(%rbp),%eax
  add    %edx,%eax
  mov    %ax,-0x66(%rbp)
  addb   $0x1,-0x6c(%rbp)
  addb   $0x1,-0x6b(%rbp)
  jmp    L619
L757:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%edx
  movzbl -0x45(%rbp),%eax
  cmp    %al,%dl
  ja     L621
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%ecx
  movzwl -0x50(%rbp),%eax
  movswl %ax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %eax,%edx
  movzwl -0x4e(%rbp),%eax
  cwtl
  add    %eax,%eax
  add    %edx,%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    %edx
  sar    $0x1f,%eax
  sub    %edx,%eax
  lea    (%rcx,%rax,1),%edx
  movzwl -0x68(%rbp),%eax
  add    %edx,%eax
  mov    %ax,-0x68(%rbp)
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%ecx
  movzwl -0x50(%rbp),%eax
  movswl %ax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %eax,%edx
  movzwl -0x4e(%rbp),%eax
  cwtl
  add    %eax,%eax
  add    %edx,%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    %edx
  sar    $0x1f,%eax
  sub    %edx,%eax
  lea    (%rcx,%rax,1),%edx
  movzwl -0x66(%rbp),%eax
  add    %edx,%eax
  mov    %ax,-0x66(%rbp)
  addb   $0x1,-0x6c(%rbp)
  addb   $0x1,-0x6b(%rbp)
  jmp    L619
L621:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%edx
  movzbl -0x44(%rbp),%eax
  cmp    %al,%dl
  ja     L393
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%ecx
  movzwl -0x50(%rbp),%eax
  cwtl
  lea    (%rax,%rax,1),%esi
  movzwl -0x4e(%rbp),%eax
  movswl %ax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %esi,%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    %edx
  sar    $0x1f,%eax
  sub    %edx,%eax
  lea    (%rcx,%rax,1),%edx
  movzwl -0x68(%rbp),%eax
  add    %edx,%eax
  mov    %ax,-0x68(%rbp)
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%ecx
  movzwl -0x50(%rbp),%eax
  cwtl
  lea    (%rax,%rax,1),%esi
  movzwl -0x4e(%rbp),%eax
  movswl %ax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %esi,%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    %edx
  sar    $0x1f,%eax
  sub    %edx,%eax
  lea    (%rcx,%rax,1),%edx
  movzwl -0x66(%rbp),%eax
  add    %edx,%eax
  mov    %ax,-0x66(%rbp)
  addb   $0x1,-0x6c(%rbp)
  addb   $0x1,-0x6b(%rbp)
  jmp    L619
L393:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%edx
  movzbl -0x43(%rbp),%eax
  cmp    %al,%dl
  ja     L1191
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%ecx
  movzwl -0x50(%rbp),%eax
  movswl %ax,%edx
  movzwl -0x4e(%rbp),%eax
  cwtl
  shl    $0x2,%eax
  add    %edx,%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    %edx
  sar    $0x1f,%eax
  sub    %edx,%eax
  lea    (%rcx,%rax,1),%edx
  movzwl -0x68(%rbp),%eax
  add    %edx,%eax
  mov    %ax,-0x68(%rbp)
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%ecx
  movzwl -0x50(%rbp),%eax
  movswl %ax,%edx
  movzwl -0x4e(%rbp),%eax
  cwtl
  shl    $0x2,%eax
  add    %edx,%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    %edx
  sar    $0x1f,%eax
  sub    %edx,%eax
  lea    (%rcx,%rax,1),%edx
  movzwl -0x66(%rbp),%eax
  add    %edx,%eax
  mov    %ax,-0x66(%rbp)
  addb   $0x1,-0x6c(%rbp)
  addb   $0x1,-0x6b(%rbp)
  jmp    L619
L1191:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%eax
  movzwl -0x4e(%rbp),%edx
  mov    %edx,%ecx
  sub    %ecx,%eax
  mov    %eax,%edx
  movzwl -0x66(%rbp),%eax
  add    %edx,%eax
  mov    %ax,-0x66(%rbp)
  addb   $0x1,-0x6b(%rbp)
L619:
  movzbl -0x6f(%rbp),%eax
  add    $0x1,%eax
  mov    %al,-0x6f(%rbp)
L90:
  movzbl -0x6f(%rbp),%eax
  cmp    %eax,-0x84(%rbp)
  jg     L19
  movzbl -0x6e(%rbp),%eax
  add    $0x1,%eax
  mov    %al,-0x6e(%rbp)
L601:
  movzbl -0x6e(%rbp),%eax
  cmp    %eax,-0x88(%rbp)
  jg     L325
  cmpb   $0x0,-0x6c(%rbp)
  jne    L350
  movb   $0x1,-0x6c(%rbp)
L350:
  cmpb   $0x0,-0x6b(%rbp)
  jne    L538
  movb   $0x1,-0x6b(%rbp)
L538:
  movzwl -0x50(%rbp),%eax
  mov    %eax,%esi
  movswl -0x68(%rbp),%eax
  movzbl -0x6c(%rbp),%edi
  cltd
  idiv   %edi
  add    %esi,%eax
  mov    %ax,-0x50(%rbp)
  movzwl -0x50(%rbp),%eax
  test   %ax,%ax
  jns    L1178
  movw   $0x0,-0x50(%rbp)
L1178:
  movzwl -0x4e(%rbp),%eax
  mov    %eax,%esi
  movswl -0x66(%rbp),%eax
  movzbl -0x6b(%rbp),%edi
  cltd
  idiv   %edi
  add    %esi,%eax
  mov    %ax,-0x4e(%rbp)
  movzwl -0x4e(%rbp),%eax
  cmp    $0xff,%ax
  jle    L15
  movw   $0xff,-0x4e(%rbp)
L15:
  movl   $0x0,-0x5c(%rbp)
  movb   $0x0,-0x6d(%rbp)
  jmp    L35
L681:
  movzwl -0x50(%rbp),%eax
  cwtl
  movzbl -0x6d(%rbp),%edx
  lea    (%rdx,%rdx,1),%ecx
  mov    $0x9,%edx
  sub    %ecx,%edx
  imul   %edx,%eax
  mov    %eax,%ecx
  movzwl -0x4e(%rbp),%eax
  cwtl
  movzbl -0x6d(%rbp),%edx
  add    %edx,%edx
  add    $0x1,%edx
  imul   %edx,%eax
  add    %ecx,%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  sub    %eax,%edx
  movzbl -0x6d(%rbp),%eax
  cltq
  mov    %dl,-0x47(%rbp,%rax,1)
  movzbl -0x6d(%rbp),%eax
  add    $0x1,%eax
  mov    %al,-0x6d(%rbp)
L35:
  cmpb   $0x4,-0x6d(%rbp)
  jbe    L681
  movb   $0x0,-0x6e(%rbp)
  jmp    L166
L177:
  movb   $0x0,-0x6f(%rbp)
  jmp    L115
L993:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%edx
  movzwl -0x50(%rbp),%eax
  mov    %eax,%ecx
  shr    $0xf,%cx
  add    %ecx,%eax
  sar    %ax
  cwtl
  cmp    %eax,%edx
  jg     L243
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%edx
  movzbl -0x6f(%rbp),%eax
  add    %edx,%eax
  cltq
  movb   $0x6,-0x20(%rbp,%rax,1)
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%eax
  mov    %ax,-0x6a(%rbp)
  jmp    L467
L243:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%eax
  movzwl -0x4e(%rbp),%edx
  movswl %dx,%edx
  add    $0xff,%edx
  mov    %edx,%ecx
  shr    $0x1f,%ecx
  add    %ecx,%edx
  sar    %edx
  cmp    %edx,%eax
  jle    L39
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%edx
  movzbl -0x6f(%rbp),%eax
  add    %edx,%eax
  cltq
  movb   $0x7,-0x20(%rbp,%rax,1)
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%edx
  mov    $0xff,%eax
  sub    %edx,%eax
  mov    %ax,-0x6a(%rbp)
  jmp    L467
L39:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%edx
  movzbl -0x47(%rbp),%eax
  cmp    %al,%dl
  ja     L1125
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%edx
  movzbl -0x6f(%rbp),%eax
  add    %edx,%eax
  cltq
  movb   $0x0,-0x20(%rbp,%rax,1)
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%eax
  movzwl -0x50(%rbp),%edx
  sub    %edx,%eax
  mov    %ax,-0x6a(%rbp)
  jmp    L467
L1125:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%edx
  movzbl -0x46(%rbp),%eax
  cmp    %al,%dl
  ja     L380
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%edx
  movzbl -0x6f(%rbp),%eax
  add    %edx,%eax
  cltq
  movb   $0x2,-0x20(%rbp,%rax,1)
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%ecx
  movzwl -0x50(%rbp),%eax
  cwtl
  lea    0x0(,%rax,4),%edx
  movzwl -0x4e(%rbp),%eax
  cwtl
  add    %edx,%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    %edx
  sar    $0x1f,%eax
  sub    %edx,%eax
  add    %ecx,%eax
  mov    %ax,-0x6a(%rbp)
  jmp    L467
L380:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%edx
  movzbl -0x45(%rbp),%eax
  cmp    %al,%dl
  ja     L798
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%edx
  movzbl -0x6f(%rbp),%eax
  add    %edx,%eax
  cltq
  movb   $0x3,-0x20(%rbp,%rax,1)
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%ecx
  movzwl -0x50(%rbp),%eax
  movswl %ax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %eax,%edx
  movzwl -0x4e(%rbp),%eax
  cwtl
  add    %eax,%eax
  add    %edx,%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    %edx
  sar    $0x1f,%eax
  sub    %edx,%eax
  add    %ecx,%eax
  mov    %ax,-0x6a(%rbp)
  jmp    L467
L798:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%edx
  movzbl -0x44(%rbp),%eax
  cmp    %al,%dl
  ja     L1194
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%edx
  movzbl -0x6f(%rbp),%eax
  add    %edx,%eax
  cltq
  movb   $0x4,-0x20(%rbp,%rax,1)
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%ecx
  movzwl -0x50(%rbp),%eax
  cwtl
  lea    (%rax,%rax,1),%esi
  movzwl -0x4e(%rbp),%eax
  movswl %ax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %esi,%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    %edx
  sar    $0x1f,%eax
  sub    %edx,%eax
  add    %ecx,%eax
  mov    %ax,-0x6a(%rbp)
  jmp    L467
L1194:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%edx
  movzbl -0x43(%rbp),%eax
  cmp    %al,%dl
  ja     L403
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%edx
  movzbl -0x6f(%rbp),%eax
  add    %edx,%eax
  cltq
  movb   $0x5,-0x20(%rbp,%rax,1)
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%ecx
  movzwl -0x50(%rbp),%eax
  movswl %ax,%edx
  movzwl -0x4e(%rbp),%eax
  cwtl
  shl    $0x2,%eax
  add    %edx,%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    %edx
  sar    $0x1f,%eax
  sub    %edx,%eax
  add    %ecx,%eax
  mov    %ax,-0x6a(%rbp)
  jmp    L467
L403:
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%edx
  movzbl -0x6f(%rbp),%eax
  add    %edx,%eax
  cltq
  movb   $0x1,-0x20(%rbp,%rax,1)
  movzbl -0x6e(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x6f(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  movzbl %al,%eax
  movzwl -0x4e(%rbp),%edx
  sub    %edx,%eax
  mov    %ax,-0x6a(%rbp)
L467:
  movswl -0x6a(%rbp),%edx
  movswl -0x6a(%rbp),%eax
  imul   %edx,%eax
  add    %eax,-0x5c(%rbp)
  movzbl -0x6f(%rbp),%eax
  add    $0x1,%eax
  mov    %al,-0x6f(%rbp)
L115:
  movzbl -0x6f(%rbp),%eax
  cmp    %eax,-0x84(%rbp)
  jg     L993
  movzbl -0x6e(%rbp),%eax
  add    $0x1,%eax
  mov    %al,-0x6e(%rbp)
L166:
  movzbl -0x6e(%rbp),%eax
  cmp    %eax,-0x88(%rbp)
  jg     L177
L531:
  mov    -0x64(%rbp),%eax
  cmp    -0x60(%rbp),%eax
  ja     L649
  mov    -0x64(%rbp),%eax
  cmp    -0x5c(%rbp),%eax
  ja     L649
  movzbl -0x49(%rbp),%eax
  movzbl %al,%edx
  movzbl -0x48(%rbp),%eax
  movzbl %al,%esi
  lea    -0x40(%rbp),%rcx
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <util_format_unsigned_write_rgtc_encoded_channel@plt>
  jmp    L867
L649:
  mov    -0x60(%rbp),%eax
  cmp    -0x5c(%rbp),%eax
  ja     L1102
  movzbl -0x4a(%rbp),%eax
  movzbl %al,%edx
  movzbl -0x4b(%rbp),%eax
  movzbl %al,%esi
  lea    -0x30(%rbp),%rcx
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <util_format_unsigned_write_rgtc_encoded_channel@plt>
  jmp    L867
L1102:
  movzwl -0x4e(%rbp),%eax
  movzbl %al,%edx
  movzwl -0x50(%rbp),%eax
  movzbl %al,%esi
  lea    -0x20(%rbp),%rcx
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <util_format_unsigned_write_rgtc_encoded_channel@plt>
L867:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L944
  call   <__stack_chk_fail@plt>
L944:
  leave
  ret
```

assistant: ```c
void util_format_unsigned_encode_rgtc_ubyte(unsigned char *blkaddr, unsigned char srccolors[4][4], int numxpixels, int numypixels) {
  unsigned char alphabase[2], alphause[2];
  short alphatest[2] = {0};
  unsigned int alphablockerror1, alphablockerror2, alphablockerror3;
  unsigned char i, j, aindex, acutValues[7];
  unsigned char alphaenc1[16], alphaenc2[16], alphaenc3[16];
  int alphaabsmin = 0, alphaabsmax = 0;
  short alphadist;
  alphabase[0] = 0xff;
  alphabase[1] = 0;
  for (j = 0; j < numypixels; j++) {
    for (i = 0; i < numxpixels; i++) {
      if (srccolors[j][i] == 0)
        alphaabsmin = 1;
      else if (srccolors[j][i] == 0xff)
        alphaabsmax = 1;
      else {
        if (srccolors[j][i] > alphabase[1])
          alphabase[1] = srccolors[j][i];
        if (srccolors[j][i] < alphabase[0])
          alphabase[0] = srccolors[j][i];
      }
    }
  }
  if (((alphabase[0] > alphabase[1]) && !(alphaabsmin && alphaabsmax)) || (alphabase[0] == alphabase[1] && !alphaabsmin && !alphaabsmax)) {
    *blkaddr++ = srccolors[0][0];
    blkaddr++;
    *blkaddr++ = 0;
    *blkaddr++ = 0;
    *blkaddr++ = 0;
    *blkaddr++ = 0;
    *blkaddr++ = 0;
    *blkaddr++ = 0;
    return;
  }
  alphablockerror1 = 0x0;
  alphablockerror2 = 0xffffffff;
  alphablockerror3 = 0xffffffff;
  if (alphaabsmin)
    alphause[0] = 0;
  else
    alphause[0] = alphabase[0];
  if (alphaabsmax)
    alphause[1] = 0xff;
  else
    alphause[1] = alphabase[1];
  for (aindex = 0; aindex < 7; aindex++) {
    acutValues[aindex] = (alphause[0] * (2 * aindex + 1) + alphause[1] * (14 - (2 * aindex + 1))) / 14;
  }
  for (j = 0; j < numypixels; j++) {
    for (i = 0; i < numxpixels; i++) {
      if (srccolors[j][i] > acutValues[0]) {
        alphaenc1[4 * j + i] = 0;
        alphadist = srccolors[j][i] - alphause[1];
      } else if (srccolors[j][i] > acutValues[1]) {
        alphaenc1[4 * j + i] = 2;
        alphadist = srccolors[j][i] - (alphause[1] * 6 + alphause[0] * 1) / 7;
      } else if (srccolors[j][i] > acutValues[2]) {
        alphaenc1[4 * j + i] = 3;
        alphadist = srccolors[j][i] - (alphause[1] * 5 + alphause[0] * 2) / 7;
      } else if (srccolors[j][i] > acutValues[3]) {
        alphaenc1[4 * j + i] = 4;
        alphadist = srccolors[j][i] - (alphause[1] * 4 + alphause[0] * 3) / 7;
      } else if (srccolors[j][i] > acutValues[4]) {
        alphaenc1[4 * j + i] = 5;
        alphadist = srccolors[j][i] - (alphause[1] * 3 + alphause[0] * 4) / 7;
      } else if (srccolors[j][i] > acutValues[5]) {
        alphaenc1[4 * j + i] = 6;
        alphadist = srccolors[j][i] - (alphause[1] * 2 + alphause[0] * 5) / 7;
      } else if (srccolors[j][i] > acutValues[6]) {
        alphaenc1[4 * j + i] = 7;
        alphadist = srccolors[j][i] - (alphause[1] * 1 + alphause[0] * 6) / 7;
      } else {
        alphaenc1[4 * j + i] = 1;
        alphadist = srccolors[j][i] - alphause[0];
      }
      alphablockerror1 += alphadist * alphadist;
    }
  }
  if (alphablockerror1 >= 32) {
    alphablockerror2 = 0;
    for (aindex = 0; aindex < 5; aindex++) {
      acutValues[aindex] = (alphabase[0] * (10 - (2 * aindex + 1)) + alphabase[1] * (2 * aindex + 1)) / 10;
    }
    for (j = 0; j < numypixels; j++) {
      for (i = 0; i < numxpixels; i++) {
        if (srccolors[j][i] == 0) {
          alphaenc2[4 * j + i] = 6;
          alphadist = 0;
        } else if (srccolors[j][i] == 0xff) {
          alphaenc2[4 * j + i] = 7;
          alphadist = 0;
        } else if (srccolors[j][i] <= acutValues[0]) {
          alphaenc2[4 * j + i] = 0;
          alphadist = srccolors[j][i] - alphabase[0];
        } else if (srccolors[j][i] <= acutValues[1]) {
          alphaenc2[4 * j + i] = 2;
          alphadist = srccolors[j][i] - (alphabase[0] * 4 + alphabase[1] * 1) / 5;
        } else if (srccolors[j][i] <= acutValues[2]) {
          alphaenc2[4 * j + i] = 3;
          alphadist = srccolors[j][i] - (alphabase[0] * 3 + alphabase[1] * 2) / 5;
        } else if (srccolors[j][i] <= acutValues[3]) {
          alphaenc2[4 * j + i] = 4;
          alphadist = srccolors[j][i] - (alphabase[0] * 2 + alphabase[1] * 3) / 5;
        } else if (srccolors[j][i] <= acutValues[4]) {
          alphaenc2[4 * j + i] = 5;
          alphadist = srccolors[j][i] - (alphabase[0] * 1 + alphabase[1] * 4) / 5;
        } else {
          alphaenc2[4 * j + i] = 1;
          alphadist = srccolors[j][i] - alphabase[1];
        }
        alphablockerror2 += alphadist * alphadist;
      }
    }
    if ((alphablockerror2 > 96) && (alphablockerror1 > 96)) {
      short blockerrlin1 = 0;
      short blockerrlin2 = 0;
      unsigned char nralphainrangelow = 0;
      unsigned char nralphainrangehigh = 0;
      alphatest[0] = 0xff;
      alphatest[1] = 0;
      for (j = 0; j < numypixels; j++) {
        for (i = 0; i < numxpixels; i++) {
          if ((srccolors[j][i] > alphatest[1]) && (srccolors[j][i] < (0xff - (alphabase[1] - alphabase[0]) / 28)))
            alphatest[1] = srccolors[j][i];
          if ((srccolors[j][i] < alphatest[0]) && (srccolors[j][i] > (alphabase[1] - alphabase[0]) / 28))
            alphatest[0] = srccolors[j][i];
        }
      }
      if (alphatest[1] <= alphatest[0]) {
        alphatest[0] = 0 + 1;
        alphatest[1] = 0xff - 1;
      }
      for (aindex = 0; aindex < 5; aindex++) {
        acutValues[aindex] = (alphatest[0] * (10 - (2 * aindex + 1)) + alphatest[1] * (2 * aindex + 1)) / 10;
      }
      for (j = 0; j < numypixels; j++) {
        for (i = 0; i < numxpixels; i++) {
          if (srccolors[j][i] <= alphatest[0] / 2) {
          } else if (srccolors[j][i] > ((0xff + alphatest[1]) / 2)) {
          } else if (srccolors[j][i] <= acutValues[0]) {
            blockerrlin1 += (srccolors[j][i] - alphatest[0]);
            nralphainrangelow += 1;
          } else if (srccolors[j][i] <= acutValues[1]) {
            blockerrlin1 += (srccolors[j][i] - (alphatest[0] * 4 + alphatest[1] * 1) / 5);
            blockerrlin2 += (srccolors[j][i] - (alphatest[0] * 4 + alphatest[1] * 1) / 5);
            nralphainrangelow += 1;
            nralphainrangehigh += 1;
          } else if (srccolors[j][i] <= acutValues[2]) {
            blockerrlin1 += (srccolors[j][i] - (alphatest[0] * 3 + alphatest[1] * 2) / 5);
            blockerrlin2 += (srccolors[j][i] - (alphatest[0] * 3 + alphatest[1] * 2) / 5);
            nralphainrangelow += 1;
            nralphainrangehigh += 1;
          } else if (srccolors[j][i] <= acutValues[3]) {
            blockerrlin1 += (srccolors[j][i] - (alphatest[0] * 2 + alphatest[1] * 3) / 5);
            blockerrlin2 += (srccolors[j][i] - (alphatest[0] * 2 + alphatest[1] * 3) / 5);
            nralphainrangelow += 1;
            nralphainrangehigh += 1;
          } else if (srccolors[j][i] <= acutValues[4]) {
            blockerrlin1 += (srccolors[j][i] - (alphatest[0] * 1 + alphatest[1] * 4) / 5);
            blockerrlin2 += (srccolors[j][i] - (alphatest[0] * 1 + alphatest[1] * 4) / 5);
            nralphainrangelow += 1;
            nralphainrangehigh += 1;
          } else {
            blockerrlin2 += (srccolors[j][i] - alphatest[1]);
            nralphainrangehigh += 1;
          }
        }
      }
      if (nralphainrangelow == 0)
        nralphainrangelow = 1;
      if (nralphainrangehigh == 0)
        nralphainrangehigh = 1;
      alphatest[0] = alphatest[0] + (blockerrlin1 / nralphainrangelow);
      if (alphatest[0] < 0) {
        alphatest[0] = 0;
      }
      alphatest[1] = alphatest[1] + (blockerrlin2 / nralphainrangehigh);
      if (alphatest[1] > 0xff) {
        alphatest[1] = 0xff;
      }
      alphablockerror3 = 0;
      for (aindex = 0; aindex < 5; aindex++) {
        acutValues[aindex] = (alphatest[0] * (10 - (2 * aindex + 1)) + alphatest[1] * (2 * aindex + 1)) / 10;
      }
      for (j = 0; j < numypixels; j++) {
        for (i = 0; i < numxpixels; i++) {
          if (srccolors[j][i] <= alphatest[0] / 2) {
            alphaenc3[4 * j + i] = 6;
            alphadist = srccolors[j][i];
          } else if (srccolors[j][i] > ((0xff + alphatest[1]) / 2)) {
            alphaenc3[4 * j + i] = 7;
            alphadist = 0xff - srccolors[j][i];
          } else if (srccolors[j][i] <= acutValues[0]) {
            alphaenc3[4 * j + i] = 0;
            alphadist = srccolors[j][i] - alphatest[0];
          } else if (srccolors[j][i] <= acutValues[1]) {
            alphaenc3[4 * j + i] = 2;
            alphadist = srccolors[j][i] - (alphatest[0] * 4 + alphatest[1] * 1) / 5;
          } else if (srccolors[j][i] <= acutValues[2]) {
            alphaenc3[4 * j + i] = 3;
            alphadist = srccolors[j][i] - (alphatest[0] * 3 + alphatest[1] * 2) / 5;
          } else if (srccolors[j][i] <= acutValues[3]) {
            alphaenc3[4 * j + i] = 4;
            alphadist = srccolors[j][i] - (alphatest[0] * 2 + alphatest[1] * 3) / 5;
          } else if (srccolors[j][i] <= acutValues[4]) {
            alphaenc3[4 * j + i] = 5;
            alphadist = srccolors[j][i] - (alphatest[0] * 1 + alphatest[1] * 4) / 5;
          } else {
            alphaenc3[4 * j + i] = 1;
            alphadist = srccolors[j][i] - alphatest[1];
          }
          alphablockerror3 += alphadist * alphadist;
        }
      }
    }
  }
  if ((alphablockerror1 <= alphablockerror2) && (alphablockerror1 <= alphablockerror3)) {
    util_format_unsigned_write_rgtc_encoded_channel(blkaddr, alphause[1], alphause[0], alphaenc1);
  } else if (alphablockerror2 <= alphablockerror3) {
    util_format_unsigned_write_rgtc_encoded_channel(blkaddr, alphabase[0], alphabase[1], alphaenc2);
  } else {
    util_format_unsigned_write_rgtc_encoded_channel(blkaddr, (unsigned char)alphatest[0], (unsigned char)alphatest[1], alphaenc3);
  }
}
```