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

```asm
<main>:
  endbr64
  push   %r15
  xor    %edi,%edi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    $0x2,%ebp
  push   %rbx
  mov    %ebp,%r15d
  sub    $0x288,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x278(%rsp)
  movabs $0x500000004,%rax
  lea    0x70(%rsp),%r12
  mov    %rax,0x50(%rsp)
  movabs $0x300000002,%rax
  mov    %rax,0x5c(%rsp)
  movabs $0x500000003,%rax
  mov    %rax,0x68(%rsp)
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  lea    0x4c(%rsp),%rax
  mov    %rax,0x30(%rsp)
  lea    0x58(%rsp),%rax
  mov    %rax,0x38(%rsp)
  lea    0x64(%rsp),%rax
  mov    %rax,0x28(%rsp)
  lea    0x48(%rsp),%rax
  mov    %rax,0x10(%rsp)
L123:
  mov    0x38(%rsp),%rax
  mov    $0x1,%r13d
  mov    %r15d,%ebp
  mov    %rax,0x20(%rsp)
L131:
  mov    0x28(%rsp),%rax
  mov    $0x1,%r15d
  mov    %rax,0x18(%rsp)
L140:
  mov    $0x1,%r14d
L83:
  movl   $0x1,0x4(%rsp)
L68:
  movl   $0x1,(%rsp)
  mov    %r12,%rax
  mov    $0x1,%ebx
  mov    %ebp,%r12d
  mov    %r14d,%ebp
  mov    %rax,%r14
L88:
  sub    $0x8,%rsp
  mov    %ebp,%r9d
  mov    %r15d,%r8d
  mov    %r13d,%ecx
  push   %rbx
  mov    0x10(%rsp),%eax
  mov    %r12d,%edx
  lea    D24(%rip),%rsi
  mov    %r14,%rdi
  push   %rax
  mov    0x1c(%rsp),%eax
  push   %rax
  call   <sprintf@plt>
  add    $0x20,%rsp
  mov    %r14,%rdi
  call   <system@plt>
  lea    D11(%rip),%rsi
  lea    D55(%rip),%rdi
  movl   $0x0,0x48(%rsp)
  call   <fopen@plt>
  mov    0x10(%rsp),%rdx
  lea    D2(%rip),%rsi
  mov    %rax,%rdi
  call   <fscanf@plt>
  lea    D31(%rip),%rsi
  lea    D37(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%r10
  test   %rax,%rax
  je     L72
L71:
  mov    0x48(%rsp),%eax
  mov    %r10,%rdi
  mov    %ebp,%r9d
  mov    %r15d,%r8d
  mov    %r12d,%edx
  lea    D56(%rip),%rsi
  push   %rax
  push   %rbx
  mov    0x10(%rsp),%eax
  push   %rax
  mov    0x1c(%rsp),%ecx
  push   %rcx
  mov    %r13d,%ecx
  mov    %r10,0x28(%rsp)
  call   <fprintf@plt>
  mov    0x28(%rsp),%rdi
  add    $0x20,%rsp
  call   <fclose@plt>
  cmp    $0x2,%ebx
  jne    L91
  cmpl   $0x2,(%rsp)
  je     L20
  movl   $0x2,(%rsp)
  mov    $0x1,%ebx
  jmp    L88
  nopl   (%rax)
L91:
  mov    $0x2,%ebx
  jmp    L88
  nopw   0x0(%rax,%rax,1)
L20:
  mov    %r14,%rax
  cmpl   $0x2,0x4(%rsp)
  mov    %ebp,%r14d
  mov    %r12d,%ebp
  mov    %rax,%r12
  je     L2
  movl   $0x2,0x4(%rsp)
  jmp    L68
L72:
  lea    D45(%rip),%rdi
  mov    %rax,0x8(%rsp)
  call   <error@plt>
  mov    0x8(%rsp),%r10
  jmp    L71
  nopl   0x0(%rax,%rax,1)
L2:
  cmp    $0x2,%r14d
  je     L23
  mov    $0x2,%r14d
  jmp    L83
  nopl   0x0(%rax)
L23:
  addq   $0x4,0x18(%rsp)
  mov    0x18(%rsp),%rax
  cmp    %r12,%rax
  je     L75
  mov    (%rax),%r15d
  jmp    L140
L75:
  addq   $0x4,0x20(%rsp)
  mov    0x20(%rsp),%rax
  cmp    0x28(%rsp),%rax
  je     L80
  mov    (%rax),%r13d
  jmp    L131
L80:
  addq   $0x4,0x30(%rsp)
  mov    0x30(%rsp),%rax
  cmp    %rax,0x38(%rsp)
  je     L169
  mov    (%rax),%r15d
  jmp    L123
L169:
  mov    0x278(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L41
  add    $0x288,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L41:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D24
type_infered: string
name: parse_data
arguments: label: D11
type_infered: string
name: parse_data
arguments: label: D55
type_infered: string
name: parse_data
arguments: label: D2
type_infered: string
name: parse_data
arguments: label: D31
type_infered: string
name: parse_data
arguments: label: D37
type_infered: string
name: parse_data
arguments: label: D56
type_infered: string
name: parse_data
arguments: label: D45
type_infered: string

tool: D24: python pebbleAuto.py %d %d %d %d %d %d %d

tool: D11: r

tool: D55: auto_out.res

tool: D2: %d

tool: D31: a+

tool: D37: output.txt

tool: D56: %d %d %d %d %d %d %d - %d


tool: D45: Error Opening output file 'output.txt'


assistant: ```c
int main(int argc, char **argv) {
  FILE *output;
  int columnValues[3] = {2, 4, 5};
  int pebbleValues[3] = {1, 2, 3};
  int plyValues[3] = {1, 3, 5};
  int columnCounter = 0, pebbleCounter = 0, plyCounter = 0;
  int p1Algorithm, p2Algorithm;
  int p1Heuristic, p2Heuristic;
  char python_command[512];
  srand(time(NULL));
  for (columnCounter = 0; columnCounter < 3; columnCounter++) {
    int columnValue = columnValues[columnCounter];
    for (pebbleCounter = 0; pebbleCounter < 3; pebbleCounter++) {
      int pebbleValue = pebbleValues[pebbleCounter];
      for (plyCounter = 0; plyCounter < 3; plyCounter++) {
        int plyValue = plyValues[plyCounter];
        for (p1Algorithm = 1; p1Algorithm <= 2; p1Algorithm++) {
          for (p2Algorithm = 1; p2Algorithm <= 2; p2Algorithm++) {
            for (p1Heuristic = 1; p1Heuristic <= 2; p1Heuristic++) {
              for (p2Heuristic = 1; p2Heuristic <= 2; p2Heuristic++) {
                sprintf(python_command, "python pebbleAuto.py %d %d %d %d %d %d %d", columnValue, pebbleValue, plyValue, p1Algorithm, p2Algorithm, p1Heuristic, p2Heuristic);
                system(python_command);
                int winner = 0;
                FILE *input = fopen("auto_out.res", "r");
                fscanf(input, "%d", &winner);
                output = fopen("output.txt", "a+");
                if (!output)
                  error("Error Opening output file 'output.txt'\n");
                fprintf(output, "%d %d %d %d %d %d %d - %d\n", columnValue, pebbleValue, plyValue, p1Algorithm, p2Algorithm, p1Heuristic, p2Heuristic, winner);
                fclose(output);
              }
            }
          }
        }
      }
    }
  }
  return 0;
}
```