ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Demonstrate the C code that generates the assembly output below:

```asm
<circleSinTable>:
  endbr64
  lea    D4(%rip),%rax
  ret
```

assistant: ```c
double *circleSinTable(void) {
  static double theTable[33] = {0.0, 0.1950903220161282, 0.3826834323650897, 0.555570233019602, 0.707106781186547, 0.831469612302545, 0.923879532511287, 0.98078528040323, 1.0, 0.98078528040323, 0.923879532511287, 0.831469612302545, 0.7071067811865475, 0.555570233019602, 0.38268343236509, 0.1950903220161286, 0.0, -0.1950903220161283, -0.3826834323650896, -0.555570233019602, -0.707106781186547, -0.831469612302545, -0.9238795325112865, -0.98078528040323, -1.0, -0.98078528040323, -0.923879532511287, -0.831469612302545, -0.707106781186548, -0.555570233019602, -0.3826834323650903, -0.1950903220161287, 0.0};
  return theTable;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<do_square>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    %ecx,-0x24(%rbp)
  mov    %r8d,-0x28(%rbp)
  movl   $0x0,-0x4(%rbp)
  movl   $0x0,-0x8(%rbp)
  jmp    L17
L53:
  movl   $0x0,-0xc(%rbp)
  jmp    L32
L46:
  mov    -0x20(%rbp),%edx
  mov    -0x8(%rbp),%eax
  add    %edx,%eax
  imul   -0x24(%rbp),%eax
  mov    %eax,%edx
  mov    -0x1c(%rbp),%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %eax,-0x4(%rbp)
  addl   $0x1,-0xc(%rbp)
L32:
  mov    -0xc(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L46
  addl   $0x1,-0x8(%rbp)
L17:
  mov    -0x8(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L53
  cmpl   $0x0,-0x4(%rbp)
  je     L87
  mov    -0x28(%rbp),%eax
  imul   %eax,%eax
  cmp    %eax,-0x4(%rbp)
  jne    L75
L87:
  cmpl   $0x1,-0x28(%rbp)
  je     L81
  mov    $0x1,%edi
  call   <bit_output@plt>
L81:
  cmpl   $0x0,-0x4(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <bit_output@plt>
  jmp    L8
L75:
  cmpl   $0x1,-0x28(%rbp)
  jle    L8
  mov    $0x0,%edi
  call   <bit_output@plt>
  sarl   -0x28(%rbp)
  mov    -0x28(%rbp),%edi
  mov    -0x24(%rbp),%ecx
  mov    -0x20(%rbp),%edx
  mov    -0x1c(%rbp),%esi
  mov    -0x18(%rbp),%rax
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <do_square>
  mov    -0x1c(%rbp),%edx
  mov    -0x28(%rbp),%eax
  lea    (%rdx,%rax,1),%esi
  mov    -0x28(%rbp),%edi
  mov    -0x24(%rbp),%ecx
  mov    -0x20(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <do_square>
  mov    -0x20(%rbp),%edx
  mov    -0x28(%rbp),%eax
  lea    (%rdx,%rax,1),%edi
  mov    -0x28(%rbp),%ecx
  mov    -0x24(%rbp),%edx
  mov    -0x1c(%rbp),%esi
  mov    -0x18(%rbp),%rax
  mov    %ecx,%r8d
  mov    %edx,%ecx
  mov    %edi,%edx
  mov    %rax,%rdi
  call   <do_square>
  mov    -0x20(%rbp),%edx
  mov    -0x28(%rbp),%eax
  lea    (%rdx,%rax,1),%edi
  mov    -0x1c(%rbp),%edx
  mov    -0x28(%rbp),%eax
  lea    (%rdx,%rax,1),%esi
  mov    -0x28(%rbp),%ecx
  mov    -0x24(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %ecx,%r8d
  mov    %edx,%ecx
  mov    %edi,%edx
  mov    %rax,%rdi
  call   <do_square>
L8:
  leave
  ret
```

