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

```asm
<main>:
  endbr64
  push   %r12
  xor    %r12d,%r12d
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <fork@plt>
  test   %rax,%rax
  jne    L5
L42:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L65
  add    $0x10,%rsp
  mov    %r12d,%eax
  pop    %r12
  ret
L5:
  lea    0x4(%rsp),%rdi
  call   <wait@plt>
  mov    %eax,%r12d
  cmp    $0xffffffff,%eax
  je     L69
  mov    0x4(%rsp),%edi
  call   <WIFEXITED@plt>
  test   %rax,%rax
  je     L61
  lea    D7(%rip),%rdi
  xor    %r12d,%r12d
  call   <printf@plt>
  jmp    L42
L69:
  lea    D28(%rip),%rdi
  call   <perror@plt>
  jmp    L42
L61:
  lea    D3(%rip),%rdi
  or     $0xffffffff,%r12d
  call   <printf@plt>
  jmp    L42
L65:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D7
type: string
name: retrieve_data
arguments: tag: D28
type: string
name: retrieve_data
arguments: tag: D3
type: string

tool: D7: Test PASSED


tool: D28: Unexpected error while setting up test pre-conditions

tool: D3: Test FAILED


assistant: ```c
int main() {
  if (fork() == 0) {
    return 0;
  } else {
    int s;
    if (wait(&s) == -1) {
      perror("Unexpected error while setting up test "
             "pre-conditions");
      return -1;
    }
    if (WIFEXITED(s)) {
      printf("Test PASSED\n");
      return 0;
    }
  }
  printf("Test FAILED\n");
  return -1;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<main>:
  endbr64
  push   %r12
  xor    %r12d,%r12d
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <fork@plt>
  test   %rax,%rax
  jne    L63
L31:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L2
  add    $0x10,%rsp
  mov    %r12d,%eax
  pop    %r12
  ret
L63:
  lea    0x4(%rsp),%rdi
  call   <wait@plt>
  mov    %eax,%r12d
  cmp    $0xffffffff,%eax
  je     L46
  mov    0x4(%rsp),%edi
  call   <WIFEXITED@plt>
  test   %rax,%rax
  je     L53
  lea    D29(%rip),%rdi
  xor    %r12d,%r12d
  call   <printf@plt>
  jmp    L31
L46:
  lea    D4(%rip),%rdi
  call   <perror@plt>
  jmp    L31
L53:
  lea    D21(%rip),%rdi
  or     $0xffffffff,%r12d
  call   <printf@plt>
  jmp    L31
L2:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D29
data_type: string
name: unpack_data
arguments: data_tag: D4
data_type: string
name: unpack_data
arguments: data_tag: D21
data_type: string

tool: D29: Test PASSED


tool: D4: Unexpected error while setting up test pre-conditions

tool: D21: Test FAILED


assistant: ```c
int main() {
  if (fork() == 0) {
    return 0;
  } else {
    int s;
    if (wait(&s) == -1) {
      perror("Unexpected error while setting up test "
             "pre-conditions");
      return -1;
    }
    if (WIFEXITED(s)) {
      printf("Test PASSED\n");
      return 0;
    }
  }
  printf("Test FAILED\n");
  return -1;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<streq>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L37
L39:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x4(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x20(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  je     L7
  mov    $0x0,%eax
  jmp    L28
L7:
  addl   $0x1,-0x4(%rbp)
L37:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L39
  mov    -0x4(%rbp),%eax
L28:
  pop    %rbp
  ret
```

assistant: ```c
streq(str1, str2) char str1[], str2[];
{
  int k;
  k = 0;
  while (str2[k]) {
    if ((str1[k]) != (str2[k]))
      return 0;
    k++;
  }
  return k;
}
```
user: Translate the below assembly code into C programming language:

```asm
<streq>:
  endbr64
  movzbl (%rsi),%edx
  test   %dl,%dl
  je     L38
  mov    $0x1,%eax
L28:
  cmp    %dl,-0x1(%rdi,%rax,1)
  jne    L13
  mov    %eax,%ecx
  add    $0x1,%rax
  movzbl -0x1(%rsi,%rax,1),%edx
  test   %dl,%dl
  jne    L28
  jmp    L34
L38:
  mov    $0x0,%ecx
  jmp    L34
L13:
  mov    $0x0,%ecx
L34:
  mov    %ecx,%eax
  ret
```

assistant: ```c
streq(str1, str2) char str1[], str2[];
{
  int k;
  k = 0;
  while (str2[k]) {
    if ((str1[k]) != (str2[k]))
      return 0;
    k++;
  }
  return k;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<streq>:
  endbr64
  movzbl (%rsi),%edx
  test   %dl,%dl
  je     L37
  mov    $0x1,%eax
  jmp    L15
  nopw   0x0(%rax,%rax,1)
L20:
  mov    %eax,%r8d
  add    $0x1,%rax
  movzbl -0x1(%rsi,%rax,1),%edx
  test   %dl,%dl
  je     L8
L15:
  cmp    %dl,-0x1(%rdi,%rax,1)
  je     L20
L37:
  xor    %r8d,%r8d
L8:
  mov    %r8d,%eax
  ret
```

assistant: ```c
streq(str1, str2) char str1[], str2[];
{
  int k;
  k = 0;
  while (str2[k]) {
    if ((str1[k]) != (str2[k]))
      return 0;
    k++;
  }
  return k;
}
```
user: What is the c source code of the assembly code below?

```asm
<streq>:
  endbr64
  movzbl (%rsi),%edx
  test   %dl,%dl
  je     L34
  mov    $0x1,%eax
  jmp    L31
  nopw   0x0(%rax,%rax,1)
L22:
  mov    %eax,%r8d
  add    $0x1,%rax
  movzbl -0x1(%rsi,%rax,1),%edx
  test   %dl,%dl
  je     L39
L31:
  cmp    %dl,-0x1(%rdi,%rax,1)
  je     L22
L34:
  xor    %r8d,%r8d
L39:
  mov    %r8d,%eax
  ret
```

assistant: ```c
streq(str1, str2) char str1[], str2[];
{
  int k;
  k = 0;
  while (str2[k]) {
    if ((str1[k]) != (str2[k]))
      return 0;
    k++;
  }
  return k;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<make_config>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xb0,%rsp
  mov    %rdi,-0xa8(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0xa8(%rbp),%rax
  mov    %rax,%rdx
  lea    D19(%rip),%rax
  mov    %rax,%rsi
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    D40(%rip),%rax
  mov    %rax,-0xa0(%rbp)
  mov    -0xa8(%rbp),%rax
  mov    %rax,-0x98(%rbp)
  mov    -0xa8(%rbp),%rdx
  lea    -0x90(%rbp),%rax
  mov    %rdx,%rcx
  lea    D19(%rip),%rdx
  lea    D22(%rip),%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  lea    -0xa0(%rbp),%rdx
  lea    -0x90(%rbp),%rax
  mov    $0x2,%ecx
  mov    %rax,%rsi
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  call   <parse_file@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L8
  call   <__stack_chk_fail@plt>
L8:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D19
data_type: string
name: read_data
arguments: data_label: D16
data_type: string
name: read_data
arguments: data_label: D40
data_type: string
name: read_data
arguments: data_label: D22
data_type: string
name: read_data
arguments: data_label: D24
data_type: string

tool: D19: ./

tool: D16: Make config file %s/%s/config 


tool: D40: {{module_name}}

tool: D22: %s/%s/config

tool: D24: tpls/config.tpl

assistant: ```c
void make_config(char *module_name) {
  printf("Make config file %s/%s/config \n", "./", module_name);
  char new_file_name[128];
  char *replace_args[] = {"{{module_name}}", module_name};
  sprintf(new_file_name, "%s/%s/config", "./", module_name);
  parse_file("tpls/config.tpl", new_file_name, replace_args, 2);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<make_config>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xa0,%rsp
  mov    %rdi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x98(%rsp)
  xor    %eax,%eax
  mov    %rdi,%rdx
  lea    D17(%rip),%r12
  mov    %r12,%rsi
  lea    D14(%rip),%rdi
  call   <printf@plt>
  lea    D20(%rip),%rax
  mov    %rax,(%rsp)
  mov    %rbx,0x8(%rsp)
  lea    0x10(%rsp),%rbp
  mov    %rbx,%rcx
  mov    %r12,%rdx
  lea    D48(%rip),%rsi
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rsp,%rdx
  mov    $0x2,%ecx
  mov    %rbp,%rsi
  lea    D21(%rip),%rdi
  call   <parse_file@plt>
  mov    0x98(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L1
  add    $0xa0,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L1:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D17
data_type: string
name: parse_data
arguments: data_tag: D14
data_type: string
name: parse_data
arguments: data_tag: D20
data_type: string
name: parse_data
arguments: data_tag: D48
data_type: string
name: parse_data
arguments: data_tag: D21
data_type: string

tool: D17: ./

tool: D14: Make config file %s/%s/config 


tool: D20: {{module_name}}

tool: D48: %s/%s/config

tool: D21: tpls/config.tpl

assistant: ```c
void make_config(char *module_name) {
  printf("Make config file %s/%s/config \n", "./", module_name);
  char new_file_name[128];
  char *replace_args[] = {"{{module_name}}", module_name};
  sprintf(new_file_name, "%s/%s/config", "./", module_name);
  parse_file("tpls/config.tpl", new_file_name, replace_args, 2);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<make_config>:
  endbr64
  push   %r13
  lea    D11(%rip),%r13
  mov    %rdi,%rdx
  push   %r12
  mov    %r13,%rsi
  mov    %rdi,%r12
  lea    D13(%rip),%rdi
  push   %rbp
  sub    $0xa0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x98(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rbp
  call   <printf@plt>
  mov    %r12,%rcx
  mov    %r13,%rdx
  mov    %rbp,%rdi
  lea    D20(%rip),%rax
  lea    D0(%rip),%rsi
  mov    %r12,0x8(%rsp)
  mov    %rax,(%rsp)
  call   <sprintf@plt>
  mov    %rsp,%rdx
  mov    $0x2,%ecx
  mov    %rbp,%rsi
  lea    D35(%rip),%rdi
  call   <parse_file@plt>
  mov    0x98(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  add    $0xa0,%rsp
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L5:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D11
type: string
name: parse_data
arguments: label: D13
type: string
name: parse_data
arguments: label: D20
type: string
name: parse_data
arguments: label: D0
type: string
name: parse_data
arguments: label: D35
type: string

tool: D11: ./

tool: D13: Make config file %s/%s/config 


tool: D20: {{module_name}}

tool: D0: %s/%s/config

tool: D35: tpls/config.tpl

assistant: ```c
void make_config(char *module_name) {
  printf("Make config file %s/%s/config \n", "./", module_name);
  char new_file_name[128];
  char *replace_args[] = {"{{module_name}}", module_name};
  sprintf(new_file_name, "%s/%s/config", "./", module_name);
  parse_file("tpls/config.tpl", new_file_name, replace_args, 2);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<make_config>:
  endbr64
  push   %r13
  lea    D11(%rip),%r13
  mov    %rdi,%rdx
  push   %r12
  mov    %r13,%rsi
  mov    %rdi,%r12
  lea    D37(%rip),%rdi
  push   %rbp
  sub    $0xa0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x98(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rbp
  call   <printf@plt>
  mov    %r12,%rcx
  mov    %r13,%rdx
  mov    %rbp,%rdi
  lea    D41(%rip),%rax
  lea    D18(%rip),%rsi
  mov    %r12,0x8(%rsp)
  mov    %rax,(%rsp)
  call   <sprintf@plt>
  mov    %rsp,%rdx
  mov    $0x2,%ecx
  mov    %rbp,%rsi
  lea    D49(%rip),%rdi
  call   <parse_file@plt>
  mov    0x98(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L6
  add    $0xa0,%rsp
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L6:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D11
type_infered: string
name: unpack_data
arguments: label: D37
type_infered: string
name: unpack_data
arguments: label: D41
type_infered: string
name: unpack_data
arguments: label: D18
type_infered: string
name: unpack_data
arguments: label: D49
type_infered: string

tool: D11: ./

tool: D37: Make config file %s/%s/config 


tool: D41: {{module_name}}

tool: D18: %s/%s/config

tool: D49: tpls/config.tpl

assistant: ```c
void make_config(char *module_name) {
  printf("Make config file %s/%s/config \n", "./", module_name);
  char new_file_name[128];
  char *replace_args[] = {"{{module_name}}", module_name};
  sprintf(new_file_name, "%s/%s/config", "./", module_name);
  parse_file("tpls/config.tpl", new_file_name, replace_args, 2);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  movl   $0x14,-0xc(%rbp)
  mov    $0x0,%eax
  call   <fork@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L2
  mov    $0x0,%eax
  call   <ChildProcess@plt>
  addl   $0x5,-0xc(%rbp)
  jmp    L13
L2:
  mov    $0x0,%eax
  call   <ParentProcess@plt>
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  lea    D0(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L13:
  nop
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D0
type_guessed: string

tool: D0: Value of num = %d


assistant: ```c
void main() {
  pid_t pid;
  int num = 20;
  pid = fork();
  if (pid == 0) {
    ChildProcess();
    num += 5;
  } else {
    ParentProcess();
    printf("Value of num = %d\n", num);
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%eax
  call   <fork@plt>
  test   %rax,%rax
  jne    L9
  call   <ChildProcess@plt>
L5:
  add    $0x8,%rsp
  ret
L9:
  mov    $0x0,%eax
  call   <ParentProcess@plt>
  mov    $0x14,%esi
  lea    D3(%rip),%rdi
  call   <printf@plt>
  jmp    L5
```

tool_calls: name: read_data
arguments: label: D3
type_infered: string

tool: D3: Value of num = %d


assistant: ```c
void main() {
  pid_t pid;
  int num = 20;
  pid = fork();
  if (pid == 0) {
    ChildProcess();
    num += 5;
  } else {
    ParentProcess();
    printf("Value of num = %d\n", num);
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <fork@plt>
  test   %rax,%rax
  jne    L9
  pop    %rdx
  jmp    10a0 <ChildProcess@plt>
L9:
  xor    %eax,%eax
  call   <ParentProcess@plt>
  mov    $0x14,%esi
  lea    D6(%rip),%rdi
  pop    %rax
  jmp    1080 <printf@plt>
```

tool_calls: name: read_data
arguments: data_tag: D6
type_guessed: string

tool: D6: Value of num = %d


assistant: ```c
void main() {
  pid_t pid;
  int num = 20;
  pid = fork();
  if (pid == 0) {
    ChildProcess();
    num += 5;
  } else {
    ParentProcess();
    printf("Value of num = %d\n", num);
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <fork@plt>
  test   %rax,%rax
  jne    L5
  pop    %rdx
  jmp    10a0 <ChildProcess@plt>
L5:
  xor    %eax,%eax
  call   <ParentProcess@plt>
  mov    $0x14,%esi
  lea    D4(%rip),%rdi
  pop    %rax
  jmp    1080 <printf@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D4
type: string

tool: D4: Value of num = %d


assistant: ```c
void main() {
  pid_t pid;
  int num = 20;
  pid = fork();
  if (pid == 0) {
    ChildProcess();
    num += 5;
  } else {
    ParentProcess();
    printf("Value of num = %d\n", num);
  }
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<maxSum>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %esi,%r9d
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movslq %esi,%rax
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L139:
  cmp    %rdx,%rsp
  je     L189
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L139
L189:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L179
  orq    $0x0,-0x8(%rsp,%rax,1)
L179:
  lea    0x3(%rsp),%rsi
  mov    %rsi,%r8
  shr    $0x2,%r8
  and    $0xfffffffffffffffc,%rsi
  test   %r9d,%r9d
  js     L164
  lea    0x1(%r9),%ecx
  shl    $0x2,%rcx
  mov    $0x0,%eax
L128:
  mov    (%rdi,%rax,1),%edx
  mov    %edx,(%rsi,%rax,1)
  add    $0x4,%rax
  cmp    %rcx,%rax
  jne    L128
L164:
  cmp    $0x1,%r9d
  jle    L156
  mov    %r9d,%r10d
  mov    $0x1,%edx
  jmp    L29
L114:
  add    $0x1,%rax
  cmp    %rdx,%rax
  je     L127
L153:
  cmp    %ecx,(%rdi,%rax,4)
  jge    L114
  mov    %ecx,%r8d
  add    (%rsi,%rax,4),%r8d
  cmp    %r8d,(%rsi,%rdx,4)
  jge    L114
  mov    %r8d,(%rsi,%rdx,4)
  jmp    L114
L127:
  add    $0x1,%rdx
  cmp    %r10,%rdx
  je     L70
L29:
  test   %edx,%edx
  jle    L127
  mov    (%rdi,%rdx,4),%ecx
  mov    $0x0,%eax
  jmp    L153
L156:
  je     L97
  mov    $0x0,%edx
  jmp    L45
L70:
  mov    $0x0,%eax
  mov    $0x0,%edx
L108:
  mov    (%rsi,%rax,4),%ecx
  cmp    %ecx,%edx
  cmovl  %ecx,%edx
  add    $0x1,%rax
  cmp    %eax,%r9d
  jg     L108
L45:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L102
  mov    %edx,%eax
  leave
  ret
L97:
  mov    0x0(,%r8,4),%edx
  test   %edx,%edx
  mov    $0x0,%eax
  cmovs  %eax,%edx
  jmp    L45
L102:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int maxSum(int arr[], int N) {
  int i, j, max = 0;
  int MSis[N];
  for (i = 0; i <= N; i++) {
    MSis[i] = arr[i];
  }
  for (i = 1; i < N; i++) {
    for (j = 0; j < i; j++) {
      if (arr[j] < arr[i] && MSis[i] < MSis[j] + arr[i])
        MSis[i] = MSis[j] + arr[i];
    }
  }
  for (i = 0; i < N; i++) {
    if (max < MSis[i])
      max = MSis[i];
  }
  return max;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<maxSum>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r14
  push   %r13
  movslq %esi,%r13
  push   %r12
  mov    %r13,%r12
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  lea    0xf(,%r13,4),%rax
  mov    %rsp,%rcx
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L69
L76:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L76
L69:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L133
L82:
  lea    0x3(%rsp),%rdi
  mov    %rdi,%r14
  and    $0xfffffffffffffffc,%rdi
  shr    $0x2,%r14
  test   %r12d,%r12d
  js     L22
  lea    0x4(,%r13,4),%rdx
  mov    %rbx,%rsi
  call   <memcpy@plt>
  mov    %rax,%rdi
  cmp    $0x1,%r12d
  jle    L22
  mov    $0x1,%edx
  nopl   (%rax)
L96:
  mov    (%rbx,%rdx,4),%ecx
  xor    %eax,%eax
  nopl   (%rax)
L89:
  cmp    %ecx,(%rbx,%rax,4)
  jge    L2
  mov    (%rdi,%rax,4),%esi
  add    %ecx,%esi
  cmp    %esi,(%rdi,%rdx,4)
  jge    L2
  mov    %esi,(%rdi,%rdx,4)
L2:
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L89
  lea    0x1(%rax),%rdx
  cmp    %rdx,%r13
  jne    L96
  xor    %eax,%eax
  xor    %r8d,%r8d
  nopl   0x0(%rax)
L46:
  mov    (%rdi,%rax,4),%edx
  cmp    %edx,%r8d
  cmovl  %edx,%r8d
  add    $0x1,%rax
  cmp    %eax,%r12d
  jg     L46
L112:
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L53
  lea    -0x20(%rbp),%rsp
  mov    %r8d,%eax
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %rbp
  ret
L133:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L82
L22:
  cmp    $0x1,%r12d
  je     L52
  xor    %r8d,%r8d
  jmp    L112
L52:
  mov    0x0(,%r14,4),%r8d
  xor    %eax,%eax
  test   %r8d,%r8d
  cmovs  %eax,%r8d
  jmp    L112
L53:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int maxSum(int arr[], int N) {
  int i, j, max = 0;
  int MSis[N];
  for (i = 0; i <= N; i++) {
    MSis[i] = arr[i];
  }
  for (i = 1; i < N; i++) {
    for (j = 0; j < i; j++) {
      if (arr[j] < arr[i] && MSis[i] < MSis[j] + arr[i])
        MSis[i] = MSis[j] + arr[i];
    }
  }
  for (i = 0; i < N; i++) {
    if (max < MSis[i])
      max = MSis[i];
  }
  return max;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<autohelperowl_vital_apat14>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    %ecx,-0x24(%rbp)
  mov    %r8d,-0x28(%rbp)
  mov    -0x1c(%rbp),%edx
  mov    -0x20(%rbp),%eax
  mov    %edx,%ecx
  mov    %eax,%edx
  mov    $0xffffffff,%esi
  mov    $0x1,%edi
  call   <offset@plt>
  mov    %eax,-0x10(%rbp)
  mov    -0x1c(%rbp),%edx
  mov    -0x20(%rbp),%eax
  mov    %edx,%ecx
  mov    %eax,%edx
  mov    $0x0,%esi
  mov    $0xffffffff,%edi
  call   <offset@plt>
  mov    %eax,-0xc(%rbp)
  mov    -0x1c(%rbp),%edx
  mov    -0x20(%rbp),%eax
  mov    %edx,%ecx
  mov    %eax,%edx
  mov    $0x1,%esi
  mov    $0x1,%edi
  call   <offset@plt>
  mov    %eax,-0x8(%rbp)
  mov    -0x1c(%rbp),%edx
  mov    -0x20(%rbp),%eax
  mov    %edx,%ecx
  mov    %eax,%edx
  mov    $0xffffffff,%esi
  mov    $0xffffffff,%edi
  call   <offset@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <countlib@plt>
  cmp    $0x2,%eax
  jne    L12
  mov    -0x10(%rbp),%eax
  mov    %eax,%edi
  call   <countlib@plt>
  cmp    $0x1,%eax
  jle    L12
  mov    -0x8(%rbp),%edi
  mov    -0xc(%rbp),%esi
  mov    -0x20(%rbp),%edx
  mov    -0x24(%rbp),%eax
  sub    $0x8,%rsp
  mov    -0x8(%rbp),%ecx
  push   %rcx
  mov    %edi,%r9d
  mov    %esi,%r8d
  mov    %edx,%ecx
  mov    $0x3,%edx
  mov    $0x1,%esi
  mov    %eax,%edi
  call   <play_attack_defend_n@plt>
  add    $0x10,%rsp
  test   %eax,%eax
  jne    L12
  mov    $0x1,%eax
  jmp    L18
L12:
  mov    $0x0,%eax
L18:
  leave
  ret
```

assistant: ```c
int autohelperowl_vital_apat14(struct pattern *patt, int transformation, int move, int color, int action) {
  int b, c, d, A;
  (void)patt;
  (void)color;
  (void)action;
  b = offset(1, -1, move, transformation);
  c = offset(-1, 0, move, transformation);
  d = offset(1, 1, move, transformation);
  A = offset(-1, -1, move, transformation);
  return countlib(A) == 2 && countlib(b) > 1 && !play_attack_defend_n(color, 1, 3, move, c, d, d);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<autohelperowl_vital_apat14>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %esi,%ebp
  mov    %edx,%ebx
  mov    %ecx,%r14d
  mov    %esi,%ecx
  mov    $0xffffffff,%esi
  mov    $0x1,%edi
  call   <offset@plt>
  mov    %eax,%r12d
  mov    %ebp,%ecx
  mov    %ebx,%edx
  mov    $0x0,%esi
  mov    $0xffffffff,%edi
  call   <offset@plt>
  mov    %eax,%r15d
  mov    %ebp,%ecx
  mov    %ebx,%edx
  mov    $0x1,%esi
  mov    $0x1,%edi
  call   <offset@plt>
  mov    %eax,%r13d
  mov    %ebp,%ecx
  mov    %ebx,%edx
  mov    $0xffffffff,%esi
  mov    $0xffffffff,%edi
  call   <offset@plt>
  mov    %eax,%edi
  call   <countlib@plt>
  mov    %eax,%edx
  mov    $0x0,%eax
  cmp    $0x2,%edx
  je     L25
L17:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L25:
  mov    %r12d,%edi
  call   <countlib@plt>
  mov    %eax,%edx
  mov    $0x0,%eax
  cmp    $0x1,%edx
  jle    L17
  sub    $0x8,%rsp
  push   %r13
  mov    %r13d,%r9d
  mov    %r15d,%r8d
  mov    %ebx,%ecx
  mov    $0x3,%edx
  mov    $0x1,%esi
  mov    %r14d,%edi
  call   <play_attack_defend_n@plt>
  add    $0x10,%rsp
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  jmp    L17
```

assistant: ```c
int autohelperowl_vital_apat14(struct pattern *patt, int transformation, int move, int color, int action) {
  int b, c, d, A;
  (void)patt;
  (void)color;
  (void)action;
  b = offset(1, -1, move, transformation);
  c = offset(-1, 0, move, transformation);
  d = offset(1, 1, move, transformation);
  A = offset(-1, -1, move, transformation);
  return countlib(A) == 2 && countlib(b) > 1 && !play_attack_defend_n(color, 1, 3, move, c, d, d);
}
```