ylfeng/ReF-Decompile-dataset huggingface dataset:
user: What is the c source code of the assembly code below:

```asm
<imprimir>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r12
  mov    %esi,%ebp
  mov    $0x0,%ebx
L2:
  movslq %ebx,%rax
  mov    (%r12,%rax,8),%rdx
  mov    $0x0,%esi
  mov    %ebp,%edi
  call   <scrn_print@plt>
  add    $0x1,%ebx
  mov    %ebx,%eax
  sar    $0x1f,%eax
  shr    $0x1e,%eax
  add    %eax,%ebx
  and    $0x3,%ebx
  sub    %eax,%ebx
  jmp    L2
```

assistant: ```c
void imprimir(char *buf[], int row) {
  int i;
  for (i = 0; i < 4;) {
    scrn_print(row, 0, buf[i]);
    i = (i + 1) % 4;
  }
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<imprimir>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  xor    %ebx,%ebx
  nop
L2:
  movslq %ebx,%rax
  xor    %esi,%esi
  mov    %ebp,%edi
  add    $0x1,%ebx
  mov    (%r12,%rax,8),%rdx
  and    $0x3,%ebx
  call   <scrn_print@plt>
  jmp    L2
```

assistant: ```c
void imprimir(char *buf[], int row) {
  int i;
  for (i = 0; i < 4;) {
    scrn_print(row, 0, buf[i]);
    i = (i + 1) % 4;
  }
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<imprimir>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  xor    %ebx,%ebx
  nop
L7:
  movslq %ebx,%rax
  xor    %esi,%esi
  mov    %ebp,%edi
  add    $0x1,%ebx
  mov    (%r12,%rax,8),%rdx
  and    $0x3,%ebx
  call   <scrn_print@plt>
  jmp    L7
```

assistant: ```c
void imprimir(char *buf[], int row) {
  int i;
  for (i = 0; i < 4;) {
    scrn_print(row, 0, buf[i]);
    i = (i + 1) % 4;
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<get_s>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  lea    0xff(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x8,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  and    $0xf,%eax
  pop    %rbp
  ret
```

assistant: ```c
uint32_t get_s(int32_t value) {
  value = value / 256;
  return value & 0xf;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<get_s>:
  endbr64
  lea    0xff(%rdi),%eax
  test   %edi,%edi
  cmovns %edi,%eax
  sar    $0x8,%eax
  and    $0xf,%eax
  ret
```

assistant: ```c
uint32_t get_s(int32_t value) {
  value = value / 256;
  return value & 0xf;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<get_s>:
  endbr64
  test   %edi,%edi
  lea    0xff(%rdi),%eax
  cmovns %edi,%eax
  sar    $0x8,%eax
  and    $0xf,%eax
  ret
```

assistant: ```c
uint32_t get_s(int32_t value) {
  value = value / 256;
  return value & 0xf;
}
```
user: What is the c source code of the assembly code below:

```asm
<get_s>:
  endbr64
  test   %edi,%edi
  lea    0xff(%rdi),%eax
  cmovns %edi,%eax
  sar    $0x8,%eax
  and    $0xf,%eax
  ret
```

