user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<genMaps>:
  endbr64
  push   %rbx
  lea    D52(%rip),%rbx
  lea    D139(%rip),%r9
  lea    D51(%rip),%r10
  lea    D196(%rip),%r8
  lea    D59(%rip),%rsi
  lea    D180(%rip),%rcx
  sub    $0x130,%rsp
  lea    D82(%rip),%rdx
  lea    D158(%rip),%r11
  mov    %fs:0x28,%rax
  mov    %rax,0x128(%rsp)
  lea    D168(%rip),%rax
  mov    %rbx,0x78(%rsp)
  lea    D54(%rip),%rbx
  mov    %rbx,0x80(%rsp)
  lea    D37(%rip),%rbx
  mov    %rbx,0xb0(%rsp)
  lea    D146(%rip),%rbx
  mov    %rbx,0xb8(%rsp)
  lea    D32(%rip),%rbx
  mov    %rbx,0xc0(%rsp)
  lea    D113(%rip),%rbx
  mov    %r9,0x50(%rsp)
  lea    D198(%rip),%r9
  mov    %rax,(%rsp)
  lea    D179(%rip),%rax
  mov    %rax,0x8(%rsp)
  lea    D8(%rip),%rax
  mov    %rax,0x10(%rsp)
  lea    D216(%rip),%rax
  mov    %rax,0x18(%rsp)
  lea    D105(%rip),%rax
  mov    %r10,0x58(%rsp)
  lea    D213(%rip),%r10
  mov    %rbx,0xd0(%rsp)
  lea    D68(%rip),%rbx
  mov    %r8,0x20(%rsp)
  mov    %rsi,0x28(%rsp)
  mov    %rcx,0x30(%rsp)
  mov    %rdx,0x38(%rsp)
  mov    %rax,0x40(%rsp)
  mov    %r11,0x60(%rsp)
  mov    %r10,0x68(%rsp)
  mov    %r9,0x70(%rsp)
  mov    %r8,0x88(%rsp)
  mov    %rsi,0x90(%rsp)
  mov    %rcx,0x98(%rsp)
  mov    %rdx,0xa0(%rsp)
  mov    %rax,0xa8(%rsp)
  mov    %r11,0xc8(%rsp)
  mov    %r10,0xd8(%rsp)
  mov    %r9,0xe0(%rsp)
  mov    %rbx,0xe8(%rsp)
  lea    D84(%rip),%rbx
  mov    %rbx,0xf0(%rsp)
  mov    %r8,0xf8(%rsp)
  mov    %rsi,0x100(%rsp)
  mov    %rcx,0x108(%rsp)
  mov    %rdx,0x110(%rsp)
  mov    %rax,0x118(%rsp)
  cmp    $0x2,%edi
  je     L35
  cmp    $0x3,%edi
  je     L57
  lea    D27(%rip),%rax
  cmp    $0x1,%edi
  je     L60
