ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 这段汇编代码用C语言表示是什么样的？

```asm
<xmalloc>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <assert@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L6
  mov    $0x0,%eax
  call   <abort@plt>
L6:
  mov    -0x8(%rbp),%rax
  leave
  ret
```

assistant: ```c
void *xmalloc(size_t size) {
  void *ptr;
  assert(size);
  ptr = malloc(size);
  if (!ptr)
    abort();
  return ptr;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<xmalloc>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <assert@plt>
  mov    %rbx,%rdi
  call   <malloc@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L18
L19:
  mov    %rbx,%rax
  pop    %rbx
  ret
L18:
  mov    $0x0,%eax
  call   <abort@plt>
  jmp    L19
```

assistant: ```c
void *xmalloc(size_t size) {
  void *ptr;
  assert(size);
  ptr = malloc(size);
  if (!ptr)
    abort();
  return ptr;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<xmalloc>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  call   <assert@plt>
  mov    %r12,%rdi
  call   <malloc@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L3
L2:
  mov    %r12,%rax
  pop    %r12
  ret
L3:
  xor    %eax,%eax
  call   <abort@plt>
  jmp    L2
```

assistant: ```c
void *xmalloc(size_t size) {
  void *ptr;
  assert(size);
  ptr = malloc(size);
  if (!ptr)
    abort();
  return ptr;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<xmalloc>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  call   <assert@plt>
  mov    %r12,%rdi
  call   <malloc@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L7
L12:
  mov    %r12,%rax
  pop    %r12
  ret
L7:
  xor    %eax,%eax
  call   <abort@plt>
  jmp    L12
```

assistant: ```c
void *xmalloc(size_t size) {
  void *ptr;
  assert(size);
  ptr = malloc(size);
  if (!ptr)
    abort();
  return ptr;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<getmaxbit>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  shr    %eax
  or     %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  shr    $0x2,%eax
  or     %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  shr    $0x4,%eax
  or     %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  shr    $0x8,%eax
  or     %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  shr    $0x10,%eax
  or     %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  imul   $0x7c4acdd,%eax,%eax
  shr    $0x1b,%eax
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D3(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  pop    %rbp
  ret
```

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

tool: 

assistant: ```c
int getmaxbit(unsigned int v) {
  static const int bit_position[32] = {0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30, 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31};
  v |= v >> 1;
  v |= v >> 2;
  v |= v >> 4;
  v |= v >> 8;
  v |= v >> 16;
  return bit_position[(unsigned int)(v * 0x07C4ACDDU) >> 27];
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<getmaxbit>:
  endbr64
  mov    %edi,%eax
  shr    %eax
  or     %edi,%eax
  mov    %eax,%edx
  shr    $0x2,%edx
  or     %eax,%edx
  mov    %edx,%eax
  shr    $0x4,%eax
  or     %edx,%eax
  mov    %eax,%edx
  shr    $0x8,%edx
  or     %eax,%edx
  mov    %edx,%eax
  shr    $0x10,%eax
  or     %edx,%eax
  imul   $0x7c4acdd,%eax,%eax
  shr    $0x1b,%eax
  mov    %eax,%eax
  lea    D9(%rip),%rdx
  mov    (%rdx,%rax,4),%eax
  ret
```

tool_calls: name: retrieve_data
arguments: label: D9
type_guessed: string

tool: 

assistant: ```c
int getmaxbit(unsigned int v) {
  static const int bit_position[32] = {0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30, 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31};
  v |= v >> 1;
  v |= v >> 2;
  v |= v >> 4;
  v |= v >> 8;
  v |= v >> 16;
  return bit_position[(unsigned int)(v * 0x07C4ACDDU) >> 27];
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<getmaxbit>:
  endbr64
  mov    %edi,%eax
  shr    %eax
  or     %edi,%eax
  mov    %eax,%edx
  shr    $0x2,%edx
  or     %eax,%edx
  mov    %edx,%eax
  shr    $0x4,%eax
  or     %edx,%eax
  mov    %eax,%edx
  shr    $0x8,%edx
  or     %eax,%edx
  mov    %edx,%eax
  shr    $0x10,%eax
  or     %edx,%eax
  lea    D1(%rip),%rdx
  imul   $0x7c4acdd,%eax,%eax
  shr    $0x1b,%eax
  mov    (%rdx,%rax,4),%eax
  ret
```

