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

```asm
<DiskPerfDispatchPnp>:
  endbr64
  push   %r12
  xor    %eax,%eax
  mov    %esi,%r12d
  push   %rbp
  mov    %edi,%ebp
  sub    $0x8,%rsp
  call   <__VERIFIER_nondet_int@plt>
  xor    %eax,%eax
  call   <__VERIFIER_nondet_int@plt>
  mov    %r12d,%esi
  mov    %ebp,%edi
  test   %eax,%eax
  je     L13
  cmp    $0x2,%eax
  jne    L6
  add    $0x8,%rsp
  pop    %rbp
  pop    %r12
  jmp    10a0 <DiskPerfRemoveDevice@plt>
  nopl   0x0(%rax,%rax,1)
L6:
  add    $0x8,%rsp
  pop    %rbp
  pop    %r12
  jmp    1080 <DiskPerfSendToNextDriver@plt>
  nopl   0x0(%rax)
L13:
  add    $0x8,%rsp
  pop    %rbp
  pop    %r12
  jmp    1090 <DiskPerfStartDevice@plt>
```

assistant: ```c
int DiskPerfDispatchPnp(int DeviceObject, int Irp) {
  int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int();
  int irpSp__MinorFunction = __VERIFIER_nondet_int();
  int irpSp;
  int status;
  int tmp;
  {
    irpSp = Irp__Tail__Overlay__CurrentStackLocation;
    if (irpSp__MinorFunction == 0) {
      goto switch_0_0;
    } else {
      if (irpSp__MinorFunction == 2) {
        goto switch_0_2;
      } else {
        goto switch_0_default;
        if (0) {
        switch_0_0 : { status = DiskPerfStartDevice(DeviceObject, Irp); }
          goto switch_0_break;
        switch_0_2 : { status = DiskPerfRemoveDevice(DeviceObject, Irp); }
          goto switch_0_break;
        switch_0_default : { tmp = DiskPerfSendToNextDriver(DeviceObject, Irp); }
          return (tmp);
        } else {
        switch_0_break:;
        }
      }
    }
    return (status);
  }
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<__umoddi3>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x10(%rbp),%rdx
  mov    -0x20(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <__udivmoddi4@plt>
  mov    -0x10(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L6
  call   <__stack_chk_fail@plt>
L6:
  leave
  ret
```

assistant: ```c
unsigned long long __umoddi3(unsigned long long num, unsigned long long den) {
  unsigned long long v;
  (void)__udivmoddi4(num, den, &v);
  return v;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<__umoddi3>:
  endbr64
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdx
  call   <__udivmoddi4@plt>
  mov    (%rsp),%rax
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L9
  add    $0x18,%rsp
  ret
L9:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
unsigned long long __umoddi3(unsigned long long num, unsigned long long den) {
  unsigned long long v;
  (void)__udivmoddi4(num, den, &v);
  return v;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<__umoddi3>:
  endbr64
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdx
  call   <__udivmoddi4@plt>
  mov    (%rsp),%rax
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L4
  add    $0x18,%rsp
  ret
L4:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
unsigned long long __umoddi3(unsigned long long num, unsigned long long den) {
  unsigned long long v;
  (void)__udivmoddi4(num, den, &v);
  return v;
}
```
user: Translate the below assembly code into C programming language:

```asm
<__umoddi3>:
  endbr64
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdx
  call   <__udivmoddi4@plt>
  mov    (%rsp),%rax
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L7
  add    $0x18,%rsp
  ret
L7:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
unsigned long long __umoddi3(unsigned long long num, unsigned long long den) {
  unsigned long long v;
  (void)__udivmoddi4(num, den, &v);
  return v;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<is_consonant>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,%eax
  mov    %al,-0x4(%rbp)
  cmpb   $0x40,-0x4(%rbp)
  jle    L15
  cmpb   $0x5a,-0x4(%rbp)
  jle    L31
L15:
  cmpb   $0x60,-0x4(%rbp)
  jle    L46
  cmpb   $0x7a,-0x4(%rbp)
  jg     L46
L31:
  movsbl -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <is_vowel@plt>
  test   %eax,%eax
  jne    L46
  mov    $0x1,%eax
  jmp    L35
L46:
  mov    $0x0,%eax
L35:
  leave
  ret
```

