ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Converte this assembly snippet into its equivalent C code:

```asm
<getlong>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <getc@plt>
  mov    %eax,-0x10(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <getc@plt>
  mov    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <getc@plt>
  mov    %eax,-0x8(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <getc@plt>
  mov    %eax,-0x4(%rbp)
  mov    D16(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4(%rbp)
  jne    L19
  mov    D16(%rip),%rax
  mov    (%rax),%eax
  cltq
  jmp    L12
L19:
  mov    -0x10(%rbp),%eax
  shl    $0x18,%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  shl    $0x10,%eax
  or     %eax,%edx
  mov    -0x8(%rbp),%eax
  shl    $0x8,%eax
  or     %edx,%eax
  or     -0x4(%rbp),%eax
  cltq
L12:
  leave
  ret
```

assistant: ```c
long getlong(FILE *f) {
  int ch1 = getc(f);
  int ch2 = getc(f);
  int ch3 = getc(f);
  int ch4 = getc(f);
  if (ch4 == EOF)
    return (EOF);
  return ((ch1 << 24) | (ch2 << 16) | (ch3 << 8) | ch4);
}
```
user: Translate the below assembly code into C programming language:

```asm
<getlong>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  call   <getc@plt>
  mov    %eax,%ebx
  mov    %rbp,%rdi
  call   <getc@plt>
  mov    %eax,%r13d
  mov    %rbp,%rdi
  call   <getc@plt>
  mov    %eax,%r12d
  mov    %rbp,%rdi
  call   <getc@plt>
  mov    %eax,%edx
  mov    D1(%rip),%rax
  cmp    %edx,(%rax)
  je     L19
  mov    %ebx,%eax
  shl    $0x18,%eax
  shl    $0x10,%r13d
  or     %r13d,%eax
  or     %edx,%eax
  shl    $0x8,%r12d
  or     %r12d,%eax
  cltq
L5:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L19:
  movslq %edx,%rax
  jmp    L5
```

assistant: ```c
long getlong(FILE *f) {
  int ch1 = getc(f);
  int ch2 = getc(f);
  int ch3 = getc(f);
  int ch4 = getc(f);
  if (ch4 == EOF)
    return (EOF);
  return ((ch1 << 24) | (ch2 << 16) | (ch3 << 8) | ch4);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<getlong>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  call   <getc@plt>
  mov    %rbp,%rdi
  mov    %eax,%ebx
  call   <getc@plt>
  mov    %rbp,%rdi
  mov    %eax,%r13d
  call   <getc@plt>
  mov    %rbp,%rdi
  mov    %eax,%r12d
  call   <getc@plt>
  mov    %eax,%edx
  mov    D5(%rip),%rax
  cmp    %edx,(%rax)
  je     L9
  shl    $0x10,%r13d
  mov    %ebx,%eax
  shl    $0x8,%r12d
  add    $0x8,%rsp
  shl    $0x18,%eax
  pop    %rbx
  pop    %rbp
  or     %r13d,%eax
  or     %edx,%eax
  or     %r12d,%eax
  pop    %r12
  pop    %r13
  cltq
  ret
  nopl   (%rax)
L9:
  add    $0x8,%rsp
  movslq %edx,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
long getlong(FILE *f) {
  int ch1 = getc(f);
  int ch2 = getc(f);
  int ch3 = getc(f);
  int ch4 = getc(f);
  if (ch4 == EOF)
    return (EOF);
  return ((ch1 << 24) | (ch2 << 16) | (ch3 << 8) | ch4);
}
```
user: Translate the below assembly code into C programming language:

