ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 这段汇编代码用C语言表示是什么样的？

```asm
<clear_bitvector>:
  endbr64
  mov    %edi,%eax
  mov    %edi,%ecx
  shr    $0x5,%eax
  lea    (%rsi,%rax,4),%rsi
  mov    $0x1,%eax
  mov    (%rsi),%edx
  shl    %cl,%eax
  test   %eax,%edx
  je     L3
  xor    %eax,%edx
  mov    %edx,(%rsi)
L3:
  ret
```

assistant: ```c
void clear_bitvector(unsigned int idx, int *bitvec) {
  unsigned int neighbor_id = idx;
  int dword = (neighbor_id >> 5);
  int bit = neighbor_id & 0x1F;
  unsigned int current_value = bitvec[dword];
  if ((current_value & (1 << bit))) {
    bitvec[dword] = current_value ^ (1 << bit);
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<clear_bitvector>:
  endbr64
  mov    %edi,%eax
  mov    %edi,%ecx
  shr    $0x5,%eax
  lea    (%rsi,%rax,4),%rsi
  mov    $0x1,%eax
  mov    (%rsi),%edx
  shl    %cl,%eax
  test   %eax,%edx
  je     L1
  xor    %eax,%edx
  mov    %edx,(%rsi)
L1:
  ret
```

assistant: ```c
void clear_bitvector(unsigned int idx, int *bitvec) {
  unsigned int neighbor_id = idx;
  int dword = (neighbor_id >> 5);
  int bit = neighbor_id & 0x1F;
  unsigned int current_value = bitvec[dword];
  if ((current_value & (1 << bit))) {
    bitvec[dword] = current_value ^ (1 << bit);
  }
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<strlength>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L18
L3:
  addl   $0x1,-0x4(%rbp)
L18:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L3
  mov    -0x4(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int strlength(char *c) {
  int offset = 0;
  while (*(c + offset) != '\0')
    ++offset;
  return offset;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<strlength>:
  endbr64
  cmpb   $0x0,(%rdi)
  je     L22
  mov    $0x1,%eax
L5:
  mov    %eax,%edx
  add    $0x1,%rax
  cmpb   $0x0,-0x1(%rdi,%rax,1)
  jne    L5
L7:
  mov    %edx,%eax
  ret
L22:
  mov    $0x0,%edx
  jmp    L7
```

assistant: ```c
int strlength(char *c) {
  int offset = 0;
  while (*(c + offset) != '\0')
    ++offset;
  return offset;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<strlength>:
  endbr64
  cmpb   $0x0,(%rdi)
  je     L2
  mov    $0x1,%eax
  xchg   %ax,%ax
L6:
  mov    %eax,%r8d
  add    $0x1,%rax
  cmpb   $0x0,-0x1(%rdi,%rax,1)
  jne    L6
  mov    %r8d,%eax
  ret
  nopw   0x0(%rax,%rax,1)
L2:
  xor    %r8d,%r8d
  mov    %r8d,%eax
  ret
```

assistant: ```c
int strlength(char *c) {
  int offset = 0;
  while (*(c + offset) != '\0')
    ++offset;
  return offset;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<strlength>:
  endbr64
  cmpb   $0x0,(%rdi)
  je     L15
  mov    $0x1,%eax
  xchg   %ax,%ax
L11:
  mov    %eax,%r8d
  add    $0x1,%rax
  cmpb   $0x0,-0x1(%rdi,%rax,1)
  jne    L11
  mov    %r8d,%eax
  ret
  nopw   0x0(%rax,%rax,1)
L15:
  xor    %r8d,%r8d
  mov    %r8d,%eax
  ret
```

assistant: ```c
int strlength(char *c) {
  int offset = 0;
  while (*(c + offset) != '\0')
    ++offset;
  return offset;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<ft_striter>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  jmp    L6
L16:
  mov    -0x8(%rbp),%rax
  mov    -0x10(%rbp),%rdx
  mov    %rax,%rdi
  call   *%rdx
  addq   $0x1,-0x8(%rbp)
L6:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L16
  nop
  nop
  leave
  ret
```

