ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Converte this assembly snippet into its equivalent C code:

```asm
<reset_alarm>:
  endbr64
  push   %rbp
  mov    %edi,%ebp
  xor    %edi,%edi
  call   <alarm@plt>
  mov    D5(%rip),%rax
  mov    (%rax),%edi
  call   <clear_pending_blocked_signals@plt>
  mov    %ebp,%edi
  pop    %rbp
  jmp    1070 <alarm@plt>
```

assistant: ```c
void reset_alarm(unsigned int seconds) {
  alarm(0);
  clear_pending_blocked_signals(SIGALRM);
  alarm(seconds);
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<reset_alarm>:
  endbr64
  push   %rbp
  mov    %edi,%ebp
  xor    %edi,%edi
  call   <alarm@plt>
  mov    D4(%rip),%rax
  mov    (%rax),%edi
  call   <clear_pending_blocked_signals@plt>
  mov    %ebp,%edi
  pop    %rbp
  jmp    1070 <alarm@plt>
```

assistant: ```c
void reset_alarm(unsigned int seconds) {
  alarm(0);
  clear_pending_blocked_signals(SIGALRM);
  alarm(seconds);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<suppress_quotes>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x1,-0x4(%rbp)
  jle    L33
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x22,%al
  jne    L33
  mov    -0x4(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x22,%al
  jne    L33
  movl   $0x0,-0x8(%rbp)
  jmp    L8
L37:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x8(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x8(%rbp)
L8:
  mov    -0x4(%rbp),%eax
  sub    $0x2,%eax
  cmp    %eax,-0x8(%rbp)
  jl     L37
  mov    -0x4(%rbp),%eax
  cltq
  lea    -0x2(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
L33:
  nop
  leave
  ret
```

assistant: ```c
void suppress_quotes(char *string) {
  int l;
  int i;
  l = strlen(string);
  if (l >= 2) {
    if ((string[0] == '"') && (string[l - 1] == '"')) {
      for (i = 0; i < l - 2; i++) {
        string[i] = string[i + 1];
      }
      string[l - 2] = '\0';
    }
  }
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<suppress_quotes>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  cmp    $0x1,%eax
  jle    L25
  cmpb   $0x22,(%rbx)
  je     L34
L25:
  pop    %rbx
  ret
L34:
  movslq %eax,%rsi
  cmpb   $0x22,-0x1(%rbx,%rsi,1)
  jne    L25
  cmp    $0x2,%eax
  jle    L40
  mov    %rbx,%rdx
  lea    -0x3(%rax),%eax
  lea    0x1(%rbx,%rax,1),%rcx
L4:
  movzbl 0x1(%rdx),%eax
  mov    %al,(%rdx)
  add    $0x1,%rdx
  cmp    %rcx,%rdx
  jne    L4
L40:
  movb   $0x0,-0x2(%rbx,%rsi,1)
  jmp    L25
```

assistant: ```c
void suppress_quotes(char *string) {
  int l;
  int i;
  l = strlen(string);
  if (l >= 2) {
    if ((string[0] == '"') && (string[l - 1] == '"')) {
      for (i = 0; i < l - 2; i++) {
        string[i] = string[i + 1];
      }
      string[l - 2] = '\0';
    }
  }
}
```
user: What is the c source code of the assembly code below?

```asm
<suppress_quotes>:
  endbr64
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  call   <strlen@plt>
  cmp    $0x1,%eax
  jle    L32
  cmpb   $0x22,(%rbx)
  je     L11
L32:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L11:
  movslq %eax,%rbp
  cmpb   $0x22,-0x1(%rbx,%rbp,1)
  jne    L32
  cmp    $0x2,%eax
  je     L39
  lea    -0x3(%rax),%edx
  lea    0x1(%rbx),%rsi
  mov    %rbx,%rdi
  add    $0x1,%rdx
  call   <memmove@plt>
L39:
  movb   $0x0,-0x2(%rbx,%rbp,1)
  jmp    L32
```

