ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请从给定的汇编指令推导出C源代码：

```asm
<cgen_print>:
  endbr64
  push   %rbp
  lea    D13(%rip),%rdi
  lea    D1(%rip),%rbp
  call   <print_instr@plt>
  mov    %rbp,%rdi
  call   <print_instr@plt>
  lea    D26(%rip),%rdi
  call   <print_instr@plt>
  lea    D19(%rip),%rdi
  call   <print_instr@plt>
  lea    D45(%rip),%rdi
  call   <print_instr@plt>
  mov    %rbp,%rdi
  call   <print_instr@plt>
  lea    D28(%rip),%rdi
  pop    %rbp
  jmp    1050 <print_instr@plt>
```

tool_calls: name: disassemble_data
arguments: label: D13
type: string
name: disassemble_data
arguments: label: D1
type: string
name: disassemble_data
arguments: label: D26
type: string
name: disassemble_data
arguments: label: D19
type: string
name: disassemble_data
arguments: label: D45
type: string
name: disassemble_data
arguments: label: D28
type: string

tool: D13: li $v0 1

tool: D1: syscall

tool: D26: move $t0 $a0

tool: D19: li $v0 11

tool: D45: li $a0 10

tool: D28: move $a0 $t0

assistant: ```c
void cgen_print() {
  print_instr("li $v0 1");
  print_instr("syscall");
  print_instr("move $t0 $a0");
  print_instr("li $v0 11");
  print_instr("li $a0 10");
  print_instr("syscall");
  print_instr("move $a0 $t0");
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<cgen_print>:
  endbr64
  push   %rbp
  lea    D49(%rip),%rdi
  lea    D34(%rip),%rbp
  call   <print_instr@plt>
  mov    %rbp,%rdi
  call   <print_instr@plt>
  lea    D12(%rip),%rdi
  call   <print_instr@plt>
  lea    D48(%rip),%rdi
  call   <print_instr@plt>
  lea    D42(%rip),%rdi
  call   <print_instr@plt>
  mov    %rbp,%rdi
  call   <print_instr@plt>
  lea    D21(%rip),%rdi
  pop    %rbp
  jmp    1050 <print_instr@plt>
```

tool_calls: name: read_data
arguments: data_tag: D49
type: string
name: read_data
arguments: data_tag: D34
type: string
name: read_data
arguments: data_tag: D12
type: string
name: read_data
arguments: data_tag: D48
type: string
name: read_data
arguments: data_tag: D42
type: string
name: read_data
arguments: data_tag: D21
type: string

tool: D49: li $v0 1

tool: D34: syscall

tool: D12: move $t0 $a0

tool: D48: li $v0 11

tool: D42: li $a0 10

tool: D21: move $a0 $t0

assistant: ```c
void cgen_print() {
  print_instr("li $v0 1");
  print_instr("syscall");
  print_instr("move $t0 $a0");
  print_instr("li $v0 11");
  print_instr("li $a0 10");
  print_instr("syscall");
  print_instr("move $a0 $t0");
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0xc(%rbp)
  lea    -0x1c(%rbp),%rax
  mov    %rax,%rsi
  lea    D18(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  movl   $0x1,-0x18(%rbp)
  jmp    L60
L15:
  movl   $0x1,-0x14(%rbp)
  jmp    L17
L41:
  movl   $0x1,-0x10(%rbp)
  jmp    L25
L24:
  mov    -0x18(%rbp),%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cmp    %eax,-0x10(%rbp)
  jge    L70
  mov    -0x14(%rbp),%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  cmp    %eax,-0x18(%rbp)
  jge    L70
  mov    -0x10(%rbp),%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  cmp    %eax,-0x14(%rbp)
  jge    L70
  addl   $0x1,-0xc(%rbp)
L70:
  addl   $0x1,-0x10(%rbp)
L25:
  mov    -0x1c(%rbp),%eax
  cmp    %eax,-0x10(%rbp)
  jle    L24
  addl   $0x1,-0x14(%rbp)
L17:
  mov    -0x1c(%rbp),%eax
  cmp    %eax,-0x14(%rbp)
  jle    L41
  addl   $0x1,-0x18(%rbp)
L60:
  mov    -0x1c(%rbp),%eax
  cmp    %eax,-0x18(%rbp)
  jle    L15
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L22
  call   <__stack_chk_fail@plt>
L22:
  leave
  ret
```

