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

```asm
<main>:
  endbr64
  push   %r14
  mov    $0x65,%ecx
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x350,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x348(%rsp)
  xor    %eax,%eax
  lea    0x20(%rsp),%rbx
  lea    0x4(%rsp),%rdx
  mov    %rsp,%rsi
  mov    %rbx,%rdi
  lea    0xc(%rsp),%r8
  rep stos %rax,%es:(%rdi)
  lea    0x8(%rsp),%rcx
  lea    D4(%rip),%rdi
  call   <scanf@plt>
  mov    (%rsp),%eax
  mov    %eax,0x18(%rsp)
  mov    0x4(%rsp),%eax
  mov    %eax,0x1c(%rsp)
  mov    0xc(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0xc(%rsp)
  test   %eax,%eax
  je     L51
  lea    0x14(%rsp),%r13
  lea    0x10(%rsp),%r12
  lea    D3(%rip),%rbp
  lea    0x28(%rsp),%r14
  nopl   0x0(%rax)
L60:
  mov    %r13,%rdx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  movslq 0x10(%rsp),%rdi
  mov    0x14(%rsp),%r8d
  imul   $0x194,%rdi,%rdx
  mov    0x18(%rsp,%rdi,4),%esi
  mov    0x20(%rsp,%rdx,1),%eax
  add    $0x1,%eax
  mov    %eax,0x20(%rsp,%rdx,1)
  lea    (%rdi,%rdi,4),%rdx
  cltq
  lea    (%rdx,%rdx,4),%rdx
  lea    (%rdi,%rdx,4),%rdx
  add    %rdx,%rax
  mov    %r8d,0x20(%rsp,%rax,4)
  mov    (%rsp),%eax
  test   %edi,%edi
  je     L6
  mov    0x4(%rsp),%eax
L6:
  imul   $0x194,%rdi,%rcx
  sub    %r8d,%eax
  movslq 0x20(%rsp,%rcx,1),%rdx
  cmp    %eax,%r8d
  jg     L99
  lea    (%rdi,%rdi,4),%rax
  lea    (%rax,%rax,4),%rax
  lea    (%rdi,%rax,4),%rax
  add    %rax,%rdx
  mov    %r8d,0x20(%rsp,%rdx,4)
  cmp    %r8d,%esi
  jle    L42
  movslq 0x20(%rsp,%rcx,1),%rdx
  mov    %r8d,%esi
  add    %rax,%rdx
  mov    %r8d,0x20(%rsp,%rdx,4)
  movslq 0x20(%rsp,%rcx,1),%rdx
  add    %rdx,%rax
  mov    %r8d,0x20(%rsp,%rax,4)
L42:
  imul   $0x194,%rdi,%rax
  mov    %esi,0x18(%rsp,%rdi,4)
  mov    0x20(%rsp,%rax,1),%edx
  cmp    $0x1,%edx
  jle    L91
  lea    0x4(%rbx,%rax,1),%rcx
  lea    (%rdi,%rdi,4),%rax
  sub    $0x2,%edx
  lea    (%rax,%rax,4),%rax
  lea    (%rdi,%rax,4),%rax
  add    %rdx,%rax
  lea    (%r14,%rax,4),%r9
  xchg   %ax,%ax
L32:
  mov    (%rcx),%eax
  sub    %r8d,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    %eax,%esi
  cmovg  %eax,%esi
  add    $0x4,%rcx
  cmp    %rcx,%r9
  jne    L32
  mov    %esi,0x18(%rsp,%rdi,4)
L91:
  mov    0xc(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0xc(%rsp)
  test   %eax,%eax
  jne    L60
L51:
  mov    0x18(%rsp),%esi
  imul   0x8(%rsp),%esi
  lea    D28(%rip),%rdi
  imul   0x1c(%rsp),%esi
  call   <printf@plt>
  mov    0x348(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L57
  add    $0x350,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L99:
  cmp    %eax,%esi
  jle    L42
  lea    (%rdi,%rdi,4),%rcx
  mov    %eax,%esi
  lea    (%rcx,%rcx,4),%rcx
  lea    (%rdi,%rcx,4),%rcx
  add    %rcx,%rdx
  mov    %r8d,0x20(%rsp,%rdx,4)
  jmp    L42
L57:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D4
datatype: string
name: read_data
arguments: data_tag: D3
datatype: string
name: read_data
arguments: data_tag: D28
datatype: string

tool: D4: %d %d %d %d

tool: D3: %d %d

tool: D28: %d


assistant: ```c
int main(void) {
  int x, y, z, n;
  int xy[2][101] = {{0}};
  int xym[2];
  scanf("%d %d %d %d", &x, &y, &z, &n);
  xym[0] = x;
  xym[1] = y;
  while (n--) {
    int d, a, i;
    scanf("%d %d", &d, &a);
    xy[d][0]++;
    xym[d] = ((xym[d]) > (((xy[d][xy[d][0]] = a) > ((d ? y : x) - a) ? ((d ? y : x) - a) : (xy[d][xy[d][0]] = a))) ? (((xy[d][xy[d][0]] = a) > ((d ? y : x) - a) ? ((d ? y : x) - a) : (xy[d][xy[d][0]] = a))) : (xym[d]));
    for (i = 1; i < xy[d][0]; i++) {
      xym[d] = (((0 > (xy[d][i] - a) ? (-(xy[d][i] - a)) : xy[d][i] - a)) > (xym[d]) ? (xym[d]) : ((0 > (xy[d][i] - a) ? (-(xy[d][i] - a)) : xy[d][i] - a)));
    }
  }
  printf("%d\n", z * xym[0] * xym[1]);
  return 0;
}
```