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

```asm
<calcCRC>:
  endbr64
  cmp    $0x2,%esi
  jle    L29
  lea    -0x3(%rsi),%eax
  lea    0x2(%rdi),%r9
  mov    $0xfffffffe,%r11d
  push   %rbx
  sub    %r9d,%r11d
  lea    0x3(%rdi,%rax,1),%rbx
  mov    $0xffff,%eax
  nopl   0x0(%rax)
L39:
  lea    (%r11,%r9,1),%edx
  cmp    $0x1,%edx
  jbe    L1
  movsbl (%r9),%r10d
  mov    $0x8,%ecx
  mov    $0x80,%edx
  nop
L17:
  mov    %eax,%esi
  add    %eax,%eax
  and    $0x8000,%esi
  test   %esi,%esi
  mov    %eax,%esi
  sete   %r8b
  test   %edx,%r10d
  sete   %dil
  xor    $0x8005,%esi
  cmp    %dil,%r8b
  cmovne %esi,%eax
  sar    %edx
  sub    $0x1,%ecx
  jne    L17
L1:
  add    $0x1,%r9
  cmp    %rbx,%r9
  jne    L39
  movzwl %ax,%eax
  pop    %rbx
  ret
L29:
  mov    $0xffff,%eax
  ret
```

assistant: ```c
int calcCRC(char *pData, int size) {
  int i;
  int crc = 0xffff;
  int masking;
  int carry;
  int data;
  for (i = 2; i < size; i++) {
    if (i != 4 && i != 5) {
      masking = 1 << 8;
      data = pData[i];
      while (masking >>= 1) {
        carry = crc & 0x8000;
        crc <<= 1;
        if (!carry ^ !(data & masking))
          crc ^= 0x8005;
      }
    }
  }
  crc &= 0xffff;
  return crc;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<calcCRC>:
  endbr64
  cmp    $0x2,%esi
  jle    L1
  lea    -0x3(%rsi),%eax
  lea    0x2(%rdi),%rcx
  mov    $0xfffffffe,%esi
  lea    0x3(%rdi,%rax,1),%r8
  sub    %ecx,%esi
  mov    $0xffff,%eax
  nopl   (%rax)
L21:
  lea    (%rsi,%rcx,1),%edx
  cmp    $0x1,%edx
  jbe    L23
  movzbl (%rcx),%edi
  lea    (%rax,%rax,1),%edx
  shr    $0xf,%eax
  xor    $0x1,%eax
  mov    %edx,%r10d
  mov    %edi,%r9d
  and    $0x1,%eax
  xor    $0x8005,%r10d
  not    %r9d
  mov    %r9d,%r11d
  shr    $0x7,%r11b
  cmp    %al,%r11b
  cmovne %r10d,%edx
  lea    (%rdx,%rdx,1),%eax
  shr    $0xf,%edx
  xor    $0x1,%edx
  mov    %eax,%r10d
  and    $0x1,%edx
  test   $0x40,%dil
  sete   %r11b
  xor    $0x8005,%r10d
  cmp    %r11b,%dl
  cmovne %r10d,%eax
  lea    (%rax,%rax,1),%edx
  shr    $0xf,%eax
  xor    $0x1,%eax
  mov    %edx,%r10d
  and    $0x1,%eax
  test   $0x20,%dil
  sete   %r11b
  xor    $0x8005,%r10d
  cmp    %r11b,%al
  cmovne %r10d,%edx
  lea    (%rdx,%rdx,1),%eax
  shr    $0xf,%edx
  xor    $0x1,%edx
  mov    %eax,%r10d
  and    $0x1,%edx
  test   $0x10,%dil
  sete   %r11b
  xor    $0x8005,%r10d
  cmp    %r11b,%dl
  cmovne %r10d,%eax
  lea    (%rax,%rax,1),%edx
  shr    $0xf,%eax
  xor    $0x1,%eax
  mov    %edx,%r10d
  and    $0x1,%eax
  test   $0x8,%dil
  sete   %r11b
  xor    $0x8005,%r10d
  cmp    %r11b,%al
  cmovne %r10d,%edx
  lea    (%rdx,%rdx,1),%eax
  shr    $0xf,%edx
  xor    $0x1,%edx
  mov    %eax,%r10d
  and    $0x1,%edx
  test   $0x4,%dil
  sete   %r11b
  xor    $0x8005,%r10d
  cmp    %r11b,%dl
  cmovne %r10d,%eax
  lea    (%rax,%rax,1),%edx
  shr    $0xf,%eax
  xor    $0x1,%eax
  and    $0x1,%eax
  and    $0x2,%edi
  mov    %edx,%edi
  sete   %r10b
  xor    $0x8005,%edi
  cmp    %r10b,%al
  cmovne %edi,%edx
  and    $0x1,%r9d
  lea    (%rdx,%rdx,1),%eax
  shr    $0xf,%edx
  xor    $0x1,%edx
  mov    %eax,%edi
  and    $0x1,%edx
  xor    $0x8005,%edi
  cmp    %dl,%r9b
  cmovne %edi,%eax
L23:
  add    $0x1,%rcx
  cmp    %r8,%rcx
  jne    L21
  movzwl %ax,%eax
  ret
L1:
  mov    $0xffff,%eax
  ret
```

