user: Translate the below assembly code into C programming language:

```asm
<outputEdge>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x138,%rsp
  mov    %r8d,0x3c(%rsp)
  imul   %r9d,%r8d
  mov    0x180(%rsp),%r12d
  mov    %rdi,0x50(%rsp)
  mov    %rcx,0x30(%rsp)
  mov    %r8d,%ebp
  mov    %rsi,0x58(%rsp)
  imul   %r12d,%ebp
  mov    %r9d,0x20(%rsp)
  movss  %xmm0,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x128(%rsp)
  xor    %eax,%eax
  mov    %ebp,%edi
  mov    %r8d,0x4c(%rsp)
  call   <malloc@plt>
  movslq %ebp,%rcx
  movss  0x8(%rsp),%xmm0
  add    %rax,%rcx
  sub    %rax,%rbx
  test   %ebp,%ebp
  mov    %rax,%r15
  jle    L107
  nop
L160:
  movzbl (%rbx,%rax,1),%edx
  pxor   %xmm1,%xmm1
  add    $0x1,%rax
  cvtsi2ss %edx,%xmm1
  mulss  %xmm0,%xmm1
  cvttss2si %xmm1,%edx
  mov    %dl,-0x1(%rax)
  cmp    %rcx,%rax
  jne    L160
L107:
  mov    0x20(%rsp),%eax
  mov    0x30(%rsp),%rcx
  mov    %r15,%r14
  movl   $0x0,0x18(%rsp)
  movl   $0x0,0x24(%rsp)
  sub    $0x2,%eax
  lea    0x1(%rcx,%rax,1),%rax
  mov    0x3c(%rsp),%ecx
  mov    %rax,0x28(%rsp)
  test   %ecx,%ecx
  jle    L178
  nopl   (%rax)
L67:
  cmpl   $0x1,0x20(%rsp)
  jle    L146
  movslq 0x18(%rsp),%r15
  mov    0x30(%rsp),%rsi
  lea    -0x1(%r12),%r13d
  add    $0x1,%r13
  mov    %r15,%rax
  lea    (%rsi,%r15,1),%rbx
  lea    0x0(%r13,%r14,1),%r9
  add    0x28(%rsp),%r15
  imul   %r12d,%eax
  mov    %eax,%ebp
  jmp    L48
  nop
L147:
  add    %r12d,%ebp
L86:
  add    $0x1,%rbx
  cmp    %r15,%rbx
  je     L302
L48:
  movzbl 0x1(%rbx),%eax
  cmp    %al,(%rbx)
  je     L147
  test   %r12d,%r12d
  jle    L147
  movslq %ebp,%rcx
  add    %r12d,%ebp
  movslq %ebp,%rdx
  lea    (%rcx,%r14,1),%rdi
  lea    (%r9,%rcx,1),%rsi
  lea    (%r14,%rdx,1),%r8
  mov    %rdi,%rax
  cmp    %r8,%rsi
  jbe    L183
  lea    (%r9,%rdx,1),%r10
  sub    %rcx,%rdx
  cmp    %rdi,%r10
  ja     L318
L183:
  mov    %r13,%rdx
  mov    $0xff,%esi
  mov    %r9,0x10(%rsp)
  add    $0x1,%rbx
  mov    %r8,0x8(%rsp)
  call   <memset@plt>
  mov    0x8(%rsp),%rdi
  mov    %r13,%rdx
  mov    $0xff,%esi
  call   <memset@plt>
  mov    0x10(%rsp),%r9
  cmp    %r15,%rbx
  jne    L48
L302:
  mov    0x18(%rsp),%eax
  mov    0x20(%rsp),%ecx
  lea    -0x1(%rax,%rcx,1),%eax
  mov    %eax,0x18(%rsp)
L146:
  addl   $0x1,0x24(%rsp)
  mov    0x24(%rsp),%eax
  addl   $0x1,0x18(%rsp)
  cmp    %eax,0x3c(%rsp)
  jne    L67
  mov    %r14,%r15
L178:
  mov    0x3c(%rsp),%eax
  sub    $0x1,%eax
  mov    %eax,0x48(%rsp)
  test   %eax,%eax
  jle    L296
  mov    0x20(%rsp),%eax
  movl   $0x0,0x38(%rsp)
  mov    %r15,%r14
  movl   $0x0,0x28(%rsp)
  mov    %eax,%ecx
  sub    $0x1,%eax
  imul   %r12d,%ecx
  mov    %ecx,0x24(%rsp)
  mov    0x30(%rsp),%rcx
  lea    0x1(%rcx,%rax,1),%rax
  mov    %rax,0x40(%rsp)
  xchg   %ax,%ax
L280:
  mov    0x20(%rsp),%edx
  test   %edx,%edx
  jle    L24
  movslq 0x38(%rsp),%r15
  mov    0x30(%rsp),%rdi
  lea    -0x1(%r12),%r13d
  add    $0x1,%r13
  movslq 0x20(%rsp),%rcx
  mov    %r15,%rax
  lea    (%rdi,%r15,1),%rbx
  lea    (%r14,%r13,1),%r10
  add    0x40(%rsp),%r15
  imul   %r12d,%eax
  mov    %eax,%ebp
  mov    %r15,%rax
  mov    %r14,%r15
  mov    %rax,%r14
  jmp    L306
  nopl   (%rax)
L1:
  add    $0x1,%rbx
  add    %r12d,%ebp
  cmp    %r14,%rbx
  je     L150
L306:
  movzbl (%rbx,%rcx,1),%eax
  cmp    %al,(%rbx)
  je     L1
  test   %r12d,%r12d
  jle    L1
  mov    0x24(%rsp),%eax
  movslq %ebp,%rsi
  lea    (%r15,%rsi,1),%rdi
  lea    (%rsi,%r10,1),%r11
  lea    0x0(%rbp,%rax,1),%edx
  mov    %rdi,%rax
  movslq %edx,%rdx
  lea    (%rdx,%r10,1),%r8
  cmp    %r8,%rdi
  lea    (%rdx,%r15,1),%r8
  jae    L198
  sub    %rsi,%rdx
  cmp    %r11,%r8
  jb     L333
L198:
  mov    %r13,%rdx
  mov    $0xff,%esi
  mov    %r10,0x18(%rsp)
  add    %r12d,%ebp
  mov    %rcx,0x10(%rsp)
  add    $0x1,%rbx
  mov    %r8,0x8(%rsp)
  call   <memset@plt>
  mov    0x8(%rsp),%rdi
  mov    %r13,%rdx
  mov    $0xff,%esi
  call   <memset@plt>
  mov    0x10(%rsp),%rcx
  mov    0x18(%rsp),%r10
  cmp    %r14,%rbx
  jne    L306
L150:
  mov    0x20(%rsp),%esi
  add    %esi,0x38(%rsp)
  mov    %r15,%r14
L24:
  addl   $0x1,0x28(%rsp)
  mov    0x28(%rsp),%eax
  cmp    0x48(%rsp),%eax
  jne    L280
  mov    %r14,%r15
L296:
  mov    0x4c(%rsp),%eax
  test   %eax,%eax
  jle    L254
  mov    0x4c(%rsp),%eax
  mov    0x30(%rsp),%rbp
  xor    %r13d,%r13d
  lea    -0x1(%r12),%ebx
  sub    $0x1,%eax
  lea    0x1(%rbp,%rax,1),%r14
  jmp    L4
  nopl   0x0(%rax,%rax,1)
L235:
  add    $0x1,%rbp
  add    %r12d,%r13d
  cmp    %r14,%rbp
  je     L254
L4:
  cmpb   $0x0,0x0(%rbp)
  jne    L235
  test   %r12d,%r12d
  jle    L235
  movslq %r13d,%rdi
  mov    %ebx,%edx
  xor    %esi,%esi
  add    $0x1,%rbp
  add    $0x1,%rdx
  add    %r15,%rdi
  add    %r12d,%r13d
  call   <memset@plt>
  cmp    %r14,%rbp
  jne    L4
L254:
  cmpl   $0xffffffff,0x170(%rsp)
  je     L73
  lea    0x60(%rsp),%rbp
  mov    0x58(%rsp),%r8
  xor    %eax,%eax
  mov    0x170(%rsp),%ecx
  mov    0x50(%rsp),%rdx
  lea    D8(%rip),%rsi
  mov    %rbp,%rdi
  call   <sprintf@plt>
L223:
  mov    0x178(%rsp),%edi
  mov    %r12d,%r9d
  mov    %r15,%rdx
  mov    %rbp,%rsi
  mov    0x20(%rsp),%r8d
  mov    0x3c(%rsp),%ecx
  call   <outputresult@plt>
  mov    %r15,%rdi
  call   <free@plt>
  mov    0x128(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L72
  add    $0x138,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L318:
  movb   $0xff,(%rax)
  movb   $0xff,(%rdx,%rax,1)
  add    $0x1,%rax
  cmp    %rax,%rsi
  je     L86
  movb   $0xff,(%rax)
  movb   $0xff,(%rdx,%rax,1)
  add    $0x1,%rax
  cmp    %rax,%rsi
  jne    L318
  jmp    L86
  nopl   0x0(%rax)
L333:
  movb   $0xff,(%rax)
  movb   $0xff,(%rdx,%rax,1)
  add    $0x1,%rax
  cmp    %r11,%rax
  je     L1
  movb   $0xff,(%rax)
  movb   $0xff,(%rdx,%rax,1)
  add    $0x1,%rax
  cmp    %r11,%rax
  jne    L333
  jmp    L1
L73:
  lea    0x60(%rsp),%rbp
  mov    0x50(%rsp),%rdx
  lea    D10(%rip),%rsi
  xor    %eax,%eax
  mov    %rbp,%rdi
  call   <sprintf@plt>
  jmp    L223
L72:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D8
type_infered: string
name: parse_data
arguments: tag: D10
type_infered: string

tool: D8: %s.%d.seg.%s

tool: D10: %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);
}
```