assistant: ```c
void ft_striter(char *s, void (*f)(char *)) {
  while (*s != '\0') {
    (*f)(s);
    s++;
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<ft_striter>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  cmpb   $0x0,(%rdi)
  je     L3
L18:
  mov    %rbx,%rdi
  call   *%rbp
  add    $0x1,%rbx
  cmpb   $0x0,(%rbx)
  jne    L18
L3:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void ft_striter(char *s, void (*f)(char *)) {
  while (*s != '\0') {
    (*f)(s);
    s++;
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<ft_striter>:
  endbr64
  cmpb   $0x0,(%rdi)
  je     L1
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  nopl   (%rax)
L12:
  mov    %rbx,%rdi
  add    $0x1,%rbx
  call   *%rbp
  cmpb   $0x0,(%rbx)
  jne    L12
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   (%rax)
L1:
  ret
```

assistant: ```c
void ft_striter(char *s, void (*f)(char *)) {
  while (*s != '\0') {
    (*f)(s);
    s++;
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<ft_striter>:
  endbr64
  cmpb   $0x0,(%rdi)
  je     L1
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  nopl   (%rax)
L6:
  mov    %rbx,%rdi
  add    $0x1,%rbx
  call   *%rbp
  cmpb   $0x0,(%rbx)
  jne    L6
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   (%rax)
L1:
  ret
```

assistant: ```c
void ft_striter(char *s, void (*f)(char *)) {
  while (*s != '\0') {
    (*f)(s);
    s++;
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<OneWireIntDisable>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %esi,-0x8(%rbp)
  cmpl   $0x400b6000,-0x4(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <ASSERT@plt>
  mov    -0x8(%rbp),%eax
  and    $0xffffffe0,%eax
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <ASSERT@plt>
  mov    -0x4(%rbp),%eax
  add    $0x100,%eax
  cltq
  mov    (%rax),%ecx
  mov    -0x8(%rbp),%eax
  not    %eax
  mov    %eax,%esi
  mov    -0x4(%rbp),%eax
  add    $0x100,%eax
  cltq
  mov    %rax,%rdx
  mov    %ecx,%eax
  and    %esi,%eax
  mov    %eax,(%rdx)
  nop
  leave
  ret
```

assistant: ```c
void OneWireIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ASSERT(ui32Base == 0x400B6000);
  ASSERT((ui32IntFlags & ~(0x00000001 | 0x00000002 | 0x00000010 | 0x00000004 | 0x00000008)) == 0);
  (*((volatile uint32_t *)(ui32Base + 0x00000100))) &= ~ui32IntFlags;
}
```
user: What is the c source code of the assembly code below?

