user: Converte this assembly snippet into its equivalent C code:

```asm
<bitmap_decompress2>:
  endbr64
  push   %r15
  movslq %r8d,%r8
  push   %r14
  lea    (%rcx,%r8,1),%rax
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,-0x28(%rsp)
  mov    %rax,-0x8(%rsp)
  cmp    %rax,%rcx
  jae    L724
  movb   $0x0,-0x10(%rsp)
  mov    %edx,%r11d
  mov    %esi,%edi
  mov    %esi,%edx
  movb   $0x0,-0xf(%rsp)
  mov    %rcx,%r9
  xor    %ebp,%ebp
  xor    %ebx,%ebx
  movb   $0x0,-0xe(%rsp)
  xor    %esi,%esi
  xor    %r8d,%r8d
  mov    %r11d,%r14d
  movb   $0xff,-0x2a(%rsp)
  lea    D18(%rip),%r15
  movb   $0xff,-0x29(%rsp)
  movl   $0x0,-0x20(%rsp)
  movl   $0xffffffff,-0x30(%rsp)
  movb   $0x0,-0xd(%rsp)
L757:
  movzbl (%r9),%ecx
  lea    0x1(%r9),%r10
  mov    %ecx,%r11d
  mov    %ecx,%eax
  sar    $0x4,%r11d
  cmp    $0xf,%r11d
  jne    L63
  mov    %ecx,%r11d
  and    $0xf,%ecx
  and    $0xf,%r11d
  cmp    $0x8,%r11b
  ja     L564
  movzwl 0x1(%r9),%eax
  lea    0x3(%r9),%r10
  cmp    $0xa,%r11b
  ja     L345
  lea    D16(%rip),%r13
  movzbl %r11b,%r11d
  movslq 0x0(%r13,%r11,4),%r9
  add    %r13,%r9
  notrack jmp *%r9
  nopl   0x0(%rax,%rax,1)
L63:
  cmp    $0xb,%r11d
  jg     L747
  sar    $0x5,%ecx
  and    $0x1f,%eax
  mov    $0x20,%r12d
L375:
  mov    $0x84,%r11d
  shr    %cl,%r11
  and    $0x1,%r11d
  test   %eax,%eax
  je     L702
  lea    0x0(,%rax,8),%r9d
  test   %r11,%r11
  cmovne %r9d,%eax
L3:
  cmp    $0xa,%ecx
  ja     L437
L635:
  lea    D10(%rip),%r11
  mov    %ecx,%r9d
  movslq (%r11,%r9,4),%r9
  add    %r11,%r9
  notrack jmp *%r9
L702:
  movzbl 0x1(%r9),%r13d
  lea    0x2(%r9),%r10
  add    %r13d,%r12d
  lea    0x1(%r13),%eax
  test   %r11,%r11
  cmove  %r12d,%eax
  cmp    $0xa,%ecx
  jbe    L635
L437:
  movl   $0x0,-0x30(%rsp)
  jmp    L903
  cs nopw 0x0(%rax,%rax,1)
L564:
  cmp    $0xa,%r11b
  ja     L442
  mov    $0x8,%eax
  jmp    L3
  nopl   0x0(%rax)
L747:
  lea    -0x6(%r11),%ecx
  and    $0xf,%eax
  mov    $0x10,%r12d
  jmp    L375
  nopw   0x0(%rax,%rax,1)
  movzbl (%r10),%r9d
  movl   $0x0,-0x30(%rsp)
  sub    $0x5,%ecx
  add    $0x2,%r10
  mov    %r9b,-0x2a(%rsp)
  movzbl -0x1(%r10),%r9d
  mov    %r9b,-0x29(%rsp)
  nopw   0x0(%rax,%rax,1)
L674:
  test   %eax,%eax
  je     L292
L903:
  xor    %r9d,%r9d
  mov    %ecx,%r13d
  cs nopw 0x0(%rax,%rax,1)
L233:
  cmp    %edx,%edi
  jg     L733
  test   %r14d,%r14d
  jle    L179
  sub    $0x1,%r14d
  mov    %edi,%edx
  mov    %rsi,%r8
  mov    -0x28(%rsp),%rsi
  imul   %r14d,%edx
  add    %edx,%edx
  movslq %edx,%rdx
  add    %rdx,%rsi
  xor    %edx,%edx
L733:
  cmp    $0xe,%r13d
  ja     L179
  mov    %r13d,%ecx
  movslq (%r15,%rcx,4),%rcx
  add    %r15,%rcx
  notrack jmp *%rcx
  nopl   0x0(%rax,%rax,1)
L179:
  xor    %eax,%eax
L239:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
  lea    0x1(%rdx),%ecx
  movslq %ecx,%rcx
  cmp    %edi,%edx
  jge    L233
  nopw   0x0(%rax,%rax,1)
L463:
  sub    $0x1,%eax
  movb   $0x0,-0x2(%rsi,%rcx,2)
  mov    %ecx,%edx
  test   %eax,%eax
  movb   $0x0,-0x1(%rsi,%rcx,2)
  setg   %r12b
  cmp    %ecx,%edi
  setg   %r11b
  add    $0x1,%rcx
  test   %r11b,%r12b
  jne    L463
L587:
  test   %eax,%eax
  jne    L233
L353:
  mov    %r13d,%ecx
L292:
  mov    %ecx,-0x30(%rsp)
  mov    %r10,%r9
  cmp    %r10,-0x8(%rsp)
  ja     L757
L724:
  mov    $0x1,%eax
  jmp    L239
  nopl   0x0(%rax,%rax,1)
  lea    0x1(%rdx),%ecx
  movslq %ecx,%rcx
  cmp    %edi,%edx
  jge    L233
  xchg   %ax,%ax
L182:
  sub    $0x1,%eax
  movb   $0xff,-0x2(%rsi,%rcx,2)
  mov    %ecx,%edx
  test   %eax,%eax
  movb   $0xff,-0x1(%rsi,%rcx,2)
  setg   %r12b
  cmp    %ecx,%edi
  setg   %r11b
  add    $0x1,%rcx
  test   %r11b,%r12b
  jne    L182
  test   %eax,%eax
  jne    L233
  jmp    L353
  xchg   %ax,%ax
  lea    0x1(%rdx),%ecx
  movslq %ecx,%rcx
  cmp    %edi,%edx
  jge    L233
  xchg   %ax,%ax
L236:
  movzbl (%r10),%edx
  sub    $0x1,%eax
  add    $0x2,%r10
  test   %eax,%eax
  mov    %dl,-0x2(%rsi,%rcx,2)
  setg   %r12b
  movzbl -0x1(%r10),%edx
  cmp    %ecx,%edi
  setg   %r11b
  mov    %dl,-0x1(%rsi,%rcx,2)
  mov    %ecx,%edx
  add    $0x1,%rcx
  test   %r11b,%r12b
  jne    L236
  test   %eax,%eax
  jne    L233
  jmp    L353
  nopl   0x0(%rax)
  lea    0x1(%rdx),%ecx
  movslq %ecx,%rcx
  cmp    %edi,%edx
  jge    L233
  mov    %r10,-0x18(%rsp)
  movzbl -0xf(%rsp),%r12d
  mov    %ebp,-0xc(%rsp)
  movzbl -0x10(%rsp),%ebp
  nopw   0x0(%rax,%rax,1)
L283:
  sub    $0x1,%eax
  mov    %r12b,-0x2(%rsi,%rcx,2)
  mov    %ecx,%edx
  test   %eax,%eax
  mov    %bpl,-0x1(%rsi,%rcx,2)
  setg   %r11b
  cmp    %ecx,%edi
  setg   %r10b
  add    $0x1,%rcx
  test   %r10b,%r11b
  jne    L283
  mov    -0x18(%rsp),%r10
  mov    -0xc(%rsp),%ebp
L639:
  test   %eax,%eax
  jne    L233
  jmp    L353
  nopw   0x0(%rax,%rax,1)
  lea    0x1(%rdx),%ecx
  movslq %ecx,%rcx
  cmp    %edi,%edx
  jl     L416
  jmp    L233
  nopw   0x0(%rax,%rax,1)
L61:
  movzbl -0xf(%rsp),%r11d
  movzbl -0x10(%rsp),%edx
  sub    $0x1,%eax
  xor    %ebp,%ebp
L398:
  cmp    %ecx,%edi
  mov    %r11b,-0x2(%rsi,%rcx,2)
  setg   %r12b
  test   %eax,%eax
  mov    %dl,-0x1(%rsi,%rcx,2)
  mov    %ecx,%edx
  setg   %r11b
  add    $0x1,%rcx
  test   %r11b,%r12b
  je     L587
L416:
  test   %ebp,%ebp
  jne    L61
  movzbl -0xe(%rsp),%r11d
  movzbl -0xd(%rsp),%edx
  mov    $0x1,%ebp
  jmp    L398
  nopw   0x0(%rax,%rax,1)
  test   %r8,%r8
  je     L754
  cmp    %edi,%edx
  jge    L233
  add    $0x1,%edx
  movslq %edx,%rcx
  mov    -0x30(%rsp),%edx
  test   %edx,%edx
  je     L48
  nopl   0x0(%rax,%rax,1)
L12:
  add    %r9d,%r9d
  mov    $0x1,%edx
  test   $0xfe,%r9b
  cmove  -0x30(%rsp),%ebx
  cmove  %edx,%r9d
  movzbl -0x2(%r8,%rcx,2),%edx
  test   %r9d,%ebx
  jne    L468
  sub    $0x1,%eax
  cmp    %ecx,%edi
  mov    %dl,-0x2(%rsi,%rcx,2)
  movzbl -0x1(%r8,%rcx,2),%edx
  setg   %r12b
  test   %eax,%eax
  setg   %r11b
  mov    %dl,-0x1(%rsi,%rcx,2)
  mov    %ecx,%edx
  add    $0x1,%rcx
  test   %r11b,%r12b
  jne    L12
  jmp    L587
  nopl   0x0(%rax)
L190:
  xor    -0x2a(%rsp),%dl
  mov    %dl,-0x2(%rsi,%rcx,2)
  movzbl -0x29(%rsp),%edx
  xor    -0x1(%r8,%rcx,2),%dl
L618:
  sub    $0x1,%eax
  mov    %dl,-0x1(%rsi,%rcx,2)
  mov    %ecx,%edx
  test   %eax,%eax
  setg   %r12b
  cmp    %ecx,%edi
  setg   %r11b
  add    $0x1,%rcx
  test   %r11b,%r12b
  je     L587
L48:
  add    %r9d,%r9d
  test   $0xfe,%r9b
  jne    L39
  movzbl (%r10),%ebx
  mov    $0x1,%r9d
  add    $0x1,%r10
L39:
  movzbl -0x2(%r8,%rcx,2),%edx
  test   %ebx,%r9d
  jne    L190
  mov    %dl,-0x2(%rsi,%rcx,2)
  movzbl -0x1(%r8,%rcx,2),%edx
  jmp    L618
  nopw   0x0(%rax,%rax,1)
  test   %r8,%r8
  je     L523
  lea    0x1(%rdx),%ecx
  movslq %ecx,%rcx
  cmp    %edi,%edx
  jge    L233
  mov    %r10,-0x18(%rsp)
  movzbl -0x29(%rsp),%r12d
  mov    %ebp,-0xc(%rsp)
  movzbl -0x2a(%rsp),%ebp
  nopl   0x0(%rax,%rax,1)
L397:
  movzbl -0x2(%r8,%rcx,2),%edx
  sub    $0x1,%eax
  xor    %ebp,%edx
  mov    %dl,-0x2(%rsi,%rcx,2)
  movzbl -0x1(%r8,%rcx,2),%edx
  xor    %r12d,%edx
  test   %eax,%eax
  setg   %r11b
  cmp    %ecx,%edi
  mov    %dl,-0x1(%rsi,%rcx,2)
  mov    %ecx,%edx
  setg   %r10b
  add    $0x1,%rcx
  test   %r10b,%r11b
  jne    L397
  mov    -0x18(%rsp),%r10
  mov    -0xc(%rsp),%ebp
  jmp    L639
  nopl   0x0(%rax)
  mov    -0x20(%rsp),%r12d
  test   %r12d,%r12d
  je     L214
  lea    (%rdx,%rdx,1),%ecx
  movslq %ecx,%rcx
  lea    0x1(%rsi,%rcx,1),%r11
  lea    (%rsi,%rcx,1),%r12
  mov    %r11,-0x20(%rsp)
  test   %r8,%r8
  je     L634
  movzbl -0x2a(%rsp),%r11d
  xor    (%r8,%rcx,1),%r11b
  mov    %r11b,(%r12)
  movzbl -0x29(%rsp),%r11d
  xor    0x1(%r8,%rcx,1),%r11b
  mov    %r11d,%ecx
L751:
  mov    -0x20(%rsp),%r11
  sub    $0x1,%eax
  add    $0x1,%edx
  mov    %cl,(%r11)
L214:
  cmp    %edi,%edx
  setl   %r11b
  test   %eax,%eax
  setg   %cl
  and    %ecx,%r11d
  test   %r8,%r8
  je     L24
  lea    0x1(%rdx),%ecx
  movslq %ecx,%rcx
  test   %r11b,%r11b
  je     L218
  nopl   0x0(%rax,%rax,1)
L761:
  movzbl -0x2(%r8,%rcx,2),%edx
  sub    $0x1,%eax
  test   %eax,%eax
  mov    %dl,-0x2(%rsi,%rcx,2)
  setg   %r12b
  movzbl -0x1(%r8,%rcx,2),%edx
  cmp    %ecx,%edi
  setg   %r11b
  mov    %dl,-0x1(%rsi,%rcx,2)
  mov    %ecx,%edx
  add    $0x1,%rcx
  test   %r11b,%r12b
  jne    L761
L218:
  mov    %r13d,-0x20(%rsp)
L781:
  test   %eax,%eax
  jne    L233
  jmp    L353
  nopl   0x0(%rax,%rax,1)
L442:
  movl   $0x0,-0x30(%rsp)
  mov    $0x1,%eax
  jmp    L903
  nopw   0x0(%rax,%rax,1)
L345:
  movl   $0x0,-0x30(%rsp)
  jmp    L674
  nopl   (%rax)
  mov    -0x30(%rsp),%r13d
  test   %r13d,%r13d
  jne    L133
  cmp    %edx,%edi
  jne    L664
  xor    %ecx,%ecx
  test   %r8,%r8
  je     L674
L664:
  movl   $0x1,-0x20(%rsp)
  xor    %ecx,%ecx
  jmp    L674
  nopl   0x0(%rax)
  movl   $0x5,-0x30(%rsp)
  mov    $0x2,%ecx
  mov    $0x5,%ebx
  jmp    L674
  nop
  movl   $0x3,-0x30(%rsp)
  mov    $0x2,%ecx
  mov    $0x3,%ebx
  jmp    L674
  nopw   0x0(%rax,%rax,1)
  movzbl (%r10),%ecx
  lea    0x2(%r10),%r9
  mov    %cl,-0xe(%rsp)
  movzbl 0x1(%r10),%ecx
  mov    %cl,-0xd(%rsp)
  mov    $0x8,%ecx
L82:
  movzbl (%r9),%r10d
  movl   $0x0,-0x30(%rsp)
  mov    %r10b,-0xf(%rsp)
  lea    0x2(%r9),%r10
  movzbl 0x1(%r9),%r9d
  mov    %r9b,-0x10(%rsp)
  jmp    L674
  mov    %r10,%r9
  jmp    L82
  nopl   0x0(%rax,%rax,1)
L468:
  xor    -0x2a(%rsp),%dl
  sub    $0x1,%eax
  mov    %dl,-0x2(%rsi,%rcx,2)
  movzbl -0x29(%rsp),%edx
  xor    -0x1(%r8,%rcx,2),%dl
  test   %eax,%eax
  setg   %r12b
  cmp    %ecx,%edi
  mov    %dl,-0x1(%rsi,%rcx,2)
  mov    %ecx,%edx
  setg   %r11b
  add    $0x1,%rcx
  test   %r11b,%r12b
  jne    L12
  test   %eax,%eax
  jne    L233
  jmp    L353
  nopl   0x0(%rax)
L754:
  cmp    %edi,%edx
  jge    L233
  mov    -0x30(%rsp),%r11d
  add    $0x1,%edx
  movslq %edx,%rcx
  test   %r11d,%r11d
  je     L393
  jmp    L851
  xchg   %ax,%ax
L667:
  movb   $0x0,-0x2(%rsi,%rcx,2)
  movb   $0x0,-0x1(%rsi,%rcx,2)
L469:
  sub    $0x1,%eax
  cmp    %ecx,%edi
  mov    %ecx,%edx
  setg   %r12b
  test   %eax,%eax
  setg   %r11b
  add    $0x1,%rcx
  test   %r11b,%r12b
  je     L587
L851:
  add    %r9d,%r9d
  mov    $0x1,%edx
  test   $0xfe,%r9b
  cmove  -0x30(%rsp),%ebx
  cmove  %edx,%r9d
  test   %r9d,%ebx
  je     L667
  movzbl -0x2a(%rsp),%edx
  mov    %dl,-0x2(%rsi,%rcx,2)
  movzbl -0x29(%rsp),%edx
  mov    %dl,-0x1(%rsi,%rcx,2)
  jmp    L469
  cs nopw 0x0(%rax,%rax,1)
L330:
  movzbl -0x2a(%rsp),%edx
  sub    $0x1,%eax
  test   %eax,%eax
  mov    %dl,-0x2(%rsi,%rcx,2)
  setg   %r12b
  movzbl -0x29(%rsp),%edx
  cmp    %ecx,%edi
  setg   %r11b
  mov    %dl,-0x1(%rsi,%rcx,2)
  mov    %ecx,%edx
  add    $0x1,%rcx
  test   %r11b,%r12b
  je     L587
L393:
  add    %r9d,%r9d
  test   $0xfe,%r9b
  jne    L543
  movzbl (%r10),%ebx
  mov    $0x1,%r9d
  add    $0x1,%r10
L543:
  test   %ebx,%r9d
  jne    L330
  sub    $0x1,%eax
  cmp    %ecx,%edi
  movb   $0x0,-0x2(%rsi,%rcx,2)
  mov    %ecx,%edx
  setg   %r12b
  test   %eax,%eax
  movb   $0x0,-0x1(%rsi,%rcx,2)
  setg   %r11b
  add    $0x1,%rcx
  test   %r11b,%r12b
  jne    L393
  jmp    L587
  nopl   (%rax)
L523:
  cmp    %edi,%edx
  jge    L233
  mov    %r10,-0x18(%rsp)
  add    $0x1,%edx
  movzbl -0x29(%rsp),%r12d
  mov    %ebp,-0xc(%rsp)
  movzbl -0x2a(%rsp),%ebp
  movslq %edx,%rcx
  nopw   0x0(%rax,%rax,1)
L670:
  sub    $0x1,%eax
  mov    %bpl,-0x2(%rsi,%rcx,2)
  mov    %ecx,%edx
  test   %eax,%eax
  mov    %r12b,-0x1(%rsi,%rcx,2)
  setg   %r11b
  cmp    %ecx,%edi
  setg   %r10b
  add    $0x1,%rcx
  test   %r10b,%r11b
  jne    L670
  mov    -0x18(%rsp),%r10
  mov    -0xc(%rsp),%ebp
  jmp    L639
  nopw   0x0(%rax,%rax,1)
L24:
  test   %r11b,%r11b
  je     L218
  add    $0x1,%edx
  movslq %edx,%rcx
  nopw   0x0(%rax,%rax,1)
L690:
  sub    $0x1,%eax
  movb   $0x0,-0x2(%rsi,%rcx,2)
  mov    %ecx,%edx
  test   %eax,%eax
  movb   $0x0,-0x1(%rsi,%rcx,2)
  setg   %r12b
  cmp    %ecx,%edi
  setg   %r11b
  add    $0x1,%rcx
  test   %r11b,%r12b
  jne    L690
  mov    %r13d,-0x20(%rsp)
  jmp    L781
  xchg   %ax,%ax
L634:
  movzbl -0x2a(%rsp),%ecx
  mov    %cl,(%r12)
  movzbl -0x29(%rsp),%ecx
  jmp    L751
  nopl   0x0(%rax,%rax,1)
L133:
  movl   $0x0,-0x30(%rsp)
  xor    %ecx,%ecx
  jmp    L674
  mov    %r10,%r9
  mov    $0x3,%ecx
  jmp    L82
```

