ylfeng/ReF-Decompile-dataset huggingface dataset:
user: What is the c source code of the assembly code below:

```asm
<max_star2>:
  endbr64
  movaps %xmm1,%xmm2
  subss  %xmm0,%xmm2
  comiss D18(%rip),%xmm2
  ja     L9
  movss  D34(%rip),%xmm3
  comiss %xmm2,%xmm3
  ja     L12
  comiss D28(%rip),%xmm2
  jbe    L10
  addss  D39(%rip),%xmm1
  movaps %xmm1,%xmm0
  ret
  cs nopw 0x0(%rax,%rax,1)
L9:
  movaps %xmm1,%xmm0
L12:
  ret
  nopl   0x0(%rax)
L10:
  addss  D39(%rip),%xmm0
  ret
```

tool_calls: name: read_data
arguments: data_label: D18
data_type: f32
name: read_data
arguments: data_label: D34
data_type: byte[4]
name: read_data
arguments: data_label: D28
data_type: byte[4]
name: read_data
arguments: data_label: D39
data_type: f32

tool: D18: 1.5

tool: {"D34": [0x00,0x00,0xc0,0xbf]}

tool: {"D28": [0x00,0x00,0x00,0x00]}

tool: D39: 0.5

assistant: ```c
float max_star2(float delta1, float delta2) {
  register float diff;
  diff = delta2 - delta1;
  if (diff > 1.5)
    return (delta2);
  else if (diff < -1.5)
    return (delta1);
  else if (diff > 0)
    return (delta2 + 0.5);
  else
    return (delta1 + 0.5);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<max_star2>:
  endbr64
  movaps %xmm1,%xmm2
  subss  %xmm0,%xmm2
  comiss D34(%rip),%xmm2
  ja     L8
  movss  D35(%rip),%xmm3
  comiss %xmm2,%xmm3
  ja     L12
  comiss D30(%rip),%xmm2
  jbe    L1
  addss  D14(%rip),%xmm1
  movaps %xmm1,%xmm0
  ret
  cs nopw 0x0(%rax,%rax,1)
L8:
  movaps %xmm1,%xmm0
L12:
  ret
  nopl   0x0(%rax)
L1:
  addss  D14(%rip),%xmm0
  ret
```

tool_calls: name: read_data
arguments: data_label: D34
type_infered: f32
name: read_data
arguments: data_label: D35
type_infered: byte[4]
name: read_data
arguments: data_label: D30
type_infered: byte[4]
name: read_data
arguments: data_label: D14
type_infered: f32

tool: D34: 1.5

tool: {"D35": [0x00,0x00,0xc0,0xbf]}

tool: {"D30": [0x00,0x00,0x00,0x00]}

tool: D14: 0.5

assistant: ```c
float max_star2(float delta1, float delta2) {
  register float diff;
  diff = delta2 - delta1;
  if (diff > 1.5)
    return (delta2);
  else if (diff < -1.5)
    return (delta1);
  else if (diff > 0)
    return (delta2 + 0.5);
  else
    return (delta1 + 0.5);
}
```
user: Translate the below assembly code into C programming language:

```asm
<rgb888to565>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    %edx,-0x1c(%rbp)
  movl   $0x0,-0x4(%rbp)
  mov    -0x14(%rbp),%eax
  sar    $0x3,%eax
  shl    $0xb,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x18(%rbp),%eax
  sar    $0x2,%eax
  shl    $0x6,%eax
  or     %eax,-0x4(%rbp)
  mov    -0x1c(%rbp),%eax
  sar    $0x3,%eax
  or     %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
uint16_t rgb888to565(uint8_t r, uint8_t g, uint8_t b) {
  uint16_t rgb565 = 0;
  rgb565 = ((r >> 3) << 11);
  rgb565 |= ((g >> 2) << 6);
  rgb565 |= (b >> 3);
  return rgb565;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<rgb888to565>:
  endbr64
  sar    $0x3,%edi
  shl    $0xb,%edi
  sar    $0x2,%esi
  shl    $0x6,%esi
  sar    $0x3,%edx
  or     %edx,%esi
  mov    %esi,%eax
  or     %edi,%eax
  ret
```