assistant: ```c
void suppress_quotes(char *string) {
  int l;
  int i;
  l = strlen(string);
  if (l >= 2) {
    if ((string[0] == '"') && (string[l - 1] == '"')) {
      for (i = 0; i < l - 2; i++) {
        string[i] = string[i + 1];
      }
      string[l - 2] = '\0';
    }
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<suppress_quotes>:
  endbr64
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  call   <strlen@plt>
  cmp    $0x1,%eax
  jle    L0
  cmpb   $0x22,(%rbx)
  je     L26
L0:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L26:
  movslq %eax,%rbp
  cmpb   $0x22,-0x1(%rbx,%rbp,1)
  jne    L0
  cmp    $0x2,%eax
  je     L36
  lea    -0x3(%rax),%edx
  lea    0x1(%rbx),%rsi
  mov    %rbx,%rdi
  add    $0x1,%rdx
  call   <memmove@plt>
L36:
  movb   $0x0,-0x2(%rbx,%rbp,1)
  jmp    L0
```

assistant: ```c
void suppress_quotes(char *string) {
  int l;
  int i;
  l = strlen(string);
  if (l >= 2) {
    if ((string[0] == '"') && (string[l - 1] == '"')) {
      for (i = 0; i < l - 2; i++) {
        string[i] = string[i + 1];
      }
      string[l - 2] = '\0';
    }
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<stripline>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L13
L6:
  addl   $0x1,-0x4(%rbp)
L13:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  jne    L61
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L6
L61:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  sub    -0x4(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x4(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x18(%rbp),%rax
  add    %rax,%rcx
  mov    -0x18(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memmove@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  sub    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L38
L24:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  subl   $0x1,-0x4(%rbp)
L38:
  cmpl   $0x0,-0x4(%rbp)
  jle    L69
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x7b,%al
  je     L24
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  je     L24
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L24
L69:
  mov    -0x18(%rbp),%rax
  leave
  ret
```

assistant: ```c
char *stripline(char *pszBuf) {
  int i = 0;
  while (pszBuf[i] == ' ' && pszBuf[i] != 0)
    i++;
  memmove(pszBuf, pszBuf + i, strlen(pszBuf) - i + 1);
  i = strlen(pszBuf) - 1;
  while (i > 0 && (pszBuf[i] == '{' || pszBuf[i] == '\n' || pszBuf[i] == ' ')) {
    pszBuf[i] = 0;
    i--;
  }
  return pszBuf;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<stripline>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  cmpb   $0x20,(%rdi)
  jne    L6
  lea    0x1(%rdi),%rcx
  mov    %rcx,%rax
  mov    $0x1,%edx
  sub    %ecx,%edx
L45:
  lea    (%rdx,%rax,1),%r12d
  mov    %rax,%rbp
  add    $0x1,%rax
  cmpb   $0x20,-0x1(%rax)
  je     L45
L20:
  mov    %rbx,%rdi
  call   <strlen@plt>
  sub    %r12d,%eax
  lea    0x1(%rax),%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <memmove@plt>
  mov    %rbx,%rdi
  call   <strlen@plt>
  lea    -0x1(%rax),%edx
  test   %edx,%edx
  jle    L67
  movslq %edx,%rdx
  add    %rbx,%rdx
  movslq %eax,%rcx
  lea    -0x2(%rbx,%rcx,1),%r8
  lea    -0x2(%rax),%eax
  sub    %rax,%r8
  jmp    L22
L6:
  mov    %rdi,%rbp
  mov    $0x0,%r12d
  jmp    L20
L66:
  movb   $0x0,(%rdi)
  sub    $0x1,%rdx
  cmp    %r8,%rdx
  je     L67
L22:
  mov    %rdx,%rdi
  movzbl (%rdx),%eax
  cmp    $0x7b,%al
  sete   %cl
  cmp    $0xa,%al
  sete   %sil
  or     %sil,%cl
  jne    L66
  cmp    $0x20,%al
  je     L66
L67:
  mov    %rbx,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
char *stripline(char *pszBuf) {
  int i = 0;
  while (pszBuf[i] == ' ' && pszBuf[i] != 0)
    i++;
  memmove(pszBuf, pszBuf + i, strlen(pszBuf) - i + 1);
  i = strlen(pszBuf) - 1;
  while (i > 0 && (pszBuf[i] == '{' || pszBuf[i] == '\n' || pszBuf[i] == ' ')) {
    pszBuf[i] = 0;
    i--;
  }
  return pszBuf;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<stripline>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  cmpb   $0x20,(%rdi)
  jne    L34
  mov    %edi,%edx
  lea    0x1(%rdi),%rax
  neg    %edx
  nopl   0x0(%rax)
L47:
  lea    (%rdx,%rax,1),%ebx
  mov    %rax,%rbp
  add    $0x1,%rax
  cmpb   $0x20,-0x1(%rax)
  je     L47
L16:
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %rbp,%rsi
  mov    %r12,%rdi
  sub    %ebx,%eax
  lea    0x1(%rax),%edx
  call   <memmove@plt>
  mov    %r12,%rdi
  call   <strlen@plt>
  lea    -0x1(%rax),%edx
  test   %edx,%edx
  jle    L1
  movslq %eax,%rcx
  movslq %edx,%rdx
  sub    $0x2,%eax
  lea    -0x2(%r12,%rcx,1),%rdi
  add    %r12,%rdx
  sub    %rax,%rdi
  nopl   0x0(%rax,%rax,1)
L14:
  movzbl (%rdx),%eax
  cmp    $0x7b,%al
  sete   %cl
  cmp    $0xa,%al
  sete   %sil
  or     %sil,%cl
  jne    L56
  cmp    $0x20,%al
  jne    L1
L56:
  movb   $0x0,(%rdx)
  sub    $0x1,%rdx
  cmp    %rdx,%rdi
  jne    L14
L1:
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L34:
  mov    %rdi,%rbp
  xor    %ebx,%ebx
  jmp    L16
```

