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

```asm
<prims>:
  endbr64
  push   %r15
  lea    0x0(,%rsi,4),%r15d
  lea    -0x1(%rsi),%eax
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  mov    %r15d,%edi
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  sub    $0x38,%rsp
  mov    %eax,0x28(%rsp)
  call   <malloc@plt>
  lea    0x0(,%rbp,8),%edi
  mov    %rax,0x8(%rsp)
  call   <malloc@plt>
  mov    %rax,0x10(%rsp)
  test   %ebp,%ebp
  jle    L155
  mov    %ebp,%esi
  mov    %ebx,0x2c(%rsp)
  mov    %rax,%r13
  mov    %rax,%rbx
  mov    %rsi,0x20(%rsp)
  lea    (%rax,%rsi,8),%rsi
  mov    %rsi,0x18(%rsp)
  mov    %rsi,%r14
  nopl   0x0(%rax)
L207:
  mov    %r15d,%edi
  add    $0x8,%rbx
  call   <malloc@plt>
  mov    %rax,-0x8(%rbx)
  cmp    %r14,%rbx
  jne    L207
  mov    0x2c(%rsp),%ebx
  mov    0x20(%rsp),%r14
  mov    %ebx,0x20(%rsp)
  mov    %r13,%rbx
  mov    0x18(%rsp),%r13
  shl    $0x2,%r14
  xchg   %ax,%ax
L138:
  mov    (%rbx),%rdi
  mov    %r14,%rdx
  xor    %esi,%esi
  add    $0x8,%rbx
  call   <memset@plt>
  cmp    %r13,%rbx
  jne    L138
  mov    $0x1,%esi
  mov    %ebp,%edi
  mov    0x20(%rsp),%ebx
  call   <calloc@plt>
  mov    %r15d,%edi
  mov    %rax,%r13
  call   <malloc@plt>
  movl   $0x0,(%rax)
  mov    %rax,%r15
  cmp    $0x1,%ebp
  jle    L145
  lea    -0x2(%rbp),%edx
  lea    0x4(%rax),%rax
  lea    0x8(%r15,%rdx,4),%rdx
  nopl   0x0(%rax,%rax,1)
L165:
  movl   $0x7fffffff,(%rax)
  add    $0x4,%rax
  cmp    %rax,%rdx
  jne    L165
L145:
  mov    0x8(%rsp),%rax
  movb   $0x1,0x0(%r13)
  xor    %r14d,%r14d
  movslq %ebp,%r10
  sub    %r15,%rax
  mov    %rax,0x18(%rsp)
  mov    0x28(%rsp),%eax
  test   %eax,%eax
  jle    L97
  mov    %r15,0x20(%rsp)
  mov    0x28(%rsp),%r15d
  nopl   (%rax)
L136:
  test   %ebp,%ebp
  jle    L169
  movslq %r14d,%rax
  mov    0x20(%rsp),%rdx
  mov    $0x7fffffff,%r11d
  mov    (%r12,%rax,8),%r9
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L31:
  mov    (%r9,%rax,4),%esi
  lea    0x0(%r13,%rax,1),%rcx
  mov    %eax,%r8d
  movzbl (%rcx),%edi
  test   %esi,%esi
  je     L62
  test   %dil,%dil
  jne    L193
  mov    (%rdx),%edi
  cmp    %edi,%esi
  jge    L173
  mov    %esi,(%rdx)
  mov    0x18(%rsp),%rsi
  mov    %r14d,(%rsi,%rdx,1)
  nopl   0x0(%rax)
L62:
  cmpb   $0x0,(%rcx)
  jne    L193
  mov    (%rdx),%edi
L173:
  cmp    %r11d,%edi
  jge    L193
  mov    %r8d,%ebx
  mov    %edi,%r11d
L193:
  add    $0x1,%rax
  add    $0x4,%rdx
  cmp    %rax,%r10
  jne    L31
L169:
  mov    0x8(%rsp),%rsi
  movslq %ebx,%rax
  movb   $0x1,0x0(%r13,%rax,1)
  movslq (%rsi,%rax,4),%rdx
  mov    0x10(%rsp),%rsi
  mov    (%r12,%rdx,8),%rcx
  mov    (%rsi,%rdx,8),%rdx
  mov    (%rcx,%rax,4),%ecx
  mov    %ecx,(%rdx,%rax,4)
  sub    $0x1,%r15d
  je     L97
  mov    %ebx,%r14d
  jmp    L136
  nopw   0x0(%rax,%rax,1)
L97:
  test   %ebp,%ebp
  jle    L161
  mov    0x10(%rsp),%r13
  xor    %r15d,%r15d
  movslq %ebp,%r14
  lea    D6(%rip),%r12
  xchg   %ax,%ax
L162:
  xor    %ebx,%ebx
  jmp    L98
  nopl   0x0(%rax)
L130:
  add    $0x1,%rbx
  cmp    %rbx,%r14
  je     L92
L98:
  mov    0x0(%r13),%rax
  mov    %ebx,%edx
  mov    (%rax,%rbx,4),%ecx
  test   %ecx,%ecx
  je     L130
  mov    %r15d,%esi
  mov    %r12,%rdi
  add    $0x1,%rbx
  call   <printf@plt>
  cmp    %rbx,%r14
  jne    L98
L92:
  add    $0x1,%r15d
  add    $0x8,%r13
  cmp    %r15d,%ebp
  jne    L162
L161:
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L155:
  mov    $0x1,%esi
  mov    %ebp,%edi
  call   <calloc@plt>
  mov    %r15d,%edi
  mov    %rax,%r13
  call   <malloc@plt>
  movl   $0x0,(%rax)
  mov    %rax,%r15
  jmp    L145
```

tool_calls: name: retrieve_data
arguments: data_label: D6
datatype: string

tool: D6: 
Muchia %d - %d, cost: %d

assistant: ```c
int **prims(int **ingraph, int n) {
  int i, j, lastNode = 0, min = (1 << 31) - 1, nextNode, nodesLeft;
  nodesLeft = n - 1;
  int *parent = (int *)malloc(sizeof(int) * n);
  int **outree = (int **)malloc(sizeof(int *) * n);
  for (i = 0; i < n; i++) {
    outree[i] = (int *)malloc(sizeof(int) * n);
  }
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) {
      outree[i][j] = 0;
    }
  char *visit = (char *)calloc(n, sizeof(char));
  int *key = (int *)malloc(sizeof(int) * n);
  key[0] = 0;
  for (i = 1; i < n; i++)
    key[i] = (1 << 31) - 1;
  visit[0] = 1;
  while (nodesLeft > 0) {
    min = (1 << 31) - 1;
    for (i = 0; i < n; i++) {
      if (ingraph[lastNode][i] && !visit[i] && ingraph[lastNode][i] < key[i]) {
        key[i] = ingraph[lastNode][i];
        parent[i] = lastNode;
      }
      if (!visit[i] && key[i] < min) {
        min = key[i];
        nextNode = i;
      }
    }
    visit[nextNode] = 1;
    outree[parent[nextNode]][nextNode] = ingraph[parent[nextNode]][nextNode];
    lastNode = nextNode;
    nodesLeft--;
  }
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++)
      if (outree[i][j] != 0)
        printf("\nMuchia %d - %d, cost: %d", i, j, outree[i][j]);
  return 0;
}
```