assistant: ```c
uint16_t rgb888to565(uint8_t r, uint8_t g, uint8_t b) {
  uint16_t rgb565 = 0;
  rgb565 = ((r >> 3) << 11);
  rgb565 |= ((g >> 2) << 6);
  rgb565 |= (b >> 3);
  return rgb565;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<rgb888to565>:
  endbr64
  sar    $0x2,%esi
  sar    $0x3,%edx
  shl    $0x6,%esi
  sar    $0x3,%edi
  or     %edx,%esi
  shl    $0xb,%edi
  mov    %esi,%eax
  or     %edi,%eax
  ret
```

assistant: ```c
uint16_t rgb888to565(uint8_t r, uint8_t g, uint8_t b) {
  uint16_t rgb565 = 0;
  rgb565 = ((r >> 3) << 11);
  rgb565 |= ((g >> 2) << 6);
  rgb565 |= (b >> 3);
  return rgb565;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<rgb888to565>:
  endbr64
  sar    $0x2,%esi
  sar    $0x3,%edx
  shl    $0x6,%esi
  sar    $0x3,%edi
  or     %edx,%esi
  shl    $0xb,%edi
  mov    %esi,%eax
  or     %edi,%eax
  ret
```

assistant: ```c
uint16_t rgb888to565(uint8_t r, uint8_t g, uint8_t b) {
  uint16_t rgb565 = 0;
  rgb565 = ((r >> 3) << 11);
  rgb565 |= ((g >> 2) << 6);
  rgb565 |= (b >> 3);
  return rgb565;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<server_stop>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0x0,%eax
  call   <game_stop@plt>
  nop
  pop    %rbp
  ret
```

assistant: ```c
void server_stop() {
  game_stop();
  return;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<server_stop>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%eax
  call   <game_stop@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
void server_stop() {
  game_stop();
  return;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<server_stop>:
  endbr64
  xor    %eax,%eax
  jmp    1050 <game_stop@plt>
```

assistant: ```c
void server_stop() {
  game_stop();
  return;
}
```
user: Translate the below assembly code into C programming language:

```asm
<server_stop>:
  endbr64
  xor    %eax,%eax
  jmp    1050 <game_stop@plt>
```

assistant: ```c
void server_stop() {
  game_stop();
  return;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0x0,%eax
  call   <foo@plt>
  mov    $0x0,%eax
  call   <xxx@plt>
  mov    $0x0,%eax
  call   <bar@plt>
  mov    $0x0,%eax
  pop    %rbp
  ret
```

assistant: ```c
int main() {
  foo();
  xxx();
  bar();
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%eax
  call   <foo@plt>
  mov    $0x0,%eax
  call   <xxx@plt>
  mov    $0x0,%eax
  call   <bar@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main() {
  foo();
  xxx();
  bar();
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <foo@plt>
  xor    %eax,%eax
  call   <xxx@plt>
  xor    %eax,%eax
  call   <bar@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main() {
  foo();
  xxx();
  bar();
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <foo@plt>
  xor    %eax,%eax
  call   <xxx@plt>
  xor    %eax,%eax
  call   <bar@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main() {
  foo();
  xxx();
  bar();
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<merge_args>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rsi,%rbx
  test   %rdi,%rdi
  je     L67
  mov    %rsi,%r14
  mov    %rdx,%r13
  call   <strdup@plt>
  mov    %eax,%edi
  mov    $0x36,%edx
  lea    D13(%rip),%rsi
  call   <do_nofail@plt>
  mov    %rax,%rdi
  lea    D5(%rip),%rsi
  call   <strtok@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L67
  mov    $0x0,%r12d
  mov    $0x0,%ebx
  lea    D13(%rip),%r15
L44:
  mov    %r12d,%edx
  add    $0x1,%r12d
  mov    0x0(%r13),%eax
  lea    0x2(%rdx,%rax,1),%esi
  shl    $0x3,%esi
  mov    %rbx,%rdi
  call   <realloc@plt>
  mov    %eax,%edi
  mov    $0x39,%edx
  mov    %r15,%rsi
  call   <do_nofail@plt>
  mov    %rax,%rbx
  mov    %r12d,%eax
  mov    %rbp,(%rbx,%rax,8)
  lea    D5(%rip),%rsi
  mov    $0x0,%edi
  call   <strtok@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  jne    L44
  test   %rbx,%rbx
  je     L58
  mov    (%r14),%rax
  mov    %rax,(%rbx)
  cmpl   $0x0,0x0(%r13)
  je     L70
  mov    $0x1,%eax
L66:
  mov    %eax,%edx
  mov    (%r14,%rdx,8),%rcx
  lea    (%r12,%rax,1),%edx
  mov    %rcx,(%rbx,%rdx,8)
  add    $0x1,%eax
  mov    0x0(%r13),%edx
  cmp    %eax,%edx
  jae    L66
L60:
  add    %edx,%r12d
  mov    %r12d,0x0(%r13)
L67:
  mov    %rbx,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L70:
  mov    $0x0,%edx
  jmp    L60
L58:
  mov    %r14,%rbx
  jmp    L67
```

