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    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x8(%rsp),%rbp
  lea    D38(%rip),%rbx
  lea    D10(%rip),%r12
  jmp    L179
L111:
  mov    0x8(%rsp),%eax
  sub    $0x2,%eax
  cmp    $0x61,%eax
  jbe    L248
L179:
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    0x8(%rsp),%eax
  sub    $0x2,%eax
  cmp    $0x61,%eax
  jbe    L111
  mov    %r12,%rdi
  call   <puts@plt>
  jmp    L111
L248:
  lea    0xc(%rsp),%rbp
  lea    D38(%rip),%rbx
  lea    D10(%rip),%r12
  jmp    L140
L162:
  mov    %r12,%rdi
  call   <puts@plt>
  mov    0xc(%rsp),%eax
  sub    $0x5,%eax
  cmp    $0x2d,%eax
  jbe    L159
L140:
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    0xc(%rsp),%eax
  sub    $0x5,%eax
  cmp    $0x2d,%eax
  ja     L162
L159:
  cmpl   $0x0,0x8(%rsp)
  jle    L66
  mov    $0x0,%r12d
  mov    $0x0,%r14d
  mov    $0x0,%r15d
  mov    $0x0,%r13d
  mov    $0x0,%ebx
  lea    D44(%rip),%rbp
  jmp    L227
L249:
  add    $0x1,%r13d
L200:
  add    $0x1,%ebx
  cmp    %ebx,0x8(%rsp)
  jle    L36
L227:
  lea    0x14(%rsp),%rcx
  lea    0x10(%rsp),%rdx
  lea    0x7(%rsp),%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  movzbl 0x7(%rsp),%eax
  cmp    $0x53,%al
  je     L244
  cmp    $0x54,%al
  je     L62
  cmp    $0x48,%al
  jne    L200
  mov    0xc(%rsp),%esi
  mov    0x10(%rsp),%edi
  call   <jeHambi@plt>
  cmp    $0x1,%eax
  je     L249
  test   %eax,%eax
  jne    L200
  add    0x14(%rsp),%r12d
  jmp    L200
L62:
  mov    0xc(%rsp),%esi
  mov    0x10(%rsp),%edi
  call   <jeTrokut@plt>
  cmp    $0x1,%eax
  je     L80
  test   %eax,%eax
  jne    L200
  add    0x14(%rsp),%r12d
  jmp    L200
L80:
  add    $0x1,%r15d
  jmp    L200
L244:
  mov    0xc(%rsp),%esi
  mov    0x10(%rsp),%edi
  call   <jeSlapica@plt>
  cmp    $0x1,%eax
  je     L209
  test   %eax,%eax
  jne    L200
  add    0x14(%rsp),%r12d
  jmp    L200
L209:
  add    $0x1,%r14d
  jmp    L200
L66:
  mov    $0x0,%r12d
  mov    $0x0,%r14d
  mov    $0x0,%r15d
  mov    $0x0,%r13d
L36:
  pxor   %xmm0,%xmm0
  cvtsi2sd %r12d,%xmm0
  divsd  D74(%rip),%xmm0
  lea    D54(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    %r15d,%ecx
  mov    %r14d,%edx
  mov    %r13d,%esi
  lea    D62(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L75
  mov    $0x0,%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L75:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D38
type_guessed: string
name: read_data
arguments: data_tag: D10
type_guessed: string
name: read_data
arguments: data_tag: D44
type_guessed: string
name: read_data
arguments: data_tag: D74
type_guessed: f64
name: read_data
arguments: data_tag: D54
type_guessed: string
name: read_data
arguments: data_tag: D62
type_guessed: string

tool: D38: %d

tool: D10: Nepravilan unos!

tool: D44:  %c %d%d

tool: D74: 1000

tool: D54: Poklonit ce %.2f kg peciva.


tool: D62: U automatu ce biti %d hambi peciva, %d slapica i %d sir-trokuta.

assistant: ```c
int main() {
  int i, brPeciva, promjerRupe, opseg, tezina, prolazi, H_br = 0, T_br = 0, S_br = 0, poklon = 0;
  char vrstaPeciva;
  do {
    scanf("%d", &brPeciva);
    if (brPeciva <= 1 || brPeciva >= 100)
      printf("Nepravilan unos!\n");
  } while (brPeciva <= 1 || brPeciva >= 100);
  do {
    scanf("%d", &promjerRupe);
    if (promjerRupe < 5 || promjerRupe > 50)
      printf("Nepravilan unos!\n");
  } while (promjerRupe < 5 || promjerRupe > 50);
  for (i = 0; i < brPeciva; i++) {
    scanf(" %c %d%d", &vrstaPeciva, &opseg, &tezina);
    switch (vrstaPeciva) {
    case 'H':
      prolazi = jeHambi(opseg, promjerRupe);
      if (prolazi == 1)
        H_br++;
      else if (prolazi == 0)
        poklon += tezina;
      break;
    case 'T':
      prolazi = jeTrokut(opseg, promjerRupe);
      if (prolazi == 1)
        T_br++;
      else if (prolazi == 0)
        poklon += tezina;
      break;
    case 'S':
      prolazi = jeSlapica(opseg, promjerRupe);
      if (prolazi == 1)
        S_br++;
      else if (prolazi == 0)
        poklon += tezina;
      break;
    default:
      break;
    }
  }
  printf("Poklonit ce %.2f kg peciva.\n", poklon / 1000.00);
  printf("U automatu ce biti %d hambi peciva, %d slapica i %d sir-trokuta.", H_br, S_br, T_br);
  return 0;
}
```