ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<sockaddr_in_set>:
  endbr64
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  test   %rdi,%rdi
  je     L3
  mov    D6(%rip),%rax
  mov    %edx,%edi
  mov    %rsi,%rbp
  mov    (%rax),%eax
  mov    %eax,0xc(%rbx)
  call   <htons@plt>
  lea    0x4(%rbx),%rsi
  mov    %rbp,%rdi
  mov    %eax,0x8(%rbx)
  call   <inet_aton@plt>
  test   %eax,%eax
  je     L3
  mov    (%rbx),%edi
  mov    $0x8,%edx
  xor    %esi,%esi
  call   <memset@plt>
  add    $0x8,%rsp
  mov    %rbx,%rax
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L3:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
struct sockaddr_in *sockaddr_in_set(struct sockaddr_in *sa, const char *ipaddr, int port) {
  if (!sa) {
    return NULL;
  }
  sa->sin_family = AF_INET;
  sa->sin_port = htons(port);
  if (!inet_aton(ipaddr, &(sa->sin_addr))) {
    return NULL;
  }
  memset(sa->sin_zero, '\0', 8);
  return sa;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<sockaddr_in_set>:
  endbr64
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  test   %rdi,%rdi
  je     L11
  mov    D9(%rip),%rax
  mov    %edx,%edi
  mov    %rsi,%rbp
  mov    (%rax),%eax
  mov    %eax,0xc(%rbx)
  call   <htons@plt>
  lea    0x4(%rbx),%rsi
  mov    %rbp,%rdi
  mov    %eax,0x8(%rbx)
  call   <inet_aton@plt>
  test   %eax,%eax
  je     L11
  mov    (%rbx),%edi
  mov    $0x8,%edx
  xor    %esi,%esi
  call   <memset@plt>
  add    $0x8,%rsp
  mov    %rbx,%rax
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L11:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
struct sockaddr_in *sockaddr_in_set(struct sockaddr_in *sa, const char *ipaddr, int port) {
  if (!sa) {
    return NULL;
  }
  sa->sin_family = AF_INET;
  sa->sin_port = htons(port);
  if (!inet_aton(ipaddr, &(sa->sin_addr))) {
    return NULL;
  }
  memset(sa->sin_zero, '\0', 8);
  return sa;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  movl   $0xa,-0x8(%rbp)
  cmpl   $0x4,-0x8(%rbp)
  jle    L18
  mov    $0x64,%eax
  jmp    L7
L18:
  mov    $0xc8,%eax
L7:
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D3
datatype: string

tool: D3: %d


assistant: ```c
main() {
  int a = 10, b;
  b = a >= 5 ? 100 : 200;
  printf("%d\n", b);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x64,%esi
  lea    D0(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

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

tool: D0: %d


assistant: ```c
main() {
  int a = 10, b;
  b = a >= 5 ? 100 : 200;
  printf("%d\n", b);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x64,%esi
  lea    D4(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D4
type: string

tool: D4: %d


assistant: ```c
main() {
  int a = 10, b;
  b = a >= 5 ? 100 : 200;
  printf("%d\n", b);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x64,%esi
  lea    D2(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D2
data_type: string

tool: D2: %d


assistant: ```c
main() {
  int a = 10, b;
  b = a >= 5 ? 100 : 200;
  printf("%d\n", b);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<find_block_start>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
L19:
  mov    -0x28(%rbp),%rdx
  mov    -0x20(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <read_line@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L30
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L11
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x23,%al
  jne    L2
L11:
  nop
  jmp    L19
L30:
  nop
L2:
  mov    -0x8(%rbp),%rax
  leave
  ret
```

assistant: ```c
char *find_block_start(FILE *file, char *buff, size_t buff_size) {
  char *line;
  for (;;) {
    line = read_line(file, buff, buff_size);
    if (line == NULL)
      break;
    if (strlen(line) == 0 || line[0] == '#')
      continue;
    else
      break;
  }
  return line;
}
```
user: What is the c source code of the assembly code below:

```asm
<find_block_start>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r12
  mov    %rsi,%rbp
  mov    %rdx,%rbx
L3:
  mov    %rbx,%rdx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <read_line@plt>
  test   %rax,%rax
  je     L7
  movzbl (%rax),%edx
  test   %dl,%dl
  je     L3
  cmp    $0x23,%dl
  je     L3
L7:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
char *find_block_start(FILE *file, char *buff, size_t buff_size) {
  char *line;
  for (;;) {
    line = read_line(file, buff, buff_size);
    if (line == NULL)
      break;
    if (strlen(line) == 0 || line[0] == '#')
      continue;
    else
      break;
  }
  return line;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<find_block_start>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdx,%rbx
L24:
  mov    %rbx,%rdx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <read_line@plt>
  test   %rax,%rax
  je     L22
  movzbl (%rax),%edx
  test   %dl,%dl
  je     L24
  cmp    $0x23,%dl
  je     L24
L22:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
char *find_block_start(FILE *file, char *buff, size_t buff_size) {
  char *line;
  for (;;) {
    line = read_line(file, buff, buff_size);
    if (line == NULL)
      break;
    if (strlen(line) == 0 || line[0] == '#')
      continue;
    else
      break;
  }
  return line;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<find_block_start>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdx,%rbx
L22:
  mov    %rbx,%rdx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <read_line@plt>
  test   %rax,%rax
  je     L21
  movzbl (%rax),%edx
  test   %dl,%dl
  je     L22
  cmp    $0x23,%dl
  je     L22
L21:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
char *find_block_start(FILE *file, char *buff, size_t buff_size) {
  char *line;
  for (;;) {
    line = read_line(file, buff, buff_size);
    if (line == NULL)
      break;
    if (strlen(line) == 0 || line[0] == '#')
      continue;
    else
      break;
  }
  return line;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x10(%rbp),%rcx
  lea    -0x14(%rbp),%rdx
  lea    -0x18(%rbp),%rax
  mov    %rax,%rsi
  lea    D32(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0x18(%rbp),%edx
  mov    -0x14(%rbp),%eax
  cmp    %eax,%edx
  jle    L29
  mov    -0x18(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x14(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x14(%rbp)
L29:
  mov    -0x18(%rbp),%edx
  mov    -0x10(%rbp),%eax
  cmp    %eax,%edx
  jle    L20
  mov    -0x18(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x10(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x10(%rbp)
L20:
  mov    -0x14(%rbp),%edx
  mov    -0x10(%rbp),%eax
  cmp    %eax,%edx
  jle    L31
  mov    -0x14(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x10(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x10(%rbp)
L31:
  mov    -0x18(%rbp),%edx
  mov    -0x14(%rbp),%eax
  add    %eax,%edx
  mov    -0x10(%rbp),%eax
  cmp    %eax,%edx
  jg     L70
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L22
L70:
  mov    -0x18(%rbp),%edx
  mov    -0x18(%rbp),%eax
  mov    %edx,%ecx
  imul   %eax,%ecx
  mov    -0x14(%rbp),%edx
  mov    -0x14(%rbp),%eax
  imul   %edx,%eax
  add    %eax,%ecx
  mov    -0x10(%rbp),%edx
  mov    -0x10(%rbp),%eax
  imul   %edx,%eax
  cmp    %eax,%ecx
  je     L55
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L22
L55:
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L22:
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L13
  call   <__stack_chk_fail@plt>
L13:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D32
type: string
name: unpack_data
arguments: label: D15
type: string
name: unpack_data
arguments: label: D2
type: string
name: unpack_data
arguments: label: D17
type: string

tool: D32: %d%d%d

tool: D15: not a triangle


tool: D2: no


tool: D17: yes


assistant: ```c
int main(void) {
  int a, b, c, t;
  scanf("%d%d%d", &a, &b, &c);
  if (a > b) {
    t = a;
    a = b;
    b = t;
  }
  if (a > c) {
    t = a;
    a = c;
    c = t;
  }
  if (b > c) {
    t = b;
    b = c;
    c = t;
  }
  if (a + b <= c)
    printf("not a triangle\n");
  else if (a * a + b * b != c * c)
    printf("no\n");
  else
    printf("yes\n");
  return 0;
}
```
user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x14(%rsp),%rcx
  lea    0x10(%rsp),%rdx
  lea    0xc(%rsp),%rsi
  lea    D26(%rip),%rdi
  call   <scanf@plt>
  mov    0xc(%rsp),%eax
  mov    0x10(%rsp),%edx
  cmp    %edx,%eax
  jle    L28
  mov    %edx,0xc(%rsp)
  mov    %eax,0x10(%rsp)
L28:
  mov    0xc(%rsp),%eax
  mov    0x14(%rsp),%edx
  cmp    %edx,%eax
  jle    L8
  mov    %edx,0xc(%rsp)
  mov    %eax,0x14(%rsp)
L8:
  mov    0x10(%rsp),%eax
  mov    0x14(%rsp),%edx
  cmp    %edx,%eax
  jle    L14
  mov    %edx,0x10(%rsp)
  mov    %eax,0x14(%rsp)
L14:
  mov    0xc(%rsp),%eax
  mov    0x10(%rsp),%ecx
  mov    0x14(%rsp),%edx
  lea    (%rax,%rcx,1),%esi
  cmp    %edx,%esi
  jle    L40
  imul   %eax,%eax
  imul   %ecx,%ecx
  add    %ecx,%eax
  imul   %edx,%edx
  cmp    %edx,%eax
  je     L29
  lea    D23(%rip),%rdi
  call   <printf@plt>
L78:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L63
  mov    $0x0,%eax
  add    $0x28,%rsp
  ret
L40:
  lea    D24(%rip),%rdi
  call   <printf@plt>
  jmp    L78
L29:
  lea    D38(%rip),%rdi
  call   <printf@plt>
  jmp    L78
L63:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D26
data_type: string
name: parse_data
arguments: label: D23
data_type: string
name: parse_data
arguments: label: D24
data_type: string
name: parse_data
arguments: label: D38
data_type: string

tool: D26: %d%d%d

tool: D23: no


tool: D24: not a triangle


tool: D38: yes


assistant: ```c
int main(void) {
  int a, b, c, t;
  scanf("%d%d%d", &a, &b, &c);
  if (a > b) {
    t = a;
    a = b;
    b = t;
  }
  if (a > c) {
    t = a;
    a = c;
    c = t;
  }
  if (b > c) {
    t = b;
    b = c;
    c = t;
  }
  if (a + b <= c)
    printf("not a triangle\n");
  else if (a * a + b * b != c * c)
    printf("no\n");
  else
    printf("yes\n");
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  sub    $0x28,%rsp
  lea    D4(%rip),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x14(%rsp),%rcx
  lea    0x10(%rsp),%rdx
  lea    0xc(%rsp),%rsi
  call   <scanf@plt>
  mov    0xc(%rsp),%eax
  mov    0x10(%rsp),%ecx
  cmp    %ecx,%eax
  jle    L1
  mov    %eax,%edx
  mov    %ecx,0xc(%rsp)
  mov    %eax,0x10(%rsp)
  mov    %ecx,%eax
  mov    %edx,%ecx
L1:
  mov    0x14(%rsp),%edx
  cmp    %edx,%eax
  jle    L59
  mov    %eax,%esi
  mov    %edx,0xc(%rsp)
  mov    %eax,0x14(%rsp)
  mov    %edx,%eax
  mov    %esi,%edx
L59:
  cmp    %edx,%ecx
  jle    L13
  mov    %ecx,%esi
  mov    %edx,0x10(%rsp)
  mov    %ecx,0x14(%rsp)
  mov    %edx,%ecx
  mov    %esi,%edx
L13:
  lea    (%rax,%rcx,1),%esi
  cmp    %edx,%esi
  jle    L5
  imul   %eax,%eax
  imul   %ecx,%ecx
  imul   %edx,%edx
  add    %ecx,%eax
  cmp    %edx,%eax
  je     L21
  lea    D26(%rip),%rdi
  call   <printf@plt>
L50:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L37
  xor    %eax,%eax
  add    $0x28,%rsp
  ret
L21:
  lea    D17(%rip),%rdi
  call   <printf@plt>
  jmp    L50
L5:
  lea    D37(%rip),%rdi
  call   <printf@plt>
  jmp    L50
L37:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D4
data_type: string
name: retrieve_data
arguments: data_tag: D26
data_type: string
name: retrieve_data
arguments: data_tag: D17
data_type: string
name: retrieve_data
arguments: data_tag: D37
data_type: string

tool: D4: %d%d%d

tool: D26: no


tool: D17: yes


tool: D37: not a triangle


assistant: ```c
int main(void) {
  int a, b, c, t;
  scanf("%d%d%d", &a, &b, &c);
  if (a > b) {
    t = a;
    a = b;
    b = t;
  }
  if (a > c) {
    t = a;
    a = c;
    c = t;
  }
  if (b > c) {
    t = b;
    b = c;
    c = t;
  }
  if (a + b <= c)
    printf("not a triangle\n");
  else if (a * a + b * b != c * c)
    printf("no\n");
  else
    printf("yes\n");
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<main>:
  endbr64
  sub    $0x28,%rsp
  lea    D23(%rip),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x14(%rsp),%rcx
  lea    0x10(%rsp),%rdx
  lea    0xc(%rsp),%rsi
  call   <scanf@plt>
  mov    0xc(%rsp),%eax
  mov    0x10(%rsp),%ecx
  cmp    %ecx,%eax
  jle    L71
  mov    %eax,%edx
  mov    %ecx,0xc(%rsp)
  mov    %eax,0x10(%rsp)
  mov    %ecx,%eax
  mov    %edx,%ecx
L71:
  mov    0x14(%rsp),%edx
  cmp    %edx,%eax
  jle    L12
  mov    %eax,%esi
  mov    %edx,0xc(%rsp)
  mov    %eax,0x14(%rsp)
  mov    %edx,%eax
  mov    %esi,%edx
L12:
  cmp    %edx,%ecx
  jle    L16
  mov    %ecx,%esi
  mov    %edx,0x10(%rsp)
  mov    %ecx,0x14(%rsp)
  mov    %edx,%ecx
  mov    %esi,%edx
L16:
  lea    (%rax,%rcx,1),%esi
  cmp    %edx,%esi
  jle    L34
  imul   %eax,%eax
  imul   %ecx,%ecx
  imul   %edx,%edx
  add    %ecx,%eax
  cmp    %edx,%eax
  je     L4
  lea    D35(%rip),%rdi
  call   <printf@plt>
L63:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L27
  xor    %eax,%eax
  add    $0x28,%rsp
  ret
L4:
  lea    D33(%rip),%rdi
  call   <printf@plt>
  jmp    L63
L34:
  lea    D2(%rip),%rdi
  call   <printf@plt>
  jmp    L63
L27:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D23
type_guessed: string
name: read_data
arguments: data_label: D35
type_guessed: string
name: read_data
arguments: data_label: D33
type_guessed: string
name: read_data
arguments: data_label: D2
type_guessed: string

tool: D23: %d%d%d

tool: D35: no


tool: D33: yes


tool: D2: not a triangle


assistant: ```c
int main(void) {
  int a, b, c, t;
  scanf("%d%d%d", &a, &b, &c);
  if (a > b) {
    t = a;
    a = b;
    b = t;
  }
  if (a > c) {
    t = a;
    a = c;
    c = t;
  }
  if (b > c) {
    t = b;
    b = c;
    c = t;
  }
  if (a + b <= c)
    printf("not a triangle\n");
  else if (a * a + b * b != c * c)
    printf("no\n");
  else
    printf("yes\n");
  return 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<mysql_connect>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  movl   $0x0,-0xc(%rbp)
  movl   $0xffffffff,-0x8(%rbp)
  movl   $0x0,-0x4(%rbp)
  mov    $0x0,%eax
  pop    %rbp
  ret
```

assistant: ```c
int mysql_connect(char *user, char *password) {
  int connected = 0;
  int i = -1;
  unsigned int count = 0;
  return 0;
}
```
user: What is the c source code of the assembly code below:

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

assistant: ```c
int mysql_connect(char *user, char *password) {
  int connected = 0;
  int i = -1;
  unsigned int count = 0;
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的?

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

assistant: ```c
int mysql_connect(char *user, char *password) {
  int connected = 0;
  int i = -1;
  unsigned int count = 0;
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

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

assistant: ```c
int mysql_connect(char *user, char *password) {
  int connected = 0;
  int i = -1;
  unsigned int count = 0;
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<bsearch_more>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  mov    %r8,-0x48(%rbp)
  movl   $0x0,-0x18(%rbp)
  mov    -0x38(%rbp),%rax
  sub    $0x1,%eax
  mov    %eax,-0x14(%rbp)
  jmp    L49
L70:
  mov    -0x18(%rbp),%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  cltq
  imul   -0x40(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    -0x48(%rbp),%rcx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   *%rcx
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  jns    L10
  mov    -0x10(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x14(%rbp)
  jmp    L49
L10:
  cmpl   $0x0,-0xc(%rbp)
  jle    L94
  mov    -0x10(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x18(%rbp)
  jmp    L49
L94:
  mov    -0x10(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  je     L98
  mov    -0x8(%rbp),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  jmp    L53
L98:
  mov    $0x0,%eax
  jmp    L53
L49:
  mov    -0x18(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jle    L70
  mov    -0x18(%rbp),%eax
  cltq
  mov    -0x38(%rbp),%rdx
  sub    $0x1,%rdx
  cmp    %rdx,%rax
  ja     L91
  mov    -0x18(%rbp),%eax
  cltq
  imul   -0x40(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  jmp    L53
L91:
  mov    $0x0,%eax
L53:
  leave
  ret
```

assistant: ```c
void *bsearch_more(const void *key, const void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)) {
  int l, u, idx;
  const void *p;
  int comparison;
  l = 0;
  u = nmemb - 1;
  while (l <= u) {
    idx = (l + u) / 2;
    p = (void *)(((const char *)base) + (idx * size));
    comparison = (*compar)(key, p);
    if (comparison < 0)
      u = idx - 1;
    else if (comparison > 0)
      l = idx + 1;
    else
      return (idx == u) ? NULL : (void *)(((const char *)p) + size);
  }
  return (l > nmemb - 1) ? NULL : (void *)(((const char *)base) + (l * size));
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<bsearch_more>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,0x10(%rsp)
  mov    %rsi,0x8(%rsp)
  mov    %rdx,0x18(%rsp)
  mov    %rcx,%r14
  mov    %edx,%r13d
  sub    $0x1,%r13d
  js     L37
  mov    %r8,%r15
  mov    $0x0,%r12d
  jmp    L15
L6:
  lea    -0x1(%rbx),%r13d
  jmp    L36
L58:
  lea    0x1(%rbx),%r12d
L36:
  cmp    %r13d,%r12d
  jg     L59
L15:
  lea    (%r12,%r13,1),%eax
  mov    %eax,%ebx
  shr    $0x1f,%ebx
  add    %eax,%ebx
  sar    %ebx
  movslq %ebx,%rbp
  imul   %r14,%rbp
  add    0x8(%rsp),%rbp
  mov    %rbp,%rsi
  mov    0x10(%rsp),%rdi
  call   *%r15
  test   %eax,%eax
  js     L6
  jg     L58
  lea    0x0(%rbp,%r14,1),%rax
  cmp    %r13d,%ebx
  mov    $0x0,%edx
  cmove  %rdx,%rax
  jmp    L62
L59:
  movslq %r12d,%r12
  mov    0x18(%rsp),%rdx
  sub    $0x1,%rdx
  mov    $0x0,%eax
  cmp    %rdx,%r12
  ja     L62
L17:
  imul   %r12,%r14
  mov    0x8(%rsp),%rax
  add    %r14,%rax
L62:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L37:
  mov    $0x0,%r12d
  jmp    L17
```

assistant: ```c
void *bsearch_more(const void *key, const void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)) {
  int l, u, idx;
  const void *p;
  int comparison;
  l = 0;
  u = nmemb - 1;
  while (l <= u) {
    idx = (l + u) / 2;
    p = (void *)(((const char *)base) + (idx * size));
    comparison = (*compar)(key, p);
    if (comparison < 0)
      u = idx - 1;
    else if (comparison > 0)
      l = idx + 1;
    else
      return (idx == u) ? NULL : (void *)(((const char *)p) + size);
  }
  return (l > nmemb - 1) ? NULL : (void *)(((const char *)base) + (l * size));
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<bsearch_more>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdx,0x18(%rsp)
  mov    %rcx,0x8(%rsp)
  mov    %r8,0x10(%rsp)
  sub    $0x1,%ebp
  js     L75
  mov    %rdi,%r13
  xor    %r15d,%r15d
  jmp    L29
  nopw   0x0(%rax,%rax,1)
L72:
  je     L59
  lea    0x1(%r14),%r15d
  cmp    %r15d,%ebp
  jl     L40
L29:
  lea    (%r15,%rbp,1),%edx
  mov    0x10(%rsp),%rax
  mov    %r13,%rdi
  sar    %edx
  movslq %edx,%rbx
  mov    %rbx,%r14
  imul   0x8(%rsp),%rbx
  add    %r12,%rbx
  mov    %rbx,%rsi
  call   *%rax
  test   %eax,%eax
  jns    L72
  lea    -0x1(%r14),%ebp
  cmp    %r15d,%ebp
  jge    L29
L40:
  movslq %r15d,%rcx
  mov    0x18(%rsp),%r15
  xor    %eax,%eax
  sub    $0x1,%r15
  cmp    %r15,%rcx
  ja     L68
  imul   0x8(%rsp),%rcx
  lea    (%r12,%rcx,1),%rax
L68:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L59:
  mov    0x8(%rsp),%rax
  xor    %edx,%edx
  add    %rbx,%rax
  cmp    %ebp,%r14d
  cmove  %rdx,%rax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L75:
  mov    %rsi,%rax
  jmp    L68
```

assistant: ```c
void *bsearch_more(const void *key, const void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)) {
  int l, u, idx;
  const void *p;
  int comparison;
  l = 0;
  u = nmemb - 1;
  while (l <= u) {
    idx = (l + u) / 2;
    p = (void *)(((const char *)base) + (idx * size));
    comparison = (*compar)(key, p);
    if (comparison < 0)
      u = idx - 1;
    else if (comparison > 0)
      l = idx + 1;
    else
      return (idx == u) ? NULL : (void *)(((const char *)p) + size);
  }
  return (l > nmemb - 1) ? NULL : (void *)(((const char *)base) + (l * size));
}
```