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

```asm
<nextFibonacciUntil_>:
  endbr64
  push   %r15
  mov    %edx,%r15d
  push   %r14
  mov    %esi,%r14d
  push   %r13
  push   %r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  mov    %ecx,%ebx
  sub    $0x18,%rsp
  cmp    $0x1,%r8d
  sete   %r13b
  cmp    %edx,%ecx
  jg     L46
  test   %r13b,%r13b
  jne    L61
L46:
  cmp    $0x1,%r8d
  setne  0xb(%rsp)
  movzbl 0xb(%rsp),%eax
  test   %ebx,%ebx
  js     L149
L142:
  lea    D25(%rip),%r12
  nopw   0x0(%rax,%rax,1)
L17:
  test   %r15d,%r15d
  je     L114
  lea    0x0(%rbp,%r14,1),%ecx
  cmp    $0x1,%r15d
  mov    $0x1,%eax
  cmove  %eax,%ecx
  mov    $0x0,%eax
  cmove  %eax,%r14d
  cmp    %ecx,%ebx
  jge    L65
  cmpb   $0x0,0xb(%rsp)
  je     L65
L61:
  add    $0x18,%rsp
  lea    D47(%rip),%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1060 <puts@plt>
  nopl   0x0(%rax)
L114:
  xor    %r14d,%r14d
  mov    $0xffffffff,%ebp
L57:
  mov    %r14d,%esi
  mov    %r12,%rdi
  xor    %eax,%eax
  add    $0x1,%r15d
  call   <printf@plt>
  cmp    %r15d,%ebx
  jg     L17
  test   %r13b,%r13b
  je     L17
  jmp    L61
  nopl   (%rax)
L65:
  lea    D58(%rip),%rdi
  xor    %eax,%eax
  mov    %ecx,0xc(%rsp)
  mov    %r14d,%ebp
  call   <printf@plt>
  mov    0xc(%rsp),%r14d
  jmp    L57
  nopl   0x0(%rax)
L149:
  test   %al,%al
  je     L142
  lea    D58(%rip),%rdx
L151:
  test   %r15d,%r15d
  je     L61
  cmp    $0x1,%r15d
  je     L61
  lea    (%r14,%rbp,1),%r12d
  cmp    %r12d,%ebx
  jl     L61
  mov    %rdx,%rdi
  xor    %eax,%eax
  add    $0x1,%r15d
  mov    %r14d,%ebp
  call   <printf@plt>
  xor    %eax,%eax
  mov    %r12d,%esi
  lea    D25(%rip),%rdi
  call   <printf@plt>
  cmp    %ebx,%r15d
  lea    D58(%rip),%rdx
  jl     L23
  test   %r13b,%r13b
  jne    L61
L23:
  mov    %r12d,%r14d
  jmp    L151
```

tool_calls: name: read_data
arguments: data_label: D25
type_infered: string
name: read_data
arguments: data_label: D47
type_infered: string
name: read_data
arguments: data_label: D58
type_infered: string

tool: D25: %lu

tool: D47: .

tool: D58: , 

assistant: ```c
void nextFibonacciUntil_(uint64_t n1, uint64_t n2, int times, int until, int type) {
  if (type == 1 && times >= until) {
    puts(".");
    return;
  }
  if (times == 0) {
    n1 = -1;
    n2 = 0;
  } else if (times == 1) {
    n1 = 0;
    n2 = 1;
  } else {
    uint64_t temp = n1;
    n1 = n2;
    n2 += temp;
  }
  if (type != 1 && n2 > until) {
    puts(".");
    return;
  }
  if (times) {
    printf(", ");
  }
  printf("%lu", n2);
  nextFibonacciUntil_(n1, n2, times + 1, until, type);
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<HandleWhiteSpace>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  lea    D6(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strpbrk@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L7
L18:
  mov    -0x8(%rbp),%rax
  lea    D6(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strspn@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0x1,-0xc(%rbp)
  jle    L17
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  sub    -0xc(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0xc(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x8(%rbp),%rax
  add    %rax,%rcx
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memmove@plt>
L17:
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movb   $0x20,(%rax)
  mov    -0x8(%rbp),%rax
  lea    D6(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strpbrk@plt>
  mov    %rax,-0x8(%rbp)
L7:
  cmpq   $0x0,-0x8(%rbp)
  jne    L18
  nop
  nop
  leave
  ret
```

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