tool_calls: name: parse_data
arguments: tag: D13
type_infered: string
name: parse_data
arguments: tag: D5
type_infered: string

tool: D13: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/10w01/buildroot/refs/heads/2013.11-Amlogic/DroneOS/buildroot/package/mkpasswd/utils.c

tool: D5:  

assistant: ```c
char **merge_args(char *args, char *argv[], int *argc) {
  char *arg, *argstring;
  char **newargs = NULL;
  unsigned int i, num_env = 0;
  if (!args)
    return argv;
  argstring = do_nofail((strdup(args)), "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/10w01/buildroot/refs/heads/2013.11-Amlogic/DroneOS/buildroot/package/mkpasswd/utils.c", 54);
  for (arg = strtok(argstring, " "); arg; arg = strtok(NULL, " ")) {
    num_env++;
    newargs = do_nofail((realloc(newargs, sizeof(newargs[0]) * (num_env + *argc + 1))), "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/10w01/buildroot/refs/heads/2013.11-Amlogic/DroneOS/buildroot/package/mkpasswd/utils.c", 57);
    newargs[num_env] = arg;
  }
  if (!newargs)
    return argv;
  newargs[0] = argv[0];
  for (i = 1; i <= *argc; i++)
    newargs[num_env + i] = argv[i];
  *argc += num_env;
  return newargs;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<merge_args>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rsi,0x8(%rsp)
  test   %rdi,%rdi
  je     L17
  mov    %rdx,%r13
  lea    D1(%rip),%r14
  lea    D17(%rip),%r15
  call   <strdup@plt>
  mov    $0x36,%edx
  mov    %r14,%rsi
  mov    %eax,%edi
  call   <do_nofail@plt>
  mov    %r15,%rsi
  mov    %rax,%rdi
  call   <strtok@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L17
  xor    %r12d,%r12d
  xor    %ebp,%ebp
  nopl   0x0(%rax)
L46:
  mov    0x0(%r13),%eax
  mov    %r12d,%edx
  mov    %rbp,%rdi
  add    $0x1,%r12d
  lea    0x2(%rdx,%rax,1),%esi
  shl    $0x3,%esi
  call   <realloc@plt>
  mov    $0x39,%edx
  mov    %r14,%rsi
  mov    %eax,%edi
  call   <do_nofail@plt>
  mov    %r15,%rsi
  xor    %edi,%edi
  mov    %rax,%rbp
  mov    %r12d,%eax
  mov    %rbx,0x0(%rbp,%rax,8)
  call   <strtok@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  jne    L46
  test   %rbp,%rbp
  je     L17
  mov    0x8(%rsp),%rax
  mov    0x0(%r13),%edi
  mov    (%rax),%rax
  mov    %rax,0x0(%rbp)
  test   %edi,%edi
  je     L12
  mov    $0x1,%eax
  nopl   0x0(%rax)
L44:
  mov    0x8(%rsp),%rcx
  mov    %eax,%edx
  mov    (%rcx,%rdx,8),%rsi
  lea    (%r12,%rax,1),%edx
  add    $0x1,%eax
  mov    %rsi,0x0(%rbp,%rdx,8)
  cmp    %edi,%eax
  jbe    L44
  add    %edi,%r12d
L12:
  mov    %r12d,0x0(%r13)
L30:
  add    $0x18,%rsp
  mov    %rbp,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L17:
  mov    0x8(%rsp),%rbp
  jmp    L30
```

