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

```asm
<dts_decode_header>:
  endbr64
  mov    %rdi,%rax
  mov    %rsi,%rdi
  mov    %rdx,%rsi
  mov    0x4(%rax),%ecx
  mov    (%rax),%edx
  shl    $0x10,%ecx
  shl    $0x18,%edx
  or     %ecx,%edx
  mov    0x8(%rax),%ecx
  or     0xc(%rax),%edx
  shl    $0x8,%ecx
  or     %ecx,%edx
  cmp    $0x7ffe8001,%edx
  jne    L53
  mov    0x10(%rax),%r8d
  mov    0x14(%rax),%ecx
  mov    %r8d,%edx
  sar    $0x2,%ecx
  shl    $0x6,%edx
  sar    $0x7,%r8d
  and    $0x40,%edx
  or     %ecx,%edx
  add    $0x1,%edx
  mov    %edx,(%rsi)
  mov    0x18(%rax),%edx
  mov    0x1c(%rax),%ecx
  shl    $0x4,%edx
  sar    $0x4,%ecx
  or     %ecx,%edx
  mov    0x14(%rax),%ecx
  shl    $0xc,%ecx
  and    $0x3000,%ecx
  or     %ecx,%edx
  mov    0x20(%rax),%ecx
  mov    0x24(%rax),%eax
  lea    0x1(%rdx),%r9d
  shl    $0x3,%ecx
  sar    $0x5,%eax
  and    $0x18,%ecx
  and    $0x7,%eax
  or     %ecx,%eax
  mov    %eax,(%rdi)
  cmp    $0x1,%r8d
  jne    L53
  sub    $0x5f,%edx
  cmp    $0x1fa0,%edx
  ja     L53
  mov    (%rsi),%eax
  lea    -0x8(%rax),%edx
  and    $0xfffffff7,%edx
  lea    -0x20(%rax),%edx
  setne  %cl
  and    $0xffffffdf,%edx
  setne  %dl
  test   %dl,%cl
  je     L10
  cmp    $0x80,%eax
  jne    L53
L10:
  mov    %r9d,%eax
  ret
  nopl   0x0(%rax)
L53:
  mov    $0xffffffff,%r9d
  jmp    L10
```

assistant: ```c
int dts_decode_header(const uint8_t *src, int *rate, int *nblks) {
  int ftype, fsize;
  uint32_t sync;
  sync = (src[0] << 24) | (src[1] << 16) | (src[2] << 8) | src[3];
  if (sync != 0x7ffe8001)
    return -1;
  ftype = src[4] >> 7;
  *nblks = ((src[4] & 0x01) << 6 | (src[5] >> 2)) + 1;
  fsize = ((src[5] & 0x03) << 12 | (src[6] << 4) | (src[7] >> 4)) + 1;
  *rate = (src[8] & 0x03) << 3 | ((src[9] >> 5) & 0x07);
  if (ftype != 1 || fsize > 8192 || fsize < 96)
    return -1;
  if (*nblks != 8 && *nblks != 16 && *nblks != 32 && *nblks != 64 && *nblks != 128 && ftype == 1)
    return -1;
  return fsize;
}
```
user: Translate the below assembly code into C programming language:

```asm
<squot_check>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  add    $0x14,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L57
  mov    -0x8(%rbp),%rax
  add    $0xc,%rax
  mov    (%rax),%eax
  cmp    $0x27,%eax
  jne    L57
  mov    -0x10(%rbp),%rax
  add    $0x14,%rax
  movl   $0x1,(%rax)
  jmp    L18
L57:
  mov    -0x10(%rbp),%rax
  add    $0x14,%rax
  mov    (%rax),%eax
  cmp    $0x1,%eax
  jne    L18
  mov    -0x8(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0x27,%eax
  jne    L33
  mov    -0x8(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  cmp    $0x5c,%eax
  je     L107
L33:
  mov    -0x8(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  cmp    $0x27,%eax
  jne    L83
  mov    -0x8(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%eax
  cmp    $0x27,%eax
  je     L83
  mov    -0x8(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%eax
  cmp    $0x5c,%eax
  jne    L107
L83:
  mov    -0x8(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  cmp    $0x27,%eax
  je     L18
  mov    -0x8(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%eax
  cmp    $0x27,%eax
  jne    L18
L107:
  mov    -0x8(%rbp),%rax
  add    $0xc,%rax
  mov    (%rax),%eax
  cmp    $0x27,%eax
  jne    L18
  mov    -0x10(%rbp),%rax
  add    $0x14,%rax
  movl   $0x0,(%rax)
L18:
  nop
  pop    %rbp
  ret
```