assistant: ```c
void do_square(unsigned char *image, int ox, int oy, int w, int size) {
  int x, y, t = 0;
  for (y = 0; y < size; y++)
    for (x = 0; x < size; x++)
      t += image[(oy + y) * w + ox + x];
  if (t == 0 || t == size * size) {
    if (size != 1)
      bit_output(1);
    bit_output(t ? 1 : 0);
    return;
  }
  if (size > 1) {
    bit_output(0);
    size >>= 1;
    do_square(image, ox, oy, w, size);
    do_square(image, ox + size, oy, w, size);
    do_square(image, ox, oy + size, w, size);
    do_square(image, ox + size, oy + size, w, size);
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<do_square>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  test   %r8d,%r8d
  jle    L33
  mov    %rdi,%r14
  mov    %esi,%r15d
  mov    %edx,%r13d
  mov    %ecx,%r12d
  movslq %ecx,%rdi
  lea    -0x1(%r8),%esi
  mov    %edx,%eax
  imul   %ecx,%eax
  cltq
  movslq %r15d,%rdx
  lea    0x1(%rax,%rdx,1),%rcx
  add    %r14,%rcx
  add    %rsi,%rcx
  mov    $0x0,%ebx
  mov    $0x0,%ebp
L86:
  mov    %rcx,%rax
  sub    %rsi,%rax
  sub    $0x1,%rax
L72:
  movzbl (%rax),%edx
  add    %edx,%ebx
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L72
  add    $0x1,%ebp
  add    %rdi,%rcx
  cmp    %ebp,%r8d
  jne    L86
  test   %ebx,%ebx
  je     L46
  mov    %ebp,%eax
  imul   %ebp,%eax
  cmp    %ebx,%eax
  je     L46
  cmp    $0x1,%ebp
  jle    L15
  mov    $0x0,%edi
  call   <bit_output@plt>
  sar    %ebp
  mov    %ebp,%r8d
  mov    %r12d,%ecx
  mov    %r13d,%edx
  mov    %r15d,%esi
  mov    %r14,%rdi
  call   <do_square>
  lea    0x0(%rbp,%r15,1),%ebx
  mov    %ebp,%r8d
  mov    %r12d,%ecx
  mov    %r13d,%edx
  mov    %ebx,%esi
  mov    %r14,%rdi
  call   <do_square>
  add    %ebp,%r13d
  mov    %ebp,%r8d
  mov    %r12d,%ecx
  mov    %r13d,%edx
  mov    %r15d,%esi
  mov    %r14,%rdi
  call   <do_square>
  mov    %ebp,%r8d
  mov    %r12d,%ecx
  mov    %r13d,%edx
  mov    %ebx,%esi
  mov    %r14,%rdi
  call   <do_square>
  jmp    L15
L33:
  mov    $0x0,%ebx
L46:
  cmp    $0x1,%r8d
  jne    L64
L69:
  test   %ebx,%ebx
  setne  %dil
  movzbl %dil,%edi
  call   <bit_output@plt>
L15:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L64:
  mov    $0x1,%edi
  call   <bit_output@plt>
  jmp    L69
```