assistant: ```c
int calcCRC(char *pData, int size) {
  int i;
  int crc = 0xffff;
  int masking;
  int carry;
  int data;
  for (i = 2; i < size; i++) {
    if (i != 4 && i != 5) {
      masking = 1 << 8;
      data = pData[i];
      while (masking >>= 1) {
        carry = crc & 0x8000;
        crc <<= 1;
        if (!carry ^ !(data & masking))
          crc ^= 0x8005;
      }
    }
  }
  crc &= 0xffff;
  return crc;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<fpext>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    $0x2e,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L1
  mov    -0x8(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  jne    L3
L1:
  lea    D0(%rip),%rax
  jmp    L0
L3:
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
L0:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: label: D0
type: string

tool: 

assistant: ```c
const char *fpext(const char *filename) {
  const char *dot = strchr(filename, '.');
  if (!dot || dot == filename)
    return "";
  return dot + 1;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<fpext>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  mov    $0x2e,%esi
  call   <strchr@plt>
  test   %rax,%rax
  je     L23
  cmp    %rax,%rbx
  je     L23
  add    $0x1,%rax
L5:
  pop    %rbx
  ret
L23:
  lea    D6(%rip),%rax
  jmp    L5
```

tool_calls: name: unpack_data
arguments: label: D6
type: string

tool: 

assistant: ```c
const char *fpext(const char *filename) {
  const char *dot = strchr(filename, '.');
  if (!dot || dot == filename)
    return "";
  return dot + 1;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<fpext>:
  endbr64
  push   %rbx
  mov    $0x2e,%esi
  mov    %rdi,%rbx
  call   <strchr@plt>
  test   %rax,%rax
  je     L17
  cmp    %rax,%rbx
  je     L17
  add    $0x1,%rax
  pop    %rbx
  ret
  nopw   0x0(%rax,%rax,1)
L17:
  lea    D9(%rip),%rax
  pop    %rbx
  ret
```

tool_calls: name: parse_data
arguments: data_label: D9
type_guessed: string

tool: 

assistant: ```c
const char *fpext(const char *filename) {
  const char *dot = strchr(filename, '.');
  if (!dot || dot == filename)
    return "";
  return dot + 1;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<fpext>:
  endbr64
  push   %rbx
  mov    $0x2e,%esi
  mov    %rdi,%rbx
  call   <strchr@plt>
  test   %rax,%rax
  je     L0
  cmp    %rax,%rbx
  je     L0
  add    $0x1,%rax
  pop    %rbx
  ret
  nopw   0x0(%rax,%rax,1)
L0:
  lea    D9(%rip),%rax
  pop    %rbx
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D9
datatype: string

tool: 

assistant: ```c
const char *fpext(const char *filename) {
  const char *dot = strchr(filename, '.');
  if (!dot || dot == filename)
    return "";
  return dot + 1;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<memcpy>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %edx,-0x44(%rbp)
  mov    -0x38(%rbp),%rax
  cltq
  and    $0x3,%eax
  test   %rax,%rax
  jne    L58
  mov    -0x40(%rbp),%rax
  cltq
  and    $0x3,%eax
  test   %rax,%rax
  jne    L58
  mov    -0x44(%rbp),%eax
  cltq
  and    $0x3,%eax
  test   %rax,%rax
  jne    L58
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L3
L26:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x24(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x20(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x24(%rbp)
L3:
  mov    -0x24(%rbp),%eax
  cltq
  mov    -0x44(%rbp),%edx
  movslq %edx,%rdx
  shr    $0x2,%rdx
  cmp    %rdx,%rax
  jb     L26
  jmp    L55
L58:
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L8
L0:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    -0x24(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x10(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x24(%rbp)
L8:
  mov    -0x24(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jl     L0
L55:
  mov    -0x38(%rbp),%rax
  pop    %rbp
  ret
```

assistant: ```c
void *memcpy(void *destination, const void *source, uint64_t length) {
  uint64_t i;
  if ((uint64_t)destination % sizeof(uint32_t) == 0 && (uint64_t)source % sizeof(uint32_t) == 0 && length % sizeof(uint32_t) == 0) {
    uint32_t *d = (uint32_t *)destination;
    const uint32_t *s = (const uint32_t *)source;
    for (i = 0; i < length / sizeof(uint32_t); i++)
      d[i] = s[i];
  } else {
    uint8_t *d = (uint8_t *)destination;
    const uint8_t *s = (const uint8_t *)source;
    for (i = 0; i < length; i++)
      d[i] = s[i];
  }
  return destination;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<memcpy>:
  endbr64
  mov    %rdi,%rax
  mov    %rdi,%rcx
  or     %rsi,%rcx
  and    $0x3,%ecx
  je     L56
L2:
  mov    %edx,%edi
  mov    $0x0,%ecx
  test   %edx,%edx
  jle    L40
L42:
  mov    (%rsi,%rcx,4),%edx
  mov    %edx,(%rax,%rcx,4)
  add    $0x1,%rcx
  cmp    %rcx,%rdi
  jne    L42
L38:
  ret
L40:
  ret
L56:
  test   $0x3,%dl
  jne    L2
  movslq %edx,%rdx
  mov    %rdx,%rdi
  shr    $0x2,%rdi
  cmp    $0x3,%rdx
  jbe    L38
L49:
  mov    (%rsi,%rcx,4),%edx
  mov    %edx,(%rax,%rcx,4)
  add    $0x1,%rcx
  cmp    %rdi,%rcx
  jb     L49
  ret
```

assistant: ```c
void *memcpy(void *destination, const void *source, uint64_t length) {
  uint64_t i;
  if ((uint64_t)destination % sizeof(uint32_t) == 0 && (uint64_t)source % sizeof(uint32_t) == 0 && length % sizeof(uint32_t) == 0) {
    uint32_t *d = (uint32_t *)destination;
    const uint32_t *s = (const uint32_t *)source;
    for (i = 0; i < length / sizeof(uint32_t); i++)
      d[i] = s[i];
  } else {
    uint8_t *d = (uint8_t *)destination;
    const uint8_t *s = (const uint8_t *)source;
    for (i = 0; i < length; i++)
      d[i] = s[i];
  }
  return destination;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<memcpy>:
  endbr64
  mov    %rdi,%rax
  mov    %rdi,%r8
  or     %rsi,%rax
  and    $0x3,%eax
  je     L56
L29:
  movslq %edx,%rcx
  xor    %eax,%eax
  test   %edx,%edx
  jle    L31
  nopl   0x0(%rax,%rax,1)
L54:
  mov    (%rsi,%rax,4),%edx
  mov    %edx,(%r8,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%rcx
  jne    L54
L31:
  mov    %r8,%rax
  ret
  nopl   0x0(%rax)
L56:
  test   $0x3,%dl
  jne    L29
  movslq %edx,%rdx
  shr    $0x2,%rdx
  je     L31
  shl    $0x2,%rdx
  nopw   0x0(%rax,%rax,1)
L37:
  mov    (%rsi,%rax,1),%ecx
  mov    %ecx,(%r8,%rax,1)
  add    $0x4,%rax
  cmp    %rax,%rdx
  jne    L37
  mov    %r8,%rax
  ret
```

assistant: ```c
void *memcpy(void *destination, const void *source, uint64_t length) {
  uint64_t i;
  if ((uint64_t)destination % sizeof(uint32_t) == 0 && (uint64_t)source % sizeof(uint32_t) == 0 && length % sizeof(uint32_t) == 0) {
    uint32_t *d = (uint32_t *)destination;
    const uint32_t *s = (const uint32_t *)source;
    for (i = 0; i < length / sizeof(uint32_t); i++)
      d[i] = s[i];
  } else {
    uint8_t *d = (uint8_t *)destination;
    const uint8_t *s = (const uint8_t *)source;
    for (i = 0; i < length; i++)
      d[i] = s[i];
  }
  return destination;
}
```
user: What is the c source code of the assembly code below:

```asm
<memcpy>:
  endbr64
  mov    %rdi,%rax
  mov    %rdi,%r8
  mov    %rsi,%rcx
  or     %rsi,%rax
  and    $0x3,%eax
  je     L98
L199:
  test   %edx,%edx
  jle    L128
  lea    0x4(%rcx),%rsi
  mov    %r8,%rax
  sub    %rsi,%rax
  cmp    $0x8,%rax
  jbe    L89
  lea    -0x1(%rdx),%eax
  cmp    $0x2,%eax
  jbe    L89
  mov    %edx,%esi
  xor    %eax,%eax
  shr    $0x2,%esi
  shl    $0x4,%rsi
  nopl   0x0(%rax)
L72:
  movdqu (%rcx,%rax,1),%xmm0
  movups %xmm0,(%r8,%rax,1)
  add    $0x10,%rax
  cmp    %rsi,%rax
  jne    L72
  mov    %edx,%eax
  and    $0xfffffffc,%eax
  test   $0x3,%dl
  je     L128
  mov    %eax,%edi
  mov    (%rcx,%rdi,4),%r9d
  lea    0x0(,%rdi,4),%rsi
  mov    %r9d,(%r8,%rdi,4)
  lea    0x1(%rax),%edi
  cmp    %edi,%edx
  jle    L128
  mov    0x4(%rcx,%rsi,1),%edi
  add    $0x2,%eax
  mov    %edi,0x4(%r8,%rsi,1)
  cmp    %eax,%edx
  jle    L128
  mov    0x8(%rcx,%rsi,1),%eax
  mov    %eax,0x8(%r8,%rsi,1)
L128:
  mov    %r8,%rax
  ret
  nopl   0x0(%rax,%rax,1)
L98:
  test   $0x3,%dl
  jne    L199
  movslq %edx,%rdx
  mov    %rdx,%rsi
  shr    $0x2,%rsi
  je     L128
  lea    0x4(%rcx),%r9
  sub    %r9,%rdi
  cmp    $0x8,%rdi
  jbe    L8
  lea    -0x1(%rsi),%rdi
  cmp    $0x2,%rdi
  jbe    L8
  mov    %rdx,%rdi
  and    $0xfffffffffffffff0,%rdx
  shr    $0x4,%rdi
  nopw   0x0(%rax,%rax,1)
L80:
  movdqu (%rcx,%rax,1),%xmm1
  movups %xmm1,(%r8,%rax,1)
  add    $0x10,%rax
  cmp    %rax,%rdx
  jne    L80
  lea    0x0(,%rdi,4),%rax
  cmp    %rax,%rsi
  je     L128
  shl    $0x4,%rdi
  mov    (%rcx,%rdi,1),%edx
  mov    %edx,(%r8,%rdi,1)
  lea    0x1(%rax),%edx
  movslq %edx,%rdx
  cmp    %rdx,%rsi
  jbe    L128
  mov    (%rcx,%rdx,4),%r9d
  add    $0x2,%eax
  lea    0x0(,%rdx,4),%rdi
  cltq
  mov    %r9d,(%r8,%rdx,4)
  cmp    %rax,%rsi
  jbe    L128
  mov    0x4(%rcx,%rdi,1),%eax
  mov    %eax,0x4(%r8,%rdi,1)
  jmp    L128
  cs nopw 0x0(%rax,%rax,1)
L89:
  mov    %edx,%edx
  xor    %eax,%eax
  nopl   0x0(%rax)
L168:
  mov    (%rcx,%rax,4),%esi
  mov    %esi,(%r8,%rax,4)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L168
  mov    %r8,%rax
  ret
L8:
  shl    $0x2,%rsi
L109:
  mov    (%rcx,%rax,1),%edx
  mov    %edx,(%r8,%rax,1)
  add    $0x4,%rax
  cmp    %rsi,%rax
  jne    L109
  jmp    L128
```

assistant: ```c
void *memcpy(void *destination, const void *source, uint64_t length) {
  uint64_t i;
  if ((uint64_t)destination % sizeof(uint32_t) == 0 && (uint64_t)source % sizeof(uint32_t) == 0 && length % sizeof(uint32_t) == 0) {
    uint32_t *d = (uint32_t *)destination;
    const uint32_t *s = (const uint32_t *)source;
    for (i = 0; i < length / sizeof(uint32_t); i++)
      d[i] = s[i];
  } else {
    uint8_t *d = (uint8_t *)destination;
    const uint8_t *s = (const uint8_t *)source;
    for (i = 0; i < length; i++)
      d[i] = s[i];
  }
  return destination;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  lea    D3(%rip),%rax
  mov    %rax,-0x8(%rbp)
  nop
L8:
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <corta_string@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  jne    L8
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <corta_string@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: read_data
arguments: data_tag: D3
datatype: string
name: read_data
arguments: data_tag: D13
datatype: string

tool: D3: Campos verdes

tool: D13: %s


assistant: ```c
int main(void) {
  char *s = "Campos verdes";
  while (*(s = corta_string(s)) != ' ')
    ;
  s = corta_string(s);
  printf("%s\n", s);
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  lea    D13(%rip),%rdi
L1:
  call   <corta_string@plt>
  mov    %rax,%rdi
  cmpb   $0x20,(%rax)
  jne    L1
  call   <corta_string@plt>
  mov    %rax,%rsi
  lea    D7(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D13
type: string
name: disassemble_data
arguments: data_tag: D7
type: string

tool: D13: Campos verdes

tool: D7: %s


assistant: ```c
int main(void) {
  char *s = "Campos verdes";
  while (*(s = corta_string(s)) != ' ')
    ;
  s = corta_string(s);
  printf("%s\n", s);
  return 0;
}
```
user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  lea    D3(%rip),%rdi
  nop
L8:
  call   <corta_string@plt>
  cmpb   $0x20,(%rax)
  mov    %rax,%rdi
  jne    L8
  call   <corta_string@plt>
  lea    D6(%rip),%rdi
  mov    %rax,%rsi
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D3
type: string
name: unpack_data
arguments: data_label: D6
type: string

tool: D3: Campos verdes

tool: D6: %s


assistant: ```c
int main(void) {
  char *s = "Campos verdes";
  while (*(s = corta_string(s)) != ' ')
    ;
  s = corta_string(s);
  printf("%s\n", s);
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  lea    D17(%rip),%rdi
  nop
L5:
  call   <corta_string@plt>
  cmpb   $0x20,(%rax)
  mov    %rax,%rdi
  jne    L5
  call   <corta_string@plt>
  lea    D12(%rip),%rdi
  mov    %rax,%rsi
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

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

tool: D17: Campos verdes

tool: D12: %s


assistant: ```c
int main(void) {
  char *s = "Campos verdes";
  while (*(s = corta_string(s)) != ' ')
    ;
  s = corta_string(s);
  printf("%s\n", s);
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<desRound>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %ecx,%eax
  mov    %r8d,%edx
  mov    %al,-0x3c(%rbp)
  mov    %edx,%eax
  mov    %al,-0x40(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x38(%rbp),%rax
  lea    0x4(%rax),%rcx
  lea    -0x14(%rbp),%rax
  mov    $0x4,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  movzbl -0x14(%rbp),%eax
  movzbl %al,%eax
  lea    0x1(%rax),%edx
  movzbl -0x40(%rbp),%eax
  imul   %eax,%edx
  movzbl -0x14(%rbp),%eax
  movzbl %al,%eax
  add    %edx,%eax
  mov    %ax,-0x1a(%rbp)
  movzwl -0x1a(%rbp),%eax
  mov    %eax,%edx
  movzwl -0x1a(%rbp),%eax
  shr    $0x8,%ax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %al,-0x14(%rbp)
  movzwl -0x1a(%rbp),%eax
  movzbl %al,%eax
  movzwl -0x1a(%rbp),%edx
  shr    $0x8,%dx
  movzwl %dx,%edx
  sub    %edx,%eax
  test   %eax,%eax
  jns    L16
  movzbl -0x14(%rbp),%eax
  add    $0x1,%eax
  mov    %al,-0x14(%rbp)
L16:
  lea    -0x10(%rbp),%rdx
  mov    -0x30(%rbp),%rcx
  mov    -0x28(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <makeK@plt>
  lea    -0x18(%rbp),%rdx
  lea    -0x10(%rbp),%rcx
  lea    -0x14(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <desCore@plt>
  lea    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <permut32@plt>
  movzbl -0x3c(%rbp),%eax
  and    $0x8,%eax
  test   %eax,%eax
  je     L14
  movzbl -0x18(%rbp),%eax
  mov    %al,-0x1b(%rbp)
  movzbl -0x17(%rbp),%eax
  mov    %al,-0x18(%rbp)
  movzbl -0x1b(%rbp),%eax
  mov    %al,-0x17(%rbp)
L14:
  movb   $0x0,-0x1b(%rbp)
  jmp    L44
L24:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%edx
  movzbl -0x1b(%rbp),%eax
  cltq
  movzbl -0x18(%rbp,%rax,1),%eax
  xor    %eax,%edx
  mov    -0x38(%rbp),%rax
  mov    %dl,(%rax)
  addq   $0x1,-0x38(%rbp)
  movzbl -0x1b(%rbp),%eax
  add    $0x1,%eax
  mov    %al,-0x1b(%rbp)
L44:
  cmpb   $0x3,-0x1b(%rbp)
  jbe    L24
  mov    -0x38(%rbp),%rax
  lea    -0x4(%rax),%rdx
  mov    -0x38(%rbp),%rax
  mov    %rax,%rsi
  mov    %rdx,%rdi
  call   <swap@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L49
  call   <__stack_chk_fail@plt>
L49:
  leave
  ret
```

assistant: ```c
void desRound(unsigned char left[], unsigned char right[], unsigned char data[], unsigned char mode, unsigned char k8) {
  unsigned char i;
  unsigned char K[8];
  unsigned char r[4];
  unsigned char tempr[4];
  unsigned short temp;
  memcpy(tempr, data + 4, 4);
  temp = (short)k8 * (short)tempr[0] + (short)k8 + (short)tempr[0];
  tempr[0] = (temp & 0xff) - ((temp >> 8) & 0xff);
  if ((temp & 0xff) - (temp >> 8) < 0) {
    tempr[0]++;
  }
  makeK(left, right, K);
  desCore(tempr, K, r);
  permut32(r);
  if (mode & 8) {
    i = r[0];
    r[0] = r[1];
    r[1] = i;
  }
  for (i = 0; i < 4; i++) {
    *data ^= r[i];
    data++;
  }
  swap(data - 4, data);
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<desRound>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%r12
  mov    %rsi,%r14
  mov    %rdx,%rbx
  mov    %ecx,%ebp
  mov    %r8d,%r15d
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x4(%rdx),%r13
  lea    0xc(%rsp),%rdi
  mov    $0x4,%edx
  mov    %r13,%rsi
  call   <memcpy@plt>
  movzbl 0xc(%rsp),%eax
  lea    0x1(%rax),%r8d
  movzbl %r15b,%r15d
  imul   %r15d,%r8d
  add    %eax,%r8d
  mov    %r8d,%edx
  shr    $0x8,%dx
  mov    %r8d,%eax
  sub    %edx,%eax
  movzbl %r8b,%r8d
  movzwl %dx,%edx
  lea    0x1(%rax),%ecx
  cmp    %edx,%r8d
  cmovl  %ecx,%eax
  mov    %al,0xc(%rsp)
  lea    0x10(%rsp),%r15
  mov    %r15,%rdx
  mov    %r14,%rsi
  mov    %r12,%rdi
  call   <makeK@plt>
  lea    0x8(%rsp),%r12
  lea    0xc(%rsp),%rdi
  mov    %r12,%rdx
  mov    %r15,%rsi
  call   <desCore@plt>
  mov    %r12,%rdi
  call   <permut32@plt>
  test   $0x8,%bpl
  je     L8
  movzbl 0x8(%rsp),%eax
  movzbl 0x9(%rsp),%edx
  mov    %dl,0x8(%rsp)
  mov    %al,0x9(%rsp)
L8:
  mov    $0x0,%eax
L26:
  movzbl 0x8(%rsp,%rax,1),%edx
  xor    %dl,(%rbx,%rax,1)
  add    $0x1,%rax
  cmp    $0x4,%rax
  jne    L26
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <swap@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L6
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L6:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void desRound(unsigned char left[], unsigned char right[], unsigned char data[], unsigned char mode, unsigned char k8) {
  unsigned char i;
  unsigned char K[8];
  unsigned char r[4];
  unsigned char tempr[4];
  unsigned short temp;
  memcpy(tempr, data + 4, 4);
  temp = (short)k8 * (short)tempr[0] + (short)k8 + (short)tempr[0];
  tempr[0] = (temp & 0xff) - ((temp >> 8) & 0xff);
  if ((temp & 0xff) - (temp >> 8) < 0) {
    tempr[0]++;
  }
  makeK(left, right, K);
  desCore(tempr, K, r);
  permut32(r);
  if (mode & 8) {
    i = r[0];
    r[0] = r[1];
    r[1] = i;
  }
  for (i = 0; i < 4; i++) {
    *data ^= r[i];
    data++;
  }
  swap(data - 4, data);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<desRound>:
  endbr64
  push   %r15
  mov    %rsi,%r15
  push   %r14
  lea    0x4(%rdx),%r14
  push   %r13
  mov    %r14,%rsi
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  mov    %rdx,%rbp
  mov    $0x4,%edx
  push   %rbx
  mov    %r8d,%ebx
  movzbl %bl,%ebx
  sub    $0x38,%rsp
  mov    %ecx,0x4(%rsp)
  lea    0x1c(%rsp),%r12
  mov    %r12,%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  call   <memcpy@plt>
  movzbl 0x1c(%rsp),%eax
  mov    %r15,%rsi
  mov    %r13,%rdi
  lea    0x1(%rax),%r8d
  imul   %ebx,%r8d
  lea    0x18(%rsp),%rbx
  add    %eax,%r8d
  mov    %r8d,%edx
  mov    %r8d,%eax
  shr    $0x8,%dx
  sub    %edx,%eax
  cmp    %r8b,%dl
  lea    0x20(%rsp),%r8
  lea    0x1(%rax),%ecx
  mov    %r8,%rdx
  mov    %r8,0x8(%rsp)
  cmova  %ecx,%eax
  mov    %al,0x1c(%rsp)
  call   <makeK@plt>
  mov    0x8(%rsp),%rsi
  mov    %r12,%rdi
  mov    %rbx,%rdx
  call   <desCore@plt>
  mov    %rbx,%rdi
  call   <permut32@plt>
  testb  $0x8,0x4(%rsp)
  jne    L19
  movzbl 0x18(%rsp),%edx
L47:
  xor    %eax,%eax
  xor    %dl,0x0(%rbp,%rax,1)
  add    $0x1,%rax
  cmp    $0x4,%rax
  je     L3
L35:
  movzbl (%rbx,%rax,1),%edx
  xor    %dl,0x0(%rbp,%rax,1)
  add    $0x1,%rax
  cmp    $0x4,%rax
  jne    L35
L3:
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <swap@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L21
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L19:
  movzbl 0x19(%rsp),%edx
  rolw   $0x8,0x18(%rsp)
  jmp    L47
L21:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void desRound(unsigned char left[], unsigned char right[], unsigned char data[], unsigned char mode, unsigned char k8) {
  unsigned char i;
  unsigned char K[8];
  unsigned char r[4];
  unsigned char tempr[4];
  unsigned short temp;
  memcpy(tempr, data + 4, 4);
  temp = (short)k8 * (short)tempr[0] + (short)k8 + (short)tempr[0];
  tempr[0] = (temp & 0xff) - ((temp >> 8) & 0xff);
  if ((temp & 0xff) - (temp >> 8) < 0) {
    tempr[0]++;
  }
  makeK(left, right, K);
  desCore(tempr, K, r);
  permut32(r);
  if (mode & 8) {
    i = r[0];
    r[0] = r[1];
    r[1] = i;
  }
  for (i = 0; i < 4; i++) {
    *data ^= r[i];
    data++;
  }
  swap(data - 4, data);
}
```