tool_calls: name: read_data
arguments: data_tag: D1
datatype: string
name: read_data
arguments: data_tag: D17
datatype: string

tool: D1: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/10w01/buildroot/refs/heads/2013.11-Amlogic/DroneOS/buildroot/package/mkpasswd/utils.c

tool: D17:  

assistant: ```c
char **merge_args(char *args, char *argv[], int *argc) {
  char *arg, *argstring;
  char **newargs = NULL;
  unsigned int i, num_env = 0;
  if (!args)
    return argv;
  argstring = do_nofail((strdup(args)), "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/10w01/buildroot/refs/heads/2013.11-Amlogic/DroneOS/buildroot/package/mkpasswd/utils.c", 54);
  for (arg = strtok(argstring, " "); arg; arg = strtok(NULL, " ")) {
    num_env++;
    newargs = do_nofail((realloc(newargs, sizeof(newargs[0]) * (num_env + *argc + 1))), "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/10w01/buildroot/refs/heads/2013.11-Amlogic/DroneOS/buildroot/package/mkpasswd/utils.c", 57);
    newargs[num_env] = arg;
  }
  if (!newargs)
    return argv;
  newargs[0] = argv[0];
  for (i = 1; i <= *argc; i++)
    newargs[num_env + i] = argv[i];
  *argc += num_env;
  return newargs;
}
```
user: Translate the below assembly code into C programming language:

```asm
<merge_args>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rsi,0x8(%rsp)
  test   %rdi,%rdi
  je     L45
  mov    %rdx,%r13
  lea    D2(%rip),%r14
  lea    D1(%rip),%r15
  call   <strdup@plt>
  mov    $0x36,%edx
  mov    %r14,%rsi
  mov    %eax,%edi
  call   <do_nofail@plt>
  mov    %r15,%rsi
  mov    %rax,%rdi
  call   <strtok@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L45
  xor    %r12d,%r12d
  xor    %ebp,%ebp
  nopl   0x0(%rax)
L48:
  mov    0x0(%r13),%eax
  mov    %r12d,%edx
  mov    %rbp,%rdi
  add    $0x1,%r12d
  lea    0x2(%rdx,%rax,1),%esi
  shl    $0x3,%esi
  call   <realloc@plt>
  mov    $0x39,%edx
  mov    %r14,%rsi
  mov    %eax,%edi
  call   <do_nofail@plt>
  mov    %r15,%rsi
  xor    %edi,%edi
  mov    %rax,%rbp
  mov    %r12d,%eax
  mov    %rbx,0x0(%rbp,%rax,8)
  call   <strtok@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  jne    L48
  test   %rbp,%rbp
  je     L45
  mov    0x8(%rsp),%rax
  mov    0x0(%r13),%edi
  mov    (%rax),%rax
  mov    %rax,0x0(%rbp)
  test   %edi,%edi
  je     L12
  mov    $0x1,%eax
  nopl   0x0(%rax)
L13:
  mov    0x8(%rsp),%rcx
  mov    %eax,%edx
  mov    (%rcx,%rdx,8),%rsi
  lea    (%r12,%rax,1),%edx
  add    $0x1,%eax
  mov    %rsi,0x0(%rbp,%rdx,8)
  cmp    %edi,%eax
  jbe    L13
  add    %edi,%r12d
L12:
  mov    %r12d,0x0(%r13)
L7:
  add    $0x18,%rsp
  mov    %rbp,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L45:
  mov    0x8(%rsp),%rbp
  jmp    L7
```

