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

```asm
<skeleton>:
  endbr64
  push   %r13
  push   %r12
  lea    D14(%rip),%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  lea    D68(%rip),%rbx
  sub    $0x1b8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x1a8(%rsp)
  xor    %eax,%eax
  call   <strlen@plt>
  mov    %r12,%rdx
  mov    $0x1dd,%esi
  lea    0x28(%rax),%rdi
  call   <eipa_malloc@plt>
  lea    D314(%rip),%rsi
  mov    %rax,%rdi
  mov    %rax,(%rsp)
  call   <strcpy@plt>
  mov    (%rsp),%rdi
  mov    %rbp,%rsi
  call   <strcat@plt>
  mov    (%rsp),%rdi
  lea    D105(%rip),%rsi
  call   <strcat@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %r12,%rdx
  mov    $0x1e5,%esi
  lea    0x25(%rax),%rdi
  call   <eipa_malloc@plt>
  mov    %rbx,%rsi
  mov    %rax,%rdi
  mov    %rax,0x8(%rsp)
  call   <strcpy@plt>
  mov    0x8(%rsp),%rdi
  mov    %rbp,%rsi
  call   <strcat@plt>
  mov    0x8(%rsp),%rdi
  lea    D259(%rip),%rsi
  call   <strcat@plt>
  lea    D262(%rip),%rsi
  mov    (%rsp),%rdx
  lea    D119(%rip),%rax
  mov    %rsi,0x58(%rsp)
  lea    D266(%rip),%rdi
  lea    D353(%rip),%rcx
  mov    %rsi,0x88(%rsp)
  lea    D260(%rip),%rsi
  mov    %rsi,0x90(%rsp)
  lea    D117(%rip),%rsi
  mov    %rsi,0x98(%rsp)
  lea    D34(%rip),%rsi
  mov    %rdx,0x28(%rsp)
  lea    D281(%rip),%rdx
  mov    %rsi,0xb0(%rsp)
  lea    D26(%rip),%rsi
  mov    %rdx,0x48(%rsp)
  lea    D213(%rip),%rdx
  mov    %rsi,0xc0(%rsp)
  lea    D53(%rip),%rsi
  mov    %rdx,0x50(%rsp)
  lea    D59(%rip),%rdx
  mov    %rsi,0xc8(%rsp)
  lea    D149(%rip),%rsi
  mov    %rax,0x10(%rsp)
  lea    D98(%rip),%rax
  mov    %rdx,0x60(%rsp)
  lea    D325(%rip),%rdx
  mov    %rdi,0x80(%rsp)
  lea    D49(%rip),%rdi
  mov    %rsi,0xd0(%rsp)
  lea    D179(%rip),%rsi
  mov    %rax,0x18(%rsp)
  lea    D205(%rip),%rax
  mov    %rcx,0x30(%rsp)
  lea    D195(%rip),%rcx
  mov    %rdx,0x68(%rsp)
  lea    D183(%rip),%rdx
  mov    %rsi,0xe8(%rsp)
  lea    D331(%rip),%rsi
  mov    %rdi,0xf8(%rsp)
  lea    D78(%rip),%rdi
  mov    %rcx,0x38(%rsp)
  mov    %rdx,0x70(%rsp)
  mov    %rdx,0xa0(%rsp)
  mov    %rdx,0xd8(%rsp)
  mov    %rax,0x20(%rsp)
  mov    %rax,0x40(%rsp)
  mov    %rax,0x78(%rsp)
  mov    %rbx,0xa8(%rsp)
  mov    %rax,0xb8(%rsp)
  mov    %rax,0xe0(%rsp)
  mov    %rax,0xf0(%rsp)
  mov    %rsi,0x100(%rsp)
  mov    %rdi,0x108(%rsp)
  mov    0x8(%rsp),%rsi
  lea    D96(%rip),%rdi
  mov    %rdi,0x120(%rsp)
  lea    D357(%rip),%rdi
  mov    %rsi,0x110(%rsp)
  lea    D234(%rip),%rsi
  mov    %rsi,0x118(%rsp)
  lea    D122(%rip),%rsi
  mov    %rsi,0x128(%rsp)
  lea    D327(%rip),%rsi
  mov    %rdi,0x138(%rsp)
  lea    D114(%rip),%rdi
  mov    %rsi,0x140(%rsp)
  lea    D66(%rip),%rsi
  mov    %rdi,0x158(%rsp)
  lea    D232(%rip),%rdi
  mov    %rax,0x130(%rsp)
  mov    %rbx,0x150(%rsp)
  mov    %rax,0x160(%rsp)
  mov    %rsi,0x168(%rsp)
  mov    $0x33,%esi
  mov    %rdi,0x170(%rsp)
  lea    0x10(%rsp),%rdi
  mov    %rbx,0x180(%rsp)
  lea    D309(%rip),%rbx
  mov    %rax,0x190(%rsp)
  lea    D218(%rip),%rax
  mov    %rdx,0x148(%rsp)
  mov    %rdx,0x178(%rsp)
  mov    %rcx,0x1a0(%rsp)
  mov    %rbx,0x188(%rsp)
  mov    %rax,0x198(%rsp)
  call   <buildString@plt>
  mov    %rsp,%rdi
  mov    %r12,%rdx
  mov    $0x222,%esi
  mov    %rax,%r13
  call   <eipa_free@plt>
  lea    0x8(%rsp),%rdi
  mov    %r12,%rdx
  mov    $0x223,%esi
  call   <eipa_free@plt>
  mov    0x1a8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L7
  add    $0x1b8,%rsp
  mov    %r13,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L7:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D14
data_type: string
name: parse_data
arguments: data_label: D68
data_type: string
name: parse_data
arguments: data_label: D314
data_type: string
name: parse_data
arguments: data_label: D105
data_type: string
name: parse_data
arguments: data_label: D259
data_type: string
name: parse_data
arguments: data_label: D262
data_type: string
name: parse_data
arguments: data_label: D119
data_type: string
name: parse_data
arguments: data_label: D266
data_type: string
name: parse_data
arguments: data_label: D353
data_type: string
name: parse_data
arguments: data_label: D260
data_type: string
name: parse_data
arguments: data_label: D117
data_type: string
name: parse_data
arguments: data_label: D34
data_type: string
name: parse_data
arguments: data_label: D281
data_type: string
name: parse_data
arguments: data_label: D26
data_type: string
name: parse_data
arguments: data_label: D213
data_type: string
name: parse_data
arguments: data_label: D53
data_type: string
name: parse_data
arguments: data_label: D59
data_type: string
name: parse_data
arguments: data_label: D149
data_type: string
name: parse_data
arguments: data_label: D98
data_type: string
name: parse_data
arguments: data_label: D325
data_type: string
name: parse_data
arguments: data_label: D49
data_type: string
name: parse_data
arguments: data_label: D179
data_type: string
name: parse_data
arguments: data_label: D205
data_type: string
name: parse_data
arguments: data_label: D195
data_type: string
name: parse_data
arguments: data_label: D183
data_type: string
name: parse_data
arguments: data_label: D331
data_type: string
name: parse_data
arguments: data_label: D78
data_type: string
name: parse_data
arguments: data_label: D96
data_type: string
name: parse_data
arguments: data_label: D357
data_type: string
name: parse_data
arguments: data_label: D234
data_type: string
name: parse_data
arguments: data_label: D122
data_type: string
name: parse_data
arguments: data_label: D327
data_type: string
name: parse_data
arguments: data_label: D114
data_type: string
name: parse_data
arguments: data_label: D66
data_type: string
name: parse_data
arguments: data_label: D232
data_type: string
name: parse_data
arguments: data_label: D309
data_type: string
name: parse_data
arguments: data_label: D218
data_type: string

tool: D14: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/WikiDreams/CUDA-SAK/refs/heads/master/Cuda-SAK/functions.c

tool: D68: 	

tool: D314: __global__ void 

tool: D105: (TODO:add parameters) {

tool: D259: <<<blocks,grid>>>(TODO:parameters);

tool: D262: 	* Example:

tool: D119: #include <stdio.h>

tool: D266: 	/*TODO: prepare device memory

tool: D353: 	//TODO: Kernel code here

tool: D260: 	* size_t histo_size_bytes = 256 * sizeof(unsigned int);

tool: D117: 	* HANDLE_ERROR( cudaMalloc((int**)&histo_d,histo_size_bytes) );

tool: D34: 	HANDLE_ERROR( cudaMalloc((TODO:add cast to variable type)&TODO:device variable name,TODO:size to allocate in the device memory);

tool: D281: int main(void) {

tool: D26: 	/*TODO: initialize device variables

tool: D213: 	/*TODO: declare and initialize variables for device and host

tool: D53: 	* Example: 

tool: D59: 	* int histo_h[256];	

tool: D149: 	* HANDLE_ERROR(cudaMemcpy(buffer_d,buffer_h,buffer_size_bytes,cudaMemcpyHostToDevice));

tool: D98: #include "HandleError.h"

tool: D325: 	* unsigned int *histo_d;

tool: D49: 	//Kernel Call

tool: D179: 	HANDLE_ERROR(cudaMemcpy(TODO:device variable,TODO:host variable,TODO:size allocated to device variable, cudaMemcpyHostToDevice))

tool: 

tool: D195: }

tool: D183: 	*/

tool: D331: 	dim3 grid(TODO:set grid dimensions);

tool: D78: 	dim3 blocks(TODO:set block dimensions);

tool: D96: 	cudaError_t err = cudaGetLastError();

tool: D357: 	/*TODO: copy variables from device to host

tool: D234: 	cudaDeviceSynchronize();

tool: D122: 	HANDLE_ERROR( err );

tool: D327: 	* Example: HANDLE_ERROR(cudaMemcpy(histo_h,histo_d,histo_size_bytes,cudaMemcpyDeviceToHost));

tool: D114: 	HANDLE_ERROR(cudaMemcpy(TODO:host variable,TODO:device variable,TODO: size allocated to device variable, cudaMemcpyDeviceToHost));

tool: D66: 	/*TODO: free device memory

tool: D232: 	* Example: HANDLE_ERROR(cudaFree(buffer_d));

tool: D309: 	HANDLE_ERROR(cudaFree(TODO:variable to free));

tool: D218: 	return 0;

assistant: ```c
char *skeleton(char *kernel_name) {
  char *aux1 = "__global__ void ";
  char *aux2 = "(TODO:add parameters) {";
  char *aux3 = eipa_malloc((strlen(kernel_name) + strlen(aux1) + strlen(aux2) + 1), 477, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/WikiDreams/CUDA-SAK/refs/heads/master/Cuda-SAK/functions.c");
  strcpy(aux3, aux1);
  strcat(aux3, kernel_name);
  strcat(aux3, aux2);
  char *aux4 = "	";
  char *aux5 = "<<<blocks,grid>>>(TODO:parameters);";
  char *aux6 = eipa_malloc((strlen(kernel_name) + strlen(aux4) + strlen(aux5) + 1), 485, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/WikiDreams/CUDA-SAK/refs/heads/master/Cuda-SAK/functions.c");
  strcpy(aux6, aux4);
  strcat(aux6, kernel_name);
  strcat(aux6, aux5);
  char *string[51] = {"#include <stdio.h>", "#include \"HandleError.h\"", "", aux3, "	//TODO: Kernel code here", "}", "", "int main(void) {", "	/*TODO: declare and initialize variables for device and host", "	* Example:", "	* int histo_h[256];	", "	* unsigned int *histo_d;", "	*/", "", "	/*TODO: prepare device memory", "	* Example:", "	* size_t histo_size_bytes = 256 * sizeof(unsigned int);", "	* HANDLE_ERROR( cudaMalloc((int**)&histo_d,histo_size_bytes) );", "	*/", "	", "	HANDLE_ERROR( cudaMalloc((TODO:add cast to variable type)&TODO:device variable name,TODO:size to allocate in the device memory);", "", "	/*TODO: initialize device variables", "	* Example: ", "	* HANDLE_ERROR(cudaMemcpy(buffer_d,buffer_h,buffer_size_bytes,cudaMemcpyHostToDevice));", "	*/", "", "	HANDLE_ERROR(cudaMemcpy(TODO:device variable,TODO:host variable,TODO:size allocated to device variable, cudaMemcpyHostToDevice))", "", "	//Kernel Call", "	dim3 grid(TODO:set grid dimensions);", "	dim3 blocks(TODO:set block dimensions);", aux6, "	cudaDeviceSynchronize();", "	cudaError_t err = cudaGetLastError();", "	HANDLE_ERROR( err );", "", "	/*TODO: copy variables from device to host", "	* Example: HANDLE_ERROR(cudaMemcpy(histo_h,histo_d,histo_size_bytes,cudaMemcpyDeviceToHost));", "	*/", "	", "	HANDLE_ERROR(cudaMemcpy(TODO:host variable,TODO:device variable,TODO: size allocated to device variable, cudaMemcpyDeviceToHost));", "", "	/*TODO: free device memory", "	* Example: HANDLE_ERROR(cudaFree(buffer_d));", "	*/", "	", "	HANDLE_ERROR(cudaFree(TODO:variable to free));", "", "	return 0;", "}"};
  char *final = buildString(string, 51);
  eipa_free((void **)(&(aux3)), 546, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/WikiDreams/CUDA-SAK/refs/heads/master/Cuda-SAK/functions.c");
  eipa_free((void **)(&(aux6)), 547, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/WikiDreams/CUDA-SAK/refs/heads/master/Cuda-SAK/functions.c");
  return final;
}
```