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

```asm
<main>:
  endbr64
  push   %r15
  lea    D15(%rip),%rdi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  lea    D40(%rip),%rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  movabs $0x100000007,%rax
  lea    0x20(%rsp),%r14
  lea    0x38(%rsp),%r12
  movl   $0x1,0x10(%rsp)
  movl   $0x0,0x58(%rsp)
  mov    %r14,%rbx
  mov    %rax,0x20(%rsp)
  movabs $0x300000005,%rax
  mov    %rax,0x28(%rsp)
  movabs $0x400000006,%rax
  mov    %rax,0x30(%rsp)
  movabs $0x600000007,%rax
  mov    %rax,(%rsp)
  movabs $0x300000004,%rax
  mov    %rax,0x8(%rsp)
  sub    $0x3,%rax
  mov    %rax,0x40(%rsp)
  movabs $0x600000004,%rax
  mov    %rax,0x48(%rsp)
  movabs $0x900000007,%rax
  mov    %rax,0x50(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  nopl   0x0(%rax,%rax,1)
L16:
  mov    (%rbx),%esi
  mov    %rbp,%rdi
  xor    %eax,%eax
  add    $0x4,%rbx
  call   <printf@plt>
  cmp    %r12,%rbx
  jne    L16
  mov    %r14,%rdi
  mov    $0x6,%esi
  lea    0x14(%rsp),%r12
  mov    %rsp,%r15
  call   <max_profit_one_transaction@plt>
  lea    D47(%rip),%r13
  mov    %r15,%rbx
  mov    %eax,%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r14,%rdi
  mov    $0x6,%esi
  lea    D32(%rip),%r14
  call   <max_profit_multiple_transactions@plt>
  mov    %r14,%rdi
  mov    %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
L6:
  mov    (%rbx),%esi
  mov    %rbp,%rdi
  xor    %eax,%eax
  add    $0x4,%rbx
  call   <printf@plt>
  cmp    %r12,%rbx
  jne    L6
  mov    $0x5,%esi
  mov    %r15,%rdi
  lea    0x58(%rsp),%r12
  call   <max_profit_one_transaction@plt>
  mov    %r13,%rdi
  mov    %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x6,%esi
  mov    %r15,%rdi
  call   <max_profit_multiple_transactions@plt>
  mov    %r14,%rdi
  lea    0x40(%rsp),%r14
  mov    %eax,%esi
  xor    %eax,%eax
  mov    %r14,%rbx
  call   <printf@plt>
  nopl   0x0(%rax)
L9:
  mov    (%rbx),%esi
  mov    %rbp,%rdi
  xor    %eax,%eax
  add    $0x4,%rbx
  call   <printf@plt>
  cmp    %r12,%rbx
  jne    L9
  mov    $0x7,%esi
  mov    %r14,%rdi
  call   <max_profit_one_transaction@plt>
  mov    %r13,%rdi
  mov    %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x6,%esi
  mov    %r14,%rdi
  call   <max_profit_multiple_transactions@plt>
  lea    D1(%rip),%rdi
  mov    %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L13
  add    $0x78,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L13:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D15
type: string
name: disassemble_data
arguments: data_label: D40
type: string
name: disassemble_data
arguments: data_label: D47
type: string
name: disassemble_data
arguments: data_label: D32
type: string
name: disassemble_data
arguments: data_label: D1
type: string

tool: D15: Max profit of the following stock day prices windows:
[

tool: D40: %d, 

tool: D47: ]
   one transaction %d


tool: D32:    multiple transactions %d
[

tool: D1:    multiple transactions %d


assistant: ```c
int main() {
  int stock_a[6] = {7, 1, 5, 3, 6, 4};
  int stock_b[5] = {7, 6, 4, 3, 1};
  int stock_c[7] = {1, 3, 4, 6, 7, 9};
  printf("Max profit of the following stock day prices windows:\n[");
  for (int i = 0; i < 6; i++)
    printf("%d, ", stock_a[i]);
  printf("]\n   one transaction %d\n", max_profit_one_transaction(stock_a, 6));
  printf("   multiple transactions %d\n[", max_profit_multiple_transactions(stock_a, 6));
  for (int i = 0; i < 5; i++)
    printf("%d, ", stock_b[i]);
  printf("]\n   one transaction %d\n", max_profit_one_transaction(stock_b, 5));
  printf("   multiple transactions %d\n[", max_profit_multiple_transactions(stock_b, 6));
  for (int i = 0; i < 6; i++)
    printf("%d, ", stock_c[i]);
  printf("]\n   one transaction %d\n", max_profit_one_transaction(stock_c, 7));
  printf("   multiple transactions %d\n", max_profit_multiple_transactions(stock_c, 6));
  return 0;
}
```