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

```asm
<strchr>:
  endbr64
  jmp    L12
  cs nopw 0x0(%rax,%rax,1)
L0:
  cmp    %esi,%edx
  je     L28
  add    $0x1,%rdi
L12:
  movsbl (%rdi),%edx
  test   %dl,%dl
  jne    L0
  xor    %eax,%eax
  test   %esi,%esi
  cmove  %rdi,%rax
  ret
  nopl   0x0(%rax,%rax,1)
L28:
  mov    %rdi,%rax
  ret
```

assistant: ```c
char *strchr(const char *s, int c) {
  while (*s && *s != c) {
    s++;
  }
  return (char *)(*s ? s : (c ? ((void *)0) : s));
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<strchr>:
  endbr64
  jmp    L19
  cs nopw 0x0(%rax,%rax,1)
L24:
  cmp    %esi,%edx
  je     L15
  add    $0x1,%rdi
L19:
  movsbl (%rdi),%edx
  test   %dl,%dl
  jne    L24
  xor    %eax,%eax
  test   %esi,%esi
  cmove  %rdi,%rax
  ret
  nopl   0x0(%rax,%rax,1)
L15:
  mov    %rdi,%rax
  ret
```

assistant: ```c
char *strchr(const char *s, int c) {
  while (*s && *s != c) {
    s++;
  }
  return (char *)(*s ? s : (c ? ((void *)0) : s));
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<pthread_getschedparam>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    %rdx,-0x18(%rbp)
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  call   <abort@plt>
  nop
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D9
data_type: string

tool: D9: FIXME: pthread_getschedparam called


assistant: ```c
int pthread_getschedparam(pthread_t thread, int *policy, struct sched_param *param) {
  printf("FIXME: pthread_getschedparam called\n");
  abort();
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<pthread_getschedparam>:
  endbr64
  sub    $0x8,%rsp
  lea    D4(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  call   <abort@plt>
  add    $0x8,%rsp
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D4
datatype: string

tool: D4: FIXME: pthread_getschedparam called


assistant: ```c
int pthread_getschedparam(pthread_t thread, int *policy, struct sched_param *param) {
  printf("FIXME: pthread_getschedparam called\n");
  abort();
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<pthread_getschedparam>:
  endbr64
  sub    $0x8,%rsp
  lea    D8(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  jmp    1060 <abort@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D8
type: string

tool: D8: FIXME: pthread_getschedparam called


assistant: ```c
int pthread_getschedparam(pthread_t thread, int *policy, struct sched_param *param) {
  printf("FIXME: pthread_getschedparam called\n");
  abort();
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<pthread_getschedparam>:
  endbr64
  sub    $0x8,%rsp
  lea    D8(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  jmp    1060 <abort@plt>
```

tool_calls: name: read_data
arguments: data_label: D8
datatype: string

tool: D8: FIXME: pthread_getschedparam called


assistant: ```c
int pthread_getschedparam(pthread_t thread, int *policy, struct sched_param *param) {
  printf("FIXME: pthread_getschedparam called\n");
  abort();
}
```
user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x13(%rbp),%rax
  mov    %rax,%rsi
  lea    D22(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  lea    -0x13(%rbp),%rax
  mov    %rax,%rdi
  call   <CheckPassword@plt>
  mov    %eax,-0x18(%rbp)
  cmpl   $0x0,-0x18(%rbp)
  jne    L9
  lea    D14(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L16
L9:
  lea    D27(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L16:
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L3
  call   <__stack_chk_fail@plt>
L3:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D22
datatype: string
name: extract_symbolic_data
arguments: data_label: D14
datatype: string
name: extract_symbolic_data
arguments: data_label: D27
datatype: string

tool: D22: %s

tool: D14: REJECTED


tool: D27: ACCEPTED


assistant: ```c
int main() {
  char str[11];
  scanf("%s", str);
  int res = CheckPassword(str);
  if (res == 0) {
    printf("REJECTED\n");
  } else {
    printf("ACCEPTED\n");
  }
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  push   %rbx
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0xd(%rsp),%rbx
  mov    %rbx,%rsi
  lea    D13(%rip),%rdi
  call   <scanf@plt>
  mov    %rbx,%rdi
  call   <CheckPassword@plt>
  test   %eax,%eax
  jne    L8
  lea    D10(%rip),%rdi
  call   <printf@plt>
L27:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L6
  mov    $0x0,%eax
  add    $0x20,%rsp
  pop    %rbx
  ret
L8:
  lea    D0(%rip),%rdi
  call   <printf@plt>
  jmp    L27
L6:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D13
datatype: string
name: retrieve_data
arguments: data_tag: D10
datatype: string
name: retrieve_data
arguments: data_tag: D0
datatype: string

tool: D13: %s

tool: D10: REJECTED


tool: D0: ACCEPTED


assistant: ```c
int main() {
  char str[11];
  scanf("%s", str);
  int res = CheckPassword(str);
  if (res == 0) {
    printf("REJECTED\n");
  } else {
    printf("ACCEPTED\n");
  }
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %rbp
  lea    D15(%rip),%rdi
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0xd(%rsp),%rbp
  mov    %rbp,%rsi
  call   <scanf@plt>
  mov    %rbp,%rdi
  call   <CheckPassword@plt>
  test   %eax,%eax
  jne    L2
  lea    D17(%rip),%rdi
  call   <printf@plt>
L0:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L13
  add    $0x20,%rsp
  xor    %eax,%eax
  pop    %rbp
  ret
L2:
  lea    D22(%rip),%rdi
  call   <printf@plt>
  jmp    L0
L13:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D15
type: string
name: parse_data
arguments: data_label: D17
type: string
name: parse_data
arguments: data_label: D22
type: string

tool: D15: %s

tool: D17: REJECTED


tool: D22: ACCEPTED


assistant: ```c
int main() {
  char str[11];
  scanf("%s", str);
  int res = CheckPassword(str);
  if (res == 0) {
    printf("REJECTED\n");
  } else {
    printf("ACCEPTED\n");
  }
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<main>:
  endbr64
  push   %rbp
  lea    D13(%rip),%rdi
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0xd(%rsp),%rbp
  mov    %rbp,%rsi
  call   <scanf@plt>
  mov    %rbp,%rdi
  call   <CheckPassword@plt>
  test   %eax,%eax
  jne    L28
  lea    D0(%rip),%rdi
  call   <printf@plt>
L0:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L14
  add    $0x20,%rsp
  xor    %eax,%eax
  pop    %rbp
  ret
L28:
  lea    D23(%rip),%rdi
  call   <printf@plt>
  jmp    L0
L14:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D13
type: string
name: parse_data
arguments: label: D0
type: string
name: parse_data
arguments: label: D23
type: string

tool: D13: %s

tool: D0: REJECTED


tool: D23: ACCEPTED


assistant: ```c
int main() {
  char str[11];
  scanf("%s", str);
  int res = CheckPassword(str);
  if (res == 0) {
    printf("REJECTED\n");
  } else {
    printf("ACCEPTED\n");
  }
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  movb   $0x61,(%rax)
  movb   $0x31,-0x7(%rbp)
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L0
  call   <__stack_chk_fail@plt>
L0:
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D2
data_type: string

tool: D2: Hello World


assistant: ```c
int main() {
  char a[4];
  char *p = 0;
  *p = 'a';
  a[5] = '1';
  printf("Hello World\n");
  return 0;
}
```
user: What is the c source code of the assembly code below:

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

tool_calls: name: disassemble_data
arguments: label: D5
type: string

tool: D5: Hello World


assistant: ```c
int main() {
  char a[4];
  char *p = 0;
  *p = 'a';
  a[5] = '1';
  printf("Hello World\n");
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<main>:
  endbr64
  movb   $0x0,0x0
  ud2
```

assistant: ```c
int main() {
  char a[4];
  char *p = 0;
  *p = 'a';
  a[5] = '1';
  printf("Hello World\n");
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<main>:
  endbr64
  movb   $0x0,0x0
  ud2
```

assistant: ```c
int main() {
  char a[4];
  char *p = 0;
  *p = 'a';
  a[5] = '1';
  printf("Hello World\n");
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<maximumProduct>:
  endbr64
  push   %rbp
  push   %rbx
  mov    %esi,%r8d
  cmp    $0x1,%esi
  jle    L146
  lea    0x4(%rdi),%rax
  lea    -0x2(%rsi),%edx
  lea    0x8(%rdi,%rdx,4),%rsi
  jmp    L142
L51:
  add    $0x4,%rax
  cmp    %rsi,%rax
  je     L146
L142:
  mov    (%rdi),%ecx
  mov    (%rax),%edx
  cmp    %edx,%ecx
  jle    L51
  mov    %ecx,(%rax)
  mov    %edx,(%rdi)
  jmp    L51
L146:
  cmp    $0x2,%r8d
  jle    L168
  lea    0x8(%rdi),%rax
  lea    -0x3(%r8),%edx
  lea    0xc(%rdi,%rdx,4),%rsi
  jmp    L33
L40:
  add    $0x4,%rax
  cmp    %rsi,%rax
  je     L168
L33:
  mov    0x4(%rdi),%ecx
  mov    (%rax),%edx
  cmp    %edx,%ecx
  jle    L40
  mov    %ecx,(%rax)
  mov    %edx,0x4(%rdi)
  jmp    L40
L168:
  lea    -0x1(%r8),%r9d
  movslq %r9d,%rbp
  lea    0x0(,%rbp,4),%r11
  lea    (%rdi,%r11,1),%rsi
  lea    -0x4(%r8),%r10d
  lea    0x4(%rdi),%rbx
  jmp    L93
L157:
  add    $0x4,%rax
  cmp    %r8,%rax
  je     L124
L55:
  mov    (%rsi),%ecx
  mov    (%rax),%edx
  cmp    %edx,%ecx
  jge    L157
  mov    %ecx,(%rax)
  mov    %edx,(%rsi)
  jmp    L157
L124:
  sub    $0x1,%r9d
  sub    $0x4,%rsi
  cmp    %r10d,%r9d
  je     L152
L93:
  test   %r9d,%r9d
  jle    L124
  mov    %rdi,%rax
  lea    -0x1(%r9),%edx
  lea    (%rbx,%rdx,4),%r8
  jmp    L55
L152:
  mov    (%rdi,%rbp,4),%ecx
  mov    %ecx,%eax
  imul   -0x4(%rdi,%r11,1),%eax
  imul   -0x8(%rdi,%r11,1),%eax
  mov    (%rdi),%edx
  imul   0x4(%rdi),%edx
  imul   %ecx,%edx
  cmp    %edx,%eax
  cmovl  %edx,%eax
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
int maximumProduct(int *nums, int numsSize) {
  int temp = 0;
  for (int i = 0; i < 2; i++) {
    for (int j = i + 1; j < numsSize; j++) {
      if (nums[i] > nums[j]) {
        temp = nums[j];
        nums[j] = nums[i];
        nums[i] = temp;
      }
    }
  }
  for (int i = numsSize - 1; i > numsSize - 4; i--) {
    for (int j = 0; j < i; j++) {
      if (nums[i] < nums[j]) {
        temp = nums[j];
        nums[j] = nums[i];
        nums[i] = temp;
      }
    }
  }
  int res1 = nums[0] * nums[1] * nums[numsSize - 1];
  int res2 = nums[numsSize - 1] * nums[numsSize - 2] * nums[numsSize - 3];
  return res1 > res2 ? res1 : res2;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<maximumProduct>:
  endbr64
  push   %rbp
  mov    %esi,%r8d
  push   %rbx
  cmp    $0x1,%esi
  jle    L35
  lea    -0x2(%rsi),%ecx
  lea    0x8(%rdi),%rax
  lea    0x4(%rdi),%rdx
  lea    (%rax,%rcx,4),%r9
  nopl   (%rax)
L0:
  mov    (%rdi),%esi
  mov    (%rdx),%ecx
  cmp    %esi,%ecx
  jge    L62
  mov    %esi,(%rdx)
  mov    %ecx,(%rdi)
L62:
  add    $0x4,%rdx
  cmp    %r9,%rdx
  jne    L0
  cmp    $0x2,%r8d
  jle    L35
  lea    -0x3(%r8),%edx
  lea    0xc(%rdi,%rdx,4),%rsi
  nopl   0x0(%rax)
L80:
  mov    0x4(%rdi),%ecx
  mov    (%rax),%edx
  cmp    %edx,%ecx
  jle    L75
  mov    %ecx,(%rax)
  mov    %edx,0x4(%rdi)
L75:
  add    $0x4,%rax
  cmp    %rsi,%rax
  jne    L80
L35:
  lea    -0x1(%r8),%edx
  lea    -0x4(%r8),%r10d
  movslq %edx,%r11
  lea    0x4(%rdi),%rbx
  shl    $0x2,%r11
  lea    (%rdi,%r11,1),%rbp
  mov    %rbp,%rsi
L96:
  lea    -0x1(%rdx),%r9d
  test   %edx,%edx
  jle    L39
  sub    $0x1,%edx
  mov    %rdi,%rax
  mov    %rdx,%r9
  lea    (%rbx,%rdx,4),%r8
  xchg   %ax,%ax
L29:
  mov    (%rsi),%ecx
  mov    (%rax),%edx
  cmp    %edx,%ecx
  jge    L28
  mov    %ecx,(%rax)
  mov    %edx,(%rsi)
L28:
  add    $0x4,%rax
  cmp    %r8,%rax
  jne    L29
L39:
  mov    %r9d,%edx
  sub    $0x4,%rsi
  cmp    %r9d,%r10d
  jne    L96
  mov    (%rdi),%edx
  imul   0x4(%rdi),%edx
  mov    0x0(%rbp),%ecx
  mov    -0x4(%rdi,%r11,1),%eax
  pop    %rbx
  pop    %rbp
  imul   %ecx,%eax
  imul   %ecx,%edx
  imul   -0x8(%rdi,%r11,1),%eax
  cmp    %edx,%eax
  cmovl  %edx,%eax
  ret
```

assistant: ```c
int maximumProduct(int *nums, int numsSize) {
  int temp = 0;
  for (int i = 0; i < 2; i++) {
    for (int j = i + 1; j < numsSize; j++) {
      if (nums[i] > nums[j]) {
        temp = nums[j];
        nums[j] = nums[i];
        nums[i] = temp;
      }
    }
  }
  for (int i = numsSize - 1; i > numsSize - 4; i--) {
    for (int j = 0; j < i; j++) {
      if (nums[i] < nums[j]) {
        temp = nums[j];
        nums[j] = nums[i];
        nums[i] = temp;
      }
    }
  }
  int res1 = nums[0] * nums[1] * nums[numsSize - 1];
  int res2 = nums[numsSize - 1] * nums[numsSize - 2] * nums[numsSize - 3];
  return res1 > res2 ? res1 : res2;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<maximumProduct>:
  endbr64
  movslq %esi,%r8
  mov    %rdi,%rcx
  cmp    $0x1,%r8d
  jle    L52
  lea    -0x2(%r8),%esi
  lea    0x8(%rcx),%rax
  mov    (%rdi),%edi
  lea    0x4(%rcx),%rdx
  lea    (%rax,%rsi,4),%r9
  cs nopw 0x0(%rax,%rax,1)
L44:
  mov    (%rdx),%esi
  cmp    %esi,%edi
  jle    L46
  mov    %edi,(%rdx)
  mov    %esi,%edi
  mov    %esi,(%rcx)
L46:
  add    $0x4,%rdx
  cmp    %rdx,%r9
  jne    L44
  mov    $0x1,%esi
  cmp    $0x2,%r8d
  je     L66
  lea    -0x3(%r8),%edx
  mov    0x4(%rcx),%esi
  lea    0xc(%rcx,%rdx,4),%rdi
  nopl   0x0(%rax)
L30:
  mov    (%rax),%edx
  cmp    %esi,%edx
  jge    L32
  mov    %esi,(%rax)
  mov    %edx,%esi
  mov    %edx,0x4(%rcx)
L32:
  add    $0x4,%rax
  cmp    %rdi,%rax
  jne    L30
  lea    -0x1(%r8),%esi
L66:
  lea    -0x3(%rsi),%r9d
  xor    %eax,%eax
  movslq %esi,%rsi
  test   %r9d,%r9d
  cmovs  %eax,%r9d
L86:
  mov    (%rcx,%rsi,4),%edi
  xor    %eax,%eax
  nop
L4:
  mov    (%rcx,%rax,4),%edx
  cmp    %edi,%edx
  jle    L20
  mov    %edi,(%rcx,%rax,4)
  mov    %edx,%edi
  mov    %edx,(%rcx,%rsi,4)
L20:
  add    $0x1,%rax
  cmp    %esi,%eax
  jl     L4
  sub    $0x1,%rsi
  cmp    %esi,%r9d
  jl     L86
L52:
  shl    $0x2,%r8
  mov    (%rcx),%edx
  imul   0x4(%rcx),%edx
  mov    -0x4(%rcx,%r8,1),%esi
  mov    -0x8(%rcx,%r8,1),%eax
  imul   %esi,%edx
  imul   %esi,%eax
  imul   -0xc(%rcx,%r8,1),%eax
  cmp    %edx,%eax
  cmovl  %edx,%eax
  ret
```

assistant: ```c
int maximumProduct(int *nums, int numsSize) {
  int temp = 0;
  for (int i = 0; i < 2; i++) {
    for (int j = i + 1; j < numsSize; j++) {
      if (nums[i] > nums[j]) {
        temp = nums[j];
        nums[j] = nums[i];
        nums[i] = temp;
      }
    }
  }
  for (int i = numsSize - 1; i > numsSize - 4; i--) {
    for (int j = 0; j < i; j++) {
      if (nums[i] < nums[j]) {
        temp = nums[j];
        nums[j] = nums[i];
        nums[i] = temp;
      }
    }
  }
  int res1 = nums[0] * nums[1] * nums[numsSize - 1];
  int res2 = nums[numsSize - 1] * nums[numsSize - 2] * nums[numsSize - 3];
  return res1 > res2 ? res1 : res2;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<el_mutex_destroy>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <pthread_mutex_destroy@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  nop
  leave
  ret
```

assistant: ```c
void el_mutex_destroy(void *hmutex) {
  pthread_mutex_destroy((pthread_mutex_t *)hmutex);
  free(hmutex);
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<el_mutex_destroy>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <pthread_mutex_destroy@plt>
  mov    %rbx,%rdi
  call   <free@plt>
  pop    %rbx
  ret
```

assistant: ```c
void el_mutex_destroy(void *hmutex) {
  pthread_mutex_destroy((pthread_mutex_t *)hmutex);
  free(hmutex);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<el_mutex_destroy>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  call   <pthread_mutex_destroy@plt>
  mov    %rbp,%rdi
  pop    %rbp
  jmp    1060 <free@plt>
```

assistant: ```c
void el_mutex_destroy(void *hmutex) {
  pthread_mutex_destroy((pthread_mutex_t *)hmutex);
  free(hmutex);
}
```
user: What is the c source code of the assembly code below:

```asm
<timeval_sub>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jge    L1
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  mov    %rdx,%rcx
  sub    %rax,%rcx
  movabs $0x431bde82d7b634db,%rdx
  mov    %rcx,%rax
  imul   %rdx
  mov    %rdx,%rax
  sar    $0x12,%rax
  sar    $0x3f,%rcx
  mov    %rcx,%rdx
  sub    %rdx,%rax
  add    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rax
  mov    -0x8(%rbp),%edx
  imul   $0xf4240,%edx,%edx
  movslq %edx,%rcx
  sub    %rcx,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x28(%rbp),%rax
  mov    0x8(%rax),%rdx
  mov    -0x8(%rbp),%eax
  cltq
  add    %rax,%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,0x8(%rax)
L1:
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rcx
  mov    %rdx,%rax
  sub    %rcx,%rax
  cmp    $0xf4240,%rax
  jle    L12
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rax
  mov    %rdx,%rcx
  sub    %rax,%rcx
  movabs $0x431bde82d7b634db,%rdx
  mov    %rcx,%rax
  imul   %rdx
  mov    %rdx,%rax
  sar    $0x12,%rax
  sar    $0x3f,%rcx
  mov    %rcx,%rdx
  sub    %rdx,%rax
  mov    %eax,-0x4(%rbp)
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%eax
  imul   $0xf4240,%eax,%eax
  cltq
  add    %rax,%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x28(%rbp),%rax
  mov    0x8(%rax),%rax
  mov    -0x4(%rbp),%edx
  movslq %edx,%rcx
  sub    %rcx,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,0x8(%rax)
L12:
  mov    -0x20(%rbp),%rax
  mov    0x8(%rax),%rdx
  mov    -0x28(%rbp),%rax
  mov    0x8(%rax),%rax
  sub    %rax,%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,0x8(%rax)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rax
  sub    %rax,%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x20(%rbp),%rax
  mov    0x8(%rax),%rdx
  mov    -0x28(%rbp),%rax
  mov    0x8(%rax),%rax
  cmp    %rax,%rdx
  setl   %al
  movzbl %al,%eax
  pop    %rbp
  ret
```

assistant: ```c
int timeval_sub(struct timeval *result, struct timeval *x, struct timeval *y) {
  if (x->tv_usec < y->tv_usec) {
    int nsec = (y->tv_usec - x->tv_usec) / 1000000 + 1;
    y->tv_usec -= 1000000 * nsec;
    y->tv_sec += nsec;
  }
  if (x->tv_usec - y->tv_usec > 1000000) {
    int nsec = (x->tv_usec - y->tv_usec) / 1000000;
    y->tv_usec += 1000000 * nsec;
    y->tv_sec -= nsec;
  }
  result->tv_sec = x->tv_sec - y->tv_sec;
  result->tv_usec = x->tv_usec - y->tv_usec;
  return x->tv_sec < y->tv_sec;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<timeval_sub>:
  endbr64
  mov    %rdi,%r8
  mov    %rdx,%rcx
  mov    (%rsi),%rax
  mov    (%rdx),%rdi
  cmp    %rdi,%rax
  jge    L18
  mov    %rdi,%r9
  sub    %rax,%r9
  movabs $0x431bde82d7b634db,%rdx
  mov    %r9,%rax
  imul   %rdx
  sar    $0x12,%rdx
  sar    $0x3f,%r9
  sub    %r9,%rdx
  add    $0x1,%edx
  imul   $0xf4240,%edx,%eax
  cltq
  sub    %rax,%rdi
  mov    %rdi,(%rcx)
  movslq %edx,%rdx
  add    %rdx,0x8(%rcx)
L18:
  mov    (%rcx),%r9
  mov    (%rsi),%rdi
  sub    %r9,%rdi
  cmp    $0xf4240,%rdi
  jle    L0
  movabs $0x431bde82d7b634db,%rdx
  mov    %rdi,%rax
  imul   %rdx
  sar    $0x12,%rdx
  sar    $0x3f,%rdi
  sub    %rdi,%rdx
  imul   $0xf4240,%edx,%eax
  cltq
  add    %r9,%rax
  mov    %rax,(%rcx)
  movslq %edx,%rdx
  sub    %rdx,0x8(%rcx)
L0:
  mov    0x8(%rsi),%rax
  sub    0x8(%rcx),%rax
  mov    %rax,0x8(%r8)
  mov    (%rsi),%rax
  sub    (%rcx),%rax
  mov    %rax,(%r8)
  mov    0x8(%rcx),%rax
  cmp    %rax,0x8(%rsi)
  setl   %al
  movzbl %al,%eax
  ret
```

assistant: ```c
int timeval_sub(struct timeval *result, struct timeval *x, struct timeval *y) {
  if (x->tv_usec < y->tv_usec) {
    int nsec = (y->tv_usec - x->tv_usec) / 1000000 + 1;
    y->tv_usec -= 1000000 * nsec;
    y->tv_sec += nsec;
  }
  if (x->tv_usec - y->tv_usec > 1000000) {
    int nsec = (x->tv_usec - y->tv_usec) / 1000000;
    y->tv_usec += 1000000 * nsec;
    y->tv_sec -= nsec;
  }
  result->tv_sec = x->tv_sec - y->tv_sec;
  result->tv_usec = x->tv_usec - y->tv_usec;
  return x->tv_sec < y->tv_sec;
}
```
user: Translate the below assembly code into C programming language:

```asm
<timeval_sub>:
  endbr64
  mov    %rdi,%r9
  mov    %rsi,%rdi
  mov    (%rdx),%r8
  mov    0x8(%rdx),%r10
  mov    (%rdi),%rcx
  mov    %rdx,%rsi
  cmp    %r8,%rcx
  jge    L3
  mov    %r8,%rdx
  sub    %rcx,%rdx
  movabs $0x431bde82d7b634db,%rcx
  mov    %rdx,%rax
  mul    %rcx
  shr    $0x12,%rdx
  add    $0x1,%edx
  imul   $0xf4240,%edx,%eax
  movslq %edx,%rdx
  add    %rdx,%r10
  mov    %r10,0x8(%rsi)
  cltq
  sub    %rax,%r8
  mov    %r8,(%rsi)
  mov    (%rdi),%rcx
L3:
  sub    %r8,%rcx
  cmp    $0xf4240,%rcx
  jle    L17
  movabs $0x431bde82d7b634db,%rdx
  mov    %rcx,%rax
  sar    $0x3f,%rcx
  imul   %rdx
  sar    $0x12,%rdx
  sub    %rcx,%rdx
  imul   $0xf4240,%edx,%eax
  movslq %edx,%rdx
  sub    %rdx,%r10
  mov    %r10,0x8(%rsi)
  cltq
  add    %r8,%rax
  mov    %rax,(%rsi)
  mov    (%rdi),%rcx
  sub    %rax,%rcx
L17:
  mov    0x8(%rdi),%rax
  mov    %rcx,(%r9)
  sub    %r10,%rax
  mov    %rax,0x8(%r9)
  mov    0x8(%rsi),%rax
  cmp    %rax,0x8(%rdi)
  setl   %al
  movzbl %al,%eax
  ret
```

assistant: ```c
int timeval_sub(struct timeval *result, struct timeval *x, struct timeval *y) {
  if (x->tv_usec < y->tv_usec) {
    int nsec = (y->tv_usec - x->tv_usec) / 1000000 + 1;
    y->tv_usec -= 1000000 * nsec;
    y->tv_sec += nsec;
  }
  if (x->tv_usec - y->tv_usec > 1000000) {
    int nsec = (x->tv_usec - y->tv_usec) / 1000000;
    y->tv_usec += 1000000 * nsec;
    y->tv_sec -= nsec;
  }
  result->tv_sec = x->tv_sec - y->tv_sec;
  result->tv_usec = x->tv_usec - y->tv_usec;
  return x->tv_sec < y->tv_sec;
}
```