user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %r15
  lea    D16(%rip),%rdi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x518,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x508(%rsp)
  xor    %eax,%eax
  lea    0x3c(%rsp),%rsi
  call   <scanf@plt>
  mov    0x3c(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x3c(%rsp)
  test   %eax,%eax
  je     L129
  lea    0x4c(%rsp),%rax
  lea    0x50(%rsp),%r13
  mov    %rax,0x28(%rsp)
  lea    0x48(%rsp),%rax
  lea    0x1e0(%rsp),%rbp
  mov    %r13,%r12
  mov    %rax,0x20(%rsp)
  lea    0x44(%rsp),%rax
  lea    0x370(%rsp),%rbx
  mov    %rax,0x18(%rsp)
  lea    0x40(%rsp),%rax
  mov    %rax,0x10(%rsp)
L65:
  xor    %eax,%eax
  mov    $0x32,%ecx
  mov    %r12,%rdi
  mov    0x10(%rsp),%rsi
  rep stos %rax,%es:(%rdi)
  mov    $0x32,%ecx
  mov    %rbp,%rdi
  mov    0x28(%rsp),%r8
  rep stos %rax,%es:(%rdi)
  mov    0x18(%rsp),%rdx
  mov    0x20(%rsp),%rcx
  lea    D10(%rip),%rdi
  call   <scanf@plt>
  mov    0x48(%rsp),%edi
  mov    0x44(%rsp),%esi
  lea    0x1dc(%rsp),%rcx
  test   %edi,%edi
  je     L115
  mov    %edi,%eax
  nopw   0x0(%rax,%rax,1)
L74:
  cltd
  sub    $0x4,%rcx
  idiv   %esi
  mov    %edx,0x4(%rcx)
  test   %eax,%eax
  jne    L74
  movl   $0x0,0x48(%rsp)
  mov    0x50(%rsp),%edi
L115:
  mov    0x4c(%rsp),%eax
  test   %eax,%eax
  je     L41
  lea    0x36c(%rsp),%rcx
  nopw   0x0(%rax,%rax,1)
L46:
  cltd
  sub    $0x4,%rcx
  idiv   %esi
  mov    %edx,0x4(%rcx)
  test   %eax,%eax
  jne    L46
  movl   $0x0,0x4c(%rsp)
  mov    0x1e0(%rsp),%eax
L41:
  mov    %eax,%edx
  xor    %ecx,%ecx
  mov    %edi,%eax
  jmp    L34
  nopl   (%rax)
L13:
  mov    (%r12,%rcx,1),%eax
  mov    0x0(%rbp,%rcx,1),%edx
L34:
  add    %edx,%eax
  cltd
  idiv   %esi
  mov    %edx,(%rbx,%rcx,1)
  add    $0x4,%rcx
  cmp    $0x190,%rcx
  jne    L13
  mov    %rbp,0x8(%rsp)
  mov    $0x63,%r15d
  xor    %r13d,%r13d
  mov    %rbx,%rbp
  mov    $0x63,%r14d
  jmp    L31
  xchg   %ax,%ax
L14:
  sub    $0x1,%r15
  je     L106
L31:
  mov    0x0(%rbp,%r15,4),%ebx
  mov    %r14d,%esi
  sub    %r15d,%esi
  test   %ebx,%ebx
  je     L14
  mov    0x44(%rsp),%edi
  call   <pow@plt>
  imul   %eax,%ebx
  add    %ebx,%r13d
  sub    $0x1,%r15
  jne    L31
L106:
  mov    0x40(%rsp),%esi
  mov    %r13d,%edx
  lea    D1(%rip),%rdi
  mov    %rbp,%rbx
  mov    0x8(%rsp),%rbp
  call   <printf@plt>
  mov    0x3c(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x3c(%rsp)
  test   %eax,%eax
  jne    L65
L129:
  mov    0x508(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L98
  add    $0x518,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L98:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D16
datatype: string
name: parse_data
arguments: data_label: D10
datatype: string
name: parse_data
arguments: data_label: D1
datatype: string

tool: D16: %d

tool: D10: %d%d%d%d

tool: D1: %d %d


assistant: ```c
int main() {
  int t, n, b, x, y;
  scanf("%d", &t);
  while (t--) {
    int num1[100] = {0}, num2[100] = {0};
    int sum[100], ans;
    ans = 0;
    scanf("%d%d%d%d", &n, &b, &x, &y);
    int i = 99;
    while (x) {
      num1[i--] = x % b;
      x /= b;
    }
    i = 99;
    while (y) {
      num2[i--] = y % b;
      y /= b;
    }
    for (i = 0; i < 100; i++)
      sum[i] = (num1[i] + num2[i]) % b;
    i = 0;
    int j = 99;
    while (j) {
      if (sum[j] != 0)
        ans += (pow(b, i) * sum[j]);
      i++;
      j--;
    }
    printf("%d %d\n", n, ans);
  }
  return 0;
}
```