user: Demonstrate the C code that generates the assembly output below:

```asm
<img_rle_compact>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x18,%rsp
  cmp    $0x1,%esi
  sete   %al
  cmp    $0x1,%ecx
  mov    %rdx,0x8(%rsp)
  mov    %ecx,%edx
  sete   %cl
  test   %al,%al
  je     L1132
  test   %cl,%cl
  je     L1132
  movslq %r8d,%r8
  mov    %rbx,%rax
  lea    (%rdi,%r8,1),%rbp
L1128:
  cmp    %rbp,%rdi
  jae    L920
  nopl   0x0(%rax,%rax,1)
L710:
  lea    0x2(%rdi),%rdx
  mov    %rdi,%r15
  mov    %rdx,%r12
  cmp    %rdx,%rbp
  ja     L538
  jmp    L1166
  nopl   0x0(%rax)
L1322:
  lea    0x1(%rdx),%r12
  cmp    %r12,%rbp
  je     L172
  mov    %r12,%rdx
L538:
  movzbl -0x1(%rdx),%ecx
  cmp    %cl,-0x2(%rdx)
  jne    L1322
  cmp    (%rdx),%cl
  jne    L1322
  lea    -0x2(%rdx),%r15
  mov    %rdx,%r12
  mov    %r15d,%ebx
  sub    %edi,%ebx
  nopl   0x0(%rax)
L859:
  test   %ebx,%ebx
  je     L1166
L1439:
  mov    $0x7e,%ecx
  lea    0x1(%rax),%r14
  cmp    %ecx,%ebx
  cmovle %ebx,%ecx
  movswl %cx,%edx
  mov    %ecx,%r11d
  sub    %edx,%ebx
  mov    %ecx,%edx
  or     $0xffffff80,%edx
  mov    %dl,(%rax)
  lea    -0x1(%rcx),%edx
  mov    %edx,%r8d
  test   %cx,%cx
  je     L444
  mov    %rax,%rsi
  sub    %rdi,%rsi
  cmp    $0xe,%rsi
  jbe    L1333
  cmp    $0x6,%dx
  jbe    L1333
  cmp    $0xe,%dx
  jbe    L882
  lea    -0x10(%rcx),%esi
  xor    %r8d,%r8d
  xor    %r9d,%r9d
  shr    $0x4,%si
  add    $0x1,%esi
L789:
  movdqu (%rdi,%r8,1),%xmm3
  add    $0x1,%r9d
  movups %xmm3,0x1(%rax,%r8,1)
  add    $0x10,%r8
  cmp    %r9w,%si
  ja     L789
  shl    $0x4,%esi
  mov    %edx,%r8d
  movzwl %si,%r13d
  sub    %esi,%r8d
  lea    (%rdi,%r13,1),%r10
  lea    (%r14,%r13,1),%r9
  cmp    %si,%cx
  je     L1354
  mov    %ecx,%r11d
  sub    %esi,%r11d
  lea    -0x1(%r11),%ecx
  cmp    $0x6,%cx
  jbe    L416
L768:
  mov    (%rdi,%r13,1),%rcx
  mov    %rcx,0x1(%rax,%r13,1)
  mov    %r11d,%eax
  mov    %r11,%rcx
  and    $0xfff8,%ecx
  and    $0xfffffff8,%eax
  add    %rcx,%r10
  add    %rcx,%r9
  sub    %eax,%r8d
  cmp    %ax,%r11w
  je     L1354
L416:
  movzbl (%r10),%eax
  mov    %al,(%r9)
  test   %r8w,%r8w
  je     L1354
  movzbl 0x1(%r10),%eax
  mov    %al,0x1(%r9)
  cmp    $0x1,%r8w
  je     L1354
  movzbl 0x2(%r10),%eax
  mov    %al,0x2(%r9)
  cmp    $0x2,%r8w
  je     L1354
  movzbl 0x3(%r10),%eax
  mov    %al,0x3(%r9)
  cmp    $0x3,%r8w
  je     L1354
  movzbl 0x4(%r10),%eax
  mov    %al,0x4(%r9)
  cmp    $0x4,%r8w
  je     L1354
  movzbl 0x5(%r10),%eax
  mov    %al,0x5(%r9)
  cmp    $0x5,%r8w
  je     L1354
  movzbl 0x6(%r10),%eax
  mov    %al,0x6(%r9)
L1354:
  movzwl %dx,%edx
L619:
  add    $0x1,%rdx
  add    %rdx,%rdi
  lea    (%r14,%rdx,1),%rax
  test   %ebx,%ebx
  jne    L1439
L1166:
  lea    -0x1(%r12),%rdi
  movzbl -0x2(%r12),%r8d
  cmp    %rdi,%rbp
  ja     L505
  jmp    L612
L1402:
  add    $0x1,%rdi
  cmp    %rdi,%rbp
  jbe    L612
L505:
  cmp    (%rdi),%r8b
  je     L1402
  mov    %rdi,%rdx
  sub    %r15,%rdx
  mov    %edx,%ecx
  test   %edx,%edx
  je     L1128
  nopw   0x0(%rax,%rax,1)
L1122:
  mov    $0x7e,%edx
  cmp    %edx,%ecx
  cmovle %ecx,%edx
  add    $0x2,%rax
  mov    %dl,-0x2(%rax)
  movswl %dx,%esi
  mov    %r8b,-0x1(%rax)
  sub    %esi,%ecx
  jne    L1122
  cmp    %rbp,%rdi
  jb     L710
L920:
  movb   $0x0,(%rax)
  add    $0x1,%rax
  sub    0x8(%rsp),%eax
L446:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L1132:
  cmp    $0x2,%edx
  sete   %r9b
  test   %al,%al
  je     L774
  test   %r9b,%r9b
  je     L774
  movslq %r8d,%r8
  mov    0x8(%rsp),%rax
  lea    (%rdi,%r8,1),%rbp
  cmp    %rbp,%rdi
  jae    L532
  pxor   %xmm1,%xmm1
L1111:
  lea    0x2(%rdi),%rdx
  mov    %rdi,%r12
  mov    %rdx,%r11
  cmp    %rdx,%rbp
  ja     L1129
  jmp    L217
  nopl   0x0(%rax)
L451:
  lea    0x1(%rdx),%r11
  cmp    %r11,%rbp
  je     L1153
  mov    %r11,%rdx
L1129:
  movzbl -0x1(%rdx),%ecx
  cmp    %cl,-0x2(%rdx)
  jne    L451
  cmp    (%rdx),%cl
  jne    L451
  lea    -0x2(%rdx),%r12
  mov    %rdx,%r11
  mov    %r12d,%r10d
  sub    %edi,%r10d
  nopw   0x0(%rax,%rax,1)
L1543:
  test   %r10d,%r10d
  je     L217
L1530:
  mov    $0x7e,%r8d
  lea    0x2(%rax),%rbx
  cmp    %r8d,%r10d
  cmovle %r10d,%r8d
  movswl %r8w,%edx
  lea    -0x1(%r8),%r9d
  sub    %edx,%r10d
  mov    %r8d,%edx
  or     $0x80,%dl
  mov    %dx,(%rax)
  test   %r8w,%r8w
  je     L552
  movzwl %r8w,%edx
  lea    0x2(%rax,%rdx,2),%rcx
  cmp    %rcx,%rdi
  setae  %cl
  add    %rdi,%rdx
  cmp    %rdx,%rbx
  setae  %dl
  or     %dl,%cl
  je     L11
  cmp    $0xe,%r9w
  jbe    L11
  lea    -0x10(%r8),%esi
  xor    %edx,%edx
  xor    %ecx,%ecx
  shr    $0x4,%si
  add    $0x1,%esi
  nopw   0x0(%rax,%rax,1)
L591:
  movdqu (%rdi,%rdx,1),%xmm0
  add    $0x1,%ecx
  movdqa %xmm0,%xmm2
  punpckhbw %xmm1,%xmm0
  punpcklbw %xmm1,%xmm2
  movups %xmm0,0x12(%rax,%rdx,2)
  movups %xmm2,0x2(%rax,%rdx,2)
  add    $0x10,%rdx
  cmp    %cx,%si
  ja     L591
  shl    $0x4,%esi
  mov    %r9d,%ecx
  movzwl %si,%eax
  sub    %esi,%ecx
  lea    (%rdi,%rax,1),%rdx
  lea    (%rbx,%rax,2),%rax
  cmp    %si,%r8w
  je     L918
  movzbl (%rdx),%esi
  mov    %si,(%rax)
  test   %cx,%cx
  je     L918
  movzbl 0x1(%rdx),%esi
  mov    %si,0x2(%rax)
  cmp    $0x1,%cx
  je     L918
  movzbl 0x2(%rdx),%esi
  mov    %si,0x4(%rax)
  cmp    $0x2,%cx
  je     L918
  movzbl 0x3(%rdx),%esi
  mov    %si,0x6(%rax)
  cmp    $0x3,%cx
  je     L918
  movzbl 0x4(%rdx),%esi
  mov    %si,0x8(%rax)
  cmp    $0x4,%cx
  je     L918
  movzbl 0x5(%rdx),%esi
  mov    %si,0xa(%rax)
  cmp    $0x5,%cx
  je     L918
  movzbl 0x6(%rdx),%esi
  mov    %si,0xc(%rax)
  cmp    $0x6,%cx
  je     L918
  movzbl 0x7(%rdx),%esi
  mov    %si,0xe(%rax)
  cmp    $0x7,%cx
  je     L918
  movzbl 0x8(%rdx),%esi
  mov    %si,0x10(%rax)
  cmp    $0x8,%cx
  je     L918
  movzbl 0x9(%rdx),%esi
  mov    %si,0x12(%rax)
  cmp    $0x9,%cx
  je     L918
  movzbl 0xa(%rdx),%esi
  mov    %si,0x14(%rax)
  cmp    $0xa,%cx
  je     L918
  movzbl 0xb(%rdx),%esi
  mov    %si,0x16(%rax)
  cmp    $0xb,%cx
  je     L918
  movzbl 0xc(%rdx),%esi
  mov    %si,0x18(%rax)
  cmp    $0xc,%cx
  je     L918
  movzbl 0xd(%rdx),%esi
  mov    %si,0x1a(%rax)
  cmp    $0xd,%cx
  je     L918
  movzbl 0xe(%rdx),%edx
  mov    %dx,0x1c(%rax)
  nopl   0x0(%rax)
L918:
  movzwl %r9w,%r9d
L432:
  add    $0x1,%r9
  add    %r9,%rdi
  lea    (%rbx,%r9,2),%rax
  test   %r10d,%r10d
  jne    L1530
L217:
  lea    -0x1(%r11),%rdi
  movzbl -0x2(%r11),%edx
  cmp    %rdi,%rbp
  ja     L847
  jmp    L669
  nopl   0x0(%rax,%rax,1)
L857:
  add    $0x1,%rdi
  cmp    %rdi,%rbp
  jbe    L669
L847:
  cmp    (%rdi),%dl
  je     L857
  mov    %rdi,%rsi
  sub    %r12,%rsi
  mov    %esi,%ecx
  test   %esi,%esi
  je     L578
L249:
  movzbl %dl,%r8d
  nopl   0x0(%rax)
L597:
  mov    $0x7e,%edx
  cmp    %edx,%ecx
  cmovle %ecx,%edx
  add    $0x4,%rax
  mov    %dx,-0x4(%rax)
  movswl %dx,%esi
  mov    %r8w,-0x2(%rax)
  sub    %esi,%ecx
  jne    L597
L578:
  cmp    %rbp,%rdi
  jb     L1111
L532:
  xor    %edx,%edx
  add    $0x2,%rax
  mov    %dx,-0x2(%rax)
  sub    0x8(%rsp),%rax
  sar    %rax
L1481:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L774:
  cmp    $0x2,%esi
  sete   %al
  test   %cl,%cl
  je     L618
  test   %al,%al
  je     L618
  movslq %r8d,%r8
  mov    0x8(%rsp),%rax
  lea    (%rdi,%r8,2),%rbp
  cmp    %rbp,%rdi
  jae    L920
  movdqa D16(%rip),%xmm2
L1018:
  lea    0x4(%rdi),%rdx
  mov    %rdi,%r12
  mov    %rdx,%r11
  cmp    %rdx,%rbp
  ja     L286
  jmp    L1124
  nopw   0x0(%rax,%rax,1)
L1448:
  lea    0x2(%rdx),%r11
  cmp    %r11,%rbp
  jbe    L809
  mov    %r11,%rdx
L286:
  movzwl -0x2(%rdx),%ecx
  cmp    %cx,-0x4(%rdx)
  jne    L1448
  cmp    (%rdx),%cx
  jne    L1448
  lea    -0x4(%rdx),%r12
  mov    %rdx,%r11
  mov    %r12,%r10
  sub    %rdi,%r10
  sar    %r10
  nop
L1097:
  test   %r10d,%r10d
  je     L1124
L916:
  mov    $0x7e,%r8d
  lea    0x1(%rax),%rbx
  cmp    %r8d,%r10d
  cmovle %r10d,%r8d
  movswl %r8w,%edx
  lea    -0x1(%r8),%r9d
  sub    %edx,%r10d
  mov    %r8d,%edx
  or     $0xffffff80,%edx
  mov    %dl,(%rax)
  test   %r8w,%r8w
  je     L550
  movzwl %r8w,%ecx
  lea    0x1(%rax,%rcx,1),%rdx
  lea    (%rdi,%rcx,2),%rcx
  cmp    %rdx,%rdi
  setae  %dl
  cmp    %rcx,%rbx
  setae  %cl
  or     %cl,%dl
  je     L1464
  cmp    $0xe,%r9w
  jbe    L1464
  lea    -0x10(%r8),%esi
  xor    %edx,%edx
  xor    %ecx,%ecx
  shr    $0x4,%si
  add    $0x1,%esi
  nopw   0x0(%rax,%rax,1)
L560:
  movdqu (%rdi,%rdx,2),%xmm0
  movdqu 0x10(%rdi,%rdx,2),%xmm1
  add    $0x1,%ecx
  pand   %xmm2,%xmm0
  pand   %xmm2,%xmm1
  packuswb %xmm1,%xmm0
  movups %xmm0,0x1(%rax,%rdx,1)
  add    $0x10,%rdx
  cmp    %cx,%si
  ja     L560
  shl    $0x4,%esi
  mov    %r9d,%ecx
  movzwl %si,%eax
  sub    %esi,%ecx
  lea    (%rdi,%rax,2),%rdx
  add    %rbx,%rax
  cmp    %r8w,%si
  je     L897
  movzwl (%rdx),%esi
  mov    %sil,(%rax)
  test   %cx,%cx
  je     L897
  movzwl 0x2(%rdx),%esi
  mov    %sil,0x1(%rax)
  cmp    $0x1,%cx
  je     L897
  movzwl 0x4(%rdx),%esi
  mov    %sil,0x2(%rax)
  cmp    $0x2,%cx
  je     L897
  movzwl 0x6(%rdx),%esi
  mov    %sil,0x3(%rax)
  cmp    $0x3,%cx
  je     L897
  movzwl 0x8(%rdx),%esi
  mov    %sil,0x4(%rax)
  cmp    $0x4,%cx
  je     L897
  movzwl 0xa(%rdx),%esi
  mov    %sil,0x5(%rax)
  cmp    $0x5,%cx
  je     L897
  movzwl 0xc(%rdx),%esi
  mov    %sil,0x6(%rax)
  cmp    $0x6,%cx
  je     L897
  movzwl 0xe(%rdx),%esi
  mov    %sil,0x7(%rax)
  cmp    $0x7,%cx
  je     L897
  movzwl 0x10(%rdx),%esi
  mov    %sil,0x8(%rax)
  cmp    $0x8,%cx
  je     L897
  movzwl 0x12(%rdx),%esi
  mov    %sil,0x9(%rax)
  cmp    $0x9,%cx
  je     L897
  movzwl 0x14(%rdx),%esi
  mov    %sil,0xa(%rax)
  cmp    $0xa,%cx
  je     L897
  movzwl 0x16(%rdx),%esi
  mov    %sil,0xb(%rax)
  cmp    $0xb,%cx
  je     L897
  movzwl 0x18(%rdx),%esi
  mov    %sil,0xc(%rax)
  cmp    $0xc,%cx
  je     L897
  movzwl 0x1a(%rdx),%esi
  mov    %sil,0xd(%rax)
  cmp    $0xd,%cx
  je     L897
  movzwl 0x1c(%rdx),%edx
  mov    %dl,0xe(%rax)
  nopl   0x0(%rax,%rax,1)
L897:
  movzwl %r9w,%r9d
L369:
  add    $0x1,%r9
  lea    (%rdi,%r9,2),%rdi
  lea    (%rbx,%r9,1),%rax
  test   %r10d,%r10d
  jne    L916
L1124:
  lea    -0x2(%r11),%rdi
  movzwl -0x4(%r11),%r8d
  cmp    %rdi,%rbp
  jbe    L441
  movswl %r8w,%ecx
  jmp    L1403
  nopl   0x0(%rax)
L1091:
  add    $0x2,%rdi
  cmp    %rdi,%rbp
  jbe    L441
L1403:
  movzwl (%rdi),%edx
  cmp    %ecx,%edx
  je     L1091
  mov    %rdi,%rdx
  sub    %r12,%rdx
  sar    %rdx
  mov    %edx,%ecx
  test   %edx,%edx
  je     L514
  nopl   0x0(%rax,%rax,1)
L42:
  mov    $0x7e,%edx
  cmp    %edx,%ecx
  cmovle %ecx,%edx
  add    $0x2,%rax
  mov    %dl,-0x2(%rax)
  movswl %dx,%esi
  mov    %r8b,-0x1(%rax)
  sub    %esi,%ecx
  jne    L42
L514:
  cmp    %rbp,%rdi
  jb     L1018
  jmp    L920
L618:
  test   %r9b,%r9b
  je     L1121
  test   %al,%al
  je     L1121
  movslq %r8d,%r8
  mov    0x8(%rsp),%rax
  lea    (%rdi,%r8,2),%r13
  cmp    %r13,%rdi
  jae    L532
L956:
  lea    0x4(%rdi),%rdx
  mov    %rdi,%r15
  mov    %rdx,%r11
  cmp    %rdx,%r13
  ja     L951
  jmp    L783
  nopl   0x0(%rax)
L976:
  lea    0x2(%rdx),%r11
  cmp    %r11,%r13
  jbe    L398
  mov    %r11,%rdx
L951:
  movzwl -0x2(%rdx),%ecx
  cmp    %cx,-0x4(%rdx)
  jne    L976
  cmp    (%rdx),%cx
  jne    L976
  lea    -0x4(%rdx),%r15
  mov    %rdx,%r11
  mov    %r15,%r9
  sub    %rdi,%r9
  sar    %r9
  nopw   0x0(%rax,%rax,1)
L1277:
  test   %r9d,%r9d
  je     L783
L440:
  mov    $0x7e,%edx
  lea    0x2(%rax),%r14
  cmp    %edx,%r9d
  cmovle %r9d,%edx
  movswl %dx,%ecx
  lea    -0x1(%rdx),%r8d
  mov    %edx,%r10d
  sub    %ecx,%r9d
  mov    %edx,%ecx
  mov    %r8d,%ebx
  or     $0x80,%cl
  mov    %cx,(%rax)
  test   %dx,%dx
  je     L872
  mov    %rax,%rcx
  sub    %rdi,%rcx
  cmp    $0xc,%rcx
  jbe    L65
  cmp    $0x2,%r8w
  jbe    L65
  cmp    $0x6,%r8w
  jbe    L700
  lea    -0x8(%rdx),%ecx
  xor    %esi,%esi
  xor    %r10d,%r10d
  shr    $0x3,%cx
  add    $0x1,%ecx
  nop
L1334:
  movdqu (%rdi,%rsi,1),%xmm4
  add    $0x1,%r10d
  movups %xmm4,0x2(%rax,%rsi,1)
  add    $0x10,%rsi
  cmp    %r10w,%cx
  ja     L1334
  shl    $0x3,%ecx
  mov    %r8d,%ebx
  movzwl %cx,%r12d
  sub    %ecx,%ebx
  lea    (%r12,%r12,1),%rsi
  lea    (%rdi,%rsi,1),%rbp
  add    %r14,%rsi
  cmp    %dx,%cx
  je     L1303
  mov    %edx,%r10d
  sub    %ecx,%r10d
  lea    -0x1(%r10),%edx
  cmp    $0x2,%dx
  jbe    L620
L1492:
  mov    (%rdi,%r12,2),%rdx
  movzwl %r8w,%ecx
  mov    %rdx,0x2(%rax,%r12,2)
  mov    %r10,%rax
  mov    %r10d,%edx
  and    $0xfffc,%eax
  and    $0xfffffffc,%edx
  add    %rax,%rax
  sub    %edx,%ebx
  add    %rax,%rbp
  add    %rax,%rsi
  cmp    %dx,%r10w
  je     L420
L620:
  movzwl 0x0(%rbp),%eax
  mov    %ax,(%rsi)
  test   %bx,%bx
  je     L1303
  movzwl 0x2(%rbp),%eax
  mov    %ax,0x2(%rsi)
  cmp    $0x1,%bx
  je     L1303
  movzwl 0x4(%rbp),%eax
  mov    %ax,0x4(%rsi)
L1303:
  movzwl %r8w,%ecx
L420:
  lea    0x2(%rcx,%rcx,1),%rax
  add    %rax,%rdi
  add    %r14,%rax
  test   %r9d,%r9d
  jne    L440
L783:
  lea    -0x2(%r11),%rdi
  movzwl -0x4(%r11),%r8d
  cmp    %rdi,%r13
  jbe    L549
  movswl %r8w,%ecx
  jmp    L1175
  xchg   %ax,%ax
L271:
  add    $0x2,%rdi
  cmp    %rdi,%r13
  jbe    L549
L1175:
  movzwl (%rdi),%edx
  cmp    %ecx,%edx
  je     L271
L549:
  mov    %rdi,%rdx
  sub    %r15,%rdx
  sar    %rdx
  mov    %edx,%ecx
  test   %edx,%edx
  je     L666
  nop
L693:
  mov    $0x7e,%edx
  cmp    %edx,%ecx
  cmovle %ecx,%edx
  add    $0x4,%rax
  mov    %dx,-0x4(%rax)
  movswl %dx,%esi
  mov    %r8w,-0x2(%rax)
  sub    %esi,%ecx
  jne    L693
L666:
  cmp    %rdi,%r13
  ja     L956
  jmp    L532
  nopl   0x0(%rax)
L1333:
  movzwl %dx,%edx
  xor    %ecx,%ecx
  nopl   (%rax)
L1409:
  movzbl (%rdi,%rcx,1),%esi
  mov    %sil,0x1(%rax,%rcx,1)
  mov    %rcx,%rsi
  add    $0x1,%rcx
  cmp    %rdx,%rsi
  jne    L1409
  jmp    L619
  nopw   0x0(%rax,%rax,1)
L444:
  mov    %r14,%rax
  jmp    L859
L172:
  lea    -0x1(%rdx),%r15
  mov    %r15d,%ebx
  sub    %edi,%ebx
  jmp    L859
L882:
  mov    %rdi,%r10
  mov    %r14,%r9
  xor    %r13d,%r13d
  jmp    L768
L612:
  mov    %rdi,%rdx
  sub    %r15,%rdx
  mov    %edx,%ecx
  test   %edx,%edx
  jne    L1122
  movb   $0x0,(%rax)
  add    $0x1,%rax
  sub    0x8(%rsp),%eax
  jmp    L446
L1121:
  lea    D4(%rip),%rdi
  call   <i_errhdlr@plt>
  xor    %eax,%eax
  jmp    L1481
  nop
L11:
  movzwl %r9w,%r9d
  xor    %edx,%edx
  cs nopw 0x0(%rax,%rax,1)
L1340:
  movzbl (%rdi,%rdx,1),%ecx
  mov    %cx,0x2(%rax,%rdx,2)
  mov    %rdx,%rcx
  add    $0x1,%rdx
  cmp    %rcx,%r9
  jne    L1340
  jmp    L432
  nopw   0x0(%rax,%rax,1)
L65:
  movzwl %r8w,%ecx
  xor    %edx,%edx
  lea    0x2(%rcx,%rcx,1),%r8
  nopl   0x0(%rax,%rax,1)
L827:
  movzwl (%rdi,%rdx,1),%esi
  mov    %si,0x2(%rax,%rdx,1)
  add    $0x2,%rdx
  cmp    %r8,%rdx
  jne    L827
  jmp    L420
L1464:
  movzwl %r9w,%r9d
  xor    %edx,%edx
  nopl   (%rax)
L955:
  movzwl (%rdi,%rdx,2),%ecx
  mov    %cl,0x1(%rax,%rdx,1)
  mov    %rdx,%rcx
  add    $0x1,%rdx
  cmp    %rcx,%r9
  jne    L955
  jmp    L369
L552:
  mov    %rbx,%rax
  jmp    L1543
L872:
  mov    %r14,%rax
  jmp    L1277
L1153:
  lea    -0x1(%rdx),%r12
  mov    %r12d,%r10d
  sub    %edi,%r10d
  jmp    L1543
L398:
  lea    -0x2(%rdx),%r15
  mov    %r15,%r9
  sub    %rdi,%r9
  sar    %r9
  jmp    L1277
L550:
  mov    %rbx,%rax
  jmp    L1097
L669:
  mov    %rdi,%rsi
  sub    %r12,%rsi
  mov    %esi,%ecx
  test   %esi,%esi
  jne    L249
  jmp    L532
L700:
  mov    %rdi,%rbp
  mov    %r14,%rsi
  xor    %r12d,%r12d
  jmp    L1492
L809:
  lea    -0x2(%rdx),%r12
  mov    %r12,%r10
  sub    %rdi,%r10
  sar    %r10
  jmp    L1097
L441:
  mov    %rdi,%rdx
  sub    %r12,%rdx
  sar    %rdx
  mov    %edx,%ecx
  test   %edx,%edx
  jne    L42
  jmp    L920
```

