ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 下面的汇编指令对应的C源代码是什么:

```asm
<ILibIsDelimiter>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    %rcx,-0x28(%rbp)
  mov    %r8d,-0x2c(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x1,-0x4(%rbp)
  mov    -0x1c(%rbp),%edx
  mov    -0x2c(%rbp),%eax
  add    %edx,%eax
  cmp    %eax,-0x20(%rbp)
  jge    L4
  mov    $0x0,%eax
  jmp    L59
L4:
  movl   $0x0,-0x8(%rbp)
  jmp    L13
L58:
  mov    -0x1c(%rbp),%edx
  mov    -0x8(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x8(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  je     L36
  movl   $0x0,-0x4(%rbp)
  jmp    L1
L36:
  addl   $0x1,-0x8(%rbp)
L13:
  mov    -0x8(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L58
L1:
  mov    -0x4(%rbp),%eax
L59:
  pop    %rbp
  ret
```

assistant: ```c
int ILibIsDelimiter(char *buffer, int offset, int buffersize, char *Delimiter, int DelimiterLength) {
  int i = 0;
  int RetVal = 1;
  if (offset + DelimiterLength > buffersize) {
    return (0);
  }
  for (i = 0; i < DelimiterLength; ++i) {
    if (buffer[offset + i] != Delimiter[i]) {
      RetVal = 0;
      break;
    }
  }
  return (RetVal);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<ILibIsDelimiter>:
  endbr64
  lea    (%rsi,%r8,1),%r9d
  mov    $0x0,%eax
  cmp    %edx,%r9d
  jg     L30
  test   %r8d,%r8d
  jle    L38
  mov    %r8d,%r8d
  mov    $0x0,%eax
  movslq %esi,%rsi
  lea    (%rdi,%rsi,1),%rdx
L39:
  movzbl (%rcx,%rax,1),%edi
  cmp    %dil,(%rdx,%rax,1)
  jne    L26
  add    $0x1,%rax
  cmp    %r8,%rax
  jne    L39
  mov    $0x1,%eax
  ret
L38:
  mov    $0x1,%eax
  ret
L26:
  mov    $0x0,%eax
L30:
  ret
```

assistant: ```c
int ILibIsDelimiter(char *buffer, int offset, int buffersize, char *Delimiter, int DelimiterLength) {
  int i = 0;
  int RetVal = 1;
  if (offset + DelimiterLength > buffersize) {
    return (0);
  }
  for (i = 0; i < DelimiterLength; ++i) {
    if (buffer[offset + i] != Delimiter[i]) {
      RetVal = 0;
      break;
    }
  }
  return (RetVal);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<ILibIsDelimiter>:
  endbr64
  lea    (%rsi,%r8,1),%r9d
  xor    %eax,%eax
  cmp    %edx,%r9d
  jg     L32
  test   %r8d,%r8d
  jle    L0
  movslq %esi,%rsi
  movslq %r8d,%r8
  xor    %eax,%eax
  lea    (%rdi,%rsi,1),%rdx
  jmp    L1
  nopw   0x0(%rax,%rax,1)
L33:
  add    $0x1,%rax
  cmp    %r8,%rax
  je     L0
L1:
  movzbl (%rcx,%rax,1),%edi
  cmp    %dil,(%rdx,%rax,1)
  je     L33
  xor    %eax,%eax
L32:
  ret
  xchg   %ax,%ax
L0:
  mov    $0x1,%eax
  ret
```