```asm
<getlong>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  call   <getc@plt>
  mov    %rbp,%rdi
  mov    %eax,%ebx
  call   <getc@plt>
  mov    %rbp,%rdi
  mov    %eax,%r13d
  call   <getc@plt>
  mov    %rbp,%rdi
  mov    %eax,%r12d
  call   <getc@plt>
  mov    %eax,%edx
  mov    D7(%rip),%rax
  cmp    %edx,(%rax)
  je     L1
  shl    $0x10,%r13d
  mov    %ebx,%eax
  shl    $0x8,%r12d
  add    $0x8,%rsp
  shl    $0x18,%eax
  pop    %rbx
  pop    %rbp
  or     %r13d,%eax
  or     %edx,%eax
  or     %r12d,%eax
  pop    %r12
  pop    %r13
  cltq
  ret
  nopl   (%rax)
L1:
  add    $0x8,%rsp
  movslq %edx,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
long getlong(FILE *f) {
  int ch1 = getc(f);
  int ch2 = getc(f);
  int ch3 = getc(f);
  int ch4 = getc(f);
  if (ch4 == EOF)
    return (EOF);
  return ((ch1 << 24) | (ch2 << 16) | (ch3 << 8) | ch4);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<adc_reg32_reg32>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %esi,-0x8(%rbp)
  mov    $0x11,%edi
  call   <put8@plt>
  mov    -0x8(%rbp),%eax
  shl    $0x3,%eax
  or     -0x4(%rbp),%eax
  or     $0xc0,%al
  mov    %eax,%edi
  call   <put8@plt>
  nop
  leave
  ret
```

assistant: ```c
void adc_reg32_reg32(unsigned int reg1, unsigned int reg2) {
  put8(0x11);
  put8(0xC0 | (reg2 << 3) | reg1);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<adc_reg32_reg32>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebp
  mov    %esi,%ebx
  mov    $0x11,%edi
  call   <put8@plt>
  lea    0x0(,%rbx,8),%edi
  or     %ebp,%edi
  or     $0xc0,%dil
  call   <put8@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void adc_reg32_reg32(unsigned int reg1, unsigned int reg2) {
  put8(0x11);
  put8(0xC0 | (reg2 << 3) | reg1);
}
```
user: Translate the below assembly code into C programming language:

```asm
<adc_reg32_reg32>:
  endbr64
  push   %rbp
  mov    %edi,%ebp
  mov    $0x11,%edi
  push   %rbx
  mov    %esi,%ebx
  sub    $0x8,%rsp
  call   <put8@plt>
  lea    0x0(,%rbx,8),%edi
  add    $0x8,%rsp
  or     %ebp,%edi
  pop    %rbx
  pop    %rbp
  or     $0xc0,%dil
  jmp    1050 <put8@plt>
```

assistant: ```c
void adc_reg32_reg32(unsigned int reg1, unsigned int reg2) {
  put8(0x11);
  put8(0xC0 | (reg2 << 3) | reg1);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<adc_reg32_reg32>:
  endbr64
  push   %rbp
  mov    %edi,%ebp
  mov    $0x11,%edi
  push   %rbx
  mov    %esi,%ebx
  sub    $0x8,%rsp
  call   <put8@plt>
  lea    0x0(,%rbx,8),%edi
  add    $0x8,%rsp
  or     %ebp,%edi
  pop    %rbx
  pop    %rbp
  or     $0xc0,%dil
  jmp    1050 <put8@plt>
```

assistant: ```c
void adc_reg32_reg32(unsigned int reg1, unsigned int reg2) {
  put8(0x11);
  put8(0xC0 | (reg2 << 3) | reg1);
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<check_string_buffer_terminated>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  movq   $0x0,-0x8(%rbp)
  jmp    L26
L39:
  mov    -0x18(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L13
  mov    $0x1,%eax
  jmp    L18
L13:
  addq   $0x1,-0x8(%rbp)
L26:
  mov    -0x8(%rbp),%rax
  cmp    -0x20(%rbp),%rax
  jb     L39
  mov    $0x0,%eax
L18:
  pop    %rbp
  ret
```

assistant: ```c
bool check_string_buffer_terminated(const char *buf, size_t len) {
  size_t i;
  for (i = 0; i < len; i++) {
    if (buf[i] == '\0') {
      return true;
    }
  }
  return false;
}
```
user: Translate the below assembly code into C programming language:

```asm
<check_string_buffer_terminated>:
  endbr64
  test   %rsi,%rsi
  je     L20
  mov    %rdi,%rax
  add    %rsi,%rdi
L13:
  cmpb   $0x0,(%rax)
  je     L1
  add    $0x1,%rax
  cmp    %rdi,%rax
  jne    L13
  mov    $0x0,%eax
  ret
L20:
  mov    $0x0,%eax
  ret
L1:
  mov    $0x1,%eax
  ret
```

