ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%ecx
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    $0x0,%edi
  jmp    L36
L8:
  add    $0x1,%ecx
  cmp    $0x8,%ecx
  je     L34
L36:
  mov    %esi,%eax
  sar    %cl,%eax
  test   $0x1,%al
  je     L8
  mov    %edi,%eax
  shl    %cl,%eax
  add    %eax,%edx
  jmp    L8
L34:
  test   %edx,%edx
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main() {
  unsigned char a, b;
  int result = 0, i;
  for (i = 0; i < 8; i++)
    if ((b >> i) & 1)
      result += (a << i);
  assert(result == a * b);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  xor    %ecx,%ecx
  xor    %edx,%edx
  xor    %r8d,%r8d
  xor    %edi,%edi
  nopl   0x0(%rax)
L0:
  mov    %r8d,%esi
  mov    %edi,%eax
  shl    %cl,%eax
  sar    %cl,%esi
  add    %edx,%eax
  and    $0x1,%esi
  cmovne %eax,%edx
  add    $0x1,%ecx
  cmp    $0x8,%ecx
  jne    L0
  imul   %r8d,%edi
  cmp    %edx,%edi
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main() {
  unsigned char a, b;
  int result = 0, i;
  for (i = 0; i < 8; i++)
    if ((b >> i) & 1)
      result += (a << i);
  assert(result == a * b);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  xor    %eax,%eax
  sub    $0x8,%rsp
  xor    %edi,%edi
  test   %eax,%eax
  sete   %dil
  call   <assert@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main() {
  unsigned char a, b;
  int result = 0, i;
  for (i = 0; i < 8; i++)
    if ((b >> i) & 1)
      result += (a << i);
  assert(result == a * b);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0x4(%rbp)
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D1
type: string

tool: D1: 1

assistant: ```c
int main() {
  int i = atoi("1");
  (void)i;
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  lea    D2(%rip),%rdi
  call   <atoi@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D2
datatype: string

tool: D2: 1

assistant: ```c
int main() {
  int i = atoi("1");
  (void)i;
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  lea    D3(%rip),%rdi
  call   <atoi@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D3
type_infered: string

tool: D3: 1

assistant: ```c
int main() {
  int i = atoi("1");
  (void)i;
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  lea    D0(%rip),%rdi
  call   <atoi@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D0
type: string

tool: D0: 1

assistant: ```c
int main() {
  int i = atoi("1");
  (void)i;
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  lea    -0x3c(%rbp),%rsi
  lea    D17(%rip),%rdi
  call   <scanf@plt>
  mov    -0x3c(%rbp),%eax
  cmp    $0x31,%eax
  jg     L156
  mov    %rsp,%r12
  movslq %eax,%rdx
  lea    0xf(,%rdx,4),%rdx
  mov    %rdx,%rsi
  and    $0xfffffffffffffff0,%rsi
  and    $0xfffffffffffff000,%rdx
  mov    %rsp,%rcx
  sub    %rdx,%rcx
L48:
  cmp    %rcx,%rsp
  je     L159
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L48
L159:
  mov    %rsi,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L145
  orq    $0x0,-0x8(%rsp,%rdx,1)
L145:
  mov    %rsp,%rbx
  test   %eax,%eax
  jle    L103
  mov    %rbx,%r14
  mov    $0x0,%r13d
  lea    D35(%rip),%r15
L102:
  mov    %r14,%rsi
  mov    %r15,%rdi
  call   <scanf@plt>
  add    $0x1,%r13d
  mov    -0x3c(%rbp),%edi
  add    $0x4,%r14
  cmp    %r13d,%edi
  jg     L102
  test   %edi,%edi
  jle    L103
  lea    -0x1(%rdi),%r9d
  mov    $0x0,%esi
  mov    $0x0,%r10d
  mov    $0x1,%r11d
  jmp    L147
L124:
  mov    %r11d,%r10d
L106:
  add    $0x1,%rsi
L147:
  cmp    %r9,%rsi
  je     L27
  cmp    $0xffffffff,%esi
  je     L106
  mov    0x4(%rbx,%rsi,4),%r8d
  mov    $0x0,%eax
L42:
  cmp    (%rbx,%rax,4),%r8d
  je     L124
  lea    0x1(%rax),%edx
  cmp    %edx,%edi
  setg   %cl
  cmp    %esi,%eax
  setne  %dl
  add    $0x1,%rax
  test   %dl,%cl
  jne    L42
  jmp    L106
L27:
  test   %r10d,%r10d
  je     L103
  lea    D27(%rip),%rdi
  call   <printf@plt>
  jmp    L74
L103:
  lea    D37(%rip),%rdi
  call   <printf@plt>
L74:
  mov    %r12,%rsp
L156:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L52
  mov    $0x0,%eax
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L52:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D17
datatype: string
name: extract_symbolic_data
arguments: label: D35
datatype: string
name: extract_symbolic_data
arguments: label: D27
datatype: string
name: extract_symbolic_data
arguments: label: D37
datatype: string

tool: D17: %d


tool: D35: %d 

tool: D27: YES


tool: D37: NO


assistant: ```c
int main() {
  int N;
  scanf("%d\n", &N);
  if (N < 50) {
    int d = 0;
    int arr[N], i, j;
    for (i = 0; i < N; i = i + 1) {
      scanf("%d ", &arr[i]);
    }
    for (i = 0; i < N; i = i + 1) {
      for (j = 0; j != i && j < N; j = j + 1) {
        if (arr[i] == arr[j]) {
          d = 1;
          break;
        }
      }
    }
    if (d == 0) {
      printf("NO\n");
    } else {
      printf("YES\n");
    }
  }
  return 0;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<main>:
  endbr64
  push   %rbp
  lea    D31(%rip),%rdi
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  lea    -0x3c(%rbp),%rsi
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  call   <scanf@plt>
  mov    -0x3c(%rbp),%eax
  cmp    $0x31,%eax
  jg     L38
  movslq %eax,%rdx
  mov    %rsp,%rsi
  mov    %rsp,%rbx
  lea    0xf(,%rdx,4),%rdx
  mov    %rdx,%rcx
  and    $0xfffffffffffff000,%rdx
  and    $0xfffffffffffffff0,%rcx
  sub    %rdx,%rsi
L59:
  cmp    %rsi,%rsp
  je     L76
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L59
L32:
  test   %r10d,%r10d
  je     L144
  lea    D9(%rip),%rdi
  call   <printf@plt>
L83:
  mov    %rbx,%rsp
L38:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L134
  lea    -0x28(%rbp),%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L76:
  and    $0xfff,%ecx
  sub    %rcx,%rsp
  test   %rcx,%rcx
  je     L147
  orq    $0x0,-0x8(%rsp,%rcx,1)
L147:
  mov    %rsp,%r12
  test   %eax,%eax
  jle    L144
  mov    %r12,%r15
  xor    %r13d,%r13d
  lea    D0(%rip),%r14
  nopl   (%rax)
L0:
  mov    %r15,%rsi
  mov    %r14,%rdi
  add    $0x1,%r13d
  add    $0x4,%r15
  call   <scanf@plt>
  mov    -0x3c(%rbp),%edi
  cmp    %r13d,%edi
  jg     L0
  test   %edi,%edi
  jle    L144
  lea    -0x1(%rdi),%r9d
  xor    %esi,%esi
  xor    %r10d,%r10d
  nopl   0x0(%rax,%rax,1)
L89:
  cmp    %r9,%rsi
  je     L32
  mov    0x4(%r12,%rsi,4),%r8d
  xor    %eax,%eax
L14:
  cmp    (%r12,%rax,4),%r8d
  je     L92
  lea    0x1(%rax),%edx
  cmp    %edx,%edi
  setg   %cl
  cmp    %esi,%eax
  setne  %dl
  add    $0x1,%rax
  test   %dl,%cl
  jne    L14
  add    $0x1,%rsi
  jmp    L89
  nopl   0x0(%rax)
L92:
  mov    $0x1,%r10d
  add    $0x1,%rsi
  jmp    L89
L144:
  lea    D10(%rip),%rdi
  call   <printf@plt>
  jmp    L83
L134:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D31
type_guessed: string
name: parse_data
arguments: label: D9
type_guessed: string
name: parse_data
arguments: label: D0
type_guessed: string
name: parse_data
arguments: label: D10
type_guessed: string

tool: D31: %d


tool: D9: YES


tool: D0: %d 

tool: D10: NO


assistant: ```c
int main() {
  int N;
  scanf("%d\n", &N);
  if (N < 50) {
    int d = 0;
    int arr[N], i, j;
    for (i = 0; i < N; i = i + 1) {
      scanf("%d ", &arr[i]);
    }
    for (i = 0; i < N; i = i + 1) {
      for (j = 0; j != i && j < N; j = j + 1) {
        if (arr[i] == arr[j]) {
          d = 1;
          break;
        }
      }
    }
    if (d == 0) {
      printf("NO\n");
    } else {
      printf("YES\n");
    }
  }
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %rbp
  lea    D9(%rip),%rdi
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  lea    -0x3c(%rbp),%rsi
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  call   <scanf@plt>
  mov    -0x3c(%rbp),%eax
  cmp    $0x31,%eax
  jg     L116
  movslq %eax,%rdx
  mov    %rsp,%rsi
  mov    %rsp,%rbx
  lea    0xf(,%rdx,4),%rdx
  mov    %rdx,%rcx
  and    $0xfffffffffffff000,%rdx
  and    $0xfffffffffffffff0,%rcx
  sub    %rdx,%rsi
L140:
  cmp    %rsi,%rsp
  je     L130
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L140
L130:
  and    $0xfff,%ecx
  sub    %rcx,%rsp
  test   %rcx,%rcx
  je     L134
  orq    $0x0,-0x8(%rsp,%rcx,1)
L134:
  mov    %rsp,%r12
  test   %eax,%eax
  jle    L5
  mov    %r12,%r15
  xor    %r13d,%r13d
  lea    D1(%rip),%r14
  nopl   (%rax)
L112:
  mov    %r15,%rsi
  mov    %r14,%rdi
  add    $0x1,%r13d
  add    $0x4,%r15
  call   <scanf@plt>
  mov    -0x3c(%rbp),%edi
  cmp    %r13d,%edi
  jg     L112
  test   %edi,%edi
  jle    L5
  cmp    $0x1,%edi
  je     L5
  lea    -0x1(%rdi),%r9d
  xor    %esi,%esi
  xor    %r10d,%r10d
  nopl   (%rax)
L136:
  mov    0x4(%r12,%rsi,4),%r8d
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L19:
  cmp    (%r12,%rax,4),%r8d
  je     L82
  lea    0x1(%rax),%edx
  cmp    %edx,%edi
  setg   %cl
  cmp    %esi,%eax
  setne  %dl
  add    $0x1,%rax
  test   %dl,%cl
  jne    L19
L38:
  add    $0x1,%rsi
  cmp    %rsi,%r9
  jne    L136
  test   %r10d,%r10d
  je     L5
  lea    D26(%rip),%rdi
  call   <printf@plt>
L27:
  mov    %rbx,%rsp
L116:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L97
  lea    -0x28(%rbp),%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L82:
  mov    $0x1,%r10d
  jmp    L38
L5:
  lea    D4(%rip),%rdi
  call   <printf@plt>
  jmp    L27
L97:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D9
data_type: string
name: read_data
arguments: data_label: D1
data_type: string
name: read_data
arguments: data_label: D26
data_type: string
name: read_data
arguments: data_label: D4
data_type: string

tool: D9: %d


tool: D1: %d 

tool: D26: YES


tool: D4: NO


assistant: ```c
int main() {
  int N;
  scanf("%d\n", &N);
  if (N < 50) {
    int d = 0;
    int arr[N], i, j;
    for (i = 0; i < N; i = i + 1) {
      scanf("%d ", &arr[i]);
    }
    for (i = 0; i < N; i = i + 1) {
      for (j = 0; j != i && j < N; j = j + 1) {
        if (arr[i] == arr[j]) {
          d = 1;
          break;
        }
      }
    }
    if (d == 0) {
      printf("NO\n");
    } else {
      printf("YES\n");
    }
  }
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<maxArray>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    -0x18(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movl   $0x1,-0xc(%rbp)
  jmp    L22
L9:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  comisd -0x8(%rbp),%xmm0
  jbe    L0
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x8(%rbp)
L0:
  addl   $0x1,-0xc(%rbp)
L22:
  mov    -0xc(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L9
  movsd  -0x8(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  pop    %rbp
  ret
```

assistant: ```c
double maxArray(double someArray[], int length) {
  int i;
  double currentMax = someArray[0];
  for (i = 1; i < length; i++) {
    if (someArray[i] > currentMax) {
      currentMax = someArray[i];
    }
  }
  return currentMax;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<maxArray>:
  endbr64
  movsd  (%rdi),%xmm0
  cmp    $0x1,%esi
  jle    L11
  lea    0x8(%rdi),%rax
  lea    -0x2(%rsi),%edx
  lea    0x10(%rdi,%rdx,8),%rdx
L19:
  movsd  (%rax),%xmm1
  maxsd  %xmm0,%xmm1
  movapd %xmm1,%xmm0
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L19
L11:
  ret
```

assistant: ```c
double maxArray(double someArray[], int length) {
  int i;
  double currentMax = someArray[0];
  for (i = 1; i < length; i++) {
    if (someArray[i] > currentMax) {
      currentMax = someArray[i];
    }
  }
  return currentMax;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<maxArray>:
  endbr64
  movsd  (%rdi),%xmm0
  cmp    $0x1,%esi
  jle    L6
  lea    -0x2(%rsi),%edx
  lea    0x8(%rdi),%rax
  lea    0x10(%rdi,%rdx,8),%rdx
  nopl   0x0(%rax)
L14:
  movsd  (%rax),%xmm1
  add    $0x8,%rax
  maxsd  %xmm0,%xmm1
  movapd %xmm1,%xmm0
  cmp    %rdx,%rax
  jne    L14
L6:
  ret
```

assistant: ```c
double maxArray(double someArray[], int length) {
  int i;
  double currentMax = someArray[0];
  for (i = 1; i < length; i++) {
    if (someArray[i] > currentMax) {
      currentMax = someArray[i];
    }
  }
  return currentMax;
}
```
user: Translate the below assembly code into C programming language:

```asm
<maxArray>:
  endbr64
  movsd  (%rdi),%xmm0
  cmp    $0x1,%esi
  jle    L7
  lea    -0x2(%rsi),%edx
  lea    0x8(%rdi),%rax
  lea    0x10(%rdi,%rdx,8),%rdx
  nopl   0x0(%rax)
L15:
  movsd  (%rax),%xmm1
  add    $0x8,%rax
  maxsd  %xmm0,%xmm1
  movapd %xmm1,%xmm0
  cmp    %rdx,%rax
  jne    L15
L7:
  ret
```

assistant: ```c
double maxArray(double someArray[], int length) {
  int i;
  double currentMax = someArray[0];
  for (i = 1; i < length; i++) {
    if (someArray[i] > currentMax) {
      currentMax = someArray[i];
    }
  }
  return currentMax;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<printi>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  mov    %edx,-0x40(%rbp)
  mov    %ecx,-0x44(%rbp)
  mov    %r8d,-0x48(%rbp)
  mov    %r9d,-0x4c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x2c(%rbp)
  movl   $0x0,-0x28(%rbp)
  mov    -0x3c(%rbp),%eax
  mov    %eax,-0x24(%rbp)
  cmpl   $0x0,-0x3c(%rbp)
  jne    L109
  movb   $0x30,-0x14(%rbp)
  movb   $0x0,-0x13(%rbp)
  mov    -0x4c(%rbp),%ecx
  mov    -0x48(%rbp),%edx
  lea    -0x14(%rbp),%rsi
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <prints@plt>
  jmp    L29
L109:
  cmpl   $0x0,-0x44(%rbp)
  je     L90
  cmpl   $0xa,-0x40(%rbp)
  jne    L90
  cmpl   $0x0,-0x3c(%rbp)
  jns    L90
  movl   $0x1,-0x2c(%rbp)
  mov    -0x3c(%rbp),%eax
  neg    %eax
  mov    %eax,-0x24(%rbp)
L90:
  lea    -0x14(%rbp),%rax
  add    $0xb,%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  movb   $0x0,(%rax)
  jmp    L111
L0:
  mov    -0x40(%rbp),%ecx
  mov    -0x24(%rbp),%eax
  mov    $0x0,%edx
  div    %ecx
  mov    %edx,%eax
  mov    %eax,-0x30(%rbp)
  cmpl   $0x9,-0x30(%rbp)
  jle    L123
  mov    0x10(%rbp),%eax
  sub    $0x3a,%eax
  add    %eax,-0x30(%rbp)
L123:
  mov    -0x30(%rbp),%eax
  add    $0x30,%eax
  subq   $0x1,-0x20(%rbp)
  mov    %eax,%edx
  mov    -0x20(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x40(%rbp),%edi
  mov    -0x24(%rbp),%eax
  mov    $0x0,%edx
  div    %edi
  mov    %eax,-0x24(%rbp)
L111:
  cmpl   $0x0,-0x24(%rbp)
  jne    L0
  cmpl   $0x0,-0x2c(%rbp)
  je     L92
  cmpl   $0x0,-0x48(%rbp)
  je     L45
  mov    -0x4c(%rbp),%eax
  and    $0x2,%eax
  test   %eax,%eax
  je     L45
  mov    -0x38(%rbp),%rax
  mov    $0x2d,%esi
  mov    %rax,%rdi
  call   <printchar@plt>
  addl   $0x1,-0x28(%rbp)
  subl   $0x1,-0x48(%rbp)
  jmp    L92
L45:
  subq   $0x1,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  movb   $0x2d,(%rax)
L92:
  mov    -0x4c(%rbp),%ecx
  mov    -0x48(%rbp),%edx
  mov    -0x20(%rbp),%rsi
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <prints@plt>
  mov    -0x28(%rbp),%edx
  add    %edx,%eax
L29:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L88
  call   <__stack_chk_fail@plt>
L88:
  leave
  ret
```

assistant: ```c
int printi(char **out, int i, int b, int sg, int width, int pad, int letbase) {
  char print_buf[12];
  char *s;
  int t, neg = 0, pc = 0;
  unsigned u = (unsigned)i;
  if (i == 0) {
    print_buf[0] = '0';
    print_buf[1] = '\0';
    return prints(out, print_buf, width, pad);
  }
  if (sg && b == 10 && i < 0) {
    neg = 1;
    u = (unsigned)-i;
  }
  s = print_buf + 12 - 1;
  *s = '\0';
  while (u) {
    t = u % b;
    if (t >= 10)
      t += letbase - '0' - 10;
    *--s = t + '0';
    u /= b;
  }
  if (neg) {
    if (width && (pad & 2)) {
      printchar(out, '-');
      ++pc;
      --width;
    } else {
      *--s = '-';
    }
  }
  return pc + prints(out, s, width, pad);
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<printi>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x20,%rsp
  mov    %rdi,%r12
  mov    %esi,%eax
  mov    %edx,%esi
  mov    %r8d,%ebx
  mov    %r9d,%ebp
  mov    %fs:0x28,%rdx
  mov    %rdx,0x18(%rsp)
  xor    %edx,%edx
  test   %eax,%eax
  je     L53
  test   %ecx,%ecx
  setne  %cl
  cmp    $0xa,%esi
  sete   %dl
  test   %dl,%cl
  je     L45
  test   %eax,%eax
  js     L31
L45:
  mov    %eax,%ecx
  mov    $0x0,%r13d
L13:
  movb   $0x0,0x17(%rsp)
  lea    0x17(%rsp),%rdi
  mov    %esi,%r8d
  mov    0x50(%rsp),%eax
  lea    -0x3a(%rax),%r9d
  jmp    L20
L53:
  movb   $0x30,0xc(%rsp)
  movb   $0x0,0xd(%rsp)
  lea    0xc(%rsp),%rsi
  mov    %r9d,%ecx
  mov    %r8d,%edx
  call   <prints@plt>
  jmp    L99
L31:
  neg    %eax
  mov    %eax,%ecx
  mov    $0x1,%r13d
  jmp    L13
L56:
  mov    %eax,%ecx
  mov    %r14,%rdi
L20:
  mov    %ecx,%eax
  mov    $0x0,%edx
  div    %esi
  lea    (%rdx,%r9,1),%eax
  cmp    $0x9,%edx
  cmovle %edx,%eax
  lea    -0x1(%rdi),%r14
  add    $0x30,%eax
  mov    %al,-0x1(%rdi)
  mov    %ecx,%eax
  mov    $0x0,%edx
  div    %r8d
  cmp    %ecx,%esi
  jbe    L56
  test   %r13d,%r13d
  je     L15
  test   %ebx,%ebx
  je     L100
  test   $0x2,%bpl
  jne    L63
L100:
  movb   $0x2d,-0x1(%r14)
  lea    -0x2(%rdi),%r14
  mov    $0x0,%r13d
L15:
  mov    %ebp,%ecx
  mov    %ebx,%edx
  mov    %r14,%rsi
  mov    %r12,%rdi
  call   <prints@plt>
  add    %r13d,%eax
L99:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L22
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L63:
  mov    $0x2d,%esi
  mov    %r12,%rdi
  call   <printchar@plt>
  sub    $0x1,%ebx
  jmp    L15
L22:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int printi(char **out, int i, int b, int sg, int width, int pad, int letbase) {
  char print_buf[12];
  char *s;
  int t, neg = 0, pc = 0;
  unsigned u = (unsigned)i;
  if (i == 0) {
    print_buf[0] = '0';
    print_buf[1] = '\0';
    return prints(out, print_buf, width, pad);
  }
  if (sg && b == 10 && i < 0) {
    neg = 1;
    u = (unsigned)-i;
  }
  s = print_buf + 12 - 1;
  *s = '\0';
  while (u) {
    t = u % b;
    if (t >= 10)
      t += letbase - '0' - 10;
    *--s = t + '0';
    u /= b;
  }
  if (neg) {
    if (width && (pad & 2)) {
      printchar(out, '-');
      ++pc;
      --width;
    } else {
      *--s = '-';
    }
  }
  return pc + prints(out, s, width, pad);
}
```
user: What is the c source code of the assembly code below:

```asm
<printi>:
  endbr64
  push   %r14
  push   %r12
  mov    %r8d,%r12d
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  test   %esi,%esi
  je     L9
  mov    %edx,%edi
  test   %ecx,%ecx
  setne  %dl
  cmp    $0xa,%edi
  sete   %al
  test   %al,%dl
  je     L121
  test   %esi,%esi
  js     L82
L121:
  xor    %ebx,%ebx
L100:
  mov    0x60(%rsp),%eax
  movb   $0x0,0x27(%rsp)
  lea    0x27(%rsp),%r10
  lea    -0x3a(%rax),%r8d
  jmp    L24
  nopl   0x0(%rax,%rax,1)
L20:
  mov    %eax,%esi
  mov    %r14,%r10
L24:
  xor    %edx,%edx
  mov    %esi,%eax
  lea    -0x1(%r10),%r14
  div    %edi
  cmp    $0x9,%edx
  lea    (%rdx,%r8,1),%ecx
  cmovle %edx,%ecx
  add    $0x30,%ecx
  mov    %cl,-0x1(%r10)
  cmp    %esi,%edi
  jbe    L20
  test   %ebx,%ebx
  jne    L106
L17:
  mov    %r9d,%ecx
  mov    %r12d,%edx
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <prints@plt>
  add    %ebx,%eax
L58:
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L4
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r14
  ret
  nopw   0x0(%rax,%rax,1)
L106:
  test   %r12d,%r12d
  je     L45
  test   $0x2,%r9b
  je     L45
  mov    $0x2d,%esi
  mov    %rbp,%rdi
  mov    %r9d,0xc(%rsp)
  sub    $0x1,%r12d
  call   <printchar@plt>
  mov    0xc(%rsp),%r9d
  jmp    L17
  nopl   0x0(%rax,%rax,1)
L45:
  movb   $0x2d,-0x1(%r14)
  xor    %ebx,%ebx
  lea    -0x2(%r10),%r14
  jmp    L17
  nopl   (%rax)
L9:
  mov    $0x30,%eax
  lea    0x1c(%rsp),%rsi
  mov    %r9d,%ecx
  mov    %r8d,%edx
  mov    %ax,0x1c(%rsp)
  call   <prints@plt>
  jmp    L58
  nop
L82:
  neg    %esi
  mov    $0x1,%ebx
  jmp    L100
L4:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int printi(char **out, int i, int b, int sg, int width, int pad, int letbase) {
  char print_buf[12];
  char *s;
  int t, neg = 0, pc = 0;
  unsigned u = (unsigned)i;
  if (i == 0) {
    print_buf[0] = '0';
    print_buf[1] = '\0';
    return prints(out, print_buf, width, pad);
  }
  if (sg && b == 10 && i < 0) {
    neg = 1;
    u = (unsigned)-i;
  }
  s = print_buf + 12 - 1;
  *s = '\0';
  while (u) {
    t = u % b;
    if (t >= 10)
      t += letbase - '0' - 10;
    *--s = t + '0';
    u /= b;
  }
  if (neg) {
    if (width && (pad & 2)) {
      printchar(out, '-');
      ++pc;
      --width;
    } else {
      *--s = '-';
    }
  }
  return pc + prints(out, s, width, pad);
}
```