assistant: ```c
int ILibIsDelimiter(char *buffer, int offset, int buffersize, char *Delimiter, int DelimiterLength) {
  int i = 0;
  int RetVal = 1;
  if (offset + DelimiterLength > buffersize) {
    return (0);
  }
  for (i = 0; i < DelimiterLength; ++i) {
    if (buffer[offset + i] != Delimiter[i]) {
      RetVal = 0;
      break;
    }
  }
  return (RetVal);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<ILibIsDelimiter>:
  endbr64
  lea    (%rsi,%r8,1),%r9d
  xor    %eax,%eax
  cmp    %edx,%r9d
  jg     L18
  test   %r8d,%r8d
  jle    L3
  movslq %esi,%rsi
  movslq %r8d,%r8
  xor    %eax,%eax
  lea    (%rdi,%rsi,1),%rdx
  jmp    L5
  nopw   0x0(%rax,%rax,1)
L16:
  add    $0x1,%rax
  cmp    %rax,%r8
  je     L3
L5:
  movzbl (%rcx,%rax,1),%edi
  cmp    %dil,(%rdx,%rax,1)
  je     L16
  xor    %eax,%eax
L18:
  ret
  xchg   %ax,%ax
L3:
  mov    $0x1,%eax
  ret
```

assistant: ```c
int ILibIsDelimiter(char *buffer, int offset, int buffersize, char *Delimiter, int DelimiterLength) {
  int i = 0;
  int RetVal = 1;
  if (offset + DelimiterLength > buffersize) {
    return (0);
  }
  for (i = 0; i < DelimiterLength; ++i) {
    if (buffer[offset + i] != Delimiter[i]) {
      RetVal = 0;
      break;
    }
  }
  return (RetVal);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<sdbm_hash>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movq   $0x0,-0x8(%rbp)
  jmp    L3
L18:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  shl    $0x6,%rax
  add    %rax,%rdx
  mov    -0x8(%rbp),%rax
  shl    $0x10,%rax
  add    %rdx,%rax
  sub    -0x8(%rbp),%rax
  mov    %rax,-0x8(%rbp)
L3:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  jne    L18
  mov    -0x8(%rbp),%rax
  pop    %rbp
  ret
```

assistant: ```c
unsigned long sdbm_hash(const char *str) {
  unsigned long hash;
  int c;
  hash = 0;
  while ((c = (unsigned char)*str++))
    hash = c + (hash << 6) + (hash << 16) - hash;
  return hash;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<sdbm_hash>:
  endbr64
  lea    0x1(%rdi),%rcx
  movzbl (%rdi),%edx
  test   %dl,%dl
  je     L19
  mov    $0x0,%eax
L10:
  imul   $0x1003f,%rax,%rax
  movzbl %dl,%edx
  add    %rdx,%rax
  add    $0x1,%rcx
  movzbl -0x1(%rcx),%edx
  test   %dl,%dl
  jne    L10
  ret
L19:
  mov    $0x0,%eax
  ret
```

assistant: ```c
unsigned long sdbm_hash(const char *str) {
  unsigned long hash;
  int c;
  hash = 0;
  while ((c = (unsigned char)*str++))
    hash = c + (hash << 6) + (hash << 16) - hash;
  return hash;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<sdbm_hash>:
  endbr64
  movzbl (%rdi),%edx
  lea    0x1(%rdi),%rcx
  xor    %eax,%eax
  test   %dl,%dl
  je     L15
  nopl   0x0(%rax)
L5:
  imul   $0x1003f,%rax,%rax
  add    $0x1,%rcx
  add    %rdx,%rax
  movzbl -0x1(%rcx),%edx
  test   %dl,%dl
  jne    L5
  ret
  nop
L15:
  ret
```

assistant: ```c
unsigned long sdbm_hash(const char *str) {
  unsigned long hash;
  int c;
  hash = 0;
  while ((c = (unsigned char)*str++))
    hash = c + (hash << 6) + (hash << 16) - hash;
  return hash;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<sdbm_hash>:
  endbr64
  movzbl (%rdi),%edx
  lea    0x1(%rdi),%rcx
  xor    %eax,%eax
  test   %dl,%dl
  je     L3
  nopl   0x0(%rax)
L0:
  imul   $0x1003f,%rax,%rax
  add    $0x1,%rcx
  add    %rdx,%rax
  movzbl -0x1(%rcx),%edx
  test   %dl,%dl
  jne    L0
  ret
  nop
L3:
  ret
```

