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
  lea    -0x5000(%rsp),%r11
L275:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L275
  sub    $0xd18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x5d08(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r12
  lea    0x1f00(%rsp),%rbx
  lea    0x3e00(%rsp),%rbp
  call   <check_offloading@plt>
  mov    $0x3e0,%ecx
  xor    %eax,%eax
  mov    %r12,%rdi
  rep stos %rax,%es:(%rdi)
  movsd  D224(%rip),%xmm2
  xchg   %ax,%ax
L331:
  pxor   %xmm0,%xmm0
  movsd  %xmm2,(%rbx,%rax,8)
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,0x0(%rbp,%rax,8)
  add    $0x1,%rax
  cmp    $0x3e0,%rax
  jne    L331
  xor    %eax,%eax
  nopl   0x0(%rax)
L68:
  movsd  (%rbx,%rax,1),%xmm0
  addsd  0x0(%rbp,%rax,1),%xmm0
  addsd  %xmm2,%xmm0
  movsd  %xmm0,(%r12,%rax,1)
  add    $0x8,%rax
  cmp    $0x1f00,%rax
  jne    L68
  xor    %r13d,%r13d
  xor    %r14d,%r14d
  lea    D192(%rip),%r15
  xor    %edx,%edx
  jmp    L251
  nopw   0x0(%rax,%rax,1)
L137:
  add    $0x1,%r13
  cmp    $0x3e0,%r13
  je     L248
L251:
  lea    0x2(%r13),%eax
  pxor   %xmm0,%xmm0
  movsd  (%r12,%r13,8),%xmm1
  mov    %r13d,%esi
  cvtsi2sd %eax,%xmm0
  ucomisd %xmm0,%xmm1
  jp     L325
  je     L137
L325:
  mov    %r15,%rdx
  lea    D18(%rip),%rdi
  mov    $0x2,%eax
  call   <printf@plt>
  lea    0x1(%r14),%eax
  cmp    $0xa,%r14d
  jg     L96
  add    $0x1,%r13
  mov    %eax,%r14d
  mov    $0x1,%edx
  cmp    $0x3e0,%r13
  jne    L251
L248:
  test   %edx,%edx
  jne    L96
  lea    D153(%rip),%rdi
  call   <puts@plt>
  mov    D224(%rip),%rax
  movq   %rax,%xmm2
  jmp    L35
L96:
  lea    D140(%rip),%rdi
  call   <puts@plt>
  mov    D224(%rip),%rax
  movq   %rax,%xmm2
L35:
  movsd  D108(%rip),%xmm3
  mov    $0x1,%eax
L107:
  pxor   %xmm0,%xmm0
  movsd  %xmm3,-0x8(%rbx,%rax,8)
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,-0x8(%rbp,%rax,8)
  add    $0x1,%rax
  cmp    $0x3e1,%rax
  jne    L107
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L252:
  movsd  (%rbx,%rax,1),%xmm0
  addsd  0x0(%rbp,%rax,1),%xmm0
  addsd  %xmm2,%xmm0
  movsd  %xmm0,(%r12,%rax,1)
  add    $0x8,%rax
  cmp    $0x1f00,%rax
  jne    L252
  xor    %r13d,%r13d
  xor    %r14d,%r14d
  lea    D192(%rip),%r15
  xor    %edx,%edx
  jmp    L154
  nopw   0x0(%rax,%rax,1)
L149:
  add    $0x1,%r13
  cmp    $0x3e0,%r13
  je     L225
L154:
  lea    0x4(%r13),%eax
  pxor   %xmm0,%xmm0
  movsd  (%r12,%r13,8),%xmm1
  mov    %r13d,%esi
  cvtsi2sd %eax,%xmm0
  ucomisd %xmm0,%xmm1
  jp     L330
  je     L149
L330:
  mov    %r15,%rdx
  lea    D18(%rip),%rdi
  mov    $0x2,%eax
  call   <printf@plt>
  lea    0x1(%r14),%eax
  cmp    $0xa,%r14d
  jg     L286
  add    $0x1,%r13
  mov    %eax,%r14d
  mov    $0x1,%edx
  cmp    $0x3e0,%r13
  jne    L154
L225:
  test   %edx,%edx
  jne    L286
  lea    D149(%rip),%rdi
  call   <puts@plt>
  mov    D224(%rip),%rax
  movq   %rax,%xmm2
  jmp    L270
L286:
  lea    D182(%rip),%rdi
  call   <puts@plt>
  mov    D224(%rip),%rax
  movq   %rax,%xmm2
L270:
  mov    $0x3e0,%ecx
  xor    %eax,%eax
  mov    %r12,%rdi
  rep stos %rax,%es:(%rdi)
L42:
  pxor   %xmm0,%xmm0
  movsd  %xmm2,(%rbx,%rax,8)
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,0x0(%rbp,%rax,8)
  add    $0x1,%rax
  cmp    $0x3e0,%rax
  jne    L42
  xor    %eax,%eax
  nopl   0x0(%rax)
L406:
  movsd  (%rbx,%rax,1),%xmm0
  addsd  0x0(%rbp,%rax,1),%xmm0
  addsd  %xmm2,%xmm0
  movsd  %xmm0,(%r12,%rax,1)
  add    $0x8,%rax
  cmp    $0x1f00,%rax
  jne    L406
  xor    %r13d,%r13d
  xor    %r14d,%r14d
  lea    D192(%rip),%r15
  xor    %edx,%edx
  jmp    L39
  nopw   0x0(%rax,%rax,1)
L291:
  add    $0x1,%r13
  cmp    $0x3e0,%r13
  je     L76
L39:
  lea    0x2(%r13),%eax
  pxor   %xmm0,%xmm0
  movsd  (%r12,%r13,8),%xmm1
  mov    %r13d,%esi
  cvtsi2sd %eax,%xmm0
  ucomisd %xmm0,%xmm1
  jp     L368
  je     L291
L368:
  mov    %r15,%rdx
  lea    D18(%rip),%rdi
  mov    $0x2,%eax
  call   <printf@plt>
  lea    0x1(%r14),%eax
  cmp    $0xa,%r14d
  jg     L360
  add    $0x1,%r13
  mov    %eax,%r14d
  mov    $0x1,%edx
  cmp    $0x3e0,%r13
  jne    L39
L76:
  test   %edx,%edx
  jne    L360
  lea    D25(%rip),%rdi
  call   <puts@plt>
  mov    D108(%rip),%rax
  movq   %rax,%xmm3
  mov    D224(%rip),%rax
  movq   %rax,%xmm2
  jmp    L280
L360:
  lea    D161(%rip),%rdi
  call   <puts@plt>
  mov    D224(%rip),%rax
  movq   %rax,%xmm2
  mov    D108(%rip),%rax
  movq   %rax,%xmm3
L280:
  mov    $0x1,%eax
L177:
  pxor   %xmm0,%xmm0
  movsd  %xmm3,-0x8(%rbx,%rax,8)
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,-0x8(%rbp,%rax,8)
  add    $0x1,%rax
  cmp    $0x3e1,%rax
  jne    L177
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L97:
  movsd  (%rbx,%rax,1),%xmm0
  addsd  0x0(%rbp,%rax,1),%xmm0
  addsd  %xmm2,%xmm0
  movsd  %xmm0,(%r12,%rax,1)
  add    $0x8,%rax
  cmp    $0x1f00,%rax
  jne    L97
  xor    %ebx,%ebx
  xor    %r14d,%r14d
  lea    D192(%rip),%r13
  xor    %edx,%edx
  lea    D18(%rip),%rbp
  jmp    L257
L103:
  add    $0x1,%rbx
  cmp    $0x3e0,%rbx
  je     L50
L257:
  lea    0x4(%rbx),%eax
  pxor   %xmm0,%xmm0
  movsd  (%r12,%rbx,8),%xmm1
  mov    %ebx,%esi
  cvtsi2sd %eax,%xmm0
  ucomisd %xmm0,%xmm1
  jp     L14
  je     L103
L14:
  mov    %r13,%rdx
  mov    %rbp,%rdi
  mov    $0x2,%eax
  call   <printf@plt>
  lea    0x1(%r14),%eax
  cmp    $0xa,%r14d
  jg     L73
  add    $0x1,%rbx
  mov    %eax,%r14d
  mov    $0x1,%edx
  cmp    $0x3e0,%rbx
  jne    L257
L50:
  test   %edx,%edx
  jne    L73
  lea    D189(%rip),%rdi
  call   <puts@plt>
  jmp    L254
L73:
  lea    D186(%rip),%rdi
  call   <puts@plt>
L254:
  mov    0x5d08(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L206
  add    $0x5d18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L206:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D224
datatype: byte[8]
name: parse_data
arguments: label: D192
datatype: string
name: parse_data
arguments: label: D18
datatype: string
name: parse_data
arguments: label: D153
datatype: string
name: parse_data
arguments: label: D140
datatype: string
name: parse_data
arguments: label: D108
datatype: byte[8]
name: parse_data
arguments: label: D149
datatype: string
name: parse_data
arguments: label: D182
datatype: string
name: parse_data
arguments: label: D25
datatype: string
name: parse_data
arguments: label: D161
datatype: string
name: parse_data
arguments: label: D189
datatype: string
name: parse_data
arguments: label: D186
datatype: string

tool: {"D224": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

tool: D192: A[i]

tool: D18: Failed at %3d with %s, expected %f, got %f


tool: D153: Test update from: Succeeded

tool: D140: Test update from: Failed

tool: {"D108": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40]}

tool: D149: Test update to: Succeeded

tool: D182: Test update to: Failed

tool: D25: Test update from with offsets: Succeeded

tool: D161: Test update from with offsets: Failed

tool: D189: Test update to with offsets: Succeeded

tool: D186: Test update to with offsets: Failed

assistant: ```c
int main(void) {
  check_offloading();
  int fail;
  double A[(992)], B[(992)], C[(992)], D[(992)], E[(992)];
  double *pA, *pB, *pC, *pD, *pE;
  pA = &A[0];
  pB = &B[0];
  pC = &C[0];
  pD = &D[0];
  pE = &E[0];
  {
    int i;
    for (i = 0; i < (992); i++) {
      {
        A[i] = 0;
        C[i] = 1;
        D[i] = i;
        E[i] = -i;
      }
    }
  };
#pragma omp target data map(from : pA [0:N]) map(to : pC [0:N], pD [0:N]) device(1)
  {
#pragma omp target device(1)
    {
#pragma omp parallel for schedule(static, 1)
      for (int i = 0; i < (992); i++)
        pA[i] = pC[i] + pD[i] + 1;
    }
#pragma omp target update from(pA [0:N]) device(1)
    fail = 0;
    {
      int i;
      int errorNum = 0;
      for (i = 0; i < (992); i++) {
        if (A[i] != (double)(i + 2)) {
          printf("Failed at %3d with %s, expected %f, got %f\n", i, "A[i]", (double)(i + 2), A[i]);
          fail = 1;
          if (errorNum++ > 10)
            break;
        }
      }
    };
    if (fail) {
      printf("Test update from: Failed\n");
    } else {
      printf("Test update from: Succeeded\n");
    }
    for (int i = 0; i < (992); i++) {
      C[i] = 2;
      D[i] = i + 1;
    }
#pragma omp target update to(pC [0:N], pD [0:N]) device(1)
#pragma omp target device(1)
    {
#pragma omp parallel for schedule(static, 1)
      for (int i = 0; i < (992); i++)
        pA[i] = pC[i] + pD[i] + 1;
    }
#pragma omp target update from(pA [0:N]) device(1)
    fail = 0;
    {
      int i;
      int errorNum = 0;
      for (i = 0; i < (992); i++) {
        if (A[i] != (double)(i + 4)) {
          printf("Failed at %3d with %s, expected %f, got %f\n", i, "A[i]", (double)(i + 4), A[i]);
          fail = 1;
          if (errorNum++ > 10)
            break;
        }
      }
    };
    if (fail) {
      printf("Test update to: Failed\n");
    } else {
      printf("Test update to: Succeeded\n");
    }
  }
  pA = pA - 100;
  pC = pC - 200;
  pD = pD - 300;
  {
    int i;
    for (i = 0; i < (992); i++) {
      {
        A[i] = 0;
        C[i] = 1;
        D[i] = i;
        E[i] = -i;
      }
    }
  };
#pragma omp target data map(from : pA [100:N]) map(to : pC [200:N], pD [300:N]) device(1)
  {
#pragma omp target map(from : pA [100:N]) map(to : pC [200:N], pD [300:N]) device(1)
    {
#pragma omp parallel for schedule(static, 1)
      for (int i = 0; i < (992); i++)
        pA[i + 100] = pC[i + 200] + pD[i + 300] + 1;
    }
#pragma omp target update from(pA [100:N]) device(1)
    fail = 0;
    {
      int i;
      int errorNum = 0;
      for (i = 0; i < (992); i++) {
        if (A[i] != (double)(i + 2)) {
          printf("Failed at %3d with %s, expected %f, got %f\n", i, "A[i]", (double)(i + 2), A[i]);
          fail = 1;
          if (errorNum++ > 10)
            break;
        }
      }
    };
    if (fail) {
      printf("Test update from with offsets: Failed\n");
    } else {
      printf("Test update from with offsets: Succeeded\n");
    }
    for (int i = 0; i < (992); i++) {
      C[i] = 2;
      D[i] = i + 1;
    }
#pragma omp target update to(pC [200:N], pD [300:N]) device(1)
#pragma omp target map(from : pA [100:N]) map(to : pC [200:N], pD [300:N]) device(1)
    {
#pragma omp parallel for schedule(static, 1)
      for (int i = 0; i < (992); i++)
        pA[i + 100] = pC[i + 200] + pD[i + 300] + 1;
    }
#pragma omp target update from(pA [100:N]) device(1)
    fail = 0;
    {
      int i;
      int errorNum = 0;
      for (i = 0; i < (992); i++) {
        if (A[i] != (double)(i + 4)) {
          printf("Failed at %3d with %s, expected %f, got %f\n", i, "A[i]", (double)(i + 4), A[i]);
          fail = 1;
          if (errorNum++ > 10)
            break;
        }
      }
    };
    if (fail) {
      printf("Test update to with offsets: Failed\n");
    } else {
      printf("Test update to with offsets: Succeeded\n");
    }
  }
  return 0;
}
```