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

```asm
<main>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  cmp    $0x2,%edi
  je     L40
  mov    (%rsi),%rsi
  lea    D5(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L40:
  mov    0x8(%r12),%rdi
  xor    %ebx,%ebx
  call   <atoi@plt>
  mulss  D79(%rip),%xmm0
  divss  D97(%rip),%xmm0
  jmp    L95
  nopl   0x0(%rax)
L68:
  cmp    $0xff,%ebx
  jg     L30
  cmp    $0xff,%ebp
  jg     L30
L95:
  add    $0x1,%ebx
  pxor   %xmm1,%xmm1
  pxor   %xmm2,%xmm2
  cvtsi2ss %ebx,%xmm1
  mulss  %xmm0,%xmm1
  cvttss2si %xmm1,%ebp
  cvtsi2ss %ebp,%xmm2
  ucomiss %xmm1,%xmm2
  jp     L68
  jne    L68
L30:
  cmp    $0x100,%ebx
  je     L6
L29:
  lea    -0x3(%rbp),%eax
  cmp    $0xfc,%eax
  ja     L45
L72:
  mov    0x8(%r12),%rsi
  lea    D58(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %ebp,%edx
  mov    %ebp,%esi
  lea    D67(%rip),%rdi
  xor    %eax,%eax
  shl    $0x8,%ebp
  call   <printf@plt>
  mov    %ebx,%edx
  mov    %ebx,%esi
  lea    D82(%rip),%rdi
  xor    %eax,%eax
  movslq %ebx,%rbx
  call   <printf@plt>
  movslq %ebp,%rsi
  lea    D30(%rip),%rdi
  xor    %eax,%eax
  add    %rbx,%rsi
  mov    %rsi,%rdx
  call   <printf@plt>
  lea    D118(%rip),%rdi
  call   <puts@plt>
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  ret
L45:
  mov    %ebp,%esi
  lea    D20(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D26(%rip),%rdi
  call   <puts@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L72
L6:
  mov    $0x100,%esi
  lea    D80(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D26(%rip),%rdi
  call   <puts@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L29
```

tool_calls: name: unpack_data
arguments: label: D5
data_type: string
name: unpack_data
arguments: label: D79
data_type: byte[4]
name: unpack_data
arguments: label: D97
data_type: byte[4]
name: unpack_data
arguments: label: D58
data_type: string
name: unpack_data
arguments: label: D67
data_type: string
name: unpack_data
arguments: label: D82
data_type: string
name: unpack_data
arguments: label: D30
data_type: string
name: unpack_data
arguments: label: D118
data_type: string
name: unpack_data
arguments: label: D20
data_type: string
name: unpack_data
arguments: label: D26
data_type: string
name: unpack_data
arguments: label: D80
data_type: string

tool: D5: usage: %s frequenz


tool: {"D79": [0x00,0x00,0x00,0x3f]}

tool: {"D97": [0x00,0x00,0xd8,0x41]}

tool: D58: frequ=%s


tool: D67: ndiv=%d (%x)


tool: D82: mdiv=%d (%x)


tool: D30: pll0_ndiv_mdiv for module=%ld (%lx)


tool: D118: frequenz is ok

tool: D20: ndiv not correct (%d)


tool: D26: frequenz can't be used

tool: D80: mdiv not correct (%d)


assistant: ```c
main(int argc, char *argv[]) {
  int ndiv = 0, mdiv = 0;
  float frequ = 0, frequ_check = 1;
  unsigned long ndiv_mdiv = 0;
  if (argc != 2) {
    printf("usage: %s frequenz\n", argv[0]);
    exit(1);
  }
  frequ = atoi(argv[1]);
  frequ = frequ / 2 / 27;
  while (frequ_check != ndiv && mdiv <= 255 && ndiv <= 255) {
    mdiv++;
    frequ_check = frequ * mdiv;
    ndiv = frequ_check;
  }
  if (mdiv < 0 || mdiv > 255) {
    printf("mdiv not correct (%d)\n", mdiv);
    printf("frequenz can't be used\n");
    exit(1);
  }
  if (ndiv < 3 || ndiv > 255) {
    printf("ndiv not correct (%d)\n", ndiv);
    printf("frequenz can't be used\n");
    exit(1);
  }
  printf("frequ=%s\n", argv[1]);
  printf("ndiv=%d (%x)\n", ndiv, ndiv);
  printf("mdiv=%d (%x)\n", mdiv, mdiv);
  ndiv_mdiv = mdiv;
  ndiv_mdiv += (ndiv << 8);
  printf("pll0_ndiv_mdiv for module=%ld (%lx)\n", ndiv_mdiv, ndiv_mdiv);
  printf("frequenz is ok\n");
}
```