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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x380,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    $0x0,%eax
  call   <check_offloading@plt>
  movl   $0x0,-0x380(%rbp)
  movl   $0x0,-0x37c(%rbp)
  movl   $0x0,-0x330(%rbp)
  movl   $0x0,-0x378(%rbp)
  jmp    L69
L298:
  mov    -0x330(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x330(%rbp)
  addl   $0x1,-0x378(%rbp)
L69:
  cmpl   $0x63,-0x378(%rbp)
  jle    L298
  mov    -0x330(%rbp),%eax
  mov    %eax,-0x33c(%rbp)
  movl   $0x64,-0x338(%rbp)
  mov    -0x33c(%rbp),%eax
  cmp    -0x338(%rbp),%eax
  je     L398
  addl   $0x1,-0x37c(%rbp)
  mov    -0x37c(%rbp),%ecx
  mov    -0x338(%rbp),%edx
  mov    -0x33c(%rbp),%eax
  mov    %eax,%esi
  lea    D142(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x1,-0x380(%rbp)
L398:
  cmpl   $0x0,-0x380(%rbp)
  jne    L366
  lea    D43(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L54
L366:
  movl   $0x0,-0x380(%rbp)
L54:
  movl   $0x0,-0x330(%rbp)
  movl   $0x0,-0x374(%rbp)
  jmp    L336
L412:
  mov    -0x330(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x330(%rbp)
  addl   $0x1,-0x374(%rbp)
L336:
  cmpl   $0x63,-0x374(%rbp)
  jle    L412
  mov    -0x330(%rbp),%eax
  mov    %eax,-0x33c(%rbp)
  movl   $0x64,-0x338(%rbp)
  mov    -0x33c(%rbp),%eax
  cmp    -0x338(%rbp),%eax
  je     L13
  addl   $0x1,-0x37c(%rbp)
  mov    -0x37c(%rbp),%ecx
  mov    -0x338(%rbp),%edx
  mov    -0x33c(%rbp),%eax
  mov    %eax,%esi
  lea    D121(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x1,-0x380(%rbp)
L13:
  cmpl   $0x0,-0x380(%rbp)
  jne    L324
  lea    D43(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L270
L324:
  movl   $0x0,-0x380(%rbp)
L270:
  movl   $0x0,-0x330(%rbp)
  movl   $0x0,-0x370(%rbp)
  jmp    L38
L268:
  mov    -0x370(%rbp),%eax
  cltq
  movl   $0xffffffff,-0x1a0(%rbp,%rax,4)
  addl   $0x1,-0x370(%rbp)
L38:
  cmpl   $0x63,-0x370(%rbp)
  jle    L268
  movl   $0x0,-0x36c(%rbp)
  jmp    L325
L304:
  movl   $0x0,-0x334(%rbp)
  mov    -0x330(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x330(%rbp)
  mov    %eax,-0x334(%rbp)
  mov    -0x36c(%rbp),%eax
  cltq
  mov    -0x334(%rbp),%edx
  mov    %edx,-0x1a0(%rbp,%rax,4)
  addl   $0x1,-0x36c(%rbp)
L325:
  cmpl   $0x63,-0x36c(%rbp)
  jle    L304
  mov    -0x330(%rbp),%eax
  mov    %eax,-0x33c(%rbp)
  movl   $0x64,-0x338(%rbp)
  mov    -0x33c(%rbp),%eax
  cmp    -0x338(%rbp),%eax
  je     L291
  addl   $0x1,-0x37c(%rbp)
  mov    -0x37c(%rbp),%ecx
  mov    -0x338(%rbp),%edx
  mov    -0x33c(%rbp),%eax
  mov    %eax,%esi
  lea    D88(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x1,-0x380(%rbp)
L291:
  movl   $0x0,-0x368(%rbp)
  jmp    L33
L86:
  movl   $0x0,-0x364(%rbp)
  mov    -0x368(%rbp),%eax
  mov    %eax,-0x338(%rbp)
  movl   $0x0,-0x360(%rbp)
  jmp    L137
L303:
  mov    -0x360(%rbp),%eax
  cltq
  mov    -0x1a0(%rbp,%rax,4),%eax
  mov    %eax,-0x33c(%rbp)
  mov    -0x33c(%rbp),%eax
  cmp    -0x338(%rbp),%eax
  jne    L55
  movl   $0x1,-0x364(%rbp)
L55:
  addl   $0x1,-0x360(%rbp)
L137:
  cmpl   $0x63,-0x360(%rbp)
  jle    L303
  cmpl   $0x0,-0x364(%rbp)
  jne    L276
  addl   $0x1,-0x37c(%rbp)
  mov    -0x37c(%rbp),%edx
  mov    -0x338(%rbp),%eax
  mov    %eax,%esi
  lea    D20(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x1,-0x380(%rbp)
L276:
  addl   $0x1,-0x368(%rbp)
L33:
  cmpl   $0x63,-0x368(%rbp)
  jle    L86
  cmpl   $0x0,-0x380(%rbp)
  jne    L319
  lea    D43(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L181
L319:
  movl   $0x0,-0x380(%rbp)
L181:
  movl   $0x0,-0x35c(%rbp)
  jmp    L26
L360:
  mov    -0x35c(%rbp),%eax
  cltq
  movl   $0x0,-0x330(%rbp,%rax,4)
  addl   $0x1,-0x35c(%rbp)
L26:
  cmpl   $0x63,-0x35c(%rbp)
  jle    L360
  movl   $0x0,-0x358(%rbp)
  jmp    L260
L123:
  mov    -0x358(%rbp),%eax
  cltq
  mov    -0x358(%rbp),%edx
  mov    %edx,-0x330(%rbp,%rax,4)
  addl   $0x1,-0x358(%rbp)
L260:
  cmpl   $0x63,-0x358(%rbp)
  jle    L123
  movl   $0x0,-0x354(%rbp)
  jmp    L176
L435:
  mov    -0x354(%rbp),%eax
  cltq
  mov    -0x330(%rbp,%rax,4),%eax
  mov    %eax,-0x33c(%rbp)
  mov    -0x354(%rbp),%eax
  mov    %eax,-0x338(%rbp)
  mov    -0x33c(%rbp),%eax
  cmp    -0x338(%rbp),%eax
  je     L493
  addl   $0x1,-0x37c(%rbp)
  mov    -0x37c(%rbp),%ecx
  mov    -0x338(%rbp),%edx
  mov    -0x33c(%rbp),%eax
  mov    %eax,%esi
  lea    D96(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x1,-0x380(%rbp)
L493:
  addl   $0x1,-0x354(%rbp)
L176:
  cmpl   $0x63,-0x354(%rbp)
  jle    L435
  cmpl   $0x0,-0x380(%rbp)
  jne    L198
  lea    D43(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L285
L198:
  movl   $0x0,-0x380(%rbp)
L285:
  movl   $0x0,-0x350(%rbp)
  jmp    L409
L102:
  mov    -0x350(%rbp),%eax
  cltq
  movl   $0x0,-0x330(%rbp,%rax,4)
  mov    -0x350(%rbp),%eax
  cltq
  mov    -0x350(%rbp),%edx
  mov    %edx,-0x1a0(%rbp,%rax,4)
  addl   $0x1,-0x350(%rbp)
L409:
  cmpl   $0x63,-0x350(%rbp)
  jle    L102
  movl   $0x0,-0x34c(%rbp)
  jmp    L70
L503:
  mov    -0x34c(%rbp),%eax
  cltq
  mov    -0x1a0(%rbp,%rax,4),%edx
  mov    -0x34c(%rbp),%eax
  cltq
  mov    %edx,-0x330(%rbp,%rax,4)
  addl   $0x1,-0x34c(%rbp)
L70:
  cmpl   $0x63,-0x34c(%rbp)
  jle    L503
  movl   $0x0,-0x348(%rbp)
  jmp    L208
L459:
  mov    -0x348(%rbp),%eax
  cltq
  mov    -0x330(%rbp,%rax,4),%eax
  mov    %eax,-0x33c(%rbp)
  mov    -0x348(%rbp),%eax
  cltq
  mov    -0x1a0(%rbp,%rax,4),%eax
  mov    %eax,-0x338(%rbp)
  mov    -0x33c(%rbp),%eax
  cmp    -0x338(%rbp),%eax
  je     L200
  addl   $0x1,-0x37c(%rbp)
  mov    -0x37c(%rbp),%ecx
  mov    -0x338(%rbp),%edx
  mov    -0x33c(%rbp),%eax
  mov    %eax,%esi
  lea    D116(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x1,-0x380(%rbp)
L200:
  addl   $0x1,-0x348(%rbp)
L208:
  cmpl   $0x63,-0x348(%rbp)
  jle    L459
  cmpl   $0x0,-0x380(%rbp)
  jne    L62
  lea    D43(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L345
L62:
  movl   $0x0,-0x380(%rbp)
L345:
  movl   $0x0,-0x330(%rbp)
  movl   $0x0,-0x344(%rbp)
  jmp    L297
L56:
  mov    -0x330(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x330(%rbp)
  addl   $0x1,-0x344(%rbp)
L297:
  cmpl   $0x63,-0x344(%rbp)
  jle    L56
  mov    -0x330(%rbp),%eax
  mov    %eax,-0x33c(%rbp)
  movl   $0x64,-0x338(%rbp)
  mov    -0x33c(%rbp),%eax
  cmp    -0x338(%rbp),%eax
  je     L127
  addl   $0x1,-0x37c(%rbp)
  mov    -0x37c(%rbp),%ecx
  mov    -0x338(%rbp),%edx
  mov    -0x33c(%rbp),%eax
  mov    %eax,%esi
  lea    D137(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x1,-0x380(%rbp)
L127:
  cmpl   $0x0,-0x380(%rbp)
  jne    L514
  lea    D43(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L314
L514:
  movl   $0x0,-0x380(%rbp)
L314:
  movl   $0x0,-0x330(%rbp)
  movl   $0x0,-0x340(%rbp)
  jmp    L263
L334:
  mov    -0x330(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x330(%rbp)
  addl   $0x1,-0x340(%rbp)
L263:
  cmpl   $0x63,-0x340(%rbp)
  jle    L334
  mov    -0x330(%rbp),%eax
  mov    %eax,-0x33c(%rbp)
  movl   $0x64,-0x338(%rbp)
  mov    -0x33c(%rbp),%eax
  cmp    -0x338(%rbp),%eax
  je     L377
  addl   $0x1,-0x37c(%rbp)
  mov    -0x37c(%rbp),%ecx
  mov    -0x338(%rbp),%edx
  mov    -0x33c(%rbp),%eax
  mov    %eax,%esi
  lea    D77(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x1,-0x380(%rbp)
L377:
  cmpl   $0x0,-0x380(%rbp)
  jne    L85
  lea    D43(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L213
L85:
  movl   $0x0,-0x380(%rbp)
L213:
  mov    -0x37c(%rbp),%eax
  mov    %eax,%esi
  lea    D119(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x37c(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L487
  call   <__stack_chk_fail@plt>
L487:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D142
datatype: string
name: unpack_data
arguments: tag: D43
datatype: string
name: unpack_data
arguments: tag: D121
datatype: string
name: unpack_data
arguments: tag: D88
datatype: string
name: unpack_data
arguments: tag: D20
datatype: string
name: unpack_data
arguments: tag: D96
datatype: string
name: unpack_data
arguments: tag: D116
datatype: string
name: unpack_data
arguments: tag: D137
datatype: string
name: unpack_data
arguments: tag: D77
datatype: string
name: unpack_data
arguments: tag: D119
datatype: string

tool: D142: update (implicit) a %d != %d (error %d)


tool: D43: successful

tool: D121: update (explicit) a %d != %d (error %d)


tool: D88: capture a %d != %d (error %d)


tool: D20: capture b %d not captured (error %d)


tool: D96: write a %d != %d (error %d)


tool: D116: ar a %d != %d (error %d)


tool: D137: Multi Team a %d != %d (error %d)


tool: D77: Using seq_cst a %d != %d (error %d)


tool: D119: done with %d errors


assistant: ```c
int main() {
  check_offloading();
  int fail = 0;
  int error = 0;
  int a[100];
  int b[100];
  a[0] = 0;
#pragma omp target map(tofrom : a[:1])
  {
#pragma omp parallel for
    for (int ii = 0; ii < 100; ++ii)
#pragma omp atomic
      a[0]++;
  }
  int result = a[0];
  int expect = 100;
  if (result != expect) {
    printf("update (implicit) a %d != %d (error %d)\n", result, expect, ++error);
    fail = 1;
  }
  if (!fail)
    printf("successful\n");
  else
    fail = 0;
  a[0] = 0;
#pragma omp target map(tofrom : a[:1])
  {
#pragma omp parallel for
    for (int ii = 0; ii < 100; ++ii)
#pragma omp atomic update
      a[0]++;
  }
  result = a[0];
  expect = 100;
  if (result != expect) {
    printf("update (explicit) a %d != %d (error %d)\n", result, expect, ++error);
    fail = 1;
  }
  if (!fail)
    printf("successful\n");
  else
    fail = 0;
  a[0] = 0;
  for (int ii = 0; ii < 100; ++ii)
    b[ii] = -1;
#pragma omp target map(tofrom : a[:1], b[:N])
  {
#pragma omp parallel for
    for (int ii = 0; ii < 100; ++ii) {
      int v = 0;
#pragma omp atomic capture
      v = a[0]++;
      b[ii] = v;
    }
  }
  result = a[0];
  expect = 100;
  if (result != expect) {
    printf("capture a %d != %d (error %d)\n", result, expect, ++error);
    fail = 1;
  }
  for (int ii = 0; ii < 100; ++ii) {
    int pass = 0;
    expect = ii;
    for (int jj = 0; jj < 100; ++jj) {
      result = b[jj];
      if (result == expect)
        pass = 1;
    }
    if (!pass) {
      printf("capture b %d not captured (error %d)\n", expect, ++error);
      fail = 1;
    }
  }
  if (!fail)
    printf("successful\n");
  else
    fail = 0;
  for (int ii = 0; ii < 100; ++ii)
    a[ii] = 0;
#pragma omp target map(tofrom : a[:N])
  {
#pragma omp parallel for
    for (int ii = 0; ii < 100; ++ii)
#pragma omp atomic write
      a[ii] = ii;
  }
  for (int ii = 0; ii < 100; ++ii) {
    result = a[ii];
    expect = ii;
    if (result != expect) {
      printf("write a %d != %d (error %d)\n", result, expect, ++error);
      fail = 1;
    }
  }
  if (!fail)
    printf("successful\n");
  else
    fail = 0;
  for (int ii = 0; ii < 100; ++ii) {
    a[ii] = 0;
    b[ii] = ii;
  }
#pragma omp target map(tofrom : a[:N], b[:N])
  {
#pragma omp parallel for
    for (int ii = 0; ii < 100; ++ii)
#pragma omp atomic read
      a[ii] = b[ii];
  }
  for (int ii = 0; ii < 100; ++ii) {
    result = a[ii];
    expect = b[ii];
    if (result != expect) {
      printf("ar a %d != %d (error %d)\n", result, expect, ++error);
      fail = 1;
    }
  }
  if (!fail)
    printf("successful\n");
  else
    fail = 0;
  a[0] = 0;
#pragma omp target map(tofrom : a[:1])
  {
#pragma omp teams num_teams(10) thread_limit(10)
#pragma omp distribute parallel for
    for (int ii = 0; ii < 100; ++ii)
#pragma omp atomic
      a[0]++;
  }
  result = a[0];
  expect = 100;
  if (result != expect) {
    printf("Multi Team a %d != %d (error %d)\n", result, expect, ++error);
    fail = 1;
  }
  if (!fail)
    printf("successful\n");
  else
    fail = 0;
  a[0] = 0;
#pragma omp target map(tofrom : a[:1])
  {
#pragma omp parallel for
    for (int ii = 0; ii < 100; ++ii)
#pragma omp atomic seq_cst
      a[0]++;
  }
  result = a[0];
  expect = 100;
  if (result != expect) {
    printf("Using seq_cst a %d != %d (error %d)\n", result, expect, ++error);
    fail = 1;
  }
  if (!fail)
    printf("successful\n");
  else
    fail = 0;
  printf("done with %d errors\n", error);
  return error;
}
```