user: 请从给定的汇编指令推导出C源代码：

```asm
<halve1Dimage_uint>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %edi,-0x44(%rbp)
  mov    %esi,-0x48(%rbp)
  mov    %edx,-0x4c(%rbp)
  mov    %rcx,-0x58(%rbp)
  mov    %r8,-0x60(%rbp)
  mov    %r9d,-0x50(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x48(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x3c(%rbp)
  mov    -0x4c(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x38(%rbp)
  mov    -0x58(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x60(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  cmpl   $0x1,-0x48(%rbp)
  je     L57
  cmpl   $0x1,-0x4c(%rbp)
  jne    L171
L57:
  mov    $0x1,%eax
  jmp    L172
L171:
  mov    $0x0,%eax
L172:
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x48(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  cmpl   $0x1,-0x4c(%rbp)
  jne    L31
  cmpl   $0x1,-0x48(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  movl   $0x1,-0x38(%rbp)
  movl   $0x0,-0x34(%rbp)
  jmp    L7
L61:
  movl   $0x0,-0x30(%rbp)
  jmp    L181
L140:
  cmpl   $0x0,0x20(%rbp)
  je     L166
  mov    -0x20(%rbp),%rax
  add    $0xc,%rax
  mov    (%rax),%eax
  shl    $0x18,%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%eax
  shl    $0x10,%eax
  or     %eax,%edx
  mov    -0x20(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  shl    $0x8,%eax
  or     %eax,%edx
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  or     %edx,%eax
  mov    %eax,-0x10(%rbp)
  mov    0x18(%rbp),%eax
  cltq
  lea    0xc(%rax),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  shl    $0x18,%eax
  mov    %eax,%edx
  mov    0x18(%rbp),%eax
  cltq
  lea    0x8(%rax),%rcx
  mov    -0x20(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  shl    $0x10,%eax
  or     %eax,%edx
  mov    0x18(%rbp),%eax
  cltq
  lea    0x4(%rax),%rcx
  mov    -0x20(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  shl    $0x8,%eax
  mov    %edx,%ecx
  or     %eax,%ecx
  mov    0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  or     %ecx,%eax
  mov    %eax,-0xc(%rbp)
  jmp    L58
L166:
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x10(%rbp)
  mov    0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
L58:
  mov    -0x10(%rbp),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  mov    -0xc(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  addsd  %xmm1,%xmm0
  movsd  D18(%rip),%xmm1
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x50(%rbp),%eax
  cltq
  add    %rax,-0x20(%rbp)
  addq   $0x4,-0x18(%rbp)
  addl   $0x1,-0x30(%rbp)
L181:
  mov    -0x30(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jl     L140
  mov    0x18(%rbp),%eax
  cltq
  add    %rax,-0x20(%rbp)
  addl   $0x1,-0x34(%rbp)
L7:
  mov    -0x34(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L61
  mov    -0x48(%rbp),%eax
  imul   0x18(%rbp),%eax
  mov    %eax,%edx
  mov    0x10(%rbp),%eax
  sub    %edx,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x24(%rbp),%eax
  cltq
  add    %rax,-0x20(%rbp)
  jmp    L37
L31:
  cmpl   $0x1,-0x48(%rbp)
  jne    L37
  mov    -0x48(%rbp),%eax
  imul   0x18(%rbp),%eax
  mov    %eax,%edx
  mov    0x10(%rbp),%eax
  sub    %edx,%eax
  mov    %eax,-0x28(%rbp)
  cmpl   $0x1,-0x4c(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  movl   $0x1,-0x3c(%rbp)
  movl   $0x0,-0x34(%rbp)
  jmp    L49
L176:
  movl   $0x0,-0x2c(%rbp)
  jmp    L30
L91:
  cmpl   $0x0,0x20(%rbp)
  je     L132
  mov    -0x20(%rbp),%rax
  add    $0xc,%rax
  mov    (%rax),%eax
  shl    $0x18,%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%eax
  shl    $0x10,%eax
  or     %eax,%edx
  mov    -0x20(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  shl    $0x8,%eax
  or     %eax,%edx
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  or     %edx,%eax
  mov    %eax,-0x10(%rbp)
  mov    0x10(%rbp),%eax
  cltq
  lea    0xc(%rax),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  shl    $0x18,%eax
  mov    %eax,%edx
  mov    0x10(%rbp),%eax
  cltq
  lea    0x8(%rax),%rcx
  mov    -0x20(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  shl    $0x10,%eax
  or     %eax,%edx
  mov    0x10(%rbp),%eax
  cltq
  lea    0x4(%rax),%rcx
  mov    -0x20(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  shl    $0x8,%eax
  mov    %edx,%ecx
  or     %eax,%ecx
  mov    0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  or     %ecx,%eax
  mov    %eax,-0xc(%rbp)
  jmp    L83
L132:
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x10(%rbp)
  mov    0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
L83:
  mov    -0x10(%rbp),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  mov    -0xc(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  addsd  %xmm1,%xmm0
  movsd  D18(%rip),%xmm1
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x50(%rbp),%eax
  cltq
  add    %rax,-0x20(%rbp)
  addq   $0x4,-0x18(%rbp)
  addl   $0x1,-0x2c(%rbp)
L30:
  mov    -0x2c(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jl     L91
  mov    -0x28(%rbp),%eax
  cltq
  add    %rax,-0x20(%rbp)
  mov    0x10(%rbp),%eax
  cltq
  add    %rax,-0x20(%rbp)
  addl   $0x1,-0x34(%rbp)
L49:
  mov    -0x34(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L176
  mov    0x10(%rbp),%eax
  imul   -0x4c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  cmp    %rax,-0x20(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
L37:
  mov    -0x44(%rbp),%eax
  imul   -0x50(%rbp),%eax
  imul   -0x3c(%rbp),%eax
  imul   -0x38(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  cmp    %rax,-0x18(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L16
  call   <__stack_chk_fail@plt>
L16:
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D18
type_guessed: f64

tool: D18: 2

assistant: ```c
void halve1Dimage_uint(GLint components, GLuint width, GLuint height, const GLuint *dataIn, GLuint *dataOut, GLint element_size, GLint ysize, GLint group_size, GLint myswap_bytes) {
  GLint halfWidth = width / 2;
  GLint halfHeight = height / 2;
  const char *src = (const char *)dataIn;
  GLuint *dest = dataOut;
  int jj;
  assert(width == 1 || height == 1);
  assert(width != height);
  if (height == 1) {
    assert(width != 1);
    halfHeight = 1;
    for (jj = 0; jj < halfWidth; jj++) {
      int kk;
      for (kk = 0; kk < components; kk++) {
        GLuint uint[2];
        if (myswap_bytes) {
          uint[0] = (GLuint)(((GLuint)((const GLubyte *)(src))[3]) << 24 | ((GLuint)((const GLubyte *)(src))[2]) << 16 | ((GLuint)((const GLubyte *)(src))[1]) << 8 | ((const GLubyte *)(src))[0]);
          uint[1] = (GLuint)(((GLuint)((const GLubyte *)(src + group_size))[3]) << 24 | ((GLuint)((const GLubyte *)(src + group_size))[2]) << 16 | ((GLuint)((const GLubyte *)(src + group_size))[1]) << 8 | ((const GLubyte *)(src + group_size))[0]);
        } else {
          uint[0] = *(const GLuint *)src;
          uint[1] = *(const GLuint *)(src + group_size);
        }
        *dest = ((double)uint[0] + (double)uint[1]) / 2.0;
        src += element_size;
        dest++;
      }
      src += group_size;
    }
    {
      int padBytes = ysize - (width * group_size);
      src += padBytes;
    }
  } else if (width == 1) {
    int padBytes = ysize - (width * group_size);
    assert(height != 1);
    halfWidth = 1;
    for (jj = 0; jj < halfHeight; jj++) {
      int kk;
      for (kk = 0; kk < components; kk++) {
        GLuint uint[2];
        if (myswap_bytes) {
          uint[0] = (GLuint)(((GLuint)((const GLubyte *)(src))[3]) << 24 | ((GLuint)((const GLubyte *)(src))[2]) << 16 | ((GLuint)((const GLubyte *)(src))[1]) << 8 | ((const GLubyte *)(src))[0]);
          uint[1] = (GLuint)(((GLuint)((const GLubyte *)(src + ysize))[3]) << 24 | ((GLuint)((const GLubyte *)(src + ysize))[2]) << 16 | ((GLuint)((const GLubyte *)(src + ysize))[1]) << 8 | ((const GLubyte *)(src + ysize))[0]);
        } else {
          uint[0] = *(const GLuint *)src;
          uint[1] = *(const GLuint *)(src + ysize);
        }
        *dest = ((double)uint[0] + (double)uint[1]) / 2.0;
        src += element_size;
        dest++;
      }
      src += padBytes;
      src += ysize;
    }
    assert(src == &((const char *)dataIn)[ysize * height]);
  }
  assert((char *)dest == &((char *)dataOut)[components * element_size * halfWidth * halfHeight]);
}
```