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

```asm
<main>:
  endbr64
  push   %r15
  lea    D20(%rip),%rdi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    0x30(%rsp),%rsi
  call   <scanf@plt>
  mov    0x30(%rsp),%esi
  test   %esi,%esi
  jle    L104
  lea    0x28(%rsp),%rax
  xor    %r12d,%r12d
  lea    0x24(%rsp),%r15
  mov    %rax,0x10(%rsp)
  lea    0x20(%rsp),%rax
  lea    0x36(%rsp),%r13
  mov    %rax,0x8(%rsp)
  lea    0x2c(%rsp),%rax
  lea    0x37(%rsp),%r14
  mov    %rax,0x18(%rsp)
L125:
  push   0x18(%rsp)
  mov    %r13,%rdx
  mov    %r15,%r9
  mov    %r14,%r8
  push   %r13
  lea    D3(%rip),%rdi
  xor    %eax,%eax
  mov    0x20(%rsp),%rcx
  mov    0x18(%rsp),%rsi
  call   <scanf@plt>
  movzbl 0x47(%rsp),%eax
  pop    %rdx
  pop    %rcx
  cmp    $0x2d,%al
  je     L89
  jg     L7
  cmp    $0x2a,%al
  je     L41
  cmp    $0x2b,%al
  jne    L71
  mov    0x2c(%rsp),%ebx
  mov    0x28(%rsp),%eax
  mov    0x20(%rsp),%ebp
  mov    0x24(%rsp),%edx
  imul   %ebx,%ebp
  imul   %eax,%edx
  imul   %eax,%ebx
  add    %edx,%ebp
  nopw   0x0(%rax,%rax,1)
L71:
  mov    %ebx,%r8d
  mov    %ebp,%r9d
  mov    $0x3e8,%ecx
  nopl   0x0(%rax,%rax,1)
L103:
  mov    %r9d,%eax
  cltd
  idiv   %ecx
  mov    %eax,%esi
  test   %edx,%edx
  jne    L5
  mov    %r8d,%eax
  cltd
  idiv   %ecx
  test   %edx,%edx
  cmove  %esi,%r9d
  cmove  %eax,%r8d
L5:
  sub    $0x1,%ecx
  jne    L103
  mov    %r9d,%ecx
  mov    %ebx,%edx
  mov    %ebp,%esi
  add    $0x1,%r12d
  lea    D1(%rip),%rdi
  call   <printf@plt>
  cmp    %r12d,0x30(%rsp)
  jg     L125
L104:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L57
  add    $0x48,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L7:
  cmp    $0x2f,%al
  jne    L71
  mov    0x20(%rsp),%ebp
  mov    0x24(%rsp),%ebx
  imul   0x2c(%rsp),%ebp
  imul   0x28(%rsp),%ebx
  jmp    L71
L89:
  mov    0x2c(%rsp),%ebx
  mov    0x28(%rsp),%eax
  mov    0x20(%rsp),%ebp
  mov    0x24(%rsp),%edx
  imul   %ebx,%ebp
  imul   %eax,%edx
  imul   %eax,%ebx
  sub    %edx,%ebp
  jmp    L71
L41:
  mov    0x20(%rsp),%ebp
  mov    0x28(%rsp),%ebx
  imul   0x24(%rsp),%ebp
  imul   0x2c(%rsp),%ebx
  jmp    L71
L57:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D20
data_type: string
name: read_data
arguments: tag: D3
data_type: string
name: read_data
arguments: tag: D1
data_type: string

tool: D20: %d

tool: D3: %d %c %d %c %d %c %d

tool: D1: %d/%d = %d/%d


assistant: ```c
int main() {
  char a[2];
  int i, j, k, n1, n2, d1, d2;
  int ans[4], loop;
  scanf("%d", &loop);
  for (i = 0; i < loop; i++) {
    scanf("%d %c %d %c %d %c %d", &n1, &a[0], &d1, &a[1], &n2, &a[0], &d2);
    switch (a[1]) {
    case '+':
      ans[0] = (n1 * d2 + n2 * d1);
      ans[1] = (d1 * d2);
      break;
    case '-':
      ans[0] = (n1 * d2 - n2 * d1);
      ans[1] = (d1 * d2);
      break;
    case '*':
      ans[0] = (n1 * n2);
      ans[1] = (d1 * d2);
      break;
    case '/':
      ans[0] = (n1 * d2);
      ans[1] = (n2 * d1);
      break;
    }
    ans[2] = ans[0];
    ans[3] = ans[1];
    for (j = 1000; j > 0; j--) {
      if (ans[2] % j == 0 && ans[3] % j == 0) {
        ans[2] = ans[2] / j;
        ans[3] = ans[3] / j;
      }
    }
    printf("%d/%d = %d/%d\n", ans[0], ans[1], ans[2], ans[3]);
  }
  return 0;
}
```