ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Translate the below assembly code into C programming language:

```asm
<read_counted_string>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%r12
  mov    %rdx,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x6(%rsp),%rdi
  mov    %rdx,%rsi
  call   <read_short@plt>
  mov    %rax,%rdx
  mov    $0x0,%eax
  test   %rdx,%rdx
  je     L26
  movzwl 0x6(%rsp),%edi
  mov    $0x0,%r13d
  test   %di,%di
  jne    L32
L4:
  mov    %r13,(%r12)
  movzwl 0x6(%rsp),%eax
  mov    %ax,0x0(%rbp)
  mov    $0x1,%eax
L26:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L13
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L32:
  movzwl %di,%edi
  call   <malloc@plt>
  mov    %rax,%r13
  mov    $0x0,%eax
  test   %r13,%r13
  je     L26
  movzwl 0x6(%rsp),%edx
  mov    %rbx,%rcx
  mov    $0x1,%esi
  mov    %r13,%rdi
  call   <fread@plt>
  movzwl 0x6(%rsp),%esi
  cmp    %si,%ax
  je     L4
  movzwl %si,%esi
  mov    %r13,%rdi
  call   <bzero@plt>
  mov    %r13,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  jmp    L26
L13:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int read_counted_string(unsigned short *countp, char **stringp, FILE *file) {
  unsigned short len;
  char *data;
  if (read_short(&len, file) == 0)
    return 0;
  if (len == 0) {
    data = 0;
  } else {
    data = malloc((unsigned)len);
    if (!data)
      return 0;
    if (fread(data, (int)sizeof(char), (int)len, file) != len) {
      bzero(data, len);
      free(data);
      return 0;
    }
  }
  *stringp = data;
  *countp = len;
  return 1;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<read_counted_string>:
  endbr64
  push   %r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %rsi,%rbp
  mov    %rdx,%rsi
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x6(%rsp),%rdi
  call   <read_short@plt>
  test   %rax,%rax
  je     L22
  movzwl 0x6(%rsp),%esi
  xor    %r13d,%r13d
  test   %si,%si
  jne    L40
L42:
  mov    %r13,0x0(%rbp)
  mov    $0x1,%eax
  mov    %si,(%rbx)
L26:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L54
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   (%rax)
L40:
  movzwl %si,%edi
  call   <malloc@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L22
  movzwl 0x6(%rsp),%edx
  mov    $0x1,%esi
  mov    %r12,%rcx
  mov    %rax,%rdi
  call   <fread@plt>
  movzwl 0x6(%rsp),%esi
  cmp    %si,%ax
  je     L42
  mov    %r13,%rdi
  call   <bzero@plt>
  mov    %r13,%rdi
  call   <free@plt>
  nop
L22:
  xor    %eax,%eax
  jmp    L26
L54:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int read_counted_string(unsigned short *countp, char **stringp, FILE *file) {
  unsigned short len;
  char *data;
  if (read_short(&len, file) == 0)
    return 0;
  if (len == 0) {
    data = 0;
  } else {
    data = malloc((unsigned)len);
    if (!data)
      return 0;
    if (fread(data, (int)sizeof(char), (int)len, file) != len) {
      bzero(data, len);
      free(data);
      return 0;
    }
  }
  *stringp = data;
  *countp = len;
  return 1;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<read_counted_string>:
  endbr64
  push   %r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %rsi,%rbp
  mov    %rdx,%rsi
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x6(%rsp),%rdi
  call   <read_short@plt>
  test   %rax,%rax
  je     L19
  movzwl 0x6(%rsp),%esi
  xor    %r13d,%r13d
  test   %si,%si
  jne    L45
L5:
  mov    %r13,0x0(%rbp)
  mov    $0x1,%eax
  mov    %si,(%rbx)
L2:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L31
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   (%rax)
L45:
  movzwl %si,%edi
  call   <malloc@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L19
  movzwl 0x6(%rsp),%edx
  mov    $0x1,%esi
  mov    %r12,%rcx
  mov    %rax,%rdi
  call   <fread@plt>
  movzwl 0x6(%rsp),%esi
  cmp    %si,%ax
  je     L5
  mov    %r13,%rdi
  call   <bzero@plt>
  mov    %r13,%rdi
  call   <free@plt>
  nop
L19:
  xor    %eax,%eax
  jmp    L2
L31:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int read_counted_string(unsigned short *countp, char **stringp, FILE *file) {
  unsigned short len;
  char *data;
  if (read_short(&len, file) == 0)
    return 0;
  if (len == 0) {
    data = 0;
  } else {
    data = malloc((unsigned)len);
    if (!data)
      return 0;
    if (fread(data, (int)sizeof(char), (int)len, file) != len) {
      bzero(data, len);
      free(data);
      return 0;
    }
  }
  *stringp = data;
  *countp = len;
  return 1;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<isdigit>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x4(%rbp)
  cmpl   $0x2f,-0x4(%rbp)
  jle    L11
  cmpl   $0x39,-0x4(%rbp)
  jg     L11
  mov    $0x1,%eax
  jmp    L18
L11:
  mov    $0x0,%eax
L18:
  pop    %rbp
  ret
```

