user: What is the c source code of the assembly code below?

```asm
<outputEdge>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x138,%rsp
  mov    %r8d,0x38(%rsp)
  imul   %r9d,%r8d
  mov    0x180(%rsp),%ebp
  mov    %rdi,0x50(%rsp)
  mov    %rsi,0x58(%rsp)
  mov    %r8d,%r12d
  mov    %rcx,0x18(%rsp)
  imul   %ebp,%r12d
  mov    %r9d,0x28(%rsp)
  movss  %xmm0,(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x128(%rsp)
  xor    %eax,%eax
  mov    %r12d,%edi
  mov    %r8d,0x4c(%rsp)
  call   <malloc@plt>
  mov    %rax,%r15
  test   %r12d,%r12d
  jle    L218
  lea    0x1(%rbx),%rdx
  movss  (%rsp),%xmm5
  sub    %rdx,%rax
  cmp    $0xe,%rax
  jbe    L191
  lea    -0x1(%r12),%eax
  cmp    $0xe,%eax
  jbe    L191
  mov    %r12d,%edx
  mov    %rbx,%rcx
  movaps %xmm5,%xmm4
  mov    %r15,%rax
  shr    $0x4,%edx
  sub    %r15,%rcx
  pxor   %xmm6,%xmm6
  shufps $0x0,%xmm4,%xmm4
  shl    $0x4,%rdx
  movdqa D3(%rip),%xmm7
  pxor   %xmm3,%xmm3
  add    %r15,%rdx
  nopl   (%rax)
L105:
  movdqu (%rax,%rcx,1),%xmm2
  add    $0x10,%rax
  movdqa %xmm2,%xmm1
  punpckhbw %xmm6,%xmm2
  punpcklbw %xmm6,%xmm1
  movdqa %xmm1,%xmm0
  punpckhwd %xmm3,%xmm1
  punpcklwd %xmm3,%xmm0
  cvtdq2ps %xmm1,%xmm1
  cvtdq2ps %xmm0,%xmm0
  mulps  %xmm4,%xmm1
  mulps  %xmm4,%xmm0
  cvttps2dq %xmm1,%xmm1
  cvttps2dq %xmm0,%xmm0
  movdqa %xmm0,%xmm8
  punpcklwd %xmm1,%xmm0
  punpckhwd %xmm1,%xmm8
  movdqa %xmm0,%xmm1
  punpckhwd %xmm8,%xmm1
  punpcklwd %xmm8,%xmm0
  punpcklwd %xmm1,%xmm0
  movdqa %xmm2,%xmm1
  punpckhwd %xmm3,%xmm2
  punpcklwd %xmm3,%xmm1
  cvtdq2ps %xmm2,%xmm2
  pand   %xmm7,%xmm0
  mulps  %xmm4,%xmm2
  cvtdq2ps %xmm1,%xmm1
  mulps  %xmm4,%xmm1
  cvttps2dq %xmm2,%xmm2
  cvttps2dq %xmm1,%xmm1
  movdqa %xmm1,%xmm8
  punpcklwd %xmm2,%xmm1
  punpckhwd %xmm2,%xmm8
  movdqa %xmm1,%xmm2
  punpckhwd %xmm8,%xmm2
  punpcklwd %xmm8,%xmm1
  punpcklwd %xmm2,%xmm1
  pand   %xmm7,%xmm1
  packuswb %xmm1,%xmm0
  movups %xmm0,-0x10(%rax)
  cmp    %rdx,%rax
  jne    L105
  mov    %r12d,%eax
  and    $0xfffffff0,%eax
  test   $0xf,%r12b
  je     L218
  mov    %eax,%edx
  pxor   %xmm0,%xmm0
  movzbl (%rbx,%rdx,1),%ecx
  cvtsi2ss %ecx,%xmm0
  mulss  %xmm5,%xmm0
  cvttss2si %xmm0,%ecx
  mov    %cl,(%r15,%rdx,1)
  lea    0x1(%rax),%edx
  cmp    %edx,%r12d
  jle    L218
  movslq %edx,%rdx
  pxor   %xmm0,%xmm0
  movzbl (%rbx,%rdx,1),%ecx
  cvtsi2ss %ecx,%xmm0
  mulss  %xmm5,%xmm0
  cvttss2si %xmm0,%ecx
  mov    %cl,(%r15,%rdx,1)
  lea    0x2(%rax),%edx
  cmp    %edx,%r12d
  jle    L218
  movslq %edx,%rdx
  pxor   %xmm0,%xmm0
  movzbl (%rbx,%rdx,1),%ecx
  cvtsi2ss %ecx,%xmm0
  mulss  %xmm5,%xmm0
  cvttss2si %xmm0,%ecx
  mov    %cl,(%r15,%rdx,1)
  lea    0x3(%rax),%edx
  cmp    %edx,%r12d
  jle    L218
  movslq %edx,%rdx
  pxor   %xmm0,%xmm0
  movzbl (%rbx,%rdx,1),%ecx
  cvtsi2ss %ecx,%xmm0
  mulss  %xmm5,%xmm0
  cvttss2si %xmm0,%ecx
  mov    %cl,(%r15,%rdx,1)
  lea    0x4(%rax),%edx
  cmp    %edx,%r12d
  jle    L218
  movslq %edx,%rdx
  pxor   %xmm0,%xmm0
  movzbl (%rbx,%rdx,1),%ecx
  cvtsi2ss %ecx,%xmm0
  mulss  %xmm5,%xmm0
  cvttss2si %xmm0,%ecx
  mov    %cl,(%r15,%rdx,1)
  lea    0x5(%rax),%edx
  cmp    %edx,%r12d
  jle    L218
  movslq %edx,%rdx
  pxor   %xmm0,%xmm0
  movzbl (%rbx,%rdx,1),%ecx
  cvtsi2ss %ecx,%xmm0
  mulss  %xmm5,%xmm0
  cvttss2si %xmm0,%ecx
  mov    %cl,(%r15,%rdx,1)
  lea    0x6(%rax),%edx
  cmp    %edx,%r12d
  jle    L218
  movslq %edx,%rdx
  pxor   %xmm0,%xmm0
  movzbl (%rbx,%rdx,1),%ecx
  cvtsi2ss %ecx,%xmm0
  mulss  %xmm5,%xmm0
  cvttss2si %xmm0,%ecx
  mov    %cl,(%r15,%rdx,1)
  lea    0x7(%rax),%edx
  cmp    %edx,%r12d
  jle    L218
  movslq %edx,%rdx
  pxor   %xmm0,%xmm0
  movzbl (%rbx,%rdx,1),%ecx
  cvtsi2ss %ecx,%xmm0
  mulss  %xmm5,%xmm0
  cvttss2si %xmm0,%ecx
  mov    %cl,(%r15,%rdx,1)
  lea    0x8(%rax),%edx
  cmp    %edx,%r12d
  jle    L218
  movslq %edx,%rdx
  pxor   %xmm0,%xmm0
  movzbl (%rbx,%rdx,1),%ecx
  cvtsi2ss %ecx,%xmm0
  mulss  %xmm5,%xmm0
  cvttss2si %xmm0,%ecx
  mov    %cl,(%r15,%rdx,1)
  lea    0x9(%rax),%edx
  cmp    %edx,%r12d
  jle    L218
  movslq %edx,%rdx
  pxor   %xmm0,%xmm0
  movzbl (%rbx,%rdx,1),%ecx
  cvtsi2ss %ecx,%xmm0
  mulss  %xmm5,%xmm0
  cvttss2si %xmm0,%ecx
  mov    %cl,(%r15,%rdx,1)
  lea    0xa(%rax),%edx
  cmp    %edx,%r12d
  jle    L218
  movslq %edx,%rdx
  pxor   %xmm0,%xmm0
  movzbl (%rbx,%rdx,1),%ecx
  cvtsi2ss %ecx,%xmm0
  mulss  %xmm5,%xmm0
  cvttss2si %xmm0,%ecx
  mov    %cl,(%r15,%rdx,1)
  lea    0xb(%rax),%edx
  cmp    %edx,%r12d
  jle    L218
  movslq %edx,%rdx
  pxor   %xmm0,%xmm0
  movzbl (%rbx,%rdx,1),%ecx
  cvtsi2ss %ecx,%xmm0
  mulss  %xmm5,%xmm0
  cvttss2si %xmm0,%ecx
  mov    %cl,(%r15,%rdx,1)
  lea    0xc(%rax),%edx
  cmp    %edx,%r12d
  jle    L218
  movslq %edx,%rdx
  pxor   %xmm0,%xmm0
  movzbl (%rbx,%rdx,1),%ecx
  cvtsi2ss %ecx,%xmm0
  mulss  %xmm5,%xmm0
  cvttss2si %xmm0,%ecx
  mov    %cl,(%r15,%rdx,1)
  lea    0xd(%rax),%edx
  cmp    %edx,%r12d
  jle    L218
  movslq %edx,%rdx
  pxor   %xmm0,%xmm0
  add    $0xe,%eax
  movzbl (%rbx,%rdx,1),%ecx
  cvtsi2ss %ecx,%xmm0
  mulss  %xmm5,%xmm0
  cvttss2si %xmm0,%ecx
  mov    %cl,(%r15,%rdx,1)
  cmp    %eax,%r12d
  jle    L218
  cltq
  pxor   %xmm0,%xmm0
  movzbl (%rbx,%rax,1),%edx
  cvtsi2ss %edx,%xmm0
  mulss  %xmm5,%xmm0
  cvttss2si %xmm0,%edx
  mov    %dl,(%r15,%rax,1)
L218:
  mov    0x38(%rsp),%eax
  test   %eax,%eax
  jle    L504
  mov    0x28(%rsp),%eax
  cmp    $0x1,%eax
  jle    L504
  mov    %eax,%ecx
  sub    $0x2,%eax
  movl   $0x0,0x14(%rsp)
  mov    %r15,%r12
  imul   %ebp,%ecx
  movl   $0x0,0x10(%rsp)
  mov    %ebp,%r13d
  movl   $0x0,0x8(%rsp)
  mov    %ecx,0x2c(%rsp)
  mov    0x18(%rsp),%rcx
  lea    0x1(%rcx,%rax,1),%rax
  mov    %rax,0x30(%rsp)
  lea    -0x1(%rbp),%eax
  mov    %eax,0x3c(%rsp)
  xchg   %ax,%ax
L225:
  mov    0x3c(%rsp),%r10d
  movslq 0x10(%rsp),%r15
  mov    %r12,%r8
  mov    0x18(%rsp),%rax
  lea    0x1(%r10),%r14
  lea    (%rax,%r15,1),%rbx
  lea    (%r12,%r14,1),%rcx
  add    0x30(%rsp),%r15
  movslq 0x14(%rsp),%rax
  mov    %r15,%r12
  mov    %rcx,0x20(%rsp)
  mov    %r14,%r15
  jmp    L292
  nopl   (%rax)
L232:
  add    $0x1,%rbx
  movslq %ebp,%rax
  cmp    %r12,%rbx
  je     L17
L292:
  movzbl 0x1(%rbx),%esi
  lea    (%rax,%r13,1),%ebp
  cmp    %sil,(%rbx)
  je     L232
  test   %r13d,%r13d
  jle    L232
  movslq %ebp,%rcx
  lea    (%r8,%rax,1),%rdi
  lea    (%rcx,%r8,1),%r14
  mov    %rdi,%rdx
  lea    (%r14,%r15,1),%rsi
  cmp    %rsi,%rdi
  jae    L400
  lea    (%rdi,%r15,1),%rsi
  cmp    %rsi,%r14
  jb     L466
L400:
  mov    %r15,%rdx
  mov    $0xff,%esi
  mov    %r8,(%rsp)
  add    $0x1,%rbx
  call   <memset@plt>
  mov    %r15,%rdx
  mov    $0xff,%esi
  mov    %r14,%rdi
  call   <memset@plt>
  mov    (%rsp),%r8
  movslq %ebp,%rax
  cmp    %r12,%rbx
  jne    L292
L17:
  addl   $0x1,0x8(%rsp)
  mov    0x28(%rsp),%ecx
  mov    %r8,%r12
  mov    0x2c(%rsp),%edi
  add    %ecx,0x10(%rsp)
  add    %edi,0x14(%rsp)
  mov    0x8(%rsp),%eax
  cmp    %eax,0x38(%rsp)
  jne    L225
  mov    %r8,%r15
  mov    %r13d,%ebp
L504:
  mov    0x38(%rsp),%eax
  sub    $0x1,%eax
  mov    %eax,0x3c(%rsp)
  test   %eax,%eax
  jle    L316
  mov    0x28(%rsp),%eax
  test   %eax,%eax
  jle    L316
  mov    %eax,%ecx
  movslq %eax,%r14
  sub    $0x1,%eax
  movl   $0x0,0x2c(%rsp)
  imul   %ebp,%ecx
  movl   $0x0,0x20(%rsp)
  mov    %r14,%r13
  movl   $0x0,0x14(%rsp)
  mov    %ecx,0x10(%rsp)
  mov    0x18(%rsp),%rcx
  lea    0x1(%rcx,%rax,1),%rax
  mov    %r15,%rcx
  mov    %ebp,%r15d
  mov    %rax,0x40(%rsp)
  lea    -0x1(%rbp),%eax
  mov    %eax,0x48(%rsp)
  nopl   0x0(%rax)
L53:
  mov    0x48(%rsp),%r10d
  movslq 0x20(%rsp),%rbp
  mov    %r13,%r8
  mov    0x18(%rsp),%rax
  mov    0x2c(%rsp),%r12d
  lea    0x1(%r10),%r14
  lea    (%rax,%rbp,1),%rbx
  lea    (%r14,%rcx,1),%rax
  add    0x40(%rsp),%rbp
  mov    %r14,%r13
  mov    %rax,0x30(%rsp)
  mov    %rbp,%rax
  mov    %rcx,%rbp
  mov    %rax,%rcx
  jmp    L352
  nopl   0x0(%rax,%rax,1)
L513:
  add    $0x1,%rbx
  add    %r15d,%r12d
  cmp    %rcx,%rbx
  je     L161
L352:
  movzbl (%rbx,%r8,1),%eax
  cmp    %al,(%rbx)
  je     L513
  test   %r15d,%r15d
  jle    L513
  mov    0x10(%rsp),%edx
  movslq %r12d,%rsi
  lea    0x0(%rbp,%rsi,1),%rdi
  add    %r12d,%edx
  mov    %rdi,%rax
  movslq %edx,%rdx
  lea    (%rdx,%rbp,1),%r14
  lea    0x0(%r13,%r14,1),%r10
  cmp    %r10,%rdi
  jae    L224
  lea    0x0(%r13,%rdi,1),%r10
  cmp    %r10,%r14
  jb     L2
L224:
  mov    %r13,%rdx
  mov    $0xff,%esi
  mov    %r8,0x8(%rsp)
  add    %r15d,%r12d
  mov    %rcx,(%rsp)
  add    $0x1,%rbx
  call   <memset@plt>
  mov    %r13,%rdx
  mov    $0xff,%esi
  mov    %r14,%rdi
  call   <memset@plt>
  mov    (%rsp),%rcx
  mov    0x8(%rsp),%r8
  cmp    %rcx,%rbx
  jne    L352
L161:
  addl   $0x1,0x14(%rsp)
  mov    0x28(%rsp),%edi
  mov    %rbp,%rcx
  mov    %r8,%r13
  mov    0x10(%rsp),%esi
  add    %edi,0x20(%rsp)
  add    %esi,0x2c(%rsp)
  mov    0x14(%rsp),%eax
  cmp    0x3c(%rsp),%eax
  jne    L53
  mov    %r15d,%ebp
  mov    %rcx,%r15
L316:
  mov    0x4c(%rsp),%eax
  test   %eax,%eax
  jle    L525
  mov    0x18(%rsp),%r12
  sub    $0x1,%eax
  xor    %r13d,%r13d
  lea    -0x1(%rbp),%ebx
  lea    0x1(%r12,%rax,1),%r14
  jmp    L146
  nopw   0x0(%rax,%rax,1)
L350:
  add    $0x1,%r12
  add    %ebp,%r13d
  cmp    %r14,%r12
  je     L525
L146:
  cmpb   $0x0,(%r12)
  jne    L350
  test   %ebp,%ebp
  jle    L350
  movslq %r13d,%rdi
  mov    %ebx,%edx
  xor    %esi,%esi
  add    $0x1,%r12
  add    $0x1,%rdx
  add    %r15,%rdi
  add    %ebp,%r13d
  call   <memset@plt>
  cmp    %r14,%r12
  jne    L146
L525:
  cmpl   $0xffffffff,0x170(%rsp)
  lea    0x60(%rsp),%r12
  je     L507
  mov    0x58(%rsp),%r8
  mov    0x50(%rsp),%rdx
  mov    %r12,%rdi
  xor    %eax,%eax
  mov    0x170(%rsp),%ecx
  lea    D28(%rip),%rsi
  call   <sprintf@plt>
L281:
  mov    0x178(%rsp),%edi
  mov    %ebp,%r9d
  mov    %r15,%rdx
  mov    %r12,%rsi
  mov    0x28(%rsp),%r8d
  mov    0x38(%rsp),%ecx
  call   <outputresult@plt>
  mov    %r15,%rdi
  call   <free@plt>
  mov    0x128(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L259
  add    $0x138,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L2:
  mov    0x30(%rsp),%rdi
  sub    %rsi,%rdx
  add    %rsi,%rdi
  nopl   (%rax)
L57:
  movb   $0xff,(%rax)
  movb   $0xff,(%rdx,%rax,1)
  add    $0x1,%rax
  cmp    %rax,%rdi
  jne    L57
  jmp    L513
L466:
  mov    0x20(%rsp),%rdi
  sub    %rax,%rcx
  lea    (%rdi,%rax,1),%rsi
  nopl   0x0(%rax)
L11:
  movb   $0xff,(%rdx)
  movb   $0xff,(%rcx,%rdx,1)
  add    $0x1,%rdx
  cmp    %rsi,%rdx
  jne    L11
  jmp    L232
L507:
  mov    0x50(%rsp),%rdx
  lea    D5(%rip),%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <sprintf@plt>
  jmp    L281
L191:
  mov    %r12d,%eax
  mov    %r15,%rdx
  sub    %r15,%rbx
  add    %r15,%rax
L99:
  movzbl (%rbx,%rdx,1),%ecx
  pxor   %xmm0,%xmm0
  add    $0x1,%rdx
  cvtsi2ss %ecx,%xmm0
  mulss  %xmm5,%xmm0
  cvttss2si %xmm0,%ecx
  mov    %cl,-0x1(%rdx)
  cmp    %rax,%rdx
  jne    L99
  jmp    L218
L259:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D3
type_guessed: byte[16]
name: read_data
arguments: data_tag: D28
type_guessed: string
name: read_data
arguments: data_tag: D5
type_guessed: string

tool: {"D3": [0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00]}

tool: D28: %s.%d.seg.%s

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