assistant: ```c
uint32_t get_s(int32_t value) {
  value = value / 256;
  return value & 0xf;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  movl   $0x4,-0xc(%rbp)
  movl   $0x5,-0x8(%rbp)
  movss  D5(%rip),%xmm0
  movss  %xmm0,-0x4(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0xc(%rbp),%xmm1
  movd   %xmm1,%eax
  mov    -0x8(%rbp),%edx
  mov    %edx,%esi
  movd   %eax,%xmm0
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  pxor   %xmm2,%xmm2
  cvtsi2ssl -0xc(%rbp),%xmm2
  movd   %xmm2,%eax
  movd   %eax,%xmm0
  lea    D21(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    -0x8(%rbp),%edx
  mov    -0x4(%rbp),%eax
  mov    %edx,%esi
  movd   %eax,%xmm0
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D5
type: byte[4]
name: extract_symbolic_data
arguments: tag: D12
type: string
name: extract_symbolic_data
arguments: tag: D21
type: string
name: extract_symbolic_data
arguments: tag: D24
type: string

tool: {"D5": [0x00,0x00,0xa0,0x40]}

tool: D12: %d


tool: D21: %d %d


tool: D24: %d %f


assistant: ```c
int main(void) {
  int f = 4;
  int g = 5;
  float h = 5.0f;
  printf("%d\n", f, g);
  printf("%d %d\n", f);
  printf("%d %f\n", h, g);
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x5,%esi
  movss  D14(%rip),%xmm0
  lea    D45(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  movss  D14(%rip),%xmm0
  lea    D8(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    $0x5,%esi
  movss  D17(%rip),%xmm0
  lea    D0(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: unpack_data
arguments: label: D14
datatype: byte[4]
name: unpack_data
arguments: label: D45
datatype: string
name: unpack_data
arguments: label: D8
datatype: string
name: unpack_data
arguments: label: D17
datatype: byte[4]
name: unpack_data
arguments: label: D0
datatype: string

tool: {"D14": [0x00,0x00,0x80,0x40]}

tool: D45: %d


tool: D8: %d %d


tool: {"D17": [0x00,0x00,0xa0,0x40]}

tool: D0: %d %f


assistant: ```c
int main(void) {
  int f = 4;
  int g = 5;
  float h = 5.0f;
  printf("%d\n", f, g);
  printf("%d %d\n", f);
  printf("%d %f\n", h, g);
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x5,%esi
  mov    $0x1,%eax
  movss  D53(%rip),%xmm0
  lea    D25(%rip),%rdi
  call   <printf@plt>
  movss  D53(%rip),%xmm0
  mov    $0x1,%eax
  lea    D11(%rip),%rdi
  call   <printf@plt>
  mov    $0x5,%esi
  mov    $0x1,%eax
  movss  D26(%rip),%xmm0
  lea    D38(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D53
datatype: byte[4]
name: extract_symbolic_data
arguments: data_tag: D25
datatype: string
name: extract_symbolic_data
arguments: data_tag: D11
datatype: string
name: extract_symbolic_data
arguments: data_tag: D26
datatype: byte[4]
name: extract_symbolic_data
arguments: data_tag: D38
datatype: string

tool: {"D53": [0x00,0x00,0x80,0x40]}

tool: D25: %d


tool: D11: %d %d


tool: {"D26": [0x00,0x00,0xa0,0x40]}

tool: D38: %d %f


assistant: ```c
int main(void) {
  int f = 4;
  int g = 5;
  float h = 5.0f;
  printf("%d\n", f, g);
  printf("%d %d\n", f);
  printf("%d %f\n", h, g);
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x5,%esi
  mov    $0x1,%eax
  movss  D20(%rip),%xmm0
  lea    D51(%rip),%rdi
  call   <printf@plt>
  movss  D20(%rip),%xmm0
  mov    $0x1,%eax
  lea    D23(%rip),%rdi
  call   <printf@plt>
  mov    $0x5,%esi
  mov    $0x1,%eax
  movss  D19(%rip),%xmm0
  lea    D56(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: read_data
arguments: label: D20
type_infered: byte[4]
name: read_data
arguments: label: D51
type_infered: string
name: read_data
arguments: label: D23
type_infered: string
name: read_data
arguments: label: D19
type_infered: byte[4]
name: read_data
arguments: label: D56
type_infered: string

tool: {"D20": [0x00,0x00,0x80,0x40]}

tool: D51: %d


tool: D23: %d %d


tool: {"D19": [0x00,0x00,0xa0,0x40]}

tool: D56: %d %f


assistant: ```c
int main(void) {
  int f = 4;
  int g = 5;
  float h = 5.0f;
  printf("%d\n", f, g);
  printf("%d %d\n", f);
  printf("%d %f\n", h, g);
  return 0;
}
```
user: What is the c source code of the assembly code below:

```asm
<_sprintf_string>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  jmp    L8
L12:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%edx
  mov    -0x8(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <sprintf_char@plt>
  mov    %rax,-0x8(%rbp)
L8:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L12
  mov    -0x8(%rbp),%rax
  leave
  ret
```

assistant: ```c
char *_sprintf_string(char *buffer, const char *str) {
  while (*str)
    buffer = sprintf_char(buffer, *str++);
  return buffer;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<_sprintf_string>:
  endbr64
  push   %rbx
  mov    %rsi,%rbx
  movzbl (%rsi),%esi
  test   %sil,%sil
  je     L6
L18:
  add    $0x1,%rbx
  movsbl %sil,%esi
  call   <sprintf_char@plt>
  mov    %rax,%rdi
  movzbl (%rbx),%esi
  test   %sil,%sil
  jne    L18
L6:
  mov    %rdi,%rax
  pop    %rbx
  ret
```

assistant: ```c
char *_sprintf_string(char *buffer, const char *str) {
  while (*str)
    buffer = sprintf_char(buffer, *str++);
  return buffer;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<_sprintf_string>:
  endbr64
  push   %rbx
  mov    %rsi,%rbx
  movsbl (%rsi),%esi
  test   %sil,%sil
  je     L2
L16:
  call   <sprintf_char@plt>
  movsbl 0x1(%rbx),%esi
  add    $0x1,%rbx
  mov    %rax,%rdi
  test   %sil,%sil
  jne    L16
L2:
  mov    %rdi,%rax
  pop    %rbx
  ret
```

assistant: ```c
char *_sprintf_string(char *buffer, const char *str) {
  while (*str)
    buffer = sprintf_char(buffer, *str++);
  return buffer;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<_sprintf_string>:
  endbr64
  push   %rbx
  mov    %rsi,%rbx
  movsbl (%rsi),%esi
  test   %sil,%sil
  je     L6
L18:
  call   <sprintf_char@plt>
  movsbl 0x1(%rbx),%esi
  add    $0x1,%rbx
  mov    %rax,%rdi
  test   %sil,%sil
  jne    L18
L6:
  mov    %rdi,%rax
  pop    %rbx
  ret
```

assistant: ```c
char *_sprintf_string(char *buffer, const char *str) {
  while (*str)
    buffer = sprintf_char(buffer, *str++);
  return buffer;
}
```
user: What is the c source code of the assembly code below?

```asm
<output>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x0,-0x8(%rbp)
  jmp    L31
L39:
  movl   $0x0,-0x4(%rbp)
  jmp    L12
L18:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  mov    %rax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  mov    %eax,%esi
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x1,-0x4(%rbp)
L12:
  mov    -0x4(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jl     L18
  mov    $0xa,%edi
  call   <putchar@plt>
  addl   $0x1,-0x8(%rbp)
L31:
  mov    -0x8(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L39
  nop
  nop
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D15
data_type: string
name: disassemble_data
arguments: data_label: D9
data_type: string

tool: D15: 
 Output 

tool: D9: %d

assistant: ```c
void output(int y[5][5], int m, int n) {
  int i, j;
  printf("\n Output \n");
  for (i = 0; i < m; i++) {
    for (j = 0; j < n; j++) {
      printf("%d", y[i][j]);
    }
    printf("\n");
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<output>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r12
  mov    %esi,%ebx
  mov    %edx,%r14d
  lea    D9(%rip),%rdi
  call   <puts@plt>
  test   %ebx,%ebx
  jle    L13
  lea    -0x1(%r14),%r13d
  lea    0x4(%r12,%r13,4),%rbp
  lea    -0x1(%rbx),%eax
  lea    (%rax,%rax,4),%rax
  add    %r13,%rax
  lea    0x18(%r12,%rax,4),%r15
  not    %r13
  shl    $0x2,%r13
  lea    D1(%rip),%r12
  jmp    L20
L59:
  mov    (%rbx),%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x4,%rbx
  cmp    %rbp,%rbx
  jne    L59
L6:
  mov    $0xa,%edi
  call   <putchar@plt>
  add    $0x14,%rbp
  cmp    %r15,%rbp
  je     L13
L20:
  lea    0x0(%r13,%rbp,1),%rbx
  test   %r14d,%r14d
  jg     L59
  jmp    L6
L13:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: unpack_data
arguments: label: D9
type: string
name: unpack_data
arguments: label: D1
type: string

tool: D9: 
 Output 

tool: D1: %d

assistant: ```c
void output(int y[5][5], int m, int n) {
  int i, j;
  printf("\n Output \n");
  for (i = 0; i < m; i++) {
    for (j = 0; j < n; j++) {
      printf("%d", y[i][j]);
    }
    printf("\n");
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<output>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %edx,%r13d
  push   %r12
  mov    %rdi,%r12
  lea    D0(%rip),%rdi
  push   %rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x8,%rsp
  call   <puts@plt>
  test   %ebx,%ebx
  jle    L1
  lea    -0x1(%rbx),%eax
  lea    -0x1(%r13),%ecx
  mov    $0xfffffffffffffffc,%r14
  lea    (%rax,%rax,4),%rax
  lea    0x0(,%rcx,4),%rdx
  add    %rcx,%rax
  lea    0x4(%r12,%rdx,1),%rbp
  sub    %rdx,%r14
  lea    0x18(%r12,%rax,4),%r15
  lea    D4(%rip),%r12
  nopl   0x0(%rax,%rax,1)
L32:
  lea    (%r14,%rbp,1),%rbx
  test   %r13d,%r13d
  jle    L6
  nopl   0x0(%rax)
L10:
  mov    (%rbx),%esi
  mov    %r12,%rdi
  xor    %eax,%eax
  add    $0x4,%rbx
  call   <printf@plt>
  cmp    %rbp,%rbx
  jne    L10
L6:
  mov    $0xa,%edi
  add    $0x14,%rbp
  call   <putchar@plt>
  cmp    %r15,%rbp
  jne    L32
L1:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

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

tool: D0: 
 Output 

tool: D4: %d

assistant: ```c
void output(int y[5][5], int m, int n) {
  int i, j;
  printf("\n Output \n");
  for (i = 0; i < m; i++) {
    for (j = 0; j < n; j++) {
      printf("%d", y[i][j]);
    }
    printf("\n");
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<output>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  lea    D1(%rip),%rdi
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  sub    $0x18,%rsp
  call   <puts@plt>
  test   %r12d,%r12d
  jle    L94
  lea    -0x1(%r12),%eax
  lea    0x18(%r13),%rbx
  lea    (%rax,%rax,4),%rax
  lea    D10(%rip),%r12
  lea    0x2c(%r13,%rax,4),%r13
  lea    -0x7(%rbp),%eax
  lea    0x4(,%rax,4),%rax
  mov    %rax,0x8(%rsp)
  nopl   0x0(%rax,%rax,1)
L85:
  test   %ebp,%ebp
  jle    L3
  mov    -0x18(%rbx),%esi
  xor    %eax,%eax
  mov    %r12,%rdi
  call   <printf@plt>
  cmp    $0x1,%ebp
  je     L3
  mov    -0x14(%rbx),%esi
  xor    %eax,%eax
  mov    %r12,%rdi
  call   <printf@plt>
  cmp    $0x2,%ebp
  je     L3
  mov    -0x10(%rbx),%esi
  xor    %eax,%eax
  mov    %r12,%rdi
  call   <printf@plt>
  cmp    $0x3,%ebp
  je     L3
  mov    -0xc(%rbx),%esi
  xor    %eax,%eax
  mov    %r12,%rdi
  call   <printf@plt>
  cmp    $0x4,%ebp
  je     L3
  mov    -0x8(%rbx),%esi
  xor    %eax,%eax
  mov    %r12,%rdi
  call   <printf@plt>
  cmp    $0x5,%ebp
  je     L3
  mov    -0x4(%rbx),%esi
  xor    %eax,%eax
  mov    %r12,%rdi
  call   <printf@plt>
  cmp    $0x6,%ebp
  je     L3
  mov    0x8(%rsp),%rax
  mov    %rbx,%r14
  lea    (%rax,%rbx,1),%r15
L57:
  mov    (%r14),%esi
  mov    %r12,%rdi
  xor    %eax,%eax
  add    $0x4,%r14
  call   <printf@plt>
  cmp    %r15,%r14
  jne    L57
  nopw   0x0(%rax,%rax,1)
L3:
  mov    $0xa,%edi
  add    $0x14,%rbx
  call   <putchar@plt>
  cmp    %r13,%rbx
  jne    L85
L94:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: read_data
arguments: tag: D1
type_guessed: string
name: read_data
arguments: tag: D10
type_guessed: string

tool: D1: 
 Output 

tool: D10: %d

assistant: ```c
void output(int y[5][5], int m, int n) {
  int i, j;
  printf("\n Output \n");
  for (i = 0; i < m; i++) {
    for (j = 0; j < n; j++) {
      printf("%d", y[i][j]);
    }
    printf("\n");
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<compress_data>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  mov    %edi,-0x54(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %rdx,-0x68(%rbp)
  mov    %rcx,-0x70(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpl   $0x0,-0x54(%rbp)
  jne    L28
  mov    -0x70(%rbp),%rax
  mov    -0x68(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    $0x0,%eax
  jmp    L11
L28:
  mov    -0x68(%rbp),%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x48(%rbp)
  cmpq   $0x0,-0x48(%rbp)
  jne    L16
  mov    D50(%rip),%rax
  mov    (%rax),%eax
  jmp    L11
L16:
  mov    D25(%rip),%rax
  mov    (%rax),%rax
  mov    %rax,-0x10(%rbp)
  mov    D25(%rip),%rax
  mov    (%rax),%rax
  mov    %rax,-0x18(%rbp)
  movq   $0x0,-0x20(%rbp)
  mov    -0x54(%rbp),%edx
  lea    -0x40(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <deflateInit@plt>
  mov    %eax,-0x4c(%rbp)
  mov    D19(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4c(%rbp)
  je     L50
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    D4(%rip),%rax
  mov    (%rax),%eax
  jmp    L11
L50:
  mov    -0x60(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x40(%rbp)
  mov    -0x68(%rbp),%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x68(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  mov    D47(%rip),%rax
  mov    (%rax),%edx
  lea    -0x40(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <deflate@plt>
  lea    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <deflateEnd@plt>
  mov    -0x60(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x60(%rbp),%rax
  mov    -0x48(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    -0x28(%rbp),%rcx
  mov    -0x68(%rbp),%rax
  sub    %rcx,%rax
  mov    %rax,%rdx
  mov    -0x70(%rbp),%rax
  mov    %rdx,(%rax)
  mov    $0x0,%eax
L11:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L44
  call   <__stack_chk_fail@plt>
L44:
  leave
  ret
```

assistant: ```c
int compress_data(const int level, unsigned char **pdata, const size_t size, size_t *newsize) {
  z_stream sout;
  Bytef *buffer;
  int rc;
  if (level == 0) {
    *newsize = size;
    return 0;
  }
  buffer = malloc(size);
  if (buffer == NULL)
    return ENOMEM;
  sout.zalloc = Z_NULL;
  sout.zfree = Z_NULL;
  sout.opaque = NULL;
  rc = deflateInit(&sout, level);
  if (rc != Z_OK) {
    free(buffer);
    return EINVAL;
  }
  sout.next_in = (Bytef *)*pdata;
  sout.avail_in = size;
  sout.next_out = buffer;
  sout.avail_out = size;
  deflate(&sout, Z_FINISH);
  deflateEnd(&sout);
  free(*pdata);
  *pdata = (unsigned char *)buffer;
  *newsize = size - sout.avail_out;
  return 0;
}
```
user: What is the c source code of the assembly code below?

```asm
<compress_data>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x40,%rsp
  mov    %edi,%ebx
  mov    %rdx,%rbp
  mov    %rcx,%r13
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  test   %edi,%edi
  jne    L62
  mov    %rdx,0x0(%r13)
  mov    %edi,%eax
L19:
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L14
  add    $0x40,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L62:
  mov    %rsi,%r14
  mov    %rdx,%rdi
  call   <malloc@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L1
  mov    D23(%rip),%rax
  mov    (%rax),%rax
  mov    %rax,0x30(%rsp)
  mov    %rax,0x28(%rsp)
  movq   $0x0,0x20(%rsp)
  mov    %rsp,%rdi
  mov    %ebx,%esi
  call   <deflateInit@plt>
  mov    D32(%rip),%rdx
  cmp    %eax,(%rdx)
  je     L48
  mov    %r12,%rdi
  call   <free@plt>
  mov    D46(%rip),%rax
  mov    (%rax),%eax
  jmp    L19
L1:
  mov    D11(%rip),%rax
  mov    (%rax),%eax
  jmp    L19
L48:
  mov    (%r14),%rax
  mov    %rax,(%rsp)
  mov    %rbp,0x8(%rsp)
  mov    %r12,0x10(%rsp)
  mov    %rbp,0x18(%rsp)
  mov    %rsp,%rbx
  mov    D40(%rip),%rax
  mov    (%rax),%esi
  mov    %rbx,%rdi
  call   <deflate@plt>
  mov    %rbx,%rdi
  call   <deflateEnd@plt>
  mov    (%r14),%rdi
  call   <free@plt>
  mov    %r12,(%r14)
  sub    0x18(%rsp),%rbp
  mov    %rbp,0x0(%r13)
  mov    $0x0,%eax
  jmp    L19
L14:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int compress_data(const int level, unsigned char **pdata, const size_t size, size_t *newsize) {
  z_stream sout;
  Bytef *buffer;
  int rc;
  if (level == 0) {
    *newsize = size;
    return 0;
  }
  buffer = malloc(size);
  if (buffer == NULL)
    return ENOMEM;
  sout.zalloc = Z_NULL;
  sout.zfree = Z_NULL;
  sout.opaque = NULL;
  rc = deflateInit(&sout, level);
  if (rc != Z_OK) {
    free(buffer);
    return EINVAL;
  }
  sout.next_in = (Bytef *)*pdata;
  sout.avail_in = size;
  sout.next_out = buffer;
  sout.avail_out = size;
  deflate(&sout, Z_FINISH);
  deflateEnd(&sout);
  free(*pdata);
  *pdata = (unsigned char *)buffer;
  *newsize = size - sout.avail_out;
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<compress_data>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rcx,%r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  test   %edi,%edi
  jne    L42
  mov    %rdx,0x0(%r13)
L8:
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L31
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L42:
  mov    %edi,%r14d
  mov    %rdx,%rdi
  mov    %rsi,%r12
  call   <malloc@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L29
  mov    D34(%rip),%rax
  mov    %rsp,%r15
  mov    %r14d,%esi
  movq   $0x0,0x20(%rsp)
  mov    %r15,%rdi
  mov    (%rax),%rax
  mov    %rax,0x30(%rsp)
  mov    %rax,0x28(%rsp)
  call   <deflateInit@plt>
  mov    D17(%rip),%rdx
  cmp    %eax,(%rdx)
  je     L26
  mov    %rbp,%rdi
  call   <free@plt>
  mov    D29(%rip),%rax
  mov    (%rax),%eax
  jmp    L8
  xchg   %ax,%ax
L26:
  mov    (%r12),%rax
  mov    %r15,%rdi
  mov    %rbx,0x8(%rsp)
  mov    %rbx,0x18(%rsp)
  mov    %rax,(%rsp)
  mov    D32(%rip),%rax
  mov    %rbp,0x10(%rsp)
  mov    (%rax),%esi
  call   <deflate@plt>
  mov    %r15,%rdi
  call   <deflateEnd@plt>
  mov    (%r12),%rdi
  call   <free@plt>
  sub    0x18(%rsp),%rbx
  mov    %rbp,(%r12)
  xor    %eax,%eax
  mov    %rbx,0x0(%r13)
  jmp    L8
L31:
  call   <__stack_chk_fail@plt>
L29:
  mov    D24(%rip),%rax
  mov    (%rax),%eax
  jmp    L8
```

assistant: ```c
int compress_data(const int level, unsigned char **pdata, const size_t size, size_t *newsize) {
  z_stream sout;
  Bytef *buffer;
  int rc;
  if (level == 0) {
    *newsize = size;
    return 0;
  }
  buffer = malloc(size);
  if (buffer == NULL)
    return ENOMEM;
  sout.zalloc = Z_NULL;
  sout.zfree = Z_NULL;
  sout.opaque = NULL;
  rc = deflateInit(&sout, level);
  if (rc != Z_OK) {
    free(buffer);
    return EINVAL;
  }
  sout.next_in = (Bytef *)*pdata;
  sout.avail_in = size;
  sout.next_out = buffer;
  sout.avail_out = size;
  deflate(&sout, Z_FINISH);
  deflateEnd(&sout);
  free(*pdata);
  *pdata = (unsigned char *)buffer;
  *newsize = size - sout.avail_out;
  return 0;
}
```