ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请从给定的汇编指令推导出C源代码：

```asm
<TimerControlWaitOnTrigger>:
  endbr64
  test   %sil,%sil
  je     L27
  test   %edx,%edx
  je     L12
  lea    0x4(%rdi),%eax
  cltq
  mov    (%rax),%edx
  or     $0x40,%edx
  mov    %edx,(%rax)
  test   $0xff00,%esi
  je     L31
L34:
  add    $0x8,%edi
  movslq %edi,%rdi
  mov    (%rdi),%eax
  or     $0x40,%eax
  mov    %eax,(%rdi)
  ret
L31:
  ret
L12:
  lea    0x4(%rdi),%eax
  cltq
  mov    (%rax),%edx
  and    $0xffffffbf,%edx
  mov    %edx,(%rax)
  test   $0xff00,%esi
  jne    L30
  ret
L27:
  test   $0xff00,%esi
  je     L44
  test   %edx,%edx
  jne    L34
L30:
  add    $0x8,%edi
  movslq %edi,%rdi
  mov    (%rdi),%eax
  and    $0xffffffbf,%eax
  mov    %eax,(%rdi)
L44:
  ret
```

assistant: ```c
void TimerControlWaitOnTrigger(uint32_t ui32Base, uint32_t ui32Timer, bool bWait) {
  ;

  ;
  if ((ui32Timer & 0x000000ff) != 0) {
    if (bWait) {
      (*((volatile uint32_t *)(ui32Base + 0x00000004))) |= 0x00000040;
    } else {
      (*((volatile uint32_t *)(ui32Base + 0x00000004))) &= ~(0x00000040);
    }
  }
  if ((ui32Timer & 0x0000ff00) != 0) {
    if (bWait) {
      (*((volatile uint32_t *)(ui32Base + 0x00000008))) |= 0x00000040;
    } else {
      (*((volatile uint32_t *)(ui32Base + 0x00000008))) &= ~(0x00000040);
    }
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<TimerControlWaitOnTrigger>:
  endbr64
  mov    %esi,%ecx
  and    $0xff00,%ecx
  test   %sil,%sil
  je     L47
  lea    0x4(%rdi),%eax
  test   %edx,%edx
  cltq
  mov    (%rax),%edx
  je     L27
  or     $0x40,%edx
  mov    %edx,(%rax)
  test   %ecx,%ecx
  je     L11
L58:
  add    $0x8,%edi
  movslq %edi,%rdi
  mov    (%rdi),%eax
  or     $0x40,%eax
  mov    %eax,(%rdi)
  ret
  nopl   0x0(%rax,%rax,1)
L47:
  test   %ecx,%ecx
  je     L11
  test   %edx,%edx
  jne    L58
L55:
  add    $0x8,%edi
  movslq %edi,%rdi
  mov    (%rdi),%eax
  and    $0xffffffbf,%eax
  mov    %eax,(%rdi)
L11:
  ret
  xchg   %ax,%ax
L27:
  and    $0xffffffbf,%edx
  mov    %edx,(%rax)
  test   %ecx,%ecx
  jne    L55
  ret
```

assistant: ```c
void TimerControlWaitOnTrigger(uint32_t ui32Base, uint32_t ui32Timer, bool bWait) {
  ;

  ;
  if ((ui32Timer & 0x000000ff) != 0) {
    if (bWait) {
      (*((volatile uint32_t *)(ui32Base + 0x00000004))) |= 0x00000040;
    } else {
      (*((volatile uint32_t *)(ui32Base + 0x00000004))) &= ~(0x00000040);
    }
  }
  if ((ui32Timer & 0x0000ff00) != 0) {
    if (bWait) {
      (*((volatile uint32_t *)(ui32Base + 0x00000008))) |= 0x00000040;
    } else {
      (*((volatile uint32_t *)(ui32Base + 0x00000008))) &= ~(0x00000040);
    }
  }
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<TimerControlWaitOnTrigger>:
  endbr64
  mov    %esi,%ecx
  and    $0xff00,%ecx
  test   %sil,%sil
  je     L58
  lea    0x4(%rdi),%eax
  test   %edx,%edx
  cltq
  mov    (%rax),%edx
  je     L36
  or     $0x40,%edx
  mov    %edx,(%rax)
  test   %ecx,%ecx
  je     L43
L4:
  add    $0x8,%edi
  movslq %edi,%rdi
  mov    (%rdi),%eax
  or     $0x40,%eax
  mov    %eax,(%rdi)
  ret
  nopl   0x0(%rax,%rax,1)
L58:
  test   %ecx,%ecx
  je     L43
  test   %edx,%edx
  jne    L4
L15:
  add    $0x8,%edi
  movslq %edi,%rdi
  mov    (%rdi),%eax
  and    $0xffffffbf,%eax
  mov    %eax,(%rdi)
L43:
  ret
  xchg   %ax,%ax
L36:
  and    $0xffffffbf,%edx
  mov    %edx,(%rax)
  test   %ecx,%ecx
  jne    L15
  ret
```

