user: 请将以下的汇编代码转换成C语言代码:

```asm
<bytemapmag>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x90,%rsp
  mov    %rdi,-0x78(%rbp)
  mov    %esi,-0x7c(%rbp)
  mov    %edx,-0x80(%rbp)
  mov    %ecx,-0x84(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x38(%rbp)
  movl   $0x0,-0x60(%rbp)
  movl   $0x0,-0x5c(%rbp)
  movl   $0xffffffff,-0x58(%rbp)
  movl   $0x0,-0x54(%rbp)
  movl   $0x1,-0x50(%rbp)
  movl   $0x40,-0x4c(%rbp)
  cmpq   $0x0,-0x78(%rbp)
  je     L164
  cmpl   $0x0,-0x7c(%rbp)
  jle    L791
  cmpl   $0x0,-0x80(%rbp)
  jle    L791
  mov    -0x7c(%rbp),%eax
  imul   -0x80(%rbp),%eax
  cmp    $0x186a0,%eax
  jg     L258
  cmpl   $0x0,-0x84(%rbp)
  jle    L1088
  cmpl   $0xa,-0x84(%rbp)
  jg     L1088
  mov    -0x84(%rbp),%eax
  imul   -0x7c(%rbp),%eax
  imul   -0x84(%rbp),%eax
  imul   -0x80(%rbp),%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x38(%rbp)
  cmpq   $0x0,-0x38(%rbp)
  je     L446
  movl   $0x0,-0x68(%rbp)
  jmp    L394
L988:
  movl   $0x0,-0x64(%rbp)
  jmp    L624
L1093:
  mov    -0x7c(%rbp),%eax
  imul   -0x84(%rbp),%eax
  imul   -0x68(%rbp),%eax
  mov    %eax,%edx
  mov    -0x64(%rbp),%eax
  add    %eax,%edx
  mov    -0x84(%rbp),%eax
  imul   %edx,%eax
  mov    %eax,-0x48(%rbp)
  addl   $0x1,-0x58(%rbp)
  mov    -0x58(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x54(%rbp)
  movl   $0x0,-0x60(%rbp)
  jmp    L236
L60:
  movl   $0x0,-0x5c(%rbp)
  jmp    L131
L449:
  mov    -0x7c(%rbp),%eax
  imul   -0x84(%rbp),%eax
  imul   -0x60(%rbp),%eax
  mov    %eax,%edx
  mov    -0x5c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x44(%rbp)
  mov    -0x48(%rbp),%edx
  mov    -0x44(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x40(%rbp)
  mov    -0x40(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    -0x54(%rbp),%edx
  mov    %dl,(%rax)
  cmpl   $0x0,-0x50(%rbp)
  je     L1039
  mov    -0x5c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x84(%rbp),%eax
  imul   -0x60(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x3c(%rbp)
  mov    -0x54(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x64(%rbp)
  jle    L670
  mov    -0x58(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  jmp    L601
L670:
  mov    -0x54(%rbp),%eax
L601:
  mov    %eax,-0x20(%rbp)
  mov    -0x64(%rbp),%eax
  cmp    -0x7c(%rbp),%eax
  jge    L63
  mov    -0x58(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  jmp    L218
L63:
  mov    -0x54(%rbp),%eax
L218:
  mov    %eax,-0x18(%rbp)
  cmpl   $0x0,-0x68(%rbp)
  jle    L871
  mov    -0x58(%rbp),%eax
  sub    -0x7c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  jmp    L818
L871:
  mov    -0x54(%rbp),%eax
L818:
  mov    %eax,-0x28(%rbp)
  mov    -0x68(%rbp),%eax
  cmp    -0x80(%rbp),%eax
  jge    L883
  mov    -0x58(%rbp),%edx
  mov    -0x7c(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  jmp    L233
L883:
  mov    -0x54(%rbp),%eax
L233:
  mov    %eax,-0x10(%rbp)
  cmpl   $0x0,-0x68(%rbp)
  jle    L567
  cmpl   $0x0,-0x64(%rbp)
  jle    L567
  mov    -0x58(%rbp),%eax
  sub    -0x7c(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  jmp    L81
L567:
  mov    -0x54(%rbp),%eax
L81:
  mov    %eax,-0x2c(%rbp)
  cmpl   $0x0,-0x68(%rbp)
  jle    L796
  mov    -0x64(%rbp),%eax
  cmp    -0x7c(%rbp),%eax
  jge    L796
  mov    -0x58(%rbp),%eax
  sub    -0x7c(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  jmp    L428
L796:
  mov    -0x54(%rbp),%eax
L428:
  mov    %eax,-0x24(%rbp)
  mov    -0x68(%rbp),%eax
  cmp    -0x80(%rbp),%eax
  jge    L373
  cmpl   $0x0,-0x64(%rbp)
  jle    L373
  mov    -0x58(%rbp),%edx
  mov    -0x7c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  jmp    L88
L373:
  mov    -0x54(%rbp),%eax
L88:
  mov    %eax,-0x14(%rbp)
  mov    -0x68(%rbp),%eax
  cmp    -0x80(%rbp),%eax
  jge    L116
  mov    -0x64(%rbp),%eax
  cmp    -0x7c(%rbp),%eax
  jge    L116
  mov    -0x58(%rbp),%edx
  mov    -0x7c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  jmp    L1036
L116:
  mov    -0x54(%rbp),%eax
L1036:
  mov    %eax,-0xc(%rbp)
  cmpl   $0x2,-0x84(%rbp)
  je     L980
  cmpl   $0x3,-0x84(%rbp)
  je     L825
  jmp    L1039
L980:
  cmpl   $0x1,-0x3c(%rbp)
  jne    L78
  mov    -0x20(%rbp),%eax
  mov    -0x28(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jl     L78
  mov    -0x20(%rbp),%eax
  mov    -0x10(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L78
  mov    -0x28(%rbp),%eax
  mov    -0x18(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L78
  mov    -0x28(%rbp),%edx
  mov    -0x40(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  mov    %dl,(%rax)
L78:
  cmpl   $0x2,-0x3c(%rbp)
  jne    L607
  mov    -0x28(%rbp),%eax
  mov    -0x18(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jl     L607
  mov    -0x28(%rbp),%eax
  mov    -0x20(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L607
  mov    -0x18(%rbp),%eax
  mov    -0x10(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L607
  mov    -0x18(%rbp),%edx
  mov    -0x40(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  mov    %dl,(%rax)
L607:
  cmpl   $0x4,-0x3c(%rbp)
  jne    L152
  mov    -0x18(%rbp),%eax
  mov    -0x10(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jl     L152
  mov    -0x18(%rbp),%eax
  mov    -0x28(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L152
  mov    -0x10(%rbp),%eax
  mov    -0x20(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L152
  mov    -0x10(%rbp),%edx
  mov    -0x40(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  mov    %dl,(%rax)
L152:
  cmpl   $0x3,-0x3c(%rbp)
  jne    L867
  mov    -0x10(%rbp),%eax
  mov    -0x20(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jl     L867
  mov    -0x10(%rbp),%eax
  mov    -0x18(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L867
  mov    -0x20(%rbp),%eax
  mov    -0x28(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L867
  mov    -0x20(%rbp),%edx
  mov    -0x40(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  mov    %dl,(%rax)
  jmp    L867
L825:
  cmpl   $0x1,-0x3c(%rbp)
  jne    L344
  mov    -0x20(%rbp),%eax
  mov    -0x28(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jl     L344
  mov    -0x20(%rbp),%eax
  mov    -0x10(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L344
  mov    -0x28(%rbp),%eax
  mov    -0x18(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L344
  mov    -0x20(%rbp),%edx
  mov    -0x40(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  mov    %dl,(%rax)
L344:
  cmpl   $0x2,-0x3c(%rbp)
  jne    L1037
  mov    -0x20(%rbp),%eax
  mov    -0x28(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jl     L618
  mov    -0x20(%rbp),%eax
  mov    -0x10(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L618
  mov    -0x28(%rbp),%eax
  mov    -0x18(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L618
  mov    -0x1c(%rbp),%eax
  mov    -0x24(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jl     L488
L618:
  mov    -0x28(%rbp),%eax
  mov    -0x18(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jl     L1037
  mov    -0x28(%rbp),%eax
  mov    -0x20(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L1037
  mov    -0x18(%rbp),%eax
  mov    -0x10(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L1037
  mov    -0x1c(%rbp),%eax
  mov    -0x2c(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L1037
L488:
  mov    -0x28(%rbp),%edx
  mov    -0x40(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  mov    %dl,(%rax)
L1037:
  cmpl   $0x3,-0x3c(%rbp)
  jne    L1145
  mov    -0x28(%rbp),%eax
  mov    -0x18(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jl     L1145
  mov    -0x28(%rbp),%eax
  mov    -0x20(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L1145
  mov    -0x18(%rbp),%eax
  mov    -0x10(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L1145
  mov    -0x18(%rbp),%edx
  mov    -0x40(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  mov    %dl,(%rax)
L1145:
  cmpl   $0x4,-0x3c(%rbp)
  jne    L386
  mov    -0x10(%rbp),%eax
  mov    -0x20(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jl     L1024
  mov    -0x10(%rbp),%eax
  mov    -0x18(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L1024
  mov    -0x20(%rbp),%eax
  mov    -0x28(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L1024
  mov    -0x1c(%rbp),%eax
  mov    -0x2c(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jl     L372
L1024:
  mov    -0x20(%rbp),%eax
  mov    -0x28(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jl     L386
  mov    -0x20(%rbp),%eax
  mov    -0x10(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L386
  mov    -0x28(%rbp),%eax
  mov    -0x18(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L386
  mov    -0x1c(%rbp),%eax
  mov    -0x14(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L386
L372:
  mov    -0x20(%rbp),%edx
  mov    -0x40(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  mov    %dl,(%rax)
L386:
  cmpl   $0x6,-0x3c(%rbp)
  jne    L746
  mov    -0x28(%rbp),%eax
  mov    -0x18(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jl     L10
  mov    -0x28(%rbp),%eax
  mov    -0x20(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L10
  mov    -0x18(%rbp),%eax
  mov    -0x10(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L10
  mov    -0x1c(%rbp),%eax
  mov    -0xc(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jl     L807
L10:
  mov    -0x18(%rbp),%eax
  mov    -0x10(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jl     L746
  mov    -0x18(%rbp),%eax
  mov    -0x28(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L746
  mov    -0x10(%rbp),%eax
  mov    -0x20(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L746
  mov    -0x1c(%rbp),%eax
  mov    -0x24(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L746
L807:
  mov    -0x18(%rbp),%edx
  mov    -0x40(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  mov    %dl,(%rax)
L746:
  cmpl   $0x7,-0x3c(%rbp)
  jne    L250
  mov    -0x10(%rbp),%eax
  mov    -0x20(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jl     L250
  mov    -0x10(%rbp),%eax
  mov    -0x18(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L250
  mov    -0x20(%rbp),%eax
  mov    -0x28(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L250
  mov    -0x20(%rbp),%edx
  mov    -0x40(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  mov    %dl,(%rax)
L250:
  cmpl   $0x8,-0x3c(%rbp)
  jne    L922
  mov    -0x18(%rbp),%eax
  mov    -0x10(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jl     L939
  mov    -0x18(%rbp),%eax
  mov    -0x28(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L939
  mov    -0x10(%rbp),%eax
  mov    -0x20(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L939
  mov    -0x1c(%rbp),%eax
  mov    -0x14(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jl     L954
L939:
  mov    -0x10(%rbp),%eax
  mov    -0x20(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jl     L922
  mov    -0x10(%rbp),%eax
  mov    -0x18(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L922
  mov    -0x20(%rbp),%eax
  mov    -0x28(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L922
  mov    -0x1c(%rbp),%eax
  mov    -0xc(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L922
L954:
  mov    -0x10(%rbp),%edx
  mov    -0x40(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  mov    %dl,(%rax)
L922:
  cmpl   $0x9,-0x3c(%rbp)
  jne    L237
  mov    -0x18(%rbp),%eax
  mov    -0x10(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jl     L237
  mov    -0x18(%rbp),%eax
  mov    -0x28(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L237
  mov    -0x10(%rbp),%eax
  mov    -0x20(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jge    L237
  mov    -0x18(%rbp),%edx
  mov    -0x40(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  mov    %dl,(%rax)
  jmp    L237
L867:
  nop
  jmp    L1039
L237:
  nop
L1039:
  addl   $0x1,-0x5c(%rbp)
L131:
  mov    -0x5c(%rbp),%eax
  cmp    -0x84(%rbp),%eax
  jl     L449
  addl   $0x1,-0x60(%rbp)
L236:
  mov    -0x60(%rbp),%eax
  cmp    -0x84(%rbp),%eax
  jl     L60
  addl   $0x1,-0x64(%rbp)
L624:
  mov    -0x64(%rbp),%eax
  cmp    -0x7c(%rbp),%eax
  jl     L1093
  addl   $0x1,-0x68(%rbp)
L394:
  mov    -0x68(%rbp),%eax
  cmp    -0x80(%rbp),%eax
  jl     L988
  jmp    L446
L164:
  nop
  jmp    L785
L791:
  nop
  jmp    L785
L258:
  nop
  jmp    L785
L1088:
  nop
  jmp    L785
L446:
  nop
L785:
  mov    -0x38(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L776
  call   <__stack_chk_fail@plt>
L776:
  leave
  ret
```

