ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  push   %rbp
  lea    D12(%rip),%rdi
  lea    D11(%rip),%rbp
  push   %rbx
  mov    $0x1,%ebx
  sub    $0x18,%rsp
  call   <puts@plt>
  movsd  D32(%rip),%xmm1
  movapd %xmm1,%xmm0
  xchg   %ax,%ax
L0:
  mulsd  D41(%rip),%xmm1
  addsd  D68(%rip),%xmm0
  mov    %ebx,%esi
  mov    %rbp,%rdi
  mov    $0x2,%eax
  add    $0x1,%ebx
  movsd  %xmm0,(%rsp)
  movsd  %xmm1,0x8(%rsp)
  call   <printf@plt>
  cmp    $0x1c,%ebx
  movsd  (%rsp),%xmm0
  movsd  0x8(%rsp),%xmm1
  jne    L0
  mov    $0x1b,%esi
  lea    D47(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  movsd  0x8(%rsp),%xmm1
  movsd  (%rsp),%xmm0
  lea    D30(%rip),%rdi
  mov    $0x2,%eax
  call   <printf@plt>
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D12
type_guessed: string
name: extract_symbolic_data
arguments: tag: D11
type_guessed: string
name: extract_symbolic_data
arguments: tag: D32
type_guessed: f64
name: extract_symbolic_data
arguments: tag: D41
type_guessed: f64
name: extract_symbolic_data
arguments: tag: D68
type_guessed: byte[8]
name: extract_symbolic_data
arguments: tag: D47
type_guessed: string
name: extract_symbolic_data
arguments: tag: D30
type_guessed: string

tool: D12:           Daphne   Deirdre

tool: D11: Year%2d : $%-8.2f $%-8.2f


tool: D32: 100

tool: D41: 1.05

tool: {"D68": [0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x40]}

tool: D47: Deirdre's investment beyond Daphne's investment takes %d years!


tool: D30: Daphne will have $%.2f, and Deirdre will have $%.2f since then!


assistant: ```c
int main(void) {
  double money, daphne, deirdre;
  int years = 1;
  money = 100.0;
  daphne = money;
  deirdre = money;
  printf("          Daphne   Deirdre\n");
  while (deirdre <= daphne) {
    daphne += money * 0.10;
    deirdre *= 1.05;
    printf("Year%2d : $%-8.2f $%-8.2f\n", years, daphne, deirdre);
    years++;
  }
  printf("Deirdre's investment beyond Daphne's investment takes %d years!\n", years - 1);
  printf("Daphne will have $%.2f, and Deirdre will have $%.2f since then!\n", daphne, deirdre);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<main>:
  endbr64
  push   %rbp
  lea    D25(%rip),%rdi
  lea    D27(%rip),%rbp
  push   %rbx
  mov    $0x1,%ebx
  sub    $0x18,%rsp
  call   <puts@plt>
  movsd  D5(%rip),%xmm1
  movapd %xmm1,%xmm0
  xchg   %ax,%ax
L7:
  mulsd  D14(%rip),%xmm1
  addsd  D49(%rip),%xmm0
  mov    %ebx,%esi
  mov    %rbp,%rdi
  mov    $0x2,%eax
  add    $0x1,%ebx
  movsd  %xmm0,(%rsp)
  movsd  %xmm1,0x8(%rsp)
  call   <printf@plt>
  cmp    $0x1c,%ebx
  movsd  (%rsp),%xmm0
  movsd  0x8(%rsp),%xmm1
  jne    L7
  mov    $0x1b,%esi
  lea    D36(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  movsd  0x8(%rsp),%xmm1
  movsd  (%rsp),%xmm0
  lea    D48(%rip),%rdi
  mov    $0x2,%eax
  call   <printf@plt>
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D25
type: string
name: disassemble_data
arguments: tag: D27
type: string
name: disassemble_data
arguments: tag: D5
type: f64
name: disassemble_data
arguments: tag: D14
type: f64
name: disassemble_data
arguments: tag: D49
type: byte[8]
name: disassemble_data
arguments: tag: D36
type: string
name: disassemble_data
arguments: tag: D48
type: string

tool: D25:           Daphne   Deirdre

tool: D27: Year%2d : $%-8.2f $%-8.2f


tool: D5: 100

tool: D14: 1.05

tool: {"D49": [0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x40]}

tool: D36: Deirdre's investment beyond Daphne's investment takes %d years!


tool: D48: Daphne will have $%.2f, and Deirdre will have $%.2f since then!


assistant: ```c
int main(void) {
  double money, daphne, deirdre;
  int years = 1;
  money = 100.0;
  daphne = money;
  deirdre = money;
  printf("          Daphne   Deirdre\n");
  while (deirdre <= daphne) {
    daphne += money * 0.10;
    deirdre *= 1.05;
    printf("Year%2d : $%-8.2f $%-8.2f\n", years, daphne, deirdre);
    years++;
  }
  printf("Deirdre's investment beyond Daphne's investment takes %d years!\n", years - 1);
  printf("Daphne will have $%.2f, and Deirdre will have $%.2f since then!\n", daphne, deirdre);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<foo1>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x438,%rsp
  mov    %rdi,-0x438(%rbp)
  mov    %rsi,-0x440(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  lea    -0x420(%rbp),%rax
  mov    %rax,-0x428(%rbp)
  movq   $0x0,-0x440(%rbp)
  jmp    L23
L16:
  mov    -0x440(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x428(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x440(%rbp),%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x428(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  mov    %rax,%rdi
  call   <bar1@plt>
  mov    %rax,(%rbx)
  addq   $0x1,-0x440(%rbp)
L23:
  mov    -0x440(%rbp),%rax
  cmp    -0x438(%rbp),%rax
  jl     L16
  mov    -0x428(%rbp),%rax
  mov    %rax,%rdi
  call   <dummy1@plt>
  nop
  mov    -0x18(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L11
  call   <__stack_chk_fail@plt>
L11:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
void foo1(long a, long b) {
  long array[128];
  long *c = array;
  for (b = 0; b < a; b++)
    c[b] = bar1(c[b]);
  dummy1(c);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<foo1>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x410,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x408(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  jle    L9
  mov    %rdi,%r12
  mov    $0x0,%ebx
L8:
  mov    %rsp,%rbp
  mov    0x0(%rbp,%rbx,8),%rdi
  call   <bar1@plt>
  mov    %rax,0x0(%rbp,%rbx,8)
  add    $0x1,%rbx
  cmp    %rbx,%r12
  jne    L8
L9:
  mov    %rsp,%rdi
  call   <dummy1@plt>
  mov    0x408(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L6
  add    $0x410,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L6:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void foo1(long a, long b) {
  long array[128];
  long *c = array;
  for (b = 0; b < a; b++)
    c[b] = bar1(c[b]);
  dummy1(c);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<foo1>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x410,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x408(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  test   %rdi,%rdi
  jle    L18
  mov    %rdi,%r12
  xor    %ebx,%ebx
  mov    %rsp,%rbp
  nopw   0x0(%rax,%rax,1)
L8:
  mov    0x0(%rbp,%rbx,8),%rdi
  call   <bar1@plt>
  mov    %rax,0x0(%rbp,%rbx,8)
  add    $0x1,%rbx
  cmp    %rbx,%r12
  jne    L8
L18:
  mov    %rbp,%rdi
  call   <dummy1@plt>
  mov    0x408(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L28
  add    $0x410,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L28:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void foo1(long a, long b) {
  long array[128];
  long *c = array;
  for (b = 0; b < a; b++)
    c[b] = bar1(c[b]);
  dummy1(c);
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<foo1>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x410,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x408(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  test   %rdi,%rdi
  jle    L9
  mov    %rdi,%r12
  xor    %ebx,%ebx
  mov    %rsp,%rbp
  nopw   0x0(%rax,%rax,1)
L4:
  mov    0x0(%rbp,%rbx,8),%rdi
  call   <bar1@plt>
  mov    %rax,0x0(%rbp,%rbx,8)
  add    $0x1,%rbx
  cmp    %rbx,%r12
  jne    L4
L9:
  mov    %rbp,%rdi
  call   <dummy1@plt>
  mov    0x408(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L3
  add    $0x410,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L3:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void foo1(long a, long b) {
  long array[128];
  long *c = array;
  for (b = 0; b < a; b++)
    c[b] = bar1(c[b]);
  dummy1(c);
}
```
user: Translate the below assembly code into C programming language:

```asm
<get_name>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x28(%rbp),%rdx
  lea    -0x20(%rbp),%rax
  lea    D4(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L0
  call   <__stack_chk_fail@plt>
L0:
  leave
  ret
```

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

tool: D4: %p

assistant: ```c
char *get_name(void *addr) {
  char buf[20];
  sprintf(buf, "%p", addr);
  return strdup(buf);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<get_name>:
  endbr64
  push   %rbx
  sub    $0x20,%rsp
  mov    %rdi,%rdx
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbx
  lea    D0(%rip),%rsi
  mov    %rbx,%rdi
  call   <sprintf@plt>
  mov    %rbx,%rdi
  call   <strdup@plt>
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L1
  add    $0x20,%rsp
  pop    %rbx
  ret
L1:
  call   <__stack_chk_fail@plt>
```

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

tool: D0: %p

assistant: ```c
char *get_name(void *addr) {
  char buf[20];
  sprintf(buf, "%p", addr);
  return strdup(buf);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<get_name>:
  endbr64
  push   %rbp
  mov    %rdi,%rdx
  lea    D0(%rip),%rsi
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <strdup@plt>
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L5
  add    $0x20,%rsp
  pop    %rbp
  ret
L5:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D0
type_infered: string

tool: D0: %p

assistant: ```c
char *get_name(void *addr) {
  char buf[20];
  sprintf(buf, "%p", addr);
  return strdup(buf);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<get_name>:
  endbr64
  push   %rbp
  mov    %rdi,%rdx
  lea    D0(%rip),%rsi
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <strdup@plt>
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L2
  add    $0x20,%rsp
  pop    %rbp
  ret
L2:
  call   <__stack_chk_fail@plt>
```

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

tool: D0: %p

assistant: ```c
char *get_name(void *addr) {
  char buf[20];
  sprintf(buf, "%p", addr);
  return strdup(buf);
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<eunlink>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <unlink@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0xffffffff,-0x4(%rbp)
  jne    L2
  lea    D0(%rip),%rax
  mov    %rax,%rsi
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  call   <syssuerr@plt>
L2:
  mov    -0x4(%rbp),%eax
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D0
data_type: string
name: retrieve_data
arguments: data_label: D13
data_type: string

tool: D0: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/TobbeTripitaka/src/refs/heads/master/trip/iwave/sucore/src/syscalls.c

tool: D13: %s: eunlink: unlink failed

assistant: ```c
int eunlink(char *path) {
  int returnmode;
  if (-1 == (returnmode = unlink(path)))
    syssuerr("%s: eunlink: unlink failed", "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/TobbeTripitaka/src/refs/heads/master/trip/iwave/sucore/src/syscalls.c");
  return returnmode;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<eunlink>:
  endbr64
  push   %rbx
  call   <unlink@plt>
  mov    %eax,%ebx
  cmp    $0xffffffff,%eax
  je     L14
L18:
  mov    %ebx,%eax
  pop    %rbx
  ret
L14:
  lea    D1(%rip),%rsi
  lea    D16(%rip),%rdi
  call   <syssuerr@plt>
  jmp    L18
```

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

tool: D1: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/TobbeTripitaka/src/refs/heads/master/trip/iwave/sucore/src/syscalls.c

tool: D16: %s: eunlink: unlink failed

assistant: ```c
int eunlink(char *path) {
  int returnmode;
  if (-1 == (returnmode = unlink(path)))
    syssuerr("%s: eunlink: unlink failed", "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/TobbeTripitaka/src/refs/heads/master/trip/iwave/sucore/src/syscalls.c");
  return returnmode;
}
```
user: Translate the below assembly code into C programming language:

```asm
<eunlink>:
  endbr64
  push   %r12
  call   <unlink@plt>
  mov    %eax,%r12d
  cmp    $0xffffffff,%eax
  je     L0
  mov    %r12d,%eax
  pop    %r12
  ret
  nopl   0x0(%rax)
L0:
  lea    D17(%rip),%rsi
  lea    D3(%rip),%rdi
  call   <syssuerr@plt>
  mov    %r12d,%eax
  pop    %r12
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D17
datatype: string
name: extract_symbolic_data
arguments: tag: D3
datatype: string

tool: D17: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/TobbeTripitaka/src/refs/heads/master/trip/iwave/sucore/src/syscalls.c

tool: D3: %s: eunlink: unlink failed

assistant: ```c
int eunlink(char *path) {
  int returnmode;
  if (-1 == (returnmode = unlink(path)))
    syssuerr("%s: eunlink: unlink failed", "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/TobbeTripitaka/src/refs/heads/master/trip/iwave/sucore/src/syscalls.c");
  return returnmode;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<eunlink>:
  endbr64
  push   %r12
  call   <unlink@plt>
  mov    %eax,%r12d
  cmp    $0xffffffff,%eax
  je     L1
  mov    %r12d,%eax
  pop    %r12
  ret
  nopl   0x0(%rax)
L1:
  lea    D11(%rip),%rsi
  lea    D2(%rip),%rdi
  call   <syssuerr@plt>
  mov    %r12d,%eax
  pop    %r12
  ret
```

tool_calls: name: unpack_data
arguments: tag: D11
data_type: string
name: unpack_data
arguments: tag: D2
data_type: string

tool: D11: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/TobbeTripitaka/src/refs/heads/master/trip/iwave/sucore/src/syscalls.c

tool: D2: %s: eunlink: unlink failed

assistant: ```c
int eunlink(char *path) {
  int returnmode;
  if (-1 == (returnmode = unlink(path)))
    syssuerr("%s: eunlink: unlink failed", "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/TobbeTripitaka/src/refs/heads/master/trip/iwave/sucore/src/syscalls.c");
  return returnmode;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<domktime>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,%eax
  mov    %al,-0x1c(%rbp)
  jmp    L44
L51:
  cmpb   $0x2d,-0x1c(%rbp)
  jne    L21
  mov    $0x2d,%esi
  jmp    L30
L21:
  mov    $0x2b,%esi
L30:
  mov    -0x18(%rbp),%rax
  mov    $0x0,%ecx
  mov    $0x1,%edx
  mov    %rax,%rdi
  call   <adjhour@plt>
L44:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <mktime@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0xffffffff,-0x4(%rbp)
  jne    L29
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0x44,%eax
  jle    L29
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0x89,%eax
  jle    L51
L29:
  mov    -0x4(%rbp),%eax
  leave
  ret
```

assistant: ```c
int domktime(struct tm *t, char type) {
  time_t ret;
  while ((ret = mktime(t)) == -1 && t->tm_year > 68 && t->tm_year < 138)
    adjhour(t, type == '-' ? type : '+', 1, 0);
  return ret;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<domktime>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  cmp    $0x2d,%sil
  sete   %al
  movzbl %al,%eax
  lea    0x2b(%rax,%rax,1),%ebp
L18:
  mov    %rbx,%rdi
  call   <mktime@plt>
  cmp    $0xffffffff,%eax
  jne    L1
  mov    (%rbx),%ecx
  lea    -0x45(%rcx),%edx
  cmp    $0x44,%edx
  ja     L1
  mov    $0x0,%ecx
  mov    $0x1,%edx
  mov    %ebp,%esi
  mov    %rbx,%rdi
  call   <adjhour@plt>
  jmp    L18
L1:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
int domktime(struct tm *t, char type) {
  time_t ret;
  while ((ret = mktime(t)) == -1 && t->tm_year > 68 && t->tm_year < 138)
    adjhour(t, type == '-' ? type : '+', 1, 0);
  return ret;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<domktime>:
  endbr64
  push   %rbp
  xor    %eax,%eax
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  cmp    $0x2d,%sil
  sete   %al
  lea    0x2b(%rax,%rax,1),%ebp
  jmp    L16
  nopl   0x0(%rax)
L12:
  xor    %ecx,%ecx
  mov    $0x1,%edx
  mov    %ebp,%esi
  mov    %rbx,%rdi
  call   <adjhour@plt>
L16:
  mov    %rbx,%rdi
  call   <mktime@plt>
  cmp    $0xffffffff,%eax
  jne    L7
  mov    (%rbx),%ecx
  lea    -0x45(%rcx),%edx
  cmp    $0x44,%edx
  jbe    L12
L7:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
int domktime(struct tm *t, char type) {
  time_t ret;
  while ((ret = mktime(t)) == -1 && t->tm_year > 68 && t->tm_year < 138)
    adjhour(t, type == '-' ? type : '+', 1, 0);
  return ret;
}
```
user: What is the c source code of the assembly code below?

```asm
<domktime>:
  endbr64
  push   %rbp
  xor    %eax,%eax
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  cmp    $0x2d,%sil
  sete   %al
  lea    0x2b(%rax,%rax,1),%ebp
  jmp    L11
  nopl   0x0(%rax)
L13:
  xor    %ecx,%ecx
  mov    $0x1,%edx
  mov    %ebp,%esi
  mov    %rbx,%rdi
  call   <adjhour@plt>
L11:
  mov    %rbx,%rdi
  call   <mktime@plt>
  cmp    $0xffffffff,%eax
  jne    L7
  mov    (%rbx),%ecx
  lea    -0x45(%rcx),%edx
  cmp    $0x44,%edx
  jbe    L13
L7:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
int domktime(struct tm *t, char type) {
  time_t ret;
  while ((ret = mktime(t)) == -1 && t->tm_year > 68 && t->tm_year < 138)
    adjhour(t, type == '-' ? type : '+', 1, 0);
  return ret;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<xstrlcat>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %edx,-0x44(%rbp)
  mov    -0x38(%rbp),%rbx
  mov    -0x40(%rbp),%r13
  mov    -0x44(%rbp),%r12d
  jmp    L15
L57:
  add    $0x1,%rbx
L15:
  movzbl (%rbx),%eax
  test   %al,%al
  je     L42
  mov    %r12d,%eax
  lea    -0x1(%rax),%r12d
  test   %eax,%eax
  jne    L57
L42:
  mov    %rbx,%rax
  sub    -0x38(%rbp),%rax
  mov    %eax,-0x24(%rbp)
  mov    -0x44(%rbp),%eax
  sub    -0x24(%rbp),%eax
  mov    %eax,%r12d
  test   %r12d,%r12d
  jne    L21
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    -0x24(%rbp),%edx
  add    %edx,%eax
  jmp    L37
L32:
  cmp    $0x1,%r12d
  je     L64
  mov    %rbx,%rax
  lea    0x1(%rax),%rbx
  movzbl 0x0(%r13),%edx
  mov    %dl,(%rax)
  sub    $0x1,%r12d
L64:
  add    $0x1,%r13
L21:
  movzbl 0x0(%r13),%eax
  test   %al,%al
  jne    L32
  movb   $0x0,(%rbx)
  mov    %r13,%rax
  sub    -0x40(%rbp),%rax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
L37:
  add    $0x38,%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %rbp
  ret
```

assistant: ```c
int xstrlcat(char *dst, const char *src, int siz) {
  register char *d = dst;
  register const char *s = src;
  register int n = siz;
  int dlen;
  while (*d != '\0' && n-- != 0)
    d++;
  dlen = d - dst;
  n = siz - dlen;
  if (n == 0)
    return dlen + strlen(s);
  while (*s != '\0') {
    if (n != 1) {
      *d++ = *s;
      n--;
    }
    s++;
  }
  *d = '\0';
  return dlen + (s - src);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<xstrlcat>:
  endbr64
  push   %rbx
  mov    %rdi,%r8
  mov    %rsi,%rdi
  cmpb   $0x0,(%r8)
  je     L86
  test   %edx,%edx
  je     L59
  mov    %edx,%eax
  add    %r8,%rax
  mov    %r8,%rcx
L81:
  add    $0x1,%rcx
  cmpb   $0x0,(%rcx)
  je     L22
  cmp    %rax,%rcx
  jne    L81
  mov    %rax,%rcx
L22:
  mov    %rcx,%rsi
  sub    %r8,%rsi
  mov    %esi,%ebx
  sub    %esi,%edx
  je     L0
  movzbl (%rdi),%r8d
  mov    %rdi,%rax
  test   %r8b,%r8b
  jne    L9
L75:
  movb   $0x0,(%rcx)
  sub    %rdi,%rax
  add    %esi,%eax
L56:
  pop    %rbx
  ret
L86:
  mov    %r8,%rcx
  jmp    L22
L59:
  mov    %edx,%ebx
L0:
  call   <strlen@plt>
  add    %ebx,%eax
  jmp    L56
L5:
  add    $0x1,%rax
  movzbl (%rax),%r8d
  test   %r8b,%r8b
  je     L75
L9:
  cmp    $0x1,%edx
  je     L5
  mov    %r8b,(%rcx)
  sub    $0x1,%edx
  lea    0x1(%rcx),%rcx
  jmp    L5
```

assistant: ```c
int xstrlcat(char *dst, const char *src, int siz) {
  register char *d = dst;
  register const char *s = src;
  register int n = siz;
  int dlen;
  while (*d != '\0' && n-- != 0)
    d++;
  dlen = d - dst;
  n = siz - dlen;
  if (n == 0)
    return dlen + strlen(s);
  while (*s != '\0') {
    if (n != 1) {
      *d++ = *s;
      n--;
    }
    s++;
  }
  *d = '\0';
  return dlen + (s - src);
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<xstrlcat>:
  endbr64
  mov    %rdi,%r8
  push   %rbx
  mov    %rsi,%rdi
  cmpb   $0x0,(%r8)
  je     L138
  test   %edx,%edx
  je     L113
  mov    %edx,%eax
  mov    %r8,%rcx
  add    %r8,%rax
  jmp    L102
  nopl   0x0(%rax,%rax,1)
L17:
  cmp    %rax,%rcx
  je     L120
L102:
  add    $0x1,%rcx
  cmpb   $0x0,(%rcx)
  jne    L17
L120:
  mov    %rcx,%rsi
  sub    %r8,%rsi
  mov    %esi,%ebx
  sub    %esi,%edx
L9:
  test   %edx,%edx
  je     L84
  movzbl (%rdi),%r8d
  mov    %rdi,%rax
  test   %r8b,%r8b
  jne    L67
  jmp    L66
  nopw   0x0(%rax,%rax,1)
L61:
  mov    %r8b,(%rcx)
  sub    $0x1,%edx
  mov    %rax,%r8
  add    $0x1,%rcx
L0:
  lea    0x1(%r8),%rax
  movzbl 0x1(%r8),%r8d
  test   %r8b,%r8b
  je     L44
L67:
  cmp    $0x1,%edx
  jne    L61
  cmpb   $0x0,0x1(%rax)
  lea    0x1(%rax),%r8
  jne    L0
  mov    %r8d,%eax
  sub    %edi,%eax
L119:
  movb   $0x0,(%rcx)
  add    %esi,%eax
  pop    %rbx
  ret
  xchg   %ax,%ax
L44:
  sub    %edi,%eax
  jmp    L119
L113:
  xor    %ebx,%ebx
L84:
  call   <strlen@plt>
  add    %ebx,%eax
  pop    %rbx
  ret
L66:
  xor    %eax,%eax
  jmp    L119
L138:
  mov    %r8,%rcx
  xor    %ebx,%ebx
  xor    %esi,%esi
  jmp    L9
```

assistant: ```c
int xstrlcat(char *dst, const char *src, int siz) {
  register char *d = dst;
  register const char *s = src;
  register int n = siz;
  int dlen;
  while (*d != '\0' && n-- != 0)
    d++;
  dlen = d - dst;
  n = siz - dlen;
  if (n == 0)
    return dlen + strlen(s);
  while (*s != '\0') {
    if (n != 1) {
      *d++ = *s;
      n--;
    }
    s++;
  }
  *d = '\0';
  return dlen + (s - src);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<xstrlcat>:
  endbr64
  mov    %rdi,%r8
  push   %rbx
  mov    %rsi,%rdi
  cmpb   $0x0,(%r8)
  je     L111
  test   %edx,%edx
  je     L71
  mov    %edx,%eax
  mov    %r8,%rcx
  add    %r8,%rax
  jmp    L15
  nopl   0x0(%rax,%rax,1)
L121:
  cmp    %rax,%rcx
  je     L31
L15:
  add    $0x1,%rcx
  cmpb   $0x0,(%rcx)
  jne    L121
L31:
  mov    %rcx,%rsi
  sub    %r8,%rsi
  mov    %esi,%ebx
  sub    %esi,%edx
L3:
  test   %edx,%edx
  je     L85
  movzbl (%rdi),%r8d
  mov    %rdi,%rax
  test   %r8b,%r8b
  jne    L101
  jmp    L131
  nopw   0x0(%rax,%rax,1)
L100:
  mov    %r8b,(%rcx)
  sub    $0x1,%edx
  mov    %rax,%r8
  add    $0x1,%rcx
L129:
  lea    0x1(%r8),%rax
  movzbl 0x1(%r8),%r8d
  test   %r8b,%r8b
  je     L107
L101:
  cmp    $0x1,%edx
  jne    L100
  cmpb   $0x0,0x1(%rax)
  lea    0x1(%rax),%r8
  jne    L129
  mov    %r8d,%eax
  sub    %edi,%eax
L69:
  movb   $0x0,(%rcx)
  add    %esi,%eax
  pop    %rbx
  ret
  xchg   %ax,%ax
L107:
  sub    %edi,%eax
  jmp    L69
L71:
  xor    %ebx,%ebx
L85:
  call   <strlen@plt>
  add    %ebx,%eax
  pop    %rbx
  ret
L131:
  xor    %eax,%eax
  jmp    L69
L111:
  mov    %r8,%rcx
  xor    %ebx,%ebx
  xor    %esi,%esi
  jmp    L3
```

assistant: ```c
int xstrlcat(char *dst, const char *src, int siz) {
  register char *d = dst;
  register const char *s = src;
  register int n = siz;
  int dlen;
  while (*d != '\0' && n-- != 0)
    d++;
  dlen = d - dst;
  n = siz - dlen;
  if (n == 0)
    return dlen + strlen(s);
  while (*s != '\0') {
    if (n != 1) {
      *d++ = *s;
      n--;
    }
    s++;
  }
  *d = '\0';
  return dlen + (s - src);
}
```