user: Converte this assembly snippet into its equivalent C code:

```asm
<_glp_mat_amd_order1>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x110,%rsp
  mov    %edi,-0xf4(%rbp)
  mov    %rsi,-0x100(%rbp)
  mov    %rdx,-0x108(%rbp)
  mov    %rcx,-0x110(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0xe0(%rbp),%rax
  mov    %rax,%rdi
  call   <_glp_amd_defaults@plt>
  movl   $0x1,-0xe8(%rbp)
  jmp    L48
L127:
  mov    -0xe8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x108(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  sub    $0x1,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0xe8(%rbp)
L48:
  mov    -0xf4(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x100(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0xe8(%rbp)
  jl     L127
  movl   $0x1,-0xe8(%rbp)
  jmp    L49
L138:
  mov    -0xe8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x100(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  sub    $0x1,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0xe8(%rbp)
L49:
  mov    -0xf4(%rbp),%eax
  add    $0x1,%eax
  cmp    %eax,-0xe8(%rbp)
  jle    L138
  mov    -0x110(%rbp),%rax
  lea    0x4(%rax),%rcx
  mov    -0x108(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    -0x100(%rbp),%rax
  lea    0x4(%rax),%rsi
  lea    -0xb0(%rbp),%r8
  lea    -0xe0(%rbp),%rdi
  mov    -0xf4(%rbp),%eax
  mov    %r8,%r9
  mov    %rdi,%r8
  mov    %eax,%edi
  call   <_glp_amd_order@plt>
  mov    %eax,-0xe4(%rbp)
  cmpl   $0x0,-0xe4(%rbp)
  je     L112
  cmpl   $0x1,-0xe4(%rbp)
  je     L112
  mov    $0x200,%edx
  lea    D41(%rip),%rax
  mov    %rax,%rsi
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  call   <_glp_lib_xassert@plt>
L112:
  movl   $0x1,-0xe8(%rbp)
  jmp    L5
L81:
  mov    -0xe8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x100(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  add    $0x1,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0xe8(%rbp)
L5:
  mov    -0xf4(%rbp),%eax
  add    $0x1,%eax
  cmp    %eax,-0xe8(%rbp)
  jle    L81
  movl   $0x1,-0xe8(%rbp)
  jmp    L70
L65:
  mov    -0xe8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x108(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  add    $0x1,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0xe8(%rbp)
L70:
  mov    -0xf4(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x100(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0xe8(%rbp)
  jl     L65
  mov    -0xf4(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edx
  mov    -0xf4(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rcx
  mov    -0x110(%rbp),%rax
  add    %rcx,%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  movl   $0x1,-0xe8(%rbp)
  jmp    L19
L60:
  mov    -0xe8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x110(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  add    $0x1,%edx
  mov    %edx,(%rax)
  mov    -0xe8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x110(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jle    L50
  mov    -0xe8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x110(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0xf4(%rbp)
  jge    L99
L50:
  mov    $0x208,%edx
  lea    D41(%rip),%rax
  mov    %rax,%rsi
  lea    D30(%rip),%rax
  mov    %rax,%rdi
  call   <_glp_lib_xassert@plt>
L99:
  mov    -0xe8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x110(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0xf4(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x110(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L37
  mov    $0x209,%edx
  lea    D41(%rip),%rax
  mov    %rax,%rsi
  lea    D55(%rip),%rax
  mov    %rax,%rdi
  call   <_glp_lib_xassert@plt>
L37:
  mov    -0xe8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x110(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0xf4(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x110(%rbp),%rax
  add    %rax,%rdx
  mov    -0xe8(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0xe8(%rbp)
L19:
  mov    -0xe8(%rbp),%eax
  cmp    -0xf4(%rbp),%eax
  jle    L60
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L153
  call   <__stack_chk_fail@plt>
L153:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: label: D41
type_guessed: string
name: disassemble_data
arguments: label: D12
type_guessed: string
name: disassemble_data
arguments: label: D30
type_guessed: string
name: disassemble_data
arguments: label: D55
type_guessed: string

tool: D41: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/macmanes-lab/BinPacker/refs/heads/master/glpk-4.40/src/glpmat.c

tool: D12: ret == AMD_OK || ret == AMD_OK_BUT_JUMBLED

tool: D30: 1 <= P_per[k] && P_per[k] <= n

tool: D55: P_per[n+P_per[k]] == 0

assistant: ```c
void _glp_mat_amd_order1(int n, int A_ptr[], int A_ind[], int P_per[]) {
  int k, ret;
  double Control[5], Info[20];
  _glp_amd_defaults(Control);
  for (k = 1; k < A_ptr[n + 1]; k++)
    A_ind[k]--;
  for (k = 1; k <= n + 1; k++)
    A_ptr[k]--;
  ret = _glp_amd_order(n, &A_ptr[1], &A_ind[1], &P_per[1], Control, Info);
  ((void)((ret == 0 || ret == 1) || (_glp_lib_xassert("ret == AMD_OK || ret == AMD_OK_BUT_JUMBLED", "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/macmanes-lab/BinPacker/refs/heads/master/glpk-4.40/src/glpmat.c", 512), 1)));
  for (k = 1; k <= n + 1; k++)
    A_ptr[k]++;
  for (k = 1; k < A_ptr[n + 1]; k++)
    A_ind[k]++;
  memset(&P_per[n + 1], 0, n * sizeof(int));
  for (k = 1; k <= n; k++) {
    P_per[k]++;
    ((void)((1 <= P_per[k] && P_per[k] <= n) || (_glp_lib_xassert("1 <= P_per[k] && P_per[k] <= n", "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/macmanes-lab/BinPacker/refs/heads/master/glpk-4.40/src/glpmat.c", 520), 1)));
    ((void)((P_per[n + P_per[k]] == 0) || (_glp_lib_xassert("P_per[n+P_per[k]] == 0", "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/macmanes-lab/BinPacker/refs/heads/master/glpk-4.40/src/glpmat.c", 521), 1)));
    P_per[n + P_per[k]] = k;
  }
  return;
}
```