user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x1,-0x10(%rbp)
  lea    -0x2c(%rbp),%rax
  mov    %rax,%rsi
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  movl   $0x0,-0x1c(%rbp)
  jmp    L85
L44:
  lea    -0x24(%rbp),%rcx
  lea    -0x28(%rbp),%rdx
  lea    -0x20(%rbp),%rax
  mov    %rax,%rsi
  lea    D18(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    -0x20(%rbp),%eax
  cmp    $0x1,%eax
  jne    L19
  mov    -0x28(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  mov    -0x24(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,-0xc(%rbp)
L19:
  mov    -0x20(%rbp),%eax
  cmp    $0x2,%eax
  jne    L9
  mov    -0x28(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  shl    $0x2,%eax
  add    %eax,%edx
  mov    -0x24(%rbp),%eax
  mov    %eax,%esi
  lea    0x0(,%rax,4),%ecx
  mov    %esi,%eax
  sub    %ecx,%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
L9:
  cmpl   $0x0,-0xc(%rbp)
  jle    L50
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L82
L50:
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L82:
  cmpl   $0x0,-0x10(%rbp)
  je     L62
  movl   $0x0,-0x10(%rbp)
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L60
L62:
  mov    -0xc(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jle    L60
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x14(%rbp)
L60:
  addl   $0x1,-0x1c(%rbp)
L85:
  mov    -0x2c(%rbp),%eax
  cmp    %eax,-0x1c(%rbp)
  jl     L44
  mov    -0x14(%rbp),%eax
  lea    0x1(%rax),%ecx
  mov    -0x18(%rbp),%eax
  mov    %eax,%edx
  mov    %ecx,%esi
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L38
  call   <__stack_chk_fail@plt>
L38:
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D13
type_guessed: string
name: read_data
arguments: tag: D18
type_guessed: string
name: read_data
arguments: tag: D15
type_guessed: string
name: read_data
arguments: tag: D6
type_guessed: string
name: read_data
arguments: tag: D24
type_guessed: string

tool: D13: %d

tool: D18: %d %d %d

tool: D15: Dobar igrac

tool: D6: Los igrac

tool: D24: Najdobar igrac: br. %d, %d poeni


assistant: ```c
int main() {
  int i, n, maxPoeni, maxIndeks, f = 1;
  int pobedi, porazi, poeni, nivo;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d %d %d", &nivo, &pobedi, &porazi);
    if (nivo == 1)
      poeni = pobedi * 13 - porazi;
    if (nivo == 2)
      poeni = pobedi * 13 - porazi * 3;
    if (poeni > 0)
      printf("Dobar igrac\n");
    else
      printf("Los igrac\n");
    if (f) {
      f = 0;
      maxPoeni = poeni;
      maxIndeks = 0;
    } else if (poeni > maxPoeni) {
      maxPoeni = poeni;
      maxIndeks = i;
    }
  }
  printf("Najdobar igrac: br. %d, %d poeni\n", maxIndeks + 1, maxPoeni);
  return 0;
}
```