assistant: ```c
int is_consonant(char c) {
  if (((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) && !is_vowel(c))
    return 1;
  return 0;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<is_consonant>:
  endbr64
  mov    %edi,%eax
  and    $0xffffffdf,%eax
  sub    $0x41,%eax
  mov    $0x0,%edx
  cmp    $0x19,%al
  jbe    L1
  mov    %edx,%eax
  ret
L1:
  sub    $0x8,%rsp
  movsbl %dil,%edi
  call   <is_vowel@plt>
  test   %eax,%eax
  sete   %dl
  movzbl %dl,%edx
  mov    %edx,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int is_consonant(char c) {
  if (((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) && !is_vowel(c))
    return 1;
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<is_consonant>:
  endbr64
  mov    %edi,%eax
  and    $0xffffffdf,%eax
  sub    $0x41,%eax
  cmp    $0x19,%al
  jbe    L9
  xor    %eax,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L9:
  sub    $0x8,%rsp
  movsbl %dil,%edi
  call   <is_vowel@plt>
  xor    %r8d,%r8d
  test   %eax,%eax
  sete   %r8b
  add    $0x8,%rsp
  mov    %r8d,%eax
  ret
```

assistant: ```c
int is_consonant(char c) {
  if (((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) && !is_vowel(c))
    return 1;
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<is_consonant>:
  endbr64
  mov    %edi,%eax
  and    $0xffffffdf,%eax
  sub    $0x41,%eax
  cmp    $0x19,%al
  jbe    L3
  xor    %eax,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L3:
  sub    $0x8,%rsp
  movsbl %dil,%edi
  call   <is_vowel@plt>
  xor    %r8d,%r8d
  test   %eax,%eax
  sete   %r8b
  add    $0x8,%rsp
  mov    %r8d,%eax
  ret
```

assistant: ```c
int is_consonant(char c) {
  if (((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) && !is_vowel(c))
    return 1;
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<ipow>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  movl   $0x1,-0x4(%rbp)
  jmp    L6
L5:
  mov    -0x18(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L10
  mov    -0x4(%rbp),%eax
  imul   -0x14(%rbp),%eax
  mov    %eax,-0x4(%rbp)
L10:
  sarl   -0x18(%rbp)
  mov    -0x14(%rbp),%eax
  imul   %eax,%eax
  mov    %eax,-0x14(%rbp)
L6:
  cmpl   $0x0,-0x18(%rbp)
  jne    L5
  mov    -0x4(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int64_t ipow(int64_t base, int64_t exp) {
  int64_t result = 1;
  while (exp) {
    if (exp & 1) {
      result *= base;
    }
    exp >>= 1;
    base *= base;
  }
  return result;
}
```
user: Translate the below assembly code into C programming language:

```asm
<ipow>:
  endbr64
  test   %esi,%esi
  je     L36
  mov    $0x1,%eax
  jmp    L24
L7:
  imul   %edi,%edi
  sar    %esi
  je     L47
L24:
  test   $0x1,%sil
  je     L7
  imul   %edi,%eax
  jmp    L7
L47:
  ret
L36:
  mov    $0x1,%eax
  ret
```

assistant: ```c
int64_t ipow(int64_t base, int64_t exp) {
  int64_t result = 1;
  while (exp) {
    if (exp & 1) {
      result *= base;
    }
    exp >>= 1;
    base *= base;
  }
  return result;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<ipow>:
  endbr64
  mov    $0x1,%eax
  test   %esi,%esi
  je     L19
  nopl   (%rax)
L27:
  test   $0x1,%sil
  je     L24
  imul   %edi,%eax
L24:
  imul   %edi,%edi
  sar    %esi
  jne    L27
  ret
  nopl   0x0(%rax)
L19:
  ret
```

assistant: ```c
int64_t ipow(int64_t base, int64_t exp) {
  int64_t result = 1;
  while (exp) {
    if (exp & 1) {
      result *= base;
    }
    exp >>= 1;
    base *= base;
  }
  return result;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<ipow>:
  endbr64
  mov    $0x1,%eax
  test   %esi,%esi
  je     L3
  nopl   (%rax)
L12:
  test   $0x1,%sil
  je     L22
  imul   %edi,%eax
L22:
  imul   %edi,%edi
  sar    %esi
  jne    L12
  ret
  nopl   0x0(%rax)
L3:
  ret
```

