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

```asm
<halveImage_float>:
  endbr64
  push   %r15
  mov    %edx,%r15d
  push   %r14
  mov    %esi,%r14d
  push   %r13
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  push   %rbx
  sub    $0xa8,%rsp
  mov    %edi,0x8(%rsp)
  movslq 0xe0(%rsp),%rbp
  movslq 0xe8(%rsp),%rbx
  mov    0xf0(%rsp),%r13d
  cmp    $0x1,%esi
  je     L150
  cmp    $0x1,%edx
  je     L150
  mov    %esi,%eax
  shr    $0x1f,%eax
  add    %esi,%eax
  sar    %eax
  mov    %eax,(%rsp)
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  mov    %esi,%edx
  imul   %ebx,%edx
  sar    %eax
  mov    %eax,0x94(%rsp)
  mov    %ebp,%eax
  sub    %edx,%eax
  test   %r13d,%r13d
  jne    L217
  cmp    $0x1,%r15d
  jle    L172
  movslq %ebp,%r13
  cltq
  add    %r13,%rax
  mov    %rax,0x98(%rsp)
  cmp    $0x1,%esi
  jle    L172
  mov    %edi,%ecx
  movslq %r9d,%rax
  lea    (%rbx,%r13,1),%r14
  mov    $0x3,%esi
  mov    %rcx,%r10
  lea    -0x1(%rcx),%r9d
  sub    $0x1,%rcx
  movl   $0x0,0x90(%rsp)
  mov    %rcx,%rdx
  mov    %r9d,0x68(%rsp)
  pxor   %xmm2,%xmm2
  movdqa D7(%rip),%xmm3
  imul   %rax,%rdx
  test   %rax,%rax
  lea    0x0(,%rax,4),%r11
  lea    0x3(%rdx),%rdi
  cmovns %rdi,%rsi
  lea    (%rsi,%r14,1),%rdi
  mov    %rsi,0x60(%rsp)
  mov    %rdi,0x38(%rsp)
  lea    0x3(,%rcx,4),%rdi
  mov    %rdi,0x30(%rsp)
  mov    $0x0,%edi
  cmovs  %rdx,%rdi
  mov    %r10d,%edx
  shr    $0x2,%edx
  lea    (%rdi,%r14,1),%rcx
  mov    %rdi,0x58(%rsp)
  mov    %rcx,0x28(%rsp)
  lea    (%rsi,%rbx,1),%rcx
  add    %r13,%rsi
  mov    %rsi,0x48(%rsp)
  lea    (%rdi,%r13,1),%rsi
  mov    %rsi,0x10(%rsp)
  mov    %r10d,%esi
  lea    (%rax,%rax,2),%r10
  and    $0xfffffffc,%esi
  mov    %rcx,0x20(%rsp)
  lea    (%rdi,%rbx,1),%rcx
  mov    %rcx,0x18(%rsp)
  lea    -0x1(%rdx),%ecx
  mov    %esi,%edx
  lea    0x0(,%rdx,4),%rdi
  mov    %esi,0x6c(%rsp)
  imul   %rax,%rdx
  mov    %rdi,0x70(%rsp)
  lea    0x1(%rsi),%edi
  add    $0x2,%esi
  mov    %esi,0x8c(%rsp)
  mov    %edi,0x88(%rsp)
  mov    %rdx,0x78(%rsp)
  mov    %r9d,%edx
  add    $0x1,%rdx
  lea    0x0(,%rdx,4),%rsi
  imul   %rax,%rdx
  mov    %rsi,0x50(%rsp)
  mov    %rdx,0x40(%rsp)
  lea    0x1(%rcx),%rdx
  shl    $0x4,%rdx
  mov    %rdx,0x80(%rsp)
  nopl   0x0(%rax)
L133:
  xor    %r15d,%r15d
  nopl   0x0(%rax,%rax,1)
L36:
  mov    0x8(%rsp),%edx
  test   %edx,%edx
  jle    L148
  mov    0x30(%rsp),%rdi
  mov    0x18(%rsp),%rcx
  lea    (%r8,%rdi,1),%rsi
  mov    0x20(%rsp),%rdi
  lea    (%r12,%rdi,1),%rdx
  cmp    %rdx,%r8
  lea    (%r12,%rcx,1),%rdx
  mov    0x28(%rsp),%rcx
  seta   %dil
  cmp    %rdx,%rsi
  setb   %dl
  or     %edx,%edi
  lea    (%r12,%rcx,1),%rdx
  cmp    %rdx,%rsi
  mov    0x38(%rsp),%rdx
  setb   %cl
  add    %r12,%rdx
  cmp    %rdx,%r8
  seta   %dl
  or     %ecx,%edx
  and    %edi,%edx
  cmpl   $0x2,0x68(%rsp)
  mov    0x10(%rsp),%rdi
  seta   %cl
  and    %ecx,%edx
  lea    (%r12,%rdi,1),%rcx
  mov    0x48(%rsp),%rdi
  cmp    %rcx,%rsi
  setb   %cl
  add    %r12,%rdi
  cmp    %rdi,%r8
  seta   %dil
  or     %edi,%ecx
  test   %cl,%dl
  je     L175
  mov    0x60(%rsp),%rdi
  lea    (%r12,%rdi,1),%rdx
  mov    0x58(%rsp),%rdi
  cmp    %rdx,%r8
  lea    (%r12,%rdi,1),%rcx
  seta   %dl
  cmp    %rcx,%rsi
  setb   %cl
  or     %dl,%cl
  je     L175
  mov    %r12,%rdi
  lea    (%r12,%rbx,1),%rsi
  lea    (%r12,%r13,1),%rcx
  mov    %r8,%r9
  mov    0x80(%rsp),%rbp
  lea    (%r12,%r14,1),%rdx
  add    %r8,%rbp
  nopl   0x0(%rax)
L219:
  movd   (%rdi,%r10,1),%xmm5
  movd   (%rdi,%rax,1),%xmm6
  add    $0x10,%r9
  movd   (%rdi,%rax,2),%xmm1
  movd   (%rdi),%xmm0
  add    %r11,%rdi
  movd   (%rsi,%r10,1),%xmm7
  movd   (%rsi,%rax,2),%xmm4
  punpckldq %xmm5,%xmm1
  punpckldq %xmm6,%xmm0
  movd   (%rsi,%rax,1),%xmm5
  movd   (%rcx,%r10,1),%xmm6
  punpcklqdq %xmm1,%xmm0
  movd   (%rsi),%xmm1
  punpckldq %xmm7,%xmm4
  add    %r11,%rsi
  movd   (%rcx,%rax,1),%xmm7
  punpckldq %xmm5,%xmm1
  movd   (%rdx,%r10,1),%xmm5
  punpcklqdq %xmm4,%xmm1
  movd   (%rcx,%rax,2),%xmm4
  paddd  %xmm1,%xmm0
  movd   (%rcx),%xmm1
  add    %r11,%rcx
  punpckldq %xmm6,%xmm4
  movd   (%rdx,%rax,1),%xmm6
  punpckldq %xmm7,%xmm1
  punpcklqdq %xmm4,%xmm1
  movd   (%rdx,%rax,2),%xmm4
  paddd  %xmm1,%xmm0
  movd   (%rdx),%xmm1
  add    %r11,%rdx
  punpckldq %xmm5,%xmm4
  punpckldq %xmm6,%xmm1
  punpcklqdq %xmm4,%xmm1
  paddd  %xmm1,%xmm0
  movdqa %xmm2,%xmm1
  pcmpgtd %xmm0,%xmm1
  pand   %xmm3,%xmm1
  paddd  %xmm1,%xmm0
  psrad  $0x2,%xmm0
  movups %xmm0,-0x10(%r9)
  cmp    %rbp,%r9
  jne    L219
  mov    0x70(%rsp),%rsi
  mov    0x8(%rsp),%r9d
  lea    (%r8,%rsi,1),%rcx
  mov    0x78(%rsp),%rsi
  lea    (%r12,%rsi,1),%rdx
  mov    0x50(%rsp),%rsi
  lea    (%r8,%rsi,1),%rdi
  mov    0x6c(%rsp),%esi
  cmp    %esi,%r9d
  je     L117
  mov    (%rdx),%esi
  add    (%rdx,%rbx,1),%esi
  add    (%rdx,%r13,1),%esi
  add    (%rdx,%r14,1),%esi
  lea    0x3(%rsi),%r8d
  cmovns %esi,%r8d
  mov    0x88(%rsp),%esi
  add    %rax,%rdx
  sar    $0x2,%r8d
  mov    %r8d,(%rcx)
  cmp    %esi,%r9d
  jle    L117
  mov    (%rdx),%esi
  add    (%rdx,%rbx,1),%esi
  add    (%rdx,%r13,1),%esi
  add    (%rdx,%r14,1),%esi
  lea    0x3(%rsi),%r8d
  cmovns %esi,%r8d
  lea    (%rdx,%rax,1),%rsi
  mov    0x8c(%rsp),%edx
  sar    $0x2,%r8d
  mov    %r8d,0x4(%rcx)
  cmp    %edx,%r9d
  jle    L117
  mov    (%rsi),%edx
  add    (%rsi,%rbx,1),%edx
  add    (%rsi,%r13,1),%edx
  add    (%rsi,%r14,1),%edx
  lea    0x3(%rdx),%esi
  cmovns %edx,%esi
  sar    $0x2,%esi
  mov    %esi,0x8(%rcx)
L117:
  mov    %rdi,%r8
  add    0x40(%rsp),%r12
L148:
  add    %rbx,%r12
  add    $0x1,%r15d
  cmp    %r15d,(%rsp)
  jg     L36
  addl   $0x1,0x90(%rsp)
  add    0x98(%rsp),%r12
  mov    0x90(%rsp),%esi
  cmp    %esi,0x94(%rsp)
  jg     L133
L172:
  add    $0xa8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L217:
  cmp    $0x1,%r15d
  jle    L172
  cltq
  add    %rbp,%rax
  mov    %rax,0x20(%rsp)
  cmp    $0x1,%esi
  jle    L172
  lea    -0x1(%rdi),%eax
  movslq %r9d,%rsi
  lea    0x0(%rbp,%rbx,1),%r10
  movl   $0x0,0x18(%rsp)
  add    $0x1,%rax
  lea    0x0(,%rax,4),%r14
  imul   %rsi,%rax
  mov    %r14,0x10(%rsp)
  mov    %edi,%r14d
  mov    %rax,0x8(%rsp)
  nopl   (%rax)
L181:
  xor    %r13d,%r13d
  nopl   0x0(%rax,%rax,1)
L153:
  test   %r14d,%r14d
  jle    L135
  mov    0x10(%rsp),%rax
  lea    (%r12,%rbx,1),%r9
  lea    (%r12,%rbp,1),%rdi
  mov    %r12,%rcx
  lea    (%r8,%rax,1),%r11
  nopl   (%rax)
L209:
  mov    0xc(%rcx),%edx
  mov    0x8(%rcx),%eax
  shl    $0x18,%edx
  shl    $0x10,%eax
  or     %eax,%edx
  mov    0x4(%rcx),%eax
  or     (%rcx),%edx
  shl    $0x8,%eax
  or     %eax,%edx
  mov    %edx,(%r8)
  mov    0xc(%r9),%eax
  mov    0x8(%r9),%r15d
  shl    $0x18,%eax
  shl    $0x10,%r15d
  or     %r15d,%eax
  mov    0x4(%r9),%r15d
  or     (%r9),%eax
  shl    $0x8,%r15d
  or     %r15d,%eax
  add    %edx,%eax
  mov    %eax,(%r8)
  mov    0xc(%rdi),%edx
  mov    0x8(%rdi),%r15d
  shl    $0x18,%edx
  shl    $0x10,%r15d
  or     %r15d,%edx
  mov    0x4(%rdi),%r15d
  or     (%rdi),%edx
  shl    $0x8,%r15d
  or     %r15d,%edx
  add    %eax,%edx
  mov    %edx,(%r8)
  mov    0xc(%rcx,%r10,1),%eax
  mov    0x8(%rcx,%r10,1),%r15d
  shl    $0x18,%eax
  shl    $0x10,%r15d
  or     %r15d,%eax
  mov    0x4(%rcx,%r10,1),%r15d
  or     (%rcx,%r10,1),%eax
  shl    $0x8,%r15d
  or     %r15d,%eax
  add    %edx,%eax
  lea    0x3(%rax),%edx
  cmovs  %edx,%eax
  add    $0x4,%r8
  add    %rsi,%rcx
  add    %rsi,%r9
  add    %rsi,%rdi
  sar    $0x2,%eax
  mov    %eax,-0x4(%r8)
  cmp    %r11,%r8
  jne    L209
  add    0x8(%rsp),%r12
L135:
  add    %rbx,%r12
  add    $0x1,%r13d
  cmp    %r13d,(%rsp)
  jg     L153
  addl   $0x1,0x18(%rsp)
  add    0x20(%rsp),%r12
  mov    0x18(%rsp),%eax
  cmp    %eax,0x94(%rsp)
  jg     L181
  jmp    L172
  nopw   0x0(%rax,%rax,1)
L175:
  mov    0x50(%rsp),%rsi
  mov    %r12,%rcx
  lea    (%r8,%rsi,1),%rdi
  nopl   0x0(%rax)
L139:
  mov    (%rcx,%rbx,1),%edx
  add    (%rcx),%edx
  add    (%rcx,%r13,1),%edx
  add    (%rcx,%r14,1),%edx
  lea    0x3(%rdx),%esi
  cmovs  %esi,%edx
  add    $0x4,%r8
  add    %rax,%rcx
  sar    $0x2,%edx
  mov    %edx,-0x4(%r8)
  cmp    %r8,%rdi
  jne    L139
  jmp    L117
L150:
  cmp    $0x1,%r14d
  mov    %r9d,0x10(%rsp)
  setne  %dil
  cmp    $0x1,%r15d
  mov    %r8,(%rsp)
  setne  %al
  or     %eax,%edi
  movzbl %dil,%edi
  call   <assert@plt>
  mov    0x10(%rsp),%r9d
  mov    %r12,%rcx
  mov    %r15d,%edx
  mov    %r13d,0xf0(%rsp)
  mov    (%rsp),%r8
  mov    %r14d,%esi
  mov    %ebx,0xe8(%rsp)
  mov    0x8(%rsp),%edi
  mov    %ebp,0xe0(%rsp)
  add    $0xa8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1070 <halve1Dimage_float@plt>
```

