user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xd0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0xc4(%rbp)
  movl   $0x0,-0xc0(%rbp)
  movl   $0x0,-0xbc(%rbp)
  movl   $0x0,-0xb4(%rbp)
  movl   $0x0,-0xb8(%rbp)
  movl   $0x0,-0xcc(%rbp)
  jmp    L412
L389:
  movl   $0x0,-0xc8(%rbp)
  jmp    L133
L285:
  lea    -0xcd(%rbp),%rax
  mov    %rax,%rsi
  lea    D78(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  movzbl -0xcd(%rbp),%eax
  cmp    $0x2e,%al
  je     L378
  movzbl -0xcd(%rbp),%eax
  cmp    $0x2c,%al
  je     L378
  movzbl -0xcd(%rbp),%eax
  cmp    $0x49,%al
  jne    L6
L378:
  movzbl -0xcd(%rbp),%edx
  mov    -0xc8(%rbp),%eax
  movslq %eax,%rsi
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  shl    $0x2,%rax
  add    %rcx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  add    %rsi,%rax
  sub    $0x50,%rax
  mov    %dl,(%rax)
  jmp    L97
L6:
  nop
L97:
  addl   $0x1,-0xc8(%rbp)
L133:
  cmpl   $0x13,-0xc8(%rbp)
  jle    L285
  addl   $0x1,-0xcc(%rbp)
L412:
  cmpl   $0x2,-0xcc(%rbp)
  jle    L389
  movl   $0x0,-0xcc(%rbp)
  jmp    L75
L215:
  movl   $0x0,-0xc8(%rbp)
  jmp    L118
L46:
  mov    -0xc8(%rbp),%eax
  movslq %eax,%rcx
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  add    %rcx,%rax
  sub    $0x50,%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L280
  addl   $0x1,-0xc4(%rbp)
  jmp    L149
L280:
  mov    -0xc8(%rbp),%eax
  movslq %eax,%rcx
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  add    %rcx,%rax
  sub    $0x50,%rax
  movzbl (%rax),%eax
  cmp    $0x2c,%al
  jne    L404
  addl   $0x2,-0xc4(%rbp)
  jmp    L149
L404:
  mov    -0xc8(%rbp),%eax
  movslq %eax,%rcx
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  add    %rcx,%rax
  sub    $0x50,%rax
  movzbl (%rax),%eax
  cmp    $0x49,%al
  jne    L149
  addl   $0x5,-0xc4(%rbp)
  addl   $0x1,-0xc0(%rbp)
L149:
  addl   $0x1,-0xc8(%rbp)
L118:
  cmpl   $0x13,-0xc8(%rbp)
  jle    L46
  addl   $0x1,-0xbc(%rbp)
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  lea    -0xb0(%rax),%rdx
  mov    -0xbc(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  lea    -0xac(%rax),%rdx
  mov    -0xc4(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  lea    -0xa8(%rax),%rdx
  mov    -0xc0(%rbp),%eax
  mov    %eax,(%rdx)
  movl   $0x0,-0xc4(%rbp)
  movl   $0x0,-0xc0(%rbp)
  addl   $0x1,-0xcc(%rbp)
L75:
  cmpl   $0x2,-0xcc(%rbp)
  jle    L215
  movl   $0x2,-0xcc(%rbp)
  jmp    L394
L163:
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0xa8,%rax
  mov    (%rax),%eax
  cmp    %eax,-0xb8(%rbp)
  jg     L190
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0xa8,%rax
  mov    (%rax),%eax
  mov    %eax,-0xb8(%rbp)
L190:
  subl   $0x1,-0xcc(%rbp)
L394:
  cmpl   $0x0,-0xcc(%rbp)
  jns    L163
  movl   $0x0,-0xcc(%rbp)
  jmp    L219
L11:
  mov    -0xcc(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0xc8(%rbp)
  jmp    L373
L50:
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0xac,%rax
  mov    (%rax),%ecx
  mov    -0xc8(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0xac,%rax
  mov    (%rax),%eax
  cmp    %eax,%ecx
  jle    L310
  mov    -0xc8(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0xb0,%rax
  mov    (%rax),%edx
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  add    %rax,%rax
  add    %rcx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  add    $0xffffffffffffff80,%rax
  mov    %edx,(%rax)
  mov    -0xc8(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0xac,%rax
  mov    (%rax),%edx
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  add    %rax,%rax
  add    %rcx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x7c,%rax
  mov    %edx,(%rax)
  mov    -0xc8(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0xa8,%rax
  mov    (%rax),%edx
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  add    %rax,%rax
  add    %rcx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x78,%rax
  mov    %edx,(%rax)
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0xb0,%rax
  mov    (%rax),%edx
  mov    -0xc8(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  add    %rax,%rax
  add    %rcx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0xb0,%rax
  mov    %edx,(%rax)
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0xac,%rax
  mov    (%rax),%edx
  mov    -0xc8(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  add    %rax,%rax
  add    %rcx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0xac,%rax
  mov    %edx,(%rax)
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0xa8,%rax
  mov    (%rax),%edx
  mov    -0xc8(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  add    %rax,%rax
  add    %rcx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0xa8,%rax
  mov    %edx,(%rax)
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  add    $0xffffffffffffff80,%rax
  mov    (%rax),%edx
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  add    %rax,%rax
  add    %rcx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0xb0,%rax
  mov    %edx,(%rax)
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x7c,%rax
  mov    (%rax),%edx
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  add    %rax,%rax
  add    %rcx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0xac,%rax
  mov    %edx,(%rax)
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x78,%rax
  mov    (%rax),%edx
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  add    %rax,%rax
  add    %rcx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0xa8,%rax
  mov    %edx,(%rax)
L310:
  addl   $0x1,-0xc8(%rbp)
L373:
  cmpl   $0x2,-0xc8(%rbp)
  jle    L50
  addl   $0x1,-0xcc(%rbp)
L219:
  cmpl   $0x2,-0xcc(%rbp)
  jle    L11
  movl   $0x0,-0xcc(%rbp)
  jmp    L171
L231:
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0xa8,%rax
  mov    (%rax),%eax
  mov    -0xb8(%rbp),%edx
  sub    $0x3,%edx
  cmp    %edx,%eax
  jl     L44
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0xb0,%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L330
L44:
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0xa8,%rax
  mov    (%rax),%eax
  mov    -0xb8(%rbp),%edx
  sub    $0x2,%edx
  cmp    %edx,%eax
  jl     L24
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0xb0,%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L330
L24:
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0xa8,%rax
  mov    (%rax),%eax
  mov    -0xb8(%rbp),%edx
  sub    $0x1,%edx
  cmp    %edx,%eax
  jl     L258
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0xb0,%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L330
L258:
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0xa8,%rax
  mov    (%rax),%eax
  cmp    %eax,-0xb8(%rbp)
  jg     L315
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0xb0,%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L330
L315:
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0xa8,%rax
  mov    (%rax),%eax
  cmp    %eax,-0xb8(%rbp)
  jge    L151
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0xb0,%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L330
L151:
  mov    -0xb8(%rbp),%eax
  lea    0x1(%rax),%ecx
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0xa8,%rax
  mov    (%rax),%eax
  cmp    %eax,%ecx
  jge    L122
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0xb0,%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L330
L122:
  mov    -0xb8(%rbp),%eax
  lea    0x2(%rax),%ecx
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0xa8,%rax
  mov    (%rax),%eax
  cmp    %eax,%ecx
  jge    L406
  mov    -0xcc(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0xb0,%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L330
L406:
  addl   $0x1,-0xcc(%rbp)
L171:
  cmpl   $0x2,-0xcc(%rbp)
  jle    L231
L330:
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L5
  call   <__stack_chk_fail@plt>
L5:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D78
type_guessed: string
name: retrieve_data
arguments: data_tag: D17
type_guessed: string

tool: D78:  %c

tool: D17: Pozicioniraj se u %d. red!

assistant: ```c
int main() {
  int i, j, br_vremena = 0, br_kukuruza = 0, br_reda = 0, pravi_red = 0, tablica[3][3], temp[3][3], max_kuk = 0;
  char unos, kukuruziste[3][20];
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 20; j++) {
      scanf(" %c", &unos);
      if (unos == '.' || unos == ',' || unos == 'I') {
        kukuruziste[i][j] = unos;
      } else {
        continue;
      }
    }
  }
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 20; j++) {
      if (kukuruziste[i][j] == '.') {
        br_vremena += 1;
      } else if (kukuruziste[i][j] == ',') {
        br_vremena += 2;
      } else if (kukuruziste[i][j] == 'I') {
        br_vremena += 5;
        br_kukuruza += 1;
      }
    }
    br_reda++;
    tablica[i][0] = br_reda;
    tablica[i][1] = br_vremena;
    tablica[i][2] = br_kukuruza;
    br_vremena = 0;
    br_kukuruza = 0;
  }
  for (i = 2; i >= 0; i--) {
    if (tablica[i][2] >= max_kuk) {
      max_kuk = tablica[i][2];
    }
  }
  for (i = 0; i < 3; i++) {
    for (j = i + 1; j < 3; j++) {
      if (tablica[i][1] > tablica[j][1]) {
        temp[i][0] = tablica[j][0];
        temp[i][1] = tablica[j][1];
        temp[i][2] = tablica[j][2];
        tablica[j][0] = tablica[i][0];
        tablica[j][1] = tablica[i][1];
        tablica[j][2] = tablica[i][2];
        tablica[i][0] = temp[i][0];
        tablica[i][1] = temp[i][1];
        tablica[i][2] = temp[i][2];
      }
    }
  }
  for (i = 0; i < 3; i++) {
    if (tablica[i][2] >= max_kuk - 3) {
      printf("Pozicioniraj se u %d. red!", tablica[i][0]);
      break;
    } else if (tablica[i][2] >= max_kuk - 2) {
      printf("Pozicioniraj se u %d. red!", tablica[i][0]);
      break;
    } else if (tablica[i][2] >= max_kuk - 1) {
      printf("Pozicioniraj se u %d. red!", tablica[i][0]);
      break;
    } else if (tablica[i][2] >= max_kuk) {
      printf("Pozicioniraj se u %d. red!", tablica[i][0]);
      break;
    } else if (tablica[i][2] >= max_kuk + 1) {
      printf("Pozicioniraj se u %d. red!", tablica[i][0]);
      break;
    } else if (tablica[i][2] >= max_kuk + 2) {
      printf("Pozicioniraj se u %d. red!", tablica[i][0]);
      break;
    } else if (tablica[i][2] >= max_kuk + 3) {
      printf("Pozicioniraj se u %d. red!", tablica[i][0]);
      break;
    }
  }
  return 0;
}
```