```asm
<OneWireIntDisable>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebx
  mov    %esi,%ebp
  cmp    $0x400b6000,%edi
  sete   %dil
  movzbl %dil,%edi
  call   <ASSERT@plt>
  test   $0xffffffe0,%ebp
  sete   %dil
  movzbl %dil,%edi
  call   <ASSERT@plt>
  add    $0x100,%ebx
  movslq %ebx,%rbx
  mov    (%rbx),%eax
  not    %ebp
  and    %eax,%ebp
  mov    %ebp,(%rbx)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void OneWireIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ASSERT(ui32Base == 0x400B6000);
  ASSERT((ui32IntFlags & ~(0x00000001 | 0x00000002 | 0x00000010 | 0x00000004 | 0x00000008)) == 0);
  (*((volatile uint32_t *)(ui32Base + 0x00000100))) &= ~ui32IntFlags;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<OneWireIntDisable>:
  endbr64
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %edi,%ebx
  xor    %edi,%edi
  sub    $0x8,%rsp
  cmp    $0x400b6000,%ebx
  sete   %dil
  call   <ASSERT@plt>
  xor    %edi,%edi
  test   $0xffffffe0,%ebp
  not    %ebp
  sete   %dil
  add    $0x100,%ebx
  call   <ASSERT@plt>
  movslq %ebx,%rbx
  mov    (%rbx),%eax
  and    %eax,%ebp
  mov    %ebp,(%rbx)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void OneWireIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ASSERT(ui32Base == 0x400B6000);
  ASSERT((ui32IntFlags & ~(0x00000001 | 0x00000002 | 0x00000010 | 0x00000004 | 0x00000008)) == 0);
  (*((volatile uint32_t *)(ui32Base + 0x00000100))) &= ~ui32IntFlags;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<OneWireIntDisable>:
  endbr64
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %edi,%ebx
  xor    %edi,%edi
  sub    $0x8,%rsp
  cmp    $0x400b6000,%ebx
  sete   %dil
  call   <ASSERT@plt>
  xor    %edi,%edi
  test   $0xffffffe0,%ebp
  not    %ebp
  sete   %dil
  add    $0x100,%ebx
  call   <ASSERT@plt>
  movslq %ebx,%rbx
  mov    (%rbx),%eax
  and    %eax,%ebp
  mov    %ebp,(%rbx)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void OneWireIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ASSERT(ui32Base == 0x400B6000);
  ASSERT((ui32IntFlags & ~(0x00000001 | 0x00000002 | 0x00000010 | 0x00000004 | 0x00000008)) == 0);
  (*((volatile uint32_t *)(ui32Base + 0x00000100))) &= ~ui32IntFlags;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<test>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  movl   $0x2,-0x4(%rbp)
  jmp    L10
L34:
  mov    -0x14(%rbp),%eax
  cltd
  idivl  -0x4(%rbp)
  mov    %edx,%eax
  test   %eax,%eax
  jne    L16
  mov    $0x0,%eax
  jmp    L27
L16:
  addl   $0x1,-0x4(%rbp)
L10:
  mov    -0x4(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L34
  mov    $0x1,%eax
L27:
  pop    %rbp
  ret
```

assistant: ```c
int test(int i) {
  for (int n = 2; n < i; n++) {
    if (i % n == 0) {
      return 0;
    }
  }
  return 1;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<test>:
  endbr64
  cmp    $0x2,%edi
  jle    L8
  test   $0x1,%dil
  je     L48
  mov    $0x2,%ecx
L18:
  add    $0x1,%ecx
  cmp    %ecx,%edi
  je     L4
  mov    %edi,%eax
  cltd
  idiv   %ecx
  mov    %edx,%eax
  test   %edx,%edx
  jne    L18
L49:
  ret
L4:
  mov    $0x1,%eax
  ret
L8:
  mov    $0x1,%eax
  ret
L48:
  mov    $0x0,%eax
  jmp    L49
```

assistant: ```c
int test(int i) {
  for (int n = 2; n < i; n++) {
    if (i % n == 0) {
      return 0;
    }
  }
  return 1;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<test>:
  endbr64
  cmp    $0x2,%edi
  jle    L51
  test   $0x1,%dil
  je     L40
  mov    $0x2,%ecx
  jmp    L30
  cs nopw 0x0(%rax,%rax,1)
L53:
  mov    %edi,%eax
  cltd
  idiv   %ecx
  test   %edx,%edx
  je     L54
L30:
  add    $0x1,%ecx
  cmp    %ecx,%edi
  jne    L53
L51:
  mov    $0x1,%edx
L54:
  mov    %edx,%eax
  ret
L40:
  xor    %edx,%edx
  jmp    L54
```

