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

```asm
<Action>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  lea    D25(%rip),%r13
  mov    %r13,%rsi
  lea    D42(%rip),%rdi
  call   <lr_save_string@plt>
  lea    D67(%rip),%r12
  mov    %r12,%rdi
  call   <lr_eval_string@plt>
  mov    %eax,%edi
  lea    D41(%rip),%rbp
  mov    %rbp,%rsi
  call   <Reverse@plt>
  lea    D55(%rip),%rbx
  mov    %rbx,%rdi
  call   <lr_eval_string@plt>
  mov    %eax,%edi
  call   <lr_output_message@plt>
  mov    %r13,%rsi
  lea    D57(%rip),%rdi
  call   <lr_save_string@plt>
  mov    %r12,%rdi
  call   <lr_eval_string@plt>
  mov    %eax,%edi
  mov    %rbp,%rsi
  call   <Reverse@plt>
  mov    %rbx,%rdi
  call   <lr_eval_string@plt>
  mov    %eax,%edi
  call   <lr_output_message@plt>
  mov    %r13,%rsi
  lea    D10(%rip),%rdi
  call   <lr_save_string@plt>
  mov    %r12,%rdi
  call   <lr_eval_string@plt>
  mov    %eax,%edi
  mov    %rbp,%rsi
  call   <Reverse@plt>
  mov    %rbx,%rdi
  call   <lr_eval_string@plt>
  mov    %eax,%edi
  call   <lr_output_message@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D25
type: string
name: retrieve_data
arguments: tag: D42
type: string
name: retrieve_data
arguments: tag: D67
type: string
name: retrieve_data
arguments: tag: D41
type: string
name: retrieve_data
arguments: tag: D55
type: string
name: retrieve_data
arguments: tag: D57
type: string
name: retrieve_data
arguments: tag: D10
type: string

tool: D25: Param

tool: D42: ABC123456

tool: D67: {Param}

tool: D41: NewParam

tool: D55: Changed [{Param}] to [{NewParam}]

tool: D57: Peter Piper

tool: D10: Fiddlesticks

assistant: ```c
Action() {
  lr_save_string("ABC123456", "Param");
  Reverse(lr_eval_string("{Param}"), "NewParam");
  lr_output_message(lr_eval_string("Changed [{Param}] to [{NewParam}]"));
  lr_save_string("Peter Piper", "Param");
  Reverse(lr_eval_string("{Param}"), "NewParam");
  lr_output_message(lr_eval_string("Changed [{Param}] to [{NewParam}]"));
  lr_save_string("Fiddlesticks", "Param");
  Reverse(lr_eval_string("{Param}"), "NewParam");
  lr_output_message(lr_eval_string("Changed [{Param}] to [{NewParam}]"));
  return 0;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<Action>:
  endbr64
  push   %r14
  lea    D24(%rip),%r14
  lea    D61(%rip),%rdi
  push   %r13
  mov    %r14,%rsi
  lea    D17(%rip),%r13
  push   %r12
  lea    D3(%rip),%r12
  push   %rbp
  lea    D20(%rip),%rbp
  sub    $0x8,%rsp
  call   <lr_save_string@plt>
  mov    %r13,%rdi
  call   <lr_eval_string@plt>
  mov    %r12,%rsi
  mov    %eax,%edi
  call   <Reverse@plt>
  mov    %rbp,%rdi
  call   <lr_eval_string@plt>
  mov    %eax,%edi
  call   <lr_output_message@plt>
  mov    %r14,%rsi
  lea    D15(%rip),%rdi
  call   <lr_save_string@plt>
  mov    %r13,%rdi
  call   <lr_eval_string@plt>
  mov    %r12,%rsi
  mov    %eax,%edi
  call   <Reverse@plt>
  mov    %rbp,%rdi
  call   <lr_eval_string@plt>
  mov    %eax,%edi
  call   <lr_output_message@plt>
  mov    %r14,%rsi
  lea    D21(%rip),%rdi
  call   <lr_save_string@plt>
  mov    %r13,%rdi
  call   <lr_eval_string@plt>
  mov    %r12,%rsi
  mov    %eax,%edi
  call   <Reverse@plt>
  mov    %rbp,%rdi
  call   <lr_eval_string@plt>
  mov    %eax,%edi
  call   <lr_output_message@plt>
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D24
datatype: string
name: disassemble_data
arguments: data_label: D61
datatype: string
name: disassemble_data
arguments: data_label: D17
datatype: string
name: disassemble_data
arguments: data_label: D3
datatype: string
name: disassemble_data
arguments: data_label: D20
datatype: string
name: disassemble_data
arguments: data_label: D15
datatype: string
name: disassemble_data
arguments: data_label: D21
datatype: string

tool: D24: Param

tool: D61: ABC123456

tool: D17: {Param}

tool: D3: NewParam

tool: D20: Changed [{Param}] to [{NewParam}]

tool: D15: Peter Piper

tool: D21: Fiddlesticks

assistant: ```c
Action() {
  lr_save_string("ABC123456", "Param");
  Reverse(lr_eval_string("{Param}"), "NewParam");
  lr_output_message(lr_eval_string("Changed [{Param}] to [{NewParam}]"));
  lr_save_string("Peter Piper", "Param");
  Reverse(lr_eval_string("{Param}"), "NewParam");
  lr_output_message(lr_eval_string("Changed [{Param}] to [{NewParam}]"));
  lr_save_string("Fiddlesticks", "Param");
  Reverse(lr_eval_string("{Param}"), "NewParam");
  lr_output_message(lr_eval_string("Changed [{Param}] to [{NewParam}]"));
  return 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<Action>:
  endbr64
  push   %r14
  lea    D60(%rip),%r14
  lea    D24(%rip),%rdi
  push   %r13
  mov    %r14,%rsi
  lea    D52(%rip),%r13
  push   %r12
  lea    D26(%rip),%r12
  push   %rbp
  lea    D64(%rip),%rbp
  sub    $0x8,%rsp
  call   <lr_save_string@plt>
  mov    %r13,%rdi
  call   <lr_eval_string@plt>
  mov    %r12,%rsi
  mov    %eax,%edi
  call   <Reverse@plt>
  mov    %rbp,%rdi
  call   <lr_eval_string@plt>
  mov    %eax,%edi
  call   <lr_output_message@plt>
  mov    %r14,%rsi
  lea    D35(%rip),%rdi
  call   <lr_save_string@plt>
  mov    %r13,%rdi
  call   <lr_eval_string@plt>
  mov    %r12,%rsi
  mov    %eax,%edi
  call   <Reverse@plt>
  mov    %rbp,%rdi
  call   <lr_eval_string@plt>
  mov    %eax,%edi
  call   <lr_output_message@plt>
  mov    %r14,%rsi
  lea    D9(%rip),%rdi
  call   <lr_save_string@plt>
  mov    %r13,%rdi
  call   <lr_eval_string@plt>
  mov    %r12,%rsi
  mov    %eax,%edi
  call   <Reverse@plt>
  mov    %rbp,%rdi
  call   <lr_eval_string@plt>
  mov    %eax,%edi
  call   <lr_output_message@plt>
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

tool_calls: name: read_data
arguments: data_tag: D60
data_type: string
name: read_data
arguments: data_tag: D24
data_type: string
name: read_data
arguments: data_tag: D52
data_type: string
name: read_data
arguments: data_tag: D26
data_type: string
name: read_data
arguments: data_tag: D64
data_type: string
name: read_data
arguments: data_tag: D35
data_type: string
name: read_data
arguments: data_tag: D9
data_type: string

tool: D60: Param

tool: D24: ABC123456

tool: D52: {Param}

tool: D26: NewParam

tool: D64: Changed [{Param}] to [{NewParam}]

tool: D35: Peter Piper

tool: D9: Fiddlesticks

assistant: ```c
Action() {
  lr_save_string("ABC123456", "Param");
  Reverse(lr_eval_string("{Param}"), "NewParam");
  lr_output_message(lr_eval_string("Changed [{Param}] to [{NewParam}]"));
  lr_save_string("Peter Piper", "Param");
  Reverse(lr_eval_string("{Param}"), "NewParam");
  lr_output_message(lr_eval_string("Changed [{Param}] to [{NewParam}]"));
  lr_save_string("Fiddlesticks", "Param");
  Reverse(lr_eval_string("{Param}"), "NewParam");
  lr_output_message(lr_eval_string("Changed [{Param}] to [{NewParam}]"));
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<_citrus_memory_stream_skip_ws>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  jmp    L13
L1:
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <_citrus_bcs_isspace@plt>
  test   %eax,%eax
  je     L29
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <_citrus_memory_stream_getc@plt>
L13:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <_citrus_memory_stream_peek@plt>
  mov    %eax,-0x4(%rbp)
  mov    D6(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4(%rbp)
  jne    L1
  jmp    L14
L29:
  nop
L14:
  nop
  leave
  ret
```

assistant: ```c
void _citrus_memory_stream_skip_ws(struct _citrus_memory_stream *ms) {
  int ch;
  while ((ch = _citrus_memory_stream_peek(ms)) != EOF) {
    if (!_citrus_bcs_isspace(ch))
      break;
    _citrus_memory_stream_getc(ms);
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<_citrus_memory_stream_skip_ws>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  jmp    L28
L9:
  mov    %rbx,%rdi
  call   <_citrus_memory_stream_getc@plt>
L28:
  mov    %rbx,%rdi
  call   <_citrus_memory_stream_peek@plt>
  mov    %eax,%edi
  mov    D2(%rip),%rax
  cmp    %edi,(%rax)
  je     L0
  call   <_citrus_bcs_isspace@plt>
  test   %eax,%eax
  jne    L9
L0:
  pop    %rbx
  ret
```

assistant: ```c
void _citrus_memory_stream_skip_ws(struct _citrus_memory_stream *ms) {
  int ch;
  while ((ch = _citrus_memory_stream_peek(ms)) != EOF) {
    if (!_citrus_bcs_isspace(ch))
      break;
    _citrus_memory_stream_getc(ms);
  }
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<_citrus_memory_stream_skip_ws>:
  endbr64
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  mov    D8(%rip),%rbp
  jmp    L13
  cs nopw 0x0(%rax,%rax,1)
L17:
  call   <_citrus_bcs_isspace@plt>
  test   %eax,%eax
  je     L27
  mov    %rbx,%rdi
  call   <_citrus_memory_stream_getc@plt>
L13:
  mov    %rbx,%rdi
  call   <_citrus_memory_stream_peek@plt>
  mov    %eax,%edi
  cmp    %eax,0x0(%rbp)
  jne    L17
L27:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void _citrus_memory_stream_skip_ws(struct _citrus_memory_stream *ms) {
  int ch;
  while ((ch = _citrus_memory_stream_peek(ms)) != EOF) {
    if (!_citrus_bcs_isspace(ch))
      break;
    _citrus_memory_stream_getc(ms);
  }
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<_citrus_memory_stream_skip_ws>:
  endbr64
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  mov    D0(%rip),%rbp
  jmp    L2
  cs nopw 0x0(%rax,%rax,1)
L24:
  call   <_citrus_bcs_isspace@plt>
  test   %eax,%eax
  je     L28
  mov    %rbx,%rdi
  call   <_citrus_memory_stream_getc@plt>
L2:
  mov    %rbx,%rdi
  call   <_citrus_memory_stream_peek@plt>
  mov    %eax,%edi
  cmp    %eax,0x0(%rbp)
  jne    L24
L28:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void _citrus_memory_stream_skip_ws(struct _citrus_memory_stream *ms) {
  int ch;
  while ((ch = _citrus_memory_stream_peek(ms)) != EOF) {
    if (!_citrus_bcs_isspace(ch))
      break;
    _citrus_memory_stream_getc(ms);
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<xfree>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L5
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L5:
  nop
  leave
  ret
```

assistant: ```c
void xfree(void *ptr) {
  if (ptr)
    free(ptr);
  ;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<xfree>:
  endbr64
  test   %rdi,%rdi
  je     L5
  sub    $0x8,%rsp
  call   <free@plt>
  add    $0x8,%rsp
  ret
L5:
  ret
```

assistant: ```c
void xfree(void *ptr) {
  if (ptr)
    free(ptr);
  ;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<xfree>:
  endbr64
  test   %rdi,%rdi
  je     L9
  jmp    1050 <free@plt>
  xchg   %ax,%ax
L9:
  ret
```

assistant: ```c
void xfree(void *ptr) {
  if (ptr)
    free(ptr);
  ;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<xfree>:
  endbr64
  test   %rdi,%rdi
  je     L9
  jmp    1050 <free@plt>
  xchg   %ax,%ax
L9:
  ret
```

assistant: ```c
void xfree(void *ptr) {
  if (ptr)
    free(ptr);
  ;
}
```
user: What is the c source code of the assembly code below:

```asm
<pow2_near>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <is_pow2@plt>
  test   %rax,%rax
  je     L5
  mov    -0x14(%rbp),%eax
  jmp    L22
L5:
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <pow2_next@plt>
  mov    %eax,-0x8(%rbp)
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <pow2_prev@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  sub    -0x14(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  sub    -0x4(%rbp),%eax
  mov    %eax,%ecx
  neg    %ecx
  cmovns %ecx,%eax
  cmp    %eax,%edx
  jle    L6
  mov    -0x4(%rbp),%eax
  jmp    L22
L6:
  mov    -0x8(%rbp),%eax
L22:
  leave
  ret
```

assistant: ```c
int pow2_near(int n) {
  if (is_pow2(n)) {
    return n;
  }
  int nNext = pow2_next(n);
  int nPrev = pow2_prev(n);
  if (nNext - n > abs(n - nPrev)) {
    return nPrev;
  } else {
    return nNext;
  }
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<pow2_near>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebx
  call   <is_pow2@plt>
  test   %rax,%rax
  je     L16
L4:
  mov    %ebx,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L16:
  mov    %ebx,%edi
  call   <pow2_next@plt>
  mov    %eax,%ebp
  mov    %ebx,%edi
  call   <pow2_prev@plt>
  mov    %ebp,%ecx
  sub    %ebx,%ecx
  sub    %eax,%ebx
  mov    %ebx,%edx
  neg    %edx
  cmovns %edx,%ebx
  cmp    %ebx,%ecx
  mov    %ebp,%ebx
  cmovg  %eax,%ebx
  jmp    L4
```

assistant: ```c
int pow2_near(int n) {
  if (is_pow2(n)) {
    return n;
  }
  int nNext = pow2_next(n);
  int nPrev = pow2_prev(n);
  if (nNext - n > abs(n - nPrev)) {
    return nPrev;
  } else {
    return nNext;
  }
}
```
user: What is the c source code of the assembly code below:

```asm
<pow2_near>:
  endbr64
  push   %r12
  mov    %edi,%r12d
  push   %rbx
  sub    $0x8,%rsp
  call   <is_pow2@plt>
  test   %rax,%rax
  jne    L9
  mov    %r12d,%edi
  call   <pow2_next@plt>
  mov    %r12d,%edi
  mov    %eax,%ebx
  call   <pow2_prev@plt>
  mov    %ebx,%ecx
  sub    %r12d,%ecx
  sub    %eax,%r12d
  mov    %r12d,%edx
  neg    %edx
  cmovs  %r12d,%edx
  cmp    %edx,%ecx
  cmovg  %eax,%ebx
  mov    %ebx,%r12d
L9:
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %r12
  ret
```

assistant: ```c
int pow2_near(int n) {
  if (is_pow2(n)) {
    return n;
  }
  int nNext = pow2_next(n);
  int nPrev = pow2_prev(n);
  if (nNext - n > abs(n - nPrev)) {
    return nPrev;
  } else {
    return nNext;
  }
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<pow2_near>:
  endbr64
  push   %r12
  mov    %edi,%r12d
  push   %rbx
  sub    $0x8,%rsp
  call   <is_pow2@plt>
  test   %rax,%rax
  jne    L5
  mov    %r12d,%edi
  call   <pow2_next@plt>
  mov    %r12d,%edi
  mov    %eax,%ebx
  call   <pow2_prev@plt>
  mov    %ebx,%ecx
  sub    %r12d,%ecx
  sub    %eax,%r12d
  mov    %r12d,%edx
  neg    %edx
  cmovs  %r12d,%edx
  cmp    %edx,%ecx
  cmovg  %eax,%ebx
  mov    %ebx,%r12d
L5:
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %r12
  ret
```

assistant: ```c
int pow2_near(int n) {
  if (is_pow2(n)) {
    return n;
  }
  int nNext = pow2_next(n);
  int nPrev = pow2_prev(n);
  if (nNext - n > abs(n - nPrev)) {
    return nPrev;
  } else {
    return nNext;
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<Mask_mask1>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  movl   $0x0,-0x4(%rbp)
  movl   $0x0,-0x8(%rbp)
  jmp    L9
L37:
  movl   $0x0,-0xc(%rbp)
  jmp    L31
L8:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jns    L49
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%edx
  mov    -0x28(%rbp),%rax
  mov    %dl,(%rax)
  jmp    L35
L49:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  sete   %al
  xor    %edx,%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  mov    %dl,(%rax)
L35:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0x1,%eax
  add    %eax,-0x4(%rbp)
  addq   $0x1,-0x20(%rbp)
  addq   $0x1,-0x28(%rbp)
  addl   $0x1,-0xc(%rbp)
L31:
  mov    -0xc(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jb     L8
  addl   $0x1,-0x8(%rbp)
L9:
  mov    -0x8(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jb     L37
  mov    -0x4(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
unsigned int Mask_mask1(unsigned int width, const unsigned char *s, unsigned char *d) {
  unsigned int x, y;
  unsigned int b = 0;
  for (y = 0; y < width; y++) {
    for (x = 0; x < width; x++) {
      if (*s & 0x80) {
        *d = *s;
      } else {
        *d = *s ^ ((y & 1) == 0);
      }
      b += (unsigned int)(*d & 1);
      s++;
      d++;
    }
  }
  return b;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<Mask_mask1>:
  endbr64
  push   %rbp
  push   %rbx
  mov    %edi,%r11d
  mov    $0x0,%edi
  mov    $0x0,%ebp
  mov    %r11d,%ebx
  test   %r11d,%r11d
  je     L14
L23:
  mov    $0x0,%ecx
  mov    %ebp,%r10d
  xor    $0x1,%r10d
  and    $0x1,%r10d
L38:
  movzbl (%rsi,%rcx,1),%eax
  mov    %eax,%r9d
  xor    %r10d,%r9d
  test   %al,%al
  cmovns %r9d,%eax
  mov    %al,(%rdx,%rcx,1)
  and    $0x1,%eax
  add    %eax,%edi
  add    $0x1,%rcx
  cmp    %rcx,%rbx
  jne    L38
  add    %rbx,%rsi
  add    %rbx,%rdx
  add    $0x1,%ebp
  cmp    %ebp,%r11d
  jne    L23
L6:
  mov    %edi,%eax
  pop    %rbx
  pop    %rbp
  ret
L14:
  mov    %r11d,%edi
  jmp    L6
```

assistant: ```c
unsigned int Mask_mask1(unsigned int width, const unsigned char *s, unsigned char *d) {
  unsigned int x, y;
  unsigned int b = 0;
  for (y = 0; y < width; y++) {
    for (x = 0; x < width; x++) {
      if (*s & 0x80) {
        *d = *s;
      } else {
        *d = *s ^ ((y & 1) == 0);
      }
      b += (unsigned int)(*d & 1);
      s++;
      d++;
    }
  }
  return b;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<Mask_mask1>:
  endbr64
  test   %edi,%edi
  je     L0
  push   %rbx
  mov    %edi,%ebx
  mov    $0xffffffff,%r11d
  xor    %r8d,%r8d
  not    %ebx
  mov    %edi,%r9d
  nopl   0x0(%rax)
L17:
  mov    %r11d,%r10d
  xor    %ecx,%ecx
  and    $0x1,%r10d
  nopl   0x0(%rax)
L13:
  movzbl (%rsi,%rcx,1),%eax
  mov    %eax,%edi
  xor    %r10d,%edi
  test   %al,%al
  cmovns %edi,%eax
  mov    %al,(%rdx,%rcx,1)
  and    $0x1,%eax
  add    $0x1,%rcx
  add    %eax,%r8d
  cmp    %rcx,%r9
  jne    L13
  sub    $0x1,%r11d
  add    %r9,%rsi
  add    %r9,%rdx
  cmp    %r11d,%ebx
  jne    L17
  mov    %r8d,%eax
  pop    %rbx
  ret
L0:
  xor    %eax,%eax
  ret
```

assistant: ```c
unsigned int Mask_mask1(unsigned int width, const unsigned char *s, unsigned char *d) {
  unsigned int x, y;
  unsigned int b = 0;
  for (y = 0; y < width; y++) {
    for (x = 0; x < width; x++) {
      if (*s & 0x80) {
        *d = *s;
      } else {
        *d = *s ^ ((y & 1) == 0);
      }
      b += (unsigned int)(*d & 1);
      s++;
      d++;
    }
  }
  return b;
}
```
user: What is the c source code of the assembly code below?

```asm
<expint>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %edi,%r9d
  mov    %rsi,0x8(%rsp)
  lea    -0x1(%rdi),%r15d
  cmp    $0x1,%rsi
  jle    L70
  mov    %rsi,%rdi
  movslq %r9d,%rax
  mov    %r9d,%esi
  neg    %esi
  movslq %esi,%rsi
  lea    0x2(%rdi,%rax,1),%rdi
  imul   $0x1c9c380,%rsi,%rax
  add    %rdi,%rax
  lea    (%rax,%rax,4),%rcx
  add    %rcx,%rcx
  mov    %rcx,%r10
  movabs $0x431bde82d7b634db,%rdx
  mov    %rsi,%rax
  imul   %rdx
  sar    $0x13,%rdx
  sar    $0x3f,%rsi
  sub    %rsi,%rdx
  lea    (%rdx,%rdi,1),%r11
  imul   %r11,%rcx
  imul   $0x1c9c380,%rcx,%r8
  cmp    $0x270f,%rcx
  jle    L6
  mov    $0xfffffffe,%esi
  mov    %r15d,%r9d
L89:
  mov    %r9d,%eax
  sub    %esi,%eax
  imul   %esi,%eax
  cltq
  add    $0x2,%rdi
  imul   %rax,%r10
  add    %rdi,%r10
  lea    (%r10,%r10,4),%rcx
  add    %rcx,%rcx
  mov    %rcx,%r10
  cqto
  idiv   %r11
  lea    (%rax,%rdi,1),%r11
  imul   %r11,%rcx
  imul   %rcx,%r8
  cmp    $0x270f,%rcx
  jle    L6
  sub    $0x1,%esi
  cmp    $0xffffff9b,%esi
  jne    L89
  jmp    L27
L6:
  mov    0x8(%rsp),%r12
  neg    %r12
  imul   %r8,%r12
L27:
  mov    %r12,%rax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L70:
  cmp    $0x1,%r15d
  sbb    %r12,%r12
  and    $0x3e6,%r12d
  add    $0x2,%r12
  mov    $0x1,%ebx
  mov    $0x1,%ebp
  mov    0x8(%rsp),%r13
  neg    %r13
  mov    $0x1,%eax
  sub    %edi,%eax
  mov    %eax,0x4(%rsp)
  jmp    L47
L107:
  lea    0x1(%rbx),%rax
  lea    (%rbx,%rbx,1),%rcx
  mov    $0xff,%r14d
  test   %r15d,%r15d
  jle    L73
L80:
  add    %rax,%r14
  mov    %rax,%rdx
  add    $0x1,%rax
  cmp    %rcx,%rdx
  jne    L80
L73:
  mov    0x8(%rsp),%rdi
  call   <foo@plt>
  imul   %rbp,%rax
  add    %r14,%rax
L72:
  add    %rax,%r12
  add    $0x1,%rbx
  cmp    $0x65,%rbx
  je     L27
L47:
  mov    %r13,%rax
  cqto
  idiv   %rbx
  imul   %rax,%rbp
  cmp    %ebx,%r15d
  je     L107
  mov    %rbp,%rax
  neg    %rax
  mov    0x4(%rsp),%edi
  lea    (%rdi,%rbx,1),%ecx
  movslq %ecx,%rcx
  cqto
  idiv   %rcx
  jmp    L72
```

assistant: ```c
long int expint(int n, long int x) {
  int i, ii, nm1;
  long int a, b, c, d, del, fact, h, psi, ans;
  nm1 = n - 1;
  if (x > 1) {
    b = x + n;
    c = 2e6;
    d = 3e7;
    h = d;
    for (i = 1; i <= 100; i++) {
      a = -i * (nm1 + i);
      b += 2;
      d = 10 * (a * d + b);
      c = b + a / c;
      del = c * d;
      h *= del;
      if (del < 10000) {
        ans = h * -x;
        return ans;
      }
    }
  } else {
    ans = nm1 != 0 ? 2 : 1000;
    fact = 1;
    for (i = 1; i <= 100; i++) {
      fact *= -x / i;
      if (i != nm1)
        del = -fact / (i - nm1);
      else {
        psi = 0x00FF;
        for (ii = 1; ii <= nm1; ii++)
          psi += ii + nm1;
        del = psi + fact * foo(x);
      }
      ans += del;
    }
  }
  return ans;
}
```
user: What is the c source code of the assembly code below:

```asm
<expint>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %edi,%r13d
  mov    %rsi,%rdi
  push   %r12
  lea    -0x1(%r13),%r14d
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  cmp    $0x1,%rsi
  jle    L84
  movslq %r13d,%r8
  mov    $0x1c9c380,%r9d
  mov    $0x1c9c380,%ecx
  mov    $0x1e8480,%r10d
  add    %rsi,%r8
  mov    $0xffffffff,%esi
  jmp    L71
L40:
  sub    $0x1,%esi
  cmp    $0xffffff9b,%esi
  je     L58
L71:
  mov    %r14d,%eax
  add    $0x2,%r8
  sub    %esi,%eax
  imul   %esi,%eax
  cltq
  cqto
  imul   %rax,%rcx
  idiv   %r10
  add    %r8,%rcx
  lea    (%rcx,%rcx,4),%rcx
  add    %rcx,%rcx
  lea    (%rax,%r8,1),%r10
  mov    %rcx,%rax
  imul   %r10,%rax
  imul   %rax,%r9
  cmp    $0x270f,%rax
  jg     L40
  neg    %rdi
  imul   %r9,%rdi
  mov    %rdi,%r12
L58:
  add    $0x28,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L84:
  cmp    $0x1,%r14d
  mov    %rsi,%rbp
  mov    $0x1,%ecx
  mov    $0x1,%ebx
  sbb    %r12,%r12
  mov    $0x1,%r15d
  neg    %rbp
  and    $0x3e6,%r12d
  add    $0x2,%r12
  jmp    L5
  cs nopw 0x0(%rax,%rax,1)
L45:
  mov    %r15d,%esi
  mov    %rbx,%rax
  sub    %r13d,%esi
  neg    %rax
  add    %ecx,%esi
  cqto
  movslq %esi,%rsi
  idiv   %rsi
  lea    0x1(%rcx),%rdx
L37:
  add    %rax,%r12
  mov    %rdx,%rcx
  cmp    $0x65,%rdx
  je     L58
L5:
  mov    %rbp,%rax
  cqto
  idiv   %rcx
  imul   %rax,%rbx
  cmp    %ecx,%r14d
  jne    L45
  lea    0x1(%rcx),%rdx
  mov    $0xff,%r8d
  add    %rcx,%rcx
  mov    %rdx,%rax
  nopw   0x0(%rax,%rax,1)
L63:
  mov    %rax,%rsi
  add    %rax,%r8
  add    $0x1,%rax
  cmp    %rcx,%rsi
  jne    L63
  mov    %rdx,0x18(%rsp)
  mov    %r8,0x10(%rsp)
  mov    %rdi,0x8(%rsp)
  call   <foo@plt>
  mov    0x10(%rsp),%r8
  mov    0x18(%rsp),%rdx
  imul   %rbx,%rax
  mov    0x8(%rsp),%rdi
  add    %r8,%rax
  jmp    L37
```

assistant: ```c
long int expint(int n, long int x) {
  int i, ii, nm1;
  long int a, b, c, d, del, fact, h, psi, ans;
  nm1 = n - 1;
  if (x > 1) {
    b = x + n;
    c = 2e6;
    d = 3e7;
    h = d;
    for (i = 1; i <= 100; i++) {
      a = -i * (nm1 + i);
      b += 2;
      d = 10 * (a * d + b);
      c = b + a / c;
      del = c * d;
      h *= del;
      if (del < 10000) {
        ans = h * -x;
        return ans;
      }
    }
  } else {
    ans = nm1 != 0 ? 2 : 1000;
    fact = 1;
    for (i = 1; i <= 100; i++) {
      fact *= -x / i;
      if (i != nm1)
        del = -fact / (i - nm1);
      else {
        psi = 0x00FF;
        for (ii = 1; ii <= nm1; ii++)
          psi += ii + nm1;
        del = psi + fact * foo(x);
      }
      ans += del;
    }
  }
  return ans;
}
```