assistant: ```c
char *stripline(char *pszBuf) {
  int i = 0;
  while (pszBuf[i] == ' ' && pszBuf[i] != 0)
    i++;
  memmove(pszBuf, pszBuf + i, strlen(pszBuf) - i + 1);
  i = strlen(pszBuf) - 1;
  while (i > 0 && (pszBuf[i] == '{' || pszBuf[i] == '\n' || pszBuf[i] == ' ')) {
    pszBuf[i] = 0;
    i--;
  }
  return pszBuf;
}
```
user: Translate the below assembly code into C programming language:

```asm
<stripline>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  cmpb   $0x20,(%rdi)
  jne    L27
  mov    %edi,%edx
  lea    0x1(%rdi),%rax
  neg    %edx
  nopl   0x0(%rax)
L32:
  lea    (%rdx,%rax,1),%ebx
  mov    %rax,%rbp
  add    $0x1,%rax
  cmpb   $0x20,-0x1(%rax)
  je     L32
L3:
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %rbp,%rsi
  mov    %r12,%rdi
  sub    %ebx,%eax
  lea    0x1(%rax),%edx
  call   <memmove@plt>
  mov    %r12,%rdi
  call   <strlen@plt>
  lea    -0x1(%rax),%edx
  test   %edx,%edx
  jle    L65
  movslq %eax,%rcx
  movslq %edx,%rdx
  sub    $0x2,%eax
  lea    -0x2(%r12,%rcx,1),%rdi
  add    %r12,%rdx
  sub    %rax,%rdi
  nopl   0x0(%rax,%rax,1)
L46:
  movzbl (%rdx),%eax
  cmp    $0x7b,%al
  sete   %cl
  cmp    $0xa,%al
  sete   %sil
  or     %sil,%cl
  jne    L17
  cmp    $0x20,%al
  jne    L65
L17:
  movb   $0x0,(%rdx)
  sub    $0x1,%rdx
  cmp    %rdx,%rdi
  jne    L46
L65:
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L27:
  mov    %rdi,%rbp
  xor    %ebx,%ebx
  jmp    L3
```