assistant: ```c
void do_square(unsigned char *image, int ox, int oy, int w, int size) {
  int x, y, t = 0;
  for (y = 0; y < size; y++)
    for (x = 0; x < size; x++)
      t += image[(oy + y) * w + ox + x];
  if (t == 0 || t == size * size) {
    if (size != 1)
      bit_output(1);
    bit_output(t ? 1 : 0);
    return;
  }
  if (size > 1) {
    bit_output(0);
    size >>= 1;
    do_square(image, ox, oy, w, size);
    do_square(image, ox + size, oy, w, size);
    do_square(image, ox, oy + size, w, size);
    do_square(image, ox + size, oy + size, w, size);
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<do_square>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  push   %r14
  mov    %esi,%r14d
  push   %r13
  mov    %edx,%r13d
  push   %r12
  movslq %ecx,%r12
  push   %rbp
  push   %rbx
  mov    %r8d,%ebx
  sub    $0x18,%rsp
  test   %ebx,%ebx
  jle    L10
L3:
  movslq %r14d,%rax
  lea    -0x1(%rbx),%r8d
  xor    %ebp,%ebp
  xor    %edi,%edi
  lea    0x1(%r15,%rax,1),%rsi
  mov    %r13d,%eax
  imul   %ecx,%eax
  cltq
  add    %rax,%rsi
  add    %r8,%rsi
  nopw   0x0(%rax,%rax,1)
L73:
  mov    %rsi,%rax
  sub    %r8,%rax
  sub    $0x1,%rax
  nopw   0x0(%rax,%rax,1)
L50:
  movzbl (%rax),%edx
  add    $0x1,%rax
  add    %edx,%ebp
  cmp    %rax,%rsi
  jne    L50
  add    $0x1,%edi
  add    %r12,%rsi
  cmp    %edi,%ebx
  jne    L73
  test   %ebp,%ebp
  je     L28
  mov    %ebx,%eax
  imul   %ebx,%eax
  cmp    %ebp,%eax
  je     L52
  mov    %ecx,0xc(%rsp)
  cmp    $0x1,%ebx
  je     L21
  xor    %edi,%edi
  sar    %ebx
  call   <bit_output@plt>
  mov    0xc(%rsp),%ecx
  mov    %r13d,%edx
  mov    %r14d,%esi
  mov    %ebx,%r8d
  mov    %r15,%rdi
  lea    (%rbx,%r14,1),%ebp
  call   <do_square>
  mov    0xc(%rsp),%ecx
  mov    %r13d,%edx
  mov    %ebx,%r8d
  mov    %ebp,%esi
  mov    %r15,%rdi
  add    %ebx,%r13d
  call   <do_square>
  mov    0xc(%rsp),%ecx
  mov    %r14d,%esi
  mov    %ebx,%r8d
  mov    %r13d,%edx
  mov    %r15,%rdi
  mov    %ebp,%r14d
  call   <do_square>
  mov    0xc(%rsp),%ecx
  test   %ebx,%ebx
  jg     L3
L10:
  xor    %ebp,%ebp
L20:
  mov    $0x1,%edi
  call   <bit_output@plt>
L32:
  add    $0x18,%rsp
  mov    %ebp,%edi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1050 <bit_output@plt>
L52:
  mov    $0x1,%ebp
L28:
  cmp    $0x1,%ebx
  je     L32
  jmp    L20
  nopl   0x0(%rax)
L21:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void do_square(unsigned char *image, int ox, int oy, int w, int size) {
  int x, y, t = 0;
  for (y = 0; y < size; y++)
    for (x = 0; x < size; x++)
      t += image[(oy + y) * w + ox + x];
  if (t == 0 || t == size * size) {
    if (size != 1)
      bit_output(1);
    bit_output(t ? 1 : 0);
    return;
  }
  if (size > 1) {
    bit_output(0);
    size >>= 1;
    do_square(image, ox, oy, w, size);
    do_square(image, ox + size, oy, w, size);
    do_square(image, ox, oy + size, w, size);
    do_square(image, ox + size, oy + size, w, size);
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<nand_erase_block>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  shr    $0xc,%rax
  mov    %eax,-0x4(%rbp)
  mov    $0x0,%eax
  call   <nand_select@plt>
  mov    $0x60,%edi
  call   <nand_cmd@plt>
  mov    -0x4(%rbp),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <nand_addr@plt>
  mov    -0x4(%rbp),%eax
  sar    $0x8,%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <nand_addr@plt>
  mov    -0x4(%rbp),%eax
  sar    $0x10,%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <nand_addr@plt>
  mov    $0xd0,%edi
  call   <nand_cmd@plt>
  mov    $0x0,%eax
  call   <wait_ready@plt>
  mov    $0x0,%eax
  call   <nand_deselect@plt>
  nop
  leave
  ret
```

