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

```asm
<extended_euclid>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rcx,0x10(%rsp)
  mov    %r8,0x18(%rsp)
  test   %rsi,%rsi
  jne    L49
  mov    %rdi,(%r8)
  movq   $0x1,(%rdx)
  movq   $0x0,(%rcx)
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L49:
  lea    D30(%rip),%rdi
  xor    %eax,%eax
  mov    %rsi,%rbx
  mov    %rdx,0x8(%rsp)
  call   <printf@plt>
  lea    D84(%rip),%rdi
  call   <puts@plt>
  lea    D97(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D77(%rip),%rdi
  call   <puts@plt>
  lea    D30(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D84(%rip),%rdi
  call   <puts@plt>
  test   %rbx,%rbx
  mov    0x8(%rsp),%r9
  jle    L32
  xor    %edi,%edi
  mov    $0x1,%r13d
  mov    $0x1,%ecx
  xor    %r15d,%r15d
  jmp    L25
  xchg   %ax,%ax
L14:
  mov    %rbp,%r13
  mov    %r14,%r15
L25:
  mov    %r12,%rax
  mov    %rbx,%r12
  mov    %r9,0x8(%rsp)
  cqto
  idiv   %rbx
  mov    %rax,%rsi
  imul   %r15,%rax
  mov    %rdx,%rbx
  sub    %rax,%rcx
  mov    %rsi,%rax
  imul   %r13,%rax
  mov    %rcx,(%r9)
  sub    %rax,%rdi
  mov    0x10(%rsp),%rax
  mov    %rdi,%r8
  mov    %rdi,%rbp
  mov    %rdi,(%rax)
  mov    (%r9),%r14
  lea    D80(%rip),%rdi
  xor    %eax,%eax
  mov    %r14,%rcx
  call   <printf@plt>
  mov    %r15,%rcx
  mov    %r14,%r8
  mov    %rbx,%rdx
  mov    %r12,%rsi
  lea    D80(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
  mov    %rbp,%rdx
  mov    %r13,%rsi
  lea    D32(%rip),%rdi
  call   <printf@plt>
  test   %rbx,%rbx
  mov    0x8(%rsp),%r9
  mov    %r15,%rcx
  mov    %r13,%rdi
  jg     L14
L40:
  mov    0x18(%rsp),%rax
  lea    D30(%rip),%rdi
  mov    %r12,(%rax)
  mov    0x10(%rsp),%rax
  mov    %r15,(%r9)
  mov    %r13,(%rax)
  xor    %eax,%eax
  call   <printf@plt>
  add    $0x28,%rsp
  lea    D84(%rip),%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1060 <puts@plt>
  nop
L32:
  xor    %r13d,%r13d
  mov    $0x1,%r15d
  jmp    L40
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D30
data_type: string
name: extract_symbolic_data
arguments: data_label: D84
data_type: string
name: extract_symbolic_data
arguments: data_label: D97
data_type: string
name: extract_symbolic_data
arguments: data_label: D77
data_type: string
name: extract_symbolic_data
arguments: data_label: D80
data_type: string
name: extract_symbolic_data
arguments: data_label: D32
data_type: string

tool: D30: ------------------------------

tool: D84: -------------------

tool: D97: q    r    x    y    a    b    

tool: D77: x2   x1   y2   y1

tool: D80: %4ld %4ld %4ld %4ld 

tool: D32: %4ld %4ld


assistant: ```c
void extended_euclid(long a, long b, long *x, long *y, long *d) {
  long q, r, x1, x2, y1, y2;
  if (b == 0) {
    *d = a, *x = 1, *y = 0;
    return;
  }
  x2 = 1, x1 = 0, y2 = 0, y1 = 1;
  printf("------------------------------");
  printf("-------------------\n");
  printf("q    r    x    y    a    b    ");
  printf("x2   x1   y2   y1\n");
  printf("------------------------------");
  printf("-------------------\n");
  while (b > 0) {
    q = a / b, r = a - q * b;
    *x = x2 - q * x1, *y = y2 - q * y1;
    a = b, b = r;
    x2 = x1, x1 = *x, y2 = y1, y1 = *y;
    printf("%4ld %4ld %4ld %4ld ", q, r, *x, *y);
    printf("%4ld %4ld %4ld %4ld ", a, b, x2, x1);
    printf("%4ld %4ld\n", y2, y1);
  }
  *d = a, *x = x2, *y = y2;
  printf("------------------------------");
  printf("-------------------\n");
}
```