tool_calls: name: parse_data
arguments: label: D1
type_guessed: string

tool: 

assistant: ```c
int getmaxbit(unsigned int v) {
  static const int bit_position[32] = {0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30, 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31};
  v |= v >> 1;
  v |= v >> 2;
  v |= v >> 4;
  v |= v >> 8;
  v |= v >> 16;
  return bit_position[(unsigned int)(v * 0x07C4ACDDU) >> 27];
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<getmaxbit>:
  endbr64
  mov    %edi,%eax
  shr    %eax
  or     %edi,%eax
  mov    %eax,%edx
  shr    $0x2,%edx
  or     %eax,%edx
  mov    %edx,%eax
  shr    $0x4,%eax
  or     %edx,%eax
  mov    %eax,%edx
  shr    $0x8,%edx
  or     %eax,%edx
  mov    %edx,%eax
  shr    $0x10,%eax
  or     %edx,%eax
  lea    D4(%rip),%rdx
  imul   $0x7c4acdd,%eax,%eax
  shr    $0x1b,%eax
  mov    (%rdx,%rax,4),%eax
  ret
```

tool_calls: name: unpack_data
arguments: tag: D4
type_infered: string

tool: 

assistant: ```c
int getmaxbit(unsigned int v) {
  static const int bit_position[32] = {0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30, 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31};
  v |= v >> 1;
  v |= v >> 2;
  v |= v >> 4;
  v |= v >> 8;
  v |= v >> 16;
  return bit_position[(unsigned int)(v * 0x07C4ACDDU) >> 27];
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<reverse>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
L5:
  subq   $0x4,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x20(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  jbe    L6
  mov    -0x18(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x18(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    -0x4(%rbp),%edx
  mov    %edx,(%rax)
  jmp    L5
L6:
  nop
  pop    %rbp
  ret
```

assistant: ```c
void reverse(unsigned int *a1, unsigned int *a2) {
  int t;
  for (;;) {
    t = *--a2;
    if (a2 <= a1)
      return;
    *a2 = *a1;
    *a1++ = t;
  }
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<reverse>:
  endbr64
  lea    -0x4(%rsi),%rax
  mov    -0x4(%rsi),%edx
  cmp    %rax,%rdi
  jae    L4
L16:
  mov    (%rdi),%ecx
  mov    %ecx,(%rax)
  add    $0x4,%rdi
  mov    %edx,-0x4(%rdi)
  sub    $0x4,%rax
  mov    (%rax),%edx
  cmp    %rdi,%rax
  ja     L16
L4:
  ret
```

assistant: ```c
void reverse(unsigned int *a1, unsigned int *a2) {
  int t;
  for (;;) {
    t = *--a2;
    if (a2 <= a1)
      return;
    *a2 = *a1;
    *a1++ = t;
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<reverse>:
  endbr64
  lea    -0x4(%rsi),%rax
  mov    -0x4(%rsi),%edx
  cmp    %rax,%rdi
  jae    L14
L8:
  mov    (%rdi),%ecx
  sub    $0x4,%rax
  add    $0x4,%rdi
  mov    %ecx,0x4(%rax)
  mov    %edx,-0x4(%rdi)
  mov    (%rax),%edx
  cmp    %rdi,%rax
  ja     L8
L14:
  ret
```

assistant: ```c
void reverse(unsigned int *a1, unsigned int *a2) {
  int t;
  for (;;) {
    t = *--a2;
    if (a2 <= a1)
      return;
    *a2 = *a1;
    *a1++ = t;
  }
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<reverse>:
  endbr64
  lea    -0x4(%rsi),%rax
  mov    -0x4(%rsi),%edx
  cmp    %rax,%rdi
  jae    L10
L1:
  mov    (%rdi),%ecx
  sub    $0x4,%rax
  add    $0x4,%rdi
  mov    %ecx,0x4(%rax)
  mov    %edx,-0x4(%rdi)
  mov    (%rax),%edx
  cmp    %rdi,%rax
  ja     L1
L10:
  ret
```

