user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<util_format_unsigned_encode_rgtc_ubyte>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x98,%rsp
  mov    %rdi,0x28(%rsp)
  mov    %rsi,0x8(%rsp)
  mov    %ecx,0x10(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x88(%rsp)
  xor    %eax,%eax
  test   %ecx,%ecx
  jle    L54
  mov    0x8(%rsp),%rbp
  mov    %edx,%esi
  mov    %ecx,%ebx
  xor    %r8d,%r8d
  xor    %edi,%edi
  xor    %r9d,%r9d
  mov    $0xffffffff,%r10d
  xor    %r11d,%r11d
  nopl   0x0(%rax,%rax,1)
L998:
  test   %esi,%esi
  jle    L720
  movzbl %r9b,%eax
  xor    %edx,%edx
  lea    0x0(%rbp,%rax,4),%rcx
  xor    %eax,%eax
  jmp    L155
  nopl   0x0(%rax,%rax,1)
L867:
  cmp    $0xff,%al
  je     L369
  cmp    %al,%r11b
  cmovb  %eax,%r11d
  cmp    %al,%r10b
  cmova  %eax,%r10d
L621:
  add    $0x1,%edx
  movzbl %dl,%eax
  cmp    %eax,%esi
  jle    L720
L155:
  movzbl (%rcx,%rax,1),%eax
  test   %al,%al
  jne    L867
  add    $0x1,%edx
  mov    $0x1,%edi
  movzbl %dl,%eax
  cmp    %eax,%esi
  jg     L155
L720:
  add    $0x1,%r9d
  movzbl %r9b,%eax
  cmp    %ebx,%eax
  jl     L998
  cmp    %r11b,%r10b
  ja     L526
  jne    L931
  mov    %r8d,%eax
  or     %edi,%eax
  je     L54
L931:
  test   %edi,%edi
  jne    L57
  movzbl %r10b,%eax
  mov    %r10b,0x38(%rsp)
  mov    %eax,0x20(%rsp)
L719:
  test   %r8d,%r8d
  jne    L98
  movzbl %r11b,%eax
  mov    %r11b,0x16(%rsp)
  mov    %eax,0x18(%rsp)
  jmp    L148
  nopw   0x0(%rax,%rax,1)
L369:
  mov    $0x1,%r8d
  jmp    L621
L526:
  xor    $0x1,%edi
  xor    $0x1,%r8d
  or     %r8b,%dil
  jne    L54
  movl   $0x0,0x20(%rsp)
  movb   $0x0,0x38(%rsp)
  movl   $0xff,0x18(%rsp)
  movb   $0xff,0x16(%rsp)
L148:
  mov    0x18(%rsp),%edi
  mov    0x20(%rsp),%r9d
  mov    $0x92492493,%r8d
  lea    (%rdi,%rdi,1),%r13d
  lea    0x0(,%rdi,4),%r15d
  lea    0x0(%r13,%rdi,1),%ecx
  lea    (%r15,%rdi,1),%ebp
  lea    0x0(,%r9,4),%r14d
  lea    (%rdi,%rbp,2),%r12d
  lea    (%rdi,%rcx,4),%ebx
  lea    (%rdi,%rdi,8),%edx
  lea    (%r14,%r9,1),%edi
  lea    (%r9,%r9,1),%eax
  add    %r9d,%ebx
  add    %edi,%edx
  mov    %eax,0x40(%rsp)
  add    %r9d,%eax
  shr    %ebx
  shr    %edx
  imul   %r8,%rbx
  add    %eax,%r12d
  imul   %r8,%rdx
  shr    %r12d
  imul   %r8,%r12
  shr    $0x22,%rbx
  shr    $0x22,%rdx
  mov    %dl,0x3c(%rsp)
  mov    0x18(%rsp),%edx
  shr    $0x22,%r12
  add    %r9d,%edx
  mov    %edx,%r9d
  lea    0x0(,%rdx,8),%edx
  sub    %r9d,%edx
  mov    0x20(%rsp),%r9d
  shr    %edx
  imul   %r8,%rdx
  shr    $0x22,%rdx
  mov    %dl,0x15(%rsp)
  lea    (%r9,%r9,8),%edx
  add    %ebp,%edx
  shr    %edx
  imul   %r8,%rdx
  shr    $0x22,%rdx
  mov    %dl,0x1e(%rsp)
  lea    (%r9,%rdi,2),%edx
  add    %ecx,%edx
  shr    %edx
  imul   %r8,%rdx
  shr    $0x22,%rdx
  mov    %dl,0x24(%rsp)
  lea    (%r9,%rax,4),%edx
  add    0x18(%rsp),%edx
  shr    %edx
  imul   %r8,%rdx
  shr    $0x22,%rdx
  mov    %dl,0x30(%rsp)
  mov    0x18(%rsp),%edx
  lea    (%rdx,%rax,2),%edx
  movslq %edx,%r8
  imul   $0xffffffff92492493,%r8,%r8
  shr    $0x20,%r8
  add    %r8d,%edx
  add    %r13d,%edi
  add    %r15d,%eax
  sar    $0x2,%edx
  neg    %edx
  mov    %dx,0x44(%rsp)
  movslq %edi,%rdx
  imul   $0xffffffff92492493,%rdx,%rdx
  shr    $0x20,%rdx
  add    %edx,%edi
  lea    (%r14,%rcx,1),%edx
  xor    %r14d,%r14d
  sar    $0x2,%edi
  neg    %edi
  mov    %di,0x34(%rsp)
  movslq %edx,%rdi
  imul   $0xffffffff92492493,%rdi,%rdi
  shr    $0x20,%rdi
  add    %edi,%edx
  sar    $0x2,%edx
  mov    %edx,%edi
  movslq %eax,%rdx
  imul   $0xffffffff92492493,%rdx,%rdx
  neg    %edi
  mov    %di,0x4c(%rsp)
  shr    $0x20,%rdx
  add    %edx,%eax
  sar    $0x2,%eax
  mov    %eax,%edi
  mov    0x40(%rsp),%eax
  mov    %r11b,0x40(%rsp)
  neg    %edi
  add    %ebp,%eax
  movzbl 0x3c(%rsp),%ebp
  mov    %di,0x1c(%rsp)
  xor    %edi,%edi
  movslq %eax,%rdx
  imul   $0xffffffff92492493,%rdx,%rdx
  shr    $0x20,%rdx
  add    %edx,%eax
  sar    $0x2,%eax
  mov    %eax,%r13d
  lea    (%r9,%rcx,2),%eax
  movslq %eax,%rdx
  neg    %r13d
  imul   $0xffffffff92492493,%rdx,%rdx
  shr    $0x20,%rdx
  lea    (%rax,%rdx,1),%r15d
  movzbl 0x38(%rsp),%eax
  mov    %r10b,0x38(%rsp)
  sar    $0x2,%r15d
  mov    %ax,0x48(%rsp)
  neg    %r15d
  xor    %r9d,%r9d
  nopw   0x0(%rax,%rax,1)
L527:
  test   %esi,%esi
  jle    L362
  mov    0x8(%rsp),%rcx
  movzbl %r14b,%eax
  shl    $0x2,%r9d
  xor    %edx,%edx
  movzbl 0x16(%rsp),%r11d
  lea    (%rcx,%rax,4),%r10
  xor    %ecx,%ecx
  jmp    L294
  nopl   (%rax)
L485:
  sub    %r11d,%eax
  xor    %r8d,%r8d
L592:
  cwtl
  movslq %edx,%rdx
  add    $0x1,%ecx
  imul   %eax,%eax
  mov    %r8b,0x50(%rsp,%rdx,1)
  movzbl %cl,%edx
  add    %eax,%edi
  cmp    %esi,%edx
  jge    L362
L294:
  movslq %edx,%rax
  add    %r9d,%edx
  movzbl (%r10,%rax,1),%eax
  cmp    %bl,%al
  ja     L485
  cmp    %r12b,%al
  jbe    L541
  add    %r15d,%eax
  mov    $0x2,%r8d
  jmp    L592
L54:
  mov    0x8(%rsp),%rax
  mov    0x28(%rsp),%rbx
  xor    %r11d,%r11d
  movzbl (%rax),%eax
  movl   $0x0,0x2(%rbx)
  mov    %r11w,0x6(%rbx)
  mov    %al,(%rbx)
L480:
  mov    0x88(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L496
  add    $0x98,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L541:
  cmp    %bpl,%al
  jbe    L991
  add    %r13d,%eax
  mov    $0x3,%r8d
  jmp    L592
  nopl   0x0(%rax,%rax,1)
L991:
  cmp    0x15(%rsp),%al
  jbe    L473
  add    0x1c(%rsp),%ax
  mov    $0x4,%r8d
  jmp    L592
  nopw   0x0(%rax,%rax,1)
L362:
  add    $0x1,%r14d
  movzbl %r14b,%r9d
  cmp    0x10(%rsp),%r9d
  jl     L527
  movzbl 0x38(%rsp),%r10d
  movzbl 0x40(%rsp),%r11d
  cmp    $0x1f,%edi
  jbe    L816
  movzbl %r10b,%r14d
  movzbl %r11b,%r15d
  mov    $0xcccccccd,%r8d
  mov    %edi,0x34(%rsp)
  lea    (%r15,%r15,1),%edx
  lea    (%r14,%r14,1),%r12d
  mov    %r15d,0x30(%rsp)
  mov    0x8(%rsp),%rdi
  lea    (%rdx,%r15,1),%ecx
  lea    (%r12,%r14,1),%ebp
  mov    %r14d,0x24(%rsp)
  lea    0x0(,%r14,8),%eax
  lea    (%rax,%r14,1),%ebx
  sub    %r14d,%eax
  add    %ecx,%eax
  add    %r15d,%ebx
  mov    %eax,%eax
  imul   %r8,%rbx
  imul   %r8,%rax
  shr    $0x23,%rbx
  shr    $0x23,%rax
  mov    %eax,%r13d
  mov    %r14d,%eax
  add    %r15d,%eax
  lea    (%rax,%rax,4),%eax
  imul   %r8,%rax
  shr    $0x23,%rax
  mov    %al,0x15(%rsp)
  lea    0x0(,%r15,8),%eax
  mov    %eax,%r9d
  add    %r15d,%eax
  add    %r14d,%eax
  sub    %r15d,%r9d
  imul   %r8,%rax
  add    %ebp,%r9d
  mov    %r9d,%r9d
  imul   %r8,%r9
  shr    $0x23,%rax
  mov    %al,0x1e(%rsp)
  lea    (%r14,%r15,4),%eax
  cltq
  shr    $0x23,%r9
  imul   $0x66666667,%rax,%rax
  mov    %r9b,0x1c(%rsp)
  sar    $0x21,%rax
  neg    %eax
  mov    %ax,0x38(%rsp)
  lea    (%rcx,%r12,1),%eax
  cltq
  imul   $0x66666667,%rax,%rax
  sar    $0x21,%rax
  neg    %eax
  mov    %ax,0x4c(%rsp)
  lea    (%rdx,%rbp,1),%eax
  xor    %ebp,%ebp
  cltq
  imul   $0x66666667,%rax,%rax
  sar    $0x21,%rax
  neg    %eax
  mov    %ax,0x16(%rsp)
  lea    (%r15,%r14,4),%eax
  xor    %r14d,%r14d
  cltq
  imul   $0x66666667,%rax,%rax
  sar    $0x21,%rax
  mov    %eax,%r15d
  movzbl %r11b,%eax
  mov    %ax,0x3c(%rsp)
  neg    %r15d
  xor    %r9d,%r9d
  nopl   0x0(%rax)
L164:
  test   %esi,%esi
  jle    L203
  movzbl %bpl,%eax
  shl    $0x2,%r9d
  xor    %ecx,%ecx
  movzbl %r10b,%r12d
  lea    (%rdi,%rax,4),%r11
  xor    %eax,%eax
  jmp    L653
  cs nopw 0x0(%rax,%rax,1)
L205:
  sub    %r12d,%r8d
  movswl %r8w,%r8d
  imul   %r8d,%r8d
  add    %r8d,%r14d
  xor    %r8d,%r8d
  nopl   0x0(%rax)
L580:
  cltq
  add    $0x1,%ecx
  mov    %r8b,0x60(%rsp,%rax,1)
  movzbl %cl,%eax
  cmp    %esi,%eax
  jge    L203
L653:
  movslq %eax,%rdx
  mov    $0x6,%r8d
  add    %r9d,%eax
  movzbl (%r11,%rdx,1),%edx
  test   %dl,%dl
  je     L580
  mov    $0x7,%r8d
  cmp    $0xff,%dl
  je     L580
  movzbl %dl,%r8d
  cmp    %bl,%dl
  jbe    L205
  cmp    %r13b,%dl
  ja     L647
  add    %r15d,%r8d
  movswl %r8w,%r8d
  imul   %r8d,%r8d
  add    %r8d,%r14d
  mov    $0x2,%r8d
  jmp    L580
L473:
  cmp    0x1e(%rsp),%al
  jbe    L785
  add    0x4c(%rsp),%ax
  mov    $0x5,%r8d
  jmp    L592
  nopw   0x0(%rax,%rax,1)
L203:
  add    $0x1,%ebp
  movzbl %bpl,%r9d
  cmp    0x10(%rsp),%r9d
  jl     L164
  mov    0x34(%rsp),%edi
  cmp    $0x60,%r14d
  jbe    L516
  cmp    $0x60,%edi
  jbe    L516
  mov    0x30(%rsp),%edx
  sub    0x24(%rsp),%edx
  xor    %r10d,%r10d
  xor    %r12d,%r12d
  movslq %edx,%rax
  mov    %edx,%ebx
  mov    0x8(%rsp),%r11
  mov    0x10(%rsp),%r9d
  imul   $0xffffffff92492493,%rax,%rax
  sar    $0x1f,%ebx
  mov    $0xff,%r8d
  shr    $0x20,%rax
  add    %edx,%eax
  sar    $0x4,%eax
  sub    %eax,%ebx
  lea    0xfe(%rbx),%ebp
  neg    %ebx
  nopl   0x0(%rax)
L515:
  test   %esi,%esi
  jle    L642
  movzbl %r12b,%eax
  xor    %edx,%edx
  lea    (%r11,%rax,4),%rcx
  xor    %eax,%eax
L667:
  movzbl (%rcx,%rax,1),%eax
  movswl %r10w,%r15d
  mov    %eax,%r13d
  cmp    %r15d,%eax
  jle    L662
  movzbl %al,%r15d
  cmp    %eax,%ebp
  cmovge %r15d,%r10d
L662:
  movswl %r8w,%r15d
  cmp    %r15d,%eax
  jge    L174
  cmp    %ebx,%eax
  cmovg  %r13d,%r8d
L174:
  add    $0x1,%edx
  movzbl %dl,%eax
  cmp    %esi,%eax
  jl     L667
L642:
  add    $0x1,%r12d
  movzbl %r12b,%eax
  cmp    %r9d,%eax
  jl     L515
  cmp    %r10w,%r8w
  jge    L864
  movswl %r10w,%r11d
  movswl %r8w,%ebx
  mov    %r8d,%r9d
  mov    %r8w,0x34(%rsp)
  lea    (%r11,%rbx,4),%edx
  lea    (%rbx,%rbx,1),%r8d
  sar    %r9w
  mov    %r10w,0x38(%rsp)
  movslq %edx,%rax
  sar    $0x1f,%edx
  lea    0xff(%r11),%ebp
  movswl %r9w,%r9d
  imul   $0x66666667,%rax,%rax
  mov    %edx,%ecx
  lea    (%r8,%rbx,1),%edx
  sar    %ebp
  sar    $0x21,%rax
  sub    %eax,%ecx
  lea    (%r11,%r11,1),%eax
  add    %eax,%edx
  mov    %cx,0x16(%rsp)
  add    %r11d,%eax
  movslq %edx,%rcx
  sar    $0x1f,%edx
  add    %r8d,%eax
  imul   $0x66666667,%rcx,%rcx
  sar    $0x21,%rcx
  sub    %ecx,%edx
  mov    %dx,0x1e(%rsp)
  movslq %eax,%rdx
  sar    $0x1f,%eax
  imul   $0x66666667,%rdx,%rdx
  sar    $0x21,%rdx
  sub    %edx,%eax
  mov    %ax,0x40(%rsp)
  lea    (%rbx,%r11,4),%eax
  movslq %eax,%rdx
  sar    $0x1f,%eax
  imul   $0x66666667,%rdx,%rdx
  sar    $0x21,%rdx
  sub    %edx,%eax
  mov    %ax,0x4e(%rsp)
L901:
  lea    0x0(,%rbx,8),%edx
  xor    %r10d,%r10d
  xor    %r15d,%r15d
  xor    %r12d,%r12d
  lea    (%rdx,%rbx,1),%eax
  sub    %ebx,%edx
  lea    (%rbx,%rbx,2),%r8d
  mov    %edi,0x44(%rsp)
  lea    (%rax,%r11,1),%ecx
  mov    $0xcccccccd,%eax
  mov    %r14d,0x48(%rsp)
  mov    0x8(%rsp),%r14
  imul   %rax,%rcx
  shr    $0x23,%rcx
  mov    %ecx,%r13d
  lea    (%r11,%r11,2),%ecx
  add    %ecx,%edx
  mov    %edx,%edx
  imul   %rax,%rdx
  shr    $0x23,%rdx
  mov    %dl,0x15(%rsp)
  lea    (%rbx,%r11,1),%edx
  lea    (%rdx,%rdx,4),%edx
  imul   %rax,%rdx
  shr    $0x23,%rdx
  mov    %dl,0x1c(%rsp)
  lea    0x0(,%r11,8),%edx
  mov    %edx,%ecx
  add    %r11d,%edx
  sub    %r11d,%ecx
  add    %ebx,%edx
  xor    %r11d,%r11d
  xor    %ebx,%ebx
  add    %r8d,%ecx
  mov    %edx,%edx
  movzwl 0x34(%rsp),%r8d
  mov    %ecx,%ecx
  imul   %rax,%rdx
  imul   %rax,%rcx
  shr    $0x23,%rdx
  shr    $0x23,%rcx
  mov    %dl,0x3c(%rsp)
  mov    %cl,0x4c(%rsp)
  xchg   %ax,%ax
L399:
  test   %esi,%esi
  jle    L59
  movzbl %r12b,%eax
  xor    %edx,%edx
  lea    (%r14,%rax,4),%rdi
  xor    %eax,%eax
  jmp    L44
  nopw   0x0(%rax,%rax,1)
L615:
  sub    %r8d,%ecx
  add    $0x1,%r10d
  add    %ecx,%r11d
  nopw   0x0(%rax,%rax,1)
L902:
  add    $0x1,%eax
  movzbl %al,%edx
  cmp    %esi,%edx
  jge    L59
L44:
  movzbl (%rdi,%rdx,1),%ecx
  mov    %ecx,%edx
  cmp    %r9d,%ecx
  jle    L902
  cmp    %ebp,%ecx
  jg     L902
  movzbl %cl,%ecx
  cmp    %r13b,%dl
  jbe    L615
  add    $0x1,%ebx
  cmp    0x15(%rsp),%dl
  ja     L277
  add    $0x1,%eax
  add    0x16(%rsp),%cx
  add    $0x1,%r10d
  movzbl %al,%edx
  add    %ecx,%r11d
  add    %ecx,%r15d
  cmp    %esi,%edx
  jl     L44
  nop
L59:
  add    $0x1,%r12d
  movzbl %r12b,%eax
  cmp    0x10(%rsp),%eax
  jl     L399
  test   %r10b,%r10b
  mov    $0x1,%ecx
  movswl %r11w,%eax
  mov    0x44(%rsp),%edi
  cmovne %r10d,%ecx
  cltd
  mov    0x48(%rsp),%r14d
  movzbl %cl,%ecx
  mov    %r14d,0x3c(%rsp)
  idiv   %ecx
  mov    %eax,%ecx
  mov    $0x0,%eax
  add    0x34(%rsp),%cx
  cmovns %ecx,%eax
  test   %bl,%bl
  mov    $0x1,%ecx
  cmovne %ebx,%ecx
  movzwl 0x38(%rsp),%ebx
  mov    %edi,0x38(%rsp)
  mov    %eax,%r11d
  mov    %ax,0x40(%rsp)
  movswl %r15w,%eax
  movzbl %cl,%ecx
  cltd
  movswl %r11w,%r9d
  idiv   %ecx
  lea    (%r9,%r9,1),%r10d
  mov    %r9d,%ebp
  mov    %r9d,%r14d
  add    %eax,%ebx
  mov    $0xff,%eax
  cmp    %ax,%bx
  cmovle %ebx,%eax
  sar    %bp
  movswl %bp,%ebp
  movswl %ax,%r8d
  mov    %ax,0x34(%rsp)
  lea    0x0(,%r9,8),%eax
  lea    (%rax,%r9,1),%edx
  lea    (%r8,%r8,1),%r12d
  sub    %r9d,%eax
  add    %r8d,%edx
  lea    (%r12,%r8,1),%r11d
  movslq %edx,%rcx
  add    %r11d,%eax
  sar    $0x1f,%edx
  imul   $0x66666667,%rcx,%rcx
  sar    $0x22,%rcx
  mov    %ecx,%r13d
  sub    %edx,%r13d
  movslq %eax,%rdx
  sar    $0x1f,%eax
  imul   $0x66666667,%rdx,%rdx
  sar    $0x22,%rdx
  mov    %edx,%ebx
  sub    %eax,%ebx
  lea    (%r9,%r8,1),%eax
  lea    (%rax,%rax,4),%eax
  mov    %bl,0x15(%rsp)
  movslq %eax,%rdx
  sar    $0x1f,%eax
  imul   $0x66666667,%rdx,%rdx
  sar    $0x22,%rdx
  mov    %edx,%ebx
  sub    %eax,%ebx
  lea    0x0(,%r8,8),%eax
  mov    %eax,%edx
  mov    %bl,0x1c(%rsp)
  lea    (%r10,%r9,1),%ebx
  add    %r8d,%eax
  sub    %r8d,%edx
  add    %r9d,%eax
  add    %ebx,%edx
  movslq %edx,%rcx
  sar    $0x1f,%edx
  imul   $0x66666667,%rcx,%rcx
  sar    $0x22,%rcx
  sub    %edx,%ecx
  movslq %eax,%rdx
  sar    $0x1f,%eax
  imul   $0x66666667,%rdx,%rdx
  mov    %cl,0x4c(%rsp)
  sar    $0x22,%rdx
  mov    %edx,%ecx
  lea    0xff(%r8),%edx
  sub    %eax,%ecx
  mov    %edx,%eax
  shr    $0x1f,%eax
  mov    %cl,0x44(%rsp)
  add    %edx,%eax
  lea    (%r9,%r8,4),%edx
  sar    %eax
  mov    %eax,%r15d
  movslq %edx,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x21,%rax
  sar    $0x1f,%edx
  sub    %eax,%edx
  mov    %dx,0x4e(%rsp)
  lea    (%r10,%r11,1),%edx
  xor    %r10d,%r10d
  xor    %r11d,%r11d
  movslq %edx,%rax
  sar    $0x1f,%edx
  imul   $0x66666667,%rax,%rax
  sar    $0x21,%rax
  sub    %eax,%edx
  mov    %dx,0x48(%rsp)
  lea    (%rbx,%r12,1),%edx
  xor    %r12d,%r12d
  movslq %edx,%rax
  sar    $0x1f,%edx
  imul   $0x66666667,%rax,%rax
  mov    %edx,%ebx
  lea    (%r8,%r9,4),%edx
  sar    $0x21,%rax
  sub    %eax,%ebx
  movslq %edx,%rax
  sar    $0x1f,%edx
  imul   $0x66666667,%rax,%rax
  mov    %bx,0x1e(%rsp)
  mov    %edx,%ebx
  sar    $0x21,%rax
  sub    %eax,%ebx
  mov    %bx,0x16(%rsp)
  cs nopw 0x0(%rax,%rax,1)
L507:
  test   %esi,%esi
  jle    L301
  mov    0x8(%rsp),%rbx
  movzbl %r12b,%eax
  lea    0x0(,%r11,4),%r9d
  xor    %ecx,%ecx
  mov    $0xff,%r11d
  lea    (%rbx,%rax,4),%rbx
  xor    %eax,%eax
  jmp    L572
  nopl   0x0(%rax)
L166:
  mov    %r11d,%edx
  sub    %r8d,%edx
  mov    $0x7,%r8d
  movzwl %dx,%edx
L558:
  imul   %edx,%edx
  cltq
  add    $0x1,%ecx
  mov    %r8b,0x70(%rsp,%rax,1)
  movzbl %cl,%eax
  add    %edx,%r10d
  cmp    %esi,%eax
  jge    L301
L572:
  movslq %eax,%rdx
  mov    $0x6,%r8d
  add    %r9d,%eax
  movzbl (%rbx,%rdx,1),%edx
  cmp    %ebp,%edx
  jle    L558
  movzbl %dl,%r8d
  cmp    %r15d,%edx
  jg     L166
  cmp    %r13b,%dl
  ja     L771
  sub    %r14d,%r8d
  movswl %r8w,%edx
  xor    %r8d,%r8d
  jmp    L558
  nopl   0x0(%rax)
L647:
  cmp    0x15(%rsp),%dl
  ja     L777
  movzwl 0x16(%rsp),%edx
  add    %r8d,%edx
  mov    $0x3,%r8d
  movswl %dx,%edx
  imul   %edx,%edx
  add    %edx,%r14d
  jmp    L580
  nopw   0x0(%rax,%rax,1)
L785:
  cmp    0x24(%rsp),%al
  jbe    L162
  add    0x34(%rsp),%ax
  mov    $0x6,%r8d
  jmp    L592
  xchg   %ax,%ax
L777:
  cmp    0x1c(%rsp),%dl
  ja     L532
  movzwl 0x4c(%rsp),%edx
  add    %r8d,%edx
  mov    $0x4,%r8d
  movswl %dx,%edx
  imul   %edx,%edx
  add    %edx,%r14d
  jmp    L580
  nopw   0x0(%rax,%rax,1)
L162:
  cmp    %al,0x30(%rsp)
  jae    L487
  add    0x44(%rsp),%ax
  mov    $0x7,%r8d
  jmp    L592
L532:
  cmp    %dl,0x1e(%rsp)
  jb     L355
  movzwl 0x38(%rsp),%edx
  add    %r8d,%edx
  mov    $0x5,%r8d
  movswl %dx,%edx
  imul   %edx,%edx
  add    %edx,%r14d
  jmp    L580
L487:
  sub    0x48(%rsp),%ax
  mov    $0x1,%r8d
  jmp    L592
L816:
  mov    0x20(%rsp),%edx
  mov    0x18(%rsp),%esi
  lea    0x50(%rsp),%rcx
  xor    %eax,%eax
  mov    0x28(%rsp),%rdi
  call   <util_format_unsigned_write_rgtc_encoded_channel@plt>
  jmp    L480
L355:
  sub    0x3c(%rsp),%r8w
  movswl %r8w,%edx
  mov    $0x1,%r8d
  imul   %edx,%edx
  add    %edx,%r14d
  jmp    L580
L516:
  cmp    %r14d,%edi
  jbe    L816
L866:
  mov    0x30(%rsp),%edx
  mov    0x24(%rsp),%esi
  lea    0x60(%rsp),%rcx
  xor    %eax,%eax
  mov    0x28(%rsp),%rdi
  call   <util_format_unsigned_write_rgtc_encoded_channel@plt>
  jmp    L480
  nopl   0x0(%rax)
L771:
  cmp    %dl,0x15(%rsp)
  jb     L250
  add    0x16(%rsp),%r8w
  movswl %r8w,%edx
  mov    $0x2,%r8d
  jmp    L558
  nopl   0x0(%rax,%rax,1)
L301:
  add    $0x1,%r12d
  movzbl %r12b,%r11d
  cmp    0x10(%rsp),%r11d
  jl     L507
  mov    0x3c(%rsp),%r14d
  mov    0x38(%rsp),%edi
  cmp    %r14d,%r10d
  mov    %r14d,%eax
  cmovbe %r10d,%eax
  cmp    %edi,%eax
  jae    L816
  cmp    %r14d,%r10d
  jae    L866
  movzbl 0x34(%rsp),%edx
  movzbl 0x40(%rsp),%esi
  lea    0x70(%rsp),%rcx
  xor    %eax,%eax
  mov    0x28(%rsp),%rdi
  call   <util_format_unsigned_write_rgtc_encoded_channel@plt>
  jmp    L480
  nopl   0x0(%rax,%rax,1)
L250:
  cmp    0x1c(%rsp),%dl
  ja     L470
  add    0x1e(%rsp),%r8w
  movswl %r8w,%edx
  mov    $0x3,%r8d
  jmp    L558
  nopl   0x0(%rax,%rax,1)
L277:
  cmp    0x1c(%rsp),%dl
  ja     L444
  add    0x1e(%rsp),%cx
  add    $0x1,%r10d
  add    %ecx,%r11d
  add    %ecx,%r15d
  jmp    L902
L470:
  cmp    0x4c(%rsp),%dl
  ja     L491
  add    0x48(%rsp),%r8w
  movswl %r8w,%edx
  mov    $0x4,%r8d
  jmp    L558
L444:
  cmp    0x4c(%rsp),%dl
  ja     L880
  add    0x40(%rsp),%cx
  add    $0x1,%r10d
  add    %ecx,%r11d
  add    %ecx,%r15d
  jmp    L902
L491:
  cmp    %dl,0x44(%rsp)
  jb     L171
  add    0x4e(%rsp),%r8w
  movswl %r8w,%edx
  mov    $0x5,%r8d
  jmp    L558
L880:
  cmp    %dl,0x3c(%rsp)
  jb     L471
  add    0x4e(%rsp),%cx
  add    $0x1,%r10d
  add    %ecx,%r11d
  add    %ecx,%r15d
  jmp    L902
L171:
  sub    0x34(%rsp),%r8w
  movswl %r8w,%edx
  mov    $0x1,%r8d
  jmp    L558
L471:
  sub    0x38(%rsp),%cx
  add    %ecx,%r15d
  jmp    L902
L864:
  mov    $0xffffffcd,%r9d
  mov    $0xfe,%eax
  mov    $0xffffff35,%edx
  mov    $0xffffff68,%ecx
  mov    $0xffffff9a,%r8d
  mov    $0x1,%r10d
  mov    %r9w,0x16(%rsp)
  mov    $0xfe,%ebp
  mov    %ax,0x38(%rsp)
  xor    %r9d,%r9d
  mov    $0x1,%ebx
  mov    $0xfe,%r11d
  mov    %dx,0x4e(%rsp)
  mov    %cx,0x40(%rsp)
  mov    %r8w,0x1e(%rsp)
  mov    %r10w,0x34(%rsp)
  jmp    L901
L57:
  movl   $0x0,0x20(%rsp)
  movb   $0x0,0x38(%rsp)
  jmp    L719
L98:
  movl   $0xff,0x18(%rsp)
  movb   $0xff,0x16(%rsp)
  jmp    L148
L496:
  call   <__stack_chk_fail@plt>
```

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);
  }
}
```