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

```asm
<outputEdge>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x108,%rsp
  mov    %rdi,0x18(%rsp)
  mov    %rsi,0x20(%rsp)
  mov    %rdx,%r14
  mov    %rcx,(%rsp)
  mov    %r8d,%r15d
  mov    %r9d,%r12d
  mov    0x150(%rsp),%ebx
  movss  %xmm0,0xc(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0xf8(%rsp)
  xor    %eax,%eax
  mov    %r8d,%eax
  imul   %r9d,%eax
  mov    %eax,0x28(%rsp)
  mov    %eax,%r13d
  imul   %ebx,%r13d
  mov    %r13d,%edi
  call   <malloc@plt>
  mov    %rax,%rbp
  test   %r13d,%r13d
  jle    L225
  mov    %r13d,%ecx
  add    %rax,%rcx
  sub    %rax,%r14
L302:
  movzbl (%r14,%rax,1),%edx
  pxor   %xmm0,%xmm0
  cvtsi2ss %edx,%xmm0
  mulss  0xc(%rsp),%xmm0
  cvttss2si %xmm0,%edx
  mov    %dl,(%rax)
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L302
L225:
  mov    $0x0,%edi
  mov    $0x0,%r11d
  test   %r15d,%r15d
  jle    L304
  lea    -0x2(%r12),%eax
  mov    (%rsp),%rsi
  lea    0x1(%rsi,%rax,1),%r14
  mov    %ebx,%r10d
  add    %rbp,%r10
  lea    -0x1(%r12),%eax
  mov    %eax,0xc(%rsp)
  jmp    L88
L60:
  add    $0x1,%rcx
  add    %ebx,%edi
  cmp    %r9,%rcx
  je     L296
L110:
  movzbl 0x1(%rcx),%eax
  cmp    %al,(%rcx)
  je     L60
  test   %ebx,%ebx
  jle    L60
  lea    (%rdi,%rbx,1),%edx
  movslq %edi,%r8
  lea    (%r8,%rbp,1),%rax
  lea    (%r10,%r8,1),%rsi
  movslq %edx,%rdx
  sub    %r8,%rdx
L187:
  movb   $0xff,(%rax)
  movb   $0xff,(%rdx,%rax,1)
  add    $0x1,%rax
  cmp    %rsi,%rax
  jne    L187
  jmp    L60
L296:
  mov    0xc(%rsp),%eax
  lea    (%rax,%r13,1),%edi
L19:
  add    $0x1,%edi
  add    $0x1,%r11d
  cmp    %r11d,%r15d
  je     L304
L88:
  cmp    $0x1,%r12d
  jle    L19
  movslq %edi,%r9
  mov    (%rsp),%rax
  lea    (%rax,%r9,1),%rcx
  mov    %edi,%r13d
  imul   %ebx,%edi
  add    %r14,%r9
  jmp    L110
L304:
  cmp    $0x1,%r15d
  jle    L234
  lea    -0x1(%r15),%esi
  mov    %r12d,%r13d
  imul   %ebx,%r13d
  mov    $0x0,%edi
  mov    $0x0,%r14d
  lea    -0x1(%r12),%eax
  mov    (%rsp),%rcx
  lea    0x1(%rcx,%rax,1),%rax
  mov    %rax,0x10(%rsp)
  movslq %r12d,%r10
  mov    %ebx,%r11d
  add    %rbp,%r11
  mov    %r15d,0x2c(%rsp)
  mov    %esi,%r15d
  jmp    L241
L195:
  add    $0x1,%rcx
  add    %ebx,%edi
  cmp    %r9,%rcx
  je     L69
L133:
  movzbl (%rcx,%r10,1),%eax
  cmp    %al,(%rcx)
  je     L195
  test   %ebx,%ebx
  jle    L195
  lea    (%rdi,%r13,1),%edx
  movslq %edi,%r8
  lea    (%r8,%rbp,1),%rax
  lea    (%r11,%r8,1),%rsi
  movslq %edx,%rdx
  sub    %r8,%rdx
L130:
  movb   $0xff,(%rax)
  movb   $0xff,(%rdx,%rax,1)
  add    $0x1,%rax
  cmp    %rsi,%rax
  jne    L130
  jmp    L195
L69:
  mov    0xc(%rsp),%edi
  add    %r12d,%edi
L47:
  add    $0x1,%r14d
  cmp    %r15d,%r14d
  je     L178
L241:
  test   %r12d,%r12d
  jle    L47
  movslq %edi,%r9
  mov    (%rsp),%rax
  lea    (%rax,%r9,1),%rcx
  mov    %edi,0xc(%rsp)
  imul   %ebx,%edi
  add    0x10(%rsp),%r9
  jmp    L133
L178:
  mov    0x2c(%rsp),%r15d
L234:
  mov    0x28(%rsp),%eax
  test   %eax,%eax
  jle    L139
  mov    (%rsp),%rdi
  mov    %rdi,%rdx
  lea    -0x1(%rax),%eax
  lea    0x1(%rdi,%rax,1),%rdi
  mov    $0x0,%esi
  mov    %ebx,%r8d
  add    %rbp,%r8
  jmp    L92
L134:
  add    $0x1,%rdx
  add    %ebx,%esi
  cmp    %rdi,%rdx
  je     L139
L92:
  cmpb   $0x0,(%rdx)
  jne    L134
  test   %ebx,%ebx
  jle    L134
  movslq %esi,%rcx
  lea    0x0(%rbp,%rcx,1),%rax
  add    %r8,%rcx
L138:
  movb   $0x0,(%rax)
  add    $0x1,%rax
  cmp    %rax,%rcx
  jne    L138
  jmp    L134
L139:
  cmpl   $0xffffffff,0x140(%rsp)
  je     L164
  lea    0x30(%rsp),%rdi
  mov    0x20(%rsp),%r8
  mov    0x140(%rsp),%ecx
  mov    0x18(%rsp),%rdx
  lea    D13(%rip),%rsi
  mov    $0x0,%eax
  call   <sprintf@plt>
L114:
  lea    0x30(%rsp),%rsi
  mov    %ebx,%r9d
  mov    %r12d,%r8d
  mov    %r15d,%ecx
  mov    %rbp,%rdx
  mov    0x148(%rsp),%edi
  call   <outputresult@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    0xf8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L36
  add    $0x108,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L164:
  lea    0x30(%rsp),%rdi
  mov    0x18(%rsp),%rdx
  lea    D12(%rip),%rsi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L114
L36:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D13
type: string
name: unpack_data
arguments: label: D12
type: string

tool: D13: %s.%d.seg.%s

tool: D12: %s

assistant: ```c
void outputEdge(char *fname, char *exten, unsigned char *RGB0, unsigned char *rmap, int ny, int nx, int status, int type, int dim, float displayintensity) {
  int iy, ix, i, j, datasize, l1, l2, mapsize;
  char outfname[200];
  unsigned char *RGB;
  mapsize = ny * nx;
  datasize = ny * nx * dim;
  RGB = (unsigned char *)malloc(datasize * sizeof(unsigned char));
  for (i = 0; i < datasize; i++)
    RGB[i] = RGB0[i] * displayintensity;
  l1 = 0;
  for (iy = 0; iy < ny; iy++) {
    for (ix = 0; ix < nx - 1; ix++) {
      l2 = l1 + 1;
      if (rmap[l1] != rmap[l2]) {
        for (j = 0; j < dim; j++) {
          RGB[dim * l1 + j] = 255;
          RGB[dim * l2 + j] = 255;
        }
      }
      l1++;
    }
    l1++;
  }
  l1 = 0;
  for (iy = 0; iy < ny - 1; iy++) {
    for (ix = 0; ix < nx; ix++) {
      l2 = l1 + nx;
      if (rmap[l1] != rmap[l2]) {
        for (j = 0; j < dim; j++) {
          RGB[dim * l1 + j] = 255;
          RGB[dim * l2 + j] = 255;
        }
      }
      l1++;
    }
  }
  for (i = 0; i < mapsize; i++) {
    if (rmap[i] == 0) {
      for (j = 0; j < dim; j++)
        RGB[dim * i + j] = 0;
    }
  }
  if (status == -1)
    sprintf(outfname, "%s", fname);
  else
    sprintf(outfname, "%s.%d.seg.%s", fname, status, exten);
  outputresult(type, outfname, RGB, ny, nx, dim);
  free(RGB);
}
```