assistant: ```c
unsigned long sdbm_hash(const char *str) {
  unsigned long hash;
  int c;
  hash = 0;
  while ((c = (unsigned char)*str++))
    hash = c + (hash << 6) + (hash << 16) - hash;
  return hash;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<strcasestr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x40(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L62
  mov    -0x38(%rbp),%rax
  jmp    L19
L34:
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  jmp    L39
L33:
  addq   $0x1,-0x20(%rbp)
  addq   $0x1,-0x18(%rbp)
L39:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L30
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L30
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  mov    %rax,%rbx
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  cmp    %rax,%rbx
  je     L33
L30:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L37
  mov    -0x28(%rbp),%rax
  jmp    L19
L37:
  addq   $0x1,-0x28(%rbp)
L62:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L34
  mov    $0x0,%eax
L19:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
char *strcasestr(const char *str1, const char *str2) {
  char *cp = (char *)str1;
  char *s1, *s2;
  if (!*str2)
    return (char *)str1;
  while (*cp) {
    s1 = cp;
    s2 = (char *)str2;
    while (*s1 && *s2 && !(tolower(*s1) - tolower(*s2)))
      s1++, s2++;
    if (!*s2)
      return cp;
    cp++;
  }
  return NULL;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<strcasestr>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r12
  cmpb   $0x0,(%rsi)
  je     L49
  mov    %rsi,%r13
  cmpb   $0x0,(%rdi)
  jne    L23
  mov    $0x0,%r12d
  jmp    L49
L10:
  cmpb   $0x0,(%rbx)
  je     L49
  add    $0x1,%r12
  cmpb   $0x0,(%r12)
  je     L68
L23:
  movzbl (%r12),%edi
  mov    %r13,%rbx
  mov    %r12,%rbp
  test   %dil,%dil
  je     L10
L89:
  cmpb   $0x0,(%rbx)
  je     L49
  movsbl %dil,%edi
  call   <tolower@plt>
  mov    %rax,%r14
  movsbl (%rbx),%edi
  call   <tolower@plt>
  cmp    %rax,%r14
  jne    L10
  add    $0x1,%rbp
  add    $0x1,%rbx
  movzbl 0x0(%rbp),%edi
  test   %dil,%dil
  jne    L89
  jmp    L10
L68:
  mov    $0x0,%r12d
L49:
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
char *strcasestr(const char *str1, const char *str2) {
  char *cp = (char *)str1;
  char *s1, *s2;
  if (!*str2)
    return (char *)str1;
  while (*cp) {
    s1 = cp;
    s2 = (char *)str2;
    while (*s1 && *s2 && !(tolower(*s1) - tolower(*s2)))
      s1++, s2++;
    if (!*s2)
      return cp;
    cp++;
  }
  return NULL;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<strcasestr>:
  endbr64
  movzbl (%rsi),%eax
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  test   %al,%al
  je     L12
  movsbl (%rdi),%edi
  mov    %rsi,%r13
  test   %dil,%dil
  je     L78
  nopl   0x0(%rax)
L39:
  mov    %r13,%rbx
  mov    %r12,%r14
  jmp    L29
L54:
  call   <tolower@plt>
  movsbl (%rbx),%edi
  mov    %rax,%rbp
  call   <tolower@plt>
  cmp    %rax,%rbp
  jne    L50
  movsbl 0x1(%r14),%edi
  add    $0x1,%r14
  add    $0x1,%rbx
  movzbl (%rbx),%eax
  test   %dil,%dil
  je     L86
L29:
  test   %al,%al
  jne    L54
L12:
  pop    %rbx
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopw   0x0(%rax,%rax,1)
L50:
  movzbl (%rbx),%eax
L86:
  test   %al,%al
  je     L12
  movsbl 0x1(%r12),%edi
  add    $0x1,%r12
  test   %dil,%dil
  je     L78
  movzbl 0x0(%r13),%eax
  jmp    L39
L78:
  xor    %r12d,%r12d
  pop    %rbx
  pop    %rbp
  mov    %r12,%rax
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
char *strcasestr(const char *str1, const char *str2) {
  char *cp = (char *)str1;
  char *s1, *s2;
  if (!*str2)
    return (char *)str1;
  while (*cp) {
    s1 = cp;
    s2 = (char *)str2;
    while (*s1 && *s2 && !(tolower(*s1) - tolower(*s2)))
      s1++, s2++;
    if (!*s2)
      return cp;
    cp++;
  }
  return NULL;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<strcasestr>:
  endbr64
  movzbl (%rsi),%eax
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  test   %al,%al
  je     L43
  cmpb   $0x0,(%rdi)
  mov    %rsi,%r13
  je     L1
  xchg   %ax,%ax
L60:
  movsbl (%r12),%edi
  mov    %r13,%rbx
  mov    %r12,%r14
  test   %dil,%dil
  jne    L5
  jmp    L74
  nopw   0x0(%rax,%rax,1)
L8:
  call   <tolower@plt>
  movsbl (%rbx),%edi
  mov    %rax,%rbp
  call   <tolower@plt>
  cmp    %rax,%rbp
  jne    L77
  movsbl 0x1(%r14),%edi
  add    $0x1,%r14
  add    $0x1,%rbx
  movzbl (%rbx),%eax
  test   %dil,%dil
  je     L74
L5:
  cmpb   $0x0,(%rbx)
  jne    L8
L43:
  pop    %rbx
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L77:
  movzbl (%rbx),%eax
L74:
  test   %al,%al
  je     L43
  add    $0x1,%r12
  cmpb   $0x0,(%r12)
  je     L1
  movzbl 0x0(%r13),%eax
  jmp    L60
L1:
  xor    %r12d,%r12d
  pop    %rbx
  pop    %rbp
  mov    %r12,%rax
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
char *strcasestr(const char *str1, const char *str2) {
  char *cp = (char *)str1;
  char *s1, *s2;
  if (!*str2)
    return (char *)str1;
  while (*cp) {
    s1 = cp;
    s2 = (char *)str2;
    while (*s1 && *s2 && !(tolower(*s1) - tolower(*s2)))
      s1++, s2++;
    if (!*s2)
      return cp;
    cp++;
  }
  return NULL;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<PWMGenConfigure>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %esi,-0x8(%rbp)
  mov    %edx,-0xc(%rbp)
  cmpl   $0x40028000,-0x4(%rbp)
  je     L47
  cmpl   $0x40029000,-0x4(%rbp)
  jne    L30
L47:
  mov    $0x1,%eax
  jmp    L31
L30:
  mov    $0x0,%eax
L31:
  mov    %eax,%edi
  call   <ASSERT@plt>
  mov    -0x8(%rbp),%eax
  mov    %eax,%edi
  call   <_PWMGenValid@plt>
  mov    %eax,%edi
  call   <ASSERT@plt>
  mov    -0x4(%rbp),%eax
  add    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  cltq
  mov    (%rax),%eax
  and    $0xfff80001,%eax
  mov    -0x8(%rbp),%edx
  movslq %edx,%rdx
  or     -0xc(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0xc(%rbp),%eax
  and    $0x2,%eax
  test   %eax,%eax
  je     L17
  mov    -0x8(%rbp),%eax
  add    $0x20,%eax
  cltq
  movl   $0xb0,(%rax)
  mov    -0x8(%rbp),%eax
  add    $0x24,%eax
  cltq
  movl   $0xb00,(%rax)
  jmp    L43
L17:
  mov    -0x8(%rbp),%eax
  add    $0x20,%eax
  cltq
  movl   $0x8c,(%rax)
  mov    -0x8(%rbp),%eax
  add    $0x24,%eax
  cltq
  movl   $0x80c,(%rax)
L43:
  nop
  leave
  ret
```