assistant: ```c
bool check_string_buffer_terminated(const char *buf, size_t len) {
  size_t i;
  for (i = 0; i < len; i++) {
    if (buf[i] == '\0') {
      return true;
    }
  }
  return false;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<check_string_buffer_terminated>:
  endbr64
  test   %rsi,%rsi
  je     L24
  add    %rdi,%rsi
  jmp    L30
  xchg   %ax,%ax
L23:
  add    $0x1,%rdi
  cmp    %rsi,%rdi
  je     L24
L30:
  cmpb   $0x0,(%rdi)
  jne    L23
  mov    $0x1,%eax
  ret
  nopl   0x0(%rax)
L24:
  xor    %eax,%eax
  ret
```

assistant: ```c
bool check_string_buffer_terminated(const char *buf, size_t len) {
  size_t i;
  for (i = 0; i < len; i++) {
    if (buf[i] == '\0') {
      return true;
    }
  }
  return false;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<check_string_buffer_terminated>:
  endbr64
  test   %rsi,%rsi
  je     L38
  add    %rdi,%rsi
  jmp    L28
  xchg   %ax,%ax
L21:
  add    $0x1,%rdi
  cmp    %rsi,%rdi
  je     L38
L28:
  cmpb   $0x0,(%rdi)
  jne    L21
  mov    $0x1,%eax
  ret
  nopl   0x0(%rax)
L38:
  xor    %eax,%eax
  ret
```

assistant: ```c
bool check_string_buffer_terminated(const char *buf, size_t len) {
  size_t i;
  for (i = 0; i < len; i++) {
    if (buf[i] == '\0') {
      return true;
    }
  }
  return false;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  movl   $0x0,-0x4(%rbp)
  nop
L6:
  cmpl   $0x0,-0x4(%rbp)
  js     L6
  mov    $0x0,%eax
  pop    %rbp
  ret
```

assistant: ```c
int main() {
  int i;
  i = 0;
  while (i < 0) {
  }
  return 0;
}
```
user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  mov    $0x0,%eax
  ret