assistant: ```c
int bitmap_decompress2(char *output, int width, int height, char *input, int size) {
  char *prevline;
  char *line;
  char *end;
  char color1[2];
  char color2[2];
  char mix[2];
  int code;
  int mixmask;
  int mask;
  int opcode;
  int count;
  int offset;
  int isfillormix;
  int x;
  int lastopcode;
  int insertmix;
  int bicolor;
  int fom_mask;
  end = input + size;
  prevline = 0;
  line = 0;
  x = width;
  lastopcode = -1;
  insertmix = 0;
  bicolor = 0;
  color1[0] = 0;
  color1[1] = 0;
  color2[0] = 0;
  color2[1] = 0;
  mix[0] = 0xff;
  mix[1] = 0xff;
  mask = 0;
  fom_mask = 0;
  while (input < end) {
    fom_mask = 0;
    code = ((unsigned char)(*(input++)));
    opcode = code >> 4;
    switch (opcode) {
    case 0xc:
    case 0xd:
    case 0xe:
      opcode -= 6;
      count = code & 0xf;
      offset = 16;
      break;
    case 0xf:
      opcode = code & 0xf;
      if (opcode < 9) {
        count = ((unsigned char)(*(input++)));
        count |= ((unsigned char)(*(input++))) << 8;
      } else {
        count = (opcode < 0xb) ? 8 : 1;
      }
      offset = 0;
      break;
    default:
      opcode >>= 1;
      count = code & 0x1f;
      offset = 32;
      break;
    }
    if (offset != 0) {
      isfillormix = ((opcode == 2) || (opcode == 7));
      if (count == 0) {
        if (isfillormix) {
          count = ((unsigned char)(*(input++))) + 1;
        } else {
          count = ((unsigned char)(*(input++))) + offset;
        }
      } else if (isfillormix) {
        count <<= 3;
      }
    }
    switch (opcode) {
    case 0:
      if ((lastopcode == opcode) && !((x == width) && (prevline == 0))) {
        insertmix = 1;
      }
      break;
    case 8:
      color1[0] = ((unsigned char)(*(input++)));
      color1[1] = ((unsigned char)(*(input++)));
    case 3:
      color2[0] = ((unsigned char)(*(input++)));
      color2[1] = ((unsigned char)(*(input++)));
      break;
    case 6:
    case 7:
      mix[0] = ((unsigned char)(*(input++)));
      mix[1] = ((unsigned char)(*(input++)));
      opcode -= 5;
      break;
    case 9:
      mask = 0x03;
      opcode = 0x02;
      fom_mask = 3;
      break;
    case 0x0a:
      mask = 0x05;
      opcode = 0x02;
      fom_mask = 5;
      break;
    }
    lastopcode = opcode;
    mixmask = 0;
    while (count > 0) {
      if (x >= width) {
        if (height <= 0) {
          return 0;
        }
        x = 0;
        height--;
        prevline = line;
        line = output + height * (width * 2);
      }
      switch (opcode) {
      case 0:
        if (insertmix) {
          if (prevline == 0) {
            line[x * 2 + 0] = mix[0];
            line[x * 2 + 1] = mix[1];
          } else {
            line[x * 2 + 0] = prevline[x * 2 + 0] ^ mix[0];
            line[x * 2 + 1] = prevline[x * 2 + 1] ^ mix[1];
          }
          insertmix = 0;
          count--;
          x++;
        }
        if (prevline == 0) {
          {
            while ((count > 0) && (x < width)) {
              line[x * 2 + 0] = 0;
              line[x * 2 + 1] = 0;
              ;
              count--;
              x++;
            }
          }
        } else {
          {
            while ((count > 0) && (x < width)) {
              line[x * 2 + 0] = prevline[x * 2 + 0];
              line[x * 2 + 1] = prevline[x * 2 + 1];
              ;
              count--;
              x++;
            }
          }
        }
        break;
      case 1:
        if (prevline == 0) {
          {
            while ((count > 0) && (x < width)) {
              line[x * 2 + 0] = mix[0];
              line[x * 2 + 1] = mix[1];
              ;
              count--;
              x++;
            }
          }
        } else {
          {
            while ((count > 0) && (x < width)) {
              line[x * 2 + 0] = prevline[x * 2 + 0] ^ mix[0];
              line[x * 2 + 1] = prevline[x * 2 + 1] ^ mix[1];
              ;
              count--;
              x++;
            }
          }
        }
        break;
      case 2:
        if (prevline == 0) {
          {
            while ((count > 0) && (x < width)) {
              {
                mixmask <<= 1;
                if ((mixmask & 0xff) == 0) {
                  mask = fom_mask ? fom_mask : ((unsigned char)(*(input++)));
                  mixmask = 1;
                }
              };
              if (mask & mixmask) {
                line[x * 2 + 0] = mix[0];
                line[x * 2 + 1] = mix[1];
              } else {
                line[x * 2 + 0] = 0;
                line[x * 2 + 1] = 0;
              };
              count--;
              x++;
            }
          }
        } else {
          {
            while ((count > 0) && (x < width)) {
              {
                mixmask <<= 1;
                if ((mixmask & 0xff) == 0) {
                  mask = fom_mask ? fom_mask : ((unsigned char)(*(input++)));
                  mixmask = 1;
                }
              };
              if (mask & mixmask) {
                line[x * 2 + 0] = prevline[x * 2 + 0] ^ mix[0];
                line[x * 2 + 1] = prevline[x * 2 + 1] ^ mix[1];
              } else {
                line[x * 2 + 0] = prevline[x * 2 + 0];
                line[x * 2 + 1] = prevline[x * 2 + 1];
              };
              count--;
              x++;
            }
          }
        }
        break;
      case 3: {
        while ((count > 0) && (x < width)) {
          line[x * 2 + 0] = color2[0];
          line[x * 2 + 1] = color2[1];
          ;
          count--;
          x++;
        }
      } break;
      case 4: {
        while ((count > 0) && (x < width)) {
          line[x * 2 + 0] = ((unsigned char)(*(input++)));
          line[x * 2 + 1] = ((unsigned char)(*(input++)));
          ;
          count--;
          x++;
        }
      } break;
      case 8: {
        while ((count > 0) && (x < width)) {
          if (bicolor) {
            line[x * 2 + 0] = color2[0];
            line[x * 2 + 1] = color2[1];
            bicolor = 0;
          } else {
            line[x * 2 + 0] = color1[0];
            line[x * 2 + 1] = color1[1];
            bicolor = 1;
            count++;
          };
          count--;
          x++;
        }
      } break;
      case 0xd: {
        while ((count > 0) && (x < width)) {
          line[x * 2 + 0] = 0xff;
          line[x * 2 + 1] = 0xff;
          ;
          count--;
          x++;
        }
      } break;
      case 0xe: {
        while ((count > 0) && (x < width)) {
          line[x * 2 + 0] = 0;
          line[x * 2 + 1] = 0;
          ;
          count--;
          x++;
        }
      } break;
      default:
        return 0;
        break;
      }
    }
  }
  return 1;
}
```