assistant: ```c
void reverse(unsigned int *a1, unsigned int *a2) {
  int t;
  for (;;) {
    t = *--a2;
    if (a2 <= a1)
      return;
    *a2 = *a1;
    *a1++ = t;
  }
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<epb2i>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  movsd  %xmm0,-0x28(%rbp)
  mov    %rdi,-0x30(%rbp)
  mov    %rsi,-0x38(%rbp)
  mov    %rdx,-0x40(%rbp)
  mov    %rcx,-0x48(%rbp)
  mov    %r8,-0x50(%rbp)
  mov    %r9,-0x58(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x10(%rbp),%rcx
  lea    -0x18(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rdx,%rdi
  movq   %rax,%xmm0
  mov    $0x1,%eax
  call   <epb2dt@plt>
  movsd  -0x10(%rbp),%xmm0
  mov    -0x18(%rbp),%rax
  mov    -0x58(%rbp),%r9
  mov    -0x50(%rbp),%r10
  mov    -0x48(%rbp),%rcx
  mov    -0x40(%rbp),%rdx
  mov    -0x38(%rbp),%rsi
  mov    -0x30(%rbp),%rdi
  sub    $0x8,%rsp
  mov    0x10(%rbp),%r8d
  push   %r8
  mov    %r10,%r8
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  mov    $0x2,%eax
  call   <dt2i@plt>
  add    $0x10,%rsp
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L9
  call   <__stack_chk_fail@plt>
L9:
  leave
  ret
```

assistant: ```c
void epb2i(epoch, iyr, imon, iday, ihr, imn, sec, ndsec) double epoch;
int *iyr;
int *imon;
int *iday;
int *ihr;
int *imn;
double *sec;
int ndsec;
{
  double date, time;
  epb2dt(epoch, &date, &time);
  dt2i(date, time, iyr, imon, iday, ihr, imn, sec, ndsec);
  return;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<epb2i>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  mov    %rdx,%r12
  mov    %rcx,%r13
  mov    %r8,%r14
  mov    %r9,%r15
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rsi
  lea    0x8(%rsp),%rdi
  mov    $0x1,%eax
  call   <epb2dt@plt>
  sub    $0x8,%rsp
  mov    0x68(%rsp),%eax
  push   %rax
  mov    %r15,%r9
  mov    %r14,%r8
  mov    %r13,%rcx
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  movsd  0x20(%rsp),%xmm1
  movsd  0x18(%rsp),%xmm0
  mov    $0x2,%eax
  call   <dt2i@plt>
  add    $0x10,%rsp
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L4
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L4:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void epb2i(epoch, iyr, imon, iday, ihr, imn, sec, ndsec) double epoch;
int *iyr;
int *imon;
int *iday;
int *ihr;
int *imn;
double *sec;
int ndsec;
{
  double date, time;
  epb2dt(epoch, &date, &time);
  dt2i(date, time, iyr, imon, iday, ihr, imn, sec, ndsec);
  return;
}
```
user: Translate the below assembly code into C programming language:

```asm
<epb2i>:
  endbr64
  push   %r15
  mov    %r9,%r15
  push   %r14
  mov    %rcx,%r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %r8,%rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rsi
  lea    0x8(%rsp),%rdi
  mov    $0x1,%eax
  call   <epb2dt@plt>
  sub    $0x8,%rsp
  mov    %r13,%rdx
  mov    %r15,%r9
  mov    0x68(%rsp),%eax
  mov    %rbx,%r8
  mov    %r14,%rcx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  push   %rax
  movsd  0x20(%rsp),%xmm1
  mov    $0x2,%eax
  movsd  0x18(%rsp),%xmm0
  call   <dt2i@plt>
  pop    %rax
  pop    %rdx
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L9
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L9:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void epb2i(epoch, iyr, imon, iday, ihr, imn, sec, ndsec) double epoch;
int *iyr;
int *imon;
int *iday;
int *ihr;
int *imn;
double *sec;
int ndsec;
{
  double date, time;
  epb2dt(epoch, &date, &time);
  dt2i(date, time, iyr, imon, iday, ihr, imn, sec, ndsec);
  return;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<epb2i>:
  endbr64
  push   %r15
  mov    %r9,%r15
  push   %r14
  mov    %rcx,%r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %r8,%rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rsi
  lea    0x8(%rsp),%rdi
  mov    $0x1,%eax
  call   <epb2dt@plt>
  sub    $0x8,%rsp
  mov    %r13,%rdx
  mov    %r15,%r9
  mov    0x68(%rsp),%eax
  mov    %rbx,%r8
  mov    %r14,%rcx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  push   %rax
  movsd  0x20(%rsp),%xmm1
  mov    $0x2,%eax
  movsd  0x18(%rsp),%xmm0
  call   <dt2i@plt>
  pop    %rax
  pop    %rdx
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L7
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L7:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void epb2i(epoch, iyr, imon, iday, ihr, imn, sec, ndsec) double epoch;
int *iyr;
int *imon;
int *iday;
int *ihr;
int *imn;
double *sec;
int ndsec;
{
  double date, time;
  epb2dt(epoch, &date, &time);
  dt2i(date, time, iyr, imon, iday, ihr, imn, sec, ndsec);
  return;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<run_mut>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    $0x64,%edi
  call   <rndgen_range@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x13,-0x8(%rbp)
  setbe  %al
  movzbl %al,%eax
  leave
  ret
```