assistant: ```c
void nand_erase_block(unsigned long addr) {
  int page = addr / 4096;
  nand_select();
  nand_cmd(0x60);
  nand_addr(page & 0xff);
  nand_addr((page >> 8) & 0xff);
  nand_addr((page >> 16) & 0xff);
  nand_cmd(0xd0);
  wait_ready();
  nand_deselect();
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<nand_erase_block>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  shr    $0xc,%rbx
  mov    $0x0,%eax
  call   <nand_select@plt>
  mov    $0x60,%edi
  call   <nand_cmd@plt>
  movzbl %bl,%edi
  call   <nand_addr@plt>
  movzbl %bh,%edi
  call   <nand_addr@plt>
  sar    $0x10,%ebx
  movzbl %bl,%edi
  call   <nand_addr@plt>
  mov    $0xd0,%edi
  call   <nand_cmd@plt>
  mov    $0x0,%eax
  call   <wait_ready@plt>
  mov    $0x0,%eax
  call   <nand_deselect@plt>
  pop    %rbx
  ret
```

assistant: ```c
void nand_erase_block(unsigned long addr) {
  int page = addr / 4096;
  nand_select();
  nand_cmd(0x60);
  nand_addr(page & 0xff);
  nand_addr((page >> 8) & 0xff);
  nand_addr((page >> 16) & 0xff);
  nand_cmd(0xd0);
  wait_ready();
  nand_deselect();
}
```
user: What is the c source code of the assembly code below?

```asm
<nand_erase_block>:
  endbr64
  push   %rbx
  xor    %eax,%eax
  mov    %rdi,%rbx
  shr    $0xc,%rbx
  call   <nand_select@plt>
  mov    $0x60,%edi
  call   <nand_cmd@plt>
  movzbl %bl,%edi
  call   <nand_addr@plt>
  movzbl %bh,%edi
  sar    $0x10,%ebx
  call   <nand_addr@plt>
  movzbl %bl,%edi
  call   <nand_addr@plt>
  mov    $0xd0,%edi
  call   <nand_cmd@plt>
  xor    %eax,%eax
  call   <wait_ready@plt>
  xor    %eax,%eax
  pop    %rbx
  jmp    10c0 <nand_deselect@plt>
```

assistant: ```c
void nand_erase_block(unsigned long addr) {
  int page = addr / 4096;
  nand_select();
  nand_cmd(0x60);
  nand_addr(page & 0xff);
  nand_addr((page >> 8) & 0xff);
  nand_addr((page >> 16) & 0xff);
  nand_cmd(0xd0);
  wait_ready();
  nand_deselect();
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<nand_erase_block>:
  endbr64
  push   %rbx
  xor    %eax,%eax
  mov    %rdi,%rbx
  shr    $0xc,%rbx
  call   <nand_select@plt>
  mov    $0x60,%edi
  call   <nand_cmd@plt>
  movzbl %bl,%edi
  call   <nand_addr@plt>
  movzbl %bh,%edi
  sar    $0x10,%ebx
  call   <nand_addr@plt>
  movzbl %bl,%edi
  call   <nand_addr@plt>
  mov    $0xd0,%edi
  call   <nand_cmd@plt>
  xor    %eax,%eax
  call   <wait_ready@plt>
  xor    %eax,%eax
  pop    %rbx
  jmp    10c0 <nand_deselect@plt>
```

assistant: ```c
void nand_erase_block(unsigned long addr) {
  int page = addr / 4096;
  nand_select();
  nand_cmd(0x60);
  nand_addr(page & 0xff);
  nand_addr((page >> 8) & 0xff);
  nand_addr((page >> 16) & 0xff);
  nand_cmd(0xd0);
  wait_ready();
  nand_deselect();
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<init>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  movb   $0xff,-0x5(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L10
L1:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x5(%rbp),%eax
  mov    %al,(%rdx)
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    -0x4(%rbp),%edx
  mov    %dl,(%rax)
  movzbl -0x5(%rbp),%eax
  neg    %eax
  mov    %al,-0x5(%rbp)
  addl   $0x1,-0x4(%rbp)
L10:
  mov    -0x4(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L1
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void init(char *a1, char *a2, int N) {
  char s = -1;
  int i;
  for (i = 0; i < N; i++) {
    a1[i] = s;
    a2[i] = i;
    s = -s;
  }
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<init>:
  endbr64
  test   %edx,%edx
  jle    L6
  mov    %edx,%edx
  mov    $0x0,%eax
  mov    $0xffffffff,%ecx
L8:
  mov    %cl,(%rdi,%rax,1)
  mov    %al,(%rsi,%rax,1)
  neg    %ecx
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L8
L6:
  ret
```

