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

```asm
<free_interleaved>:
  endbr64
  sub    $0x8,%rsp
  call   <munmap@plt>
  test   %rax,%rax
  js     L7
  add    $0x8,%rsp
  ret
  nopw   0x0(%rax,%rax,1)
L7:
  lea    D2(%rip),%rdi
  call   <perror@plt>
  mov    $0x1,%edi
  add    $0x8,%rsp
  jmp    1090 <exit@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D2
type_infered: string

tool: D2: munmap

assistant: ```c
void free_interleaved(void *addr, size_t length) {
  if (munmap(addr, length) < 0) {
    perror("munmap");
    exit(1);
  }
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<get_memory>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %esi,-0xc(%rbp)
  mov    %rdx,-0x18(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  jne    L33
  mov    $0x0,%eax
  jmp    L36
L33:
  cmpq   $0x0,-0x8(%rbp)
  je     L16
  mov    -0xc(%rbp),%eax
  cltq
  imul   -0x18(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <realloc@plt>
  jmp    L36
L16:
  mov    -0xc(%rbp),%eax
  cltq
  mov    -0x18(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <calloc@plt>
L36:
  leave
  ret
```

assistant: ```c
void *get_memory(void *prev_addr, int n, size_t size) {
  if (n == 0)
    return ((void *)NULL);
  if (prev_addr)
    return (realloc((void *)prev_addr, (size_t)(n * size)));
  else
    return (calloc((size_t)n, (size_t)size));
}
```
user: What is the c source code of the assembly code below:

```asm
<get_memory>:
  endbr64
  test   %esi,%esi
  je     L20
  sub    $0x8,%rsp
  test   %rdi,%rdi
  je     L23
  movslq %esi,%rsi
  imul   %rdx,%rsi
  call   <realloc@plt>
L6:
  add    $0x8,%rsp
  ret
L23:
  movslq %esi,%rdi
  mov    %rdx,%rsi
  call   <calloc@plt>
  jmp    L6
L20:
  mov    $0x0,%eax
  ret
```

assistant: ```c
void *get_memory(void *prev_addr, int n, size_t size) {
  if (n == 0)
    return ((void *)NULL);
  if (prev_addr)
    return (realloc((void *)prev_addr, (size_t)(n * size)));
  else
    return (calloc((size_t)n, (size_t)size));
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<get_memory>:
  endbr64
  mov    %esi,%eax
  mov    %rdi,%r8
  mov    %rdx,%rsi
  test   %eax,%eax
  je     L18
  movslq %eax,%rdi
  test   %r8,%r8
  je     L19
  imul   %rdi,%rsi
  mov    %r8,%rdi
  jmp    1070 <realloc@plt>
  nopl   0x0(%rax)
L19:
  jmp    1060 <calloc@plt>
  nopl   (%rax)
L18:
  xor    %eax,%eax
  ret
```

assistant: ```c
void *get_memory(void *prev_addr, int n, size_t size) {
  if (n == 0)
    return ((void *)NULL);
  if (prev_addr)
    return (realloc((void *)prev_addr, (size_t)(n * size)));
  else
    return (calloc((size_t)n, (size_t)size));
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<get_memory>:
  endbr64
  mov    %esi,%eax
  mov    %rdi,%r8
  mov    %rdx,%rsi
  test   %eax,%eax
  je     L15
  movslq %eax,%rdi
  test   %r8,%r8
  je     L2
  imul   %rdi,%rsi
  mov    %r8,%rdi
  jmp    1070 <realloc@plt>
  nopl   0x0(%rax)
L2:
  jmp    1060 <calloc@plt>
  nopl   (%rax)
L15:
  xor    %eax,%eax
  ret
```

assistant: ```c
void *get_memory(void *prev_addr, int n, size_t size) {
  if (n == 0)
    return ((void *)NULL);
  if (prev_addr)
    return (realloc((void *)prev_addr, (size_t)(n * size)));
  else
    return (calloc((size_t)n, (size_t)size));
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<overflow>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    $0x4,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  lea    D14(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  nop
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D14
datatype: string
name: retrieve_data
arguments: data_label: D15
datatype: string

tool: D14: hello world

tool: D15: %s


assistant: ```c
void overflow() {
  char *p = (char *)malloc(4);
  strcpy(p, "hello world");
  free(p);
  printf("%s\n", p);
}
```
user: Translate the below assembly code into C programming language:

```asm
<overflow>:
  endbr64
  push   %rbx
  mov    $0x4,%edi
  call   <malloc@plt>
  mov    %rax,%rbx
  lea    D8(%rip),%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    %rbx,%rdi
  call   <free@plt>
  mov    %rbx,%rsi
  lea    D15(%rip),%rdi
  call   <printf@plt>
  pop    %rbx
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D8
data_type: string
name: unpack_data
arguments: data_label: D15
data_type: string

tool: D8: hello world

tool: D15: %s


assistant: ```c
void overflow() {
  char *p = (char *)malloc(4);
  strcpy(p, "hello world");
  free(p);
  printf("%s\n", p);
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<overflow>:
  endbr64
  push   %rbp
  mov    $0x4,%edi
  call   <malloc@plt>
  lea    D15(%rip),%rsi
  mov    %rax,%rbp
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %rbp,%rsi
  lea    D11(%rip),%rdi
  pop    %rbp
  jmp    10a0 <printf@plt>
```

tool_calls: name: read_data
arguments: tag: D15
type: string
name: read_data
arguments: tag: D11
type: string

tool: D15: hello world

tool: D11: %s


assistant: ```c
void overflow() {
  char *p = (char *)malloc(4);
  strcpy(p, "hello world");
  free(p);
  printf("%s\n", p);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<overflow>:
  endbr64
  push   %rbp
  mov    $0x4,%edi
  call   <malloc@plt>
  lea    D12(%rip),%rsi
  mov    %rax,%rbp
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %rbp,%rsi
  lea    D6(%rip),%rdi
  pop    %rbp
  jmp    10a0 <printf@plt>
```

tool_calls: name: read_data
arguments: data_label: D12
data_type: string
name: read_data
arguments: data_label: D6
data_type: string

tool: D12: hello world

tool: D6: %s


assistant: ```c
void overflow() {
  char *p = (char *)malloc(4);
  strcpy(p, "hello world");
  free(p);
  printf("%s\n", p);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<foo>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x20(%rbp),%rax
  mov    %rax,-0x38(%rbp)
  lea    -0x18(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  lea    -0x10(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  movl   $0x0,-0x3c(%rbp)
  jmp    L7
L23:
  mov    -0x3c(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movl   $0x1,(%rax)
  mov    -0x3c(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movl   $0x2,(%rax)
  mov    -0x3c(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    -0x3c(%rbp),%edx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x3c(%rbp)
L7:
  cmpl   $0x1,-0x3c(%rbp)
  jbe    L23
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L15
  call   <__stack_chk_fail@plt>
L15:
  leave
  ret
```

assistant: ```c
int foo(void) {
  int a[2], b[2], c[2];
  int *ap = &a[0];
  int *bp = &b[0];
  int *cp = &c[0];
#pragma omp parallel for
  for (unsigned int idx = 0; idx < 2; idx++) {
    ap[idx] = 1;
    bp[idx] = 2;
    cp[idx] = ap[idx];
  }
  return *cp;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<foo>:
  endbr64
  mov    $0x1,%eax
  ret
```

assistant: ```c
int foo(void) {
  int a[2], b[2], c[2];
  int *ap = &a[0];
  int *bp = &b[0];
  int *cp = &c[0];
#pragma omp parallel for
  for (unsigned int idx = 0; idx < 2; idx++) {
    ap[idx] = 1;
    bp[idx] = 2;
    cp[idx] = ap[idx];
  }
  return *cp;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<foo>:
  endbr64
  mov    $0x1,%eax
  ret
```

assistant: ```c
int foo(void) {
  int a[2], b[2], c[2];
  int *ap = &a[0];
  int *bp = &b[0];
  int *cp = &c[0];
#pragma omp parallel for
  for (unsigned int idx = 0; idx < 2; idx++) {
    ap[idx] = 1;
    bp[idx] = 2;
    cp[idx] = ap[idx];
  }
  return *cp;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<foo>:
  endbr64
  mov    $0x1,%eax
  ret
```

assistant: ```c
int foo(void) {
  int a[2], b[2], c[2];
  int *ap = &a[0];
  int *bp = &b[0];
  int *cp = &c[0];
#pragma omp parallel for
  for (unsigned int idx = 0; idx < 2; idx++) {
    ap[idx] = 1;
    bp[idx] = 2;
    cp[idx] = ap[idx];
  }
  return *cp;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<ensure_not_equals>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L38
  cmpq   $0x0,-0x10(%rbp)
  jne    L38
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <log_warn@plt>
  mov    $0x0,%eax
  call   <test_fail@plt>
L38:
  cmpq   $0x0,-0x8(%rbp)
  je     L15
  cmpq   $0x0,-0x10(%rbp)
  je     L15
  mov    -0x10(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L15
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  lea    D18(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <log_warn@plt>
  mov    $0x0,%eax
  call   <test_fail@plt>
L15:
  nop
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D3
data_type: string
name: unpack_data
arguments: data_tag: D18
data_type: string

tool: D3: strings are both NULL

tool: D18: strings are both "%s"

assistant: ```c
void ensure_not_equals(const char *a, const char *b) {
  if (a == NULL && b == NULL) {
    log_warn("strings are both NULL");
    test_fail();
  }
  if (a != NULL && b != NULL && strcmp(a, b) == 0) {
    log_warn("strings are both \"%s\"", a);
    test_fail();
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<ensure_not_equals>:
  endbr64
  push   %rbx
  mov    %rdi,%rax
  or     %rsi,%rax
  je     L39
  mov    %rdi,%rbx
  test   %rdi,%rdi
  je     L16
  test   %rsi,%rsi
  je     L16
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L16
  mov    %rbx,%rsi
  lea    D4(%rip),%rdi
  call   <log_warn@plt>
  mov    $0x0,%eax
  call   <test_fail@plt>
  jmp    L16
L39:
  lea    D6(%rip),%rdi
  mov    $0x0,%eax
  call   <log_warn@plt>
  mov    $0x0,%eax
  call   <test_fail@plt>
L16:
  pop    %rbx
  ret
```

tool_calls: name: parse_data
arguments: data_label: D4
type_guessed: string
name: parse_data
arguments: data_label: D6
type_guessed: string

tool: D4: strings are both "%s"

tool: D6: strings are both NULL

assistant: ```c
void ensure_not_equals(const char *a, const char *b) {
  if (a == NULL && b == NULL) {
    log_warn("strings are both NULL");
    test_fail();
  }
  if (a != NULL && b != NULL && strcmp(a, b) == 0) {
    log_warn("strings are both \"%s\"", a);
    test_fail();
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<ensure_not_equals>:
  endbr64
  mov    %rdi,%rax
  push   %rbp
  or     %rsi,%rax
  je     L3
  mov    %rdi,%rbp
  test   %rdi,%rdi
  je     L25
  test   %rsi,%rsi
  je     L25
  call   <strcmp@plt>
  test   %rax,%rax
  je     L5
L25:
  pop    %rbp
  ret
  cs nopw 0x0(%rax,%rax,1)
L3:
  lea    D0(%rip),%rdi
  xor    %eax,%eax
  call   <log_warn@plt>
  xor    %eax,%eax
  pop    %rbp
  jmp    1080 <test_fail@plt>
  cs nopw 0x0(%rax,%rax,1)
L5:
  mov    %rbp,%rsi
  lea    D6(%rip),%rdi
  call   <log_warn@plt>
  xor    %eax,%eax
  pop    %rbp
  jmp    1080 <test_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D0
type: string
name: disassemble_data
arguments: data_tag: D6
type: string

tool: D0: strings are both NULL

tool: D6: strings are both "%s"

assistant: ```c
void ensure_not_equals(const char *a, const char *b) {
  if (a == NULL && b == NULL) {
    log_warn("strings are both NULL");
    test_fail();
  }
  if (a != NULL && b != NULL && strcmp(a, b) == 0) {
    log_warn("strings are both \"%s\"", a);
    test_fail();
  }
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<ensure_not_equals>:
  endbr64
  mov    %rdi,%rax
  push   %rbp
  or     %rsi,%rax
  je     L11
  mov    %rdi,%rbp
  test   %rdi,%rdi
  je     L29
  test   %rsi,%rsi
  je     L29
  call   <strcmp@plt>
  test   %rax,%rax
  je     L18
L29:
  pop    %rbp
  ret
  cs nopw 0x0(%rax,%rax,1)
L11:
  lea    D12(%rip),%rdi
  xor    %eax,%eax
  call   <log_warn@plt>
  xor    %eax,%eax
  pop    %rbp
  jmp    1080 <test_fail@plt>
  cs nopw 0x0(%rax,%rax,1)
L18:
  mov    %rbp,%rsi
  lea    D8(%rip),%rdi
  call   <log_warn@plt>
  xor    %eax,%eax
  pop    %rbp
  jmp    1080 <test_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D12
data_type: string
name: extract_symbolic_data
arguments: label: D8
data_type: string

tool: D12: strings are both NULL

tool: D8: strings are both "%s"

assistant: ```c
void ensure_not_equals(const char *a, const char *b) {
  if (a == NULL && b == NULL) {
    log_warn("strings are both NULL");
    test_fail();
  }
  if (a != NULL && b != NULL && strcmp(a, b) == 0) {
    log_warn("strings are both \"%s\"", a);
    test_fail();
  }
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<I2CSlaveFIFODisable>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  add    $0x804,%eax
  cltq
  movl   $0x1,(%rax)
  nop
  pop    %rbp
  ret
```

assistant: ```c
void I2CSlaveFIFODisable(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000804))) = 0x00000001;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<I2CSlaveFIFODisable>:
  endbr64
  add    $0x804,%edi
  movslq %edi,%rdi
  movl   $0x1,(%rdi)
  ret
```

assistant: ```c
void I2CSlaveFIFODisable(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000804))) = 0x00000001;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<I2CSlaveFIFODisable>:
  endbr64
  add    $0x804,%edi
  movslq %edi,%rdi
  movl   $0x1,(%rdi)
  ret
```

assistant: ```c
void I2CSlaveFIFODisable(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000804))) = 0x00000001;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<parseARGHINTfile>:
  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   <strdup@plt>
  mov    %rax,%rdx
  mov    -0x10(%rbp),%rax
  mov    %rdx,(%rax)
  nop
  leave
  ret
```

assistant: ```c
void parseARGHINTfile(char *hint, char **argfile) {
  *argfile = strdup(hint);
  return;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<parseARGHINTfile>:
  endbr64
  push   %rbx
  mov    %rsi,%rbx
  call   <strdup@plt>
  mov    %rax,(%rbx)
  pop    %rbx
  ret
```

assistant: ```c
void parseARGHINTfile(char *hint, char **argfile) {
  *argfile = strdup(hint);
  return;
}
```
user: Translate the below assembly code into C programming language:

```asm
<parseARGHINTfile>:
  endbr64
  push   %rbx
  mov    %rsi,%rbx
  call   <strdup@plt>
  mov    %rax,(%rbx)
  pop    %rbx
  ret
```

assistant: ```c
void parseARGHINTfile(char *hint, char **argfile) {
  *argfile = strdup(hint);
  return;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<parseARGHINTfile>:
  endbr64
  push   %rbx
  mov    %rsi,%rbx
  call   <strdup@plt>
  mov    %rax,(%rbx)
  pop    %rbx
  ret
```

assistant: ```c
void parseARGHINTfile(char *hint, char **argfile) {
  *argfile = strdup(hint);
  return;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<my_strlen>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L4
L19:
  addl   $0x1,-0x4(%rbp)
L4:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%eax
  test   %al,%al
  jne    L19
  mov    -0x4(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int my_strlen(char *str) {
  int length = 0;
  while (*str++)
    length++;
  return length;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<my_strlen>:
  endbr64
  lea    0x1(%rdi),%rcx
  cmpb   $0x0,(%rdi)
  je     L25
  mov    %rcx,%rax
  mov    $0x1,%edx
  sub    %ecx,%edx
L7:
  lea    (%rdx,%rax,1),%ecx
  add    $0x1,%rax
  cmpb   $0x0,-0x1(%rax)
  jne    L7
L16:
  mov    %ecx,%eax
  ret
L25:
  mov    $0x0,%ecx
  jmp    L16
```

assistant: ```c
int my_strlen(char *str) {
  int length = 0;
  while (*str++)
    length++;
  return length;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<my_strlen>:
  endbr64
  cmpb   $0x0,(%rdi)
  lea    0x1(%rdi),%rax
  je     L8
  mov    $0x1,%edx
  sub    %eax,%edx
  nopl   0x0(%rax)
L11:
  lea    (%rdx,%rax,1),%r8d
  add    $0x1,%rax
  cmpb   $0x0,-0x1(%rax)
  jne    L11
  mov    %r8d,%eax
  ret
  nopw   0x0(%rax,%rax,1)
L8:
  xor    %r8d,%r8d
  mov    %r8d,%eax
  ret
```

assistant: ```c
int my_strlen(char *str) {
  int length = 0;
  while (*str++)
    length++;
  return length;
}
```
user: Translate the below assembly code into C programming language:

```asm
<my_strlen>:
  endbr64
  cmpb   $0x0,(%rdi)
  lea    0x1(%rdi),%rax
  je     L13
  mov    $0x1,%edx
  sub    %eax,%edx
  nopl   0x0(%rax)
L3:
  lea    (%rdx,%rax,1),%r8d
  add    $0x1,%rax
  cmpb   $0x0,-0x1(%rax)
  jne    L3
  mov    %r8d,%eax
  ret
  nopw   0x0(%rax,%rax,1)
L13:
  xor    %r8d,%r8d
  mov    %r8d,%eax
  ret
```

assistant: ```c
int my_strlen(char *str) {
  int length = 0;
  while (*str++)
    length++;
  return length;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<USBDevEndpointConfigGet>:
  endbr64
  testq  $0x2000,(%rcx)
  je     L115
  movq   $0x2000,(%rcx)
  add    %rdi,%rsi
  movzwl 0x100(%rsi),%eax
  movzwl %ax,%eax
  mov    %rax,(%rdx)
  movzbl 0x103(%rsi),%eax
  test   %al,%al
  js     L89
L40:
  test   $0x10,%al
  je     L121
  test   $0x4,%al
  je     L81
  orq    $0x10,(%rcx)
L121:
  test   $0x40,%al
  jne    L1
  orq    $0x100,(%rcx)
  ret
L89:
  orq    $0x1,(%rcx)
  jmp    L40
L81:
  orq    $0x8,(%rcx)
  jmp    L121
L115:
  movq   $0x0,(%rcx)
  add    %rdi,%rsi
  movzwl 0x104(%rsi),%eax
  movzwl %ax,%eax
  mov    %rax,(%rdx)
  movzbl 0x107(%rsi),%eax
  test   %al,%al
  js     L42
L101:
  test   $0x20,%al
  je     L20
  test   $0x8,%al
  je     L82
  orq    $0x10,(%rcx)
L20:
  test   $0x40,%al
  jne    L1
  orq    $0x100,(%rcx)
L1:
  ret
L42:
  orq    $0x4,(%rcx)
  jmp    L101
L82:
  orq    $0x8,(%rcx)
  jmp    L20
```

assistant: ```c
void USBDevEndpointConfigGet(unsigned long ulBase, unsigned long ulEndpoint, unsigned long *pulMaxPacketSize, unsigned long *pulFlags) {
  unsigned long ulRegister;
  ;
  ;

  ;
  if (*pulFlags & 0x00002000) {
    *pulFlags = 0x00002000;
    *pulMaxPacketSize = (unsigned long)(*((volatile unsigned short *)(ulBase + (ulEndpoint - 0x10) + 0x00000110)));
    ulRegister = (unsigned long)(*((volatile unsigned char *)(ulBase + (ulEndpoint - 0x10) + 0x00000113)));
    if (ulRegister & 0x00000080) {
      *pulFlags |= 0x00000001;
    }
    if (ulRegister & 0x00000010) {
      if (ulRegister & 0x00000004) {
        *pulFlags |= 0x00000010;
      } else {
        *pulFlags |= 0x00000008;
      }
    }
    if (ulRegister & 0x00000040) {
      *pulFlags |= 0x00000000;
    } else {
      *pulFlags |= 0x00000100;
    }
  } else {
    *pulFlags = 0x00000000;
    *pulMaxPacketSize = (unsigned long)(*((volatile unsigned short *)(ulBase + (ulEndpoint - 0x10) + 0x00000114)));
    ulRegister = (unsigned long)(*((volatile unsigned char *)(ulBase + (ulEndpoint - 0x10) + 0x00000117)));
    if (ulRegister & 0x00000080) {
      *pulFlags |= 0x00000004;
    }
    if (ulRegister & 0x00000020) {
      if (ulRegister & 0x00000008) {
        *pulFlags |= 0x00000010;
      } else {
        *pulFlags |= 0x00000008;
      }
    }
    if (ulRegister & 0x00000040) {
      *pulFlags |= 0x00000000;
    } else {
      *pulFlags |= 0x00000100;
    }
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<USBDevEndpointConfigGet>:
  endbr64
  mov    %rcx,%rax
  add    %rdi,%rsi
  testq  $0x2000,(%rcx)
  je     L25
  movq   $0x2000,(%rcx)
  movzwl 0x100(%rsi),%ecx
  mov    %rcx,(%rdx)
  movzbl 0x103(%rsi),%edx
  test   %dl,%dl
  js     L56
  test   $0x10,%dl
  jne    L63
  nopl   0x0(%rax,%rax,1)
L77:
  and    $0x40,%edx
  jne    L51
  orq    $0x100,(%rax)
L51:
  ret
  nopl   (%rax)
L25:
  movq   $0x0,(%rcx)
  movzwl 0x104(%rsi),%ecx
  mov    %rcx,(%rdx)
  movzbl 0x107(%rsi),%edx
  test   %dl,%dl
  js     L72
  test   $0x20,%dl
  je     L77
L21:
  mov    (%rax),%rcx
  mov    %rcx,%rsi
  or     $0x10,%rcx
  or     $0x8,%rsi
  test   $0x8,%dl
  cmove  %rsi,%rcx
  mov    %rcx,(%rax)
  jmp    L77
  nopl   0x0(%rax,%rax,1)
L63:
  mov    (%rax),%rcx
  mov    %rcx,%rsi
  or     $0x10,%rcx
  or     $0x8,%rsi
  test   $0x4,%dl
  cmove  %rsi,%rcx
  mov    %rcx,(%rax)
  jmp    L77
  nopw   0x0(%rax,%rax,1)
L72:
  orq    $0x4,(%rax)
  test   $0x20,%dl
  je     L77
  jmp    L21
  nopl   0x0(%rax,%rax,1)
L56:
  orq    $0x1,(%rax)
  test   $0x10,%dl
  je     L77
  jmp    L63
```

assistant: ```c
void USBDevEndpointConfigGet(unsigned long ulBase, unsigned long ulEndpoint, unsigned long *pulMaxPacketSize, unsigned long *pulFlags) {
  unsigned long ulRegister;
  ;
  ;

  ;
  if (*pulFlags & 0x00002000) {
    *pulFlags = 0x00002000;
    *pulMaxPacketSize = (unsigned long)(*((volatile unsigned short *)(ulBase + (ulEndpoint - 0x10) + 0x00000110)));
    ulRegister = (unsigned long)(*((volatile unsigned char *)(ulBase + (ulEndpoint - 0x10) + 0x00000113)));
    if (ulRegister & 0x00000080) {
      *pulFlags |= 0x00000001;
    }
    if (ulRegister & 0x00000010) {
      if (ulRegister & 0x00000004) {
        *pulFlags |= 0x00000010;
      } else {
        *pulFlags |= 0x00000008;
      }
    }
    if (ulRegister & 0x00000040) {
      *pulFlags |= 0x00000000;
    } else {
      *pulFlags |= 0x00000100;
    }
  } else {
    *pulFlags = 0x00000000;
    *pulMaxPacketSize = (unsigned long)(*((volatile unsigned short *)(ulBase + (ulEndpoint - 0x10) + 0x00000114)));
    ulRegister = (unsigned long)(*((volatile unsigned char *)(ulBase + (ulEndpoint - 0x10) + 0x00000117)));
    if (ulRegister & 0x00000080) {
      *pulFlags |= 0x00000004;
    }
    if (ulRegister & 0x00000020) {
      if (ulRegister & 0x00000008) {
        *pulFlags |= 0x00000010;
      } else {
        *pulFlags |= 0x00000008;
      }
    }
    if (ulRegister & 0x00000040) {
      *pulFlags |= 0x00000000;
    } else {
      *pulFlags |= 0x00000100;
    }
  }
}
```