assistant: ```c
int run_mut(void) {
  if (20 >= 100)
    return 1;
  if (20 <= 0)
    return 0;
  size_t p = rndgen_range(100);
  return p < 20;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<run_mut>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x64,%edi
  call   <rndgen_range@plt>
  cmp    $0x13,%rax
  setbe  %al
  movzbl %al,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int run_mut(void) {
  if (20 >= 100)
    return 1;
  if (20 <= 0)
    return 0;
  size_t p = rndgen_range(100);
  return p < 20;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<run_mut>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x64,%edi
  call   <rndgen_range@plt>
  cmp    $0x13,%rax
  setbe  %al
  add    $0x8,%rsp
  movzbl %al,%eax
  ret
```

assistant: ```c
int run_mut(void) {
  if (20 >= 100)
    return 1;
  if (20 <= 0)
    return 0;
  size_t p = rndgen_range(100);
  return p < 20;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<run_mut>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x64,%edi
  call   <rndgen_range@plt>
  cmp    $0x13,%rax
  setbe  %al
  add    $0x8,%rsp
  movzbl %al,%eax
  ret
```

assistant: ```c
int run_mut(void) {
  if (20 >= 100)
    return 1;
  if (20 <= 0)
    return 0;
  size_t p = rndgen_range(100);
  return p < 20;
}
```
user: Translate the below assembly code into C programming language:

```asm
<ft_putnbr_fd>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  jns    L31
  mov    -0x18(%rbp),%eax
  mov    %eax,%esi
  mov    $0x2d,%edi
  call   <ft_putchar_fd@plt>
  cmpl   $0xfffffff7,-0x14(%rbp)
  jge    L8
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x4(%rbp)
  negl   -0x4(%rbp)
  mov    -0x18(%rbp),%edx
  mov    -0x4(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <ft_putnbr_fd>
L8:
  mov    -0x14(%rbp),%edx
  movslq %edx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %edx,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  mov    %eax,%ecx
  mov    %ecx,%eax
  shl    $0x2,%eax
  add    %ecx,%eax
  add    %eax,%eax
  sub    %eax,%edx
  mov    %edx,-0x14(%rbp)
  mov    $0x30,%eax
  sub    -0x14(%rbp),%eax
  mov    -0x18(%rbp),%edx
  mov    %edx,%esi
  mov    %eax,%edi
  call   <ft_putchar_fd@plt>
  jmp    L21
L31:
  cmpl   $0x9,-0x14(%rbp)
  jle    L12
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  sub    %eax,%edx
  mov    -0x18(%rbp),%eax
  mov    %eax,%esi
  mov    %edx,%edi
  call   <ft_putnbr_fd>
L12:
  mov    -0x14(%rbp),%ecx
  movslq %ecx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %ecx,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  sub    %eax,%ecx
  mov    %ecx,%edx
  add    $0x30,%edx
  mov    -0x18(%rbp),%eax
  mov    %eax,%esi
  mov    %edx,%edi
  call   <ft_putchar_fd@plt>
  nop
L21:
  leave
  ret
```

