user: 请将以下的汇编代码转换成C语言代码：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x1c(%rbp)
  movl   $0x0,-0x18(%rbp)
  movl   $0x0,-0x14(%rbp)
  movl   $0x0,-0x10(%rbp)
L42:
  lea    -0x30(%rbp),%rax
  mov    %rax,%rsi
  lea    D63(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    -0x30(%rbp),%eax
  cmp    $0x1,%eax
  jle    L44
  mov    -0x30(%rbp),%eax
  cmp    $0x63,%eax
  jle    L87
L44:
  lea    D52(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L87:
  mov    -0x30(%rbp),%eax
  cmp    $0x1,%eax
  jle    L42
  mov    -0x30(%rbp),%eax
  cmp    $0x63,%eax
  jg     L42
L192:
  lea    -0x2c(%rbp),%rax
  mov    %rax,%rsi
  lea    D63(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    -0x2c(%rbp),%eax
  cmp    $0x4,%eax
  jle    L242
  mov    -0x2c(%rbp),%eax
  cmp    $0x32,%eax
  jle    L47
L242:
  lea    D52(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L47:
  mov    -0x2c(%rbp),%eax
  cmp    $0x4,%eax
  jle    L192
  mov    -0x2c(%rbp),%eax
  cmp    $0x32,%eax
  jg     L192
  movl   $0x0,-0x20(%rbp)
  jmp    L29
L233:
  lea    -0x24(%rbp),%rcx
  lea    -0x28(%rbp),%rdx
  lea    -0x31(%rbp),%rax
  mov    %rax,%rsi
  lea    D44(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  movzbl -0x31(%rbp),%eax
  movsbl %al,%eax
  cmp    $0x54,%eax
  je     L69
  cmp    $0x54,%eax
  jg     L39
  cmp    $0x48,%eax
  je     L10
  cmp    $0x53,%eax
  je     L206
  jmp    L39
L10:
  mov    -0x2c(%rbp),%edx
  mov    -0x28(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <jeHambi@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0x1,-0xc(%rbp)
  jne    L5
  addl   $0x1,-0x1c(%rbp)
  jmp    L21
L5:
  cmpl   $0x0,-0xc(%rbp)
  jne    L21
  mov    -0x24(%rbp),%eax
  add    %eax,-0x10(%rbp)
  jmp    L21
L69:
  mov    -0x2c(%rbp),%edx
  mov    -0x28(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <jeTrokut@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0x1,-0xc(%rbp)
  jne    L81
  addl   $0x1,-0x18(%rbp)
  jmp    L152
L81:
  cmpl   $0x0,-0xc(%rbp)
  jne    L152
  mov    -0x24(%rbp),%eax
  add    %eax,-0x10(%rbp)
  jmp    L152
L206:
  mov    -0x2c(%rbp),%edx
  mov    -0x28(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <jeSlapica@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0x1,-0xc(%rbp)
  jne    L61
  addl   $0x1,-0x14(%rbp)
  jmp    L215
L61:
  cmpl   $0x0,-0xc(%rbp)
  jne    L215
  mov    -0x24(%rbp),%eax
  add    %eax,-0x10(%rbp)
  jmp    L215
L39:
  nop
  jmp    L143
L21:
  nop
  jmp    L143
L152:
  nop
  jmp    L143
L215:
  nop
L143:
  addl   $0x1,-0x20(%rbp)
L29:
  mov    -0x30(%rbp),%eax
  cmp    %eax,-0x20(%rbp)
  jl     L233
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x10(%rbp),%xmm0
  movsd  D15(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  lea    D48(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    -0x18(%rbp),%ecx
  mov    -0x14(%rbp),%edx
  mov    -0x1c(%rbp),%eax
  mov    %eax,%esi
  lea    D0(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L178
  call   <__stack_chk_fail@plt>
L178:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D63
type_guessed: string
name: unpack_data
arguments: tag: D52
type_guessed: string
name: unpack_data
arguments: tag: D44
type_guessed: string
name: unpack_data
arguments: tag: D15
type_guessed: f64
name: unpack_data
arguments: tag: D48
type_guessed: string
name: unpack_data
arguments: tag: D0
type_guessed: string

tool: D63: %d

tool: D52: Nepravilan unos!

tool: D44:  %c %d%d

tool: D15: 1000

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


tool: D0: 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;
}
```