assistant: ```c
void TimerControlWaitOnTrigger(uint32_t ui32Base, uint32_t ui32Timer, bool bWait) {
  ;

  ;
  if ((ui32Timer & 0x000000ff) != 0) {
    if (bWait) {
      (*((volatile uint32_t *)(ui32Base + 0x00000004))) |= 0x00000040;
    } else {
      (*((volatile uint32_t *)(ui32Base + 0x00000004))) &= ~(0x00000040);
    }
  }
  if ((ui32Timer & 0x0000ff00) != 0) {
    if (bWait) {
      (*((volatile uint32_t *)(ui32Base + 0x00000008))) |= 0x00000040;
    } else {
      (*((volatile uint32_t *)(ui32Base + 0x00000008))) &= ~(0x00000040);
    }
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<set_ioprio>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,%ecx
  mov    $0x0,%edx
  mov    $0x2,%esi
  mov    $0xfb,%edi
  call   <syscall@plt>
  cmp    $0xffffffff,%eax
  jne    L9
  lea    D5(%rip),%rax
  mov    %rax,%rdi
  call   <perror@plt>
L9:
  nop
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D5
type_guessed: string

tool: D5: Can not set IO priority to idle class

assistant: ```c
void set_ioprio(int prio) {
  if (syscall(251, 2, 0, prio) == -1)
    perror("Can not set IO priority to idle class");
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<set_ioprio>:
  endbr64
  sub    $0x8,%rsp
  mov    %edi,%ecx
  mov    $0x0,%edx
  mov    $0x2,%esi
  mov    $0xfb,%edi
  call   <syscall@plt>
  cmp    $0xffffffff,%eax
  je     L11
L13:
  add    $0x8,%rsp
  ret
L11:
  lea    D0(%rip),%rdi
  call   <perror@plt>
  jmp    L13
```

tool_calls: name: unpack_data
arguments: data_label: D0
datatype: string

tool: D0: Can not set IO priority to idle class

assistant: ```c
void set_ioprio(int prio) {
  if (syscall(251, 2, 0, prio) == -1)
    perror("Can not set IO priority to idle class");
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<set_ioprio>:
  endbr64
  sub    $0x8,%rsp
  mov    %edi,%ecx
  xor    %edx,%edx
  mov    $0x2,%esi
  mov    $0xfb,%edi
  call   <syscall@plt>
  cmp    $0xffffffff,%eax
  je     L0
  add    $0x8,%rsp
  ret
  nopl   (%rax)
L0:
  lea    D5(%rip),%rdi
  add    $0x8,%rsp
  jmp    1070 <perror@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D5
type_infered: string

tool: D5: Can not set IO priority to idle class

assistant: ```c
void set_ioprio(int prio) {
  if (syscall(251, 2, 0, prio) == -1)
    perror("Can not set IO priority to idle class");
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<set_ioprio>:
  endbr64
  sub    $0x8,%rsp
  mov    %edi,%ecx
  xor    %edx,%edx
  mov    $0x2,%esi
  mov    $0xfb,%edi
  call   <syscall@plt>
  cmp    $0xffffffff,%eax
  je     L8
  add    $0x8,%rsp
  ret
  nopl   (%rax)
L8:
  lea    D6(%rip),%rdi
  add    $0x8,%rsp
  jmp    1070 <perror@plt>
```

tool_calls: name: retrieve_data
arguments: label: D6
data_type: string

tool: D6: Can not set IO priority to idle class

assistant: ```c
void set_ioprio(int prio) {
  if (syscall(251, 2, 0, prio) == -1)
    perror("Can not set IO priority to idle class");
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<t4>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,%edx
  mov    %esi,%eax
  mov    %dx,-0x4(%rbp)
  mov    %ax,-0x8(%rbp)
  movzwl -0x4(%rbp),%eax
  mov    %eax,%edx
  lea    D33(%rip),%rax
  mov    %rax,%rsi
  lea    D20(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movzwl -0x8(%rbp),%eax
  mov    %eax,%edx
  lea    D33(%rip),%rax
  mov    %rax,%rsi
  lea    D27(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movzwl -0x4(%rbp),%edx
  movzwl -0x8(%rbp),%eax
  add    %edx,%eax
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D33
type: string
name: read_data
arguments: data_label: D20
type: string
name: read_data
arguments: data_label: D27
type: string

tool: D33: t4

tool: D20: %s: a: %u


tool: D27: %s: b: %u


assistant: ```c
unsigned short t4(unsigned short a, unsigned short b) {
  printf("%s: a: %u\n", __func__, a);
  printf("%s: b: %u\n", __func__, b);
  return a + b;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<t4>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%ebp
  mov    %esi,%ebx
  movzwl %di,%edx
  lea    D26(%rip),%r12
  mov    %r12,%rsi
  lea    D14(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movzwl %bx,%edx
  mov    %r12,%rsi
  lea    D1(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    (%rbx,%rbp,1),%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D26
type: string
name: extract_symbolic_data
arguments: tag: D14
type: string
name: extract_symbolic_data
arguments: tag: D1
type: string

tool: D26: t4

tool: D14: %s: a: %u


tool: D1: %s: b: %u


assistant: ```c
unsigned short t4(unsigned short a, unsigned short b) {
  printf("%s: a: %u\n", __func__, a);
  printf("%s: b: %u\n", __func__, b);
  return a + b;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<t4>:
  endbr64
  push   %r12
  lea    D16(%rip),%r12
  movzwl %di,%edx
  xor    %eax,%eax
  push   %rbp
  mov    %edi,%ebp
  lea    D21(%rip),%rdi
  push   %rbx
  mov    %esi,%ebx
  mov    %r12,%rsi
  call   <printf@plt>
  movzwl %bx,%edx
  mov    %r12,%rsi
  xor    %eax,%eax
  lea    D14(%rip),%rdi
  call   <printf@plt>
  lea    (%rbx,%rbp,1),%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

tool_calls: name: parse_data
arguments: label: D16
type_guessed: string
name: parse_data
arguments: label: D21
type_guessed: string
name: parse_data
arguments: label: D14
type_guessed: string

tool: D16: t4

tool: D21: %s: a: %u


tool: D14: %s: b: %u


assistant: ```c
unsigned short t4(unsigned short a, unsigned short b) {
  printf("%s: a: %u\n", __func__, a);
  printf("%s: b: %u\n", __func__, b);
  return a + b;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<t4>:
  endbr64
  push   %r12
  lea    D4(%rip),%r12
  movzwl %di,%edx
  xor    %eax,%eax
  push   %rbp
  mov    %edi,%ebp
  lea    D19(%rip),%rdi
  push   %rbx
  mov    %esi,%ebx
  mov    %r12,%rsi
  call   <printf@plt>
  movzwl %bx,%edx
  mov    %r12,%rsi
  xor    %eax,%eax
  lea    D8(%rip),%rdi
  call   <printf@plt>
  lea    (%rbx,%rbp,1),%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D4
type: string
name: retrieve_data
arguments: data_label: D19
type: string
name: retrieve_data
arguments: data_label: D8
type: string

tool: D4: t4

tool: D19: %s: a: %u


tool: D8: %s: b: %u


assistant: ```c
unsigned short t4(unsigned short a, unsigned short b) {
  printf("%s: a: %u\n", __func__, a);
  printf("%s: b: %u\n", __func__, b);
  return a + b;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<get_unaligned_uint16>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movzwl (%rax),%eax
  pop    %rbp
  ret
```

assistant: ```c
unsigned short get_unaligned_uint16(const void *p) {
  const struct { unsigned short d; } __attribute__((packed)) *pp = p;
  return pp->d;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<get_unaligned_uint16>:
  endbr64
  movzwl (%rdi),%eax
  ret
```

assistant: ```c
unsigned short get_unaligned_uint16(const void *p) {
  const struct { unsigned short d; } __attribute__((packed)) *pp = p;
  return pp->d;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<get_unaligned_uint16>:
  endbr64
  movzwl (%rdi),%eax
  ret
```

assistant: ```c
unsigned short get_unaligned_uint16(const void *p) {
  const struct { unsigned short d; } __attribute__((packed)) *pp = p;
  return pp->d;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<get_unaligned_uint16>:
  endbr64
  movzwl (%rdi),%eax
  ret
```

assistant: ```c
unsigned short get_unaligned_uint16(const void *p) {
  const struct { unsigned short d; } __attribute__((packed)) *pp = p;
  return pp->d;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<reverse_crc32>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %esi,-0xc(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <reverse_bits@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0xc(%rbp),%eax
  shl    $0x3,%eax
  mov    %eax,%esi
  mov    $0x2,%edi
  call   <pow_mod@plt>
  mov    %eax,%edi
  call   <reciprocal_mod@plt>
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  mov    %edx,%edi
  call   <multiply_mod@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <reverse_bits@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <htole32@plt>
  leave
  ret
```

assistant: ```c
uint32_t reverse_crc32(uint32_t delta, uint64_t endDistance) {
  delta = reverse_bits(delta);
  delta = (uint32_t)multiply_mod(reciprocal_mod(pow_mod(2, endDistance * 8)), delta);
  delta = reverse_bits(delta);
  return htole32(delta);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<reverse_crc32>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %esi,%ebx
  call   <reverse_bits@plt>
  mov    %rax,%rbp
  lea    0x0(,%rbx,8),%esi
  mov    $0x2,%edi
  call   <pow_mod@plt>
  mov    %eax,%edi
  call   <reciprocal_mod@plt>
  mov    %eax,%edi
  mov    %rbp,%rsi
  call   <multiply_mod@plt>
  mov    %rax,%rdi
  call   <reverse_bits@plt>
  mov    %rax,%rdi
  call   <htole32@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
uint32_t reverse_crc32(uint32_t delta, uint64_t endDistance) {
  delta = reverse_bits(delta);
  delta = (uint32_t)multiply_mod(reciprocal_mod(pow_mod(2, endDistance * 8)), delta);
  delta = reverse_bits(delta);
  return htole32(delta);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<reverse_crc32>:
  endbr64
  push   %rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x8,%rsp
  call   <reverse_bits@plt>
  lea    0x0(,%rbx,8),%esi
  mov    $0x2,%edi
  mov    %rax,%rbp
  call   <pow_mod@plt>
  mov    %eax,%edi
  call   <reciprocal_mod@plt>
  mov    %rbp,%rsi
  mov    %eax,%edi
  call   <multiply_mod@plt>
  mov    %rax,%rdi
  call   <reverse_bits@plt>
  add    $0x8,%rsp
  pop    %rbx
  mov    %rax,%rdi
  pop    %rbp
  jmp    1090 <htole32@plt>
```

assistant: ```c
uint32_t reverse_crc32(uint32_t delta, uint64_t endDistance) {
  delta = reverse_bits(delta);
  delta = (uint32_t)multiply_mod(reciprocal_mod(pow_mod(2, endDistance * 8)), delta);
  delta = reverse_bits(delta);
  return htole32(delta);
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<reverse_crc32>:
  endbr64
  push   %rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x8,%rsp
  call   <reverse_bits@plt>
  lea    0x0(,%rbx,8),%esi
  mov    $0x2,%edi
  mov    %rax,%rbp
  call   <pow_mod@plt>
  mov    %eax,%edi
  call   <reciprocal_mod@plt>
  mov    %rbp,%rsi
  mov    %eax,%edi
  call   <multiply_mod@plt>
  mov    %rax,%rdi
  call   <reverse_bits@plt>
  add    $0x8,%rsp
  pop    %rbx
  mov    %rax,%rdi
  pop    %rbp
  jmp    1090 <htole32@plt>
```

assistant: ```c
uint32_t reverse_crc32(uint32_t delta, uint64_t endDistance) {
  delta = reverse_bits(delta);
  delta = (uint32_t)multiply_mod(reciprocal_mod(pow_mod(2, endDistance * 8)), delta);
  delta = reverse_bits(delta);
  return htole32(delta);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<line_fill>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    %r8d,-0x20(%rbp)
  mov    %r9d,-0x34(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    0x18(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  jmp    L8
L38:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rcx
  mov    -0x8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  add    %rax,-0x8(%rbp)
  mov    0x20(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x10(%rbp)
  jge    L28
  movl   $0x0,-0xc(%rbp)
  jmp    L35
L52:
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movb   $0x20,(%rax)
  addl   $0x1,-0xc(%rbp)
L35:
  mov    -0xc(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L52
  cmpl   $0x0,0x10(%rbp)
  jle    L28
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movb   $0x20,(%rax)
  subl   $0x1,0x10(%rbp)
L28:
  addl   $0x1,-0x10(%rbp)
L8:
  mov    -0x10(%rbp),%eax
  cmp    0x20(%rbp),%eax
  jl     L38
  jmp    L18
L7:
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movb   $0x20,(%rax)
L18:
  mov    -0x8(%rbp),%rax
  sub    -0x18(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x20(%rbp),%eax
  cltq
  cmp    %rax,%rdx
  jl     L7
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movb   $0x0,(%rax)
  nop
  leave
  ret
```

assistant: ```c
void line_fill(char *line, int len, char **words, int *word_lens, int max_size, int even_spaces, int remain_spaces, int start, int end) {
  int i, j;
  char *p = line;
  for (i = start; i < end; i++) {
    memcpy(p, words[i], word_lens[i]);
    p += word_lens[i];
    if (i < end - 1) {
      for (j = 0; j < even_spaces; j++) {
        *p++ = ' ';
      }
      if (remain_spaces > 0) {
        *p++ = ' ';
        remain_spaces--;
      }
    }
  }
  while (p - line < max_size) {
    *p++ = ' ';
  }
  *p++ = '\0';
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<line_fill>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,(%rsp)
  mov    %r8d,0xc(%rsp)
  mov    %r9d,0x8(%rsp)
  mov    0x58(%rsp),%ebp
  mov    0x60(%rsp),%r14d
  cmp    %r14d,%ebp
  jge    L74
  movslq %ebp,%rax
  lea    (%rcx,%rax,4),%r12
  lea    (%rdx,%rax,8),%r13
  mov    %rdi,%rbx
  lea    -0x1(%r14),%r15d
  jmp    L5
L77:
  mov    %rbx,%rax
  jmp    L88
L33:
  add    $0x1,%ebp
  add    $0x4,%r12
  add    $0x8,%r13
  cmp    %ebp,%r14d
  je     L65
L5:
  mov    (%r12),%edx
  mov    0x0(%r13),%rsi
  mov    %rbx,%rdi
  call   <memcpy@plt>
  movslq (%r12),%rax
  add    %rax,%rbx
  cmp    %ebp,%r15d
  jle    L33
  mov    0x8(%rsp),%eax
  test   %eax,%eax
  jle    L77
  mov    %eax,%eax
  add    %rbx,%rax
L18:
  add    $0x1,%rbx
  movb   $0x20,-0x1(%rbx)
  cmp    %rbx,%rax
  jne    L18
L88:
  mov    %rax,%rbx
  cmpl   $0x0,0x50(%rsp)
  jle    L33
  lea    0x1(%rax),%rbx
  movb   $0x20,(%rax)
  subl   $0x1,0x50(%rsp)
  jmp    L33
L74:
  mov    (%rsp),%rbx
L65:
  movslq 0xc(%rsp),%rdx
  mov    %rbx,%rax
  sub    (%rsp),%rax
  cmp    %rdx,%rax
  jge    L87
L76:
  add    $0x1,%rbx
  movb   $0x20,-0x1(%rbx)
  mov    %rbx,%rax
  sub    (%rsp),%rax
  cmp    %rdx,%rax
  jl     L76
L87:
  movb   $0x0,(%rbx)
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void line_fill(char *line, int len, char **words, int *word_lens, int max_size, int even_spaces, int remain_spaces, int start, int end) {
  int i, j;
  char *p = line;
  for (i = start; i < end; i++) {
    memcpy(p, words[i], word_lens[i]);
    p += word_lens[i];
    if (i < end - 1) {
      for (j = 0; j < even_spaces; j++) {
        *p++ = ' ';
      }
      if (remain_spaces > 0) {
        *p++ = ' ';
        remain_spaces--;
      }
    }
  }
  while (p - line < max_size) {
    *p++ = ' ';
  }
  *p++ = '\0';
}
```
user: What is the c source code of the assembly code below?

```asm
<line_fill>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x28,%rsp
  mov    0x68(%rsp),%eax
  mov    0x70(%rsp),%edx
  mov    %r8d,0x1c(%rsp)
  mov    %r9d,0x18(%rsp)
  cmp    %edx,%eax
  jge    L24
  mov    %rcx,%r12
  lea    -0x1(%rdx),%ecx
  movslq %eax,%r13
  mov    %rdi,%r15
  mov    %ecx,%edx
  lea    0x1(%r13),%r14
  mov    %ecx,0x4(%rsp)
  sub    %eax,%edx
  lea    (%rdx,%r14,1),%rax
  mov    %rax,0x8(%rsp)
  movslq %r9d,%rax
  mov    %rax,0x10(%rsp)
  jmp    L34
  nopl   (%rax)
L38:
  mov    %r14,%r13
  cmp    0x8(%rsp),%r14
  je     L102
L64:
  add    $0x1,%r14
L34:
  mov    (%r12,%r13,4),%edx
  mov    0x0(%rbp,%r13,8),%rsi
  mov    %r15,%rdi
  call   <memcpy@plt>
  movslq (%r12,%r13,4),%rax
  add    %rax,%r15
  cmp    %r13d,0x4(%rsp)
  jle    L38
  mov    0x18(%rsp),%ecx
  test   %ecx,%ecx
  jle    L35
  mov    0x10(%rsp),%rax
  add    %r15,%rax
  nopl   (%rax)
L104:
  add    $0x1,%r15
  movb   $0x20,-0x1(%r15)
  cmp    %r15,%rax
  jne    L104
L78:
  mov    0x60(%rsp),%edx
  mov    %rax,%r15
  test   %edx,%edx
  jle    L38
  subl   $0x1,0x60(%rsp)
  add    $0x1,%r15
  mov    %r14,%r13
  movb   $0x20,(%rax)
  cmp    0x8(%rsp),%r14
  jne    L64
L102:
  mov    %r15,%rax
  sub    %rbx,%rax
L22:
  movslq 0x1c(%rsp),%rdx
  cmp    %rax,%rdx
  jle    L114
  nop
L109:
  add    $0x1,%r15
  movb   $0x20,-0x1(%r15)
  mov    %r15,%rax
  sub    %rbx,%rax
  cmp    %rdx,%rax
  jl     L109
L114:
  movb   $0x0,(%r15)
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L35:
  mov    %r15,%rax
  jmp    L78
L24:
  mov    %rdi,%r15
  xor    %eax,%eax
  jmp    L22
```

assistant: ```c
void line_fill(char *line, int len, char **words, int *word_lens, int max_size, int even_spaces, int remain_spaces, int start, int end) {
  int i, j;
  char *p = line;
  for (i = start; i < end; i++) {
    memcpy(p, words[i], word_lens[i]);
    p += word_lens[i];
    if (i < end - 1) {
      for (j = 0; j < even_spaces; j++) {
        *p++ = ' ';
      }
      if (remain_spaces > 0) {
        *p++ = ' ';
        remain_spaces--;
      }
    }
  }
  while (p - line < max_size) {
    *p++ = ' ';
  }
  *p++ = '\0';
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<gui_keyboard_default_bind>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <gui_keyboard_get_internal_code@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  je     L33
  mov    -0x10(%rbp),%rax
  jmp    L35
L33:
  mov    -0x18(%rbp),%rax
L35:
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <gui_keyboard_search@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L19
  mov    -0x20(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <gui_keyboard_new@plt>
L19:
  cmpq   $0x0,-0x10(%rbp)
  je     L23
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L23:
  nop
  leave
  ret
```

assistant: ```c
void gui_keyboard_default_bind(const char *key, const char *command) {
  struct t_gui_key *ptr_key;
  char *internal_code;
  internal_code = gui_keyboard_get_internal_code(key);
  ptr_key = gui_keyboard_search(NULL, (internal_code) ? internal_code : key);
  if (!ptr_key) {
    gui_keyboard_new(NULL, key, command);
  }
  if (internal_code)
    free(internal_code);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<gui_keyboard_default_bind>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbp
  mov    %rsi,%r12
  call   <gui_keyboard_get_internal_code@plt>
  test   %rax,%rax
  je     L17
  mov    %rax,%rbx
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <gui_keyboard_search@plt>
  test   %rax,%rax
  je     L12
L48:
  mov    %rbx,%rdi
  call   <free@plt>
L31:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L17:
  mov    %rbp,%rsi
  mov    $0x0,%edi
  call   <gui_keyboard_search@plt>
  test   %rax,%rax
  jne    L31
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    $0x0,%edi
  call   <gui_keyboard_new@plt>
  jmp    L31
L12:
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    $0x0,%edi
  call   <gui_keyboard_new@plt>
  jmp    L48
```

assistant: ```c
void gui_keyboard_default_bind(const char *key, const char *command) {
  struct t_gui_key *ptr_key;
  char *internal_code;
  internal_code = gui_keyboard_get_internal_code(key);
  ptr_key = gui_keyboard_search(NULL, (internal_code) ? internal_code : key);
  if (!ptr_key) {
    gui_keyboard_new(NULL, key, command);
  }
  if (internal_code)
    free(internal_code);
}
```