assistant: ```c
void PWMGenConfigure(uint32_t ui32Base, uint32_t ui32Gen, uint32_t ui32Config) {
  ASSERT((ui32Base == 0x40028000) || (ui32Base == 0x40029000));
  ASSERT(_PWMGenValid(ui32Gen));
  ui32Gen = ((ui32Base) + (ui32Gen));
  (*((volatile uint32_t *)(ui32Gen + 0x00000000))) = (((*((volatile uint32_t *)(ui32Gen + 0x00000000))) & ~(0x00000002 | 0x00000004 | 0x00040000 | 0x00020000 | 0x00010000 | 0x0000C000 | 0x00003000 | 0x00000C00 | 0x00000300 | 0x000000C0 | 0x00000008 | 0x00000010 | 0x00000020)) | ui32Config);
  if (ui32Config & 0x00000002) {
    (*((volatile uint32_t *)(ui32Gen + 0x00000020))) = (0x00000030 | 0x00000080);
    (*((volatile uint32_t *)(ui32Gen + 0x00000024))) = (0x00000300 | 0x00000800);
  } else {
    (*((volatile uint32_t *)(ui32Gen + 0x00000020))) = (0x0000000C | 0x00000080);
    (*((volatile uint32_t *)(ui32Gen + 0x00000024))) = (0x0000000C | 0x00000800);
  }
}
```
user: What is the c source code of the assembly code below?

