user: 请将以下的汇编代码转换成C语言代码:

```asm
<genMaps>:
  endbr64
  sub    $0x138,%rsp
  lea    D0(%rip),%rcx
  lea    D175(%rip),%rsi
  mov    %fs:0x28,%rax
  mov    %rax,0x128(%rsp)
  lea    D150(%rip),%rax
  movq   %rcx,%xmm10
  lea    D95(%rip),%rcx
  movq   %rcx,%xmm11
  lea    D15(%rip),%rcx
  movq   %rax,%xmm7
  lea    D30(%rip),%rax
  movq   %rax,%xmm6
  lea    D212(%rip),%rax
  movq   %rax,%xmm0
  lea    D139(%rip),%rax
  movq   %rax,%xmm2
  lea    D187(%rip),%rax
  movq   %rax,%xmm1
  lea    D215(%rip),%rax
  movq   %rax,%xmm9
  movq   %rax,%xmm4
  lea    D222(%rip),%rax
  movq   %rax,%xmm8
  lea    D184(%rip),%rax
  punpcklqdq %xmm1,%xmm4
  movq   %rax,%xmm5
  movdqa %xmm8,%xmm3
  punpcklqdq %xmm8,%xmm1
  mov    %rax,0x40(%rsp)
  punpcklqdq %xmm5,%xmm3
  movq   %rsi,%xmm5
  lea    D21(%rip),%rsi
  movaps %xmm1,0x30(%rsp)
  punpcklqdq %xmm10,%xmm5
  lea    D165(%rip),%rax
  movq   %rcx,%xmm1
  movaps %xmm4,0x90(%rsp)
  movaps %xmm5,(%rsp)
  movq   %rsi,%xmm5
  lea    D166(%rip),%rsi
  punpcklqdq %xmm11,%xmm5
  movaps %xmm3,0xa0(%rsp)
  movaps %xmm5,0x10(%rsp)
  movdqa %xmm2,%xmm5
  punpcklqdq %xmm9,%xmm5
  movaps %xmm4,0x100(%rsp)
  movaps %xmm5,0x20(%rsp)
  movq   %rax,%xmm5
  lea    D8(%rip),%rax
  punpcklqdq %xmm5,%xmm1
  movq   %rax,%xmm5
  lea    D213(%rip),%rax
  movaps %xmm3,0x110(%rsp)
  movaps %xmm1,0x50(%rsp)
  movdqa %xmm7,%xmm1
  punpcklqdq %xmm6,%xmm1
  movaps %xmm1,0x60(%rsp)
  movdqa %xmm0,%xmm1
  punpcklqdq %xmm5,%xmm1
  movaps %xmm1,0x70(%rsp)
  movq   %rax,%xmm1
  lea    D229(%rip),%rax
  punpcklqdq %xmm2,%xmm1
  movq   %rax,%xmm5
  lea    D44(%rip),%rax
  movaps %xmm1,0x80(%rsp)
  movq   %rsi,%xmm1
  punpcklqdq %xmm5,%xmm1
  movaps %xmm1,0xb0(%rsp)
  movq   %rax,%xmm1
  lea    D9(%rip),%rax
  punpcklqdq %xmm7,%xmm1
  movaps %xmm1,0xc0(%rsp)
  movq   %rax,%xmm1
  lea    D181(%rip),%rax
  punpcklqdq %xmm6,%xmm1
  movq   %rax,%xmm6
  lea    D60(%rip),%rax
  punpcklqdq %xmm6,%xmm0
  movaps %xmm1,0xd0(%rsp)
  movaps %xmm0,0xe0(%rsp)
  movq   %rax,%xmm0
  punpcklqdq %xmm2,%xmm0
  movaps %xmm0,0xf0(%rsp)
  cmp    $0x2,%edi
  je     L33
  cmp    $0x3,%edi
  je     L40
  lea    D107(%rip),%rax
  cmp    $0x1,%edi
  je     L44
L56:
  mov    0x128(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L65
  add    $0x138,%rsp
  ret
  nopw   0x0(%rax,%rax,1)
L33:
  lea    0x50(%rsp),%rdi
  mov    $0xc,%esi
  call   <buildString@plt>
  jmp    L56
  nopl   0x0(%rax)
L44:
  mov    %rsp,%rdi
  mov    $0x9,%esi
  call   <buildString@plt>
  jmp    L56
  nop
L40:
  lea    0xb0(%rsp),%rdi
  mov    $0xe,%esi
  call   <buildString@plt>
  jmp    L56
L65:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D0
type: string
name: disassemble_data
arguments: data_tag: D175
type: string
name: disassemble_data
arguments: data_tag: D150
type: string
name: disassemble_data
arguments: data_tag: D95
type: string
name: disassemble_data
arguments: data_tag: D15
type: string
name: disassemble_data
arguments: data_tag: D30
type: string
name: disassemble_data
arguments: data_tag: D212
type: string
name: disassemble_data
arguments: data_tag: D139
type: string
name: disassemble_data
arguments: data_tag: D187
type: string
name: disassemble_data
arguments: data_tag: D215
type: string
name: disassemble_data
arguments: data_tag: D222
type: string
name: disassemble_data
arguments: data_tag: D184
type: string
name: disassemble_data
arguments: data_tag: D21
type: string
name: disassemble_data
arguments: data_tag: D165
type: string
name: disassemble_data
arguments: data_tag: D166
type: string
name: disassemble_data
arguments: data_tag: D8
type: string
name: disassemble_data
arguments: data_tag: D213
type: string
name: disassemble_data
arguments: data_tag: D229
type: string
name: disassemble_data
arguments: data_tag: D44
type: string
name: disassemble_data
arguments: data_tag: D9
type: string
name: disassemble_data
arguments: data_tag: D181
type: string
name: disassemble_data
arguments: data_tag: D60
type: string
name: disassemble_data
arguments: data_tag: D107
type: string

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

tool: D175: int NumThreadsPerBlock = blockDim.x;

tool: D150: 		+ blockIdx.x * NumThreadsPerBlock

tool: D95: int idx = GlobalID_1D;

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

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

tool: D212: 		+ threadIdx.x;

tool: 

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

tool: D215: while( idx < num_elms){

tool: D222: 	idx += stride;

tool: D184: }

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

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

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

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

tool: D213: int idx = globalID_2D;

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

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

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

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

tool: D60: int idx = globalID_3D;

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