assistant: ```c
char *stripline(char *pszBuf) {
  int i = 0;
  while (pszBuf[i] == ' ' && pszBuf[i] != 0)
    i++;
  memmove(pszBuf, pszBuf + i, strlen(pszBuf) - i + 1);
  i = strlen(pszBuf) - 1;
  while (i > 0 && (pszBuf[i] == '{' || pszBuf[i] == '\n' || pszBuf[i] == ' ')) {
    pszBuf[i] = 0;
    i--;
  }
  return pszBuf;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<fec_decode>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    %edx,-0x8(%rbp)
  mov    %rcx,-0x18(%rbp)
  mov    %r8,-0x20(%rbp)
  mov    %r9,-0x28(%rbp)
  mov    0x10(%rbp),%eax
  mov    %ax,-0x2c(%rbp)
  movzwl -0x2c(%rbp),%edi
  mov    -0x28(%rbp),%r9
  mov    -0x20(%rbp),%r8
  mov    -0x18(%rbp),%rcx
  mov    -0x8(%rbp),%edx
  mov    -0x10(%rbp),%rsi
  mov    -0x4(%rbp),%eax
  sub    $0x8,%rsp
  push   %rdi
  mov    %eax,%edi
  call   <reduce@plt>
  add    $0x10,%rsp
  movzwl -0x2c(%rbp),%r8d
  mov    -0x28(%rbp),%rdi
  mov    -0x20(%rbp),%rcx
  mov    -0x18(%rbp),%rdx
  mov    -0x10(%rbp),%rsi
  mov    -0x4(%rbp),%eax
  mov    %r8d,%r9d
  mov    %rdi,%r8
  mov    %eax,%edi
  call   <resolve@plt>
  nop
  leave
  ret
```

assistant: ```c
void fec_decode(unsigned int blockSize, unsigned char **data_blocks, unsigned int nr_data_blocks, unsigned char **fec_blocks, unsigned int *fec_block_nos, unsigned int *erased_blocks, unsigned short nr_fec_blocks) {
  reduce(blockSize, data_blocks, nr_data_blocks, fec_blocks, fec_block_nos, erased_blocks, nr_fec_blocks);
  resolve(blockSize, data_blocks, fec_blocks, fec_block_nos, erased_blocks, nr_fec_blocks);
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<fec_decode>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %edi,%ebx
  mov    %rsi,%rbp
  mov    %rcx,%r12
  mov    %r8,%r13
  mov    %r9,%r14
  movzwl 0x48(%rsp),%r15d
  push   %r15
  call   <reduce@plt>
  mov    %r15d,%r9d
  mov    %r14,%r8
  mov    %r13,%rcx
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %ebx,%edi
  call   <resolve@plt>
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void fec_decode(unsigned int blockSize, unsigned char **data_blocks, unsigned int nr_data_blocks, unsigned char **fec_blocks, unsigned int *fec_block_nos, unsigned int *erased_blocks, unsigned short nr_fec_blocks) {
  reduce(blockSize, data_blocks, nr_data_blocks, fec_blocks, fec_block_nos, erased_blocks, nr_fec_blocks);
  resolve(blockSize, data_blocks, fec_blocks, fec_block_nos, erased_blocks, nr_fec_blocks);
}
```
user: Translate the below assembly code into C programming language:

```asm
<fec_decode>:
  endbr64
  push   %r15
  push   %r14
  mov    %r8,%r14
  push   %r13
  mov    %rcx,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  mov    %r9,%rbx
  sub    $0x10,%rsp
  movzwl 0x48(%rsp),%r15d
  push   %r15
  call   <reduce@plt>
  add    $0x18,%rsp
  mov    %r15d,%r9d
  mov    %rbx,%r8
  mov    %r14,%rcx
  pop    %rbx
  mov    %r13,%rdx
  mov    %r12,%rsi
  mov    %ebp,%edi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1070 <resolve@plt>
```