assistant: ```c
int isdigit(int ch) {
  if ((ch >= '0') && (ch <= '9'))
    return 1;
  else
    return 0;
}
```
user: What is the c source code of the assembly code below:

```asm
<isdigit>:
  endbr64
  sub    $0x30,%edi
  cmp    $0x9,%edi
  setbe  %al
  movzbl %al,%eax
  ret
```

assistant: ```c
int isdigit(int ch) {
  if ((ch >= '0') && (ch <= '9'))
    return 1;
  else
    return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<isdigit>:
  endbr64
  sub    $0x30,%edi
  xor    %eax,%eax
  cmp    $0x9,%edi
  setbe  %al
  ret
```

assistant: ```c
int isdigit(int ch) {
  if ((ch >= '0') && (ch <= '9'))
    return 1;
  else
    return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<isdigit>:
  endbr64
  sub    $0x30,%edi
  xor    %eax,%eax
  cmp    $0x9,%edi
  setbe  %al
  ret
```

assistant: ```c
int isdigit(int ch) {
  if ((ch >= '0') && (ch <= '9'))
    return 1;
  else
    return 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0x48,%esi
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x65,%esi
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x6c,%esi
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x6c,%esi
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x6f,%esi
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x6f,%r9d
  mov    $0x6c,%r8d
  mov    $0x6c,%ecx
  mov    $0x65,%edx
  mov    $0x48,%esi
  lea    D58(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  pop    %rbp
  ret
```

tool_calls: name: parse_data
arguments: data_label: D15
type_infered: string
name: parse_data
arguments: data_label: D58
type_infered: string
name: parse_data
arguments: data_label: D13
type_infered: string

tool: D15: %c


tool: D58: %c%c%c%c%c


tool: D13: Hello world!

assistant: ```c
int main(void) {
  printf("%c\n", 'H');
  printf("%c\n", 'e');
  printf("%c\n", 'l');
  printf("%c\n", 'l');
  printf("%c\n", 'o');
  printf("%c%c%c%c%c\n", 'H', 'e', 'l', 'l', 'o');
  printf("%s\n", "Hello world!");
  return 0;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<main>:
  endbr64
  push   %rbx
  mov    $0x48,%esi
  lea    D13(%rip),%rbx
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x65,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x6c,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x6c,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x6f,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x6f,%r9d
  mov    $0x6c,%r8d
  mov    $0x6c,%ecx
  mov    $0x65,%edx
  mov    $0x48,%esi
  lea    D0(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D22(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  pop    %rbx
  ret
```

tool_calls: name: unpack_data
arguments: tag: D13
type: string
name: unpack_data
arguments: tag: D0
type: string
name: unpack_data
arguments: tag: D22
type: string

tool: D13: %c


tool: D0: %c%c%c%c%c


tool: D22: Hello world!