tool_calls: name: parse_data
arguments: tag: D18
type: string
name: parse_data
arguments: tag: D2
type: string

tool: D18: %d

tool: D2: Number of possible triangles is %d

assistant: ```c
int main() {
  int N, a, b, c, count;
  count = 0;
  scanf("%d", &N);
  for (a = 1; a <= N; a = a + 1) {
    for (b = 1; b <= N; b = b + 1) {
      for (c = 1; c <= N; c = c + 1) {
        if ((a + b > c) && (b + c > a) && (c + a > b)) {
          count = count + 1;
        }
      }
    }
  }
  printf("Number of possible triangles is %d", count);
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rsi
  lea    D10(%rip),%rdi
  call   <scanf@plt>
  mov    0x4(%rsp),%ecx
  test   %ecx,%ecx
  jle    L81
  add    $0x1,%ecx
  mov    $0x0,%r9d
  mov    $0x1,%r8d
  jmp    L77
L91:
  add    $0x1,%eax
  cmp    %ecx,%eax
  je     L11
L89:
  cmp    %edx,%eax
  jge    L91
  lea    (%rsi,%rax,1),%edi
  cmp    %r8d,%edi
  jle    L91
  lea    (%rax,%r10,1),%edi
  cmp    %esi,%edi
  setg   %dil
  movzbl %dil,%edi
  add    %edi,%r9d
  jmp    L91
L11:
  add    $0x1,%esi
  add    $0x1,%edx
  cmp    %ecx,%esi
  je     L102
L52:
  mov    $0x1,%eax
  jmp    L89
L102:
  add    $0x1,%r8d
  cmp    %ecx,%r8d
  je     L21
L77:
  mov    %r8d,%r10d
  lea    0x1(%r8),%edx
  mov    $0x1,%esi
  jmp    L52
L81:
  mov    $0x0,%r9d
L21:
  mov    %r9d,%esi
  lea    D5(%rip),%rdi
  call   <printf@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L94
  mov    $0x0,%eax
  add    $0x18,%rsp
  ret
L94:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D10
datatype: string
name: parse_data
arguments: label: D5
datatype: string

tool: D10: %d

tool: D5: Number of possible triangles is %d

assistant: ```c
int main() {
  int N, a, b, c, count;
  count = 0;
  scanf("%d", &N);
  for (a = 1; a <= N; a = a + 1) {
    for (b = 1; b <= N; b = b + 1) {
      for (c = 1; c <= N; c = c + 1) {
        if ((a + b > c) && (b + c > a) && (c + a > b)) {
          count = count + 1;
        }
      }
    }
  }
  printf("Number of possible triangles is %d", count);
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<main>:
  endbr64
  sub    $0x18,%rsp
  lea    D15(%rip),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rsi
  call   <scanf@plt>
  mov    0x4(%rsp),%ecx
  test   %ecx,%ecx
  jle    L38
  add    $0x1,%ecx
  xor    %r9d,%r9d
  mov    $0x1,%r8d
  nopl   0x0(%rax)
L40:
  lea    0x1(%r8),%r10d
  mov    $0x1,%esi
  mov    %r10d,%edx
  nopl   0x0(%rax)
L22:
  mov    $0x1,%eax
  nopl   (%rax)
L73:
  cmp    %edx,%eax
  jge    L17
  lea    (%rsi,%rax,1),%edi
  cmp    %edi,%r8d
  jge    L17
  lea    (%rax,%r8,1),%edi
  cmp    %esi,%edi
  setg   %dil
  movzbl %dil,%edi
  add    %edi,%r9d
L17:
  add    $0x1,%eax
  cmp    %ecx,%eax
  jne    L73
  add    $0x1,%esi
  add    $0x1,%edx
  cmp    %ecx,%esi
  jne    L22
  mov    %r10d,%r8d
  cmp    %ecx,%r10d
  jne    L40
L26:
  mov    %r9d,%esi
  lea    D12(%rip),%rdi
  call   <printf@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L52
  xor    %eax,%eax
  add    $0x18,%rsp
  ret
L38:
  xor    %r9d,%r9d
  jmp    L26
L52:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D15
datatype: string
name: parse_data
arguments: data_label: D12
datatype: string

tool: D15: %d

tool: D12: Number of possible triangles is %d

assistant: ```c
int main() {
  int N, a, b, c, count;
  count = 0;
  scanf("%d", &N);
  for (a = 1; a <= N; a = a + 1) {
    for (b = 1; b <= N; b = b + 1) {
      for (c = 1; c <= N; c = c + 1) {
        if ((a + b > c) && (b + c > a) && (c + a > b)) {
          count = count + 1;
        }
      }
    }
  }
  printf("Number of possible triangles is %d", count);
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<m_name>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r12
  push   %rbx
  mov    %edi,-0x14(%rbp)
  movb   $0x0,D44(%rip)
  movb   $0x0,D32(%rip)
  movb   $0x0,D10(%rip)
  movb   $0x0,D20(%rip)
  mov    -0x14(%rbp),%ebx
  lea    D20(%rip),%r12
  test   %ebx,%ebx
  jle    L35
  cmp    $0x3e7,%ebx
  jg     L35
L31:
  movslq %ebx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %ebx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %ebx,%edx
  sub    %eax,%edx
  mov    %edx,%eax
  add    $0x30,%eax
  sub    $0x1,%r12
  mov    %al,(%r12)
  movslq %ebx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %ebx,%edx
  sar    $0x1f,%edx
  sub    %edx,%eax
  mov    %eax,%ebx
  test   %ebx,%ebx
  jne    L31
  jmp    L20
L35:
  sub    $0x1,%r12
  movb   $0x3f,(%r12)
L20:
  mov    %r12,%rax
  pop    %rbx
  pop    %r12
  pop    %rbp
  ret
```

assistant: ```c
char *m_name(num) {
  static char name[4];
  register char *cp;
  register int i;
  name[0] = 0;
  name[1] = 0;
  name[2] = 0;
  name[3] = 0;
  i = num;
  cp = &name[3];
  if (i > 0 && i <= 999)
    do {
      *--cp = (i % 10) + '0';
      i /= 10;
    } while (i);
  else
    *--cp = '?';
  return (cp);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<m_name>:
  endbr64
  movb   $0x0,D50(%rip)
  movb   $0x0,D45(%rip)
  movb   $0x0,D30(%rip)
  movb   $0x0,D55(%rip)
  lea    -0x1(%rdi),%eax
  cmp    $0x3e6,%eax
  ja     L10
  lea    D55(%rip),%rcx
L3:
  sub    $0x1,%rcx
  movslq %edi,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x22,%rax
  mov    %edi,%edx
  sar    $0x1f,%edx
  sub    %edx,%eax
  lea    (%rax,%rax,4),%edx
  add    %edx,%edx
  sub    %edx,%edi
  add    $0x30,%edi
  mov    %dil,(%rcx)
  mov    %eax,%edi
  test   %eax,%eax
  jne    L3
L24:
  mov    %rcx,%rax
  ret
L10:
  movb   $0x3f,D30(%rip)
  lea    D30(%rip),%rcx
  jmp    L24
```

assistant: ```c
char *m_name(num) {
  static char name[4];
  register char *cp;
  register int i;
  name[0] = 0;
  name[1] = 0;
  name[2] = 0;
  name[3] = 0;
  i = num;
  cp = &name[3];
  if (i > 0 && i <= 999)
    do {
      *--cp = (i % 10) + '0';
      i /= 10;
    } while (i);
  else
    *--cp = '?';
  return (cp);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<m_name>:
  endbr64
  movl   $0x0,D8(%rip)
  lea    -0x1(%rdi),%eax
  cmp    $0x3e6,%eax
  ja     L10
  lea    D16(%rip),%r8
  mov    $0xcccccccd,%ecx
  nopl   0x0(%rax)
L15:
  mov    %edi,%eax
  sub    $0x1,%r8
  imul   %rcx,%rax
  shr    $0x23,%rax
  lea    (%rax,%rax,4),%edx
  add    %edx,%edx
  sub    %edx,%edi
  add    $0x30,%edi
  mov    %dil,(%r8)
  mov    %eax,%edi
  test   %eax,%eax
  jne    L15
  mov    %r8,%rax
  ret
  nopl   (%rax)
L10:
  lea    D39(%rip),%r8
  movb   $0x3f,D39(%rip)
  mov    %r8,%rax
  ret
```

assistant: ```c
char *m_name(num) {
  static char name[4];
  register char *cp;
  register int i;
  name[0] = 0;
  name[1] = 0;
  name[2] = 0;
  name[3] = 0;
  i = num;
  cp = &name[3];
  if (i > 0 && i <= 999)
    do {
      *--cp = (i % 10) + '0';
      i /= 10;
    } while (i);
  else
    *--cp = '?';
  return (cp);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<m_name>:
  endbr64
  movl   $0x0,D4(%rip)
  lea    -0x1(%rdi),%eax
  cmp    $0x3e6,%eax
  ja     L17
  lea    D26(%rip),%r8
  mov    $0xcccccccd,%ecx
  nopl   0x0(%rax)
L14:
  mov    %edi,%eax
  sub    $0x1,%r8
  imul   %rcx,%rax
  shr    $0x23,%rax
  lea    (%rax,%rax,4),%edx
  add    %edx,%edx
  sub    %edx,%edi
  add    $0x30,%edi
  mov    %dil,(%r8)
  mov    %eax,%edi
  test   %eax,%eax
  jne    L14
  mov    %r8,%rax
  ret
  nopl   (%rax)
L17:
  lea    D37(%rip),%r8
  movb   $0x3f,D37(%rip)
  mov    %r8,%rax
  ret
```

assistant: ```c
char *m_name(num) {
  static char name[4];
  register char *cp;
  register int i;
  name[0] = 0;
  name[1] = 0;
  name[2] = 0;
  name[3] = 0;
  i = num;
  cp = &name[3];
  if (i > 0 && i <= 999)
    do {
      *--cp = (i % 10) + '0';
      i /= 10;
    } while (i);
  else
    *--cp = '?';
  return (cp);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<BUF_MEM_create_init>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <BUF_MEM_create@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L0
  mov    $0x0,%eax
  jmp    L13
L0:
  mov    -0x8(%rbp),%rax
  mov    (%rax),%eax
  mov    -0x20(%rbp),%rdx
  mov    -0x18(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <memcpy@plt>
  mov    -0x8(%rbp),%rax
L13:
  leave
  ret
```

assistant: ```c
BUF_MEM *BUF_MEM_create_init(const void *buf, size_t len) {
  BUF_MEM *out;
  out = BUF_MEM_create(len);
  if (!out)
    return NULL;
  memcpy(out->data, buf, len);
  return out;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<BUF_MEM_create_init>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r12
  mov    %rsi,%rbp
  mov    %rsi,%rdi
  call   <BUF_MEM_create@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L1
  mov    %rbp,%rdx
  mov    %r12,%rsi
  mov    (%rax),%edi
  call   <memcpy@plt>
L1:
  mov    %rbx,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
BUF_MEM *BUF_MEM_create_init(const void *buf, size_t len) {
  BUF_MEM *out;
  out = BUF_MEM_create(len);
  if (!out)
    return NULL;
  memcpy(out->data, buf, len);
  return out;
}
```
user: Translate the below assembly code into C programming language:

```asm
<BUF_MEM_create_init>:
  endbr64
  push   %r13
  mov    %rsi,%r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  mov    %rsi,%rdi
  call   <BUF_MEM_create@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L7
  mov    (%rax),%edi
  mov    %r13,%rdx
  mov    %rbp,%rsi
  call   <memcpy@plt>
L7:
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
BUF_MEM *BUF_MEM_create_init(const void *buf, size_t len) {
  BUF_MEM *out;
  out = BUF_MEM_create(len);
  if (!out)
    return NULL;
  memcpy(out->data, buf, len);
  return out;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<BUF_MEM_create_init>:
  endbr64
  push   %r13
  mov    %rsi,%r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  mov    %rsi,%rdi
  call   <BUF_MEM_create@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L1
  mov    (%rax),%edi
  mov    %r13,%rdx
  mov    %rbp,%rsi
  call   <memcpy@plt>
L1:
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
BUF_MEM *BUF_MEM_create_init(const void *buf, size_t len) {
  BUF_MEM *out;
  out = BUF_MEM_create(len);
  if (!out)
    return NULL;
  memcpy(out->data, buf, len);
  return out;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<sjis_wctomb_zint>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    -0x1c(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <jisx0201_wctomb@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  je     L69
  mov    -0x4(%rbp),%eax
  jmp    L79
L69:
  mov    -0x1c(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <jisx0208_wctomb@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  je     L40
  mov    -0x4(%rbp),%eax
  jmp    L79
L40:
  cmpl   $0xdfff,-0x1c(%rbp)
  jbe    L41
  cmpl   $0xe757,-0x1c(%rbp)
  ja     L41
  mov    -0x1c(%rbp),%eax
  sub    $0xe000,%eax
  mov    %eax,%edx
  mov    $0xae4c415d,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  shr    $0x7,%eax
  mov    %al,-0x6(%rbp)
  mov    -0x1c(%rbp),%eax
  lea    -0xe000(%rax),%edx
  mov    %edx,%ecx
  mov    $0xae4c415d,%eax
  imul   %rcx,%rax
  shr    $0x20,%rax
  shr    $0x7,%eax
  imul   $0xbc,%eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %al,-0x5(%rbp)
  movzbl -0x6(%rbp),%eax
  add    $0xf0,%eax
  shl    $0x8,%eax
  mov    %eax,%edx
  cmpb   $0x3e,-0x5(%rbp)
  ja     L6
  movzbl -0x5(%rbp),%eax
  add    $0x40,%eax
  jmp    L30
L6:
  movzbl -0x5(%rbp),%eax
  add    $0x41,%eax
L30:
  or     %edx,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,(%rax)
  mov    $0x2,%eax
  jmp    L79
L41:
  mov    $0x0,%eax
L79:
  leave
  ret
```

assistant: ```c
__attribute__((visibility("hidden"))) int sjis_wctomb_zint(unsigned int *r, unsigned int wc) {
  int ret;
  ret = jisx0201_wctomb(r, wc);
  if (ret) {
    return ret;
  }
  ret = jisx0208_wctomb(r, wc);
  if (ret) {
    return ret;
  }
  if (wc >= 0xe000 && wc < 0xe758) {
    unsigned char c1, c2;
    c1 = (unsigned int)(wc - 0xe000) / 188;
    c2 = (unsigned int)(wc - 0xe000) % 188;
    *r = ((c1 + 0xf0) << 8) | (c2 < 0x3f ? c2 + 0x40 : c2 + 0x41);
    return 2;
  }
  return 0;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<sjis_wctomb_zint>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  mov    %esi,%ebx
  call   <jisx0201_wctomb@plt>
  test   %eax,%eax
  je     L8
L29:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L8:
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <jisx0208_wctomb@plt>
  test   %eax,%eax
  jne    L29
  sub    $0xe000,%ebx
  cmp    $0x757,%ebx
  ja     L29
  mov    %ebx,%eax
  mov    $0xae4c415d,%edx
  imul   %rdx,%rax
  mov    %rax,%rcx
  shr    $0x27,%rcx
  imul   $0xbc,%ecx,%ecx
  mov    %ebx,%edx
  sub    %ecx,%edx
  shr    $0x27,%rax
  add    $0xf0,%eax
  shl    $0x8,%eax
  cmp    $0x3e,%dl
  seta   %cl
  movzbl %cl,%ecx
  lea    0x40(%rdx,%rcx,1),%ecx
  or     %ecx,%eax
  mov    %eax,0x0(%rbp)
  mov    $0x2,%eax
  jmp    L29
```

assistant: ```c
__attribute__((visibility("hidden"))) int sjis_wctomb_zint(unsigned int *r, unsigned int wc) {
  int ret;
  ret = jisx0201_wctomb(r, wc);
  if (ret) {
    return ret;
  }
  ret = jisx0208_wctomb(r, wc);
  if (ret) {
    return ret;
  }
  if (wc >= 0xe000 && wc < 0xe758) {
    unsigned char c1, c2;
    c1 = (unsigned int)(wc - 0xe000) / 188;
    c2 = (unsigned int)(wc - 0xe000) % 188;
    *r = ((c1 + 0xf0) << 8) | (c2 < 0x3f ? c2 + 0x40 : c2 + 0x41);
    return 2;
  }
  return 0;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<sjis_wctomb_zint>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x8,%rsp
  call   <jisx0201_wctomb@plt>
  test   %eax,%eax
  je     L28
L31:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nop
L28:
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <jisx0208_wctomb@plt>
  test   %eax,%eax
  jne    L31
  sub    $0xe000,%ebx
  cmp    $0x757,%ebx
  ja     L31
  mov    $0xae4c415d,%edx
  mov    %ebx,%eax
  imul   %rdx,%rax
  mov    %ebx,%edx
  mov    %rax,%rcx
  shr    $0x27,%rax
  shr    $0x27,%rcx
  add    $0xf0,%eax
  imul   $0xbc,%ecx,%ecx
  shl    $0x8,%eax
  sub    %ecx,%edx
  xor    %ecx,%ecx
  cmp    $0x3e,%edx
  seta   %cl
  lea    0x40(%rdx,%rcx,1),%ecx
  or     %ecx,%eax
  mov    %eax,0x0(%rbp)
  mov    $0x2,%eax
  jmp    L31
```

assistant: ```c
__attribute__((visibility("hidden"))) int sjis_wctomb_zint(unsigned int *r, unsigned int wc) {
  int ret;
  ret = jisx0201_wctomb(r, wc);
  if (ret) {
    return ret;
  }
  ret = jisx0208_wctomb(r, wc);
  if (ret) {
    return ret;
  }
  if (wc >= 0xe000 && wc < 0xe758) {
    unsigned char c1, c2;
    c1 = (unsigned int)(wc - 0xe000) / 188;
    c2 = (unsigned int)(wc - 0xe000) % 188;
    *r = ((c1 + 0xf0) << 8) | (c2 < 0x3f ? c2 + 0x40 : c2 + 0x41);
    return 2;
  }
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<sjis_wctomb_zint>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x8,%rsp
  call   <jisx0201_wctomb@plt>
  test   %eax,%eax
  je     L35
L37:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nop
L35:
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <jisx0208_wctomb@plt>
  test   %eax,%eax
  jne    L37
  sub    $0xe000,%ebx
  cmp    $0x757,%ebx
  ja     L37
  mov    $0xae4c415d,%edx
  mov    %ebx,%eax
  imul   %rdx,%rax
  mov    %ebx,%edx
  mov    %rax,%rcx
  shr    $0x27,%rax
  shr    $0x27,%rcx
  add    $0xf0,%eax
  imul   $0xbc,%ecx,%ecx
  shl    $0x8,%eax
  sub    %ecx,%edx
  xor    %ecx,%ecx
  cmp    $0x3e,%edx
  seta   %cl
  lea    0x40(%rdx,%rcx,1),%ecx
  or     %ecx,%eax
  mov    %eax,0x0(%rbp)
  mov    $0x2,%eax
  jmp    L37
```

assistant: ```c
__attribute__((visibility("hidden"))) int sjis_wctomb_zint(unsigned int *r, unsigned int wc) {
  int ret;
  ret = jisx0201_wctomb(r, wc);
  if (ret) {
    return ret;
  }
  ret = jisx0208_wctomb(r, wc);
  if (ret) {
    return ret;
  }
  if (wc >= 0xe000 && wc < 0xe758) {
    unsigned char c1, c2;
    c1 = (unsigned int)(wc - 0xe000) / 188;
    c2 = (unsigned int)(wc - 0xe000) % 188;
    *r = ((c1 + 0xf0) << 8) | (c2 < 0x3f ? c2 + 0x40 : c2 + 0x41);
    return 2;
  }
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<print_partition_sizes>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x68(%rbp)
  mov    %esi,-0x6c(%rbp)
  mov    -0x6c(%rbp),%esi
  add    $0x1,%esi
  movslq %esi,%rdi
  sub    $0x1,%rdi
  mov    %rdi,-0x58(%rbp)
  movslq %esi,%rdi
  mov    %rdi,%r12
  mov    $0x0,%r13d
  movslq %esi,%rdi
  lea    0x0(,%rdi,4),%r13
  mov    -0x6c(%rbp),%edi
  add    $0x1,%edi
  movslq %edi,%r12
  sub    $0x1,%r12
  mov    %r12,-0x50(%rbp)
  movslq %esi,%rsi
  mov    %rsi,%r10
  mov    $0x0,%r11d
  movslq %edi,%rsi
  mov    %rsi,%rax
  mov    $0x0,%edx
  mov    %r11,%rdi
  imul   %rax,%rdi
  mov    %rdx,%rsi
  imul   %r10,%rsi
  add    %rdi,%rsi
  mul    %r10
  add    %rdx,%rsi
  mov    %rsi,%rdx
  mov    -0x6c(%rbp),%eax
  add    $0x1,%eax
  mov    -0x6c(%rbp),%edx
  add    $0x1,%edx
  movslq %eax,%rsi
  sub    $0x1,%rsi
  mov    %rsi,-0x48(%rbp)
  movslq %eax,%rsi
  mov    %rsi,%r14
  mov    $0x0,%r15d
  movslq %edx,%rsi
  sub    $0x1,%rsi
  mov    %rsi,-0x40(%rbp)
  cltq
  mov    %rax,%r8
  mov    $0x0,%r9d
  movslq %edx,%rax
  mov    %rax,%rcx
  mov    $0x0,%ebx
  mov    %r9,%rdx
  imul   %rcx,%rdx
  mov    %rbx,%rax
  imul   %r8,%rax
  lea    (%rdx,%rax,1),%rsi
  mov    %r8,%rax
  mul    %rcx
  lea    (%rsi,%rdx,1),%rcx
  mov    %rcx,%rdx
  mov    -0x68(%rbp),%rax
  mov    %rax,-0x38(%rbp)
  movl   $0x0,-0x5c(%rbp)
  jmp    L15
L3:
  mov    -0x5c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %r13,%rcx
  shr    $0x2,%rcx
  mov    -0x5c(%rbp),%eax
  cltq
  imul   %rcx,%rax
  lea    0x0(,%rax,4),%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <array_print@plt>
  addl   $0x1,-0x5c(%rbp)
L15:
  mov    -0x5c(%rbp),%eax
  cmp    -0x6c(%rbp),%eax
  jle    L3
  nop
  nop
  add    $0x48,%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

assistant: ```c
void print_partition_sizes(void *p_ptr, int N) {
  int(*p)[N + 1][N + 1] = (int(*)[N + 1][N + 1]) p_ptr;
  int i;
  for (i = 0; i <= N; i++) {
    array_print((*p)[i], i + 1);
  }
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<print_partition_sizes>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  lea    0x1(%rsi),%r12d
  movslq %r12d,%r12
  shl    $0x2,%r12
  test   %esi,%esi
  js     L2
  mov    %esi,%r13d
  mov    %rdi,%rbp
  mov    $0x0,%ebx
L9:
  add    $0x1,%ebx
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <array_print@plt>
  add    %r12,%rbp
  cmp    %r13d,%ebx
  jle    L9
L2:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
void print_partition_sizes(void *p_ptr, int N) {
  int(*p)[N + 1][N + 1] = (int(*)[N + 1][N + 1]) p_ptr;
  int i;
  for (i = 0; i <= N; i++) {
    array_print((*p)[i], i + 1);
  }
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<print_partition_sizes>:
  endbr64
  push   %r13
  push   %r12
  lea    0x1(%rsi),%r12d
  push   %rbp
  movslq %r12d,%r12
  push   %rbx
  shl    $0x2,%r12
  sub    $0x8,%rsp
  test   %esi,%esi
  js     L10
  mov    %esi,%r13d
  mov    %rdi,%rbp
  xor    %ebx,%ebx
  nopl   (%rax)
L16:
  add    $0x1,%ebx
  mov    %rbp,%rdi
  add    %r12,%rbp
  mov    %ebx,%esi
  call   <array_print@plt>
  cmp    %r13d,%ebx
  jle    L16
L10:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
void print_partition_sizes(void *p_ptr, int N) {
  int(*p)[N + 1][N + 1] = (int(*)[N + 1][N + 1]) p_ptr;
  int i;
  for (i = 0; i <= N; i++) {
    array_print((*p)[i], i + 1);
  }
}
```