tool_calls: name: parse_data
arguments: data_tag: D2
type: string
name: parse_data
arguments: data_tag: D1
type: string

tool: D2: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/10w01/buildroot/refs/heads/2013.11-Amlogic/DroneOS/buildroot/package/mkpasswd/utils.c

tool: D1:  

assistant: ```c
char **merge_args(char *args, char *argv[], int *argc) {
  char *arg, *argstring;
  char **newargs = NULL;
  unsigned int i, num_env = 0;
  if (!args)
    return argv;
  argstring = do_nofail((strdup(args)), "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/10w01/buildroot/refs/heads/2013.11-Amlogic/DroneOS/buildroot/package/mkpasswd/utils.c", 54);
  for (arg = strtok(argstring, " "); arg; arg = strtok(NULL, " ")) {
    num_env++;
    newargs = do_nofail((realloc(newargs, sizeof(newargs[0]) * (num_env + *argc + 1))), "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/10w01/buildroot/refs/heads/2013.11-Amlogic/DroneOS/buildroot/package/mkpasswd/utils.c", 57);
    newargs[num_env] = arg;
  }
  if (!newargs)
    return argv;
  newargs[0] = argv[0];
  for (i = 1; i <= *argc; i++)
    newargs[num_env + i] = argv[i];
  *argc += num_env;
  return newargs;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<getCRC>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x840,%rsp
  mov    %rdi,-0x828(%rbp)
  mov    %rsi,-0x830(%rbp)
  mov    %rdx,-0x838(%rbp)
  mov    %rcx,-0x840(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x818(%rbp)
  lea    -0x810(%rbp),%rax
  mov    $0xedb88320,%esi
  mov    %rax,%rdi
  call   <makeCRCtable@plt>
  notq   -0x818(%rbp)
  movl   $0x0,-0x81c(%rbp)
  jmp    L21
L11:
  mov    -0x81c(%rbp),%eax
  cltq
  lea    (%rax,%rax,1),%rdx
  mov    -0x828(%rbp),%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  mov    %al,-0x81e(%rbp)
  mov    -0x81c(%rbp),%eax
  cltq
  lea    (%rax,%rax,1),%rdx
  mov    -0x828(%rbp),%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  shr    $0x8,%ax
  mov    %al,-0x81d(%rbp)
  movzbl -0x81e(%rbp),%eax
  xor    -0x818(%rbp),%rax
  movzbl %al,%eax
  mov    -0x810(%rbp,%rax,8),%rdx
  mov    -0x818(%rbp),%rax
  shr    $0x8,%rax
  xor    %rdx,%rax
  mov    %rax,-0x818(%rbp)
  movzbl -0x81d(%rbp),%eax
  xor    -0x818(%rbp),%rax
  movzbl %al,%eax
  mov    -0x810(%rbp,%rax,8),%rdx
  mov    -0x818(%rbp),%rax
  shr    $0x8,%rax
  xor    %rdx,%rax
  mov    %rax,-0x818(%rbp)
  addl   $0x1,-0x81c(%rbp)
L21:
  mov    -0x81c(%rbp),%eax
  cltq
  cmp    %rax,-0x830(%rbp)
  jg     L11
  notq   -0x818(%rbp)
  cmpq   $0x0,-0x838(%rbp)
  je     L28
  mov    -0x818(%rbp),%rax
  shr    $0x10,%rax
  mov    %eax,%edx
  mov    -0x838(%rbp),%rax
  mov    %dx,(%rax)
L28:
  cmpq   $0x0,-0x840(%rbp)
  je     L27
  mov    -0x818(%rbp),%rax
  mov    %eax,%edx
  mov    -0x840(%rbp),%rax
  mov    %dx,(%rax)
L27:
  mov    -0x818(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L41
  call   <__stack_chk_fail@plt>
L41:
  leave
  ret
```

