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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  lea    -0x44(%rbp),%rsi
  lea    D18(%rip),%rdi
  call   <scanf@plt>
  cmpl   $0x0,-0x44(%rbp)
  jle    L3
  movl   $0x0,-0x54(%rbp)
  lea    D18(%rip),%r13
  jmp    L160
L11:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L119
  orq    $0x0,-0x8(%rsp,%rdx,1)
L119:
  mov    %rsp,%rbx
  mov    %rbx,%r12
  lea    0xf(%rcx),%rax
  mov    $0x10,%edi
  mov    $0x0,%edx
  div    %rdi
  shl    $0x4,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L58:
  cmp    %rdx,%rsp
  je     L155
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L58
L155:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L30
  orq    $0x0,-0x8(%rsp,%rdx,1)
L30:
  lea    0x3(%rsp),%r14
  mov    %r14,%rax
  shr    $0x2,%rax
  mov    %rax,-0x68(%rbp)
  and    $0xfffffffffffffffc,%r14
  test   %esi,%esi
  jle    L43
  mov    $0x0,%r15d
L75:
  mov    %rbx,%rsi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  add    $0x1,%r15d
  mov    -0x40(%rbp),%eax
  add    $0x4,%rbx
  cmp    %r15d,%eax
  jg     L75
  test   %eax,%eax
  jle    L43
  mov    %r14,%r15
  mov    $0x0,%ebx
L125:
  mov    %r15,%rsi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  add    $0x1,%ebx
  mov    -0x40(%rbp),%ecx
  add    $0x4,%r15
  cmp    %ebx,%ecx
  jg     L125
  mov    -0x3c(%rbp),%r8d
  mov    %r8d,%eax
  cltd
  idivl  (%r12)
  mov    -0x68(%rbp),%rdx
  imul   0x0(,%rdx,4),%eax
  mov    %eax,%esi
  test   %ecx,%ecx
  jle    L22
  mov    %ecx,%edi
  mov    $0x0,%ecx
L141:
  mov    %r8d,%eax
  cltd
  idivl  (%r12,%rcx,4)
  imul   (%r14,%rcx,4),%eax
  cmp    %eax,%esi
  cmovl  %eax,%esi
  add    $0x1,%rcx
  cmp    %rcx,%rdi
  jne    L141
L22:
  lea    D38(%rip),%rdi
  call   <printf@plt>
  mov    -0x60(%rbp),%rsp
  addl   $0x1,-0x54(%rbp)
  mov    -0x54(%rbp),%eax
  cmp    %eax,-0x44(%rbp)
  jle    L3
L160:
  mov    %rsp,-0x60(%rbp)
  lea    -0x3c(%rbp),%rdx
  lea    -0x40(%rbp),%rsi
  lea    D0(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    -0x40(%rbp),%esi
  movslq %esi,%rcx
  shl    $0x2,%rcx
  lea    0xf(%rcx),%rax
  mov    $0x10,%edi
  mov    $0x0,%edx
  div    %rdi
  shl    $0x4,%rax
  mov    %rax,%rdi
  and    $0xfffffffffffff000,%rdi
  mov    %rsp,%rdx
  sub    %rdi,%rdx
L113:
  cmp    %rdx,%rsp
  je     L11
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L113
L3:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L46
  mov    $0x0,%eax
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L43:
  mov    -0x3c(%rbp),%eax
  cltd
  idivl  (%r12)
  mov    -0x68(%rbp),%rdx
  imul   0x0(,%rdx,4),%eax
  mov    %eax,%esi
  jmp    L22
L46:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D18
data_type: string
name: parse_data
arguments: data_label: D38
data_type: string
name: parse_data
arguments: data_label: D0
data_type: string

tool: D18: %d

tool: D38: %d


tool: D0: %d %d

assistant: ```c
int main(void) {
  int t;
  scanf("%d", &t);
  int term;
  for (term = 0; term < t; term++) {
    int n, k;
    scanf("%d %d", &n, &k);
    int a[n];
    int b[n];
    int i;
    for (i = 0; i < n; i++)
      scanf("%d", a + i);
    for (i = 0; i < n; i++)
      scanf("%d", b + i);
    int max = (k / a[0]) * b[0];
    for (i = 0; i < n; i++) {
      int t;
      t = (k / a[i]) * b[i];
      if (max < t)
        max = t;
    }
    printf("%d\n", max);
  }
}
```