assistant: ```c
int test(int i) {
  for (int n = 2; n < i; n++) {
    if (i % n == 0) {
      return 0;
    }
  }
  return 1;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<test>:
  endbr64
  cmp    $0x2,%edi
  jle    L31
  test   $0x1,%dil
  je     L3
  mov    $0x2,%ecx
  jmp    L9
  cs nopw 0x0(%rax,%rax,1)
L12:
  mov    %edi,%eax
  cltd
  idiv   %ecx
  test   %edx,%edx
  je     L37
L9:
  add    $0x1,%ecx
  cmp    %ecx,%edi
  jne    L12
L31:
  mov    $0x1,%edx
L37:
  mov    %edx,%eax
  ret
L3:
  xor    %edx,%edx
  jmp    L37
```

assistant: ```c
int test(int i) {
  for (int n = 2; n < i; n++) {
    if (i % n == 0) {
      return 0;
    }
  }
  return 1;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<ziplistDelete>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  sub    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rcx
  mov    -0x18(%rbp),%rax
  mov    $0x1,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <__ziplistDelete@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x20(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x18(%rbp),%rax
  leave
  ret
```

assistant: ```c
unsigned char *ziplistDelete(unsigned char *zl, unsigned char **p) {
  size_t offset = *p - zl;
  zl = __ziplistDelete(zl, *p, 1);
  *p = zl + offset;
  return zl;
}
```
user: Translate the below assembly code into C programming language:

```asm
<ziplistDelete>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r12
  mov    %rsi,%rbp
  mov    (%rsi),%rbx
  mov    $0x1,%edx
  mov    %rbx,%rsi
  call   <__ziplistDelete@plt>
  sub    %r12,%rbx
  add    %rax,%rbx
  mov    %rbx,0x0(%rbp)
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
unsigned char *ziplistDelete(unsigned char *zl, unsigned char **p) {
  size_t offset = *p - zl;
  zl = __ziplistDelete(zl, *p, 1);
  *p = zl + offset;
  return zl;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<ziplistDelete>:
  endbr64
  push   %r12
  mov    $0x1,%edx
  mov    %rdi,%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    (%rsi),%rbx
  mov    %rbx,%rsi
  sub    %r12,%rbx
  call   <__ziplistDelete@plt>
  add    %rax,%rbx
  mov    %rbx,0x0(%rbp)
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
unsigned char *ziplistDelete(unsigned char *zl, unsigned char **p) {
  size_t offset = *p - zl;
  zl = __ziplistDelete(zl, *p, 1);
  *p = zl + offset;
  return zl;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<ziplistDelete>:
  endbr64
  push   %r12
  mov    $0x1,%edx
  mov    %rdi,%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    (%rsi),%rbx
  mov    %rbx,%rsi
  sub    %r12,%rbx
  call   <__ziplistDelete@plt>
  add    %rax,%rbx
  mov    %rbx,0x0(%rbp)
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
unsigned char *ziplistDelete(unsigned char *zl, unsigned char **p) {
  size_t offset = *p - zl;
  zl = __ziplistDelete(zl, *p, 1);
  *p = zl + offset;
  return zl;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<ft_strchar>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  jmp    L12
L1:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <ft_strchr@plt>
  cltq
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L36
  mov    -0x8(%rbp),%rax
  jmp    L23
L36:
  addq   $0x1,-0x20(%rbp)
L12:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L1
  mov    $0x0,%eax
L23:
  leave
  ret
```

assistant: ```c
char *ft_strchar(const char *s1, const char *s2) {
  char *temp;
  while (*s2) {
    if ((temp = ft_strchr(s1, *s2)))
      return (temp);
    s2++;
  }
  return (((void *)0));
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<ft_strchar>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%rbx
  movzbl (%rsi),%esi
  test   %sil,%sil
  je     L4
L11:
  movsbl %sil,%esi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <ft_strchr@plt>
  test   %eax,%eax
  jne    L33
  add    $0x1,%rbx
  movzbl (%rbx),%esi
  test   %sil,%sil
  jne    L11
  mov    $0x0,%eax
  jmp    L31
L33:
  cltq
L31:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L4:
  mov    $0x0,%eax
  jmp    L31
```