assistant: ```c
unsigned long getCRC(volatile unsigned short *mem, signed long count, volatile unsigned short *crcH, volatile unsigned short *crcL) {
  unsigned char mem0, mem1;
  int i;
  unsigned long CRC = 0;
  unsigned long table[256];
  makeCRCtable(table, 0xEDB88320);
  CRC = ~CRC;
  for (i = 0; i < count; i++) {
    mem0 = (unsigned char)(mem[i] & 0x00ff);
    mem1 = (unsigned char)((mem[i] >> 8) & 0x00ff);
    CRC = table[(CRC ^ (mem0)) & 0xFF] ^ (CRC >> 8);
    CRC = table[(CRC ^ (mem1)) & 0xFF] ^ (CRC >> 8);
  }
  CRC = ~CRC;
  if (crcH)
    *crcH = (unsigned short)((CRC >> 16) & (0x0000ffff));
  if (crcL)
    *crcL = (unsigned short)((CRC) & (0x0000ffff));
  return CRC;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<getCRC>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x818,%rsp
  mov    %rdi,%r13
  mov    %rsi,%r12
  mov    %rdx,%rbp
  mov    %rcx,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x808(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  mov    $0xedb88320,%esi
  call   <makeCRCtable@plt>
  test   %r12,%r12
  jle    L57
  mov    %r13,%rsi
  lea    0x0(%r13,%r12,2),%rdi
  mov    $0xffffffffffffffff,%rax
L20:
  movzwl (%rsi),%ecx
  movzwl (%rsi),%edx
  xor    %eax,%ecx
  movzbl %cl,%ecx
  shr    $0x8,%rax
  xor    (%rsp,%rcx,8),%rax
  shr    $0x8,%dx
  xor    %eax,%edx
  movzbl %dl,%edx
  shr    $0x8,%rax
  xor    (%rsp,%rdx,8),%rax
  add    $0x2,%rsi
  cmp    %rdi,%rsi
  jne    L20
L41:
  not    %rax
  test   %rbp,%rbp
  je     L24
  mov    %rax,%rdx
  shr    $0x10,%rdx
  mov    %dx,0x0(%rbp)
L24:
  test   %rbx,%rbx
  je     L46
  mov    %ax,(%rbx)
L46:
  mov    0x808(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L11
  add    $0x818,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L57:
  mov    $0xffffffffffffffff,%rax
  jmp    L41
L11:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
unsigned long getCRC(volatile unsigned short *mem, signed long count, volatile unsigned short *crcH, volatile unsigned short *crcL) {
  unsigned char mem0, mem1;
  int i;
  unsigned long CRC = 0;
  unsigned long table[256];
  makeCRCtable(table, 0xEDB88320);
  CRC = ~CRC;
  for (i = 0; i < count; i++) {
    mem0 = (unsigned char)(mem[i] & 0x00ff);
    mem1 = (unsigned char)((mem[i] >> 8) & 0x00ff);
    CRC = table[(CRC ^ (mem0)) & 0xFF] ^ (CRC >> 8);
    CRC = table[(CRC ^ (mem1)) & 0xFF] ^ (CRC >> 8);
  }
  CRC = ~CRC;
  if (crcH)
    *crcH = (unsigned short)((CRC >> 16) & (0x0000ffff));
  if (crcL)
    *crcL = (unsigned short)((CRC) & (0x0000ffff));
  return CRC;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<getCRC>:
  endbr64
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rsi,%r12
  mov    $0xedb88320,%esi
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x818,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x808(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  call   <makeCRCtable@plt>
  test   %r12,%r12
  jle    L26
  mov    %r13,%rdi
  lea    0x0(%r13,%r12,2),%rsi
  mov    $0xffffffffffffffff,%rax
  nopl   (%rax)
L52:
  movzwl (%rdi),%ecx
  movzwl (%rdi),%edx
  add    $0x2,%rdi
  xor    %eax,%ecx
  shr    $0x8,%dx
  movzbl %cl,%ecx
  shr    $0x8,%rax
  xor    (%rsp,%rcx,8),%rax
  xor    %eax,%edx
  shr    $0x8,%rax
  movzbl %dl,%edx
  xor    (%rsp,%rdx,8),%rax
  cmp    %rsi,%rdi
  jne    L52
  not    %rax
L49:
  test   %rbx,%rbx
  je     L33
  mov    %rax,%rdx
  shr    $0x10,%rdx
  mov    %dx,(%rbx)
L33:
  test   %rbp,%rbp
  je     L29
  mov    %ax,0x0(%rbp)
L29:
  mov    0x808(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L40
  add    $0x818,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L26:
  xor    %eax,%eax
  jmp    L49
L40:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
unsigned long getCRC(volatile unsigned short *mem, signed long count, volatile unsigned short *crcH, volatile unsigned short *crcL) {
  unsigned char mem0, mem1;
  int i;
  unsigned long CRC = 0;
  unsigned long table[256];
  makeCRCtable(table, 0xEDB88320);
  CRC = ~CRC;
  for (i = 0; i < count; i++) {
    mem0 = (unsigned char)(mem[i] & 0x00ff);
    mem1 = (unsigned char)((mem[i] >> 8) & 0x00ff);
    CRC = table[(CRC ^ (mem0)) & 0xFF] ^ (CRC >> 8);
    CRC = table[(CRC ^ (mem1)) & 0xFF] ^ (CRC >> 8);
  }
  CRC = ~CRC;
  if (crcH)
    *crcH = (unsigned short)((CRC >> 16) & (0x0000ffff));
  if (crcL)
    *crcL = (unsigned short)((CRC) & (0x0000ffff));
  return CRC;
}
```
user: Translate the below assembly code into C programming language:

