ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<bitstream_ue>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,-0x28(%rbp)
  movl   $0xffffffff,-0x1c(%rbp)
  movl   $0x0,-0x18(%rbp)
  jmp    L7
L14:
  mov    -0x28(%rbp),%rax
  mov    $0x1,%edx
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <_read_bits@plt>
  mov    %eax,-0x18(%rbp)
  addl   $0x1,-0x1c(%rbp)
L7:
  cmpl   $0x0,-0x18(%rbp)
  je     L14
  mov    -0x1c(%rbp),%eax
  mov    $0x1,%edx
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  lea    -0x1(%rax),%ebx
  mov    -0x1c(%rbp),%ecx
  mov    -0x28(%rbp),%rax
  mov    $0x1,%edx
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <_read_bits@plt>
  add    %ebx,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
unsigned int bitstream_ue(struct bitstream_elmt_t *bs) {
  int leading_zeros = -1;
  int b;
  unsigned int code_num;
  for (b = 0; !b; leading_zeros++) {
    b = _read_bits(bs, 1, 1);
  }
  code_num = (1 << leading_zeros) - 1 + _read_bits(bs, leading_zeros, 1);
  return code_num;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<bitstream_ue>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  mov    $0xffffffff,%ebx
L4:
  mov    $0x1,%edx
  mov    $0x1,%esi
  mov    %rbp,%rdi
  call   <_read_bits@plt>
  add    $0x1,%ebx
  test   %eax,%eax
  je     L4
  mov    $0x1,%edx
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <_read_bits@plt>
  mov    %eax,%edx
  mov    $0x1,%eax
  mov    %ebx,%ecx
  shl    %cl,%eax
  lea    -0x1(%rax,%rdx,1),%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
unsigned int bitstream_ue(struct bitstream_elmt_t *bs) {
  int leading_zeros = -1;
  int b;
  unsigned int code_num;
  for (b = 0; !b; leading_zeros++) {
    b = _read_bits(bs, 1, 1);
  }
  code_num = (1 << leading_zeros) - 1 + _read_bits(bs, leading_zeros, 1);
  return code_num;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<bitstream_ue>:
  endbr64
  push   %r12
  mov    $0xffffffff,%r12d
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x8,%rsp
  nopl   0x0(%rax)
L7:
  mov    $0x1,%edx
  mov    $0x1,%esi
  mov    %rbp,%rdi
  add    $0x1,%r12d
  call   <_read_bits@plt>
  test   %eax,%eax
  je     L7
  mov    %r12d,%esi
  mov    %rbp,%rdi
  mov    $0x1,%edx
  call   <_read_bits@plt>
  mov    %r12d,%ecx
  add    $0x8,%rsp
  mov    %eax,%r8d
  mov    $0x1,%eax
  pop    %rbp
  pop    %r12
  shl    %cl,%eax
  lea    -0x1(%rax,%r8,1),%eax
  ret
```

assistant: ```c
unsigned int bitstream_ue(struct bitstream_elmt_t *bs) {
  int leading_zeros = -1;
  int b;
  unsigned int code_num;
  for (b = 0; !b; leading_zeros++) {
    b = _read_bits(bs, 1, 1);
  }
  code_num = (1 << leading_zeros) - 1 + _read_bits(bs, leading_zeros, 1);
  return code_num;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<bitstream_ue>:
  endbr64
  push   %r12
  mov    $0xffffffff,%r12d
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x8,%rsp
  nopl   0x0(%rax)
L7:
  mov    $0x1,%edx
  mov    $0x1,%esi
  mov    %rbp,%rdi
  add    $0x1,%r12d
  call   <_read_bits@plt>
  test   %eax,%eax
  je     L7
  mov    %r12d,%esi
  mov    %rbp,%rdi
  mov    $0x1,%edx
  call   <_read_bits@plt>
  mov    %r12d,%ecx
  add    $0x8,%rsp
  mov    %eax,%r8d
  mov    $0x1,%eax
  pop    %rbp
  pop    %r12
  shl    %cl,%eax
  lea    -0x1(%rax,%r8,1),%eax
  ret
```

assistant: ```c
unsigned int bitstream_ue(struct bitstream_elmt_t *bs) {
  int leading_zeros = -1;
  int b;
  unsigned int code_num;
  for (b = 0; !b; leading_zeros++) {
    b = _read_bits(bs, 1, 1);
  }
  code_num = (1 << leading_zeros) - 1 + _read_bits(bs, leading_zeros, 1);
  return code_num;
}
```
user: What is the c source code of the assembly code below?

```asm
<roll_n_dice>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  movl   $0x0,-0x4(%rbp)
  cmpl   $0x1,-0x18(%rbp)
  jg     L53
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0xfffffffe,%eax
  jmp    L19
L53:
  cmpl   $0x0,-0x14(%rbp)
  jg     L22
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0xffffffff,%eax
  jmp    L19
L22:
  movl   $0x0,-0x8(%rbp)
  jmp    L21
L20:
  mov    -0x18(%rbp),%eax
  mov    %eax,%edi
  call   <rollem@plt>
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  addl   $0x1,-0x8(%rbp)
L21:
  mov    -0x8(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L20
  mov    -0x4(%rbp),%eax
L19:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D15
type: string
name: disassemble_data
arguments: tag: D9
type: string

tool: D15: Need at 2 sides


tool: D9: Need at least 1 die


assistant: ```c
int roll_n_dice(int dice, int sides) {
  int d;
  int total = 0;
  if (sides < 2) {
    printf("Need at 2 sides\n");
    return -2;
  }
  if (dice < 1) {
    printf("Need at least 1 die\n");
    return -1;
  }
  for (d = 0; d < dice; d++) {
    total += rollem(sides);
  }
  return total;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<roll_n_dice>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  cmp    $0x1,%esi
  jle    L37
  mov    %edi,%r12d
  mov    %esi,%r13d
  test   %edi,%edi
  jle    L14
  mov    $0x0,%ebp
  mov    $0x0,%ebx
L21:
  mov    %r13d,%edi
  call   <rollem@plt>
  add    %eax,%ebp
  add    $0x1,%ebx
  cmp    %ebx,%r12d
  jne    L21
L6:
  mov    %ebp,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L37:
  lea    D10(%rip),%rdi
  call   <printf@plt>
  mov    $0xfffffffe,%ebp
  jmp    L6
L14:
  lea    D17(%rip),%rdi
  call   <printf@plt>
  mov    $0xffffffff,%ebp
  jmp    L6
```

tool_calls: name: unpack_data
arguments: data_tag: D10
type_infered: string
name: unpack_data
arguments: data_tag: D17
type_infered: string

tool: D10: Need at 2 sides


tool: D17: Need at least 1 die


assistant: ```c
int roll_n_dice(int dice, int sides) {
  int d;
  int total = 0;
  if (sides < 2) {
    printf("Need at 2 sides\n");
    return -2;
  }
  if (dice < 1) {
    printf("Need at least 1 die\n");
    return -1;
  }
  for (d = 0; d < dice; d++) {
    total += rollem(sides);
  }
  return total;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<roll_n_dice>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  cmp    $0x1,%esi
  jle    L16
  mov    %edi,%ebp
  test   %edi,%edi
  jle    L4
  mov    %esi,%r13d
  xor    %r12d,%r12d
  xor    %ebx,%ebx
  nopl   0x0(%rax)
L39:
  mov    %r13d,%edi
  add    $0x1,%ebx
  call   <rollem@plt>
  add    %eax,%r12d
  cmp    %ebx,%ebp
  jne    L39
L43:
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L16:
  lea    D3(%rip),%rdi
  mov    $0xfffffffe,%r12d
  call   <printf@plt>
  jmp    L43
L4:
  lea    D2(%rip),%rdi
  mov    $0xffffffff,%r12d
  call   <printf@plt>
  jmp    L43
```

tool_calls: name: disassemble_data
arguments: data_label: D3
type: string
name: disassemble_data
arguments: data_label: D2
type: string

tool: D3: Need at 2 sides


tool: D2: Need at least 1 die


assistant: ```c
int roll_n_dice(int dice, int sides) {
  int d;
  int total = 0;
  if (sides < 2) {
    printf("Need at 2 sides\n");
    return -2;
  }
  if (dice < 1) {
    printf("Need at least 1 die\n");
    return -1;
  }
  for (d = 0; d < dice; d++) {
    total += rollem(sides);
  }
  return total;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<roll_n_dice>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  cmp    $0x1,%esi
  jle    L40
  mov    %edi,%ebp
  test   %edi,%edi
  jle    L45
  mov    %esi,%r13d
  xor    %r12d,%r12d
  xor    %ebx,%ebx
  nopl   0x0(%rax)
L47:
  mov    %r13d,%edi
  add    $0x1,%ebx
  call   <rollem@plt>
  add    %eax,%r12d
  cmp    %ebx,%ebp
  jne    L47
L10:
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L40:
  lea    D10(%rip),%rdi
  mov    $0xfffffffe,%r12d
  call   <printf@plt>
  jmp    L10
L45:
  lea    D14(%rip),%rdi
  mov    $0xffffffff,%r12d
  call   <printf@plt>
  jmp    L10
```

tool_calls: name: extract_symbolic_data
arguments: tag: D10
type_guessed: string
name: extract_symbolic_data
arguments: tag: D14
type_guessed: string

tool: D10: Need at 2 sides


tool: D14: Need at least 1 die


assistant: ```c
int roll_n_dice(int dice, int sides) {
  int d;
  int total = 0;
  if (sides < 2) {
    printf("Need at 2 sides\n");
    return -2;
  }
  if (dice < 1) {
    printf("Need at least 1 die\n");
    return -1;
  }
  for (d = 0; d < dice; d++) {
    total += rollem(sides);
  }
  return total;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<Log_Error>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xd0,%rsp
  mov    %rdi,-0xc8(%rbp)
  mov    %rsi,-0xa8(%rbp)
  mov    %rdx,-0xa0(%rbp)
  mov    %rcx,-0x98(%rbp)
  mov    %r8,-0x90(%rbp)
  mov    %r9,-0x88(%rbp)
  test   %al,%al
  je     L0
  movaps %xmm0,-0x80(%rbp)
  movaps %xmm1,-0x70(%rbp)
  movaps %xmm2,-0x60(%rbp)
  movaps %xmm3,-0x50(%rbp)
  movaps %xmm4,-0x40(%rbp)
  movaps %xmm5,-0x30(%rbp)
  movaps %xmm6,-0x20(%rbp)
  movaps %xmm7,-0x10(%rbp)
L0:
  mov    -0xc8(%rbp),%rdx
  mov    -0xb4(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <va_start@plt>
  mov    -0xb4(%rbp),%edx
  mov    -0xc8(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x6e,%edi
  call   <LogV@plt>
  mov    -0xb4(%rbp),%eax
  mov    %eax,%edi
  call   <va_end@plt>
  nop
  leave
  ret
```

assistant: ```c
void __attribute__((__format__(__printf__, 1, 2))) Log_Error(const char *fmt, ...) {
  va_list ap;
  va_start(ap, fmt);
  LogV((100 + 10), fmt, ap);
  va_end(ap);
}
```
user: What is the c source code of the assembly code below:

```asm
<Log_Error>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %rdi,%rsi
  mov    $0x0,%ebp
  mov    %ebp,%edi
  call   <va_start@plt>
  mov    %ebp,%edx
  mov    %rbx,%rsi
  mov    $0x6e,%edi
  call   <LogV@plt>
  mov    %ebp,%edi
  call   <va_end@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void __attribute__((__format__(__printf__, 1, 2))) Log_Error(const char *fmt, ...) {
  va_list ap;
  va_start(ap, fmt);
  LogV((100 + 10), fmt, ap);
  va_end(ap);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<Log_Error>:
  endbr64
  push   %r12
  xor    %r12d,%r12d
  mov    %rdi,%rsi
  push   %rbp
  mov    %rdi,%rbp
  mov    %r12d,%edi
  sub    $0x8,%rsp
  call   <va_start@plt>
  mov    %r12d,%edx
  mov    %rbp,%rsi
  mov    $0x6e,%edi
  call   <LogV@plt>
  mov    %r12d,%edi
  call   <va_end@plt>
  add    $0x8,%rsp
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
void __attribute__((__format__(__printf__, 1, 2))) Log_Error(const char *fmt, ...) {
  va_list ap;
  va_start(ap, fmt);
  LogV((100 + 10), fmt, ap);
  va_end(ap);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<Log_Error>:
  endbr64
  push   %r12
  xor    %r12d,%r12d
  mov    %rdi,%rsi
  push   %rbp
  mov    %rdi,%rbp
  mov    %r12d,%edi
  sub    $0x8,%rsp
  call   <va_start@plt>
  mov    %r12d,%edx
  mov    %rbp,%rsi
  mov    $0x6e,%edi
  call   <LogV@plt>
  mov    %r12d,%edi
  call   <va_end@plt>
  add    $0x8,%rsp
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
void __attribute__((__format__(__printf__, 1, 2))) Log_Error(const char *fmt, ...) {
  va_list ap;
  va_start(ap, fmt);
  LogV((100 + 10), fmt, ap);
  va_end(ap);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<testPassingParentRegionArray>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x20(%rbp),%rdx
  mov    -0x24(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <initArray@plt>
  movsd  -0x18(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L5
  call   <__stack_chk_fail@plt>
L5:
  leave
  ret
```

assistant: ```c
int testPassingParentRegionArray(int x) {
  double XYZ[3];
  initArray(x, XYZ);
  return 1 * XYZ[1];
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<testPassingParentRegionArray>:
  endbr64
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rsi
  call   <initArray@plt>
  cvttsd2si 0x8(%rsp),%eax
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L1
  add    $0x28,%rsp
  ret
L1:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int testPassingParentRegionArray(int x) {
  double XYZ[3];
  initArray(x, XYZ);
  return 1 * XYZ[1];
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<testPassingParentRegionArray>:
  endbr64
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rsi
  call   <initArray@plt>
  cvttsd2si 0x8(%rsp),%eax
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L2
  add    $0x28,%rsp
  ret
L2:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int testPassingParentRegionArray(int x) {
  double XYZ[3];
  initArray(x, XYZ);
  return 1 * XYZ[1];
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<testPassingParentRegionArray>:
  endbr64
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rsi
  call   <initArray@plt>
  cvttsd2si 0x8(%rsp),%eax
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L8
  add    $0x28,%rsp
  ret
L8:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int testPassingParentRegionArray(int x) {
  double XYZ[3];
  initArray(x, XYZ);
  return 1 * XYZ[1];
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<noise>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %esi,-0xc(%rbp)
  mov    %edx,-0x10(%rbp)
  mov    %ecx,-0x14(%rbp)
  cmpl   $0x0,-0x10(%rbp)
  je     L42
  mov    -0x10(%rbp),%eax
  mov    %eax,%edi
  call   <rand_mod@plt>
  mov    %eax,-0x10(%rbp)
L42:
  mov    -0xc(%rbp),%eax
  add    %eax,-0x10(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L8
L49:
  mov    $0x0,%eax
  call   <rand_chr@plt>
  mov    -0x8(%rbp),%rdx
  mov    %al,(%rdx)
  cmpl   $0x0,-0x14(%rbp)
  je     L41
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isalnum@plt>
  test   %eax,%eax
  je     L49
L41:
  addl   $0x1,-0xc(%rbp)
  addq   $0x1,-0x8(%rbp)
L8:
  mov    -0xc(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jb     L49
  cmpl   $0x0,-0x14(%rbp)
  je     L17
  mov    -0x8(%rbp),%rax
  movb   $0x0,(%rax)
L17:
  mov    -0x10(%rbp),%eax
  leave
  ret
```

assistant: ```c
int noise(char *ptr, unsigned min, unsigned xtra, int str) {
  if (xtra)
    xtra = rand_mod(xtra);
  xtra += min;
  for (min = 0; min < xtra; min++, ptr++)
    do
      *ptr = rand_chr();
    while (str && !isalnum((int)*ptr));
  if (str)
    *ptr = '\0';
  return xtra;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<noise>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %esi,%r13d
  mov    %ecx,%ebp
  test   %edx,%edx
  jne    L71
L40:
  add    %edx,%r13d
  je     L10
  mov    %r13d,%r12d
  add    %rbx,%r12
  jmp    L83
L71:
  mov    %edx,%edi
  call   <rand_mod@plt>
  mov    %eax,%edx
  jmp    L40
L25:
  add    $0x1,%rbx
  cmp    %r12,%rbx
  je     L43
L83:
  mov    $0x0,%eax
  call   <rand_chr@plt>
  mov    %al,(%rbx)
  test   %ebp,%ebp
  je     L25
  movsbl %al,%edi
  call   <isalnum@plt>
  test   %eax,%eax
  je     L83
  jmp    L25
L10:
  mov    %rbx,%r12
L43:
  test   %ebp,%ebp
  je     L66
  movb   $0x0,(%r12)
L66:
  mov    %r13d,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
int noise(char *ptr, unsigned min, unsigned xtra, int str) {
  if (xtra)
    xtra = rand_mod(xtra);
  xtra += min;
  for (min = 0; min < xtra; min++, ptr++)
    do
      *ptr = rand_chr();
    while (str && !isalnum((int)*ptr));
  if (str)
    *ptr = '\0';
  return xtra;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<noise>:
  endbr64
  push   %r13
  mov    %esi,%r13d
  push   %r12
  push   %rbp
  mov    %ecx,%ebp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  test   %edx,%edx
  jne    L49
  test   %r13d,%r13d
  je     L87
L35:
  mov    %r13d,%r12d
  add    %rbx,%r12
  jmp    L85
  nopw   0x0(%rax,%rax,1)
L81:
  movsbl %al,%edi
  call   <isalnum@plt>
  test   %eax,%eax
  jne    L83
L85:
  xor    %eax,%eax
  call   <rand_chr@plt>
  mov    %al,(%rbx)
  test   %ebp,%ebp
  jne    L81
L83:
  add    $0x1,%rbx
  cmp    %r12,%rbx
  jne    L85
L33:
  test   %ebp,%ebp
  je     L6
  movb   $0x0,(%r12)
L6:
  add    $0x8,%rsp
  mov    %r13d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L49:
  mov    %edx,%edi
  call   <rand_mod@plt>
  add    %eax,%r13d
  test   %r13d,%r13d
  jne    L35
L87:
  mov    %rbx,%r12
  jmp    L33
```

assistant: ```c
int noise(char *ptr, unsigned min, unsigned xtra, int str) {
  if (xtra)
    xtra = rand_mod(xtra);
  xtra += min;
  for (min = 0; min < xtra; min++, ptr++)
    do
      *ptr = rand_chr();
    while (str && !isalnum((int)*ptr));
  if (str)
    *ptr = '\0';
  return xtra;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<noise>:
  endbr64
  push   %r13
  mov    %esi,%r13d
  push   %r12
  push   %rbp
  mov    %ecx,%ebp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  test   %edx,%edx
  jne    L37
  test   %r13d,%r13d
  je     L82
L9:
  mov    %r13d,%r12d
  add    %rbx,%r12
  nopl   (%rax)
L4:
  test   %ebp,%ebp
  je     L68
  nopl   0x0(%rax)
L5:
  xor    %eax,%eax
  call   <rand_chr@plt>
  mov    %al,(%rbx)
  movsbl %al,%edi
  call   <isalnum@plt>
  test   %eax,%eax
  je     L5
  add    $0x1,%rbx
  cmp    %r12,%rbx
  jne    L4
L47:
  test   %ebp,%ebp
  je     L10
  movb   $0x0,(%r12)
L10:
  add    $0x8,%rsp
  mov    %r13d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L68:
  xor    %eax,%eax
  add    $0x1,%rbx
  call   <rand_chr@plt>
  mov    %al,-0x1(%rbx)
  cmp    %r12,%rbx
  jne    L4
  jmp    L47
L37:
  mov    %edx,%edi
  call   <rand_mod@plt>
  add    %eax,%r13d
  test   %r13d,%r13d
  jne    L9
L82:
  mov    %rbx,%r12
  jmp    L47
```

assistant: ```c
int noise(char *ptr, unsigned min, unsigned xtra, int str) {
  if (xtra)
    xtra = rand_mod(xtra);
  xtra += min;
  for (min = 0; min < xtra; min++, ptr++)
    do
      *ptr = rand_chr();
    while (str && !isalnum((int)*ptr));
  if (str)
    *ptr = '\0';
  return xtra;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<rtime_decompress>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x450,%rsp
  mov    %rdi,-0x438(%rbp)
  mov    %rsi,-0x440(%rbp)
  mov    %edx,-0x444(%rbp)
  mov    %ecx,-0x448(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x420(%rbp)
  movl   $0x0,-0x41c(%rbp)
  lea    -0x410(%rbp),%rax
  mov    $0x400,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  jmp    L51
L44:
  mov    -0x41c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x41c(%rbp)
  movslq %eax,%rdx
  mov    -0x438(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x421(%rbp)
  mov    -0x420(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x420(%rbp)
  movslq %eax,%rdx
  mov    -0x440(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x421(%rbp),%eax
  mov    %al,(%rdx)
  mov    -0x41c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x41c(%rbp)
  movslq %eax,%rdx
  mov    -0x438(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x414(%rbp)
  movzbl -0x421(%rbp),%eax
  cltq
  mov    -0x410(%rbp,%rax,4),%eax
  mov    %eax,-0x418(%rbp)
  movzbl -0x421(%rbp),%eax
  cltq
  mov    -0x420(%rbp),%edx
  mov    %edx,-0x410(%rbp,%rax,4)
  cmpl   $0x0,-0x414(%rbp)
  je     L51
  mov    -0x418(%rbp),%edx
  mov    -0x414(%rbp),%eax
  add    %edx,%eax
  cmp    %eax,-0x420(%rbp)
  jg     L75
  jmp    L50
L67:
  mov    -0x418(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x418(%rbp)
  movslq %eax,%rdx
  mov    -0x440(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x420(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x420(%rbp)
  movslq %eax,%rdx
  mov    -0x440(%rbp),%rax
  add    %rax,%rdx
  movzbl (%rcx),%eax
  mov    %al,(%rdx)
  subl   $0x1,-0x414(%rbp)
L50:
  cmpl   $0x0,-0x414(%rbp)
  jne    L67
  jmp    L51
L75:
  mov    -0x418(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x440(%rbp),%rax
  lea    (%rdx,%rax,1),%rsi
  mov    -0x420(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x440(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x414(%rbp),%eax
  mov    %eax,%edx
  mov    %rcx,%rdi
  call   <memcpy@plt>
  mov    -0x414(%rbp),%eax
  add    %eax,-0x420(%rbp)
L51:
  mov    -0x420(%rbp),%eax
  cmp    -0x448(%rbp),%eax
  jl     L44
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L4
  call   <__stack_chk_fail@plt>
L4:
  leave
  ret
```

assistant: ```c
void rtime_decompress(unsigned char *data_in, unsigned char *cpage_out, __u32 srclen, __u32 destlen) {
  int positions[256];
  int outpos = 0;
  int pos = 0;
  memset(positions, 0, sizeof(positions));
  while (outpos < destlen) {
    unsigned char value;
    int backoffs;
    int repeat;
    value = data_in[pos++];
    cpage_out[outpos++] = value;
    repeat = data_in[pos++];
    backoffs = positions[value];
    positions[value] = outpos;
    if (repeat) {
      if (backoffs + repeat >= outpos) {
        while (repeat) {
          cpage_out[outpos++] = cpage_out[backoffs++];
          repeat--;
        }
      } else {
        memcpy(&cpage_out[outpos], &cpage_out[backoffs], repeat);
        outpos += repeat;
      }
    }
  }
}
```
user: What is the c source code of the assembly code below?

```asm
<rtime_decompress>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x418,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%r12
  mov    %ecx,%r13d
  mov    %fs:0x28,%rax
  mov    %rax,0x408(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  mov    $0x400,%edx
  mov    $0x0,%esi
  call   <memset@plt>
  test   %r13d,%r13d
  jle    L84
  mov    $0x0,%ecx
  lea    0x1(%r12),%r14
  jmp    L34
L68:
  movslq %edx,%rdx
  lea    (%r12,%rdx,1),%rax
  lea    (%r14,%rdx,1),%r9
  lea    -0x1(%rbp),%edi
  add    %rdi,%r9
L52:
  movzbl (%rax),%r8d
  mov    %rax,%rdi
  sub    %rdx,%rdi
  mov    %r8b,0x1(%rdi,%rsi,1)
  add    $0x1,%rax
  cmp    %r9,%rax
  jne    L52
  lea    0x1(%rcx,%rbp,1),%ecx
  jmp    L32
L69:
  mov    %r15d,%ecx
L32:
  add    $0x2,%rbx
  cmp    %r13d,%ecx
  jge    L84
L34:
  movzbl (%rbx),%eax
  lea    0x1(%rcx),%r15d
  movslq %ecx,%rsi
  mov    %al,(%r12,%rsi,1)
  movzbl 0x1(%rbx),%edi
  movzbl %dil,%ebp
  movzbl %al,%eax
  mov    (%rsp,%rax,4),%edx
  mov    %r15d,(%rsp,%rax,4)
  test   %ebp,%ebp
  je     L69
  lea    0x0(%rbp,%rdx,1),%eax
  cmp    %r15d,%eax
  jge    L68
  movslq %edx,%rdx
  lea    (%r12,%rdx,1),%rsi
  movslq %r15d,%rdi
  add    %r12,%rdi
  mov    %ebp,%edx
  call   <memcpy@plt>
  lea    (%r15,%rbp,1),%ecx
  jmp    L32
L84:
  mov    0x408(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L72
  add    $0x418,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L72:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void rtime_decompress(unsigned char *data_in, unsigned char *cpage_out, __u32 srclen, __u32 destlen) {
  int positions[256];
  int outpos = 0;
  int pos = 0;
  memset(positions, 0, sizeof(positions));
  while (outpos < destlen) {
    unsigned char value;
    int backoffs;
    int repeat;
    value = data_in[pos++];
    cpage_out[outpos++] = value;
    repeat = data_in[pos++];
    backoffs = positions[value];
    positions[value] = outpos;
    if (repeat) {
      if (backoffs + repeat >= outpos) {
        while (repeat) {
          cpage_out[outpos++] = cpage_out[backoffs++];
          repeat--;
        }
      } else {
        memcpy(&cpage_out[outpos], &cpage_out[backoffs], repeat);
        outpos += repeat;
      }
    }
  }
}
```