user: Demonstrate the C code that generates the assembly output below:

```asm
<FormatFraction>:
  endbr64
  push   %r12
  lea    D30(%rip),%r12
  push   %rbx
  mov    $0x27,%ebx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  movl   $0x0,(%rsp)
  movl   $0x0,0x4(%rsp)
  test   %rcx,%rcx
  je     L79
  movslq %r8d,%r8
  mov    %rcx,%r12
  lea    -0x1(%r8),%rbx
L79:
  add    %r12,%rbx
  movb   $0x0,(%rbx)
  test   %edi,%edi
  jne    L116
  mov    $0x30,%eax
  mov    %ax,(%r12)
L116:
  test   %edx,%edx
  je     L93
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  xor    %eax,%eax
  cvtsi2sd %esi,%xmm1
  lea    D24(%rip),%rsi
  cvtsi2sd %edi,%xmm0
  mov    %r12,%rdi
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%edx
  call   <sprintf@plt>
  movzbl (%r12),%edx
  mov    %r12,%rax
  cmp    $0x2d,%dl
  je     L24
  cmp    $0x30,%dl
  je     L32
L13:
  cmpb   $0x0,(%rbx)
  jne    L27
L108:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L83
  add    $0x18,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L32:
  movzbl 0x1(%rax),%edx
  add    $0x1,%rax
  mov    %dl,-0x1(%rax)
  test   %dl,%dl
  je     L13
  movzbl 0x1(%rax),%edx
  add    $0x1,%rax
  mov    %dl,-0x1(%rax)
  test   %dl,%dl
  jne    L32
  jmp    L13
L93:
  lea    0x4(%rsp),%rcx
  mov    %rsp,%rdx
  call   <SimplifyFraction@plt>
  mov    0x4(%rsp),%ecx
  mov    (%rsp),%edx
  cmp    $0x1,%ecx
  je     L152
  lea    D28(%rip),%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <sprintf@plt>
  jmp    L13
  nopl   0x0(%rax)
L152:
  lea    D34(%rip),%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <sprintf@plt>
  jmp    L13
  cs nopw 0x0(%rax,%rax,1)
L24:
  movzbl 0x1(%r12),%edx
  lea    0x1(%r12),%rax
  cmp    $0x30,%dl
  jne    L13
  jmp    L32
  nopl   0x0(%rax)
L27:
  movb   $0x0,(%rbx)
  lea    D35(%rip),%rdi
  xor    %r12d,%r12d
  call   <SetSgError@plt>
  jmp    L108
L83:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D24
type_infered: string
name: retrieve_data
arguments: tag: D28
type_infered: string
name: retrieve_data
arguments: tag: D34
type_infered: string
name: retrieve_data
arguments: tag: D35
type_infered: string

tool: D24: %.6g

tool: D28: %d/%d

tool: D34: %d

tool: D35: Internal Error: FormatFraction(): Buffer too small

assistant: ```c
const char *FormatFraction(int nume, int deno, int Decimal, char *Buffer, int SizeBuffer) {
  int n = 0;
  int d = 0;
  char *cp, *cpp;
  static char StaticBuffer[40];
  if (NULL == Buffer) {
    Buffer = StaticBuffer;
    SizeBuffer = sizeof StaticBuffer / sizeof(*StaticBuffer);
  }
  Buffer[SizeBuffer - 1] = '\0';
  if (nume == 0) {
    Buffer[0] = '0';
    Buffer[1] = '\0';
  }
  if (Decimal) {
    sprintf(Buffer, "%.6g", (double)nume / deno);
    cp = Buffer;
    if (*cp == '-')
      cp++;
    if (*cp == '0') {
      cpp = cp + 1;
      while (*cp)
        *cp++ = *cpp++;
    }
  } else {
    SimplifyFraction(nume, deno, &n, &d);
    if (d == 1)
      sprintf(Buffer, "%d", n);
    else
      sprintf(Buffer, "%d/%d", n, d);
  }
  if (Buffer[SizeBuffer - 1] != '\0') {
    Buffer[SizeBuffer - 1] = '\0';
    SetSgError("Internal Error: FormatFraction(): Buffer too small");
    return NULL;
  }
  return Buffer;
}
```