assistant: ```c
int main(void) {
  printf("%c\n", 'H');
  printf("%c\n", 'e');
  printf("%c\n", 'l');
  printf("%c\n", 'l');
  printf("%c\n", 'o');
  printf("%c%c%c%c%c\n", 'H', 'e', 'l', 'l', 'o');
  printf("%s\n", "Hello world!");
  return 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  push   %rbp
  lea    D20(%rip),%rbp
  mov    $0x48,%esi
  xor    %eax,%eax
  mov    %rbp,%rdi
  call   <printf@plt>
  mov    %rbp,%rdi
  mov    $0x65,%esi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rdi
  mov    $0x6c,%esi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rdi
  mov    $0x6c,%esi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rdi
  mov    $0x6f,%esi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x6f,%r9d
  mov    $0x6c,%r8d
  mov    $0x6c,%ecx
  mov    $0x65,%edx
  mov    $0x48,%esi
  lea    D8(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D6(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  pop    %rbp
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D20
data_type: string
name: retrieve_data
arguments: tag: D8
data_type: string
name: retrieve_data
arguments: tag: D6
data_type: string

tool: D20: %c


tool: D8: %c%c%c%c%c


tool: D6: Hello world!

assistant: ```c
int main(void) {
  printf("%c\n", 'H');
  printf("%c\n", 'e');
  printf("%c\n", 'l');
  printf("%c\n", 'l');
  printf("%c\n", 'o');
  printf("%c%c%c%c%c\n", 'H', 'e', 'l', 'l', 'o');
  printf("%s\n", "Hello world!");
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<main>:
  endbr64
  push   %rbp
  lea    D13(%rip),%rbp
  mov    $0x48,%esi
  xor    %eax,%eax
  mov    %rbp,%rdi
  call   <printf@plt>
  mov    %rbp,%rdi
  mov    $0x65,%esi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rdi
  mov    $0x6c,%esi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rdi
  mov    $0x6c,%esi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rdi
  mov    $0x6f,%esi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x6f,%r9d
  mov    $0x6c,%r8d
  mov    $0x6c,%ecx
  mov    $0x65,%edx
  mov    $0x48,%esi
  lea    D7(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D1(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  pop    %rbp
  ret
```

tool_calls: name: read_data
arguments: data_label: D13
type_guessed: string
name: read_data
arguments: data_label: D7
type_guessed: string
name: read_data
arguments: data_label: D1
type_guessed: string

tool: D13: %c


tool: D7: %c%c%c%c%c


tool: D1: Hello world!

assistant: ```c
int main(void) {
  printf("%c\n", 'H');
  printf("%c\n", 'e');
  printf("%c\n", 'l');
  printf("%c\n", 'l');
  printf("%c\n", 'o');
  printf("%c%c%c%c%c\n", 'H', 'e', 'l', 'l', 'o');
  printf("%s\n", "Hello world!");
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<create_and_bind_nonblock_sock>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x30(%rbp),%rax
  mov    $0x28,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    D16(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,-0x10(%rbp)
  mov    D2(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,-0x20(%rbp)
  mov    D15(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,-0x30(%rbp)
  lea    -0x40(%rbp),%rcx
  lea    -0x30(%rbp),%rdx
  mov    -0x58(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <getaddrinfo@plt>
  mov    %eax,-0x44(%rbp)
  cmpl   $0x0,-0x44(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x38(%rbp)
  jmp    L50
L57:
  mov    -0x38(%rbp),%rax
  mov    0xc(%rax),%edx
  mov    -0x38(%rbp),%rax
  mov    (%rax),%ecx
  mov    D17(%rip),%rax
  mov    (%rax),%eax
  or     %eax,%ecx
  mov    -0x38(%rbp),%rax
  mov    0x10(%rax),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <socket@plt>
  mov    %eax,-0x48(%rbp)
  cmpl   $0xffffffff,-0x48(%rbp)
  je     L26
  mov    -0x38(%rbp),%rax
  mov    0x4(%rax),%edx
  mov    -0x38(%rbp),%rax
  mov    0x8(%rax),%ecx
  mov    -0x48(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <bind@plt>
  mov    %eax,-0x44(%rbp)
  cmpl   $0x0,-0x44(%rbp)
  je     L52
  mov    -0x48(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  jmp    L62
L26:
  nop
L62:
  mov    -0x38(%rbp),%rax
  mov    0x18(%rax),%rax
  mov    %rax,-0x38(%rbp)
L50:
  cmpq   $0x0,-0x38(%rbp)
  jne    L57
  jmp    L55
L52:
  nop
L55:
  cmpq   $0x0,-0x38(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <freeaddrinfo@plt>
  mov    -0x48(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L29
  call   <__stack_chk_fail@plt>
L29:
  leave
  ret
```

assistant: ```c
int create_and_bind_nonblock_sock(char *port) {
  struct addrinfo hints;
  struct addrinfo *result, *rp;
  int s, sfd;
  memset(&hints, 0, sizeof(struct addrinfo));
  hints.ai_flags = AI_PASSIVE;
  hints.ai_family = AF_UNSPEC;
  hints.ai_socktype = SOCK_STREAM;
  s = getaddrinfo(NULL, port, &hints, &result);
  assert(s == 0);
  for (rp = result; rp != NULL; rp = rp->ai_next) {
    sfd = socket(rp->ai_family, rp->ai_socktype | SOCK_NONBLOCK, rp->ai_protocol);
    if (sfd == -1)
      continue;
    s = bind(sfd, rp->ai_addr, rp->ai_addrlen);
    if (s == 0)
      break;
    close(sfd);
  }
  assert(rp != NULL);
  freeaddrinfo(result);
  return sfd;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<create_and_bind_nonblock_sock>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x40,%rsp
  mov    %rdi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rbp
  mov    $0x28,%edx
  mov    $0x0,%esi
  mov    %rbp,%rdi
  call   <memset@plt>
  mov    D23(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,0x30(%rsp)
  mov    D35(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,0x20(%rsp)
  mov    D20(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,0x10(%rsp)
  lea    0x8(%rsp),%rcx
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  mov    $0x0,%edi
  call   <getaddrinfo@plt>
  test   %eax,%eax
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    0x8(%rsp),%rbx
  test   %rbx,%rbx
  je     L6
  mov    D8(%rip),%r12
  jmp    L39
L41:
  mov    0x18(%rbx),%rbx
  test   %rbx,%rbx
  je     L21
L39:
  mov    0xc(%rbx),%edx
  mov    (%rbx),%esi
  or     (%r12),%esi
  mov    0x10(%rbx),%edi
  call   <socket@plt>
  mov    %eax,%ebp
  cmp    $0xffffffff,%eax
  je     L41
  mov    0x4(%rbx),%edx
  mov    0x8(%rbx),%esi
  mov    %eax,%edi
  call   <bind@plt>
  test   %eax,%eax
  je     L21
  mov    %ebp,%edi
  call   <close@plt>
  jmp    L41
L6:
  mov    $0x0,%ebp
L21:
  test   %rbx,%rbx
  setne  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    0x8(%rsp),%rdi
  call   <freeaddrinfo@plt>
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L68
  mov    %ebp,%eax
  add    $0x40,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L68:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int create_and_bind_nonblock_sock(char *port) {
  struct addrinfo hints;
  struct addrinfo *result, *rp;
  int s, sfd;
  memset(&hints, 0, sizeof(struct addrinfo));
  hints.ai_flags = AI_PASSIVE;
  hints.ai_family = AF_UNSPEC;
  hints.ai_socktype = SOCK_STREAM;
  s = getaddrinfo(NULL, port, &hints, &result);
  assert(s == 0);
  for (rp = result; rp != NULL; rp = rp->ai_next) {
    sfd = socket(rp->ai_family, rp->ai_socktype | SOCK_NONBLOCK, rp->ai_protocol);
    if (sfd == -1)
      continue;
    s = bind(sfd, rp->ai_addr, rp->ai_addrlen);
    if (s == 0)
      break;
    close(sfd);
  }
  assert(rp != NULL);
  freeaddrinfo(result);
  return sfd;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<create_and_bind_nonblock_sock>:
  endbr64
  push   %r12
  xor    %esi,%esi
  mov    $0x28,%edx
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x40,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%r12
  mov    %r12,%rdi
  call   <memset@plt>
  xor    %edi,%edi
  lea    0x8(%rsp),%rcx
  mov    %r12,%rdx
  mov    D28(%rip),%rax
  mov    %rbp,%rsi
  mov    (%rax),%eax
  mov    %eax,0x30(%rsp)
  mov    D33(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,0x20(%rsp)
  mov    D2(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,0x10(%rsp)
  call   <getaddrinfo@plt>
  xor    %edi,%edi
  test   %eax,%eax
  sete   %dil
  call   <assert@plt>
  mov    0x8(%rsp),%rbx
  test   %rbx,%rbx
  je     L51
  mov    D30(%rip),%rbp
  xchg   %ax,%ax
L36:
  mov    0xc(%rbx),%edx
  mov    0x10(%rbx),%edi
  mov    (%rbx),%esi
  or     0x0(%rbp),%esi
  call   <socket@plt>
  mov    %eax,%r12d
  cmp    $0xffffffff,%eax
  je     L1
  mov    0x4(%rbx),%edx
  mov    0x8(%rbx),%esi
  mov    %eax,%edi
  call   <bind@plt>
  test   %eax,%eax
  je     L4
  mov    %r12d,%edi
  call   <close@plt>
L1:
  mov    0x18(%rbx),%rbx
  test   %rbx,%rbx
  jne    L36
L33:
  xor    %edi,%edi
L47:
  call   <assert@plt>
  mov    0x8(%rsp),%rdi
  call   <freeaddrinfo@plt>
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L68
  add    $0x40,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L4:
  mov    $0x1,%edi
  jmp    L47
L51:
  xor    %r12d,%r12d
  jmp    L33
L68:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int create_and_bind_nonblock_sock(char *port) {
  struct addrinfo hints;
  struct addrinfo *result, *rp;
  int s, sfd;
  memset(&hints, 0, sizeof(struct addrinfo));
  hints.ai_flags = AI_PASSIVE;
  hints.ai_family = AF_UNSPEC;
  hints.ai_socktype = SOCK_STREAM;
  s = getaddrinfo(NULL, port, &hints, &result);
  assert(s == 0);
  for (rp = result; rp != NULL; rp = rp->ai_next) {
    sfd = socket(rp->ai_family, rp->ai_socktype | SOCK_NONBLOCK, rp->ai_protocol);
    if (sfd == -1)
      continue;
    s = bind(sfd, rp->ai_addr, rp->ai_addrlen);
    if (s == 0)
      break;
    close(sfd);
  }
  assert(rp != NULL);
  freeaddrinfo(result);
  return sfd;
}
```
user: Translate the below assembly code into C programming language:

```asm
<create_and_bind_nonblock_sock>:
  endbr64
  push   %r12
  xor    %esi,%esi
  mov    $0x28,%edx
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x40,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%r12
  mov    %r12,%rdi
  call   <memset@plt>
  xor    %edi,%edi
  lea    0x8(%rsp),%rcx
  mov    %r12,%rdx
  mov    D36(%rip),%rax
  mov    %rbp,%rsi
  mov    (%rax),%eax
  mov    %eax,0x30(%rsp)
  mov    D20(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,0x20(%rsp)
  mov    D28(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,0x10(%rsp)
  call   <getaddrinfo@plt>
  xor    %edi,%edi
  test   %eax,%eax
  sete   %dil
  call   <assert@plt>
  mov    0x8(%rsp),%rbx
  test   %rbx,%rbx
  je     L69
  mov    D13(%rip),%rbp
  xchg   %ax,%ax
L63:
  mov    0xc(%rbx),%edx
  mov    0x10(%rbx),%edi
  mov    (%rbx),%esi
  or     0x0(%rbp),%esi
  call   <socket@plt>
  mov    %eax,%r12d
  cmp    $0xffffffff,%eax
  je     L24
  mov    0x4(%rbx),%edx
  mov    0x8(%rbx),%esi
  mov    %eax,%edi
  call   <bind@plt>
  test   %eax,%eax
  je     L17
  mov    %r12d,%edi
  call   <close@plt>
L24:
  mov    0x18(%rbx),%rbx
  test   %rbx,%rbx
  jne    L63
L16:
  xor    %edi,%edi
L34:
  call   <assert@plt>
  mov    0x8(%rsp),%rdi
  call   <freeaddrinfo@plt>
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L18
  add    $0x40,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L17:
  mov    $0x1,%edi
  jmp    L34
L69:
  xor    %r12d,%r12d
  jmp    L16
L18:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int create_and_bind_nonblock_sock(char *port) {
  struct addrinfo hints;
  struct addrinfo *result, *rp;
  int s, sfd;
  memset(&hints, 0, sizeof(struct addrinfo));
  hints.ai_flags = AI_PASSIVE;
  hints.ai_family = AF_UNSPEC;
  hints.ai_socktype = SOCK_STREAM;
  s = getaddrinfo(NULL, port, &hints, &result);
  assert(s == 0);
  for (rp = result; rp != NULL; rp = rp->ai_next) {
    sfd = socket(rp->ai_family, rp->ai_socktype | SOCK_NONBLOCK, rp->ai_protocol);
    if (sfd == -1)
      continue;
    s = bind(sfd, rp->ai_addr, rp->ai_addrlen);
    if (s == 0)
      break;
    close(sfd);
  }
  assert(rp != NULL);
  freeaddrinfo(result);
  return sfd;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<stristr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  jmp    L61
L26:
  movl   $0x0,-0x14(%rbp)
  jmp    L48
L42:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %eax,%ebx
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <toupper@plt>
  cmp    %eax,%ebx
  jne    L43
  addl   $0x1,-0x14(%rbp)
L48:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L56
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L42
  jmp    L56
L43:
  nop
L56:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L2
  mov    -0x28(%rbp),%rax
  jmp    L77
L2:
  addq   $0x1,-0x28(%rbp)
L61:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L26
  mov    $0x0,%eax
L77:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
char *stristr(char *str, char *charset) {
  int i;
  while (*str) {
    for (i = 0; charset[i] && str[i]; i++)
      if (toupper(charset[i]) != toupper(str[i]))
        break;
    if (!charset[i])
      return str;
    str++;
  }
  return ((void *)0);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<stristr>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  cmpb   $0x0,(%rdi)
  je     L15
  mov    %rdi,%r14
  mov    %rsi,%r15
  movzbl (%rsi),%eax
  mov    %al,0xf(%rsp)
  jmp    L13
L7:
  test   %r13b,%r13b
  je     L40
  add    $0x1,%r14
  cmpb   $0x0,(%r14)
  je     L57
L13:
  cmpb   $0x0,0xf(%rsp)
  je     L40
  movzbl 0xf(%rsp),%r13d
  mov    $0x0,%ebp
L39:
  movzbl (%r14,%rbp,1),%ebx
  test   %bl,%bl
  je     L7
  movsbl %r13b,%edi
  call   <toupper@plt>
  mov    %eax,%r12d
  movsbl %bl,%edi
  call   <toupper@plt>
  cmp    %eax,%r12d
  jne    L7
  add    $0x1,%rbp
  movzbl (%r15,%rbp,1),%r13d
  test   %r13b,%r13b
  jne    L39
L40:
  mov    %r14,%rax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L15:
  mov    $0x0,%r14d
  jmp    L40
L57:
  mov    $0x0,%r14d
  jmp    L40
```

assistant: ```c
char *stristr(char *str, char *charset) {
  int i;
  while (*str) {
    for (i = 0; charset[i] && str[i]; i++)
      if (toupper(charset[i]) != toupper(str[i]))
        break;
    if (!charset[i])
      return str;
    str++;
  }
  return ((void *)0);
}
```