assistant: ```c
unsigned char *bytemapmag(unsigned char *bytemap, int width, int height, int magstep) {
  unsigned char *magnified = NULL;
  int irow, icol, mrow = 0, mcol = 0;
  int imap = (-1), byteval = 0;
  int isAdvMAME = 1;
  int icell[10], bmmdiff = 64;
  if (bytemap == NULL)
    goto end_of_job;
  if (width < 1 || height < 1)
    goto end_of_job;
  if (width * height > 100000)
    goto end_of_job;
  if (magstep < 1 || magstep > 10)
    goto end_of_job;
  if ((magnified = (unsigned char *)(malloc(magstep * width * magstep * height))) != NULL)
    for (irow = 0; irow < height; irow++)
      for (icol = 0; icol < width; icol++) {
        int imag1 = (icol + irow * (width * magstep)) * magstep;
        imap++;
        byteval = (int)(bytemap[imap]);
        for (mrow = 0; mrow < magstep; mrow++)
          for (mcol = 0; mcol < magstep; mcol++) {
            int idup = mcol + mrow * (width * magstep);
            int imag = imag1 + idup;
            magnified[imag] = (unsigned char)(byteval);
            if (isAdvMAME) {
              int mcell = 1 + mcol + magstep * mrow;
              icell[5] = byteval, icell[4] = (icol > 0 ? (int)(bytemap[imap - 1]) : byteval), icell[6] = (icol < width ? (int)(bytemap[imap + 1]) : byteval), icell[2] = (irow > 0 ? (int)(bytemap[imap - width]) : byteval), icell[8] = (irow < height ? (int)(bytemap[imap + width]) : byteval), icell[1] = (irow > 0 && icol > 0 ? (int)(bytemap[imap - width - 1]) : byteval), icell[3] = (irow > 0 && icol < width ? (int)(bytemap[imap - width + 1]) : byteval), icell[7] = (irow < height && icol > 0 ? (int)(bytemap[imap + width - 1]) : byteval), icell[9] = (irow < height && icol < width ? (int)(bytemap[imap + width + 1]) : byteval);
              switch (magstep) {
              default:
                break;
              case 2:
                if (mcell == 1)
                  if ((((((icell[4] - icell[2])) >= 0 ? ((icell[4] - icell[2])) : (-((icell[4] - icell[2])))) <= bmmdiff)) && !(((((icell[4] - icell[8])) >= 0 ? ((icell[4] - icell[8])) : (-((icell[4] - icell[8])))) <= bmmdiff)) && !(((((icell[2] - icell[6])) >= 0 ? ((icell[2] - icell[6])) : (-((icell[2] - icell[6])))) <= bmmdiff)))
                    magnified[imag] = icell[2];
                if (mcell == 2)
                  if ((((((icell[2] - icell[6])) >= 0 ? ((icell[2] - icell[6])) : (-((icell[2] - icell[6])))) <= bmmdiff)) && !(((((icell[2] - icell[4])) >= 0 ? ((icell[2] - icell[4])) : (-((icell[2] - icell[4])))) <= bmmdiff)) && !(((((icell[6] - icell[8])) >= 0 ? ((icell[6] - icell[8])) : (-((icell[6] - icell[8])))) <= bmmdiff)))
                    magnified[imag] = icell[6];
                if (mcell == 4)
                  if ((((((icell[6] - icell[8])) >= 0 ? ((icell[6] - icell[8])) : (-((icell[6] - icell[8])))) <= bmmdiff)) && !(((((icell[6] - icell[2])) >= 0 ? ((icell[6] - icell[2])) : (-((icell[6] - icell[2])))) <= bmmdiff)) && !(((((icell[8] - icell[4])) >= 0 ? ((icell[8] - icell[4])) : (-((icell[8] - icell[4])))) <= bmmdiff)))
                    magnified[imag] = icell[8];
                if (mcell == 3)
                  if ((((((icell[8] - icell[4])) >= 0 ? ((icell[8] - icell[4])) : (-((icell[8] - icell[4])))) <= bmmdiff)) && !(((((icell[8] - icell[6])) >= 0 ? ((icell[8] - icell[6])) : (-((icell[8] - icell[6])))) <= bmmdiff)) && !(((((icell[4] - icell[2])) >= 0 ? ((icell[4] - icell[2])) : (-((icell[4] - icell[2])))) <= bmmdiff)))
                    magnified[imag] = icell[4];
                break;
              case 3:
                if (mcell == 1)
                  if ((((((icell[4] - icell[2])) >= 0 ? ((icell[4] - icell[2])) : (-((icell[4] - icell[2])))) <= bmmdiff)) && !(((((icell[4] - icell[8])) >= 0 ? ((icell[4] - icell[8])) : (-((icell[4] - icell[8])))) <= bmmdiff)) && !(((((icell[2] - icell[6])) >= 0 ? ((icell[2] - icell[6])) : (-((icell[2] - icell[6])))) <= bmmdiff)))
                    magnified[imag] = icell[4];
                if (mcell == 2)
                  if (((((((icell[4] - icell[2])) >= 0 ? ((icell[4] - icell[2])) : (-((icell[4] - icell[2])))) <= bmmdiff)) && !(((((icell[4] - icell[8])) >= 0 ? ((icell[4] - icell[8])) : (-((icell[4] - icell[8])))) <= bmmdiff)) && !(((((icell[2] - icell[6])) >= 0 ? ((icell[2] - icell[6])) : (-((icell[2] - icell[6])))) <= bmmdiff)) && !(((((icell[5] - icell[3])) >= 0 ? ((icell[5] - icell[3])) : (-((icell[5] - icell[3])))) <= bmmdiff))) || ((((((icell[2] - icell[6])) >= 0 ? ((icell[2] - icell[6])) : (-((icell[2] - icell[6])))) <= bmmdiff)) && !(((((icell[2] - icell[4])) >= 0 ? ((icell[2] - icell[4])) : (-((icell[2] - icell[4])))) <= bmmdiff)) && !(((((icell[6] - icell[8])) >= 0 ? ((icell[6] - icell[8])) : (-((icell[6] - icell[8])))) <= bmmdiff)) && !(((((icell[5] - icell[1])) >= 0 ? ((icell[5] - icell[1])) : (-((icell[5] - icell[1])))) <= bmmdiff))))
                    magnified[imag] = icell[2];
                if (mcell == 3)
                  if ((((((icell[2] - icell[6])) >= 0 ? ((icell[2] - icell[6])) : (-((icell[2] - icell[6])))) <= bmmdiff)) && !(((((icell[2] - icell[4])) >= 0 ? ((icell[2] - icell[4])) : (-((icell[2] - icell[4])))) <= bmmdiff)) && !(((((icell[6] - icell[8])) >= 0 ? ((icell[6] - icell[8])) : (-((icell[6] - icell[8])))) <= bmmdiff)))
                    magnified[imag] = icell[6];
                if (mcell == 4)
                  if (((((((icell[8] - icell[4])) >= 0 ? ((icell[8] - icell[4])) : (-((icell[8] - icell[4])))) <= bmmdiff)) && !(((((icell[8] - icell[6])) >= 0 ? ((icell[8] - icell[6])) : (-((icell[8] - icell[6])))) <= bmmdiff)) && !(((((icell[4] - icell[2])) >= 0 ? ((icell[4] - icell[2])) : (-((icell[4] - icell[2])))) <= bmmdiff)) && !(((((icell[5] - icell[1])) >= 0 ? ((icell[5] - icell[1])) : (-((icell[5] - icell[1])))) <= bmmdiff))) || ((((((icell[4] - icell[2])) >= 0 ? ((icell[4] - icell[2])) : (-((icell[4] - icell[2])))) <= bmmdiff)) && !(((((icell[4] - icell[8])) >= 0 ? ((icell[4] - icell[8])) : (-((icell[4] - icell[8])))) <= bmmdiff)) && !(((((icell[2] - icell[6])) >= 0 ? ((icell[2] - icell[6])) : (-((icell[2] - icell[6])))) <= bmmdiff)) && !(((((icell[5] - icell[7])) >= 0 ? ((icell[5] - icell[7])) : (-((icell[5] - icell[7])))) <= bmmdiff))))
                    magnified[imag] = icell[4];
                if (mcell == 6)
                  if (((((((icell[2] - icell[6])) >= 0 ? ((icell[2] - icell[6])) : (-((icell[2] - icell[6])))) <= bmmdiff)) && !(((((icell[2] - icell[4])) >= 0 ? ((icell[2] - icell[4])) : (-((icell[2] - icell[4])))) <= bmmdiff)) && !(((((icell[6] - icell[8])) >= 0 ? ((icell[6] - icell[8])) : (-((icell[6] - icell[8])))) <= bmmdiff)) && !(((((icell[5] - icell[9])) >= 0 ? ((icell[5] - icell[9])) : (-((icell[5] - icell[9])))) <= bmmdiff))) || ((((((icell[6] - icell[8])) >= 0 ? ((icell[6] - icell[8])) : (-((icell[6] - icell[8])))) <= bmmdiff)) && !(((((icell[6] - icell[2])) >= 0 ? ((icell[6] - icell[2])) : (-((icell[6] - icell[2])))) <= bmmdiff)) && !(((((icell[8] - icell[4])) >= 0 ? ((icell[8] - icell[4])) : (-((icell[8] - icell[4])))) <= bmmdiff)) && !(((((icell[5] - icell[3])) >= 0 ? ((icell[5] - icell[3])) : (-((icell[5] - icell[3])))) <= bmmdiff))))
                    magnified[imag] = icell[6];
                if (mcell == 7)
                  if ((((((icell[8] - icell[4])) >= 0 ? ((icell[8] - icell[4])) : (-((icell[8] - icell[4])))) <= bmmdiff)) && !(((((icell[8] - icell[6])) >= 0 ? ((icell[8] - icell[6])) : (-((icell[8] - icell[6])))) <= bmmdiff)) && !(((((icell[4] - icell[2])) >= 0 ? ((icell[4] - icell[2])) : (-((icell[4] - icell[2])))) <= bmmdiff)))
                    magnified[imag] = icell[4];
                if (mcell == 8)
                  if (((((((icell[6] - icell[8])) >= 0 ? ((icell[6] - icell[8])) : (-((icell[6] - icell[8])))) <= bmmdiff)) && !(((((icell[6] - icell[2])) >= 0 ? ((icell[6] - icell[2])) : (-((icell[6] - icell[2])))) <= bmmdiff)) && !(((((icell[8] - icell[4])) >= 0 ? ((icell[8] - icell[4])) : (-((icell[8] - icell[4])))) <= bmmdiff)) && !(((((icell[5] - icell[7])) >= 0 ? ((icell[5] - icell[7])) : (-((icell[5] - icell[7])))) <= bmmdiff))) || ((((((icell[8] - icell[4])) >= 0 ? ((icell[8] - icell[4])) : (-((icell[8] - icell[4])))) <= bmmdiff)) && !(((((icell[8] - icell[6])) >= 0 ? ((icell[8] - icell[6])) : (-((icell[8] - icell[6])))) <= bmmdiff)) && !(((((icell[4] - icell[2])) >= 0 ? ((icell[4] - icell[2])) : (-((icell[4] - icell[2])))) <= bmmdiff)) && !(((((icell[5] - icell[9])) >= 0 ? ((icell[5] - icell[9])) : (-((icell[5] - icell[9])))) <= bmmdiff))))
                    magnified[imag] = icell[8];
                if (mcell == 9)
                  if ((((((icell[6] - icell[8])) >= 0 ? ((icell[6] - icell[8])) : (-((icell[6] - icell[8])))) <= bmmdiff)) && !(((((icell[6] - icell[2])) >= 0 ? ((icell[6] - icell[2])) : (-((icell[6] - icell[2])))) <= bmmdiff)) && !(((((icell[8] - icell[4])) >= 0 ? ((icell[8] - icell[4])) : (-((icell[8] - icell[4])))) <= bmmdiff)))
                    magnified[imag] = icell[6];
                break;
              }
            }
          }
      }
end_of_job:
  return (magnified);
}
```