assistant: ```c
void squot_check(int cquad[], int pnctn_sts[]) {
  if (pnctn_sts[5] == 0 && cquad[3] == '\'') {
    pnctn_sts[5] = 1;
  } else if (pnctn_sts[5] == 1 && ((cquad[0] == '\'' && cquad[1] == '\\') || (cquad[1] == '\'' && cquad[2] != '\'' && cquad[2] != '\\') || (cquad[1] != '\'' && cquad[2] == '\'')) && cquad[3] == '\'') {
    pnctn_sts[5] = 0;
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<squot_check>:
  endbr64
  mov    0x14(%rsi),%eax
  test   %eax,%eax
  jne    L23
  cmpl   $0x27,0xc(%rdi)
  je     L109
L42:
  ret
L109:
  movl   $0x1,0x14(%rsi)
  ret
L23:
  cmp    $0x1,%eax
  jne    L42
  cmpl   $0x27,(%rdi)
  je     L21
L62:
  cmpl   $0x27,0x4(%rdi)
  je     L25
  cmpl   $0x27,0x8(%rdi)
  jne    L42
L8:
  cmpl   $0x27,0xc(%rdi)
  jne    L42
  movl   $0x0,0x14(%rsi)
  jmp    L42
L21:
  cmpl   $0x5c,0x4(%rdi)
  jne    L62
  jmp    L8
L25:
  mov    0x8(%rdi),%eax
  cmp    $0x5c,%eax
  je     L42
  cmp    $0x27,%eax
  jne    L8
  ret
```

assistant: ```c
void squot_check(int cquad[], int pnctn_sts[]) {
  if (pnctn_sts[5] == 0 && cquad[3] == '\'') {
    pnctn_sts[5] = 1;
  } else if (pnctn_sts[5] == 1 && ((cquad[0] == '\'' && cquad[1] == '\\') || (cquad[1] == '\'' && cquad[2] != '\'' && cquad[2] != '\\') || (cquad[1] != '\'' && cquad[2] == '\'')) && cquad[3] == '\'') {
    pnctn_sts[5] = 0;
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<squot_check>:
  endbr64
  mov    0x14(%rsi),%eax
  test   %eax,%eax
  jne    L23
  cmpl   $0x27,0xc(%rdi)
  je     L48
L5:
  ret
  nopw   0x0(%rax,%rax,1)
L23:
  cmp    $0x1,%eax
  jne    L5
  cmpl   $0x27,(%rdi)
  mov    0x4(%rdi),%eax
  je     L31
L49:
  mov    0x8(%rdi),%edx
  cmp    $0x27,%eax
  je     L29
  cmp    $0x27,%edx
  jne    L5
L60:
  cmpl   $0x27,0xc(%rdi)
  jne    L5
  movl   $0x0,0x14(%rsi)
  ret
L48:
  movl   $0x1,0x14(%rsi)
  ret
  nopl   0x0(%rax,%rax,1)
L31:
  cmp    $0x5c,%eax
  jne    L49
  jmp    L60
  nopw   0x0(%rax,%rax,1)
L29:
  cmp    $0x5c,%edx
  je     L5
  cmp    $0x27,%edx
  jne    L60
  ret
```

assistant: ```c
void squot_check(int cquad[], int pnctn_sts[]) {
  if (pnctn_sts[5] == 0 && cquad[3] == '\'') {
    pnctn_sts[5] = 1;
  } else if (pnctn_sts[5] == 1 && ((cquad[0] == '\'' && cquad[1] == '\\') || (cquad[1] == '\'' && cquad[2] != '\'' && cquad[2] != '\\') || (cquad[1] != '\'' && cquad[2] == '\'')) && cquad[3] == '\'') {
    pnctn_sts[5] = 0;
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<squot_check>:
  endbr64
  mov    0x14(%rsi),%eax
  test   %eax,%eax
  jne    L16
  cmpl   $0x27,0xc(%rdi)
  je     L7
L51:
  ret
  nopw   0x0(%rax,%rax,1)
L16:
  cmp    $0x1,%eax
  jne    L51
  cmpl   $0x27,(%rdi)
  mov    0x4(%rdi),%eax
  je     L108
L67:
  mov    0x8(%rdi),%edx
  cmp    $0x27,%eax
  je     L91
  cmp    $0x27,%edx
  jne    L51
L49:
  cmpl   $0x27,0xc(%rdi)
  jne    L51
  movl   $0x0,0x14(%rsi)
  ret
L7:
  movl   $0x1,0x14(%rsi)
  ret
  nopl   0x0(%rax,%rax,1)
L108:
  cmp    $0x5c,%eax
  jne    L67
  jmp    L49
  nopw   0x0(%rax,%rax,1)
L91:
  cmp    $0x5c,%edx
  je     L51
  cmp    $0x27,%edx
  jne    L49
  ret
```