assistant: ```c
void init(char *a1, char *a2, int N) {
  char s = -1;
  int i;
  for (i = 0; i < N; i++) {
    a1[i] = s;
    a2[i] = i;
    s = -s;
  }
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<init>:
  endbr64
  test   %edx,%edx
  jle    L0
  movslq %edx,%rdx
  xor    %eax,%eax
  mov    $0xffffffff,%ecx
  nopw   0x0(%rax,%rax,1)
L15:
  mov    %cl,(%rdi,%rax,1)
  neg    %ecx
  mov    %al,(%rsi,%rax,1)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L15
L0:
  ret
```

assistant: ```c
void init(char *a1, char *a2, int N) {
  char s = -1;
  int i;
  for (i = 0; i < N; i++) {
    a1[i] = s;
    a2[i] = i;
    s = -s;
  }
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<init>:
  endbr64
  test   %edx,%edx
  jle    L0
  movslq %edx,%rdx
  xor    %eax,%eax
  mov    $0xffffffff,%ecx
  nopw   0x0(%rax,%rax,1)
L16:
  mov    %cl,(%rdi,%rax,1)
  neg    %ecx
  mov    %al,(%rsi,%rax,1)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L16
L0:
  ret
```

assistant: ```c
void init(char *a1, char *a2, int N) {
  char s = -1;
  int i;
  for (i = 0; i < N; i++) {
    a1[i] = s;
    a2[i] = i;
    s = -s;
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<strcmp>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  jmp    L22
L2:
  addq   $0x1,-0x8(%rbp)
  addq   $0x1,-0x10(%rbp)
L22:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L39
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L39
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%edx
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  je     L2
L39:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%edx
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  pop    %rbp
  ret
```

assistant: ```c
int strcmp(const char *s1, const char *s2) {
  while (*s1 != '\0' && *s2 != '\0' && *s1 == *s2) {
    s1++;
    s2++;
  }
  return *s1 - *s2;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<strcmp>:
  endbr64
  movzbl (%rdi),%eax
  test   %al,%al
  je     L9
L23:
  movzbl (%rsi),%edx
  cmp    %al,%dl
  jne    L9
  test   %dl,%dl
  je     L9
  add    $0x1,%rdi
  add    $0x1,%rsi
  movzbl (%rdi),%eax
  test   %al,%al
  jne    L23
L9:
  movsbl %al,%eax
  movsbl (%rsi),%edx
  sub    %edx,%eax
  ret
```

assistant: ```c
int strcmp(const char *s1, const char *s2) {
  while (*s1 != '\0' && *s2 != '\0' && *s1 == *s2) {
    s1++;
    s2++;
  }
  return *s1 - *s2;
}
```
user: What is the c source code of the assembly code below?

```asm
<strcmp>:
  endbr64
  movsbl (%rdi),%eax
  test   %al,%al
  jne    L48
  jmp    L46
  nopl   (%rax)
L12:
  test   %dl,%dl
  je     L7
  movsbl 0x1(%rdi),%eax
  add    $0x1,%rdi
  lea    0x1(%rsi),%rdx
  test   %al,%al
  je     L16
  mov    %rdx,%rsi
L48:
  movsbl (%rsi),%edx
  cmp    %al,%dl
  je     L12
L7:
  sub    %edx,%eax
  ret
  nopl   0x0(%rax)
L16:
  movsbl 0x1(%rsi),%edx
  xor    %eax,%eax
  sub    %edx,%eax
  ret
L46:
  movsbl (%rsi),%edx
  xor    %eax,%eax
  jmp    L7
```

