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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpl   $0x4,-0x34(%rbp)
  je     L54
  mov    $0x0,%edi
  call   <usage@plt>
L54:
  mov    -0x40(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  lea    -0x2c(%rbp),%rdx
  lea    D14(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sscanf@plt>
  test   %rax,%rax
  je     L8
  mov    -0x2c(%rbp),%eax
  test   %eax,%eax
  jg     L71
L8:
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  call   <usage@plt>
L71:
  mov    -0x40(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  lea    -0x28(%rbp),%rdx
  lea    D14(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sscanf@plt>
  test   %rax,%rax
  je     L72
  mov    -0x28(%rbp),%eax
  test   %eax,%eax
  jg     L39
L72:
  lea    D49(%rip),%rax
  mov    %rax,%rdi
  call   <usage@plt>
L39:
  mov    -0x40(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%rax
  lea    -0x24(%rbp),%rdx
  lea    D14(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sscanf@plt>
  test   %rax,%rax
  je     L34
  mov    -0x24(%rbp),%eax
  test   %eax,%eax
  jg     L3
L34:
  lea    D26(%rip),%rax
  mov    %rax,%rdi
  call   <usage@plt>
L3:
  mov    -0x2c(%rbp),%edx
  mov    -0x28(%rbp),%eax
  imul   %edx,%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  movl   $0x1,-0x1c(%rbp)
  movl   $0x0,-0x20(%rbp)
  jmp    L40
L26:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x24(%rbp),%edx
  mov    -0x1c(%rbp),%eax
  mov    $0x2,%esi
  mov    %eax,%edi
  call   <galois_single_multiply@plt>
  mov    %eax,-0x1c(%rbp)
  addl   $0x1,-0x20(%rbp)
L40:
  mov    -0x2c(%rbp),%edx
  mov    -0x28(%rbp),%eax
  imul   %edx,%eax
  cmp    %eax,-0x20(%rbp)
  jl     L26
  mov    -0x24(%rbp),%edx
  mov    -0x2c(%rbp),%esi
  mov    -0x28(%rbp),%eax
  mov    -0x18(%rbp),%rcx
  mov    %eax,%edi
  call   <jerasure_matrix_to_bitmatrix@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x24(%rbp),%ecx
  mov    -0x28(%rbp),%edx
  mov    -0x24(%rbp),%eax
  imul   %eax,%edx
  mov    -0x2c(%rbp),%esi
  mov    -0x24(%rbp),%eax
  imul   %eax,%esi
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <jerasure_print_bitmatrix@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L94
  call   <__stack_chk_fail@plt>
L94:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D14
data_type: string
name: extract_symbolic_data
arguments: data_tag: D16
data_type: string
name: extract_symbolic_data
arguments: data_tag: D49
data_type: string
name: extract_symbolic_data
arguments: data_tag: D26
data_type: string

tool: D14: %d

tool: D16: Bad r

tool: D49: Bad c

tool: D26: Bad w

assistant: ```c
int main(int argc, char **argv) {
  int r, c, w, i, n;
  int *matrix;
  int *bitmatrix;
  if (argc != 4)
    usage(NULL);
  if (sscanf(argv[1], "%d", &r) == 0 || r <= 0)
    usage("Bad r");
  if (sscanf(argv[2], "%d", &c) == 0 || c <= 0)
    usage("Bad c");
  if (sscanf(argv[3], "%d", &w) == 0 || w <= 0)
    usage("Bad w");
  matrix = (int *)malloc(sizeof(int) * (r * c));
  n = 1;
  for (i = 0; i < r * c; i++) {
    matrix[i] = n;
    n = galois_single_multiply(n, 2, w);
  }
  bitmatrix = jerasure_matrix_to_bitmatrix(c, r, w, matrix);
  jerasure_print_bitmatrix(bitmatrix, r * w, c * w, w);
  return 0;
}
```