user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<calc_opencl>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xc0,%rsp
  mov    %edi,-0x94(%rbp)
  mov    %rsi,-0xa0(%rbp)
  mov    %rdx,-0xa8(%rbp)
  mov    %rcx,-0xb0(%rbp)
  mov    %r8,-0xb8(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x100000,-0x88(%rbp)
  movl   $0x20,-0x84(%rbp)
  movq   $0x0,-0x78(%rbp)
  movq   $0x0,-0x70(%rbp)
  movq   $0x0,-0x68(%rbp)
  movq   $0x0,-0x60(%rbp)
  movq   $0x0,-0x58(%rbp)
  movq   $0x0,-0x50(%rbp)
  movq   $0x0,-0x48(%rbp)
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    -0x60(%rbp),%rcx
  lea    -0x68(%rbp),%rdx
  lea    -0x70(%rbp),%rsi
  lea    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <init_cl@plt>
  mov    %eax,-0x80(%rbp)
  cmpl   $0x0,-0x80(%rbp)
  jg     L4
  mov    $0xffffffff,%edi
  call   <exit@plt>
L4:
  mov    -0x80(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0x84(%rbp),%eax
  add    %edx,%eax
  cltd
  idivl  -0x80(%rbp)
  mov    %eax,-0x7c(%rbp)
  mov    -0x7c(%rbp),%eax
  mov    %eax,%esi
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x7c(%rbp),%eax
  imul   -0x80(%rbp),%eax
  cltq
  mov    %rax,-0x40(%rbp)
  movq   $0x1,-0x38(%rbp)
  movq   $0x1,-0x30(%rbp)
  mov    -0x7c(%rbp),%eax
  cltq
  mov    %rax,-0x20(%rbp)
  movq   $0x1,-0x18(%rbp)
  movq   $0x1,-0x10(%rbp)
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D33(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x60(%rbp),%rax
  mov    %rax,%rdi
  call   <clReleaseCommandQueue@plt>
  mov    -0x68(%rbp),%rax
  mov    %rax,%rdi
  call   <clReleaseContext@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L8
  call   <__stack_chk_fail@plt>
L8:
  leave
  ret
```

tool_calls: name: parse_data
arguments: tag: D16
type_guessed: string
name: parse_data
arguments: tag: D24
type_guessed: string
name: parse_data
arguments: tag: D3
type_guessed: string
name: parse_data
arguments: tag: D33
type_guessed: string

tool: D16:  [Initialize Device]

tool: D24:    * Wrok Items: %d


tool: D3:  [Calculation]

tool: D33:  [Profile]

assistant: ```c
void calc_opencl(int datasize, double *data1, double *data2, double *result, const char *cl_filename) {
  cl_int num_rand = 4096 * 256;
  int count_all, i;
  int num_generator = 32;
  double pi;
  cl_platform_id platform_id = NULL;
  cl_device_id device_id = NULL;
  cl_context context = NULL;
  cl_command_queue command_queue = NULL;
  cl_uint num_compute_unit;
  cl_uint num_work_item;
  cl_program program = NULL;
  cl_kernel kernel_mt = NULL, kernel_pi = NULL;
  cl_mem rand, count;
  size_t global_item_size[3], local_item_size[3];
  cl_mem dev_mts;
  cl_event ev_mt_end, ev_pi_end, ev_copy_end;
  cl_ulong prof_start, prof_mt_end, prof_pi_end, prof_copy_end;
  cl_int ret;
  printf(" [Initialize Device]\n");
  num_compute_unit = init_cl(&platform_id, &device_id, &context, &command_queue);
  if (num_compute_unit < 1) {
    exit(-1);
  }
  num_work_item = (num_generator + (num_compute_unit - 1)) / num_compute_unit;
  printf("   * Wrok Items: %d\n", num_work_item);
  global_item_size[0] = num_work_item * num_compute_unit;
  global_item_size[1] = 1;
  global_item_size[2] = 1;
  local_item_size[0] = num_work_item;
  local_item_size[1] = 1;
  local_item_size[2] = 1;
  printf(" [Calculation]\n");
  printf(" [Profile]\n");
  clReleaseCommandQueue(command_queue);
  clReleaseContext(context);
}
```