assistant: ```c
void ft_putnbr_fd(int n, int fd) {
  int m;
  if (n < 0) {
    ft_putchar_fd('-', fd);
    if (n < -9) {
      m = n / 10;
      m = -m;
      ft_putnbr_fd(m, fd);
    }
    n = n % 10;
    ft_putchar_fd(-n + '0', fd);
    return;
  }
  if (n > 9)
    ft_putnbr_fd(n / 10, fd);
  ft_putchar_fd(n % 10 + '0', fd);
  return;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<ft_putnbr_fd>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebx
  mov    %esi,%ebp
  test   %edi,%edi
  js     L47
  cmp    $0x9,%edi
  jg     L2
L41:
  movslq %ebx,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x22,%rax
  mov    %ebx,%edx
  sar    $0x1f,%edx
  sub    %edx,%eax
  lea    (%rax,%rax,4),%eax
  add    %eax,%eax
  sub    %eax,%ebx
  lea    0x30(%rbx),%edi
  mov    %ebp,%esi
  call   <ft_putchar_fd@plt>
L45:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L47:
  mov    $0x2d,%edi
  call   <ft_putchar_fd@plt>
  cmp    $0xfffffff7,%ebx
  jl     L33
L23:
  movslq %ebx,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x22,%rax
  mov    %ebx,%edx
  sar    $0x1f,%edx
  sub    %edx,%eax
  lea    (%rax,%rax,4),%eax
  add    %eax,%eax
  sub    %ebx,%eax
  lea    0x30(%rax),%edi
  mov    %ebp,%esi
  call   <ft_putchar_fd@plt>
  jmp    L45
L33:
  movslq %ebx,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x22,%rax
  mov    %ebx,%edi
  sar    $0x1f,%edi
  sub    %eax,%edi
  mov    %ebp,%esi
  call   <ft_putnbr_fd>
  jmp    L23
L2:
  movslq %edi,%rdi
  imul   $0x66666667,%rdi,%rdi
  sar    $0x22,%rdi
  mov    %ebx,%eax
  sar    $0x1f,%eax
  sub    %eax,%edi
  call   <ft_putnbr_fd>
  jmp    L41
```

assistant: ```c
void ft_putnbr_fd(int n, int fd) {
  int m;
  if (n < 0) {
    ft_putchar_fd('-', fd);
    if (n < -9) {
      m = n / 10;
      m = -m;
      ft_putnbr_fd(m, fd);
    }
    n = n % 10;
    ft_putchar_fd(-n + '0', fd);
    return;
  }
  if (n > 9)
    ft_putnbr_fd(n / 10, fd);
  ft_putchar_fd(n % 10 + '0', fd);
  return;
}
```
user: What is the c source code of the assembly code below?

```asm
<ft_putnbr_fd>:
  endbr64
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  push   %rbx
  mov    %edi,%ebx
  test   %edi,%edi
  js     L14
  movslq %edi,%rbp
  cmp    $0x9,%edi
  jg     L0
L4:
  imul   $0x66666667,%rbp,%rax
  mov    %ebx,%edx
  mov    %r12d,%esi
  sar    $0x1f,%edx
  sar    $0x22,%rax
  sub    %edx,%eax
  lea    (%rax,%rax,4),%eax
  add    %eax,%eax
  sub    %eax,%ebx
  lea    0x30(%rbx),%edi
  pop    %rbx
  pop    %rbp
  pop    %r12
  jmp    1050 <ft_putchar_fd@plt>
  nopl   0x0(%rax)
L0:
  imul   $0x66666667,%rbp,%rdi
  mov    %ebx,%eax
  sar    $0x1f,%eax
  sar    $0x22,%rdi
  sub    %eax,%edi
  call   <ft_putnbr_fd>
  jmp    L4
  nopl   0x0(%rax)
L14:
  mov    $0x2d,%edi
  movslq %ebx,%rbp
  call   <ft_putchar_fd@plt>
  cmp    $0xfffffff7,%ebx
  jl     L25
L34:
  imul   $0x66666667,%rbp,%rbp
  mov    %ebx,%eax
  mov    %r12d,%esi
  sar    $0x1f,%eax
  sar    $0x22,%rbp
  sub    %eax,%ebp
  lea    0x0(%rbp,%rbp,4),%eax
  add    %eax,%eax
  sub    %ebx,%eax
  pop    %rbx
  pop    %rbp
  lea    0x30(%rax),%edi
  pop    %r12
  jmp    1050 <ft_putchar_fd@plt>
  nopl   0x0(%rax,%rax,1)
L25:
  imul   $0x66666667,%rbp,%rax
  mov    %ebx,%edi
  mov    %r12d,%esi
  sar    $0x1f,%edi
  sar    $0x22,%rax
  sub    %eax,%edi
  call   <ft_putnbr_fd>
  jmp    L34
```