```asm
<getCRC>:
  endbr64
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rsi,%r12
  mov    $0xedb88320,%esi
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x818,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x808(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  call   <makeCRCtable@plt>
  test   %r12,%r12
  jle    L30
  mov    %r13,%rdi
  lea    0x0(%r13,%r12,2),%rsi
  mov    $0xffffffffffffffff,%rax
  nopl   (%rax)
L21:
  movzwl (%rdi),%ecx
  movzwl (%rdi),%edx
  add    $0x2,%rdi
  xor    %eax,%ecx
  shr    $0x8,%dx
  movzbl %cl,%ecx
  shr    $0x8,%rax
  xor    (%rsp,%rcx,8),%rax
  xor    %eax,%edx
  shr    $0x8,%rax
  movzbl %dl,%edx
  xor    (%rsp,%rdx,8),%rax
  cmp    %rdi,%rsi
  jne    L21
  not    %rax
L11:
  test   %rbx,%rbx
  je     L9
  mov    %rax,%rdx
  shr    $0x10,%rdx
  mov    %dx,(%rbx)
L9:
  test   %rbp,%rbp
  je     L14
  mov    %ax,0x0(%rbp)
L14:
  mov    0x808(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L53
  add    $0x818,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L30:
  xor    %eax,%eax
  jmp    L11
L53:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
unsigned long getCRC(volatile unsigned short *mem, signed long count, volatile unsigned short *crcH, volatile unsigned short *crcL) {
  unsigned char mem0, mem1;
  int i;
  unsigned long CRC = 0;
  unsigned long table[256];
  makeCRCtable(table, 0xEDB88320);
  CRC = ~CRC;
  for (i = 0; i < count; i++) {
    mem0 = (unsigned char)(mem[i] & 0x00ff);
    mem1 = (unsigned char)((mem[i] >> 8) & 0x00ff);
    CRC = table[(CRC ^ (mem0)) & 0xFF] ^ (CRC >> 8);
    CRC = table[(CRC ^ (mem1)) & 0xFF] ^ (CRC >> 8);
  }
  CRC = ~CRC;
  if (crcH)
    *crcH = (unsigned short)((CRC >> 16) & (0x0000ffff));
  if (crcL)
    *crcL = (unsigned short)((CRC) & (0x0000ffff));
  return CRC;
}
```