assistant: ```c
int64_t ipow(int64_t base, int64_t exp) {
  int64_t result = 1;
  while (exp) {
    if (exp & 1) {
      result *= base;
    }
    exp >>= 1;
    base *= base;
  }
  return result;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<close_libfile>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %esi,-0x8(%rbp)
  mov    D3(%rip),%rax
  mov    (%rax),%edx
  mov    -0x4(%rbp),%eax
  mov    $0x20,%esi
  mov    %eax,%edi
  call   <lseek@plt>
  mov    -0x8(%rbp),%edx
  mov    -0x4(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <write32_be@plt>
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  nop
  leave
  ret
```

assistant: ```c
void close_libfile(int fd, int count) {
  ;
  lseek(fd, 32, SEEK_SET);
  write32_be(fd, count);
  close(fd);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<close_libfile>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebx
  mov    %esi,%ebp
  mov    D2(%rip),%rax
  mov    (%rax),%edx
  mov    $0x20,%esi
  call   <lseek@plt>
  mov    %ebp,%esi
  mov    %ebx,%edi
  call   <write32_be@plt>
  mov    %ebx,%edi
  call   <close@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void close_libfile(int fd, int count) {
  ;
  lseek(fd, 32, SEEK_SET);
  write32_be(fd, count);
  close(fd);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<close_libfile>:
  endbr64
  push   %r12
  mov    %esi,%r12d
  mov    $0x20,%esi
  push   %rbp
  mov    %edi,%ebp
  sub    $0x8,%rsp
  mov    D5(%rip),%rax
  mov    (%rax),%edx
  call   <lseek@plt>
  mov    %ebp,%edi
  mov    %r12d,%esi
  call   <write32_be@plt>
  add    $0x8,%rsp
  mov    %ebp,%edi
  pop    %rbp
  pop    %r12
  jmp    1090 <close@plt>
```

assistant: ```c
void close_libfile(int fd, int count) {
  ;
  lseek(fd, 32, SEEK_SET);
  write32_be(fd, count);
  close(fd);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<close_libfile>:
  endbr64
  push   %r12
  mov    %esi,%r12d
  mov    $0x20,%esi
  push   %rbp
  mov    %edi,%ebp
  sub    $0x8,%rsp
  mov    D6(%rip),%rax
  mov    (%rax),%edx
  call   <lseek@plt>
  mov    %ebp,%edi
  mov    %r12d,%esi
  call   <write32_be@plt>
  add    $0x8,%rsp
  mov    %ebp,%edi
  pop    %rbp
  pop    %r12
  jmp    1090 <close@plt>
```

assistant: ```c
void close_libfile(int fd, int count) {
  ;
  lseek(fd, 32, SEEK_SET);
  write32_be(fd, count);
  close(fd);
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    $0x0,%eax
  call   <nondet_uint@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  movl   $0x0,-0x8(%rbp)
  jmp    L14
L3:
  subl   $0x1,-0xc(%rbp)
  addl   $0x1,-0x8(%rbp)
L14:
  cmpl   $0x0,-0xc(%rbp)
  jne    L3
  mov    -0x8(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    $0x0,%eax
  leave
  ret
```

assistant: ```c
int main() {
  unsigned int n = nondet_uint();
  unsigned int x = n, y = 0;
  while (x > 0) {
    x--;
    y++;
  }
  assert(y == n);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%eax
  call   <nondet_uint@plt>
  test   %eax,%eax
  je     L11
  mov    %eax,%edx
L10:
  sub    $0x1,%edx
  jne    L10
  mov    %eax,%edx
L26:
  cmp    %edx,%eax
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
L11:
  mov    %eax,%edx
  jmp    L26
```