```asm
<PWMGenConfigure>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%ebx
  mov    %esi,%r12d
  mov    %edx,%ebp
  mov    %edi,%eax
  and    $0xef,%ah
  cmp    $0x40028000,%eax
  sete   %dil
  movzbl %dil,%edi
  call   <ASSERT@plt>
  mov    %r12d,%edi
  call   <_PWMGenValid@plt>
  mov    %eax,%edi
  call   <ASSERT@plt>
  lea    (%rbx,%r12,1),%eax
  movslq %eax,%rcx
  mov    (%rcx),%edx
  and    $0xfff80001,%edx
  or     %ebp,%edx
  mov    %edx,(%rcx)
  test   $0x2,%bpl
  je     L6
  lea    0x20(%rax),%edx
  movslq %edx,%rdx
  movl   $0xb0,(%rdx)
  add    $0x24,%eax
  cltq
  movl   $0xb00,(%rax)
L12:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L6:
  lea    0x20(%rax),%edx
  movslq %edx,%rdx
  movl   $0x8c,(%rdx)
  add    $0x24,%eax
  cltq
  movl   $0x80c,(%rax)
  jmp    L12
```

assistant: ```c
void PWMGenConfigure(uint32_t ui32Base, uint32_t ui32Gen, uint32_t ui32Config) {
  ASSERT((ui32Base == 0x40028000) || (ui32Base == 0x40029000));
  ASSERT(_PWMGenValid(ui32Gen));
  ui32Gen = ((ui32Base) + (ui32Gen));
  (*((volatile uint32_t *)(ui32Gen + 0x00000000))) = (((*((volatile uint32_t *)(ui32Gen + 0x00000000))) & ~(0x00000002 | 0x00000004 | 0x00040000 | 0x00020000 | 0x00010000 | 0x0000C000 | 0x00003000 | 0x00000C00 | 0x00000300 | 0x000000C0 | 0x00000008 | 0x00000010 | 0x00000020)) | ui32Config);
  if (ui32Config & 0x00000002) {
    (*((volatile uint32_t *)(ui32Gen + 0x00000020))) = (0x00000030 | 0x00000080);
    (*((volatile uint32_t *)(ui32Gen + 0x00000024))) = (0x00000300 | 0x00000800);
  } else {
    (*((volatile uint32_t *)(ui32Gen + 0x00000020))) = (0x0000000C | 0x00000080);
    (*((volatile uint32_t *)(ui32Gen + 0x00000024))) = (0x0000000C | 0x00000800);
  }
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<PWMGenConfigure>:
  endbr64
  mov    %edi,%eax
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  and    $0xef,%ah
  mov    %edx,%ebp
  push   %rbx
  mov    %edi,%ebx
  xor    %edi,%edi
  cmp    $0x40028000,%eax
  sete   %dil
  call   <ASSERT@plt>
  mov    %r12d,%edi
  call   <_PWMGenValid@plt>
  mov    %eax,%edi
  call   <ASSERT@plt>
  lea    (%rbx,%r12,1),%edi
  movslq %edi,%rdx
  mov    (%rdx),%eax
  and    $0xfff80001,%eax
  or     %ebp,%eax
  mov    %eax,(%rdx)
  lea    0x20(%rdi),%eax
  add    $0x24,%edi
  and    $0x2,%ebp
  cltq
  movslq %edi,%rdi
  je     L0
  movl   $0xb0,(%rax)
  movl   $0xb00,(%rdi)
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  cs nopw 0x0(%rax,%rax,1)
L0:
  movl   $0x8c,(%rax)
  movl   $0x80c,(%rdi)
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
void PWMGenConfigure(uint32_t ui32Base, uint32_t ui32Gen, uint32_t ui32Config) {
  ASSERT((ui32Base == 0x40028000) || (ui32Base == 0x40029000));
  ASSERT(_PWMGenValid(ui32Gen));
  ui32Gen = ((ui32Base) + (ui32Gen));
  (*((volatile uint32_t *)(ui32Gen + 0x00000000))) = (((*((volatile uint32_t *)(ui32Gen + 0x00000000))) & ~(0x00000002 | 0x00000004 | 0x00040000 | 0x00020000 | 0x00010000 | 0x0000C000 | 0x00003000 | 0x00000C00 | 0x00000300 | 0x000000C0 | 0x00000008 | 0x00000010 | 0x00000020)) | ui32Config);
  if (ui32Config & 0x00000002) {
    (*((volatile uint32_t *)(ui32Gen + 0x00000020))) = (0x00000030 | 0x00000080);
    (*((volatile uint32_t *)(ui32Gen + 0x00000024))) = (0x00000300 | 0x00000800);
  } else {
    (*((volatile uint32_t *)(ui32Gen + 0x00000020))) = (0x0000000C | 0x00000080);
    (*((volatile uint32_t *)(ui32Gen + 0x00000024))) = (0x0000000C | 0x00000800);
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<PWMGenConfigure>:
  endbr64
  mov    %edi,%eax
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  and    $0xef,%ah
  mov    %edx,%ebp
  push   %rbx
  mov    %edi,%ebx
  xor    %edi,%edi
  cmp    $0x40028000,%eax
  sete   %dil
  call   <ASSERT@plt>
  mov    %r12d,%edi
  call   <_PWMGenValid@plt>
  mov    %eax,%edi
  call   <ASSERT@plt>
  lea    (%rbx,%r12,1),%edi
  movslq %edi,%rdx
  mov    (%rdx),%eax
  and    $0xfff80001,%eax
  or     %ebp,%eax
  mov    %eax,(%rdx)
  lea    0x20(%rdi),%eax
  add    $0x24,%edi
  and    $0x2,%ebp
  cltq
  movslq %edi,%rdi
  je     L5
  movl   $0xb0,(%rax)
  movl   $0xb00,(%rdi)
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  cs nopw 0x0(%rax,%rax,1)
L5:
  movl   $0x8c,(%rax)
  movl   $0x80c,(%rdi)
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
void PWMGenConfigure(uint32_t ui32Base, uint32_t ui32Gen, uint32_t ui32Config) {
  ASSERT((ui32Base == 0x40028000) || (ui32Base == 0x40029000));
  ASSERT(_PWMGenValid(ui32Gen));
  ui32Gen = ((ui32Base) + (ui32Gen));
  (*((volatile uint32_t *)(ui32Gen + 0x00000000))) = (((*((volatile uint32_t *)(ui32Gen + 0x00000000))) & ~(0x00000002 | 0x00000004 | 0x00040000 | 0x00020000 | 0x00010000 | 0x0000C000 | 0x00003000 | 0x00000C00 | 0x00000300 | 0x000000C0 | 0x00000008 | 0x00000010 | 0x00000020)) | ui32Config);
  if (ui32Config & 0x00000002) {
    (*((volatile uint32_t *)(ui32Gen + 0x00000020))) = (0x00000030 | 0x00000080);
    (*((volatile uint32_t *)(ui32Gen + 0x00000024))) = (0x00000300 | 0x00000800);
  } else {
    (*((volatile uint32_t *)(ui32Gen + 0x00000020))) = (0x0000000C | 0x00000080);
    (*((volatile uint32_t *)(ui32Gen + 0x00000024))) = (0x0000000C | 0x00000800);
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<iupStrFileMakeFileName>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  je     L36
  cmpq   $0x0,-0x20(%rbp)
  jne    L9
L36:
  mov    $0x0,%eax
  jmp    L7
L9:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x10(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0xc(%rbp)
  mov    -0x10(%rbp),%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  add    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x10(%rbp),%edx
  mov    -0x18(%rbp),%rcx
  mov    -0x8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x10(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  je     L3
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x2f,(%rax)
  addl   $0x1,-0x10(%rbp)
L3:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0xc(%rbp),%edx
  mov    -0x20(%rbp),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  mov    -0x10(%rbp),%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x8(%rbp),%rax
L7:
  leave
  ret
```

