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

```asm
<VoronoiWeights>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x108,%rsp
  mov    %esi,0x30(%rsp)
  mov    %edx,0x34(%rsp)
  mov    %rcx,0x38(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0xf8(%rsp)
  xor    %eax,%eax
  cmp    $0x1,%esi
  je     L223
  mov    0x30(%rsp),%esi
  xor    %eax,%eax
  lea    0x78(%rsp),%rdx
  mov    %rdi,%r12
  call   <simple_diffmx@plt>
  test   %eax,%eax
  je     L46
L199:
  movslq 0x30(%rsp),%rbx
  lea    D38(%rip),%rbp
  mov    $0xb5,%esi
  xor    %eax,%eax
  mov    %rbp,%rdi
  lea    0x0(,%rbx,4),%rdx
  call   <sre_malloc@plt>
  mov    0x78(%rsp),%r8
  mov    %ebx,%r9d
  movslq %eax,%rdi
  mov    %rdi,0x50(%rsp)
  test   %ebx,%ebx
  jle    L373
  movss  D27(%rip),%xmm3
  movss  D10(%rip),%xmm2
  mov    %r8,%rsi
  xor    %ecx,%ecx
  nopl   (%rax)
L437:
  xor    %eax,%eax
  movaps %xmm3,%xmm0
  nopl   (%rax)
L145:
  cmp    %eax,%ecx
  je     L358
  mov    (%rsi),%rdx
  movss  (%rdx,%rax,4),%xmm1
  minss  %xmm0,%xmm1
  movaps %xmm1,%xmm0
L358:
  add    $0x1,%rax
  cmp    %rbx,%rax
  jne    L145
  mulss  %xmm2,%xmm0
  add    $0x1,%ecx
  add    $0x4,%rdi
  add    $0x8,%rsi
  movss  %xmm0,-0x4(%rdi)
  cmp    %ecx,%r9d
  jne    L437
L373:
  mov    0x30(%rsp),%esi
  mov    %r8,%rdi
  xor    %eax,%eax
  call   <Free2DArray@plt>
  movslq 0x34(%rsp),%r14
  mov    %rbp,%rdi
  xor    %eax,%eax
  mov    $0xc3,%esi
  lea    0x0(,%r14,8),%rdx
  mov    %r14,0x60(%rsp)
  call   <sre_malloc@plt>
  lea    0x0(,%r14,4),%rdx
  mov    $0xc4,%esi
  mov    %rbp,%rdi
  cltq
  mov    %rax,0x40(%rsp)
  xor    %eax,%eax
  call   <sre_malloc@plt>
  cltq
  mov    %rax,0x48(%rsp)
  test   %r14d,%r14d
  jle    L238
  mov    0x34(%rsp),%eax
  mov    0x40(%rsp),%r14
  mov    %rax,0x10(%rsp)
  mov    %r14,%r15
  lea    (%r14,%rax,8),%r13
  nopw   0x0(%rax,%rax,1)
L125:
  mov    $0x1b,%edx
  mov    $0xc6,%esi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <sre_malloc@plt>
  add    $0x8,%r14
  cltq
  mov    %rax,-0x8(%r14)
  cmp    %r13,%r14
  jne    L125
  mov    0x30(%rsp),%eax
  mov    0x48(%rsp),%r13
  xor    %esi,%esi
  mov    %r12,0x28(%rsp)
  lea    0xe8(%rsp),%r14
  mov    %rbx,0x58(%rsp)
  movabs $0x8000000000006001,%r9
  mov    %rsi,%rbx
  sub    $0x1,%eax
  lea    0x8(%r12,%rax,8),%r8
  lea    0x80(%rsp),%rax
  mov    %r15,%r12
  mov    %r14,%r15
  mov    %rax,0x18(%rsp)
  lea    0x84(%rsp),%rax
  mov    %r13,%r14
  mov    %r8,%r13
  mov    %rax,0x20(%rsp)
  nopl   0x0(%rax,%rax,1)
L61:
  mov    0x18(%rsp),%rdi
  mov    $0xd,%ecx
  xor    %eax,%eax
  mov    0x30(%rsp),%r10d
  rep stos %rax,%es:(%rdi)
  movl   $0x0,(%rdi)
  test   %r10d,%r10d
  jle    L184
  mov    0x28(%rsp),%rdx
  mov    %r12,(%rsp)
  mov    %r13,%r12
  mov    %r14,0x8(%rsp)
  mov    %rbx,%r14
  mov    %rdx,%r13
  jmp    L268
  nopl   0x0(%rax)
L357:
  movl   $0x1,0xe8(%rsp)
L328:
  add    $0x8,%r13
  cmp    %r12,%r13
  je     L106
L268:
  mov    0x0(%r13),%rax
  mov    $0x1,%edi
  movzbl (%rax,%r14,1),%eax
  lea    -0x20(%rax),%ecx
  cmp    $0x3f,%cl
  ja     L148
  mov    %r9,%rdi
  shr    %cl,%rdi
  not    %rdi
  and    $0x1,%edi
L148:
  cmp    $0x7e,%al
  je     L357
  test   %dil,%dil
  je     L357
  movsbl %al,%ebx
  mov    %ebx,%edi
  call   <isupper@plt>
  lea    -0x41(%rbx),%ecx
  movabs $0x8000000000006001,%r9
  mov    %eax,%r8d
  lea    -0x61(%rbx),%eax
  test   %r8d,%r8d
  cmovne %ecx,%eax
  cmp    $0x19,%eax
  ja     L328
  cltq
  add    $0x8,%r13
  movl   $0x1,0x80(%rsp,%rax,4)
  cmp    %r12,%r13
  jne    L268
  nopl   (%rax)
L106:
  mov    %r12,%r13
  mov    %r14,%rbx
  mov    (%rsp),%r12
  mov    0x8(%rsp),%r14
  mov    0xe8(%rsp),%r11d
  mov    0x80(%rsp),%ecx
L402:
  movl   $0x0,(%r14)
  mov    0x20(%rsp),%rax
  mov    $0x41,%edx
  jmp    L348
  nopl   0x0(%rax)
L272:
  mov    (%rax),%ecx
  add    $0x4,%rax
L348:
  test   %ecx,%ecx
  je     L312
  movslq (%r14),%rcx
  mov    (%r12),%rsi
  mov    %dl,(%rsi,%rcx,1)
  addl   $0x1,(%r14)
L312:
  add    $0x1,%edx
  cmp    %r15,%rax
  jne    L272
  test   %r11d,%r11d
  je     L95
  movslq (%r14),%rax
  mov    (%r12),%rdx
  movb   $0x20,(%rdx,%rax,1)
  addl   $0x1,(%r14)
L95:
  add    $0x1,%rbx
  add    $0x8,%r12
  add    $0x4,%r14
  cmp    0x10(%rsp),%rbx
  jne    L61
  mov    0x28(%rsp),%r12
  mov    0x58(%rsp),%rbx
L238:
  mov    0x34(%rsp),%r14d
  mov    %rbp,%rdi
  mov    $0x109,%esi
  xor    %eax,%eax
  lea    0x1(%r14),%edx
  movslq %edx,%rdx
  call   <sre_malloc@plt>
  mov    0x30(%rsp),%r15d
  mov    0x38(%rsp),%rdi
  pxor   %xmm0,%xmm0
  movslq %eax,%rbp
  mov    $0x1,%eax
  mov    %r15d,%esi
  call   <FSet@plt>
  imul   $0x32,%r15d,%eax
  mov    %eax,0x58(%rsp)
  test   %eax,%eax
  jle    L225
  mov    0x60(%rsp),%rax
  movss  D27(%rip),%xmm2
  movl   $0x0,0x18(%rsp)
  mov    $0x2a,%r13d
  add    %rbp,%rax
  test   %r14d,%r14d
  movss  %xmm2,0x28(%rsp)
  mov    %rax,0x68(%rsp)
  cmovle %rbp,%rax
  mov    %rax,0x60(%rsp)
  nopl   0x0(%rax,%rax,1)
L433:
  mov    0x34(%rsp),%esi
  mov    0x48(%rsp),%rdx
  mov    %rbp,%r15
  mov    0x40(%rsp),%rcx
  test   %esi,%esi
  jle    L270
  mov    %rbx,0x8(%rsp)
  mov    0x68(%rsp),%r14
  mov    %rcx,%rbx
  mov    %rbp,0x10(%rsp)
  mov    %rdx,%rbp
  mov    %r12,(%rsp)
  jmp    L29
L299:
  mov    %al,(%r15)
  add    $0x1,%r15
  add    $0x4,%rbp
  add    $0x8,%rbx
  cmp    %r15,%r14
  je     L129
L29:
  mov    0x0(%rbp),%r8d
  mov    $0x20,%eax
  test   %r8d,%r8d
  je     L299
  xor    %eax,%eax
  mov    (%rbx),%r12
  call   <sre_random@plt>
  imul   0x0(%rbp),%eax
  cltq
  movzbl (%r12,%rax,1),%eax
  jmp    L299
  nopl   0x0(%rax)
L129:
  mov    (%rsp),%r12
  mov    0x8(%rsp),%rbx
  mov    0x10(%rsp),%rbp
L270:
  mov    0x60(%rsp),%rax
  movb   $0x0,(%rax)
  xor    %eax,%eax
  call   <sre_random@plt>
  pxor   %xmm2,%xmm2
  mov    0x30(%rsp),%edi
  cvtsi2ss %eax,%xmm2
  movss  %xmm2,0x8(%rsp)
  test   %edi,%edi
  jle    L283
  movss  0x28(%rsp),%xmm3
  mov    0x50(%rsp),%r14
  mov    %r13d,0x10(%rsp)
  xor    %r15d,%r15d
  movss  %xmm3,(%rsp)
  jmp    L24
  nopl   0x0(%rax)
L130:
  ucomiss (%rsp),%xmm0
  jp     L446
  je     L248
L446:
  add    $0x1,%r15
  add    $0x4,%r14
  cmp    %r15,%rbx
  je     L99
L24:
  mov    (%r12,%r15,8),%rdi
  xor    %eax,%eax
  mov    %rbp,%rsi
  mov    %r15d,%r13d
  call   <simple_distance@plt>
  pxor   %xmm0,%xmm0
  movss  (%r14),%xmm1
  cvtsi2ss %eax,%xmm0
  lea    0x0(,%r15,4),%rax
  comiss %xmm0,%xmm1
  ja     L415
  movss  (%rsp),%xmm4
  comiss %xmm0,%xmm4
  jbe    L130
  xor    %eax,%eax
  movss  %xmm0,(%rsp)
  add    $0x4,%r14
  call   <sre_random@plt>
  pxor   %xmm6,%xmm6
  mov    %r15d,0x10(%rsp)
  add    $0x1,%r15
  cvtsi2ss %eax,%xmm6
  movss  %xmm6,0x8(%rsp)
  cmp    %r15,%rbx
  jne    L24
L99:
  movslq 0x10(%rsp),%rax
  mov    %rax,%r13
  shl    $0x2,%rax
L415:
  add    0x38(%rsp),%rax
  movss  0x28(%rsp),%xmm0
  addss  (%rax),%xmm0
  addl   $0x1,0x18(%rsp)
  movss  %xmm0,(%rax)
  mov    0x18(%rsp),%eax
  cmp    0x58(%rsp),%eax
  jne    L433
L225:
  mov    0x30(%rsp),%eax
  test   %eax,%eax
  jle    L41
  mov    0x30(%rsp),%ebx
  mov    0x38(%rsp),%rax
  movss  D34(%rip),%xmm1
  lea    -0x1(%rbx),%edx
  lea    0x4(%rax,%rdx,4),%rdx
  nopl   (%rax)
L22:
  movss  (%rax),%xmm0
  add    $0x4,%rax
  divss  %xmm1,%xmm0
  movss  %xmm0,-0x4(%rax)
  cmp    %rdx,%rax
  jne    L22
L41:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    0x48(%rsp),%rdi
  call   <free@plt>
  mov    0x50(%rsp),%rdi
  call   <free@plt>
  mov    0x34(%rsp),%esi
  mov    0x40(%rsp),%rdi
  xor    %eax,%eax
  call   <Free2DArray@plt>
L8:
  mov    0xf8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L32
  add    $0x108,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L248:
  xor    %eax,%eax
  movss  %xmm0,0x20(%rsp)
  call   <sre_random@plt>
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
  comiss 0x8(%rsp),%xmm1
  jbe    L446
  movss  0x20(%rsp),%xmm0
  mov    %r15d,0x10(%rsp)
  movss  %xmm1,0x8(%rsp)
  movss  %xmm0,(%rsp)
  jmp    L446
L184:
  xor    %ecx,%ecx
  xor    %r11d,%r11d
  jmp    L402
L46:
  lea    D28(%rip),%rdi
  call   <Die@plt>
  jmp    L199
L223:
  movl   $0x3f800000,(%rcx)
  jmp    L8
L283:
  movslq %r13d,%rax
  shl    $0x2,%rax
  jmp    L415
L32:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D38
data_type: string
name: read_data
arguments: tag: D27
data_type: f32
name: read_data
arguments: tag: D10
data_type: byte[4]
name: read_data
arguments: tag: D34
data_type: byte[4]
name: read_data
arguments: tag: D28
data_type: string

tool: D38: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/vinuesa/get_phylomarkers/refs/heads/master/bin/clustal-omega-1.2.4/src/squid/weight.c

tool: D27: 1

tool: {"D10": [0x00,0x00,0x00,0x3f]}

tool: {"D34": [0x00,0x00,0x48,0x42]}

tool: D28: simple_diffmx() failed

assistant: ```c
void VoronoiWeights(char **aseq, int nseq, int alen, float *wgt) {
  float **dmx;
  float *halfmin;
  char **psym;
  int *nsym;
  int symseen[27];
  char *randseq;
  int acol;
  int idx;
  int symidx;
  int i;
  float min;
  float dist;
  float challenge, champion;
  int itscale;
  int iteration;
  int best;
  if (nseq == 1) {
    wgt[0] = 1.0;
    return;
  }
  itscale = 50;
  if (!simple_diffmx(aseq, nseq, &dmx))
    Die("simple_diffmx() failed");
  halfmin = sre_malloc("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/vinuesa/get_phylomarkers/refs/heads/master/bin/clustal-omega-1.2.4/src/squid/weight.c", 181, (sizeof(float) * nseq));
  for (idx = 0; idx < nseq; idx++) {
    for (min = 1.0, i = 0; i < nseq; i++) {
      if (i == idx)
        continue;
      if (dmx[idx][i] < min)
        min = dmx[idx][i];
    }
    halfmin[idx] = min / 2.0;
  }
  Free2DArray((void **)dmx, nseq);
  psym = sre_malloc("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/vinuesa/get_phylomarkers/refs/heads/master/bin/clustal-omega-1.2.4/src/squid/weight.c", 195, (alen * sizeof(char *)));
  nsym = sre_malloc("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/vinuesa/get_phylomarkers/refs/heads/master/bin/clustal-omega-1.2.4/src/squid/weight.c", 196, (alen * sizeof(int)));
  for (acol = 0; acol < alen; acol++)
    psym[acol] = sre_malloc("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/vinuesa/get_phylomarkers/refs/heads/master/bin/clustal-omega-1.2.4/src/squid/weight.c", 198, (27 * sizeof(char)));
  for (acol = 0; acol < alen; acol++) {
    memset(symseen, 0, sizeof(int) * 27);
    for (idx = 0; idx < nseq; idx++)
      if (!((aseq[idx][acol]) == ' ' || (aseq[idx][acol]) == '.' || (aseq[idx][acol]) == '_' || (aseq[idx][acol]) == '-' || (aseq[idx][acol]) == '~')) {
        if (isupper((int)aseq[idx][acol]))
          symidx = aseq[idx][acol] - 'A';
        else
          symidx = aseq[idx][acol] - 'a';
        if (symidx >= 0 && symidx < 26)
          symseen[symidx] = 1;
      } else
        symseen[26] = 1;
    for (nsym[acol] = 0, i = 0; i < 26; i++)
      if (symseen[i]) {
        psym[acol][nsym[acol]] = 'A' + i;
        nsym[acol]++;
      }
    if (symseen[26]) {
      psym[acol][nsym[acol]] = ' ';
      nsym[acol]++;
    }
  }
  randseq = sre_malloc("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/vinuesa/get_phylomarkers/refs/heads/master/bin/clustal-omega-1.2.4/src/squid/weight.c", 265, ((alen + 1) * sizeof(char)));
  best = 42.;
  FSet(wgt, nseq, 0.0);
  for (iteration = 0; iteration < itscale * nseq; iteration++) {
    for (acol = 0; acol < alen; acol++)
      randseq[acol] = (nsym[acol] == 0) ? ' ' : psym[acol][((int)(sre_random() * (nsym[acol])))];
    randseq[acol] = '\0';
    champion = sre_random();
    for (min = 1.0, idx = 0; idx < nseq; idx++) {
      dist = simple_distance(aseq[idx], randseq);
      if (dist < halfmin[idx]) {
        best = idx;
        break;
      }
      if (dist < min) {
        champion = sre_random();
        best = idx;
        min = dist;
      } else if (dist == min) {
        challenge = sre_random();
        if (challenge > champion) {
          champion = challenge;
          best = idx;
          min = dist;
        }
      }
    }
    wgt[best] += 1.0;
  }
  for (idx = 0; idx < nseq; idx++)
    wgt[idx] = wgt[idx] / (float)itscale;
  free(randseq);
  free(nsym);
  free(halfmin);
  Free2DArray((void **)psym, alen);
}
```