tool: D6: 	
 

assistant: ```c
void HandleWhiteSpace(char *psz_node) {
  char *s = strpbrk(psz_node, "\t\r\n ");
  while (s) {
    int i_whitespace = strspn(s, "\t\r\n ");
    if (i_whitespace > 1)
      memmove(&s[1], &s[i_whitespace], strlen(s) - i_whitespace + 1);
    *s++ = ' ';
    s = strpbrk(s, "\t\r\n ");
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<HandleWhiteSpace>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  lea    D15(%rip),%rsi
  call   <strpbrk@plt>
  test   %rax,%rax
  je     L19
  mov    %rax,%rbx
  lea    D15(%rip),%r12
  jmp    L43
L7:
  lea    0x1(%rbx),%rdi
  movb   $0x20,(%rbx)
  mov    %r12,%rsi
  call   <strpbrk@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L19
L43:
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <strspn@plt>
  mov    %eax,%ebp
  cmp    $0x1,%eax
  jle    L7
  mov    %rbx,%rdi
  call   <strlen@plt>
  sub    %ebp,%eax
  lea    0x1(%rax),%edx
  movslq %ebp,%rsi
  add    %rbx,%rsi
  lea    0x1(%rbx),%rdi
  call   <memmove@plt>
  jmp    L7
L19:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

tool_calls: name: read_data
arguments: label: D15
datatype: string

tool: D15: 	
 

assistant: ```c
void HandleWhiteSpace(char *psz_node) {
  char *s = strpbrk(psz_node, "\t\r\n ");
  while (s) {
    int i_whitespace = strspn(s, "\t\r\n ");
    if (i_whitespace > 1)
      memmove(&s[1], &s[i_whitespace], strlen(s) - i_whitespace + 1);
    *s++ = ' ';
    s = strpbrk(s, "\t\r\n ");
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<HandleWhiteSpace>:
  endbr64
  push   %r13
  push   %r12
  lea    D3(%rip),%r12
  push   %rbp
  mov    %r12,%rsi
  push   %rbx
  sub    $0x8,%rsp
  call   <strpbrk@plt>
  test   %rax,%rax
  je     L20
  mov    %rax,%rbx
  nopl   (%rax)
L22:
  mov    %r12,%rsi
  mov    %rbx,%rdi
  lea    0x1(%rbx),%r13
  call   <strspn@plt>
  mov    %eax,%ebp
  cmp    $0x1,%eax
  jle    L15
  mov    %rbx,%rdi
  call   <strlen@plt>
  movslq %ebp,%rsi
  mov    %r13,%rdi
  sub    %ebp,%eax
  add    %rbx,%rsi
  lea    0x1(%rax),%edx
  call   <memmove@plt>
L15:
  movb   $0x20,(%rbx)
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <strpbrk@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  jne    L22
L20:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D3
type_guessed: string

tool: D3: 	
 

assistant: ```c
void HandleWhiteSpace(char *psz_node) {
  char *s = strpbrk(psz_node, "\t\r\n ");
  while (s) {
    int i_whitespace = strspn(s, "\t\r\n ");
    if (i_whitespace > 1)
      memmove(&s[1], &s[i_whitespace], strlen(s) - i_whitespace + 1);
    *s++ = ' ';
    s = strpbrk(s, "\t\r\n ");
  }
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<HandleWhiteSpace>:
  endbr64
  push   %r13
  push   %r12
  lea    D6(%rip),%r12
  push   %rbp
  mov    %r12,%rsi
  push   %rbx
  sub    $0x8,%rsp
  call   <strpbrk@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L24
  nopl   (%rax)
L14:
  mov    %r12,%rsi
  mov    %rbx,%rdi
  lea    0x1(%rbx),%r13
  call   <strspn@plt>
  mov    %eax,%ebp
  cmp    $0x1,%eax
  jle    L25
  mov    %rbx,%rdi
  call   <strlen@plt>
  movslq %ebp,%rsi
  mov    %r13,%rdi
  sub    %ebp,%eax
  add    %rbx,%rsi
  lea    0x1(%rax),%edx
  call   <memmove@plt>
L25:
  movb   $0x20,(%rbx)
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <strpbrk@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  jne    L14
L24:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: read_data
arguments: label: D6
datatype: string

tool: D6: 	
 

assistant: ```c
void HandleWhiteSpace(char *psz_node) {
  char *s = strpbrk(psz_node, "\t\r\n ");
  while (s) {
    int i_whitespace = strspn(s, "\t\r\n ");
    if (i_whitespace > 1)
      memmove(&s[1], &s[i_whitespace], strlen(s) - i_whitespace + 1);
    *s++ = ' ';
    s = strpbrk(s, "\t\r\n ");
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<format_cur_time>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    $0x0,%edi
  call   <time@plt>
  mov    %eax,-0x24(%rbp)
  lea    -0x20(%rbp),%rdx
  lea    -0x24(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <gmtime_r@plt>
  mov    -0xc(%rbp),%r8d
  mov    -0x10(%rbp),%edi
  mov    -0x14(%rbp),%ecx
  mov    -0x18(%rbp),%r9d
  mov    -0x1c(%rbp),%eax
  lea    0x1(%rax),%r10d
  mov    -0x20(%rbp),%eax
  lea    0x76c(%rax),%edx
  mov    -0x3c(%rbp),%esi
  mov    -0x38(%rbp),%rax
  sub    $0x8,%rsp
  push   %r8
  push   %rdi
  push   %rcx
  mov    %r10d,%r8d
  mov    %edx,%ecx
  lea    D5(%rip),%rdx
  mov    %rax,%rdi
  call   <snprintf@plt>
  add    $0x20,%rsp
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L8
  call   <__stack_chk_fail@plt>
L8:
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D5
data_type: string

tool: D5: %04d%02d%02d-%02d:%02d:%02d	

assistant: ```c
int format_cur_time(char *buf, int buf_len) {
  time_t ttNow;
  struct tm tmNow;
  ttNow = time(NULL);
  gmtime_r(&ttNow, &tmNow);
  return snprintf(buf, buf_len, "%04d%02d%02d-%02d:%02d:%02d\t", tmNow.tm_year + 1900, tmNow.tm_mon + 1, tmNow.tm_mday, tmNow.tm_hour, tmNow.tm_min, tmNow.tm_sec);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<format_cur_time>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%rbx
  mov    %esi,%ebp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    $0x0,%edi
  call   <time@plt>
  mov    %eax,0xc(%rsp)
  lea    0x10(%rsp),%rsi
  lea    0xc(%rsp),%rdi
  call   <gmtime_r@plt>
  mov    0x10(%rsp),%eax
  lea    0x76c(%rax),%ecx
  sub    $0x8,%rsp
  mov    0x2c(%rsp),%eax
  push   %rax
  mov    0x30(%rsp),%eax
  push   %rax
  mov    0x34(%rsp),%eax
  push   %rax
  mov    0x38(%rsp),%r9d
  mov    0x34(%rsp),%eax
  lea    0x1(%rax),%r8d
  lea    D1(%rip),%rdx
  mov    %ebp,%esi
  mov    %rbx,%rdi
  call   <snprintf@plt>
  add    $0x20,%rsp
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L0
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  ret
L0:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D1
data_type: string

tool: D1: %04d%02d%02d-%02d:%02d:%02d	

assistant: ```c
int format_cur_time(char *buf, int buf_len) {
  time_t ttNow;
  struct tm tmNow;
  ttNow = time(NULL);
  gmtime_r(&ttNow, &tmNow);
  return snprintf(buf, buf_len, "%04d%02d%02d-%02d:%02d:%02d\t", tmNow.tm_year + 1900, tmNow.tm_mon + 1, tmNow.tm_mday, tmNow.tm_hour, tmNow.tm_min, tmNow.tm_sec);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<format_cur_time>:
  endbr64
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  mov    %rdi,%rbp
  xor    %edi,%edi
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  call   <time@plt>
  lea    0x10(%rsp),%rsi
  lea    0xc(%rsp),%rdi
  mov    %eax,0xc(%rsp)
  call   <gmtime_r@plt>
  mov    0x10(%rsp),%eax
  sub    $0x8,%rsp
  mov    %r12d,%esi
  lea    D2(%rip),%rdx
  mov    %rbp,%rdi
  lea    0x76c(%rax),%ecx
  mov    0x2c(%rsp),%eax
  push   %rax
  mov    0x30(%rsp),%eax
  push   %rax
  mov    0x34(%rsp),%eax
  push   %rax
  mov    0x34(%rsp),%eax
  mov    0x38(%rsp),%r9d
  lea    0x1(%rax),%r8d
  call   <snprintf@plt>
  add    $0x20,%rsp
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L0
  add    $0x38,%rsp
  pop    %rbp
  pop    %r12
  ret
L0:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D2
type: string

tool: D2: %04d%02d%02d-%02d:%02d:%02d	

assistant: ```c
int format_cur_time(char *buf, int buf_len) {
  time_t ttNow;
  struct tm tmNow;
  ttNow = time(NULL);
  gmtime_r(&ttNow, &tmNow);
  return snprintf(buf, buf_len, "%04d%02d%02d-%02d:%02d:%02d\t", tmNow.tm_year + 1900, tmNow.tm_mon + 1, tmNow.tm_mday, tmNow.tm_hour, tmNow.tm_min, tmNow.tm_sec);
}
```
user: Translate the below assembly code into C programming language:

```asm
<format_cur_time>:
  endbr64
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  mov    %rdi,%rbp
  xor    %edi,%edi
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  call   <time@plt>
  lea    0x10(%rsp),%rsi
  lea    0xc(%rsp),%rdi
  mov    %eax,0xc(%rsp)
  call   <gmtime_r@plt>
  mov    0x10(%rsp),%eax
  sub    $0x8,%rsp
  mov    %r12d,%esi
  lea    D9(%rip),%rdx
  mov    %rbp,%rdi
  lea    0x76c(%rax),%ecx
  mov    0x2c(%rsp),%eax
  push   %rax
  mov    0x30(%rsp),%eax
  push   %rax
  mov    0x34(%rsp),%eax
  push   %rax
  mov    0x34(%rsp),%eax
  mov    0x38(%rsp),%r9d
  lea    0x1(%rax),%r8d
  call   <snprintf@plt>
  add    $0x20,%rsp
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L1
  add    $0x38,%rsp
  pop    %rbp
  pop    %r12
  ret
L1:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D9
type: string

tool: D9: %04d%02d%02d-%02d:%02d:%02d	

assistant: ```c
int format_cur_time(char *buf, int buf_len) {
  time_t ttNow;
  struct tm tmNow;
  ttNow = time(NULL);
  gmtime_r(&ttNow, &tmNow);
  return snprintf(buf, buf_len, "%04d%02d%02d-%02d:%02d:%02d\t", tmNow.tm_year + 1900, tmNow.tm_mon + 1, tmNow.tm_mday, tmNow.tm_hour, tmNow.tm_min, tmNow.tm_sec);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<LedInit>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0xf0000805,%edi
  call   <SysCtlPeripheralEnable@plt>
  mov    $0xe,%esi
  mov    $0x40025000,%edi
  call   <GPIOPinTypeGPIOOutput@plt>
  nop
  pop    %rbp
  ret
```

assistant: ```c
void LedInit() {
  SysCtlPeripheralEnable(0xf0000805);
  GPIOPinTypeGPIOOutput(0x40025000, 0x00000002 | 0x00000004 | 0x00000008);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<LedInit>:
  endbr64
  sub    $0x8,%rsp
  mov    $0xf0000805,%edi
  call   <SysCtlPeripheralEnable@plt>
  mov    $0xe,%esi
  mov    $0x40025000,%edi
  call   <GPIOPinTypeGPIOOutput@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
void LedInit() {
  SysCtlPeripheralEnable(0xf0000805);
  GPIOPinTypeGPIOOutput(0x40025000, 0x00000002 | 0x00000004 | 0x00000008);
}
```
user: What is the c source code of the assembly code below:

```asm
<LedInit>:
  endbr64
  sub    $0x8,%rsp
  mov    $0xf0000805,%edi
  call   <SysCtlPeripheralEnable@plt>
  mov    $0xe,%esi
  mov    $0x40025000,%edi
  add    $0x8,%rsp
  jmp    1070 <GPIOPinTypeGPIOOutput@plt>
```

assistant: ```c
void LedInit() {
  SysCtlPeripheralEnable(0xf0000805);
  GPIOPinTypeGPIOOutput(0x40025000, 0x00000002 | 0x00000004 | 0x00000008);
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<LedInit>:
  endbr64
  sub    $0x8,%rsp
  mov    $0xf0000805,%edi
  call   <SysCtlPeripheralEnable@plt>
  mov    $0xe,%esi
  mov    $0x40025000,%edi
  add    $0x8,%rsp
  jmp    1070 <GPIOPinTypeGPIOOutput@plt>
```

assistant: ```c
void LedInit() {
  SysCtlPeripheralEnable(0xf0000805);
  GPIOPinTypeGPIOOutput(0x40025000, 0x00000002 | 0x00000004 | 0x00000008);
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<sock_getifinfo>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <getifaddrs@plt>
  cmp    $0xffffffff,%eax
  jne    L71
  mov    $0x0,%eax
  jmp    L106
L71:
  movl   $0x0,-0x1c(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  jmp    L86
L69:
  mov    -0x10(%rbp),%rax
  mov    0xc(%rax),%ecx
  mov    -0x28(%rbp),%rax
  mov    $0x0,%edx
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <sock_cmpaddr@plt>
  test   %rax,%rax
  jne    L80
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rdx
  mov    D9(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jne    L44
  cmpq   $0x0,-0x38(%rbp)
  je     L91
  mov    -0x10(%rbp),%rax
  mov    0x8(%rax),%eax
  mov    %eax,%edi
  call   <sock_addrlen@plt>
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  mov    0x8(%rax),%ecx
  mov    -0x38(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <memcpy@plt>
L91:
  cmpq   $0x0,-0x40(%rbp)
  je     L44
  mov    -0x10(%rbp),%rax
  mov    0x4(%rax),%eax
  mov    %eax,%edi
  call   <sock_addrlen@plt>
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  mov    0x4(%rax),%ecx
  mov    -0x40(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <memcpy@plt>
L44:
  cmpq   $0x0,-0x30(%rbp)
  je     L94
  mov    -0x10(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x30(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <strcpy@plt>
L94:
  movl   $0x1,-0x1c(%rbp)
  jmp    L18
L80:
  nop
  mov    -0x10(%rbp),%rax
  mov    0x10(%rax),%rax
  mov    %rax,-0x10(%rbp)
L86:
  cmpq   $0x0,-0x10(%rbp)
  jne    L69
L18:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <freeifaddrs@plt>
  mov    -0x1c(%rbp),%eax
L106:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L46
  call   <__stack_chk_fail@plt>
L46:
  leave
  ret
```

assistant: ```c
int sock_getifinfo(const struct sockaddr *addr, char *ifname, struct sockaddr *broadcast, struct sockaddr *netmask) {
  struct ifaddrs *ifap, *ifa;
  int rc;
  if (getifaddrs(&ifap) == -1)
    return 0;
  rc = 0;
  for (ifa = ifap; ifa != NULL; ifa = ifa->ifa_next) {
    if (sock_cmpaddr(addr, ifa->ifa_addr, 0))
      continue;
    if (addr->sa_family == AF_INET) {
      if (broadcast)
        memcpy(broadcast, ifa->ifa_broadaddr, sock_addrlen(ifa->ifa_broadaddr));
      if (netmask)
        memcpy(netmask, ifa->ifa_netmask, sock_addrlen(ifa->ifa_netmask));
    }
    if (ifname)
      strcpy(ifname, ifa->ifa_name);
    rc = 1;
    break;
  }
  freeifaddrs(ifap);
  return rc;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<sock_getifinfo>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%r12
  mov    %rdx,%r14
  mov    %rcx,%r13
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  call   <getifaddrs@plt>
  mov    $0x0,%r15d
  cmp    $0xffffffff,%eax
  je     L111
  mov    (%rsp),%rbp
  test   %rbp,%rbp
  je     L99
L67:
  mov    0xc(%rbp),%esi
  mov    $0x0,%edx
  mov    %rbx,%rdi
  call   <sock_cmpaddr@plt>
  test   %rax,%rax
  jne    L58
  mov    D5(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,(%rbx)
  je     L5
L94:
  mov    $0x1,%r15d
  test   %r12,%r12
  je     L12
  mov    0x0(%rbp),%esi
  mov    %r12,%rdi
  call   <strcpy@plt>
L12:
  mov    (%rsp),%rdi
  call   <freeifaddrs@plt>
L111:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L7
  mov    %r15d,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L58:
  mov    0x10(%rbp),%rbp
  test   %rbp,%rbp
  jne    L67
  mov    $0x0,%r15d
  jmp    L12
L5:
  test   %r14,%r14
  je     L109
  mov    0x8(%rbp),%edi
  call   <sock_addrlen@plt>
  mov    %eax,%edx
  mov    0x8(%rbp),%esi
  mov    %r14,%rdi
  call   <memcpy@plt>
L109:
  test   %r13,%r13
  je     L94
  mov    0x4(%rbp),%edi
  call   <sock_addrlen@plt>
  mov    %eax,%edx
  mov    0x4(%rbp),%esi
  mov    %r13,%rdi
  call   <memcpy@plt>
  jmp    L94
L99:
  mov    $0x0,%r15d
  jmp    L12
L7:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int sock_getifinfo(const struct sockaddr *addr, char *ifname, struct sockaddr *broadcast, struct sockaddr *netmask) {
  struct ifaddrs *ifap, *ifa;
  int rc;
  if (getifaddrs(&ifap) == -1)
    return 0;
  rc = 0;
  for (ifa = ifap; ifa != NULL; ifa = ifa->ifa_next) {
    if (sock_cmpaddr(addr, ifa->ifa_addr, 0))
      continue;
    if (addr->sa_family == AF_INET) {
      if (broadcast)
        memcpy(broadcast, ifa->ifa_broadaddr, sock_addrlen(ifa->ifa_broadaddr));
      if (netmask)
        memcpy(netmask, ifa->ifa_netmask, sock_addrlen(ifa->ifa_netmask));
    }
    if (ifname)
      strcpy(ifname, ifa->ifa_name);
    rc = 1;
    break;
  }
  freeifaddrs(ifap);
  return rc;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<sock_getifinfo>:
  endbr64
  push   %r15
  xor    %r15d,%r15d
  push   %r14
  mov    %rdx,%r14
  push   %r13
  mov    %rcx,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  call   <getifaddrs@plt>
  cmp    $0xffffffff,%eax
  je     L28
  mov    (%rsp),%rbp
  test   %rbp,%rbp
  je     L10
L72:
  mov    0xc(%rbp),%esi
  xor    %edx,%edx
  mov    %rbx,%rdi
  call   <sock_cmpaddr@plt>
  test   %rax,%rax
  jne    L98
  mov    D5(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,(%rbx)
  je     L53
L27:
  test   %r12,%r12
  je     L79
L106:
  mov    0x0(%rbp),%esi
  mov    %r12,%rdi
  call   <strcpy@plt>
L79:
  mov    (%rsp),%rbp
  mov    $0x1,%r15d
L10:
  mov    %rbp,%rdi
  call   <freeifaddrs@plt>
L28:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L95
  add    $0x18,%rsp
  mov    %r15d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L53:
  test   %r14,%r14
  je     L17
  mov    0x8(%rbp),%edi
  call   <sock_addrlen@plt>
  mov    0x8(%rbp),%esi
  mov    %r14,%rdi
  mov    %eax,%edx
  call   <memcpy@plt>
L17:
  test   %r13,%r13
  je     L27
  mov    0x4(%rbp),%edi
  call   <sock_addrlen@plt>
  mov    0x4(%rbp),%esi
  mov    %r13,%rdi
  mov    %eax,%edx
  call   <memcpy@plt>
  test   %r12,%r12
  jne    L106
  jmp    L79
  nopl   0x0(%rax,%rax,1)
L98:
  mov    0x10(%rbp),%rbp
  test   %rbp,%rbp
  jne    L72
  mov    (%rsp),%rbp
  xor    %r15d,%r15d
  jmp    L10
L95:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int sock_getifinfo(const struct sockaddr *addr, char *ifname, struct sockaddr *broadcast, struct sockaddr *netmask) {
  struct ifaddrs *ifap, *ifa;
  int rc;
  if (getifaddrs(&ifap) == -1)
    return 0;
  rc = 0;
  for (ifa = ifap; ifa != NULL; ifa = ifa->ifa_next) {
    if (sock_cmpaddr(addr, ifa->ifa_addr, 0))
      continue;
    if (addr->sa_family == AF_INET) {
      if (broadcast)
        memcpy(broadcast, ifa->ifa_broadaddr, sock_addrlen(ifa->ifa_broadaddr));
      if (netmask)
        memcpy(netmask, ifa->ifa_netmask, sock_addrlen(ifa->ifa_netmask));
    }
    if (ifname)
      strcpy(ifname, ifa->ifa_name);
    rc = 1;
    break;
  }
  freeifaddrs(ifap);
  return rc;
}
```