assistant: ```c
void squot_check(int cquad[], int pnctn_sts[]) {
  if (pnctn_sts[5] == 0 && cquad[3] == '\'') {
    pnctn_sts[5] = 1;
  } else if (pnctn_sts[5] == 1 && ((cquad[0] == '\'' && cquad[1] == '\\') || (cquad[1] == '\'' && cquad[2] != '\'' && cquad[2] != '\\') || (cquad[1] != '\'' && cquad[2] == '\'')) && cquad[3] == '\'') {
    pnctn_sts[5] = 0;
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<fig05_11>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  movl   $0x1,-0x4(%rbp)
  jmp    L21
L8:
  mov    $0x0,%eax
  call   <rand@plt>
  mov    %eax,%edx
  movslq %edx,%rax
  imul   $0x2aaaaaab,%rax,%rax
  shr    $0x20,%rax
  mov    %edx,%esi
  sar    $0x1f,%esi
  mov    %eax,%ecx
  sub    %esi,%ecx
  mov    %ecx,%eax
  add    %eax,%eax
  add    %ecx,%eax
  add    %eax,%eax
  sub    %eax,%edx
  mov    %edx,%ecx
  lea    0x1(%rcx),%eax
  mov    %eax,%esi
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x4(%rbp),%ecx
  mov    %ecx,%edx
  mov    $0xcccccccd,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  shr    $0x2,%eax
  mov    %eax,%edx
  shl    $0x2,%edx
  add    %eax,%edx
  mov    %ecx,%eax
  sub    %edx,%eax
  test   %eax,%eax
  jne    L4
  lea    D5(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L4:
  addl   $0x1,-0x4(%rbp)
L21:
  cmpl   $0x14,-0x4(%rbp)
  jbe    L8
  nop
  nop
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D13
data_type: string
name: disassemble_data
arguments: tag: D5
data_type: string

tool: D13: %10d

tool: 

assistant: ```c
void fig05_11() {
  unsigned int i;
  for (i = 1; i <= 20; ++i) {
    printf("%10d", 1 + (rand() % 6));
    if (i % 5 == 0) {
      puts("");
    }
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<fig05_11>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    $0x0,%eax
  call   <rand@plt>
  movslq %eax,%rdx
  imul   $0x2aaaaaab,%rdx,%rdx
  shr    $0x20,%rdx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  lea    (%rdx,%rdx,2),%edx
  add    %edx,%edx
  sub    %edx,%eax
  lea    0x1(%rax),%esi
  lea    D26(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%ebx
  lea    D26(%rip),%r12
  mov    $0xcccccccd,%ebp
  lea    D24(%rip),%r13
  jmp    L31
L8:
  mov    %r13,%rdi
  call   <puts@plt>
L31:
  add    $0x1,%ebx
  cmp    $0x15,%ebx
  je     L24
  mov    $0x0,%eax
  call   <rand@plt>
  movslq %eax,%rdx
  imul   $0x2aaaaaab,%rdx,%rdx
  shr    $0x20,%rdx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  lea    (%rdx,%rdx,2),%edx
  add    %edx,%edx
  sub    %edx,%eax
  lea    0x1(%rax),%esi
  mov    %r12,%rdi
  call   <printf@plt>
  mov    %ebx,%eax
  imul   %rbp,%rax
  shr    $0x22,%rax
  lea    (%rax,%rax,4),%eax
  cmp    %eax,%ebx
  jne    L31
  jmp    L8
L24:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D26
datatype: string
name: unpack_data
arguments: data_label: D24
datatype: string

tool: D26: %10d

tool: 

assistant: ```c
void fig05_11() {
  unsigned int i;
  for (i = 1; i <= 20; ++i) {
    printf("%10d", 1 + (rand() % 6));
    if (i % 5 == 0) {
      puts("");
    }
  }
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<fig05_11>:
  endbr64
  push   %r12
  xor    %eax,%eax
  mov    $0x1,%r12d
  push   %rbp
  lea    D1(%rip),%rbp
  push   %rbx
  lea    D15(%rip),%rbx
  call   <rand@plt>
  mov    %rbx,%rdi
  movslq %eax,%rdx
  mov    %eax,%ecx
  imul   $0x2aaaaaab,%rdx,%rdx
  sar    $0x1f,%ecx
  shr    $0x20,%rdx
  sub    %ecx,%edx
  lea    (%rdx,%rdx,2),%edx
  add    %edx,%edx
  sub    %edx,%eax
  lea    0x1(%rax),%esi
  call   <printf@plt>
  nopw   0x0(%rax,%rax,1)
L19:
  add    $0x1,%r12d
  cmp    $0x15,%r12d
  je     L0
L7:
  xor    %eax,%eax
  call   <rand@plt>
  mov    %rbx,%rdi
  movslq %eax,%rdx
  mov    %eax,%ecx
  imul   $0x2aaaaaab,%rdx,%rdx
  sar    $0x1f,%ecx
  shr    $0x20,%rdx
  sub    %ecx,%edx
  lea    (%rdx,%rdx,2),%edx
  add    %edx,%edx
  sub    %edx,%eax
  lea    0x1(%rax),%esi
  call   <printf@plt>
  imul   $0xcccccccd,%r12d,%eax
  cmp    $0x33333333,%eax
  ja     L19
  mov    %rbp,%rdi
  add    $0x1,%r12d
  call   <puts@plt>
  cmp    $0x15,%r12d
  jne    L7
L0:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D1
data_type: string
name: retrieve_data
arguments: tag: D15
data_type: string

tool: 

tool: D15: %10d

assistant: ```c
void fig05_11() {
  unsigned int i;
  for (i = 1; i <= 20; ++i) {
    printf("%10d", 1 + (rand() % 6));
    if (i % 5 == 0) {
      puts("");
    }
  }
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<fig05_11>:
  endbr64
  push   %r12
  xor    %eax,%eax
  mov    $0x2,%r12d
  push   %rbp
  lea    D4(%rip),%rbp
  push   %rbx
  lea    D2(%rip),%rbx
  call   <rand@plt>
  mov    %rbx,%rdi
  movslq %eax,%rdx
  mov    %eax,%ecx
  imul   $0x2aaaaaab,%rdx,%rdx
  sar    $0x1f,%ecx
  shr    $0x20,%rdx
  sub    %ecx,%edx
  lea    (%rdx,%rdx,2),%edx
  add    %edx,%edx
  sub    %edx,%eax
  lea    0x1(%rax),%esi
  call   <printf@plt>
  nopw   0x0(%rax,%rax,1)
L11:
  xor    %eax,%eax
  call   <rand@plt>
  mov    %rbx,%rdi
  movslq %eax,%rdx
  mov    %eax,%ecx
  imul   $0x2aaaaaab,%rdx,%rdx
  sar    $0x1f,%ecx
  shr    $0x20,%rdx
  sub    %ecx,%edx
  lea    (%rdx,%rdx,2),%edx
  add    %edx,%edx
  sub    %edx,%eax
  lea    0x1(%rax),%esi
  call   <printf@plt>
  imul   $0xcccccccd,%r12d,%eax
  cmp    $0x33333333,%eax
  ja     L17
  mov    %rbp,%rdi
  call   <puts@plt>
L17:
  add    $0x1,%r12d
  cmp    $0x15,%r12d
  jne    L11
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D4
type_guessed: string
name: retrieve_data
arguments: data_label: D2
type_guessed: string

tool: 

tool: D2: %10d

assistant: ```c
void fig05_11() {
  unsigned int i;
  for (i = 1; i <= 20; ++i) {
    printf("%10d", 1 + (rand() % 6));
    if (i % 5 == 0) {
      puts("");
    }
  }
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x130,%rsp
  mov    %edi,-0x124(%rbp)
  mov    %rsi,-0x130(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x118(%rbp)
  lea    -0x110(%rbp),%rax
  lea    D22(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  lea    -0x110(%rbp),%rax
  lea    D14(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  jmp    L105
L12:
  lea    -0x110(%rbp),%rax
  lea    D41(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  mov    -0x118(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x130(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  lea    -0x110(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
L105:
  mov    -0x118(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x118(%rbp)
  mov    -0x124(%rbp),%edx
  sub    $0x1,%edx
  cmp    %edx,%eax
  jl     L12
  lea    -0x110(%rbp),%rax
  mov    %rax,%rdi
  call   <system@plt>
  mov    %eax,-0x114(%rbp)
  jmp    L52
L100:
  mov    $0x3e8,%edi
  call   <sleep_ms@plt>
  cmpl   $0x1,-0x114(%rbp)
  je     L96
  cmpl   $0x100,-0x114(%rbp)
  jne    L13
L96:
  lea    D28(%rip),%rax
  mov    %rax,%rdi
  call   <system@plt>
  lea    D22(%rip),%rax
  mov    %rax,%rdi
  call   <system@plt>
  mov    %eax,-0x114(%rbp)
L13:
  mov    $0x3e8,%edi
  call   <sleep_ms@plt>
  cmpl   $0x2,-0x114(%rbp)
  je     L85
  cmpl   $0x200,-0x114(%rbp)
  jne    L52
L85:
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <system@plt>
  mov    %eax,-0x114(%rbp)
L52:
  cmpl   $0x1,-0x114(%rbp)
  je     L100
  cmpl   $0x2,-0x114(%rbp)
  je     L100
  cmpl   $0x100,-0x114(%rbp)
  je     L100
  cmpl   $0x200,-0x114(%rbp)
  je     L100
  mov    -0x114(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L23
  call   <__stack_chk_fail@plt>
L23:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D22
type_infered: string
name: extract_symbolic_data
arguments: label: D14
type_infered: string
name: extract_symbolic_data
arguments: label: D41
type_infered: string
name: extract_symbolic_data
arguments: label: D28
type_infered: string
name: extract_symbolic_data
arguments: label: D17
type_infered: string

tool: D22: system/div

tool: D14:  INIT

tool: D41:  

tool: D28: system/divdbg system/EXEC.EXE

tool: D17: system/div TEST

assistant: ```c
int main(int argc, char *argv[]) {
  int a = 0;
  char init[255];
  strcpy(init, "system/"
               "div");
  strcat(init, " INIT");
  while (a++ < argc - 1) {
    strcat(init, " ");
    strcat(init, argv[a]);
  }
  int ret = system(init);
  while (ret == 1 || ret == 2 || ret == 256 || ret == 512) {
    sleep_ms(1000);
    if (ret == 1 || ret == 256) {
      system("system/"
             "divdbg"
             " system/EXEC.EXE");
      ret = system("system/"
                   "div");
    }
    sleep_ms(1000);
    if (ret == 2 || ret == 512) {
      ret = system("system/"
                   "div"
                   " TEST");
    }
  }
  return ret;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x110,%rsp
  mov    %edi,%ebp
  mov    %rsi,%r12
  mov    %fs:0x28,%rax
  mov    %rax,0x108(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbx
  lea    D24(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  lea    D32(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcat@plt>
  cmp    $0x1,%ebp
  jle    L14
  lea    0x8(%r12),%rbx
  lea    -0x2(%rbp),%eax
  lea    0x10(%r12,%rax,8),%r13
  lea    D19(%rip),%r12
L15:
  mov    %rsp,%rbp
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  mov    (%rbx),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  add    $0x8,%rbx
  cmp    %r13,%rbx
  jne    L15
L14:
  mov    %rsp,%rdi
  call   <system@plt>
  mov    %eax,%ebx
  lea    D14(%rip),%r13
  lea    D24(%rip),%r12
  lea    D13(%rip),%r14
  jmp    L119
L83:
  mov    $0x3e8,%edi
  call   <sleep_ms@plt>
  cmp    $0x1,%ebx
  je     L108
  test   %bpl,%bpl
  jne    L108
L102:
  mov    $0x3e8,%edi
  call   <sleep_ms@plt>
  cmp    $0x2,%ebx
  je     L48
  cmp    $0x200,%ebx
  je     L48
L119:
  cmp    $0x100,%ebx
  sete   %bpl
  lea    -0x100(%rbx),%eax
  test   $0xfffffeff,%eax
  je     L83
  lea    -0x1(%rbx),%eax
  cmp    $0x1,%eax
  jbe    L83
  mov    0x108(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L35
  mov    %ebx,%eax
  add    $0x110,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L108:
  mov    %r13,%rdi
  call   <system@plt>
  mov    %r12,%rdi
  call   <system@plt>
  mov    %eax,%ebx
  jmp    L102
L48:
  mov    %r14,%rdi
  call   <system@plt>
  mov    %eax,%ebx
  jmp    L119
L35:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D24
datatype: string
name: unpack_data
arguments: tag: D32
datatype: string
name: unpack_data
arguments: tag: D19
datatype: string
name: unpack_data
arguments: tag: D14
datatype: string
name: unpack_data
arguments: tag: D13
datatype: string

tool: D24: system/div

tool: D32:  INIT

tool: D19:  

tool: D14: system/divdbg system/EXEC.EXE

tool: D13: system/div TEST

assistant: ```c
int main(int argc, char *argv[]) {
  int a = 0;
  char init[255];
  strcpy(init, "system/"
               "div");
  strcat(init, " INIT");
  while (a++ < argc - 1) {
    strcat(init, " ");
    strcat(init, argv[a]);
  }
  int ret = system(init);
  while (ret == 1 || ret == 2 || ret == 256 || ret == 512) {
    sleep_ms(1000);
    if (ret == 1 || ret == 256) {
      system("system/"
             "divdbg"
             " system/EXEC.EXE");
      ret = system("system/"
                   "div");
    }
    sleep_ms(1000);
    if (ret == 2 || ret == 512) {
      ret = system("system/"
                   "div"
                   " TEST");
    }
  }
  return ret;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %r14
  mov    %rsi,%r14
  push   %r13
  mov    %edi,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  lea    D14(%rip),%rbx
  mov    %rbx,%rsi
  sub    $0x110,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x108(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r12
  mov    %r12,%rdi
  call   <strcpy@plt>
  lea    D32(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  cmp    $0x1,%r13d
  jle    L84
  lea    -0x2(%r13),%eax
  lea    0x8(%r14),%rbp
  lea    D38(%rip),%r13
  lea    0x10(%r14,%rax,8),%r14
  nopw   0x0(%rax,%rax,1)
L5:
  mov    %r13,%rsi
  mov    %r12,%rdi
  add    $0x8,%rbp
  call   <strcat@plt>
  mov    -0x8(%rbp),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  cmp    %rbp,%r14
  jne    L5
L84:
  mov    %r12,%rdi
  lea    D18(%rip),%rbp
  lea    D3(%rip),%r13
  call   <system@plt>
  mov    %eax,%r12d
  nopl   0x0(%rax)
L26:
  cmp    $0x100,%r12d
  lea    -0x1(%r12),%eax
  sete   %r14b
  cmp    $0x1,%eax
  jbe    L94
  test   %r14b,%r14b
  jne    L94
  cmp    $0x200,%r12d
  jne    L83
  mov    $0x3e8,%edi
  call   <sleep_ms@plt>
  mov    $0x3e8,%edi
  call   <sleep_ms@plt>
L21:
  mov    %r13,%rdi
  call   <system@plt>
  mov    %eax,%r12d
  jmp    L26
  nopl   0x0(%rax)
L94:
  mov    $0x3e8,%edi
  call   <sleep_ms@plt>
  cmp    $0x1,%r12d
  je     L105
  test   %r14b,%r14b
  je     L96
L105:
  mov    %rbp,%rdi
  call   <system@plt>
  mov    %rbx,%rdi
  call   <system@plt>
  mov    %eax,%r12d
L96:
  mov    $0x3e8,%edi
  call   <sleep_ms@plt>
  cmp    $0x2,%r12d
  je     L21
  cmp    $0x200,%r12d
  jne    L26
  jmp    L21
  nop
L83:
  mov    0x108(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L31
  add    $0x110,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L31:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D14
type_guessed: string
name: extract_symbolic_data
arguments: label: D32
type_guessed: string
name: extract_symbolic_data
arguments: label: D38
type_guessed: string
name: extract_symbolic_data
arguments: label: D18
type_guessed: string
name: extract_symbolic_data
arguments: label: D3
type_guessed: string

tool: D14: system/div

tool: D32:  INIT

tool: D38:  

tool: D18: system/divdbg system/EXEC.EXE

tool: D3: system/div TEST

assistant: ```c
int main(int argc, char *argv[]) {
  int a = 0;
  char init[255];
  strcpy(init, "system/"
               "div");
  strcat(init, " INIT");
  while (a++ < argc - 1) {
    strcat(init, " ");
    strcat(init, argv[a]);
  }
  int ret = system(init);
  while (ret == 1 || ret == 2 || ret == 256 || ret == 512) {
    sleep_ms(1000);
    if (ret == 1 || ret == 256) {
      system("system/"
             "divdbg"
             " system/EXEC.EXE");
      ret = system("system/"
                   "div");
    }
    sleep_ms(1000);
    if (ret == 2 || ret == 512) {
      ret = system("system/"
                   "div"
                   " TEST");
    }
  }
  return ret;
}
```