ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    $0x0,%edi
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  mov    $0x0,%eax
  call   <print_version@plt>
  mov    $0x3,%r12d
  mov    $0x1,%r14d
  lea    D16(%rip),%r15
  jmp    L37
L38:
  add    $0x1,%r14d
  add    $0x3,%r12d
  cmp    $0x15,%r12d
  je     L0
L37:
  lea    -0x3(%r12),%ebx
  mov    %r14d,%esi
  mov    $0xa,%edi
  call   <pow@plt>
  mov    %eax,%ebp
  lea    -0x1(%r14),%esi
  mov    $0xa,%edi
  call   <pow@plt>
  mov    %eax,%ecx
  mov    $0x989680,%eax
  cltd
  idiv   %ecx
  mov    %eax,%r13d
L17:
  add    $0x1,%ebx
  mov    %ebp,%edx
  mov    %r15,%rsi
  lea    D4(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %ebp,%esi
  mov    %r13d,%edi
  call   <benchmark@plt>
  mov    %r13d,%edi
  call   <print_results@plt>
  mov    %ebx,%esi
  lea    D6(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmp    %r12d,%ebx
  jne    L17
  jmp    L38
L0:
  mov    $0x12,%esi
  mov    $0x12,%edi
  call   <print_summary@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: read_data
arguments: data_label: D16
type_infered: string
name: read_data
arguments: data_label: D4
type_infered: string
name: read_data
arguments: data_label: D6
type_infered: string

tool: D16: sabs

tool: D4: # c::%s:len=%d


tool: D6: ok %d benchmark finished


assistant: ```c
int main(void) {
  double elapsed;
  int count;
  int iter;
  int len;
  int i;
  int j;
  srand(time(NULL));
  print_version();
  count = 0;
  for (i = 1; i <= 6; i++) {
    len = pow(10, i);
    iter = 10000000 / pow(10, i - 1);
    for (j = 0; j < 3; j++) {
      count += 1;
      printf("# c::%s:len=%d\n", "sabs", len);
      elapsed = benchmark(iter, len);
      print_results(iter, elapsed);
      printf("ok %d benchmark finished\n", count);
    }
  }
  print_summary(count, count);
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<main>:
  endbr64
  push   %r15
  xor    %edi,%edi
  lea    D2(%rip),%r15
  push   %r14
  lea    D9(%rip),%r14
  push   %r13
  lea    D22(%rip),%r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  xor    %eax,%eax
  call   <print_version@plt>
  movl   $0x3,0x8(%rsp)
  movl   $0x1,0xc(%rsp)
  nopl   0x0(%rax)
L12:
  mov    0xc(%rsp),%ebp
  mov    0x8(%rsp),%eax
  mov    $0xa,%edi
  mov    %ebp,%esi
  lea    -0x3(%rax),%r12d
  call   <pow@plt>
  lea    -0x1(%rbp),%esi
  mov    $0xa,%edi
  mov    %eax,%ebx
  call   <pow@plt>
  mov    %eax,%r8d
  mov    $0x989680,%eax
  cltd
  idiv   %r8d
  mov    %eax,%ebp
L3:
  mov    %ebx,%edx
  mov    %r15,%rsi
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %ebx,%esi
  mov    %ebp,%edi
  add    $0x1,%r12d
  call   <benchmark@plt>
  mov    %ebp,%edi
  call   <print_results@plt>
  xor    %eax,%eax
  mov    %r12d,%esi
  mov    %r13,%rdi
  call   <printf@plt>
  cmp    0x8(%rsp),%r12d
  jne    L3
  lea    0x3(%r12),%eax
  addl   $0x1,0xc(%rsp)
  mov    %eax,0x8(%rsp)
  cmp    $0x12,%r12d
  jne    L12
  mov    $0x12,%esi
  mov    $0x12,%edi
  call   <print_summary@plt>
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: unpack_data
arguments: label: D2
type: string
name: unpack_data
arguments: label: D9
type: string
name: unpack_data
arguments: label: D22
type: string

tool: D2: sabs

tool: D9: # c::%s:len=%d


tool: D22: ok %d benchmark finished


assistant: ```c
int main(void) {
  double elapsed;
  int count;
  int iter;
  int len;
  int i;
  int j;
  srand(time(NULL));
  print_version();
  count = 0;
  for (i = 1; i <= 6; i++) {
    len = pow(10, i);
    iter = 10000000 / pow(10, i - 1);
    for (j = 0; j < 3; j++) {
      count += 1;
      printf("# c::%s:len=%d\n", "sabs", len);
      elapsed = benchmark(iter, len);
      print_results(iter, elapsed);
      printf("ok %d benchmark finished\n", count);
    }
  }
  print_summary(count, count);
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<main>:
  endbr64
  push   %r15
  xor    %edi,%edi
  lea    D22(%rip),%r15
  push   %r14
  lea    D27(%rip),%r14
  push   %r13
  lea    D19(%rip),%r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  xor    %eax,%eax
  call   <print_version@plt>
  movl   $0x3,0x8(%rsp)
  movl   $0x1,0xc(%rsp)
  nopl   0x0(%rax)
L13:
  mov    0xc(%rsp),%ebp
  mov    0x8(%rsp),%eax
  mov    $0xa,%edi
  mov    %ebp,%esi
  lea    -0x3(%rax),%r12d
  call   <pow@plt>
  lea    -0x1(%rbp),%esi
  mov    $0xa,%edi
  mov    %eax,%ebx
  call   <pow@plt>
  mov    %eax,%r8d
  mov    $0x989680,%eax
  cltd
  idiv   %r8d
  mov    %eax,%ebp
L8:
  mov    %ebx,%edx
  mov    %r15,%rsi
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %ebx,%esi
  mov    %ebp,%edi
  add    $0x1,%r12d
  call   <benchmark@plt>
  mov    %ebp,%edi
  call   <print_results@plt>
  xor    %eax,%eax
  mov    %r12d,%esi
  mov    %r13,%rdi
  call   <printf@plt>
  cmp    0x8(%rsp),%r12d
  jne    L8
  lea    0x3(%r12),%eax
  addl   $0x1,0xc(%rsp)
  mov    %eax,0x8(%rsp)
  cmp    $0x12,%r12d
  jne    L13
  mov    $0x12,%esi
  mov    $0x12,%edi
  call   <print_summary@plt>
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: disassemble_data
arguments: label: D22
data_type: string
name: disassemble_data
arguments: label: D27
data_type: string
name: disassemble_data
arguments: label: D19
data_type: string

tool: D22: sabs

tool: D27: # c::%s:len=%d


tool: D19: ok %d benchmark finished


assistant: ```c
int main(void) {
  double elapsed;
  int count;
  int iter;
  int len;
  int i;
  int j;
  srand(time(NULL));
  print_version();
  count = 0;
  for (i = 1; i <= 6; i++) {
    len = pow(10, i);
    iter = 10000000 / pow(10, i - 1);
    for (j = 0; j < 3; j++) {
      count += 1;
      printf("# c::%s:len=%d\n", "sabs", len);
      elapsed = benchmark(iter, len);
      print_results(iter, elapsed);
      printf("ok %d benchmark finished\n", count);
    }
  }
  print_summary(count, count);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<xmon_vfprintf>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  mov    -0x24(%rbp),%edx
  mov    -0x20(%rbp),%rax
  mov    %rax,%rsi
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <vsprintf@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%edx
  mov    -0x18(%rbp),%rax
  lea    D7(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <xmon_write@plt>
  nop
  leave
  ret
```

assistant: ```c
void xmon_vfprintf(void *f, const char *fmt, va_list ap) {
  static char xmon_buf[2048];
  int n;
  n = vsprintf(xmon_buf, fmt, ap);
  xmon_write(f, xmon_buf, n);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<xmon_vfprintf>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  lea    D6(%rip),%rbp
  mov    %rbp,%rdi
  call   <vsprintf@plt>
  mov    %eax,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <xmon_write@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void xmon_vfprintf(void *f, const char *fmt, va_list ap) {
  static char xmon_buf[2048];
  int n;
  n = vsprintf(xmon_buf, fmt, ap);
  xmon_write(f, xmon_buf, n);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<xmon_vfprintf>:
  endbr64
  push   %r12
  lea    D9(%rip),%r12
  push   %rbp
  mov    %rdi,%rbp
  mov    %r12,%rdi
  sub    $0x8,%rsp
  call   <vsprintf@plt>
  add    $0x8,%rsp
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    %eax,%edx
  pop    %rbp
  pop    %r12
  jmp    1070 <xmon_write@plt>
```

assistant: ```c
void xmon_vfprintf(void *f, const char *fmt, va_list ap) {
  static char xmon_buf[2048];
  int n;
  n = vsprintf(xmon_buf, fmt, ap);
  xmon_write(f, xmon_buf, n);
}
```
user: What is the c source code of the assembly code below:

```asm
<xmon_vfprintf>:
  endbr64
  push   %r12
  lea    D2(%rip),%r12
  push   %rbp
  mov    %rdi,%rbp
  mov    %r12,%rdi
  sub    $0x8,%rsp
  call   <vsprintf@plt>
  add    $0x8,%rsp
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    %eax,%edx
  pop    %rbp
  pop    %r12
  jmp    1070 <xmon_write@plt>
```

assistant: ```c
void xmon_vfprintf(void *f, const char *fmt, va_list ap) {
  static char xmon_buf[2048];
  int n;
  n = vsprintf(xmon_buf, fmt, ap);
  xmon_write(f, xmon_buf, n);
}
```
user: Translate the below assembly code into C programming language:

```asm
<ft_strchr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L26
L15:
  addl   $0x1,-0x4(%rbp)
L26:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L15
  cmpl   $0x0,-0x1c(%rbp)
  jne    L21
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  jmp    L44
L49:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    %eax,-0x1c(%rbp)
  jne    L25
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  jmp    L44
L25:
  addl   $0x1,-0x8(%rbp)
L21:
  mov    -0x8(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jl     L49
  mov    $0x0,%eax
L44:
  pop    %rbp
  ret
```

assistant: ```c
char *ft_strchr(const char *src, int c) {
  int i;
  int l;
  i = 0;
  l = 0;
  while (src[l] != '\0')
    l++;
  if (c == 0)
    return ((char *)&src[l]);
  while (i < l) {
    if (src[i] == c)
      return ((char *)&src[i]);
    i++;
  }
  return (NULL);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<ft_strchr>:
  endbr64
  cmpb   $0x0,(%rdi)
  je     L8
  lea    0x1(%rdi),%rdx
  mov    %rdx,%rax
  mov    $0x1,%ecx
  sub    %edx,%ecx
L34:
  lea    (%rcx,%rax,1),%r8d
  mov    %rax,%rdx
  add    $0x1,%rax
  cmpb   $0x0,-0x1(%rax)
  jne    L34
L61:
  test   %esi,%esi
  je     L5
  test   %r8d,%r8d
  jle    L51
  mov    %rdi,%rax
  lea    -0x1(%r8),%edx
  lea    0x1(%rdi,%rdx,1),%rdi
L3:
  mov    %rax,%rdx
  movsbl (%rax),%ecx
  cmp    %esi,%ecx
  je     L5
  add    $0x1,%rax
  cmp    %rdi,%rax
  jne    L3
  mov    $0x0,%edx
L5:
  mov    %rdx,%rax
  ret
L8:
  mov    %rdi,%rdx
  mov    $0x0,%r8d
  jmp    L61
L51:
  mov    $0x0,%edx
  jmp    L5
```

assistant: ```c
char *ft_strchr(const char *src, int c) {
  int i;
  int l;
  i = 0;
  l = 0;
  while (src[l] != '\0')
    l++;
  if (c == 0)
    return ((char *)&src[l]);
  while (i < l) {
    if (src[i] == c)
      return ((char *)&src[i]);
    i++;
  }
  return (NULL);
}
```
user: Translate the below assembly code into C programming language:

```asm
<ft_strchr>:
  endbr64
  movsbl (%rdi),%ecx
  mov    %rdi,%r9
  test   %cl,%cl
  je     L30
  lea    0x1(%rdi),%rax
  xor    %edx,%edx
  nopl   0x0(%rax)
L53:
  mov    %rax,%r8
  add    $0x1,%rax
  mov    %edx,%edi
  add    $0x1,%edx
  cmpb   $0x0,-0x1(%rax)
  jne    L53
  test   %esi,%esi
  je     L5
  add    $0x1,%edi
  xor    %eax,%eax
  movslq %edi,%rdi
  jmp    L14
  nopl   0x0(%rax,%rax,1)
L32:
  add    $0x1,%rax
  cmp    %rdi,%rax
  je     L56
  movsbl (%r9,%rax,1),%ecx
L14:
  movslq %eax,%r8
  cmp    %esi,%ecx
  jne    L32
  add    %r9,%r8
L5:
  mov    %r8,%rax
  ret
  nopl   0x0(%rax)
L56:
  xor    %r8d,%r8d
  mov    %r8,%rax
  ret
  nopw   0x0(%rax,%rax,1)
L30:
  xor    %r8d,%r8d
  test   %esi,%esi
  cmove  %rdi,%r8
  mov    %r8,%rax
  ret
```

assistant: ```c
char *ft_strchr(const char *src, int c) {
  int i;
  int l;
  i = 0;
  l = 0;
  while (src[l] != '\0')
    l++;
  if (c == 0)
    return ((char *)&src[l]);
  while (i < l) {
    if (src[i] == c)
      return ((char *)&src[i]);
    i++;
  }
  return (NULL);
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<ft_strchr>:
  endbr64
  cmpb   $0x0,(%rdi)
  je     L24
  lea    0x1(%rdi),%r9
  xor    %ecx,%ecx
  mov    %r9,%rdx
  nopw   0x0(%rax,%rax,1)
L47:
  mov    %rdx,%rax
  add    $0x1,%rdx
  movslq %ecx,%r8
  add    $0x1,%ecx
  cmpb   $0x0,-0x1(%rdx)
  jne    L47
  test   %esi,%esi
  je     L1
  mov    %rdi,%rax
  lea    (%r9,%r8,1),%rcx
  jmp    L23
  nopl   0x0(%rax,%rax,1)
L4:
  add    $0x1,%rax
  cmp    %rcx,%rax
  je     L46
L23:
  movsbl (%rax),%edx
  cmp    %esi,%edx
  jne    L4
L1:
  ret
  nopl   0x0(%rax)
L46:
  xor    %eax,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L24:
  xor    %eax,%eax
  test   %esi,%esi
  cmove  %rdi,%rax
  ret
```

assistant: ```c
char *ft_strchr(const char *src, int c) {
  int i;
  int l;
  i = 0;
  l = 0;
  while (src[l] != '\0')
    l++;
  if (c == 0)
    return ((char *)&src[l]);
  while (i < l) {
    if (src[i] == c)
      return ((char *)&src[i]);
    i++;
  }
  return (NULL);
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<instructions>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  nop
  pop    %rbp
  ret
```

tool_calls: name: unpack_data
arguments: tag: D9
type: string

tool: D9: Enter your choice:
 1 to insert an element into the list.
 2 to delete an element from the list.
 3 to end.


assistant: ```c
void instructions(void) {
  printf("Enter your choice:\n"
         " 1 to insert an element into the list.\n"
         " 2 to delete an element from the list.\n"
         " 3 to end.\n");
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<instructions>:
  endbr64
  sub    $0x8,%rsp
  lea    D6(%rip),%rdi
  call   <printf@plt>
  add    $0x8,%rsp
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D6
data_type: string

tool: D6: Enter your choice:
 1 to insert an element into the list.
 2 to delete an element from the list.
 3 to end.


assistant: ```c
void instructions(void) {
  printf("Enter your choice:\n"
         " 1 to insert an element into the list.\n"
         " 2 to delete an element from the list.\n"
         " 3 to end.\n");
}
```
user: What is the c source code of the assembly code below?

```asm
<instructions>:
  endbr64
  lea    D5(%rip),%rdi
  jmp    1050 <printf@plt>
```

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

tool: D5: Enter your choice:
 1 to insert an element into the list.
 2 to delete an element from the list.
 3 to end.


assistant: ```c
void instructions(void) {
  printf("Enter your choice:\n"
         " 1 to insert an element into the list.\n"
         " 2 to delete an element from the list.\n"
         " 3 to end.\n");
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<instructions>:
  endbr64
  lea    D9(%rip),%rdi
  jmp    1050 <printf@plt>
```

tool_calls: name: parse_data
arguments: label: D9
datatype: string

tool: D9: Enter your choice:
 1 to insert an element into the list.
 2 to delete an element from the list.
 3 to end.


assistant: ```c
void instructions(void) {
  printf("Enter your choice:\n"
         " 1 to insert an element into the list.\n"
         " 2 to delete an element from the list.\n"
         " 3 to end.\n");
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<scanf>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xd0,%rsp
  mov    %rdi,-0xc8(%rbp)
  mov    %rsi,-0xa8(%rbp)
  mov    %rdx,-0xa0(%rbp)
  mov    %rcx,-0x98(%rbp)
  mov    %r8,-0x90(%rbp)
  mov    %r9,-0x88(%rbp)
  test   %al,%al
  je     L4
  movaps %xmm0,-0x80(%rbp)
  movaps %xmm1,-0x70(%rbp)
  movaps %xmm2,-0x60(%rbp)
  movaps %xmm3,-0x50(%rbp)
  movaps %xmm4,-0x40(%rbp)
  movaps %xmm5,-0x30(%rbp)
  movaps %xmm6,-0x20(%rbp)
  movaps %xmm7,-0x10(%rbp)
L4:
  mov    -0xc8(%rbp),%rdx
  mov    -0xb8(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <va_start@plt>
  mov    -0xb8(%rbp),%edx
  mov    -0xc8(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <vscanf@plt>
  mov    %eax,-0xb4(%rbp)
  mov    -0xb8(%rbp),%eax
  mov    %eax,%edi
  call   <va_end@plt>
  mov    -0xb4(%rbp),%eax
  leave
  ret
```

assistant: ```c
int scanf(const char *format, ...) {
  va_list ap;
  va_start(ap, format);
  int out = vscanf(format, ap);
  va_end(ap);
  return out;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<scanf>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %rdi,%rsi
  mov    $0x0,%ebp
  mov    %ebp,%edi
  call   <va_start@plt>
  mov    %ebp,%esi
  mov    %rbx,%rdi
  call   <vscanf@plt>
  mov    %eax,%ebx
  mov    %ebp,%edi
  call   <va_end@plt>
  mov    %ebx,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
int scanf(const char *format, ...) {
  va_list ap;
  va_start(ap, format);
  int out = vscanf(format, ap);
  va_end(ap);
  return out;
}
```
user: What is the c source code of the assembly code below?

```asm
<scanf>:
  endbr64
  push   %r13
  xor    %r13d,%r13d
  mov    %rdi,%rsi
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  mov    %r13d,%edi
  call   <va_start@plt>
  mov    %r13d,%esi
  mov    %rbp,%rdi
  call   <vscanf@plt>
  mov    %r13d,%edi
  mov    %eax,%r12d
  call   <va_end@plt>
  mov    %r12d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
int scanf(const char *format, ...) {
  va_list ap;
  va_start(ap, format);
  int out = vscanf(format, ap);
  va_end(ap);
  return out;
}
```
user: Translate the below assembly code into C programming language:

```asm
<posix_get_process_name>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  mov    D18(%rip),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%ecx
  movslq %ecx,%rax
  sub    $0x1,%rax
  mov    %rax,-0x38(%rbp)
  movslq %ecx,%rax
  mov    %rax,%r10
  mov    $0x0,%r11d
  movslq %ecx,%rax
  mov    %rax,%r8
  mov    $0x0,%r9d
  movslq %ecx,%rax
  mov    $0x10,%edx
  sub    $0x1,%rdx
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rsi
  and    $0xfffffffffffff000,%rsi
  mov    %rsp,%rdx
  sub    %rsi,%rdx
L92:
  cmp    %rdx,%rsp
  je     L55
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L92
L55:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L71
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L71:
  mov    %rsp,%rax
  add    $0x0,%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L84
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  jmp    L87
L84:
  mov    -0x30(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <getcwd@plt>
  test   %rax,%rax
  jne    L95
  mov    $0x0,%eax
  jmp    L87
L95:
  mov    -0x48(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <FN_make_path@plt>
  mov    %rax,-0x28(%rbp)
  mov    D17(%rip),%rax
  mov    (%rax),%edx
  mov    -0x28(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <access@plt>
  test   %eax,%eax
  jne    L56
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <FN_normalize@plt>
  mov    %rax,-0x20(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x20(%rbp),%rax
  jmp    L87
L56:
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <posix_search_in_path@plt>
L87:
  mov    %rbx,%rsp
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L28
  call   <__stack_chk_fail@plt>
L28:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
char *posix_get_process_name(const char *argv) {
  char dir[PATH_MAX + 1], *path, *ret;
  if (argv[0] == '/')
    return strdup(argv);
  if (getcwd(dir, sizeof(dir)) == 0)
    return 0;
  path = FN_make_path(dir, argv);
  if (!access(path, R_OK)) {
    ret = FN_normalize(path);
    free(path);
    return ret;
  }
  free(path);
  return posix_search_in_path(argv);
}
```
user: What is the c source code of the assembly code below:

```asm
<posix_get_process_name>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  mov    D19(%rip),%rax
  mov    (%rax),%esi
  add    $0x1,%esi
  movslq %esi,%rax
  add    $0xf,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L59:
  cmp    %rdx,%rsp
  je     L61
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L59
L61:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L33
  orq    $0x0,-0x8(%rsp,%rax,1)
L33:
  mov    %rsp,%r13
  cmpb   $0x2f,(%rbx)
  je     L84
  mov    %r13,%rdi
  call   <getcwd@plt>
  mov    $0x0,%r12d
  test   %rax,%rax
  je     L52
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <FN_make_path@plt>
  mov    %rax,%r13
  mov    D9(%rip),%rax
  mov    (%rax),%esi
  mov    %r13,%rdi
  call   <access@plt>
  test   %eax,%eax
  je     L14
  mov    %r13,%rdi
  call   <free@plt>
  mov    %rbx,%rdi
  call   <posix_search_in_path@plt>
  mov    %rax,%r12
L52:
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L32
  mov    %r12,%rax
  lea    -0x18(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %rbp
  ret
L84:
  mov    %rbx,%rdi
  call   <strdup@plt>
  mov    %rax,%r12
  jmp    L52
L14:
  mov    %r13,%rdi
  call   <FN_normalize@plt>
  mov    %rax,%r12
  mov    %r13,%rdi
  call   <free@plt>
  jmp    L52
L32:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
char *posix_get_process_name(const char *argv) {
  char dir[PATH_MAX + 1], *path, *ret;
  if (argv[0] == '/')
    return strdup(argv);
  if (getcwd(dir, sizeof(dir)) == 0)
    return 0;
  path = FN_make_path(dir, argv);
  if (!access(path, R_OK)) {
    ret = FN_normalize(path);
    free(path);
    return ret;
  }
  free(path);
  return posix_search_in_path(argv);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<posix_get_process_name>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  mov    D14(%rip),%rax
  mov    %rsp,%rcx
  mov    (%rax),%esi
  add    $0x1,%esi
  movslq %esi,%rax
  add    $0xf,%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L40
L29:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L29
L40:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L98
L17:
  cmpb   $0x2f,(%r12)
  je     L51
  mov    %rsp,%rdi
  xor    %r13d,%r13d
  call   <getcwd@plt>
  test   %rax,%rax
  je     L32
  mov    %r12,%rsi
  mov    %rsp,%rdi
  call   <FN_make_path@plt>
  mov    %rax,%r14
  mov    D5(%rip),%rax
  mov    %r14,%rdi
  mov    (%rax),%esi
  call   <access@plt>
  mov    %r14,%rdi
  test   %eax,%eax
  je     L47
  call   <free@plt>
  mov    %r12,%rdi
  call   <posix_search_in_path@plt>
  mov    %rax,%r13
L32:
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L30
  lea    -0x18(%rbp),%rsp
  mov    %r13,%rax
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %rbp
  ret
  nop
L51:
  mov    %r12,%rdi
  call   <strdup@plt>
  mov    %rax,%r13
  jmp    L32
  nopl   (%rax)
L98:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L17
  nopl   0x0(%rax,%rax,1)
L47:
  call   <FN_normalize@plt>
  mov    %r14,%rdi
  mov    %rax,%r13
  call   <free@plt>
  jmp    L32
L30:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
char *posix_get_process_name(const char *argv) {
  char dir[PATH_MAX + 1], *path, *ret;
  if (argv[0] == '/')
    return strdup(argv);
  if (getcwd(dir, sizeof(dir)) == 0)
    return 0;
  path = FN_make_path(dir, argv);
  if (!access(path, R_OK)) {
    ret = FN_normalize(path);
    free(path);
    return ret;
  }
  free(path);
  return posix_search_in_path(argv);
}
```