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

```asm
<classify_region>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    0x20(%rdi),%eax
  movl   $0x0,(%rsi)
  mov    %rdi,0x18(%rsp)
  mov    %ecx,0x24(%rsp)
  mov    %r8,0x28(%rsp)
  mov    %r9d,0x30(%rsp)
  mov    %eax,0x3c(%rsp)
  test   %eax,%eax
  je     L21
  movss  (%rdi),%xmm5
  movss  0x10(%rdi),%xmm4
  mov    %rsi,%rbx
  jle    L23
  mulss  %xmm2,%xmm5
  cvttss2si %xmm0,%r15d
  mov    $0xc,%ebp
  mov    %edx,%r13d
  mulss  %xmm2,%xmm4
  cvttss2si %xmm1,%r14d
  movl   $0x0,0x38(%rsp)
  cvttss2si %xmm5,%eax
  cvttss2si %xmm4,%r8d
  mov    %eax,0x34(%rsp)
  nopl   0x0(%rax,%rax,1)
L19:
  mov    0x18(%rsp),%rcx
  movslq %ebp,%rax
  add    $0x4,%ebp
  mov    (%rcx,%rax,4),%eax
  mov    %eax,0x20(%rsp)
  test   %eax,%eax
  jle    L4
  mov    %r13d,%r9d
  xor    %r12d,%r12d
  mov    %r8d,%r13d
  nopl   0x0(%rax,%rax,1)
L32:
  mov    0x18(%rsp),%rdx
  movslq %ebp,%rax
  sub    $0x8,%rsp
  mov    %r13d,%r8d
  mov    %r15d,%esi
  add    $0x1,%r12d
  lea    (%rdx,%rax,4),%rdi
  mov    0x90(%rsp),%eax
  mov    %r14d,%edx
  push   %rax
  mov    0x90(%rsp),%eax
  push   %rax
  mov    0x48(%rsp),%eax
  push   %rax
  push   0x48(%rsp)
  mov    0x4c(%rsp),%eax
  push   %rax
  mov    0x64(%rsp),%ecx
  mov    %r9d,0x44(%rsp)
  mov    %rdi,0x38(%rsp)
  call   <get_dtree_output@plt>
  pxor   %xmm0,%xmm0
  mov    0x38(%rsp),%rdi
  add    $0x30,%rsp
  cvtsi2ss %rax,%xmm0
  addss  (%rbx),%xmm0
  movss  %xmm0,(%rbx)
  call   <get_dtree_size@plt>
  mov    0x14(%rsp),%r9d
  add    %eax,%ebp
  cmp    %r12d,0x20(%rsp)
  jne    L32
  mov    %r13d,%r8d
  mov    %r9d,%r13d
L4:
  mov    0x18(%rsp),%rsi
  movslq %ebp,%rax
  movss  (%rbx),%xmm0
  add    $0x4,%ebp
  movss  (%rsi,%rax,4),%xmm3
  comiss %xmm0,%xmm3
  jae    L65
  addl   $0x1,0x38(%rsp)
  mov    0x38(%rsp),%eax
  cmp    %eax,0x3c(%rsp)
  jne    L19
L56:
  subss  %xmm3,%xmm0
  movl   $0x1,0x3c(%rsp)
  movss  %xmm0,(%rbx)
L21:
  mov    0x3c(%rsp),%eax
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L65:
  movl   $0xffffffff,0x3c(%rsp)
  jmp    L21
L23:
  pxor   %xmm0,%xmm0
  jmp    L56
```

assistant: ```c
int classify_region(void *od, float *o, float r, float c, float s, int cost, int sint, uint8_t pixels[], int nrows, int ncols, int ldim) {
  int8_t *ptr;
  int loc;
  int32_t nstages;
  float tsr, tsc;
  int i, j;
  int ir, ic, isr, isc;
  float threshold;
  ptr = (int8_t *)od;
  loc = 0;
  *o = 0.0f;
  tsr = *(float *)&ptr[0 * sizeof(float)];
  tsc = *(float *)&ptr[1 * sizeof(float)];
  loc += 2 * sizeof(float);
  ir = (int)(r);
  ic = (int)(c);
  isr = (int)(s * tsr);
  isc = (int)(s * tsc);
  nstages = *(int32_t *)&ptr[loc];
  loc += sizeof(int32_t);
  if (!nstages)
    return 0;
  i = 0;
  while (i < nstages) {
    int numtrees;
    numtrees = *(int32_t *)&ptr[loc];
    loc += sizeof(int32_t);
    for (j = 0; j < numtrees; ++j) {
      *o += get_dtree_output(&ptr[loc], ir, ic, isr, isc, cost, sint, pixels, nrows, ncols, ldim);
      loc += get_dtree_size(&ptr[loc]);
    }
    threshold = *(float *)&ptr[loc];
    loc += sizeof(float);
    if (*o <= threshold)
      return -1;
    ++i;
  }
  *o = *o - threshold;
  return 1;
}
```