assistant: ```c
char *ft_strchar(const char *s1, const char *s2) {
  char *temp;
  while (*s2) {
    if ((temp = ft_strchr(s1, *s2)))
      return (temp);
    s2++;
  }
  return (((void *)0));
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<ft_strchar>:
  endbr64
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x8,%rsp
  movsbl (%rsi),%esi
  test   %sil,%sil
  je     L29
  mov    %rdi,%rbp
  jmp    L11
  nopw   0x0(%rax,%rax,1)
L34:
  movsbl 0x1(%rbx),%esi
  add    $0x1,%rbx
  test   %sil,%sil
  je     L29
L11:
  xor    %eax,%eax
  mov    %rbp,%rdi
  call   <ft_strchr@plt>
  test   %eax,%eax
  je     L34
  add    $0x8,%rsp
  cltq
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax)
L29:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
char *ft_strchar(const char *s1, const char *s2) {
  char *temp;
  while (*s2) {
    if ((temp = ft_strchr(s1, *s2)))
      return (temp);
    s2++;
  }
  return (((void *)0));
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<ft_strchar>:
  endbr64
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x8,%rsp
  movsbl (%rsi),%esi
  test   %sil,%sil
  je     L37
  mov    %rdi,%rbp
  jmp    L30
  nopw   0x0(%rax,%rax,1)
L39:
  movsbl 0x1(%rbx),%esi
  add    $0x1,%rbx
  test   %sil,%sil
  je     L37
L30:
  xor    %eax,%eax
  mov    %rbp,%rdi
  call   <ft_strchr@plt>
  test   %eax,%eax
  je     L39
  add    $0x8,%rsp
  cltq
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax)
L37:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
char *ft_strchar(const char *s1, const char *s2) {
  char *temp;
  while (*s2) {
    if ((temp = ft_strchr(s1, *s2)))
      return (temp);
    s2++;
  }
  return (((void *)0));
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<redisliteGetVarint32>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  and    $0x80,%eax
  test   %eax,%eax
  jne    L74
  mov    -0x30(%rbp),%rax
  mov    -0x1c(%rbp),%edx
  mov    %edx,(%rax)
  mov    $0x1,%eax
  jmp    L64
L74:
  addq   $0x1,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x18(%rbp),%eax
  and    $0x80,%eax
  test   %eax,%eax
  jne    L0
  andl   $0x7f,-0x1c(%rbp)
  shll   $0x7,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  or     -0x18(%rbp),%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  mov    %edx,(%rax)
  mov    $0x2,%eax
  jmp    L64
L0:
  addq   $0x1,-0x28(%rbp)
  shll   $0xe,-0x1c(%rbp)
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  or     %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  and    $0x80,%eax
  test   %eax,%eax
  jne    L37
  andl   $0x1fc07f,-0x1c(%rbp)
  andl   $0x7f,-0x18(%rbp)
  shll   $0x7,-0x18(%rbp)
  mov    -0x1c(%rbp),%eax
  or     -0x18(%rbp),%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  mov    %edx,(%rax)
  mov    $0x3,%eax
  jmp    L64
L37:
  subq   $0x2,-0x28(%rbp)
  lea    -0x10(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <redisliteGetVarint@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x10(%rbp),%rax
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  cmp    %rax,%rdx
  je     L9
  mov    -0x30(%rbp),%rax
  movl   $0xffffffff,(%rax)
  jmp    L66
L9:
  mov    -0x10(%rbp),%rax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  mov    %edx,(%rax)
L66:
  mov    -0x14(%rbp),%eax
L64:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L20
  call   <__stack_chk_fail@plt>
L20:
  leave
  ret
```