```

assistant: ```c
int main() {
  int i;
  i = 0;
  while (i < 0) {
  }
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<main>:
  endbr64
  xor    %eax,%eax
  ret
```

assistant: ```c
int main() {
  int i;
  i = 0;
  while (i < 0) {
  }
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<main>:
  endbr64
  xor    %eax,%eax
  ret
```

assistant: ```c
int main() {
  int i;
  i = 0;
  while (i < 0) {
  }
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<cmp_int>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  sub    -0x4(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int cmp_int(const void *a, const void *b) {
  int ia = *(int *)a;
  int ib = *(int *)b;
  return ia - ib;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<cmp_int>:
  endbr64
  mov    (%rdi),%eax
  sub    (%rsi),%eax
  ret
```

assistant: ```c
int cmp_int(const void *a, const void *b) {
  int ia = *(int *)a;
  int ib = *(int *)b;
  return ia - ib;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<cmp_int>:
  endbr64
  mov    (%rdi),%eax
  sub    (%rsi),%eax
  ret
```

assistant: ```c
int cmp_int(const void *a, const void *b) {
  int ia = *(int *)a;
  int ib = *(int *)b;
  return ia - ib;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movw   $0xa,-0x10(%rbp)
  movw   $0xfffe,-0xe(%rbp)
  movw   $0x3,-0xc(%rbp)
  movw   $0x1,-0xa(%rbp)
  movw   $0x5,-0x16(%rbp)
  movw   $0x4,-0x14(%rbp)
  movw   $0xff9c,-0x12(%rbp)
  lea    -0x10(%rbp),%rax
  mov    $0x3,%esi
  mov    %rax,%rdi
  call   <sum@plt>
  mov    %eax,%esi
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    -0x16(%rbp),%rax
  mov    $0x2,%esi
  mov    %rax,%rdi
  call   <sum@plt>
  mov    %eax,%esi
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L9
  call   <__stack_chk_fail@plt>
L9:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D2
type_infered: string

tool: D2: %hd


assistant: ```c
int main(void) {
  short arr1[] = {10, -2, 3, 1};
  short arr2[] = {5, 4, -100};
  printf("%hd\n", sum(arr1, sizeof arr1 / sizeof *arr1 - 1));
  printf("%hd\n", sum(arr2, sizeof arr2 / sizeof *arr2 - 1));
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<main>:
  endbr64
  push   %rbx
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  movw   $0xa,0x10(%rsp)
  movw   $0xfffe,0x12(%rsp)
  movw   $0x3,0x14(%rsp)
  movw   $0x1,0x16(%rsp)
  movw   $0x5,0xa(%rsp)
  movw   $0x4,0xc(%rsp)
  movw   $0xff9c,0xe(%rsp)
  lea    0x10(%rsp),%rdi
  mov    $0x3,%esi
  call   <sum@plt>
  mov    %eax,%esi
  lea    D8(%rip),%rbx
  mov    %rbx,%rdi
  call   <printf@plt>
  lea    0xa(%rsp),%rdi
  mov    $0x2,%esi
  call   <sum@plt>
  mov    %eax,%esi
  mov    %rbx,%rdi
  call   <printf@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L8
  mov    $0x0,%eax
  add    $0x20,%rsp
  pop    %rbx
  ret
L8:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D8
data_type: string

tool: D8: %hd


assistant: ```c
int main(void) {
  short arr1[] = {10, -2, 3, 1};
  short arr2[] = {5, 4, -100};
  printf("%hd\n", sum(arr1, sizeof arr1 / sizeof *arr1 - 1));
  printf("%hd\n", sum(arr2, sizeof arr2 / sizeof *arr2 - 1));
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<main>:
  endbr64
  push   %rbp
  mov    $0x3,%esi
  lea    D6(%rip),%rbp
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  movabs $0x10003fffe000a,%rax
  lea    0x10(%rsp),%rdi
  movl   $0x40005,0xa(%rsp)
  mov    %rax,0x10(%rsp)
  mov    $0xffffff9c,%eax
  mov    %ax,0xe(%rsp)
  call   <sum@plt>
  mov    %rbp,%rdi
  mov    %eax,%esi
  call   <printf@plt>
  lea    0xa(%rsp),%rdi
  mov    $0x2,%esi
  call   <sum@plt>
  mov    %rbp,%rdi
  mov    %eax,%esi
  call   <printf@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L0
  add    $0x20,%rsp
  xor    %eax,%eax
  pop    %rbp
  ret
L0:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D6
type_guessed: string

tool: D6: %hd


assistant: ```c
int main(void) {
  short arr1[] = {10, -2, 3, 1};
  short arr2[] = {5, 4, -100};
  printf("%hd\n", sum(arr1, sizeof arr1 / sizeof *arr1 - 1));
  printf("%hd\n", sum(arr2, sizeof arr2 / sizeof *arr2 - 1));
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  push   %rbp
  mov    $0x3,%esi
  lea    D14(%rip),%rbp
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    D19(%rip),%rax
  lea    0x10(%rsp),%rdi
  movl   $0x40005,0x8(%rsp)
  mov    %rax,0x10(%rsp)
  mov    $0xffffff9c,%eax
  mov    %ax,0xc(%rsp)
  call   <sum@plt>
  mov    %rbp,%rdi
  mov    %eax,%esi
  call   <printf@plt>
  lea    0x8(%rsp),%rdi
  mov    $0x2,%esi
  call   <sum@plt>
  mov    %rbp,%rdi
  mov    %eax,%esi
  call   <printf@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L7
  add    $0x20,%rsp
  xor    %eax,%eax
  pop    %rbp
  ret
L7:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D14
datatype: string
name: extract_symbolic_data
arguments: tag: D19
datatype: byte[8]

tool: D14: %hd


tool: {"D19": [0x0a,0x00,0xfe,0xff,0x03,0x00,0x01,0x00]}

assistant: ```c
int main(void) {
  short arr1[] = {10, -2, 3, 1};
  short arr2[] = {5, 4, -100};
  printf("%hd\n", sum(arr1, sizeof arr1 / sizeof *arr1 - 1));
  printf("%hd\n", sum(arr2, sizeof arr2 / sizeof *arr2 - 1));
  return 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<aes_encrypt>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %rcx,-0x50(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x2c(%rbp)
  movl   $0x0,-0x2c(%rbp)
  jmp    L1
L50:
  mov    -0x2c(%rbp),%eax
  mov    -0x50(%rbp),%rdx
  shr    $0x4,%rdx
  cmp    %rdx,%rax
  jne    L24
  mov    -0x50(%rbp),%rax
  and    $0xf,%eax
  mov    %eax,-0x24(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  je     L65
  lea    -0x20(%rbp),%rax
  mov    $0x10,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  jmp    L37
L24:
  movl   $0x10,-0x24(%rbp)
L37:
  mov    -0x24(%rbp),%edx
  mov    -0x2c(%rbp),%eax
  shl    $0x4,%rax
  mov    %rax,%rcx
  mov    -0x40(%rbp),%rax
  add    %rax,%rcx
  lea    -0x20(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  movl   $0x0,-0x28(%rbp)
  jmp    L80
L38:
  mov    -0x2c(%rbp),%eax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%eax
  add    %rax,%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x28(%rbp),%ecx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  xor    %eax,%edx
  mov    -0x28(%rbp),%eax
  mov    %dl,-0x20(%rbp,%rax,1)
  addl   $0x1,-0x28(%rbp)
L80:
  mov    -0x28(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jb     L38
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <encrypt@plt>
  lea    -0x20(%rbp),%rcx
  mov    -0x38(%rbp),%rax
  mov    $0x10,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x2c(%rbp),%eax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x48(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0x20(%rbp),%rax
  mov    $0x10,%edx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  addl   $0x1,-0x2c(%rbp)
L1:
  mov    -0x2c(%rbp),%eax
  mov    -0x50(%rbp),%rdx
  shr    $0x4,%rdx
  cmp    %rdx,%rax
  jbe    L50
  jmp    L73
L65:
  nop
L73:
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L47
  call   <__stack_chk_fail@plt>
L47:
  leave
  ret
```

assistant: ```c
void aes_encrypt(unsigned char *iv, unsigned char *inbuf, unsigned char *outbuf, unsigned long long len) {
  unsigned char block[16];
  unsigned int blockno = 0, i;
  for (blockno = 0; blockno <= (len / sizeof(block)); blockno++) {
    unsigned int fraction;
    if (blockno == (len / sizeof(block))) {
      fraction = len % sizeof(block);
      if (fraction == 0)
        break;
      memset((void *)block, 0, sizeof(block));
    } else
      fraction = 16;
    memcpy(block, inbuf + blockno * sizeof(block), fraction);
    for (i = 0; i < fraction; i++)
      block[i] = inbuf[blockno * sizeof(block) + i] ^ iv[i];
    encrypt((void *)block);
    memcpy(iv, block, sizeof(block));
    memcpy(outbuf + blockno * sizeof(block), block, sizeof(block));
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<aes_encrypt>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,%r12
  mov    %rsi,0x10(%rsp)
  mov    %rdx,0x8(%rsp)
  mov    %rcx,0x18(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  mov    %rcx,%r15
  shr    $0x4,%r15
  mov    $0x0,%r13d
  mov    $0x0,%ebp
  mov    $0x10,%r14d
  jmp    L44
L57:
  mov    %r14d,%ebx
L26:
  shl    $0x4,%rbp
  mov    %rbp,%rax
  mov    %rbp,(%rsp)
  mov    0x10(%rsp),%rbp
  add    %rax,%rbp
  lea    0x20(%rsp),%rdi
  mov    %ebx,%edx
  mov    %rbp,%rsi
  call   <memcpy@plt>
  mov    $0x0,%eax
L15:
  movzbl 0x0(%rbp,%rax,1),%edx
  xor    (%r12,%rax,1),%dl
  mov    %dl,0x20(%rsp,%rax,1)
  add    $0x1,%rax
  cmp    %eax,%ebx
  ja     L15
  lea    0x20(%rsp),%rbx
  mov    %rbx,%rdi
  call   <encrypt@plt>
  mov    %r14d,%edx
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <memcpy@plt>
  mov    (%rsp),%rdi
  add    0x8(%rsp),%rdi
  mov    %r14d,%edx
  mov    %rbx,%rsi
  call   <memcpy@plt>
  add    $0x1,%r13d
  mov    %r13d,%ebp
  cmp    %r15,%rbp
  ja     L5
L44:
  cmp    %rbp,%r15
  jne    L57
  mov    0x18(%rsp),%ebx
  and    $0xf,%ebx
  je     L5
  lea    0x20(%rsp),%rdi
  mov    %r14d,%edx
  mov    $0x0,%esi
  call   <memset@plt>
  jmp    L26
L5:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L50
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L50:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void aes_encrypt(unsigned char *iv, unsigned char *inbuf, unsigned char *outbuf, unsigned long long len) {
  unsigned char block[16];
  unsigned int blockno = 0, i;
  for (blockno = 0; blockno <= (len / sizeof(block)); blockno++) {
    unsigned int fraction;
    if (blockno == (len / sizeof(block))) {
      fraction = len % sizeof(block);
      if (fraction == 0)
        break;
      memset((void *)block, 0, sizeof(block));
    } else
      fraction = 16;
    memcpy(block, inbuf + blockno * sizeof(block), fraction);
    for (i = 0; i < fraction; i++)
      block[i] = inbuf[blockno * sizeof(block) + i] ^ iv[i];
    encrypt((void *)block);
    memcpy(iv, block, sizeof(block));
    memcpy(outbuf + blockno * sizeof(block), block, sizeof(block));
  }
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<aes_encrypt>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  xor    %r12d,%r12d
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rsi,0x8(%rsp)
  lea    0x20(%rsp),%r15
  mov    %rdx,0x10(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  mov    %rcx,%rax
  shr    $0x4,%rax
  mov    %rax,(%rsp)
  mov    %ecx,%eax
  and    $0xf,%eax
  mov    %eax,0x1c(%rsp)
  nopl   0x0(%rax,%rax,1)
L47:
  cmp    (%rsp),%rbp
  jne    L51
  mov    0x1c(%rsp),%r13d
  mov    %r13d,%ebx
  test   %r13d,%r13d
  je     L34
  mov    $0x10,%edx
  xor    %esi,%esi
  mov    %r15,%rdi
  call   <memset@plt>
  mov    %r13d,%edx
L16:
  mov    0x8(%rsp),%rax
  shl    $0x4,%rbp
  mov    %r15,%rdi
  lea    (%rax,%rbp,1),%r13
  mov    %r13,%rsi
  call   <memcpy@plt>
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L23:
  movzbl 0x0(%r13,%rax,1),%edx
  xor    (%r14,%rax,1),%dl
  mov    %dl,(%r15,%rax,1)
  add    $0x1,%rax
  cmp    %rax,%rbx
  jne    L23
  mov    %r15,%rdi
  call   <encrypt@plt>
  mov    $0x10,%edx
  mov    %r15,%rsi
  mov    %r14,%rdi
  call   <memcpy@plt>
  mov    0x10(%rsp),%rax
  mov    $0x10,%edx
  mov    %r15,%rsi
  lea    (%rax,%rbp,1),%rdi
  lea    0x1(%r12),%ebp
  call   <memcpy@plt>
  mov    %rbp,%r12
  cmp    (%rsp),%rbp
  jbe    L47
L34:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L22
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L51:
  mov    $0x10,%edx
  mov    $0x10,%ebx
  jmp    L16
L22:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void aes_encrypt(unsigned char *iv, unsigned char *inbuf, unsigned char *outbuf, unsigned long long len) {
  unsigned char block[16];
  unsigned int blockno = 0, i;
  for (blockno = 0; blockno <= (len / sizeof(block)); blockno++) {
    unsigned int fraction;
    if (blockno == (len / sizeof(block))) {
      fraction = len % sizeof(block);
      if (fraction == 0)
        break;
      memset((void *)block, 0, sizeof(block));
    } else
      fraction = 16;
    memcpy(block, inbuf + blockno * sizeof(block), fraction);
    for (i = 0; i < fraction; i++)
      block[i] = inbuf[blockno * sizeof(block) + i] ^ iv[i];
    encrypt((void *)block);
    memcpy(iv, block, sizeof(block));
    memcpy(outbuf + blockno * sizeof(block), block, sizeof(block));
  }
}
```