assistant: ```c
int strcmp(const char *s1, const char *s2) {
  while (*s1 != '\0' && *s2 != '\0' && *s1 == *s2) {
    s1++;
    s2++;
  }
  return *s1 - *s2;
}
```
user: What is the c source code of the assembly code below:

```asm
<strcmp>:
  endbr64
  movsbl (%rdi),%eax
  test   %al,%al
  jne    L58
  jmp    L33
  nopl   (%rax)
L19:
  test   %dl,%dl
  je     L17
  movsbl 0x1(%rdi),%eax
  add    $0x1,%rdi
  lea    0x1(%rsi),%rdx
  test   %al,%al
  je     L28
  mov    %rdx,%rsi
L58:
  movsbl (%rsi),%edx
  cmp    %al,%dl
  je     L19
L17:
  sub    %edx,%eax
  ret
  nopl   0x0(%rax)
L28:
  movsbl 0x1(%rsi),%edx
  xor    %eax,%eax
  sub    %edx,%eax
  ret
L33:
  movsbl (%rsi),%edx
  xor    %eax,%eax
  jmp    L17
```

assistant: ```c
int strcmp(const char *s1, const char *s2) {
  while (*s1 != '\0' && *s2 != '\0' && *s1 == *s2) {
    s1++;
    s2++;
  }
  return *s1 - *s2;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<display>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x18(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <gettimeofday@plt>
  movl   $0x0,-0x20(%rbp)
L37:
  mov    -0x20(%rbp),%eax
  shl    $0x3,%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rdi
  call   <gpio_plane@plt>
  mov    $0x0,%edi
  call   <gpio_oe@plt>
  mov    $0x0,%edi
  call   <gpio_le@plt>
  mov    $0x1,%edi
  call   <gpio_le@plt>
  mov    -0x20(%rbp),%eax
  mov    %eax,%edi
  call   <gpio_layer@plt>
  mov    $0x1,%edi
  call   <gpio_oe@plt>
  addl   $0x1,-0x20(%rbp)
  cmpl   $0x7,-0x20(%rbp)
  jle    L37
  movl   $0x0,-0x20(%rbp)
  lea    -0x10(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <gettimeofday@plt>
  mov    -0x10(%rbp),%eax
  mov    -0x18(%rbp),%edx
  sub    %edx,%eax
  imul   $0x3e8,%eax,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0xc(%rbp),%eax
  mov    -0x14(%rbp),%edx
  sub    %edx,%eax
  movslq %eax,%rdx
  imul   $0x10624dd3,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x6,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  add    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jge    L22
  jmp    L37
L22:
  nop
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L32
  call   <__stack_chk_fail@plt>
L32:
  leave
  ret
```

