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

```asm
<genMaps>:
  endbr64
  push   %rbx
  sub    $0x130,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x128(%rsp)
  xor    %eax,%eax
  lea    D144(%rip),%rax
  mov    %rax,(%rsp)
  lea    D161(%rip),%rax
  mov    %rax,0x8(%rsp)
  lea    D116(%rip),%rax
  mov    %rax,0x10(%rsp)
  lea    D184(%rip),%rax
  mov    %rax,0x18(%rsp)
  lea    D139(%rip),%r8
  mov    %r8,0x20(%rsp)
  lea    D54(%rip),%rsi
  mov    %rsi,0x28(%rsp)
  lea    D6(%rip),%rcx
  mov    %rcx,0x30(%rsp)
  lea    D125(%rip),%rdx
  mov    %rdx,0x38(%rsp)
  lea    D200(%rip),%rax
  mov    %rax,0x40(%rsp)
  lea    D187(%rip),%r9
  mov    %r9,0x50(%rsp)
  lea    D169(%rip),%r10
  mov    %r10,0x58(%rsp)
  lea    D141(%rip),%r11
  mov    %r11,0x60(%rsp)
  lea    D174(%rip),%r10
  mov    %r10,0x68(%rsp)
  lea    D56(%rip),%r9
  mov    %r9,0x70(%rsp)
  lea    D84(%rip),%rbx
  mov    %rbx,0x78(%rsp)
  lea    D53(%rip),%rbx
  mov    %rbx,0x80(%rsp)
  mov    %r8,0x88(%rsp)
  mov    %rsi,0x90(%rsp)
  mov    %rcx,0x98(%rsp)
  mov    %rdx,0xa0(%rsp)
  mov    %rax,0xa8(%rsp)
  lea    D14(%rip),%rbx
  mov    %rbx,0xb0(%rsp)
  lea    D86(%rip),%rbx
  mov    %rbx,0xb8(%rsp)
  lea    D142(%rip),%rbx
  mov    %rbx,0xc0(%rsp)
  mov    %r11,0xc8(%rsp)
  lea    D228(%rip),%rbx
  mov    %rbx,0xd0(%rsp)
  mov    %r10,0xd8(%rsp)
  mov    %r9,0xe0(%rsp)
  lea    D10(%rip),%rbx
  mov    %rbx,0xe8(%rsp)
  lea    D131(%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     L15
  cmp    $0x3,%edi
  je     L30
  lea    D26(%rip),%rax
  cmp    $0x1,%edi
  je     L38
L60:
  mov    0x128(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L16
  add    $0x130,%rsp
  pop    %rbx
  ret
L38:
  mov    %rsp,%rdi
  mov    $0x9,%esi
  call   <buildString@plt>
  jmp    L60
L15:
  lea    0x50(%rsp),%rdi
  mov    $0xc,%esi
  call   <buildString@plt>
  jmp    L60
L30:
  lea    0xb0(%rsp),%rdi
  mov    $0xe,%esi
  call   <buildString@plt>
  jmp    L60
L16:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D144
type_guessed: string
name: unpack_data
arguments: label: D161
type_guessed: string
name: unpack_data
arguments: label: D116
type_guessed: string
name: unpack_data
arguments: label: D184
type_guessed: string
name: unpack_data
arguments: label: D139
type_guessed: string
name: unpack_data
arguments: label: D54
type_guessed: string
name: unpack_data
arguments: label: D6
type_guessed: string
name: unpack_data
arguments: label: D125
type_guessed: string
name: unpack_data
arguments: label: D200
type_guessed: string
name: unpack_data
arguments: label: D187
type_guessed: string
name: unpack_data
arguments: label: D169
type_guessed: string
name: unpack_data
arguments: label: D141
type_guessed: string
name: unpack_data
arguments: label: D174
type_guessed: string
name: unpack_data
arguments: label: D56
type_guessed: string
name: unpack_data
arguments: label: D84
type_guessed: string
name: unpack_data
arguments: label: D53
type_guessed: string
name: unpack_data
arguments: label: D14
type_guessed: string
name: unpack_data
arguments: label: D86
type_guessed: string
name: unpack_data
arguments: label: D142
type_guessed: string
name: unpack_data
arguments: label: D228
type_guessed: string
name: unpack_data
arguments: label: D10
type_guessed: string
name: unpack_data
arguments: label: D131
type_guessed: string
name: unpack_data
arguments: label: D26
type_guessed: string

tool: D144: int NumThreadsPerBlock = blockDim.x;

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

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

tool: D184: int idx = GlobalID_1D;

tool: 

tool: D54: while( idx < num_elms){

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

tool: D125: 	idx += stride;

tool: D200: }

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

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

tool: D141: 		+ blockIdx.x * NumThreadsPerBlock

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

tool: D56: 		+ threadIdx.x;

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

tool: D53: int idx = globalID_2D;

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

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

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

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

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

tool: D131: int idx = globalID_3D;

tool: D26: 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";
  }
}
```