assistant: ```c
int redisliteGetVarint32(const unsigned char *p, int *v) {
  int a, b;
  a = *p;
  if (!(a & 0x80)) {
    *v = a;
    return 1;
  }
  p++;
  b = *p;
  if (!(b & 0x80)) {
    a &= 0x7f;
    a = a << 7;
    *v = a | b;
    return 2;
  }
  p++;
  a = a << 14;
  a |= *p;
  if (!(a & 0x80)) {
    a &= (0x7f << 14) | (0x7f);
    b &= 0x7f;
    b = b << 7;
    *v = a | b;
    return 3;
  }
  {
    long long v64;
    int n;
    p -= 2;
    n = redisliteGetVarint(p, &v64);
    if ((v64 & ((((long long)1) << 32) - 1)) != v64) {
      *v = 0xffffffff;
    } else {
      *v = (int)v64;
    }
    return n;
  }
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<redisliteGetVarint32>:
  endbr64
  push   %rbx
  sub    $0x10,%rsp
  mov    %rsi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  movzbl (%rdi),%eax
  movzbl %al,%edx
  test   %al,%al
  jns    L32
  movzbl 0x1(%rdi),%ecx
  test   %cl,%cl
  jns    L30
  shl    $0xe,%edx
  movzbl 0x2(%rdi),%eax
  or     %eax,%edx
  test   $0x80,%al
  je     L21
  mov    %rsp,%rsi
  call   <redisliteGetVarint@plt>
  mov    (%rsp),%rcx
  mov    %ecx,%edx
  cmp    %rdx,%rcx
  mov    $0xffffffffffffffff,%rcx
  cmovne %rcx,%rdx
  mov    %edx,(%rbx)
  jmp    L45
L32:
  mov    %edx,(%rsi)
  mov    $0x1,%eax
L45:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L61
  add    $0x10,%rsp
  pop    %rbx
  ret
L30:
  and    $0x7f,%eax
  shl    $0x7,%eax
  movzbl %cl,%ecx
  or     %ecx,%eax
  mov    %eax,(%rsi)
  mov    $0x2,%eax
  jmp    L45
L21:
  and    $0x7f,%ecx
  and    $0x1fc07f,%edx
  shl    $0x7,%ecx
  or     %ecx,%edx
  mov    %edx,(%rsi)
  mov    $0x3,%eax
  jmp    L45
L61:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int redisliteGetVarint32(const unsigned char *p, int *v) {
  int a, b;
  a = *p;
  if (!(a & 0x80)) {
    *v = a;
    return 1;
  }
  p++;
  b = *p;
  if (!(b & 0x80)) {
    a &= 0x7f;
    a = a << 7;
    *v = a | b;
    return 2;
  }
  p++;
  a = a << 14;
  a |= *p;
  if (!(a & 0x80)) {
    a &= (0x7f << 14) | (0x7f);
    b &= 0x7f;
    b = b << 7;
    *v = a | b;
    return 3;
  }
  {
    long long v64;
    int n;
    p -= 2;
    n = redisliteGetVarint(p, &v64);
    if ((v64 & ((((long long)1) << 32) - 1)) != v64) {
      *v = 0xffffffff;
    } else {
      *v = (int)v64;
    }
    return n;
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<redisliteGetVarint32>:
  endbr64
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x10,%rsp
  movzbl (%rdi),%edx
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  test   %dl,%dl
  jns    L44
  movzbl 0x1(%rdi),%ecx
  test   %cl,%cl
  jns    L29
  movzbl 0x2(%rdi),%eax
  shl    $0xe,%edx
  or     %eax,%edx
  test   $0x80,%al
  je     L3
  mov    %rsp,%rsi
  call   <redisliteGetVarint@plt>
  mov    (%rsp),%rdx
  mov    %edx,%ecx
  cmp    %rcx,%rdx
  mov    $0xffffffffffffffff,%rcx
  cmovne %rcx,%rdx
  mov    %edx,(%rbx)
L49:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L1
  add    $0x10,%rsp
  pop    %rbx
  ret
  nopl   0x0(%rax)
L44:
  mov    %edx,(%rsi)
  mov    $0x1,%eax
  jmp    L49
  nopl   0x0(%rax)
L29:
  mov    %edx,%eax
  and    $0x7f,%eax
  shl    $0x7,%eax
  or     %ecx,%eax
  mov    %eax,(%rsi)
  mov    $0x2,%eax
  jmp    L49
  nopl   0x0(%rax,%rax,1)
L3:
  and    $0x7f,%ecx
  and    $0x1fc07f,%edx
  mov    $0x3,%eax
  shl    $0x7,%ecx
  or     %ecx,%edx
  mov    %edx,(%rsi)
  jmp    L49
L1:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int redisliteGetVarint32(const unsigned char *p, int *v) {
  int a, b;
  a = *p;
  if (!(a & 0x80)) {
    *v = a;
    return 1;
  }
  p++;
  b = *p;
  if (!(b & 0x80)) {
    a &= 0x7f;
    a = a << 7;
    *v = a | b;
    return 2;
  }
  p++;
  a = a << 14;
  a |= *p;
  if (!(a & 0x80)) {
    a &= (0x7f << 14) | (0x7f);
    b &= 0x7f;
    b = b << 7;
    *v = a | b;
    return 3;
  }
  {
    long long v64;
    int n;
    p -= 2;
    n = redisliteGetVarint(p, &v64);
    if ((v64 & ((((long long)1) << 32) - 1)) != v64) {
      *v = 0xffffffff;
    } else {
      *v = (int)v64;
    }
    return n;
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<redisliteGetVarint32>:
  endbr64
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x10,%rsp
  movzbl (%rdi),%edx
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  test   %dl,%dl
  jns    L58
  movzbl 0x1(%rdi),%ecx
  test   %cl,%cl
  jns    L36
  movzbl 0x2(%rdi),%eax
  shl    $0xe,%edx
  or     %eax,%edx
  test   $0x80,%al
  je     L6
  mov    %rsp,%rsi
  call   <redisliteGetVarint@plt>
  mov    (%rsp),%rdx
  mov    %edx,%ecx
  cmp    %rcx,%rdx
  mov    $0xffffffffffffffff,%rcx
  cmovne %rcx,%rdx
  mov    %edx,(%rbx)
L55:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L56
  add    $0x10,%rsp
  pop    %rbx
  ret
  nopl   0x0(%rax)
L58:
  mov    %edx,(%rsi)
  mov    $0x1,%eax
  jmp    L55
  nopl   0x0(%rax)
L36:
  mov    %edx,%eax
  and    $0x7f,%eax
  shl    $0x7,%eax
  or     %ecx,%eax
  mov    %eax,(%rsi)
  mov    $0x2,%eax
  jmp    L55
  nopl   0x0(%rax,%rax,1)
L6:
  and    $0x7f,%ecx
  and    $0x1fc07f,%edx
  mov    $0x3,%eax
  shl    $0x7,%ecx
  or     %ecx,%edx
  mov    %edx,(%rsi)
  jmp    L55
L56:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int redisliteGetVarint32(const unsigned char *p, int *v) {
  int a, b;
  a = *p;
  if (!(a & 0x80)) {
    *v = a;
    return 1;
  }
  p++;
  b = *p;
  if (!(b & 0x80)) {
    a &= 0x7f;
    a = a << 7;
    *v = a | b;
    return 2;
  }
  p++;
  a = a << 14;
  a |= *p;
  if (!(a & 0x80)) {
    a &= (0x7f << 14) | (0x7f);
    b &= 0x7f;
    b = b << 7;
    *v = a | b;
    return 3;
  }
  {
    long long v64;
    int n;
    p -= 2;
    n = redisliteGetVarint(p, &v64);
    if ((v64 & ((((long long)1) << 32) - 1)) != v64) {
      *v = 0xffffffff;
    } else {
      *v = (int)v64;
    }
    return n;
  }
}
```