user: Please show me the C implementation that matches the assembly code listed below:

```asm
<halveImage_float>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %edi,%r13d
  mov    %esi,0x30(%rsp)
  mov    %edx,%r14d
  mov    %rcx,%r12
  mov    %r8,%rbx
  mov    %r9d,%ebp
  mov    0x80(%rsp),%r15d
  cmp    $0x1,%esi
  je     L152
  cmp    $0x1,%edx
  je     L152
  mov    0x30(%rsp),%esi
  mov    %esi,%r9d
  shr    $0x1f,%r9d
  add    %esi,%r9d
  sar    %r9d
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  sar    %eax
  mov    %eax,0x34(%rsp)
  imul   0x88(%rsp),%esi
  mov    %r15d,%eax
  sub    %esi,%eax
  cmpl   $0x0,0x90(%rsp)
  je     L5
  cmp    $0x1,%r14d
  jle    L169
  lea    -0x1(%rdi),%edx
  add    $0x1,%rdx
  lea    0x0(,%rdx,4),%rdi
  mov    %rdi,0x10(%rsp)
  movslq %ebp,%rbp
  imul   %rbp,%rdx
  mov    %rdx,0x8(%rsp)
  movl   $0x0,0x2c(%rsp)
  movslq 0x88(%rsp),%r11
  movslq %r15d,%rdi
  mov    %rdi,0x18(%rsp)
  lea    (%r11,%rdi,1),%rsi
  mov    %rsi,0x20(%rsp)
  cltq
  add    %rdi,%rax
  mov    %rax,0x38(%rsp)
  jmp    L122
L152:
  cmpl   $0x1,0x30(%rsp)
  setne  %dil
  cmp    $0x1,%r14d
  setne  %al
  or     %eax,%edi
  movzbl %dil,%edi
  call   <assert@plt>
  sub    $0x8,%rsp
  mov    0x98(%rsp),%edi
  push   %rdi
  mov    0x98(%rsp),%edi
  push   %rdi
  push   %r15
  mov    %ebp,%r9d
  mov    %rbx,%r8
  mov    %r12,%rcx
  mov    %r14d,%edx
  mov    0x50(%rsp),%esi
  mov    %r13d,%edi
  call   <halve1Dimage_float@plt>
  add    $0x20,%rsp
L169:
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L5:
  cmp    $0x1,%r14d
  jle    L169
  lea    -0x1(%rdi),%edi
  add    $0x1,%rdi
  lea    0x0(,%rdi,4),%rsi
  movslq %ebp,%rbp
  imul   %rbp,%rdi
  mov    0x90(%rsp),%r8d
  movslq 0x88(%rsp),%rcx
  movslq %r15d,%r10
  cltq
  add    %r10,%rax
  mov    %rax,0x8(%rsp)
  jmp    L207
L95:
  mov    (%rdx,%rcx,1),%eax
  add    (%rdx),%eax
  add    (%rdx,%r10,1),%eax
  lea    (%rdx,%rcx,1),%r15
  add    (%r15,%r10,1),%eax
  lea    0x3(%rax),%r15d
  cmovs  %r15d,%eax
  sar    $0x2,%eax
  mov    %eax,(%rbx)
  add    $0x4,%rbx
  add    %rbp,%rdx
  cmp    %r11,%rbx
  jne    L95
  add    %rdi,%r12
  mov    %r11,%rbx
L76:
  add    %rcx,%r12
  add    $0x1,%r14d
  cmp    %r14d,%r9d
  jle    L117
L191:
  lea    (%rbx,%rsi,1),%r11
  mov    %r12,%rdx
  test   %r13d,%r13d
  jg     L95
  jmp    L76
L117:
  add    0x8(%rsp),%r12
  add    $0x1,%r8d
  cmp    %r8d,0x34(%rsp)
  jle    L169
L207:
  mov    0x90(%rsp),%r14d
  cmpl   $0x1,0x30(%rsp)
  jg     L191
  jmp    L117
L176:
  lea    (%r12,%r11,1),%r8
  mov    0x18(%rsp),%rax
  lea    (%r12,%rax,1),%rdi
  mov    0x20(%rsp),%rax
  lea    (%r12,%rax,1),%rsi
  mov    0x10(%rsp),%rax
  lea    (%rbx,%rax,1),%r10
  mov    %r12,%rcx
L132:
  mov    0xc(%rcx),%edx
  shl    $0x18,%edx
  mov    0x8(%rcx),%eax
  shl    $0x10,%eax
  or     %eax,%edx
  or     (%rcx),%edx
  mov    0x4(%rcx),%eax
  shl    $0x8,%eax
  or     %eax,%edx
  mov    %edx,(%rbx)
  mov    0xc(%r8),%eax
  shl    $0x18,%eax
  mov    0x8(%r8),%r15d
  shl    $0x10,%r15d
  or     %r15d,%eax
  or     (%r8),%eax
  mov    0x4(%r8),%r15d
  shl    $0x8,%r15d
  or     %r15d,%eax
  add    %edx,%eax
  mov    %eax,(%rbx)
  mov    0xc(%rdi),%edx
  shl    $0x18,%edx
  mov    0x8(%rdi),%r15d
  shl    $0x10,%r15d
  or     %r15d,%edx
  or     (%rdi),%edx
  mov    0x4(%rdi),%r15d
  shl    $0x8,%r15d
  or     %r15d,%edx
  add    %eax,%edx
  mov    %edx,(%rbx)
  mov    0xc(%rsi),%eax
  shl    $0x18,%eax
  mov    0x8(%rsi),%r15d
  shl    $0x10,%r15d
  or     %r15d,%eax
  or     (%rsi),%eax
  mov    0x4(%rsi),%r15d
  shl    $0x8,%r15d
  or     %r15d,%eax
  add    %edx,%eax
  lea    0x3(%rax),%edx
  cmovs  %edx,%eax
  sar    $0x2,%eax
  mov    %eax,(%rbx)
  add    $0x4,%rbx
  add    %rbp,%rcx
  add    %rbp,%r8
  add    %rbp,%rdi
  add    %rbp,%rsi
  cmp    %r10,%rbx
  jne    L132
  add    0x8(%rsp),%r12
  mov    %r10,%rbx
L74:
  add    %r11,%r12
  add    $0x1,%r14d
  cmp    %r14d,%r9d
  jle    L120
L165:
  test   %r13d,%r13d
  jg     L176
  jmp    L74
L120:
  add    0x38(%rsp),%r12
  addl   $0x1,0x2c(%rsp)
  mov    0x2c(%rsp),%eax
  cmp    %eax,0x34(%rsp)
  jle    L169
L122:
  mov    $0x0,%r14d
  cmpl   $0x1,0x30(%rsp)
  jg     L165
  jmp    L120
```

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;
    }
}
```