L5:
  mov    0x128(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L17
  add    $0x130,%rsp
  pop    %rbx
  ret
  nopl   0x0(%rax,%rax,1)
L35:
  lea    0x50(%rsp),%rdi
  mov    $0xc,%esi
  call   <buildString@plt>
  jmp    L5
  nopl   0x0(%rax)
L60:
  mov    %rsp,%rdi
  mov    $0x9,%esi
  call   <buildString@plt>
  jmp    L5
  nop
L57:
  lea    0xb0(%rsp),%rdi
  mov    $0xe,%esi
  call   <buildString@plt>
  jmp    L5
L17:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D52
type_guessed: string
name: unpack_data
arguments: data_label: D139
type_guessed: string
name: unpack_data
arguments: data_label: D51
type_guessed: string
name: unpack_data
arguments: data_label: D196
type_guessed: string
name: unpack_data
arguments: data_label: D59
type_guessed: string
name: unpack_data
arguments: data_label: D180
type_guessed: string
name: unpack_data
arguments: data_label: D82
type_guessed: string
name: unpack_data
arguments: data_label: D158
type_guessed: string
name: unpack_data
arguments: data_label: D168
type_guessed: string
name: unpack_data
arguments: data_label: D54
type_guessed: string
name: unpack_data
arguments: data_label: D37
type_guessed: string
name: unpack_data
arguments: data_label: D146
type_guessed: string
name: unpack_data
arguments: data_label: D32
type_guessed: string
name: unpack_data
arguments: data_label: D113
type_guessed: string
name: unpack_data
arguments: data_label: D198
type_guessed: string
name: unpack_data
arguments: data_label: D179
type_guessed: string
name: unpack_data
arguments: data_label: D8
type_guessed: string
name: unpack_data
arguments: data_label: D216
type_guessed: string
name: unpack_data
arguments: data_label: D105
type_guessed: string
name: unpack_data
arguments: data_label: D213
type_guessed: string
name: unpack_data
arguments: data_label: D68
type_guessed: string
name: unpack_data
arguments: data_label: D84
type_guessed: string
name: unpack_data
arguments: data_label: D27
type_guessed: string

tool: D52: int stride = gridDim.x * gridDim.y * NumThreadsPerBlock;

tool: D139: int NumThreadsPerBlock = blockDim.x * blockDim.y;

tool: D51: int globalID_2D = blockIdx.y * gridDim.x * NumThreadsPerBlock

tool: 

tool: D59: while( idx < num_elms){

tool: D180: 	c[idx] = a[idx] + b[idx];

tool: D82: 	idx += stride;

tool: D158: 		+ blockIdx.x * NumThreadsPerBlock

tool: D168: int NumThreadsPerBlock = blockDim.x;

tool: D54: int idx = globalID_2D;

tool: D37: int NumThreadsPerBlock = blockDim.x * blockDim.y * blockDim.z;

tool: D146: int globalID_3D =  blockIdx.z * gridDim.x * gridDim.y * NumThreadsPerBlock

tool: D32: 		+ blockIdx.y * gridDim.x * NumThreadsPerBlock

tool: D113: 		+ threadIdx.z * blockDim.x * blockDim.y

tool: D198: 		+ threadIdx.x;

tool: D179: int GlobalID_1D = blockIdx.x * blockDim.x + threadIdx.x;

tool: D8: int stride = gridDim.x * NumThreadsPerBlock;

tool: D216: int idx = GlobalID_1D;

tool: D105: }

tool: D213: 		+ threadIdx.y * blockDim.x

tool: D68: int stride = gridDim.x * gridDim.y * gridDim.z * NumThreadsPerBlock;

tool: D84: int idx = globalID_3D;

tool: D27: Invalid dimension!


assistant: ```c
char *genMaps(int dimension) {
  char *oneD_to_oneD[9] = {"int NumThreadsPerBlock = blockDim.x;", "int GlobalID_1D = blockIdx.x * blockDim.x + threadIdx.x;", "int stride = gridDim.x * NumThreadsPerBlock;", "int idx = GlobalID_1D;", "", "while( idx < num_elms){", "	c[idx] = a[idx] + b[idx];", "	idx += stride;", "}"};
  char *twoD_to_oneD[12] = {"int NumThreadsPerBlock = blockDim.x * blockDim.y;", "int globalID_2D = blockIdx.y * gridDim.x * NumThreadsPerBlock", "		+ blockIdx.x * NumThreadsPerBlock", "		+ threadIdx.y * blockDim.x", "		+ threadIdx.x;", "int stride = gridDim.x * gridDim.y * NumThreadsPerBlock;", "int idx = globalID_2D;", "", "while( idx < num_elms){", "	c[idx] = a[idx] + b[idx];", "	idx += stride;", "}"};
  char *threeD_to_oneD[14] = {"int NumThreadsPerBlock = blockDim.x * blockDim.y * blockDim.z;", "int globalID_3D =  blockIdx.z * gridDim.x * gridDim.y * NumThreadsPerBlock", "		+ blockIdx.y * gridDim.x * NumThreadsPerBlock", "		+ blockIdx.x * NumThreadsPerBlock", "		+ threadIdx.z * blockDim.x * blockDim.y", "		+ threadIdx.y * blockDim.x", "		+ threadIdx.x;", "int stride = gridDim.x * gridDim.y * gridDim.z * NumThreadsPerBlock;", "int idx = globalID_3D;", "", "while( idx < num_elms){", "	c[idx] = a[idx] + b[idx];", "	idx += stride;", "}"};
  switch (dimension) {
  case 1:
    return buildString(oneD_to_oneD, 9);
  case 2:
    return buildString(twoD_to_oneD, 12);
  case 3:
    return buildString(threeD_to_oneD, 14);
  default:
    return "Invalid dimension!\n";
  }
}
```