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

```asm
<ivtv_api_dec_speed>:
  endbr64
  cvttss2si %xmm0,%eax
  sub    $0x8,%rsp
  test   %eax,%eax
  js     L83
  movss  D22(%rip),%xmm1
  test   %esi,%esi
  jg     L82
  comiss %xmm0,%xmm1
  ja     L103
  ucomiss D22(%rip),%xmm0
  jp     L171
  je     L131
L171:
  ucomiss D26(%rip),%xmm0
  jp     L172
  je     L159
L172:
  comiss D69(%rip),%xmm0
  jbe    L117
  push   $0x0
  mov    $0x1,%r9d
  xor    %r8d,%r8d
  push   $0x0
  push   $0x0
  push   $0x0
L36:
  xor    %ecx,%ecx
  xor    %edx,%edx
  xor    %esi,%esi
  call   <__ivtv_api_dec_speed@plt>
  add    $0x20,%rsp
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
  nopl   0x0(%rax,%rax,1)
L82:
  comiss %xmm0,%xmm1
  ja     L22
  ucomiss D22(%rip),%xmm0
  jp     L140
  je     L51
L140:
  ucomiss D26(%rip),%xmm0
  jp     L94
  je     L105
L94:
  comiss D69(%rip),%xmm0
  jbe    L161
  push   $0x0
  mov    $0x1,%r9d
  push   $0x0
  push   $0x0
  push   $0x1
L107:
  mov    $0x1,%r8d
  jmp    L36
  nopw   0x0(%rax,%rax,1)
L83:
  test   %esi,%esi
  jle    L131
L51:
  push   $0x0
  mov    $0x3,%r9d
  push   $0x0
  push   $0x0
  push   $0x1
  jmp    L107
L159:
  push   $0x0
  mov    $0x7,%r9d
  xor    %r8d,%r8d
  push   $0x0
  push   $0x0
  push   $0x0
L18:
  mov    $0x1,%ecx
  xor    %edx,%edx
  mov    $0x1,%esi
  call   <__ivtv_api_dec_speed@plt>
  add    $0x20,%rsp
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
  nopl   (%rax)
L105:
  push   $0x0
  mov    $0x3,%r9d
  mov    $0x1,%r8d
  push   $0x0
  push   $0x0
  push   $0x1
  jmp    L18
  cs nopw 0x0(%rax,%rax,1)
L22:
  divss  %xmm0,%xmm1
  push   $0x0
  mov    $0x3,%r9d
  xor    %ecx,%ecx
  push   $0x0
  mov    $0x1,%r8d
  xor    %edx,%edx
  push   $0x0
  push   $0x1
  cvttss2si %xmm1,%esi
  call   <__ivtv_api_dec_speed@plt>
  add    $0x20,%rsp
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
L103:
  divss  %xmm0,%xmm1
  push   $0x0
  mov    $0x7,%r9d
  xor    %r8d,%r8d
  push   $0x0
  xor    %ecx,%ecx
  xor    %edx,%edx
  push   $0x0
  push   $0x0
  cvttss2si %xmm1,%esi
  call   <__ivtv_api_dec_speed@plt>
  add    $0x20,%rsp
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
  nopl   (%rax)
L131:
  push   $0x0
  mov    $0x7,%r9d
  xor    %r8d,%r8d
  push   $0x0
  push   $0x0
  push   $0x0
  jmp    L36
  cs nopw 0x0(%rax,%rax,1)
L117:
  push   $0x0
  mov    $0x7,%r9d
  xor    %r8d,%r8d
  push   $0x0
  push   $0x0
  push   $0x0
L33:
  mov    $0x1,%ecx
  xor    %edx,%edx
  mov    $0x2,%esi
  call   <__ivtv_api_dec_speed@plt>
  add    $0x20,%rsp
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
  nopl   (%rax)
L161:
  push   $0x0
  mov    $0x7,%r9d
  mov    $0x1,%r8d
  push   $0x0
  push   $0x0
  push   $0x1
  jmp    L33
```

tool_calls: name: unpack_data
arguments: label: D22
type_infered: byte[4]
name: unpack_data
arguments: label: D26
type_infered: byte[4]
name: unpack_data
arguments: label: D69
type_infered: byte[4]

tool: {"D22": [0x00,0x00,0xf0,0x41]}

tool: {"D26": [0x00,0x00,0x34,0x42]}

tool: {"D69": [0x00,0x00,0x70,0x42]}

assistant: ```c
int ivtv_api_dec_speed(int ivtvfd, int direction, float fps) {
  int _speed = (int)fps;
  int b_per_gop = 1;
  int aud_mute = 0;
  int fr_field = 0;
  int mute = 0;
  int i_frames = 1;
  int ip_frames = 3;
  int ipb_frames = 7;
  if (direction > 1)
    direction = 1;
  else if (direction < 0)
    direction = 0;
  if (_speed < 0)
    _speed = fps = 30;
  if (direction == 0) {
    if (fps < 30) {
      _speed = 30 / fps;
      __ivtv_api_dec_speed(ivtvfd, _speed, 0, 0, direction, ipb_frames, 0, aud_mute, fr_field, mute);
    } else if (fps == 30) {
      __ivtv_api_dec_speed(ivtvfd, 0, 0, 0, direction, ipb_frames, 0, aud_mute, fr_field, mute);
    } else if (fps == (1.5 * 30)) {
      _speed = 1;
      __ivtv_api_dec_speed(ivtvfd, _speed, 0, 1, direction, ipb_frames, 0, aud_mute, fr_field, mute);
    } else if (fps > (2 * 30)) {
      __ivtv_api_dec_speed(ivtvfd, 0, 0, 0, direction, i_frames, 0, aud_mute, fr_field, mute);
    } else {
      _speed = 2;
      __ivtv_api_dec_speed(ivtvfd, _speed, 0, 1, direction, ipb_frames, 0, aud_mute, fr_field, mute);
    }
  } else {
    if (fps < 30) {
      _speed = 30 / fps;
      __ivtv_api_dec_speed(ivtvfd, _speed, 0, 0, direction, ip_frames, b_per_gop, aud_mute, fr_field, mute);
    } else if (fps == 30) {
      __ivtv_api_dec_speed(ivtvfd, 0, 0, 0, direction, ip_frames, b_per_gop, aud_mute, fr_field, mute);
    } else if (fps == (1.5 * 30)) {
      _speed = 1;
      __ivtv_api_dec_speed(ivtvfd, _speed, 0, 1, direction, ip_frames, b_per_gop, aud_mute, fr_field, mute);
    } else if (fps > (2 * 30)) {
      __ivtv_api_dec_speed(ivtvfd, 0, 0, 0, direction, i_frames, b_per_gop, aud_mute, fr_field, mute);
    } else {
      _speed = 2;
      __ivtv_api_dec_speed(ivtvfd, _speed, 0, 1, direction, ipb_frames, b_per_gop, aud_mute, fr_field, mute);
    }
  }
  return 0;
}
```