user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<ArrayswapLog>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %ecx,%eax
  mov    %r8,-0x60(%rbp)
  mov    %r9,-0x68(%rbp)
  mov    %dx,-0x54(%rbp)
  mov    %ax,-0x58(%rbp)
  movw   $0xffff,-0x38(%rbp)
  movw   $0x0,-0x36(%rbp)
  mov    -0x50(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  movl   $0x0,-0x30(%rbp)
  jmp    L103
L113:
  movl   $0x0,-0x34(%rbp)
  jmp    L73
L41:
  mov    -0x28(%rbp),%rax
  movzwl (%rax),%eax
  cmp    %ax,-0x36(%rbp)
  jae    L32
  mov    -0x28(%rbp),%rax
  movzwl (%rax),%eax
  mov    %ax,-0x36(%rbp)
L32:
  mov    -0x28(%rbp),%rax
  movzwl (%rax),%eax
  cmp    %ax,-0x38(%rbp)
  jbe    L111
  mov    -0x28(%rbp),%rax
  movzwl (%rax),%eax
  mov    %ax,-0x38(%rbp)
L111:
  addl   $0x1,-0x34(%rbp)
  addq   $0x2,-0x28(%rbp)
L73:
  movswl -0x58(%rbp),%eax
  cmp    %eax,-0x34(%rbp)
  jl     L41
  addl   $0x1,-0x30(%rbp)
L103:
  movswl -0x54(%rbp),%eax
  cmp    %eax,-0x30(%rbp)
  jl     L113
  movzwl -0x36(%rbp),%eax
  cmp    -0x38(%rbp),%ax
  jne    L50
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  jmp    L51
L50:
  movzwl -0x36(%rbp),%eax
  movzwl -0x38(%rbp),%edx
  sub    %edx,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  D15(%rip),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
L51:
  movzwl -0x36(%rbp),%edx
  movzwl -0x38(%rbp),%eax
  mov    %eax,%esi
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  movswq -0x58(%rbp),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x50(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  movl   $0x1,-0x30(%rbp)
  jmp    L89
L117:
  movl   $0x1,-0x2c(%rbp)
  jmp    L44
L65:
  mov    -0x20(%rbp),%rax
  cmp    -0x60(%rbp),%rax
  setb   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x10(%rbp),%rax
  cmp    -0x68(%rbp),%rax
  setb   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  movzwl -0x36(%rbp),%edx
  movzwl -0x38(%rbp),%ecx
  mov    -0x10(%rbp),%rax
  lea    0x2(%rax),%rsi
  mov    %rsi,-0x10(%rbp)
  movzwl (%rax),%eax
  movzwl %ax,%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <mylog@plt>
  mov    %rax,%rcx
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x18(%rbp),%rax
  cmp    -0x60(%rbp),%rax
  setb   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x10(%rbp),%rax
  cmp    -0x68(%rbp),%rax
  setb   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  movzwl -0x36(%rbp),%edx
  movzwl -0x38(%rbp),%ecx
  mov    -0x10(%rbp),%rax
  lea    0x2(%rax),%rsi
  mov    %rsi,-0x10(%rbp)
  movzwl (%rax),%eax
  movzwl %ax,%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <mylog@plt>
  mov    %rax,%rcx
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x18(%rbp),%rax
  cmp    -0x60(%rbp),%rax
  setb   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x10(%rbp),%rax
  cmp    -0x68(%rbp),%rax
  setb   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  movzwl -0x36(%rbp),%edx
  movzwl -0x38(%rbp),%ecx
  mov    -0x10(%rbp),%rax
  lea    0x2(%rax),%rsi
  mov    %rsi,-0x10(%rbp)
  movzwl (%rax),%eax
  movzwl %ax,%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <mylog@plt>
  mov    %rax,%rcx
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x20(%rbp),%rax
  cmp    -0x60(%rbp),%rax
  setb   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x10(%rbp),%rax
  cmp    -0x68(%rbp),%rax
  setb   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  movzwl -0x36(%rbp),%edx
  movzwl -0x38(%rbp),%ecx
  mov    -0x10(%rbp),%rax
  lea    0x2(%rax),%rsi
  mov    %rsi,-0x10(%rbp)
  movzwl (%rax),%eax
  movzwl %ax,%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <mylog@plt>
  mov    %rax,%rcx
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  addl   $0x1,-0x2c(%rbp)
L44:
  movzwl -0x58(%rbp),%eax
  mov    %eax,%edx
  shr    $0xf,%dx
  add    %edx,%eax
  sar    %ax
  cwtl
  cmp    %eax,-0x2c(%rbp)
  jle    L65
  movswq -0x58(%rbp),%rax
  add    %rax,-0x20(%rbp)
  movswq -0x58(%rbp),%rax
  add    %rax,-0x18(%rbp)
  addl   $0x1,-0x30(%rbp)
L89:
  movzwl -0x54(%rbp),%eax
  mov    %eax,%edx
  shr    $0xf,%dx
  add    %edx,%eax
  sar    %ax
  cwtl
  cmp    %eax,-0x30(%rbp)
  jle    L117
  nop
  nop
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D15
type: f64
name: read_data
arguments: data_label: D4
type: string

tool: D15: 255

tool: D4: MinPix %d, MaxPix %d


assistant: ```c
void ArrayswapLog(unsigned char *Imptr1, unsigned short *Imptr2, short height, short width, unsigned char *end1, unsigned short *end2) {
  unsigned short *srcPix, minPix, maxPix;
  int x, y, z;
  double scale;
  unsigned char *Impt1, *Impt2;
  unsigned short *Impt5;
  minPix = 0xFFFF;
  maxPix = 0x0000;
  srcPix = Imptr2;
  for (y = 0; y < height; y++) {
    for (x = 0; x < width; x++, srcPix++) {
      if (*srcPix > maxPix)
        maxPix = *srcPix;
      if (*srcPix < minPix)
        minPix = *srcPix;
    }
  }
  if (maxPix == minPix)
    scale = 0.0;
  else
    scale = 255.0 / (maxPix - minPix);
  printf("MinPix %d, MaxPix %d\n", minPix, maxPix);
  Impt1 = Imptr1;
  Impt2 = Imptr1 + width;
  Impt5 = Imptr2;
  for (y = 1; y <= height / 2; y++) {
    for (z = 1; z <= width / 2; z++) {
      assert(Impt1 < end1);
      assert(Impt5 < end2);
      *Impt1++ = mylog(*Impt5++, minPix, maxPix);
      assert(Impt2 < end1);
      assert(Impt5 < end2);
      *Impt2++ = mylog(*Impt5++, minPix, maxPix);
      assert(Impt2 < end1);
      assert(Impt5 < end2);
      *Impt2++ = mylog(*Impt5++, minPix, maxPix);
      assert(Impt1 < end1);
      assert(Impt5 < end2);
      *Impt1++ = mylog(*Impt5++, minPix, maxPix);
    };
    Impt1 += width;
    Impt2 += width;
  }
}
```