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

```asm
<print_memory_usage>:
  endbr64
  push   %r14
  pxor   %xmm0,%xmm0
  xor    %edx,%edx
  mov    %rsi,%r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  xor    %r12d,%r12d
  push   %rbp
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rbp
  movaps %xmm0,0x10(%rsp)
  mov    %dx,0x2c(%rsp)
  movq   $0x0,0x20(%rsp)
  movl   $0x0,0x28(%rsp)
  call   <getpid@plt>
  mov    %rbp,%rdi
  mov    $0x1e,%esi
  lea    D6(%rip),%rdx
  mov    %eax,%ecx
  call   <snprintf@plt>
  mov    %rbp,%rdi
  lea    D0(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L16
  lea    0xc(%rsp),%rdx
  lea    D25(%rip),%rsi
  mov    %rax,%rdi
  call   <fscanf@plt>
  mov    0xc(%rsp),%eax
  pxor   %xmm0,%xmm0
  mov    %r14,%rdx
  lea    D38(%rip),%rsi
  mov    %r13,%rdi
  cvtsi2sd %rax,%xmm0
  mulsd  D12(%rip),%xmm0
  cvttsd2si %xmm0,%rcx
  call   <fprintf@plt>
  mov    %eax,%r12d
L16:
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L0
  add    $0x48,%rsp
  mov    %r12d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L0:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D6
type_guessed: string
name: retrieve_data
arguments: label: D0
type_guessed: string
name: retrieve_data
arguments: label: D25
type_guessed: string
name: retrieve_data
arguments: label: D38
type_guessed: string
name: retrieve_data
arguments: label: D12
type_guessed: byte[8]

tool: D6: /proc/%u/statm

tool: D0: r

tool: D25: %u

tool: D38: %s %u MB mem used


tool: {"D12": [0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x3f]}

assistant: ```c
int print_memory_usage(FILE *out, const char *prefix) {
  char buf[30] = {};
  int res = 0;
  snprintf(buf, 30, "/proc/%u/statm", (unsigned)getpid());
  FILE *pf = fopen(buf, "r");
  if (pf) {
    unsigned size;
    unsigned resident;
    unsigned share;
    unsigned text;
    unsigned lib;
    unsigned data;
    unsigned dt;
    fscanf(pf, "%u", &size);
    res = fprintf(out, "%s %u MB mem used\n", prefix, size / (1024.0));
  }
  fclose(pf);
  return res;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<list_destroy>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <list_purge@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  nop
  leave
  ret
```

assistant: ```c
void list_destroy(struct list *const l) {
  list_purge(l);
  free(l);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<list_destroy>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <list_purge@plt>
  mov    %rbx,%rdi
  call   <free@plt>
  pop    %rbx
  ret
```

assistant: ```c
void list_destroy(struct list *const l) {
  list_purge(l);
  free(l);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<list_destroy>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  call   <list_purge@plt>
  mov    %rbp,%rdi
  pop    %rbp
  jmp    1060 <free@plt>
```

assistant: ```c
void list_destroy(struct list *const l) {
  list_purge(l);
  free(l);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<list_destroy>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  call   <list_purge@plt>
  mov    %rbp,%rdi
  pop    %rbp
  jmp    1060 <free@plt>
```

assistant: ```c
void list_destroy(struct list *const l) {
  list_purge(l);
  free(l);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<UARTCharPut>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    %esi,%eax
  mov    %al,-0x18(%rbp)
  movl   $0x60,-0x4(%rbp)
  nop
L8:
  mov    -0x14(%rbp),%eax
  add    $0x14,%eax
  mov    %eax,%eax
  mov    (%rax),%eax
  and    -0x4(%rbp),%eax
  cmp    %eax,-0x4(%rbp)
  jne    L8
  mov    -0x14(%rbp),%eax
  mov    %rax,%rdx
  movzbl -0x18(%rbp),%eax
  mov    %eax,(%rdx)
  nop
  pop    %rbp
  ret
```

assistant: ```c
void UARTCharPut(unsigned int baseAdd, unsigned char byteTx) {
  unsigned int txEmpty;
  txEmpty = ((0x00000040u) | (0x00000020u));
  while (txEmpty != ((*((volatile unsigned int *)(baseAdd + (0x14)))) & txEmpty))
    ;
  (*((volatile unsigned int *)(baseAdd + (0x0)))) = byteTx;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<UARTCharPut>:
  endbr64
  lea    0x14(%rdi),%edx
L5:
  mov    (%edx),%eax
  and    $0x60,%eax
  cmp    $0x60,%eax
  jne    L5
  movzbl %sil,%esi
  mov    %esi,(%edi)
  ret
```

assistant: ```c
void UARTCharPut(unsigned int baseAdd, unsigned char byteTx) {
  unsigned int txEmpty;
  txEmpty = ((0x00000040u) | (0x00000020u));
  while (txEmpty != ((*((volatile unsigned int *)(baseAdd + (0x14)))) & txEmpty))
    ;
  (*((volatile unsigned int *)(baseAdd + (0x0)))) = byteTx;
}
```
user: What is the c source code of the assembly code below:

```asm
<UARTCharPut>:
  endbr64
  lea    0x14(%rdi),%edx
  nopw   0x0(%rax,%rax,1)
L9:
  mov    (%rdx),%eax
  and    $0x60,%eax
  cmp    $0x60,%eax
  jne    L9
  movzbl %sil,%esi
  mov    %esi,(%edi)
  ret
```

assistant: ```c
void UARTCharPut(unsigned int baseAdd, unsigned char byteTx) {
  unsigned int txEmpty;
  txEmpty = ((0x00000040u) | (0x00000020u));
  while (txEmpty != ((*((volatile unsigned int *)(baseAdd + (0x14)))) & txEmpty))
    ;
  (*((volatile unsigned int *)(baseAdd + (0x0)))) = byteTx;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<UARTCharPut>:
  endbr64
  lea    0x14(%rdi),%edx
  nopw   0x0(%rax,%rax,1)
L6:
  mov    (%rdx),%eax
  and    $0x60,%eax
  cmp    $0x60,%eax
  jne    L6
  movzbl %sil,%esi
  mov    %esi,(%edi)
  ret
```

assistant: ```c
void UARTCharPut(unsigned int baseAdd, unsigned char byteTx) {
  unsigned int txEmpty;
  txEmpty = ((0x00000040u) | (0x00000020u));
  while (txEmpty != ((*((volatile unsigned int *)(baseAdd + (0x14)))) & txEmpty))
    ;
  (*((volatile unsigned int *)(baseAdd + (0x0)))) = byteTx;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  movl   $0xffffff9c,-0xc(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x3,-0x4(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L7
L3:
  mov    -0x8(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jle    L5
  mov    $0x0,%eax
  call   <remove_me@plt>
L5:
  addl   $0x2,-0x8(%rbp)
  addl   $0x3,-0x4(%rbp)
  addl   $0x1,-0xc(%rbp)
L7:
  cmpl   $0x63,-0xc(%rbp)
  jle    L3
  mov    $0x0,%eax
  leave
  ret
```

assistant: ```c
int main(void) {
  int a = -100;
  int b = 0;
  int c = 3;
  for (a = 0; a < 100; a++) {
    if (b > c)
      remove_me();
    b = b + 2;
    c = c + 3;
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    $0x3,%ebp
  mov    $0x0,%ebx
L18:
  add    $0x2,%ebx
  add    $0x3,%ebp
  cmp    $0xc8,%ebx
  je     L24
  cmp    %ebp,%ebx
  jle    L18
  mov    $0x0,%eax
  call   <remove_me@plt>
  jmp    L18
L24:
  mov    $0x0,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
int main(void) {
  int a = -100;
  int b = 0;
  int c = 3;
  for (a = 0; a < 100; a++) {
    if (b > c)
      remove_me();
    b = b + 2;
    c = c + 3;
  }
}
```
user: What is the c source code of the assembly code below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    $0x3,%ebp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x8,%rsp
  nopl   0x0(%rax)
L1:
  add    $0x2,%ebx
  add    $0x3,%ebp
  cmp    $0xc8,%ebx
  je     L22
L5:
  cmp    %ebp,%ebx
  jle    L1
  xor    %eax,%eax
  add    $0x2,%ebx
  add    $0x3,%ebp
  call   <remove_me@plt>
  cmp    $0xc8,%ebx
  jne    L5
L22:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
int main(void) {
  int a = -100;
  int b = 0;
  int c = 3;
  for (a = 0; a < 100; a++) {
    if (b > c)
      remove_me();
    b = b + 2;
    c = c + 3;
  }
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<main>:
  endbr64
  push   %rbp
  mov    $0x6,%ebp
  push   %rbx
  mov    $0x2,%ebx
  sub    $0x8,%rsp
  nopl   0x0(%rax)
L10:
  add    $0x2,%ebx
  add    $0x3,%ebp
  cmp    $0xc8,%ebx
  je     L26
L17:
  cmp    %ebp,%ebx
  jle    L10
  xor    %eax,%eax
  add    $0x2,%ebx
  add    $0x3,%ebp
  call   <remove_me@plt>
  cmp    $0xc8,%ebx
  jne    L17
L26:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
int main(void) {
  int a = -100;
  int b = 0;
  int c = 3;
  for (a = 0; a < 100; a++) {
    if (b > c)
      remove_me();
    b = b + 2;
    c = c + 3;
  }
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<make_part>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  movsd  %xmm0,-0x8(%rbp)
  mov    %edi,-0xc(%rbp)
  cmpl   $0x5,-0xc(%rbp)
  ja     L42
  mov    -0xc(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  lea    D9(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D9(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    -0x8(%rbp),%rax
  movq   %rax,%xmm0
  call   <year_from_time@plt>
  movq   %xmm0,%rax
  jmp    L53
  mov    -0x8(%rbp),%rax
  movq   %rax,%xmm0
  call   <month_from_time@plt>
  movq   %xmm0,%rax
  jmp    L53
  mov    -0x8(%rbp),%rax
  movq   %rax,%xmm0
  call   <date_from_time@plt>
  movq   %xmm0,%rax
  jmp    L53
  mov    -0x8(%rbp),%rax
  movq   %rax,%xmm0
  call   <hour_from_time@plt>
  movq   %xmm0,%rax
  jmp    L53
  mov    -0x8(%rbp),%rax
  movq   %rax,%xmm0
  call   <min_from_time@plt>
  movq   %xmm0,%rax
  jmp    L53
  mov    -0x8(%rbp),%rax
  movq   %rax,%xmm0
  call   <sec_from_time@plt>
  movq   %xmm0,%rax
  jmp    L53
L42:
  mov    -0x8(%rbp),%rax
  movq   %rax,%xmm0
  call   <ms_from_time@plt>
  movq   %xmm0,%rax
L53:
  movq   %rax,%xmm0
  leave
  ret
```

assistant: ```c
double make_part(double t, int shift) {
  switch (shift) {
  case 0:
    return year_from_time(t);
  case 1:
    return month_from_time(t);
  case 2:
    return date_from_time(t);
  case 3:
    return hour_from_time(t);
  case 4:
    return min_from_time(t);
  case 5:
    return sec_from_time(t);
  default:
    return ms_from_time(t);
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<make_part>:
  endbr64
  sub    $0x8,%rsp
  cmp    $0x5,%edi
  ja     L56
  mov    %edi,%edi
  lea    D6(%rip),%rdx
  movslq (%rdx,%rdi,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  call   <year_from_time@plt>
L1:
  add    $0x8,%rsp
  ret
  call   <month_from_time@plt>
  jmp    L1
  call   <date_from_time@plt>
  jmp    L1
  call   <hour_from_time@plt>
  jmp    L1
  call   <min_from_time@plt>
  jmp    L1
  call   <sec_from_time@plt>
  jmp    L1
L56:
  call   <ms_from_time@plt>
  jmp    L1
```

assistant: ```c
double make_part(double t, int shift) {
  switch (shift) {
  case 0:
    return year_from_time(t);
  case 1:
    return month_from_time(t);
  case 2:
    return date_from_time(t);
  case 3:
    return hour_from_time(t);
  case 4:
    return min_from_time(t);
  case 5:
    return sec_from_time(t);
  default:
    return ms_from_time(t);
  }
}
```
user: 请从给定的汇编指令推导出C源代码：

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

assistant: ```c
void __swap(int *x, int *y) {
  int temp;
  temp = *x;
  *x = *y;
  *y = temp;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<__swap>:
  endbr64
  mov    (%rdi),%eax
  mov    (%rsi),%edx
  mov    %edx,(%rdi)
  mov    %eax,(%rsi)
  ret
```

assistant: ```c
void __swap(int *x, int *y) {
  int temp;
  temp = *x;
  *x = *y;
  *y = temp;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<__swap>:
  endbr64
  mov    (%rdi),%eax
  mov    (%rsi),%edx
  mov    %edx,(%rdi)
  mov    %eax,(%rsi)
  ret
```

assistant: ```c
void __swap(int *x, int *y) {
  int temp;
  temp = *x;
  *x = *y;
  *y = temp;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<__swap>:
  endbr64
  mov    (%rdi),%eax
  mov    (%rsi),%edx
  mov    %edx,(%rdi)
  mov    %eax,(%rsi)
  ret
```

assistant: ```c
void __swap(int *x, int *y) {
  int temp;
  temp = *x;
  *x = *y;
  *y = temp;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<RandomFunc>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  shr    $0x3,%eax
  or     $0x61bab5,%eax
  mov    %eax,-0xc(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L17
L29:
  mov    -0xc(%rbp),%edx
  mov    -0xc(%rbp),%eax
  shr    $0x3,%eax
  and    $0x6,%eax
  or     $0x1,%eax
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  mov    %eax,-0xc(%rbp)
  addl   $0x2,-0x10(%rbp)
L17:
  cmpl   $0x0,-0x10(%rbp)
  je     L29
  mov    -0xc(%rbp),%eax
  and    $0x8a06660,%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L12
  call   <__stack_chk_fail@plt>
L12:
  leave
  ret
```

assistant: ```c
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned int local1;
  {
    state[0UL] = (input[0UL] | 51238316UL) >> 3U;
    local1 = 0UL;
    while (local1 < 1UL) {
      state[0UL] <<= ((state[0UL] >> 3U) & 7U) | 1UL;
      local1 += 2UL;
    }
    output[0UL] = (state[0UL] & 144997984UL) & 434169834U;
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<RandomFunc>:
  endbr64
  mov    (%rdi),%eax
  shl    $0x4,%eax
  and    $0x8a06600,%eax
  or     $0x804200,%eax
  mov    %eax,(%rsi)
  ret
```

assistant: ```c
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned int local1;
  {
    state[0UL] = (input[0UL] | 51238316UL) >> 3U;
    local1 = 0UL;
    while (local1 < 1UL) {
      state[0UL] <<= ((state[0UL] >> 3U) & 7U) | 1UL;
      local1 += 2UL;
    }
    output[0UL] = (state[0UL] & 144997984UL) & 434169834U;
  }
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<RandomFunc>:
  endbr64
  mov    (%rdi),%eax
  shl    $0x4,%eax
  and    $0x8a06600,%eax
  or     $0x804200,%eax
  mov    %eax,(%rsi)
  ret
```

assistant: ```c
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned int local1;
  {
    state[0UL] = (input[0UL] | 51238316UL) >> 3U;
    local1 = 0UL;
    while (local1 < 1UL) {
      state[0UL] <<= ((state[0UL] >> 3U) & 7U) | 1UL;
      local1 += 2UL;
    }
    output[0UL] = (state[0UL] & 144997984UL) & 434169834U;
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<RandomFunc>:
  endbr64
  mov    (%rdi),%eax
  shl    $0x4,%eax
  and    $0x8a06600,%eax
  or     $0x804200,%eax
  mov    %eax,(%rsi)
  ret
```

assistant: ```c
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned int local1;
  {
    state[0UL] = (input[0UL] | 51238316UL) >> 3U;
    local1 = 0UL;
    while (local1 < 1UL) {
      state[0UL] <<= ((state[0UL] >> 3U) & 7U) | 1UL;
      local1 += 2UL;
    }
    output[0UL] = (state[0UL] & 144997984UL) & 434169834U;
  }
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<entry_fits_down>:
  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)
  mov    %r9,-0x30(%rbp)
  movl   $0x1,-0xc(%rbp)
  mov    -0x28(%rbp),%edx
  mov    0x10(%rbp),%eax
  add    %edx,%eax
  cmp    %eax,-0x20(%rbp)
  jge    L101
  mov    $0x0,%eax
  jmp    L67
L101:
  cmpl   $0x0,-0x28(%rbp)
  jle    L23
  mov    -0x28(%rbp),%eax
  sub    $0x1,%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x23,%al
  je     L23
  mov    $0x0,%eax
  jmp    L67
L23:
  mov    -0x28(%rbp),%edx
  mov    0x10(%rbp),%eax
  add    %edx,%eax
  cmp    %eax,-0x20(%rbp)
  jle    L117
  mov    -0x28(%rbp),%edx
  mov    0x10(%rbp),%eax
  add    %edx,%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x23,%al
  je     L117
  mov    $0x0,%eax
  jmp    L67
L117:
  movl   $0x0,-0x8(%rbp)
  jmp    L89
L88:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%edx
  mov    -0x28(%rbp),%ecx
  mov    -0x8(%rbp),%eax
  add    %ecx,%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x24(%rbp),%eax
  add    %ecx,%eax
  movslq %eax,%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <matches@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  jne    L9
  mov    $0x0,%eax
  jmp    L67
L9:
  cmpl   $0x1,-0x4(%rbp)
  jne    L51
  movl   $0x0,-0xc(%rbp)
L51:
  addl   $0x1,-0x8(%rbp)
L89:
  mov    -0x8(%rbp),%eax
  cmp    0x10(%rbp),%eax
  jl     L88
  cmpl   $0x0,-0xc(%rbp)
  je     L96
  mov    $0x2,%eax
  jmp    L67
L96:
  mov    $0x1,%eax
L67:
  leave
  ret
```

assistant: ```c
int entry_fits_down(const char *grid, int w, int h, int i, int j, const char *word, int wlen) {
  int exact_match = 1;
  int k;
  if (j + wlen > h)
    return 0;
  if (j > 0 && grid[(j - 1) * w + i] != '#')
    return 0;
  if (j + wlen < h && grid[(j + wlen) * w + i] != '#')
    return 0;
  for (k = 0; k < wlen; ++k) {
    int rc = matches(grid[(j + k) * w + i], word[k]);
    if (rc == 0)
      return 0;
    else if (rc == 1)
      exact_match = 0;
  }
  return exact_match ? 2 : 1;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<entry_fits_down>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %esi,%edi
  mov    %edx,%esi
  mov    %ecx,%edx
  mov    0x40(%rsp),%r10d
  lea    (%r8,%r10,1),%ecx
  mov    $0x0,%eax
  cmp    %esi,%ecx
  jg     L29
  test   %r8d,%r8d
  jle    L69
  lea    -0x1(%r8),%r11d
  imul   %edi,%r11d
  add    %edx,%r11d
  movslq %r11d,%r11
  cmpb   $0x23,(%rbx,%r11,1)
  jne    L29
L69:
  cmp    %esi,%ecx
  jl     L21
L51:
  mov    $0x2,%eax
  test   %r10d,%r10d
  jle    L29
  mov    %r9,%rbp
  movslq %edi,%r15
  imul   %edi,%r8d
  movslq %r8d,%r8
  movslq %edx,%rdx
  add    %rdx,%r8
  add    %r8,%rbx
  lea    -0x1(%r10),%eax
  lea    0x1(%r9,%rax,1),%r14
  mov    $0x1,%r12d
  mov    $0x0,%r13d
L80:
  movsbl 0x0(%rbp),%esi
  movsbl (%rbx),%edi
  call   <matches@plt>
  test   %eax,%eax
  je     L29
  cmp    $0x1,%eax
  cmove  %r13d,%r12d
  add    $0x1,%rbp
  add    %r15,%rbx
  cmp    %r14,%rbp
  jne    L80
  cmp    $0x1,%r12d
  mov    $0x1,%eax
  sbb    $0xffffffff,%eax
L29:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L21:
  imul   %edi,%ecx
  add    %edx,%ecx
  movslq %ecx,%rcx
  mov    $0x0,%eax
  cmpb   $0x23,(%rbx,%rcx,1)
  jne    L29
  jmp    L51
```

assistant: ```c
int entry_fits_down(const char *grid, int w, int h, int i, int j, const char *word, int wlen) {
  int exact_match = 1;
  int k;
  if (j + wlen > h)
    return 0;
  if (j > 0 && grid[(j - 1) * w + i] != '#')
    return 0;
  if (j + wlen < h && grid[(j + wlen) * w + i] != '#')
    return 0;
  for (k = 0; k < wlen; ++k) {
    int rc = matches(grid[(j + k) * w + i], word[k]);
    if (rc == 0)
      return 0;
    else if (rc == 1)
      exact_match = 0;
  }
  return exact_match ? 2 : 1;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<entry_fits_down>:
  endbr64
  push   %r15
  movslq %ecx,%rax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    0x40(%rsp),%r10d
  lea    (%r8,%r10,1),%ecx
  cmp    %edx,%ecx
  jg     L103
  test   %r8d,%r8d
  jle    L93
  lea    -0x1(%r8),%r11d
  imul   %esi,%r11d
  add    %eax,%r11d
  movslq %r11d,%r11
  cmpb   $0x23,(%rdi,%r11,1)
  je     L93
L103:
  xor    %eax,%eax
L36:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L93:
  cmp    %edx,%ecx
  jge    L44
  imul   %esi,%ecx
  add    %eax,%ecx
  movslq %ecx,%rcx
  cmpb   $0x23,(%rdi,%rcx,1)
  jne    L103
L44:
  test   %r10d,%r10d
  jle    L33
  imul   %esi,%r8d
  mov    %r9,%r14
  movslq %esi,%rbp
  mov    $0x1,%r15d
  xor    %r12d,%r12d
  movslq %r8d,%rbx
  add    %rax,%rbx
  lea    -0x1(%r10),%eax
  add    %rdi,%rbx
  lea    0x1(%r9,%rax,1),%r13
  jmp    L105
  xchg   %ax,%ax
L56:
  cmp    $0x1,%eax
  cmove  %r12d,%r15d
  add    $0x1,%r14
  add    %rbp,%rbx
  cmp    %r13,%r14
  je     L91
L105:
  movsbl (%r14),%esi
  movsbl (%rbx),%edi
  call   <matches@plt>
  test   %eax,%eax
  jne    L56
  jmp    L103
  nopl   (%rax)
L91:
  add    $0x8,%rsp
  lea    0x1(%r15),%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L33:
  mov    $0x2,%eax
  jmp    L36
```

assistant: ```c
int entry_fits_down(const char *grid, int w, int h, int i, int j, const char *word, int wlen) {
  int exact_match = 1;
  int k;
  if (j + wlen > h)
    return 0;
  if (j > 0 && grid[(j - 1) * w + i] != '#')
    return 0;
  if (j + wlen < h && grid[(j + wlen) * w + i] != '#')
    return 0;
  for (k = 0; k < wlen; ++k) {
    int rc = matches(grid[(j + k) * w + i], word[k]);
    if (rc == 0)
      return 0;
    else if (rc == 1)
      exact_match = 0;
  }
  return exact_match ? 2 : 1;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<entry_fits_down>:
  endbr64
  push   %r15
  movslq %ecx,%rax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    0x40(%rsp),%r10d
  lea    (%r8,%r10,1),%ecx
  cmp    %edx,%ecx
  jg     L55
  test   %r8d,%r8d
  jle    L71
  lea    -0x1(%r8),%r11d
  imul   %esi,%r11d
  add    %eax,%r11d
  movslq %r11d,%r11
  cmpb   $0x23,(%rdi,%r11,1)
  je     L71
L55:
  xor    %eax,%eax
L45:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L71:
  cmp    %edx,%ecx
  jge    L8
  imul   %esi,%ecx
  add    %eax,%ecx
  movslq %ecx,%rcx
  cmpb   $0x23,(%rdi,%rcx,1)
  jne    L55
L8:
  test   %r10d,%r10d
  jle    L39
  imul   %esi,%r8d
  mov    %r9,%r14
  movslq %esi,%rbp
  mov    $0x1,%r15d
  xor    %r12d,%r12d
  movslq %r8d,%rbx
  add    %rax,%rbx
  lea    -0x1(%r10),%eax
  add    %rdi,%rbx
  lea    0x1(%r9,%rax,1),%r13
  jmp    L11
  xchg   %ax,%ax
L42:
  cmp    $0x1,%eax
  cmove  %r12d,%r15d
  add    $0x1,%r14
  add    %rbp,%rbx
  cmp    %r13,%r14
  je     L7
L11:
  movsbl (%r14),%esi
  movsbl (%rbx),%edi
  call   <matches@plt>
  test   %eax,%eax
  jne    L42
  jmp    L55
  nopl   (%rax)
L7:
  add    $0x8,%rsp
  lea    0x1(%r15),%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L39:
  mov    $0x2,%eax
  jmp    L45
```

assistant: ```c
int entry_fits_down(const char *grid, int w, int h, int i, int j, const char *word, int wlen) {
  int exact_match = 1;
  int k;
  if (j + wlen > h)
    return 0;
  if (j > 0 && grid[(j - 1) * w + i] != '#')
    return 0;
  if (j + wlen < h && grid[(j + wlen) * w + i] != '#')
    return 0;
  for (k = 0; k < wlen; ++k) {
    int rc = matches(grid[(j + k) * w + i], word[k]);
    if (rc == 0)
      return 0;
    else if (rc == 1)
      exact_match = 0;
  }
  return exact_match ? 2 : 1;
}
```