assistant: ```c
void ft_putnbr_fd(int n, int fd) {
  int m;
  if (n < 0) {
    ft_putchar_fd('-', fd);
    if (n < -9) {
      m = n / 10;
      m = -m;
      ft_putnbr_fd(m, fd);
    }
    n = n % 10;
    ft_putchar_fd(-n + '0', fd);
    return;
  }
  if (n > 9)
    ft_putnbr_fd(n / 10, fd);
  ft_putchar_fd(n % 10 + '0', fd);
  return;
}
```
user: What is the c source code of the assembly code below:

```asm
<ft_putnbr_fd>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  push   %rbx
  mov    %edi,%ebx
  test   %edi,%edi
  js     L36
  movslq %edi,%rbp
  cmp    $0x9,%edi
  jg     L49
L58:
  imul   $0x66666667,%rbp,%rax
  mov    %ebx,%edx
  mov    %r12d,%esi
  sar    $0x1f,%edx
  sar    $0x22,%rax
  sub    %edx,%eax
  lea    (%rax,%rax,4),%eax
  add    %eax,%eax
  sub    %eax,%ebx
  lea    0x30(%rbx),%edi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1050 <ft_putchar_fd@plt>
  nopl   (%rax)
L49:
  imul   $0x66666667,%rbp,%r13
  mov    %edi,%eax
  sar    $0x1f,%eax
  sar    $0x22,%r13
  sub    %eax,%r13d
  mov    %r13d,%r14d
  cmp    $0x63,%edi
  jg     L42
L20:
  mov    $0xcccccccd,%eax
  mov    %r12d,%esi
  imul   %r14,%rax
  shr    $0x23,%rax
  lea    (%rax,%rax,4),%eax
  add    %eax,%eax
  sub    %eax,%r13d
  lea    0x30(%r13),%edi
  call   <ft_putchar_fd@plt>
  jmp    L58
  xchg   %ax,%ax
L42:
  mov    $0xcccccccd,%edi
  imul   %r14,%rdi
  shr    $0x23,%rdi
  call   <ft_putnbr_fd>
  jmp    L20
  nopl   0x0(%rax)
L36:
  mov    $0x2d,%edi
  movslq %ebx,%rbp
  call   <ft_putchar_fd@plt>
  cmp    $0xfffffff7,%ebx
  jl     L45
L41:
  imul   $0x66666667,%rbp,%rbp
  mov    %ebx,%eax
  mov    %r12d,%esi
  sar    $0x1f,%eax
  sar    $0x22,%rbp
  sub    %eax,%ebp
  lea    0x0(%rbp,%rbp,4),%eax
  add    %eax,%eax
  sub    %ebx,%eax
  pop    %rbx
  pop    %rbp
  lea    0x30(%rax),%edi
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1050 <ft_putchar_fd@plt>
  nopw   0x0(%rax,%rax,1)
L45:
  imul   $0x66666667,%rbp,%rax
  mov    %ebx,%edi
  mov    %r12d,%esi
  sar    $0x1f,%edi
  sar    $0x22,%rax
  sub    %eax,%edi
  call   <ft_putnbr_fd>
  jmp    L41
```

assistant: ```c
void ft_putnbr_fd(int n, int fd) {
  int m;
  if (n < 0) {
    ft_putchar_fd('-', fd);
    if (n < -9) {
      m = n / 10;
      m = -m;
      ft_putnbr_fd(m, fd);
    }
    n = n % 10;
    ft_putchar_fd(-n + '0', fd);
    return;
  }
  if (n > 9)
    ft_putnbr_fd(n / 10, fd);
  ft_putchar_fd(n % 10 + '0', fd);
  return;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<cstrpbrk>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  jmp    L27
L7:
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L37
L30:
  mov    -0xc(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jne    L37
  mov    -0x18(%rbp),%rax
  sub    $0x1,%rax
  jmp    L49
L37:
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  jne    L30
L27:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,-0x10(%rbp)
  cmpl   $0x0,-0x10(%rbp)
  jne    L7
  mov    $0x0,%eax
L49:
  pop    %rbp
  ret
```

assistant: ```c
char *cstrpbrk(const char *s1, const char *s2) {
  const char *scanp;
  int c, sc;
  while ((c = *s1++) != 0) {
    for (scanp = s2; (sc = *scanp++) != 0;)
      if (sc == c)
        return ((char *)(s1 - 1));
  }
  return (NULL);
}
```