tool_calls: name: disassemble_data
arguments: label: D7
datatype: byte[16]

tool: {"D7": [0x03,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x03,0x00,0x00,0x00]}

assistant: ```c
void halveImage_float(GLint components, GLuint width, GLuint height, const GLfloat *datain, GLfloat *dataout, GLint element_size, GLint ysize, GLint group_size, GLint myswap_bytes) {
  int i, j, k;
  int newwidth, newheight;
  int padBytes;
  GLfloat *s;
  const char *t;
  if (width == 1 || height == 1) {
    assert(!(width == 1 && height == 1));
    halve1Dimage_float(components, width, height, datain, dataout, element_size, ysize, group_size, myswap_bytes);
    return;
  }
  newwidth = width / 2;
  newheight = height / 2;
  padBytes = ysize - (width * group_size);
  s = dataout;
  t = (const char *)datain;
  if (!myswap_bytes)
    for (i = 0; i < newheight; i++) {
      for (j = 0; j < newwidth; j++) {
        for (k = 0; k < components; k++) {
          s[0] = (*(const GLfloat *)t + *(const GLfloat *)(t + group_size) + *(const GLfloat *)(t + ysize) + *(const GLfloat *)(t + ysize + group_size)) / 4;
          s++;
          t += element_size;
        }
        t += group_size;
      }
      t += padBytes;
      t += ysize;
    }
  else
    for (i = 0; i < newheight; i++) {
      for (j = 0; j < newwidth; j++) {
        for (k = 0; k < components; k++) {
          union {
            GLuint b;
            GLfloat f;
          } swapbuf;
          swapbuf.b = (GLuint)(((GLuint)((const GLubyte *)(t))[3]) << 24 | ((GLuint)((const GLubyte *)(t))[2]) << 16 | ((GLuint)((const GLubyte *)(t))[1]) << 8 | ((const GLubyte *)(t))[0]);
          s[0] = swapbuf.f;
          swapbuf.b = (GLuint)(((GLuint)((const GLubyte *)(t + group_size))[3]) << 24 | ((GLuint)((const GLubyte *)(t + group_size))[2]) << 16 | ((GLuint)((const GLubyte *)(t + group_size))[1]) << 8 | ((const GLubyte *)(t + group_size))[0]);
          s[0] += swapbuf.f;
          swapbuf.b = (GLuint)(((GLuint)((const GLubyte *)(t + ysize))[3]) << 24 | ((GLuint)((const GLubyte *)(t + ysize))[2]) << 16 | ((GLuint)((const GLubyte *)(t + ysize))[1]) << 8 | ((const GLubyte *)(t + ysize))[0]);
          s[0] += swapbuf.f;
          swapbuf.b = (GLuint)(((GLuint)((const GLubyte *)(t + ysize + group_size))[3]) << 24 | ((GLuint)((const GLubyte *)(t + ysize + group_size))[2]) << 16 | ((GLuint)((const GLubyte *)(t + ysize + group_size))[1]) << 8 | ((const GLubyte *)(t + ysize + group_size))[0]);
          s[0] += swapbuf.f;
          s[0] /= 4;
          s++;
          t += element_size;
        }
        t += group_size;
      }
      t += padBytes;
      t += ysize;
    }
}
```