user: Translate the below assembly code into C programming language:

```asm
<regPrintPos>:
  endbr64
  push   %r14
  movapd %xmm0,%xmm1
  push   %r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x70,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  test   %edi,%edi
  je     L17
  pxor   %xmm3,%xmm3
  movsd  D45(%rip),%xmm0
  comisd %xmm1,%xmm3
  mulsd  %xmm1,%xmm0
  ja     L33
L99:
  cvttsd2si %xmm0,%r8
  pxor   %xmm2,%xmm2
  cvtsi2sd %r8,%xmm2
  subsd  %xmm2,%xmm0
  comisd D12(%rip),%xmm0
  jbe    L7
  add    $0x1,%r8
  pxor   %xmm0,%xmm0
L7:
  movabs $0x8888888888888889,%r12
  mov    %r8,%rax
  lea    0x10(%rsp),%r14
  mov    %r8,%rbx
  imul   %r12
  mov    %r8,%rax
  mov    %r14,%rdi
  movsd  %xmm1,0x8(%rsp)
  sar    $0x3f,%rax
  lea    (%rdx,%r8,1),%rcx
  sar    $0x5,%rcx
  sub    %rax,%rcx
  mov    %rcx,%rax
  shl    $0x4,%rax
  sub    %rcx,%rax
  shl    $0x2,%rax
  sub    %rax,%rbx
  mov    %rcx,%rax
  imul   %r12
  mov    %rcx,%rax
  sar    $0x3f,%rax
  lea    (%rdx,%rcx,1),%r12
  sar    $0x5,%r12
  sub    %rax,%r12
  mov    %r12,%rax
  shl    $0x4,%rax
  sub    %r12,%rax
  shl    $0x2,%rax
  sub    %rax,%rcx
  mov    %rcx,%r13
  call   <regPrintVal@plt>
  cmpb   $0x30,0x10(%rsp)
  movsd  0x8(%rsp),%xmm1
  mov    %r14,%r9
  je     L13
L76:
  pxor   %xmm4,%xmm4
  mov    %rbx,%r8
  mov    %r13,%rcx
  mov    %r12,%rdx
  comisd %xmm1,%xmm4
  ja     L27
  lea    D5(%rip),%rsi
  mov    %rbp,%rdi
  call   <sprintf@plt>
L38:
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L59
  add    $0x70,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L27:
  lea    D34(%rip),%rsi
  mov    %rbp,%rdi
  call   <sprintf@plt>
  jmp    L38
  nopl   0x0(%rax)
L33:
  xorpd  D6(%rip),%xmm0
  jmp    L99
  nopl   (%rax)
L13:
  lea    0x11(%rsp),%r9
  jmp    L76
  nopw   0x0(%rax,%rax,1)
L17:
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L59
  add    $0x70,%rsp
  mov    %rsi,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1080 <regPrintVal@plt>
L59:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D45
datatype: f64
name: disassemble_data
arguments: label: D12
datatype: f64[2]
name: disassemble_data
arguments: label: D5
datatype: string
name: disassemble_data
arguments: label: D34
datatype: string
name: disassemble_data
arguments: label: D6
datatype: byte[16]

tool: D45: 3600

tool: {"D12": [0.9999,0.0]}

tool: D5: %02ld:%02ld:%02ld%s

tool: D34: -%02ld:%02ld:%02ld%s

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

assistant: ```c
void regPrintPos(double x, int world, char *buf) {
  char tmp[80];
  char *ptr;
  long h, m;
  double s;
  double fs;
  long is;
  int south;
  if (world) {
    south = x < 0;
    s = x * 3600.0;
    if (south)
      s = -s;
    is = (long)s;
    if (s - is > 0.9999) {
      is++;
      fs = 0;
    } else {
      fs = s - is;
    }
    m = is / 60;
    is = is % 60;
    h = m / 60;
    m = m % 60;
    regPrintVal(fs, tmp);
    ptr = tmp;
    if (*ptr == '0')
      ptr++;
    if (south)
      sprintf(buf, "-%02ld:%02ld:%02ld%s", h, m, is, ptr);
    else
      sprintf(buf, "%02ld:%02ld:%02ld%s", h, m, is, ptr);
  } else {
    regPrintVal(x, buf);
  }
}
```