assistant: ```c
char *iupStrFileMakeFileName(const char *path, const char *title) {
  if (!path || !title)
    return NULL;
  else {
    int size_path = (int)strlen(path);
    int size_title = (int)strlen(title);
    char *file_name = malloc(size_path + size_title + 2);
    memcpy(file_name, path, size_path);
    if (path[size_path - 1] != '/') {
      file_name[size_path] = '/';
      size_path++;
    }
    memcpy(file_name + size_path, title, size_title);
    file_name[size_path + size_title] = 0;
    return file_name;
  }
}
```
user: What is the c source code of the assembly code below:

```asm
<iupStrFileMakeFileName>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  test   %rdi,%rdi
  je     L30
  mov    %rdi,%rbx
  mov    %rsi,%r12
  test   %rsi,%rsi
  je     L30
  call   <strlen@plt>
  mov    %rax,%r14
  mov    %eax,%r13d
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %rax,%r15
  mov    %eax,0xc(%rsp)
  lea    0x2(%rax,%r14,1),%edi
  call   <malloc@plt>
  mov    %rax,%rbp
  mov    %r14d,%edx
  mov    %rbx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  movslq %r14d,%rax
  cmpb   $0x2f,-0x1(%rbx,%rax,1)
  je     L2
  movb   $0x2f,0x0(%rbp,%rax,1)
  lea    0x1(%r14),%r13d
L2:
  movslq %r13d,%rdi
  add    %rbp,%rdi
  mov    0xc(%rsp),%edx
  mov    %r12,%rsi
  call   <memcpy@plt>
  add    %r15d,%r13d
  movslq %r13d,%r13
  movb   $0x0,0x0(%rbp,%r13,1)
L4:
  mov    %rbp,%rax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L30:
  mov    $0x0,%ebp
  jmp    L4
```

assistant: ```c
char *iupStrFileMakeFileName(const char *path, const char *title) {
  if (!path || !title)
    return NULL;
  else {
    int size_path = (int)strlen(path);
    int size_title = (int)strlen(title);
    char *file_name = malloc(size_path + size_title + 2);
    memcpy(file_name, path, size_path);
    if (path[size_path - 1] != '/') {
      file_name[size_path] = '/';
      size_path++;
    }
    memcpy(file_name + size_path, title, size_title);
    file_name[size_path + size_title] = 0;
    return file_name;
  }
}
```