assistant: ```c
void fec_decode(unsigned int blockSize, unsigned char **data_blocks, unsigned int nr_data_blocks, unsigned char **fec_blocks, unsigned int *fec_block_nos, unsigned int *erased_blocks, unsigned short nr_fec_blocks) {
  reduce(blockSize, data_blocks, nr_data_blocks, fec_blocks, fec_block_nos, erased_blocks, nr_fec_blocks);
  resolve(blockSize, data_blocks, fec_blocks, fec_block_nos, erased_blocks, nr_fec_blocks);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<fec_decode>:
  endbr64
  push   %r15
  push   %r14
  mov    %r8,%r14
  push   %r13
  mov    %rcx,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  mov    %r9,%rbx
  sub    $0x10,%rsp
  movzwl 0x48(%rsp),%r15d
  push   %r15
  call   <reduce@plt>
  add    $0x18,%rsp
  mov    %r15d,%r9d
  mov    %rbx,%r8
  mov    %r14,%rcx
  pop    %rbx
  mov    %r13,%rdx
  mov    %r12,%rsi
  mov    %ebp,%edi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1070 <resolve@plt>
```

assistant: ```c
void fec_decode(unsigned int blockSize, unsigned char **data_blocks, unsigned int nr_data_blocks, unsigned char **fec_blocks, unsigned int *fec_block_nos, unsigned int *erased_blocks, unsigned short nr_fec_blocks) {
  reduce(blockSize, data_blocks, nr_data_blocks, fec_blocks, fec_block_nos, erased_blocks, nr_fec_blocks);
  resolve(blockSize, data_blocks, fec_blocks, fec_block_nos, erased_blocks, nr_fec_blocks);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<child_join_close>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <child_close@plt>
  mov    -0x10(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <child_join@plt>
  leave
  ret
```

assistant: ```c
int child_join_close(struct child *child, struct error *err) {
  child_close(child);
  return child_join(child, err);
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<child_join_close>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  call   <child_close@plt>
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <child_join@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
int child_join_close(struct child *child, struct error *err) {
  child_close(child);
  return child_join(child, err);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<child_join_close>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x8,%rsp
  call   <child_close@plt>
  add    $0x8,%rsp
  mov    %r12,%rsi
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  jmp    1070 <child_join@plt>
```

assistant: ```c
int child_join_close(struct child *child, struct error *err) {
  child_close(child);
  return child_join(child, err);
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<child_join_close>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x8,%rsp
  call   <child_close@plt>
  add    $0x8,%rsp
  mov    %r12,%rsi
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  jmp    1070 <child_join@plt>
```

assistant: ```c
int child_join_close(struct child *child, struct error *err) {
  child_close(child);
  return child_join(child, err);
}
```
user: Translate the below assembly code into C programming language:

```asm
<parse_repo_owner>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  movq   $0x0,-0x10(%rbp)
  movq   $0x0,-0x18(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  jne    L84
  mov    $0x0,%eax
  jmp    L4
L84:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L41
  mov    $0x0,%eax
  jmp    L4
L41:
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L71
  mov    $0x0,%eax
  jmp    L4
L71:
  mov    -0x10(%rbp),%rax
  mov    $0x2f,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  je     L110
  mov    -0x18(%rbp),%rax
  sub    -0x10(%rbp),%rax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jne    L103
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  jmp    L4
L103:
  mov    -0x1c(%rbp),%edx
  mov    -0x10(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <substr@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x8(%rbp),%rax
  jmp    L4
L110:
  cmpq   $0x0,-0x30(%rbp)
  je     L49
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  test   %rax,%rax
  jle    L49
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x40,%al
  je     L49
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  mov    %rax,-0x18(%rbp)
L49:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x18(%rbp),%rax
L4:
  leave
  ret
```