assistant: ```c
int main() {
  unsigned int n = nondet_uint();
  unsigned int x = n, y = 0;
  while (x > 0) {
    x--;
    y++;
  }
  assert(y == n);
}
```
user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <nondet_uint@plt>
  mov    $0x1,%edi
  call   <assert@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main() {
  unsigned int n = nondet_uint();
  unsigned int x = n, y = 0;
  while (x > 0) {
    x--;
    y++;
  }
  assert(y == n);
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <nondet_uint@plt>
  mov    $0x1,%edi
  call   <assert@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main() {
  unsigned int n = nondet_uint();
  unsigned int x = n, y = 0;
  while (x > 0) {
    x--;
    y++;
  }
  assert(y == n);
}
```
user: What is the c source code of the assembly code below?

```asm
<VerifyIPAddress_orig>:
  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    -0x40(%rbp),%rax
  mov    %rax,-0x48(%rbp)
  mov    -0x58(%rbp),%rdx
  lea    -0x40(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  movl   $0x0,-0x4c(%rbp)
  jmp    L25
L22:
  mov    -0x48(%rbp),%rax
  lea    D5(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strtok@plt>
  mov    %rax,-0x48(%rbp)
  cmpq   $0x0,-0x48(%rbp)
  jne    L84
  mov    $0x0,%eax
  jmp    L95
L84:
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  jne    L59
  mov    -0x48(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x78,%al
  jne    L59
  mov    -0x48(%rbp),%rax
  lea    0x2(%rax),%rcx
  lea    -0x50(%rbp),%rax
  mov    %rax,%rdx
  mov    $0x10,%esi
  mov    %rcx,%rdi
  call   <ValidATOI@plt>
  test   %eax,%eax
  jne    L134
  mov    $0x0,%eax
  jmp    L95
L59:
  lea    -0x50(%rbp),%rdx
  mov    -0x48(%rbp),%rax
  mov    $0xa,%esi
  mov    %rax,%rdi
  call   <ValidATOI@plt>
  test   %eax,%eax
  jne    L134
  mov    $0x0,%eax
  jmp    L95
L134:
  mov    -0x50(%rbp),%eax
  test   %eax,%eax
  js     L93
  mov    -0x50(%rbp),%eax
  cmp    $0xff,%eax
  jle    L76
L93:
  mov    $0x0,%eax
  jmp    L95
L76:
  movq   $0x0,-0x48(%rbp)
  addl   $0x1,-0x4c(%rbp)
L25:
  cmpl   $0x3,-0x4c(%rbp)
  jle    L22
  mov    $0x1,%eax
L95:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L130
  call   <__stack_chk_fail@plt>
L130:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D5
type: string

tool: D5: .

assistant: ```c
char VerifyIPAddress_orig(char *src) {
  int i;
  int tnum;
  char tsrc[50];
  char *tok = tsrc;
  strcpy(tsrc, src);
  for (i = 0; i < 4; i++) {
    tok = strtok(tok, ".");
    if (!tok)
      return 0;
    if (tok[0] == '0' && tok[1] == 'x') {
      if (!ValidATOI(tok + 2, 0x10, &tnum))
        return 0;
    } else if (!ValidATOI(tok, 10, &tnum))
      return 0;
    if (tnum < 0 || tnum > 255)
      return 0;
    tok = ((void *)0);
  }
  return 1;
}
```
user: Translate the below assembly code into C programming language:

```asm
<VerifyIPAddress_orig>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,%rsi
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rbx
  mov    %rbx,%rdi
  call   <strcpy@plt>
  mov    $0x4,%ebp
  mov    %rbx,%rdi
  lea    D3(%rip),%rbx
  jmp    L97
L26:
  lea    0xc(%rsp),%rdx
  mov    $0xa,%esi
  call   <ValidATOI@plt>
  test   %eax,%eax
  je     L125
L42:
  cmpl   $0xff,0xc(%rsp)
  ja     L23
  mov    $0x0,%edi
  sub    $0x1,%ebp
  je     L59
L97:
  mov    %rbx,%rsi
  call   <strtok@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  je     L33
  cmpb   $0x30,(%rax)
  jne    L26
  cmpb   $0x78,0x1(%rax)
  jne    L26
  lea    0xc(%rsp),%rdx
  add    $0x2,%rdi
  mov    $0x10,%esi
  call   <ValidATOI@plt>
  test   %eax,%eax
  jne    L42
  mov    $0x0,%eax
  jmp    L109
L59:
  mov    $0x1,%eax
L109:
  mov    0x48(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L86
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  ret
L33:
  mov    $0x0,%eax
  jmp    L109
L125:
  mov    $0x0,%eax
  jmp    L109
L23:
  mov    $0x0,%eax
  jmp    L109
L86:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D3
data_type: string

tool: D3: .

assistant: ```c
char VerifyIPAddress_orig(char *src) {
  int i;
  int tnum;
  char tsrc[50];
  char *tok = tsrc;
  strcpy(tsrc, src);
  for (i = 0; i < 4; i++) {
    tok = strtok(tok, ".");
    if (!tok)
      return 0;
    if (tok[0] == '0' && tok[1] == 'x') {
      if (!ValidATOI(tok + 2, 0x10, &tnum))
        return 0;
    } else if (!ValidATOI(tok, 10, &tnum))
      return 0;
    if (tnum < 0 || tnum > 255)
      return 0;
    tok = ((void *)0);
  }
  return 1;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<VerifyIPAddress_orig>:
  endbr64
  push   %r12
  mov    %rdi,%rsi
  push   %rbp
  push   %rbx
  mov    $0x4,%ebx
  sub    $0x50,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rbp
  lea    0xc(%rsp),%r12
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    %rbp,%rdi
  lea    D3(%rip),%rbp
L2:
  mov    %rbp,%rsi
  call   <strtok@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  je     L36
  cmpb   $0x30,(%rax)
  jne    L84
  cmpb   $0x78,0x1(%rax)
  je     L69
L84:
  mov    %r12,%rdx
  mov    $0xa,%esi
  call   <ValidATOI@plt>
  test   %eax,%eax
  je     L36
L15:
  cmpl   $0xff,0xc(%rsp)
  ja     L36
  xor    %edi,%edi
  sub    $0x1,%ebx
  jne    L2
  mov    $0x1,%eax
L45:
  mov    0x48(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L12
  add    $0x50,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L69:
  add    $0x2,%rdi
  mov    %r12,%rdx
  mov    $0x10,%esi
  call   <ValidATOI@plt>
  test   %eax,%eax
  jne    L15
  nopl   (%rax)
L36:
  xor    %eax,%eax
  jmp    L45
L12:
  call   <__stack_chk_fail@plt>
```

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

tool: D3: .

assistant: ```c
char VerifyIPAddress_orig(char *src) {
  int i;
  int tnum;
  char tsrc[50];
  char *tok = tsrc;
  strcpy(tsrc, src);
  for (i = 0; i < 4; i++) {
    tok = strtok(tok, ".");
    if (!tok)
      return 0;
    if (tok[0] == '0' && tok[1] == 'x') {
      if (!ValidATOI(tok + 2, 0x10, &tnum))
        return 0;
    } else if (!ValidATOI(tok, 10, &tnum))
      return 0;
    if (tnum < 0 || tnum > 255)
      return 0;
    tok = ((void *)0);
  }
  return 1;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<VerifyIPAddress_orig>:
  endbr64
  push   %r12
  mov    %rdi,%rsi
  push   %rbp
  push   %rbx
  mov    $0x4,%ebx
  sub    $0x50,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rbp
  lea    0xc(%rsp),%r12
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    %rbp,%rdi
  lea    D0(%rip),%rbp
L3:
  mov    %rbp,%rsi
  call   <strtok@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  je     L65
  cmpb   $0x30,(%rax)
  jne    L80
  cmpb   $0x78,0x1(%rax)
  je     L86
L80:
  mov    %r12,%rdx
  mov    $0xa,%esi
  call   <ValidATOI@plt>
  test   %eax,%eax
  je     L65
L39:
  cmpl   $0xff,0xc(%rsp)
  ja     L65
  xor    %edi,%edi
  sub    $0x1,%ebx
  jne    L3
  mov    $0x1,%eax
L28:
  mov    0x48(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L76
  add    $0x50,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L86:
  add    $0x2,%rdi
  mov    %r12,%rdx
  mov    $0x10,%esi
  call   <ValidATOI@plt>
  test   %eax,%eax
  jne    L39
  nopl   (%rax)
L65:
  xor    %eax,%eax
  jmp    L28
L76:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D0
type_guessed: string

tool: D0: .

assistant: ```c
char VerifyIPAddress_orig(char *src) {
  int i;
  int tnum;
  char tsrc[50];
  char *tok = tsrc;
  strcpy(tsrc, src);
  for (i = 0; i < 4; i++) {
    tok = strtok(tok, ".");
    if (!tok)
      return 0;
    if (tok[0] == '0' && tok[1] == 'x') {
      if (!ValidATOI(tok + 2, 0x10, &tnum))
        return 0;
    } else if (!ValidATOI(tok, 10, &tnum))
      return 0;
    if (tnum < 0 || tnum > 255)
      return 0;
    tok = ((void *)0);
  }
  return 1;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<fnet_accept>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x4,-0x10(%rbp)
  mov    -0x10(%rbp),%edx
  lea    -0x14(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  movl   $0xffffffff,-0xc(%rbp)
  lea    -0x10(%rbp),%rdx
  lea    -0x14(%rbp),%rcx
  mov    -0x24(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <accept@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0xffffffff,-0xc(%rbp)
  jne    L36
  mov    D31(%rip),%rax
  mov    (%rax),%rdx
  mov    D33(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  je     L19
  mov    D31(%rip),%rax
  mov    (%rax),%rdx
  mov    D11(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jne    L60
  mov    $0xfffffffe,%eax
  jmp    L58
L60:
  mov    $0xffffffff,%eax
  jmp    L58
L36:
  nop
  jmp    L18
L19:
  nop
L18:
  mov    -0xc(%rbp),%eax
  mov    $0x2,%esi
  mov    %eax,%edi
  call   <fnet_set_recv_timeout@plt>
  mov    -0xc(%rbp),%eax
L58:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L35
  call   <__stack_chk_fail@plt>
L35:
  leave
  ret
```

assistant: ```c
int fnet_accept(int listen_fd) {
  struct sockaddr addr;
  socklen_t addrlen = sizeof(struct sockaddr_in);
  memset(&addr, 0, addrlen);
  int sock_fd = -1;
  do {
    sock_fd = accept(listen_fd, (struct sockaddr *)&addr, &addrlen);
    if (sock_fd == -1) {
      if (errno == EINTR)
        continue;
      else if (errno == EAGAIN)
        return -2;
      else
        return -1;
    } else
      break;
  } while (0);
  fnet_set_recv_timeout(sock_fd, 2);
  return sock_fd;
}
```
user: What is the c source code of the assembly code below?

```asm
<fnet_accept>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %edi,%ebx
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  movl   $0x4,0x4(%rsp)
  mov    %rsp,%rbp
  mov    $0x4,%edx
  mov    $0x0,%esi
  mov    %rbp,%rdi
  call   <memset@plt>
  lea    0x4(%rsp),%rdx
  mov    %rbp,%rsi
  mov    %ebx,%edi
  call   <accept@plt>
  mov    %eax,%ebx
  cmp    $0xffffffff,%eax
  jne    L31
  mov    D17(%rip),%rax
  mov    (%rax),%rax
  mov    D20(%rip),%rdx
  cmp    (%rdx),%rax
  je     L31
  mov    D24(%rip),%rdx
  cmp    (%rdx),%rax
  mov    $0xfffffffe,%eax
  cmove  %eax,%ebx
  jmp    L8
L31:
  mov    $0x2,%esi
  mov    %ebx,%edi
  call   <fnet_set_recv_timeout@plt>
L8:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L23
  mov    %ebx,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
L23:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int fnet_accept(int listen_fd) {
  struct sockaddr addr;
  socklen_t addrlen = sizeof(struct sockaddr_in);
  memset(&addr, 0, addrlen);
  int sock_fd = -1;
  do {
    sock_fd = accept(listen_fd, (struct sockaddr *)&addr, &addrlen);
    if (sock_fd == -1) {
      if (errno == EINTR)
        continue;
      else if (errno == EAGAIN)
        return -2;
      else
        return -1;
    } else
      break;
  } while (0);
  fnet_set_recv_timeout(sock_fd, 2);
  return sock_fd;
}
```