tool_calls: name: unpack_data
arguments: data_tag: D16
type_infered: byte[16]
name: unpack_data
arguments: data_tag: D4
type_infered: string

tool: {"D16": [0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00]}

tool: D4: rle_compact: bad bpp: %d %d


assistant: ```c
int img_rle_compact(unsigned short *expbuf, int ibpp, unsigned short *rlebuf, int obpp, int cnt) {
  if (ibpp == 1 && obpp == 1) {
    register unsigned char *iptr = (unsigned char *)expbuf;
    register unsigned char *ibufend = iptr + cnt;
    register unsigned char *sptr;
    register unsigned char *optr = (unsigned char *)rlebuf;
    register short todo, cc;
    register int count;
    while (iptr < ibufend) {
      sptr = iptr;
      iptr += 2;
      while ((iptr < ibufend) && ((iptr[-2] != iptr[-1]) || (iptr[-1] != iptr[0])))
        iptr++;
      iptr -= 2;
      count = iptr - sptr;
      while (count) {
        todo = count > 126 ? 126 : count;
        count -= todo;
        *optr++ = 0x80 | todo;
        while (todo--)
          *optr++ = *sptr++;
      }
      sptr = iptr;
      cc = *iptr++;
      while ((iptr < ibufend) && (*iptr == cc))
        iptr++;
      count = iptr - sptr;
      while (count) {
        todo = count > 126 ? 126 : count;
        count -= todo;
        *optr++ = todo;
        *optr++ = cc;
      }
    }
    *optr++ = 0;
    ;
    return optr - (unsigned char *)rlebuf;
  } else if (ibpp == 1 && obpp == 2) {
    register unsigned char *iptr = (unsigned char *)expbuf;
    register unsigned char *ibufend = iptr + cnt;
    register unsigned char *sptr;
    register unsigned short *optr = rlebuf;
    register short todo, cc;
    register int count;
    while (iptr < ibufend) {
      sptr = iptr;
      iptr += 2;
      while ((iptr < ibufend) && ((iptr[-2] != iptr[-1]) || (iptr[-1] != iptr[0])))
        iptr++;
      iptr -= 2;
      count = iptr - sptr;
      while (count) {
        todo = count > 126 ? 126 : count;
        count -= todo;
        *optr++ = 0x80 | todo;
        while (todo--)
          *optr++ = *sptr++;
      }
      sptr = iptr;
      cc = *iptr++;
      while ((iptr < ibufend) && (*iptr == cc))
        iptr++;
      count = iptr - sptr;
      while (count) {
        todo = count > 126 ? 126 : count;
        count -= todo;
        *optr++ = todo;
        *optr++ = cc;
      }
    }
    *optr++ = 0;
    ;
    return optr - rlebuf;
  } else if (ibpp == 2 && obpp == 1) {
    register unsigned short *iptr = expbuf;
    register unsigned short *ibufend = iptr + cnt;
    register unsigned short *sptr;
    register unsigned char *optr = (unsigned char *)rlebuf;
    register short todo, cc;
    register int count;
    while (iptr < ibufend) {
      sptr = iptr;
      iptr += 2;
      while ((iptr < ibufend) && ((iptr[-2] != iptr[-1]) || (iptr[-1] != iptr[0])))
        iptr++;
      iptr -= 2;
      count = iptr - sptr;
      while (count) {
        todo = count > 126 ? 126 : count;
        count -= todo;
        *optr++ = 0x80 | todo;
        while (todo--)
          *optr++ = *sptr++;
      }
      sptr = iptr;
      cc = *iptr++;
      while ((iptr < ibufend) && (*iptr == cc))
        iptr++;
      count = iptr - sptr;
      while (count) {
        todo = count > 126 ? 126 : count;
        count -= todo;
        *optr++ = todo;
        *optr++ = cc;
      }
    }
    *optr++ = 0;
    ;
    return optr - (unsigned char *)rlebuf;
  } else if (ibpp == 2 && obpp == 2) {
    register unsigned short *iptr = expbuf;
    register unsigned short *ibufend = iptr + cnt;
    register unsigned short *sptr;
    register unsigned short *optr = rlebuf;
    register short todo, cc;
    register int count;
    while (iptr < ibufend) {
      sptr = iptr;
      iptr += 2;
      while ((iptr < ibufend) && ((iptr[-2] != iptr[-1]) || (iptr[-1] != iptr[0])))
        iptr++;
      iptr -= 2;
      count = iptr - sptr;
      while (count) {
        todo = count > 126 ? 126 : count;
        count -= todo;
        *optr++ = 0x80 | todo;
        while (todo--)
          *optr++ = *sptr++;
      }
      sptr = iptr;
      cc = *iptr++;
      while ((iptr < ibufend) && (*iptr == cc))
        iptr++;
      count = iptr - sptr;
      while (count) {
        todo = count > 126 ? 126 : count;
        count -= todo;
        *optr++ = todo;
        *optr++ = cc;
      }
    }
    *optr++ = 0;
    ;
    return optr - rlebuf;
  } else {
    i_errhdlr("rle_compact: bad bpp: %d %d\n", ibpp, obpp);
    return 0;
  }
}
```