user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  lea    0xc(%rsp),%rsi
  lea    D5(%rip),%rdi
  call   <scanf@plt>
  mov    0xc(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0xc(%rsp)
  test   %eax,%eax
  je     L124
  lea    0x50(%rsp),%r12
  lea    0x30(%rsp),%rbp
  lea    D9(%rip),%r14
  lea    D6(%rip),%r15
  jmp    L137
L30:
  mov    %r13,%rdi
  call   <atoi@plt>
  mov    %eax,%r13d
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %rax,%rbx
  mov    %rbp,%rdi
  call   <atoi@plt>
  mov    %eax,%edi
  call   <len@plt>
  cmp    %rax,%rbx
  jne    L53
  mov    %rbp,%rdi
  call   <atoi@plt>
  mov    %eax,%ebx
  mov    %r12,%rdi
  call   <atoi@plt>
  test   %r13d,%r13d
  je     L103
  test   %ebx,%ebx
  je     L40
  lea    0x0(%r13,%rbx,1),%ecx
  mov    %ebx,%edx
  mov    %r13d,%esi
  mov    %r15,%rdi
  call   <printf@plt>
  jmp    L39
L40:
  mov    %r13d,%ebx
L50:
  mov    %eax,%edx
  sub    %ebx,%edx
  mov    %eax,%ecx
  mov    %ebx,%esi
  mov    %r15,%rdi
  call   <printf@plt>
L39:
  mov    0xc(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0xc(%rsp)
  test   %eax,%eax
  je     L124
L137:
  lea    0x10(%rsp),%r13
  mov    %r12,%rcx
  mov    %rbp,%rdx
  mov    %r13,%rsi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    %rax,%rbx
  mov    %r13,%rdi
  call   <atoi@plt>
  mov    %eax,%edi
  call   <len@plt>
  cmp    %rax,%rbx
  je     L30
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %rax,%rbx
  mov    %rbp,%rdi
  call   <atoi@plt>
  mov    %eax,%edi
  call   <len@plt>
  cmp    %rax,%rbx
  je     L48
  mov    $0x0,%ebx
L89:
  mov    %r12,%rdi
  call   <atoi@plt>
  test   %ebx,%ebx
  jne    L50
L103:
  mov    %eax,%esi
  sub    %ebx,%esi
  mov    %eax,%ecx
  mov    %ebx,%edx
  mov    %r15,%rdi
  call   <printf@plt>
  jmp    L39
L124:
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L117
  mov    $0x0,%eax
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L53:
  mov    %r13d,%ebx
  jmp    L89
L48:
  mov    %rbp,%rdi
  call   <atoi@plt>
  mov    %eax,%ebx
  mov    %r12,%rdi
  call   <atoi@plt>
  jmp    L103
L117:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D5
data_type: string
name: retrieve_data
arguments: label: D9
data_type: string
name: retrieve_data
arguments: label: D6
data_type: string

tool: D5: %d

tool: D9: %s %*c %s %*c %s

tool: D6: %d + %d = %d


assistant: ```c
int main() {
  char sa[18], sb[18], sc[18];
  int T, a, b, c;
  scanf("%d", &T);
  while (T--) {
    scanf("%s %*c %s %*c %s", sa, sb, sc);
    a = strlen(sa) == len(atoi(sa)) ? atoi(sa) : 0;
    b = strlen(sb) == len(atoi(sb)) ? atoi(sb) : 0;
    c = atoi(sc);
    if (!a) {
      printf("%d + %d = %d\n", c - b, b, c);
    } else if (!b) {
      printf("%d + %d = %d\n", a, c - a, c);
    } else {
      printf("%d + %d = %d\n", a, b, a + b);
    }
  }
  return 0;
}
```