assistant: ```c
void display(int duration, unsigned char *data) {
  struct timeval t0, now;
  int z, msec;
  gettimeofday(&t0, 0);
  z = 0;
  for (;;) {
    gpio_plane(data + z * 8);
    gpio_oe(0);
    gpio_le(0);
    gpio_le(1);
    gpio_layer(z);
    gpio_oe(1);
    z++;
    if (z >= 8) {
      z = 0;
      gettimeofday(&now, 0);
      msec = (now.tv_sec - t0.tv_sec) * 1000;
      msec += (now.tv_usec - t0.tv_usec) / 1000;
      if (msec >= duration)
        break;
    }
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<display>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x20,%rsp
  mov    %edi,%r13d
  mov    %rsi,%r12
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x8(%rsp),%rdi
  mov    $0x0,%esi
  call   <gettimeofday@plt>
  lea    0x10(%rsp),%r14
L25:
  mov    %r12,%rbp
  mov    $0x0,%ebx
L11:
  mov    %rbp,%rdi
  call   <gpio_plane@plt>
  mov    $0x0,%edi
  call   <gpio_oe@plt>
  mov    $0x0,%edi
  call   <gpio_le@plt>
  mov    $0x1,%edi
  call   <gpio_le@plt>
  mov    %ebx,%edi
  call   <gpio_layer@plt>
  mov    $0x1,%edi
  call   <gpio_oe@plt>
  add    $0x1,%ebx
  add    $0x8,%rbp
  cmp    $0x8,%ebx
  jne    L11
  mov    $0x0,%esi
  mov    %r14,%rdi
  call   <gettimeofday@plt>
  mov    0x10(%rsp),%ecx
  sub    0x8(%rsp),%ecx
  imul   $0x3e8,%ecx,%ecx
  mov    0x14(%rsp),%edx
  sub    0xc(%rsp),%edx
  movslq %edx,%rax
  imul   $0x10624dd3,%rax,%rax
  sar    $0x26,%rax
  sar    $0x1f,%edx
  sub    %edx,%eax
  add    %ecx,%eax
  cmp    %r13d,%eax
  jl     L25
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L24
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L24:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void display(int duration, unsigned char *data) {
  struct timeval t0, now;
  int z, msec;
  gettimeofday(&t0, 0);
  z = 0;
  for (;;) {
    gpio_plane(data + z * 8);
    gpio_oe(0);
    gpio_le(0);
    gpio_le(1);
    gpio_layer(z);
    gpio_oe(1);
    z++;
    if (z >= 8) {
      z = 0;
      gettimeofday(&now, 0);
      msec = (now.tv_sec - t0.tv_sec) * 1000;
      msec += (now.tv_usec - t0.tv_usec) / 1000;
      if (msec >= duration)
        break;
    }
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<display>:
  endbr64
  push   %r14
  push   %r13
  mov    %edi,%r13d
  push   %r12
  mov    %rsi,%r12
  xor    %esi,%esi
  push   %rbp
  push   %rbx
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x8(%rsp),%rdi
  lea    0x10(%rsp),%r14
  call   <gettimeofday@plt>
  nopw   0x0(%rax,%rax,1)
L9:
  mov    %r12,%rbp
  xor    %ebx,%ebx
  nopl   (%rax)
L5:
  mov    %rbp,%rdi
  add    $0x8,%rbp
  call   <gpio_plane@plt>
  xor    %edi,%edi
  call   <gpio_oe@plt>
  xor    %edi,%edi
  call   <gpio_le@plt>
  mov    $0x1,%edi
  call   <gpio_le@plt>
  mov    %ebx,%edi
  add    $0x1,%ebx
  call   <gpio_layer@plt>
  mov    $0x1,%edi
  call   <gpio_oe@plt>
  cmp    $0x8,%ebx
  jne    L5
  xor    %esi,%esi
  mov    %r14,%rdi
  call   <gettimeofday@plt>
  mov    0x14(%rsp),%edx
  sub    0xc(%rsp),%edx
  movslq %edx,%rax
  mov    0x10(%rsp),%ecx
  sub    0x8(%rsp),%ecx
  sar    $0x1f,%edx
  imul   $0x10624dd3,%rax,%rax
  imul   $0x3e8,%ecx,%ecx
  sar    $0x26,%rax
  sub    %edx,%eax
  add    %ecx,%eax
  cmp    %r13d,%eax
  jl     L9
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L2
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L2:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void display(int duration, unsigned char *data) {
  struct timeval t0, now;
  int z, msec;
  gettimeofday(&t0, 0);
  z = 0;
  for (;;) {
    gpio_plane(data + z * 8);
    gpio_oe(0);
    gpio_le(0);
    gpio_le(1);
    gpio_layer(z);
    gpio_oe(1);
    z++;
    if (z >= 8) {
      z = 0;
      gettimeofday(&now, 0);
      msec = (now.tv_sec - t0.tv_sec) * 1000;
      msec += (now.tv_usec - t0.tv_usec) / 1000;
      if (msec >= duration)
        break;
    }
  }
}
```