ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<xxtea_decode_byte>:
  endbr64
  sub    $0x18,%rsp
  mov    %edx,%ecx
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  movabs $0x4b704e61457458,%rax
  sar    $0x1f,%ecx
  shr    $0x1e,%ecx
  mov    %rax,(%rsp)
  lea    (%rdx,%rcx,1),%eax
  movslq %edx,%rdx
  and    $0x3,%eax
  sub    %ecx,%eax
  cltq
  movslq (%rsi,%rax,4),%rax
  mov    %rax,%rcx
  imul   $0xffffffff80808081,%rax,%rax
  mov    %ecx,%esi
  sar    $0x1f,%esi
  shr    $0x20,%rax
  add    %ecx,%eax
  sar    $0x7,%eax
  sub    %esi,%eax
  mov    %eax,%esi
  shl    $0x8,%esi
  sub    %eax,%esi
  movzbl (%rdi),%eax
  xor    (%rsp,%rdx,1),%al
  sub    %esi,%ecx
  xor    %ecx,%eax
  mov    %al,(%rdi)
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L0
  add    $0x18,%rsp
  ret
L0:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void xxtea_decode_byte(unsigned char *v, int *k, off_t p) {
  unsigned char y[] = "XtEaNpK";
  *v = *v ^ (unsigned char)(k[p % 4] % 0xFF) ^ y[p];
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x20(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  movl   $0x0,-0x2c(%rbp)
  jmp    L16
L3:
  mov    -0x2c(%rbp),%eax
  mov    %eax,%esi
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x28(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x28(%rbp)
  mov    %eax,%esi
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  addl   $0x1,-0x2c(%rbp)
L16:
  cmpl   $0x4,-0x2c(%rbp)
  jle    L3
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <reverse@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L7
  call   <__stack_chk_fail@plt>
L7:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D24
data_type: string
name: extract_symbolic_data
arguments: data_label: D7
data_type: string
name: extract_symbolic_data
arguments: data_label: D12
data_type: string

tool: D24: Enter the %d integer:

tool: D7: %d

tool: D12: reverse array:

assistant: ```c
void main() {
  int i, a[5], *p = a;
  void reverse(int *);
  for (i = 0; i < 5; i++) {
    printf("Enter the %d integer:", i);
    scanf("%d", p++);
  }
  printf("reverse array:\n");
  reverse(p);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<main>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  mov    $0x0,%ebx
  lea    D23(%rip),%r13
  lea    D26(%rip),%r12
L3:
  mov    %ebx,%esi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %ebp,%esi
  mov    %r12,%rdi
  call   <scanf@plt>
  add    $0x1,%ebx
  add    $0x4,%rbp
  cmp    $0x5,%ebx
  jne    L3
  lea    D10(%rip),%rdi
  call   <puts@plt>
  lea    0x14(%rsp),%rdi
  call   <reverse@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L17
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L17:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D23
type: string
name: extract_symbolic_data
arguments: label: D26
type: string
name: extract_symbolic_data
arguments: label: D10
type: string

tool: D23: Enter the %d integer:

tool: D26: %d

tool: D10: reverse array:

assistant: ```c
void main() {
  int i, a[5], *p = a;
  void reverse(int *);
  for (i = 0; i < 5; i++) {
    printf("Enter the %d integer:", i);
    scanf("%d", p++);
  }
  printf("reverse array:\n");
  reverse(p);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  push   %r13
  lea    D25(%rip),%r13
  push   %r12
  lea    D4(%rip),%r12
  push   %rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
L10:
  mov    %ebx,%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  add    $0x1,%ebx
  call   <printf@plt>
  mov    %ebp,%esi
  mov    %r12,%rdi
  add    $0x4,%rbp
  call   <scanf@plt>
  cmp    $0x5,%ebx
  jne    L10
  lea    D16(%rip),%rdi
  call   <puts@plt>
  lea    0x14(%rsp),%rdi
  call   <reverse@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L2
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L2:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D25
datatype: string
name: disassemble_data
arguments: label: D4
datatype: string
name: disassemble_data
arguments: label: D16
datatype: string

tool: D25: Enter the %d integer:

tool: D4: %d

tool: D16: reverse array:

assistant: ```c
void main() {
  int i, a[5], *p = a;
  void reverse(int *);
  for (i = 0; i < 5; i++) {
    printf("Enter the %d integer:", i);
    scanf("%d", p++);
  }
  printf("reverse array:\n");
  reverse(p);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %r13
  lea    D21(%rip),%r13
  push   %r12
  lea    D10(%rip),%r12
  push   %rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
L11:
  mov    %ebx,%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  add    $0x1,%ebx
  call   <printf@plt>
  mov    %ebp,%esi
  mov    %r12,%rdi
  add    $0x4,%rbp
  call   <scanf@plt>
  cmp    $0x5,%ebx
  jne    L11
  lea    D17(%rip),%rdi
  call   <puts@plt>
  lea    0x14(%rsp),%rdi
  call   <reverse@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L1
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L1:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D21
datatype: string
name: parse_data
arguments: label: D10
datatype: string
name: parse_data
arguments: label: D17
datatype: string

tool: D21: Enter the %d integer:

tool: D10: %d

tool: D17: reverse array:

assistant: ```c
void main() {
  int i, a[5], *p = a;
  void reverse(int *);
  for (i = 0; i < 5; i++) {
    printf("Enter the %d integer:", i);
    scanf("%d", p++);
  }
  printf("reverse array:\n");
  reverse(p);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<setup_socket_server>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,%eax
  mov    %ax,-0x34(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    D32(%rip),%rax
  mov    (%rax),%ecx
  mov    D25(%rip),%rax
  mov    (%rax),%eax
  mov    $0x0,%edx
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <socket@plt>
  mov    %eax,-0x20(%rbp)
  cmpl   $0x0,-0x20(%rbp)
  jns    L99
  mov    $0xffffffff,%eax
  jmp    L3
L99:
  movl   $0x1,-0x24(%rbp)
  movl   $0x4,-0x1c(%rbp)
  mov    D27(%rip),%rax
  mov    (%rax),%edx
  mov    D41(%rip),%rax
  mov    (%rax),%esi
  mov    -0x1c(%rbp),%edi
  lea    -0x24(%rbp),%rcx
  mov    -0x20(%rbp),%eax
  mov    %edi,%r8d
  mov    %eax,%edi
  call   <setsockopt@plt>
  cmp    $0xffffffff,%eax
  jne    L0
  mov    $0xffffffff,%eax
  jmp    L3
L0:
  mov    -0x20(%rbp),%eax
  mov    %eax,%edi
  call   <socket_set_nonblocking@plt>
  cmp    $0xffffffff,%eax
  jne    L5
  mov    $0xffffffff,%eax
  jmp    L3
L5:
  mov    D11(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <htonl@plt>
  mov    %eax,-0xc(%rbp)
  movzwl -0x34(%rbp),%eax
  mov    %eax,%edi
  call   <htons@plt>
  mov    %eax,-0x10(%rbp)
  mov    D25(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,-0x14(%rbp)
  movl   $0xc,-0x18(%rbp)
  mov    -0x18(%rbp),%edx
  lea    -0x14(%rbp),%rcx
  mov    -0x20(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <bind@plt>
  test   %rax,%rax
  jns    L47
  mov    $0xffffffff,%eax
  jmp    L3
L47:
  mov    D26(%rip),%rax
  mov    (%rax),%edx
  mov    -0x20(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <listen@plt>
  test   %rax,%rax
  jns    L48
  mov    $0xffffffff,%eax
  jmp    L3
L48:
  mov    -0x20(%rbp),%eax
L3:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L28
  call   <__stack_chk_fail@plt>
L28:
  leave
  ret
```

assistant: ```c
int setup_socket_server(unsigned short port) {
  struct sockaddr_in addr;
  socklen_t addr_length;
  int fd, opt, opt_length;
  if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
    return -1;
  opt = 1;
  opt_length = sizeof(opt);
  if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &opt, opt_length) == -1)
    return -1;
  if (socket_set_nonblocking(fd) == -1)
    return -1;
  addr.sin_addr.s_addr = htonl(INADDR_ANY);
  addr.sin_port = htons(port);
  addr.sin_family = AF_INET;
  addr_length = sizeof(addr);
  if (bind(fd, (struct sockaddr *)&addr, addr_length) < 0)
    return -1;
  if (listen(fd, SOMAXCONN) < 0)
    return -1;
  return fd;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<setup_socket_server>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %edi,%ebp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    $0x0,%edx
  mov    D41(%rip),%rax
  mov    (%rax),%esi
  mov    D34(%rip),%rax
  mov    (%rax),%edi
  call   <socket@plt>
  test   %eax,%eax
  js     L14
  mov    %eax,%ebx
  movl   $0x1,0x8(%rsp)
  lea    0x8(%rsp),%rcx
  mov    $0x4,%r8d
  mov    D67(%rip),%rax
  mov    (%rax),%edx
  mov    D37(%rip),%rax
  mov    (%rax),%esi
  mov    %ebx,%edi
  call   <setsockopt@plt>
  cmp    $0xffffffff,%eax
  je     L35
  mov    %ebx,%edi
  call   <socket_set_nonblocking@plt>
  cmp    $0xffffffff,%eax
  je     L18
  mov    D56(%rip),%rax
  mov    (%rax),%edi
  call   <htonl@plt>
  mov    %eax,0x14(%rsp)
  movzwl %bp,%edi
  call   <htons@plt>
  mov    %eax,0x10(%rsp)
  mov    D34(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,0xc(%rsp)
  lea    0xc(%rsp),%rsi
  mov    $0xc,%edx
  mov    %ebx,%edi
  call   <bind@plt>
  test   %rax,%rax
  js     L26
  mov    D13(%rip),%rax
  mov    (%rax),%esi
  mov    %ebx,%edi
  call   <listen@plt>
  test   %rax,%rax
  mov    $0xffffffff,%eax
  cmovs  %eax,%ebx
L54:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L51
  mov    %ebx,%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  ret
L14:
  mov    $0xffffffff,%ebx
  jmp    L54
L35:
  mov    %eax,%ebx
  jmp    L54
L18:
  mov    %eax,%ebx
  jmp    L54
L26:
  mov    $0xffffffff,%ebx
  jmp    L54
L51:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int setup_socket_server(unsigned short port) {
  struct sockaddr_in addr;
  socklen_t addr_length;
  int fd, opt, opt_length;
  if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
    return -1;
  opt = 1;
  opt_length = sizeof(opt);
  if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &opt, opt_length) == -1)
    return -1;
  if (socket_set_nonblocking(fd) == -1)
    return -1;
  addr.sin_addr.s_addr = htonl(INADDR_ANY);
  addr.sin_port = htons(port);
  addr.sin_family = AF_INET;
  addr_length = sizeof(addr);
  if (bind(fd, (struct sockaddr *)&addr, addr_length) < 0)
    return -1;
  if (listen(fd, SOMAXCONN) < 0)
    return -1;
  return fd;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<setup_socket_server>:
  endbr64
  push   %r12
  xor    %edx,%edx
  push   %rbp
  push   %rbx
  mov    %edi,%ebx
  sub    $0x20,%rsp
  mov    D18(%rip),%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    D45(%rip),%rax
  mov    0x0(%rbp),%edi
  mov    (%rax),%esi
  call   <socket@plt>
  test   %eax,%eax
  js     L62
  mov    %eax,%r12d
  mov    D16(%rip),%rax
  lea    0x8(%rsp),%rcx
  mov    $0x4,%r8d
  mov    %r12d,%edi
  movl   $0x1,0x8(%rsp)
  mov    (%rax),%edx
  mov    D44(%rip),%rax
  mov    (%rax),%esi
  call   <setsockopt@plt>
  cmp    $0xffffffff,%eax
  je     L62
  mov    %r12d,%edi
  call   <socket_set_nonblocking@plt>
  cmp    $0xffffffff,%eax
  je     L62
  mov    D51(%rip),%rax
  mov    (%rax),%edi
  call   <htonl@plt>
  movzwl %bx,%edi
  mov    %eax,0x14(%rsp)
  call   <htons@plt>
  lea    0xc(%rsp),%rsi
  mov    $0xc,%edx
  mov    %r12d,%edi
  mov    %eax,0x10(%rsp)
  mov    0x0(%rbp),%eax
  mov    %eax,0xc(%rsp)
  call   <bind@plt>
  test   %rax,%rax
  js     L62
  mov    D2(%rip),%rax
  mov    %r12d,%edi
  mov    (%rax),%esi
  call   <listen@plt>
  test   %rax,%rax
  js     L62
L29:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L59
  add    $0x20,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L62:
  mov    $0xffffffff,%r12d
  jmp    L29
L59:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int setup_socket_server(unsigned short port) {
  struct sockaddr_in addr;
  socklen_t addr_length;
  int fd, opt, opt_length;
  if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
    return -1;
  opt = 1;
  opt_length = sizeof(opt);
  if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &opt, opt_length) == -1)
    return -1;
  if (socket_set_nonblocking(fd) == -1)
    return -1;
  addr.sin_addr.s_addr = htonl(INADDR_ANY);
  addr.sin_port = htons(port);
  addr.sin_family = AF_INET;
  addr_length = sizeof(addr);
  if (bind(fd, (struct sockaddr *)&addr, addr_length) < 0)
    return -1;
  if (listen(fd, SOMAXCONN) < 0)
    return -1;
  return fd;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<setup_socket_server>:
  endbr64
  push   %r12
  xor    %edx,%edx
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  sub    $0x20,%rsp
  mov    D21(%rip),%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    D23(%rip),%rax
  mov    (%rbx),%edi
  mov    (%rax),%esi
  call   <socket@plt>
  test   %eax,%eax
  js     L2
  mov    %eax,%r12d
  mov    D17(%rip),%rax
  lea    0x4(%rsp),%rcx
  mov    $0x4,%r8d
  mov    %r12d,%edi
  movl   $0x1,0x4(%rsp)
  mov    (%rax),%edx
  mov    D29(%rip),%rax
  mov    (%rax),%esi
  call   <setsockopt@plt>
  cmp    $0xffffffff,%eax
  je     L2
  mov    %r12d,%edi
  call   <socket_set_nonblocking@plt>
  cmp    $0xffffffff,%eax
  je     L2
  mov    D57(%rip),%rax
  mov    (%rax),%edi
  call   <htonl@plt>
  movzwl %bp,%edi
  mov    %eax,0x10(%rsp)
  call   <htons@plt>
  movd   (%rbx),%xmm0
  lea    0x8(%rsp),%rsi
  mov    %r12d,%edi
  movd   %eax,%xmm1
  mov    $0xc,%edx
  punpckldq %xmm1,%xmm0
  movq   %xmm0,0x8(%rsp)
  call   <bind@plt>
  test   %rax,%rax
  js     L2
  mov    D42(%rip),%rax
  mov    %r12d,%edi
  mov    (%rax),%esi
  call   <listen@plt>
  test   %rax,%rax
  js     L2
L15:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L30
  add    $0x20,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L2:
  mov    $0xffffffff,%r12d
  jmp    L15
L30:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int setup_socket_server(unsigned short port) {
  struct sockaddr_in addr;
  socklen_t addr_length;
  int fd, opt, opt_length;
  if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
    return -1;
  opt = 1;
  opt_length = sizeof(opt);
  if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &opt, opt_length) == -1)
    return -1;
  if (socket_set_nonblocking(fd) == -1)
    return -1;
  addr.sin_addr.s_addr = htonl(INADDR_ANY);
  addr.sin_port = htons(port);
  addr.sin_family = AF_INET;
  addr_length = sizeof(addr);
  if (bind(fd, (struct sockaddr *)&addr, addr_length) < 0)
    return -1;
  if (listen(fd, SOMAXCONN) < 0)
    return -1;
  return fd;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<SysCtlUSBPLLConfigSet>:
  endbr64
  mov    %rdi,%rax
  mov    0x400fb980,%rsi
  mov    $0xa5a5a5a5,%edi
  mov    %rdi,0x400fb980
  mov    %rax,%rcx
  and    $0x3f,%ecx
  mov    0x400fb824,%rdx
  and    $0x1f,%edx
  cmp    %rdx,%rcx
  je     L11
  mov    0x400fb824,%rdx
  and    $0xffffffffffffffe0,%rdx
  or     %rcx,%rdx
  mov    %rdx,0x400fb824
L11:
  mov    0x400fb824,%rdx
  xor    %rax,%rdx
  test   $0x3,%dh
  je     L15
  mov    0x400fb824,%rcx
  mov    %rax,%rdx
  and    $0x300,%edx
  and    $0xfc,%ch
  or     %rcx,%rdx
  mov    %rdx,0x400fb824
L15:
  mov    %rax,%rdx
  shr    $0x1f,%rdx
  mov    0x400fb820,%rcx
  xor    %rdx,%rcx
  test   $0x1,%cl
  je     L17
  mov    0x400fb820,%rcx
  and    $0x1,%edx
  and    $0xfffffffffffffffe,%rcx
  or     %rcx,%rdx
  mov    %rdx,0x400fb820
L17:
  test   $0x40000000,%eax
  je     L27
  mov    0x400fb820,%rax
  and    $0xfffffffffffffff9,%rax
  or     $0x2,%rax
  mov    %rax,0x400fb820
L42:
  mov    0x400fb828,%rax
  test   $0x1,%al
  je     L42
  mov    0x400fb820,%rax
  or     $0x4,%rax
  mov    %rax,0x400fb820
L32:
  mov    %rsi,0x400fb980
  ret
L27:
  mov    0x400fb820,%rax
  and    $0xfffffffffffffff9,%rax
  mov    %rax,0x400fb820
  jmp    L32
```

assistant: ```c
void SysCtlUSBPLLConfigSet(unsigned long ulConfig) {
  unsigned long ulMWRAllow;
  ulMWRAllow = (*((volatile unsigned long *)(0x400FB980)));
  (*((volatile unsigned long *)(0x400FB980))) = 0xA5A5A5A5;
  if ((ulConfig & 0x0000003F) != ((*((volatile unsigned long *)(0x400FB824))) & 0x0000001F)) {
    (*((volatile unsigned long *)(0x400FB824))) = (ulConfig & 0x0000003F) | ((*((volatile unsigned long *)(0x400FB824))) & ~0x0000001F);
  }
  if ((ulConfig & 0x00000300) != ((*((volatile unsigned long *)(0x400FB824))) & 0x00000300)) {
    (*((volatile unsigned long *)(0x400FB824))) = (ulConfig & 0x00000300) | ((*((volatile unsigned long *)(0x400FB824))) & ~0x00000300);
  }
  if (((ulConfig & 0x80000000) >> 31) != ((*((volatile unsigned long *)(0x400FB820))) & 0x00000001)) {
    (*((volatile unsigned long *)(0x400FB820))) = ((ulConfig & 0x80000000) >> 31) | ((*((volatile unsigned long *)(0x400FB820))) & ~0x00000001);
  }
  if (ulConfig & 0x40000000) {
    (*((volatile unsigned long *)(0x400FB820))) = 0x00000002 | ((*((volatile unsigned long *)(0x400FB820))) & ~0x00000004);
    while (!((*((volatile unsigned long *)(0x400FB828))) & 0x00000001))
      ;
    (*((volatile unsigned long *)(0x400FB820))) |= 0x00000004;
  } else {
    (*((volatile unsigned long *)(0x400FB820))) &= ~(0x00000004 | 0x00000002);
  }
  (*((volatile unsigned long *)(0x400FB980))) = ulMWRAllow;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<SysCtlUSBPLLConfigSet>:
  endbr64
  mov    %rdi,%rax
  mov    $0xa5a5a5a5,%edi
  mov    0x400fb980,%rsi
  mov    %rdi,0x400fb980
  mov    0x400fb824,%rdx
  mov    %rax,%rcx
  and    $0x3f,%ecx
  and    $0x1f,%edx
  cmp    %rdx,%rcx
  je     L12
  mov    0x400fb824,%rdx
  and    $0xffffffffffffffe0,%rdx
  or     %rcx,%rdx
  mov    %rdx,0x400fb824
L12:
  mov    0x400fb824,%rdx
  xor    %rax,%rdx
  and    $0x3,%dh
  je     L25
  mov    0x400fb824,%rcx
  mov    %rax,%rdx
  and    $0x300,%edx
  and    $0xfc,%ch
  or     %rcx,%rdx
  mov    %rdx,0x400fb824
L25:
  mov    0x400fb820,%rcx
  mov    %rax,%rdx
  shr    $0x1f,%rdx
  xor    %rdx,%rcx
  and    $0x1,%ecx
  je     L43
  mov    0x400fb820,%rcx
  and    $0x1,%edx
  and    $0xfffffffffffffffe,%rcx
  or     %rcx,%rdx
  mov    %rdx,0x400fb820
L43:
  test   $0x40000000,%eax
  mov    0x400fb820,%rax
  je     L11
  and    $0xfffffffffffffff9,%rax
  or     $0x2,%rax
  mov    %rax,0x400fb820
  nopl   0x0(%rax,%rax,1)
L23:
  mov    0x400fb828,%rax
  test   $0x1,%al
  je     L23
  mov    0x400fb820,%rax
  or     $0x4,%rax
  mov    %rax,0x400fb820
  mov    %rsi,0x400fb980
  ret
  nopl   0x0(%rax)
L11:
  and    $0xfffffffffffffff9,%rax
  mov    %rax,0x400fb820
  mov    %rsi,0x400fb980
  ret
```

assistant: ```c
void SysCtlUSBPLLConfigSet(unsigned long ulConfig) {
  unsigned long ulMWRAllow;
  ulMWRAllow = (*((volatile unsigned long *)(0x400FB980)));
  (*((volatile unsigned long *)(0x400FB980))) = 0xA5A5A5A5;
  if ((ulConfig & 0x0000003F) != ((*((volatile unsigned long *)(0x400FB824))) & 0x0000001F)) {
    (*((volatile unsigned long *)(0x400FB824))) = (ulConfig & 0x0000003F) | ((*((volatile unsigned long *)(0x400FB824))) & ~0x0000001F);
  }
  if ((ulConfig & 0x00000300) != ((*((volatile unsigned long *)(0x400FB824))) & 0x00000300)) {
    (*((volatile unsigned long *)(0x400FB824))) = (ulConfig & 0x00000300) | ((*((volatile unsigned long *)(0x400FB824))) & ~0x00000300);
  }
  if (((ulConfig & 0x80000000) >> 31) != ((*((volatile unsigned long *)(0x400FB820))) & 0x00000001)) {
    (*((volatile unsigned long *)(0x400FB820))) = ((ulConfig & 0x80000000) >> 31) | ((*((volatile unsigned long *)(0x400FB820))) & ~0x00000001);
  }
  if (ulConfig & 0x40000000) {
    (*((volatile unsigned long *)(0x400FB820))) = 0x00000002 | ((*((volatile unsigned long *)(0x400FB820))) & ~0x00000004);
    while (!((*((volatile unsigned long *)(0x400FB828))) & 0x00000001))
      ;
    (*((volatile unsigned long *)(0x400FB820))) |= 0x00000004;
  } else {
    (*((volatile unsigned long *)(0x400FB820))) &= ~(0x00000004 | 0x00000002);
  }
  (*((volatile unsigned long *)(0x400FB980))) = ulMWRAllow;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<SysCtlUSBPLLConfigSet>:
  endbr64
  mov    %rdi,%rax
  mov    $0xa5a5a5a5,%edi
  mov    0x400fb980,%rsi
  mov    %rdi,0x400fb980
  mov    0x400fb824,%rdx
  mov    %rax,%rcx
  and    $0x3f,%ecx
  and    $0x1f,%edx
  cmp    %rdx,%rcx
  je     L12
  mov    0x400fb824,%rdx
  and    $0xffffffffffffffe0,%rdx
  or     %rcx,%rdx
  mov    %rdx,0x400fb824
L12:
  mov    0x400fb824,%rdx
  xor    %rax,%rdx
  and    $0x3,%dh
  je     L5
  mov    0x400fb824,%rcx
  mov    %rax,%rdx
  and    $0x300,%edx
  and    $0xfc,%ch
  or     %rcx,%rdx
  mov    %rdx,0x400fb824
L5:
  mov    0x400fb820,%rcx
  mov    %rax,%rdx
  shr    $0x1f,%rdx
  xor    %rdx,%rcx
  and    $0x1,%ecx
  je     L19
  mov    0x400fb820,%rcx
  and    $0x1,%edx
  and    $0xfffffffffffffffe,%rcx
  or     %rcx,%rdx
  mov    %rdx,0x400fb820
L19:
  test   $0x40000000,%eax
  mov    0x400fb820,%rax
  je     L18
  and    $0xfffffffffffffff9,%rax
  or     $0x2,%rax
  mov    %rax,0x400fb820
  nopl   0x0(%rax,%rax,1)
L46:
  mov    0x400fb828,%rax
  test   $0x1,%al
  je     L46
  mov    0x400fb820,%rax
  or     $0x4,%rax
  mov    %rax,0x400fb820
  mov    %rsi,0x400fb980
  ret
  nopl   0x0(%rax)
L18:
  and    $0xfffffffffffffff9,%rax
  mov    %rax,0x400fb820
  mov    %rsi,0x400fb980
  ret
```

assistant: ```c
void SysCtlUSBPLLConfigSet(unsigned long ulConfig) {
  unsigned long ulMWRAllow;
  ulMWRAllow = (*((volatile unsigned long *)(0x400FB980)));
  (*((volatile unsigned long *)(0x400FB980))) = 0xA5A5A5A5;
  if ((ulConfig & 0x0000003F) != ((*((volatile unsigned long *)(0x400FB824))) & 0x0000001F)) {
    (*((volatile unsigned long *)(0x400FB824))) = (ulConfig & 0x0000003F) | ((*((volatile unsigned long *)(0x400FB824))) & ~0x0000001F);
  }
  if ((ulConfig & 0x00000300) != ((*((volatile unsigned long *)(0x400FB824))) & 0x00000300)) {
    (*((volatile unsigned long *)(0x400FB824))) = (ulConfig & 0x00000300) | ((*((volatile unsigned long *)(0x400FB824))) & ~0x00000300);
  }
  if (((ulConfig & 0x80000000) >> 31) != ((*((volatile unsigned long *)(0x400FB820))) & 0x00000001)) {
    (*((volatile unsigned long *)(0x400FB820))) = ((ulConfig & 0x80000000) >> 31) | ((*((volatile unsigned long *)(0x400FB820))) & ~0x00000001);
  }
  if (ulConfig & 0x40000000) {
    (*((volatile unsigned long *)(0x400FB820))) = 0x00000002 | ((*((volatile unsigned long *)(0x400FB820))) & ~0x00000004);
    while (!((*((volatile unsigned long *)(0x400FB828))) & 0x00000001))
      ;
    (*((volatile unsigned long *)(0x400FB820))) |= 0x00000004;
  } else {
    (*((volatile unsigned long *)(0x400FB820))) &= ~(0x00000004 | 0x00000002);
  }
  (*((volatile unsigned long *)(0x400FB980))) = ulMWRAllow;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<write_matrix_number_k>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    %rdx,-0x18(%rbp)
  mov    %rcx,-0x20(%rbp)
  mov    %r8,-0x28(%rbp)
  mov    %r9,-0x30(%rbp)
  mov    0x18(%rbp),%eax
  mov    %eax,%ecx
  mov    0x10(%rbp),%rdx
  lea    D9(%rip),%rax
  mov    %rax,%rsi
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <sprintf@plt>
  mov    -0x30(%rbp),%r9
  mov    -0x28(%rbp),%r8
  mov    -0x20(%rbp),%rcx
  mov    -0x18(%rbp),%rdx
  mov    -0x10(%rbp),%rsi
  mov    -0x8(%rbp),%rax
  sub    $0x8,%rsp
  lea    D7(%rip),%rdi
  push   %rdi
  mov    %rax,%rdi
  call   <write_matrix_number@plt>
  add    $0x10,%rsp
  nop
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D9
data_type: string

tool: D9: %s%02d.txt

assistant: ```c
void write_matrix_number_k(float **m, long nrl, long nrh, long ncl, long nch, char *format, char *filename, int k) {
  static char filename_k[256];
  sprintf(filename_k, "%s%02d.txt", filename, k);
  write_matrix_number(m, nrl, nrh, ncl, nch, format, filename_k);
}
```