assistant: ```c
char *parse_repo_owner(const char *slug, const char *fallback) {
  char *copy = NULL;
  char *owner = NULL;
  if (NULL == slug)
    return NULL;
  if (0 == strlen(slug))
    return NULL;
  if (!(copy = strdup(slug)))
    return NULL;
  if ((owner = strchr(copy, '/'))) {
    int delta = owner - copy;
    if (!delta) {
      free(copy);
      return NULL;
    }
    char *tmp = substr(copy, 0, delta);
    free(copy);
    return tmp;
  }
  if (fallback && 0 < strlen(copy) && '@' != copy[0]) {
    owner = strdup(fallback);
  }
  free(copy);
  return owner;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<parse_repo_owner>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  test   %rdi,%rdi
  je     L43
  mov    %rsi,%r12
  mov    $0x0,%ebx
  cmpb   $0x0,(%rdi)
  je     L117
  call   <strdup@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L18
  mov    $0x2f,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L5
  sub    %rbp,%rbx
  mov    %ebx,%edx
  test   %ebx,%ebx
  je     L84
  mov    $0x0,%esi
  mov    %rbp,%rdi
  call   <substr@plt>
  mov    %rax,%rbx
  mov    %rbp,%rdi
  call   <free@plt>
L117:
  mov    %rbx,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L84:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    $0x0,%ebx
  jmp    L117
L5:
  test   %r12,%r12
  je     L97
  mov    %rbp,%rdi
  call   <strlen@plt>
  test   %rax,%rax
  jle    L125
  cmpb   $0x40,0x0(%rbp)
  je     L125
  mov    %r12,%rdi
  call   <strdup@plt>
  mov    %rax,%rbx
  jmp    L125
L97:
  mov    %r12,%rbx
L125:
  mov    %rbp,%rdi
  call   <free@plt>
  jmp    L117
L43:
  mov    %rdi,%rbx
  jmp    L117
L18:
  mov    %rax,%rbx
  jmp    L117
```

assistant: ```c
char *parse_repo_owner(const char *slug, const char *fallback) {
  char *copy = NULL;
  char *owner = NULL;
  if (NULL == slug)
    return NULL;
  if (0 == strlen(slug))
    return NULL;
  if (!(copy = strdup(slug)))
    return NULL;
  if ((owner = strchr(copy, '/'))) {
    int delta = owner - copy;
    if (!delta) {
      free(copy);
      return NULL;
    }
    char *tmp = substr(copy, 0, delta);
    free(copy);
    return tmp;
  }
  if (fallback && 0 < strlen(copy) && '@' != copy[0]) {
    owner = strdup(fallback);
  }
  free(copy);
  return owner;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<parse_repo_owner>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  test   %rdi,%rdi
  je     L61
  cmpb   $0x0,(%rdi)
  je     L61
  mov    %rsi,%r13
  call   <strdup@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L61
  mov    $0x2f,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L83
  sub    %rbp,%r12
  mov    %r12d,%edx
  test   %r12d,%r12d
  je     L11
  mov    %rbp,%rdi
  xor    %esi,%esi
  call   <substr@plt>
  mov    %rbp,%rdi
  mov    %rax,%r12
  call   <free@plt>
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L11:
  mov    %rbp,%rdi
  call   <free@plt>
L61:
  xor    %r12d,%r12d
  pop    %rbp
  mov    %r12,%rax
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L83:
  test   %r13,%r13
  je     L4
  mov    %rbp,%rdi
  call   <strlen@plt>
  test   %rax,%rax
  je     L4
  cmpb   $0x40,0x0(%rbp)
  jne    L64
L4:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L64:
  mov    %r13,%rdi
  call   <strdup@plt>
  mov    %rax,%r12
  jmp    L4
```

assistant: ```c
char *parse_repo_owner(const char *slug, const char *fallback) {
  char *copy = NULL;
  char *owner = NULL;
  if (NULL == slug)
    return NULL;
  if (0 == strlen(slug))
    return NULL;
  if (!(copy = strdup(slug)))
    return NULL;
  if ((owner = strchr(copy, '/'))) {
    int delta = owner - copy;
    if (!delta) {
      free(copy);
      return NULL;
    }
    char *tmp = substr(copy, 0, delta);
    free(copy);
    return tmp;
  }
  if (fallback && 0 < strlen(copy) && '@' != copy[0]) {
    owner = strdup(fallback);
  }
  free(copy);
  return owner;
}
```