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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    D39(%rip),%rbp
  mov    %rbp,%rdi
  call   <puts@plt>
  lea    0x10(%rsp),%rsi
  lea    D55(%rip),%rbx
  mov    %rbx,%rdi
  call   <scanf@plt>
  lea    0x18(%rsp),%rsi
  mov    %rbx,%rdi
  call   <scanf@plt>
  lea    0x20(%rsp),%rsi
  mov    %rbx,%rdi
  call   <scanf@plt>
  lea    0x28(%rsp),%rsi
  mov    %rbx,%rdi
  call   <scanf@plt>
  mov    %rbp,%rdi
  call   <puts@plt>
  lea    0x14(%rsp),%rsi
  mov    %rbx,%rdi
  call   <scanf@plt>
  lea    0x1c(%rsp),%rsi
  mov    %rbx,%rdi
  call   <scanf@plt>
  lea    0x24(%rsp),%rsi
  mov    %rbx,%rdi
  call   <scanf@plt>
  lea    0x2c(%rsp),%rsi
  mov    %rbx,%rdi
  call   <scanf@plt>
  lea    D70(%rip),%rdi
  call   <puts@plt>
  mov    0x20(%rsp),%edx
  add    0x18(%rsp),%edx
  add    0x28(%rsp),%edx
  mov    $0x0,%r12d
  cmovns %edx,%r12d
  movl   $0x0,0xc(%rsp)
  mov    0x10(%rsp),%esi
  lea    D47(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x24(%rsp),%edx
  add    0x1c(%rsp),%edx
  add    0x2c(%rsp),%edx
  cmp    %r12d,%edx
  jle    L10
  mov    %edx,%r12d
  movl   $0x1,0xc(%rsp)
L10:
  mov    0x14(%rsp),%esi
  lea    D47(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D25(%rip),%rdi
  call   <puts@plt>
  mov    $0x1,%ebx
  mov    $0x0,%ebp
  lea    D58(%rip),%r15
  mov    $0x0,%r14d
  lea    D78(%rip),%r13
  jmp    L0
L65:
  mov    %r14d,%ebp
  jmp    L19
L63:
  movslq %ebp,%rax
  mov    0x10(%rsp,%rax,4),%esi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%rbx
  cmp    $0x4,%rbx
  je     L49
L0:
  mov    %ebx,%esi
  mov    %r15,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x10(%rsp,%rbx,8),%edx
  test   %edx,%edx
  jg     L65
  mov    %r14d,%edx
L19:
  mov    0x14(%rsp,%rbx,8),%eax
  cmp    %edx,%eax
  jle    L63
  mov    %eax,%edx
  mov    $0x1,%ebp
  jmp    L63
L49:
  movslq 0xc(%rsp),%rax
  mov    0x10(%rsp,%rax,4),%esi
  mov    %r12d,%edx
  lea    D88(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L22
  mov    $0x0,%eax
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L22:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D39
type_guessed: string
name: read_data
arguments: label: D55
type_guessed: string
name: read_data
arguments: label: D70
type_guessed: string
name: read_data
arguments: label: D47
type_guessed: string
name: read_data
arguments: label: D25
type_guessed: string
name: read_data
arguments: label: D58
type_guessed: string
name: read_data
arguments: label: D78
type_guessed: string
name: read_data
arguments: label: D88
type_guessed: string

tool: D39: Enter data in form of Roll No. Sub1 Sub2 Sub3 

tool: D55: %d

tool: D70: Total Marks Scored: 

tool: D47: Student %d: %d 


tool: D25: MAX MARKS: 

tool: D58: Subject %d: 


tool: D78: Student: %d Marks: %d 


tool: D88: Max. Total By Student: %d and Marks: %d 


assistant: ```c
int main() {
  int data[4][2];
  int i, j;
  for (i = 0; i < 2; i++) {
    printf("Enter data in form of Roll No. Sub1 Sub2 Sub3 \n");
    for (j = 0; j < 4; j++) {
      scanf("%d", &data[j][i]);
    }
  }
  printf("Total Marks Scored: \n");
  int sum;
  int tmax = 0, idmax;
  for (i = 0; i < 2; i++) {
    sum = 0;
    for (j = 1; j < 4; j++) {
      sum += data[j][i];
    }
    if (tmax < sum) {
      tmax = sum;
      idmax = i;
    }
    printf("Student %d: %d \n", data[0][i], sum);
  }
  printf("MAX MARKS: \n");
  int id = 0;
  int max;
  for (j = 1; j < 4; j++) {
    max = 0;
    printf("Subject %d: \n", j);
    for (i = 0; i < 2; i++) {
      if (max < data[j][i]) {
        max = data[j][i];
        id = i;
      }
    }
    printf("Student: %d Marks: %d \n", data[0][id], max);
  }
  printf("Max. Total By Student: %d and Marks: %d \n", data[0][idmax], tmax);
  return 0;
}
```