user: What would the C source look like for the assembly code provided here:

```asm
<outhalves>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  shr    $0x2,%rsi
  je     L192
  mov    %rdi,%r13
  mov    %rsi,%rbp
  lea    -0x4(%rdi,%rsi,4),%rdx
  jmp    L17
  nopw   0x0(%rax,%rax,1)
L115:
  add    $0x1,%rax
  sub    $0x4,%rdx
  cmp    %rax,%rsi
  je     L192
L17:
  mov    (%rdx),%ecx
  test   %ecx,%ecx
  je     L115
  cmp    $0xfe,%rax
  jle    L23
  lea    0x0(,%rax,4),%rdx
  cmp    %rsi,%rdx
  jl     L23
  and    $0xfffffffffffffffc,%rax
  sub    %rax,%rsi
  mov    %rax,%r12
  mov    %rsi,%rbp
  test   %rsi,%rsi
  jg     L60
  mov    $0x1,%edi
  lea    D20(%rip),%r14
  call   <beginblock@plt>
L104:
  mov    %rsp,%rbp
  mov    %r14,%rdx
  lea    D37(%rip),%rsi
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  mov    %r12,%rdx
  xor    %esi,%esi
  call   <strf@plt>
  mov    %eax,%edi
  call   <outcomment@plt>
  jmp    L40
  nopl   (%rax)
L23:
  xor    %r12d,%r12d
L60:
  test   %rbp,%rbp
  mov    $0x1,%ecx
  cmovg  %rbp,%rcx
  cmp    $0x3,%rbp
  jle    L117
  mov    %rcx,%rdx
  movdqa D8(%rip),%xmm3
  pxor   %xmm2,%xmm2
  mov    %r13,%rax
  shr    $0x2,%rdx
  shl    $0x4,%rdx
  add    %r13,%rdx
  cs nopw 0x0(%rax,%rax,1)
L166:
  movdqu (%rax),%xmm1
  movdqa %xmm2,%xmm4
  add    $0x10,%rax
  psubd  %xmm3,%xmm4
  movdqa %xmm1,%xmm0
  psubd  %xmm3,%xmm0
  pcmpgtd %xmm4,%xmm0
  pand   %xmm0,%xmm1
  pandn  %xmm2,%xmm0
  movdqa %xmm0,%xmm2
  por    %xmm1,%xmm2
  cmp    %rdx,%rax
  jne    L166
  movdqa %xmm2,%xmm0
  movdqa %xmm2,%xmm4
  mov    %rcx,%rdx
  psrldq $0x8,%xmm0
  psubd  %xmm3,%xmm4
  and    $0xfffffffffffffffc,%rdx
  and    $0x3,%ecx
  movdqa %xmm0,%xmm1
  psubd  %xmm3,%xmm1
  pcmpgtd %xmm4,%xmm1
  pand   %xmm1,%xmm0
  pandn  %xmm2,%xmm1
  por    %xmm0,%xmm1
  movdqa %xmm1,%xmm2
  movdqa %xmm1,%xmm4
  psrldq $0x4,%xmm2
  psubd  %xmm3,%xmm4
  movdqa %xmm2,%xmm0
  psubd  %xmm3,%xmm0
  pcmpgtd %xmm4,%xmm0
  pand   %xmm0,%xmm2
  pandn  %xmm1,%xmm0
  por    %xmm2,%xmm0
  movd   %xmm0,%eax
  je     L139
L116:
  mov    0x0(%r13,%rdx,4),%ecx
  lea    0x0(,%rdx,4),%rsi
  cmp    %ecx,%eax
  cmovb  %ecx,%eax
  lea    0x1(%rdx),%rcx
  cmp    %rbp,%rcx
  jge    L139
  mov    0x4(%r13,%rsi,1),%ecx
  cmp    %ecx,%eax
  cmovb  %ecx,%eax
  add    $0x2,%rdx
  cmp    %rdx,%rbp
  jle    L139
  mov    0x8(%r13,%rsi,1),%edx
  cmp    %edx,%eax
  cmovb  %edx,%eax
L139:
  cmp    $0xff,%eax
  jbe    L206
  lea    D15(%rip),%r14
L74:
  mov    $0x1,%edi
  call   <beginblock@plt>
L75:
  xor    %ebx,%ebx
  nopl   (%rax)
L57:
  mov    0x0(%r13,%rbx,4),%esi
  mov    %r14,%rdi
  add    $0x1,%rbx
  call   <outf@plt>
  cmp    %rbp,%rbx
  jl     L57
  test   %r12,%r12
  jne    L104
L40:
  xor    %eax,%eax
  call   <endblock@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L204
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L206:
  lea    D33(%rip),%r14
  cmp    $0x63,%eax
  ja     L74
  mov    $0x1,%edi
  lea    D20(%rip),%r14
  call   <beginblock@plt>
  jmp    L75
  nop
L192:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L204
  add    $0x20,%rsp
  lea    D67(%rip),%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1130 <out@plt>
L117:
  xor    %edx,%edx
  xor    %eax,%eax
  jmp    L116
L204:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D20
datatype: string
name: unpack_data
arguments: label: D37
datatype: string
name: unpack_data
arguments: label: D8
datatype: byte[16]
name: unpack_data
arguments: label: D15
datatype: string
name: unpack_data
arguments: label: D33
datatype: string
name: unpack_data
arguments: label: D67
datatype: string

tool: D20: %u

tool: D37: %s x %%ld

tool: {"D8": [0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80]}

tool: D15: 0x%04X

tool: D33: 0x%02X

tool: D67: { 0 }

assistant: ```c
void outhalves(void const *ptr, long size, int ndx) {
  Elf64_Half const *halves = ptr;
  long count = size / sizeof *halves;
  char fmtbuf[16];
  char const *fmt = NULL;
  unsigned int max;
  long zeroes, i;
  (void)ndx;
  for (zeroes = 0; zeroes < count; ++zeroes)
    if (halves[count - zeroes - 1])
      break;
  if (zeroes == count) {
    out("{ 0 }");
    return;
  }
  if (zeroes < 255 || zeroes * 4 < count)
    zeroes = 0;
  zeroes &= ~3;
  count -= zeroes;
  max = 0;
  for (i = 0; i < count; ++i) {
    if (max < halves[i])
      max = halves[i];
  }
  fmt = max > 0xFF ? "0x%04X" : max > 99 ? "0x%02X" : "%u";
  beginblock(1);
  for (i = 0; i < count; ++i)
    outf(fmt, halves[i]);
  if (zeroes) {
    sprintf(fmtbuf, "%s x %%ld", fmt);
    outcomment(strf(fmtbuf, 0, zeroes));
  }
  endblock();
}
```