ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请将以下的汇编代码转换成C语言代码：

```asm
<TCPcreate>:
  endbr64
  push   %r14
  xor    %edx,%edx
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x20,%rsp
  mov    D12(%rip),%r14
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    D3(%rip),%rax
  mov    (%r14),%edi
  mov    (%rax),%esi
  call   <socket@plt>
  mov    %eax,%r12d
  cmp    $0xffffffff,%eax
  je     L5
  lea    0xc(%rsp),%rbp
  xor    %esi,%esi
  mov    $0xc,%edx
  mov    %rbp,%rdi
  call   <memset@plt>
  mov    (%r14),%eax
  mov    %r13,%rdi
  mov    %eax,0x14(%rsp)
  call   <htonl@plt>
  movzwl %bx,%edi
  mov    %eax,0x10(%rsp)
  call   <htons@plt>
  mov    %r12d,%edi
  mov    $0xc,%edx
  mov    %rbp,%rsi
  mov    %eax,0xc(%rsp)
  call   <bind@plt>
  cmp    $0xffffffff,%eax
  mov    $0xfffffffe,%eax
  cmove  %eax,%r12d
L5:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L16
  add    $0x20,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L16:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int TCPcreate(unsigned long IP, unsigned short port) {
  int fd;
  struct sockaddr_in address;
  fd = socket(AF_INET, SOCK_STREAM, 0);
  if (fd == -1) {
    return -1;
  }
  memset(&address, 0, sizeof(address));
  address.sin_family = AF_INET;
  address.sin_addr.s_addr = htonl(IP);
  address.sin_port = htons(port);
  if (bind(fd, (struct sockaddr *)&address, sizeof(address)) == -1) {
    return -2;
  }
  return fd;
}
```
user: What is the c source code of the assembly code below:

```asm
<check_clicks>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,%eax
  mov    %al,-0x4(%rbp)
  cmpb   $0x60,-0x4(%rbp)
  jle    L123
  cmpb   $0x6f,-0x4(%rbp)
  jg     L123
  movsbl -0x4(%rbp),%eax
  lea    -0x61(%rax),%edx
  movslq %edx,%rax
  imul   $0x55555556,%rax,%rax
  shr    $0x20,%rax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  mov    %eax,%ecx
  add    %ecx,%ecx
  add    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  cmp    $0x2,%eax
  je     L111
  cmp    $0x2,%eax
  jg     L80
  test   %eax,%eax
  je     L108
  cmp    $0x1,%eax
  je     L10
  jmp    L80
L108:
  mov    $0x1,%eax
  jmp    L80
L10:
  mov    $0x2,%eax
  jmp    L80
L111:
  mov    $0x3,%eax
  jmp    L80
L123:
  movsbl -0x4(%rbp),%eax
  sub    $0x20,%eax
  cmp    $0x5a,%eax
  ja     L80
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D13(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D13(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    $0x1,%eax
  jmp    L80
  mov    $0x2,%eax
  jmp    L80
  mov    $0x3,%eax
  jmp    L80
  mov    $0x4,%eax
  jmp    L80
L80:
  pop    %rbp
  ret
```

assistant: ```c
int check_clicks(char input) {
  if (input >= 'a' && input <= 'o') {
    switch ((input - 97) % 3) {
    case 0:
      return 1;
      break;
    case 1:
      return 2;
      break;
    case 2:
      return 3;
      break;
    }
  } else {
    switch (input) {
    case 'p':
    case 't':
    case 'w':
    case ' ':
      return 1;
      break;
    case 'q':
    case 'u':
    case 'x':
      return 2;
      break;
    case 'r':
    case 'v':
    case 'y':
      return 3;
      break;
    case 's':
    case 'z':
      return 4;
      break;
    }
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<check_clicks>:
  endbr64
  lea    -0x61(%rdi),%eax
  cmp    $0xe,%al
  ja     L28
  movsbl %dil,%edi
  sub    $0x61,%edi
  movslq %edi,%rax
  imul   $0x55555556,%rax,%rax
  shr    $0x20,%rax
  mov    %edi,%edx
  sar    $0x1f,%edx
  sub    %edx,%eax
  lea    (%rax,%rax,2),%edx
  mov    %edi,%eax
  sub    %edx,%eax
  mov    $0x2,%edx
  cmp    $0x1,%eax
  je     L46
  mov    $0x3,%edx
  cmp    $0x2,%eax
  je     L46
  mov    $0x1,%edx
  test   %eax,%eax
L46:
  mov    %edx,%eax
  ret
L28:
  sub    $0x20,%edi
  cmp    $0x5a,%dil
  ja     L46
  movzbl %dil,%edi
  lea    D7(%rip),%rdx
  movslq (%rdx,%rdi,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  mov    $0x2,%edx
  jmp    L46
  mov    $0x3,%edx
  jmp    L46
  mov    $0x4,%edx
  jmp    L46
  mov    $0x1,%edx
  jmp    L46
```

assistant: ```c
int check_clicks(char input) {
  if (input >= 'a' && input <= 'o') {
    switch ((input - 97) % 3) {
    case 0:
      return 1;
      break;
    case 1:
      return 2;
      break;
    case 2:
      return 3;
      break;
    }
  } else {
    switch (input) {
    case 'p':
    case 't':
    case 'w':
    case ' ':
      return 1;
      break;
    case 'q':
    case 'u':
    case 'x':
      return 2;
      break;
    case 'r':
    case 'v':
    case 'y':
      return 3;
      break;
    case 's':
    case 'z':
      return 4;
      break;
    }
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<check_clicks>:
  endbr64
  lea    -0x61(%rdi),%eax
  cmp    $0xe,%al
  ja     L46
  movsbl %al,%eax
  mov    $0xaaaaaaab,%ecx
  mov    $0x2,%r8d
  mov    %rax,%rdx
  imul   %rcx,%rax
  shr    $0x21,%rax
  lea    (%rax,%rax,2),%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  cmp    $0x1,%eax
  je     L13
  xor    %r8d,%r8d
  cmp    $0x2,%eax
  sete   %r8b
  lea    0x1(%r8,%r8,1),%r8d
L13:
  mov    %r8d,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L46:
  sub    $0x20,%edi
  cmp    $0x5a,%dil
  ja     L13
  lea    D9(%rip),%rdx
  movzbl %dil,%edi
  movslq (%rdx,%rdi,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  cs nopw 0x0(%rax,%rax,1)
  mov    $0x1,%r8d
  mov    %r8d,%eax
  ret
  nopw   0x0(%rax,%rax,1)
  mov    $0x2,%r8d
  mov    %r8d,%eax
  ret
  nopw   0x0(%rax,%rax,1)
  mov    $0x3,%r8d
  jmp    L13
  nopl   0x0(%rax,%rax,1)
  mov    $0x4,%r8d
  jmp    L13
```

assistant: ```c
int check_clicks(char input) {
  if (input >= 'a' && input <= 'o') {
    switch ((input - 97) % 3) {
    case 0:
      return 1;
      break;
    case 1:
      return 2;
      break;
    case 2:
      return 3;
      break;
    }
  } else {
    switch (input) {
    case 'p':
    case 't':
    case 'w':
    case ' ':
      return 1;
      break;
    case 'q':
    case 'u':
    case 'x':
      return 2;
      break;
    case 'r':
    case 'v':
    case 'y':
      return 3;
      break;
    case 's':
    case 'z':
      return 4;
      break;
    }
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<check_clicks>:
  endbr64
  lea    -0x61(%rdi),%eax
  cmp    $0xe,%al
  ja     L3
  movsbl %al,%eax
  mov    $0xaaaaaaab,%ecx
  mov    $0x2,%r8d
  mov    %rax,%rdx
  imul   %rcx,%rax
  shr    $0x21,%rax
  lea    (%rax,%rax,2),%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  cmp    $0x1,%eax
  je     L0
  xor    %r8d,%r8d
  cmp    $0x2,%eax
  sete   %r8b
  lea    0x1(%r8,%r8,1),%r8d
L0:
  mov    %r8d,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L3:
  sub    $0x20,%edi
  cmp    $0x5a,%dil
  ja     L0
  lea    D3(%rip),%rdx
  movzbl %dil,%edi
  movslq (%rdx,%rdi,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  cs nopw 0x0(%rax,%rax,1)
  mov    $0x1,%r8d
  mov    %r8d,%eax
  ret
  nopw   0x0(%rax,%rax,1)
  mov    $0x2,%r8d
  mov    %r8d,%eax
  ret
  nopw   0x0(%rax,%rax,1)
  mov    $0x3,%r8d
  jmp    L0
  nopl   0x0(%rax,%rax,1)
  mov    $0x4,%r8d
  jmp    L0
```

assistant: ```c
int check_clicks(char input) {
  if (input >= 'a' && input <= 'o') {
    switch ((input - 97) % 3) {
    case 0:
      return 1;
      break;
    case 1:
      return 2;
      break;
    case 2:
      return 3;
      break;
    }
  } else {
    switch (input) {
    case 'p':
    case 't':
    case 'w':
    case ' ':
      return 1;
      break;
    case 'q':
    case 'u':
    case 'x':
      return 2;
      break;
    case 'r':
    case 'v':
    case 'y':
      return 3;
      break;
    case 's':
    case 'z':
      return 4;
      break;
    }
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0x0,%esi
  lea    D122(%rip),%rax
  mov    %rax,%rdi
  call   <check@plt>
  mov    $0x0,%esi
  lea    D32(%rip),%rax
  mov    %rax,%rdi
  call   <check@plt>
  mov    $0x0,%esi
  lea    D106(%rip),%rax
  mov    %rax,%rdi
  call   <check@plt>
  mov    $0x0,%esi
  lea    D28(%rip),%rax
  mov    %rax,%rdi
  call   <check@plt>
  mov    $0x0,%esi
  lea    D112(%rip),%rax
  mov    %rax,%rdi
  call   <check@plt>
  mov    $0x0,%esi
  lea    D103(%rip),%rax
  mov    %rax,%rdi
  call   <check@plt>
  mov    $0x0,%esi
  lea    D85(%rip),%rax
  mov    %rax,%rdi
  call   <check@plt>
  mov    $0x0,%esi
  lea    D121(%rip),%rax
  mov    %rax,%rdi
  call   <check@plt>
  mov    $0x1,%esi
  lea    D116(%rip),%rax
  mov    %rax,%rdi
  call   <check@plt>
  mov    $0x1,%esi
  lea    D98(%rip),%rax
  mov    %rax,%rdi
  call   <check@plt>
  mov    $0x1,%esi
  lea    D39(%rip),%rax
  mov    %rax,%rdi
  call   <check@plt>
  mov    $0x1,%esi
  lea    D54(%rip),%rax
  mov    %rax,%rdi
  call   <check@plt>
  mov    $0x1,%esi
  lea    D62(%rip),%rax
  mov    %rax,%rdi
  call   <check@plt>
  mov    $0x1,%esi
  lea    D125(%rip),%rax
  mov    %rax,%rdi
  call   <check@plt>
  mov    $0x0,%eax
  pop    %rbp
  ret
```

tool_calls: name: read_data
arguments: data_tag: D122
datatype: string
name: read_data
arguments: data_tag: D32
datatype: string
name: read_data
arguments: data_tag: D106
datatype: string
name: read_data
arguments: data_tag: D28
datatype: string
name: read_data
arguments: data_tag: D112
datatype: string
name: read_data
arguments: data_tag: D103
datatype: string
name: read_data
arguments: data_tag: D85
datatype: string
name: read_data
arguments: data_tag: D121
datatype: string
name: read_data
arguments: data_tag: D116
datatype: string
name: read_data
arguments: data_tag: D98
datatype: string
name: read_data
arguments: data_tag: D39
datatype: string
name: read_data
arguments: data_tag: D54
datatype: string
name: read_data
arguments: data_tag: D62
datatype: string
name: read_data
arguments: data_tag: D125
datatype: string

tool: D122: 0.1.2.3

tool: D32: 10.11.12.133

tool: D106: 127.0.0.1

tool: D28: 169.254.12.42

tool: D112: 172.20.123.45

tool: D103: 192.168.234.123

tool: D85: 232.11.22.33

tool: D121: 255.255.255.255

tool: D116: 192.0.2.10

tool: D98: 9.8.7.6

tool: D39: 11.12.13.14

tool: D54: 126.127.128.129

tool: D62: 192.167.255.255

tool: D125: 223.255.255.254

assistant: ```c
int main(void) {
  check("0.1.2.3", false);
  check("10.11.12.133", false);
  check("127.0.0.1", false);
  check("169.254.12.42", false);
  check("172.20.123.45", false);
  check("192.168.234.123", false);
  check("232.11.22.33", false);
  check("255.255.255.255", false);
  check("192.0.2.10", true);
  check("9.8.7.6", true);
  check("11.12.13.14", true);
  check("126.127.128.129", true);
  check("192.167.255.255", true);
  check("223.255.255.254", true);
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%esi
  lea    D88(%rip),%rdi
  call   <check@plt>
  mov    $0x0,%esi
  lea    D113(%rip),%rdi
  call   <check@plt>
  mov    $0x0,%esi
  lea    D60(%rip),%rdi
  call   <check@plt>
  mov    $0x0,%esi
  lea    D25(%rip),%rdi
  call   <check@plt>
  mov    $0x0,%esi
  lea    D78(%rip),%rdi
  call   <check@plt>
  mov    $0x0,%esi
  lea    D111(%rip),%rdi
  call   <check@plt>
  mov    $0x0,%esi
  lea    D44(%rip),%rdi
  call   <check@plt>
  mov    $0x0,%esi
  lea    D110(%rip),%rdi
  call   <check@plt>
  mov    $0x1,%esi
  lea    D31(%rip),%rdi
  call   <check@plt>
  mov    $0x1,%esi
  lea    D101(%rip),%rdi
  call   <check@plt>
  mov    $0x1,%esi
  lea    D9(%rip),%rdi
  call   <check@plt>
  mov    $0x1,%esi
  lea    D46(%rip),%rdi
  call   <check@plt>
  mov    $0x1,%esi
  lea    D63(%rip),%rdi
  call   <check@plt>
  mov    $0x1,%esi
  lea    D43(%rip),%rdi
  call   <check@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: unpack_data
arguments: tag: D88
type: string
name: unpack_data
arguments: tag: D113
type: string
name: unpack_data
arguments: tag: D60
type: string
name: unpack_data
arguments: tag: D25
type: string
name: unpack_data
arguments: tag: D78
type: string
name: unpack_data
arguments: tag: D111
type: string
name: unpack_data
arguments: tag: D44
type: string
name: unpack_data
arguments: tag: D110
type: string
name: unpack_data
arguments: tag: D31
type: string
name: unpack_data
arguments: tag: D101
type: string
name: unpack_data
arguments: tag: D9
type: string
name: unpack_data
arguments: tag: D46
type: string
name: unpack_data
arguments: tag: D63
type: string
name: unpack_data
arguments: tag: D43
type: string

tool: D88: 0.1.2.3

tool: D113: 10.11.12.133

tool: D60: 127.0.0.1

tool: D25: 169.254.12.42

tool: D78: 172.20.123.45

tool: D111: 192.168.234.123

tool: D44: 232.11.22.33

tool: D110: 255.255.255.255

tool: D31: 192.0.2.10

tool: D101: 9.8.7.6

tool: D9: 11.12.13.14

tool: D46: 126.127.128.129

tool: D63: 192.167.255.255

tool: D43: 223.255.255.254

assistant: ```c
int main(void) {
  check("0.1.2.3", false);
  check("10.11.12.133", false);
  check("127.0.0.1", false);
  check("169.254.12.42", false);
  check("172.20.123.45", false);
  check("192.168.234.123", false);
  check("232.11.22.33", false);
  check("255.255.255.255", false);
  check("192.0.2.10", true);
  check("9.8.7.6", true);
  check("11.12.13.14", true);
  check("126.127.128.129", true);
  check("192.167.255.255", true);
  check("223.255.255.254", true);
  return 0;
}
```
user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  xor    %esi,%esi
  lea    D68(%rip),%rdi
  call   <check@plt>
  xor    %esi,%esi
  lea    D61(%rip),%rdi
  call   <check@plt>
  xor    %esi,%esi
  lea    D77(%rip),%rdi
  call   <check@plt>
  xor    %esi,%esi
  lea    D78(%rip),%rdi
  call   <check@plt>
  xor    %esi,%esi
  lea    D79(%rip),%rdi
  call   <check@plt>
  xor    %esi,%esi
  lea    D131(%rip),%rdi
  call   <check@plt>
  xor    %esi,%esi
  lea    D137(%rip),%rdi
  call   <check@plt>
  xor    %esi,%esi
  lea    D55(%rip),%rdi
  call   <check@plt>
  mov    $0x1,%esi
  lea    D24(%rip),%rdi
  call   <check@plt>
  mov    $0x1,%esi
  lea    D96(%rip),%rdi
  call   <check@plt>
  mov    $0x1,%esi
  lea    D39(%rip),%rdi
  call   <check@plt>
  mov    $0x1,%esi
  lea    D66(%rip),%rdi
  call   <check@plt>
  mov    $0x1,%esi
  lea    D126(%rip),%rdi
  call   <check@plt>
  mov    $0x1,%esi
  lea    D20(%rip),%rdi
  call   <check@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D68
data_type: string
name: disassemble_data
arguments: data_label: D61
data_type: string
name: disassemble_data
arguments: data_label: D77
data_type: string
name: disassemble_data
arguments: data_label: D78
data_type: string
name: disassemble_data
arguments: data_label: D79
data_type: string
name: disassemble_data
arguments: data_label: D131
data_type: string
name: disassemble_data
arguments: data_label: D137
data_type: string
name: disassemble_data
arguments: data_label: D55
data_type: string
name: disassemble_data
arguments: data_label: D24
data_type: string
name: disassemble_data
arguments: data_label: D96
data_type: string
name: disassemble_data
arguments: data_label: D39
data_type: string
name: disassemble_data
arguments: data_label: D66
data_type: string
name: disassemble_data
arguments: data_label: D126
data_type: string
name: disassemble_data
arguments: data_label: D20
data_type: string

tool: D68: 0.1.2.3

tool: D61: 10.11.12.133

tool: D77: 127.0.0.1

tool: D78: 169.254.12.42

tool: D79: 172.20.123.45

tool: D131: 192.168.234.123

tool: D137: 232.11.22.33

tool: D55: 255.255.255.255

tool: D24: 192.0.2.10

tool: D96: 9.8.7.6

tool: D39: 11.12.13.14

tool: D66: 126.127.128.129

tool: D126: 192.167.255.255

tool: D20: 223.255.255.254

assistant: ```c
int main(void) {
  check("0.1.2.3", false);
  check("10.11.12.133", false);
  check("127.0.0.1", false);
  check("169.254.12.42", false);
  check("172.20.123.45", false);
  check("192.168.234.123", false);
  check("232.11.22.33", false);
  check("255.255.255.255", false);
  check("192.0.2.10", true);
  check("9.8.7.6", true);
  check("11.12.13.14", true);
  check("126.127.128.129", true);
  check("192.167.255.255", true);
  check("223.255.255.254", true);
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  xor    %esi,%esi
  lea    D111(%rip),%rdi
  call   <check@plt>
  xor    %esi,%esi
  lea    D133(%rip),%rdi
  call   <check@plt>
  xor    %esi,%esi
  lea    D2(%rip),%rdi
  call   <check@plt>
  xor    %esi,%esi
  lea    D1(%rip),%rdi
  call   <check@plt>
  xor    %esi,%esi
  lea    D22(%rip),%rdi
  call   <check@plt>
  xor    %esi,%esi
  lea    D95(%rip),%rdi
  call   <check@plt>
  xor    %esi,%esi
  lea    D115(%rip),%rdi
  call   <check@plt>
  xor    %esi,%esi
  lea    D42(%rip),%rdi
  call   <check@plt>
  mov    $0x1,%esi
  lea    D107(%rip),%rdi
  call   <check@plt>
  mov    $0x1,%esi
  lea    D71(%rip),%rdi
  call   <check@plt>
  mov    $0x1,%esi
  lea    D87(%rip),%rdi
  call   <check@plt>
  mov    $0x1,%esi
  lea    D120(%rip),%rdi
  call   <check@plt>
  mov    $0x1,%esi
  lea    D137(%rip),%rdi
  call   <check@plt>
  mov    $0x1,%esi
  lea    D10(%rip),%rdi
  call   <check@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: parse_data
arguments: label: D111
type: string
name: parse_data
arguments: label: D133
type: string
name: parse_data
arguments: label: D2
type: string
name: parse_data
arguments: label: D1
type: string
name: parse_data
arguments: label: D22
type: string
name: parse_data
arguments: label: D95
type: string
name: parse_data
arguments: label: D115
type: string
name: parse_data
arguments: label: D42
type: string
name: parse_data
arguments: label: D107
type: string
name: parse_data
arguments: label: D71
type: string
name: parse_data
arguments: label: D87
type: string
name: parse_data
arguments: label: D120
type: string
name: parse_data
arguments: label: D137
type: string
name: parse_data
arguments: label: D10
type: string

tool: D111: 0.1.2.3

tool: D133: 10.11.12.133

tool: D2: 127.0.0.1

tool: D1: 169.254.12.42

tool: D22: 172.20.123.45

tool: D95: 192.168.234.123

tool: D115: 232.11.22.33

tool: D42: 255.255.255.255

tool: D107: 192.0.2.10

tool: D71: 9.8.7.6

tool: D87: 11.12.13.14

tool: D120: 126.127.128.129

tool: D137: 192.167.255.255

tool: D10: 223.255.255.254

assistant: ```c
int main(void) {
  check("0.1.2.3", false);
  check("10.11.12.133", false);
  check("127.0.0.1", false);
  check("169.254.12.42", false);
  check("172.20.123.45", false);
  check("192.168.234.123", false);
  check("232.11.22.33", false);
  check("255.255.255.255", false);
  check("192.0.2.10", true);
  check("9.8.7.6", true);
  check("11.12.13.14", true);
  check("126.127.128.129", true);
  check("192.167.255.255", true);
  check("223.255.255.254", true);
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<decode_base64>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  movl   $0x0,-0x28(%rbp)
  mov    -0x40(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x3d,%al
  sete   %al
  movzbl %al,%edx
  mov    -0x40(%rbp),%rax
  lea    -0x2(%rax),%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  cmp    $0x3d,%al
  sete   %al
  movzbl %al,%eax
  add    %edx,%eax
  mov    %eax,-0x28(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  jmp    L13
L3:
  mov    -0x20(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <unbase64@plt>
  mov    %eax,%ebx
  mov    -0x20(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <unbase64@plt>
  shl    $0x6,%eax
  or     %eax,%ebx
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <unbase64@plt>
  shl    $0xc,%eax
  or     %eax,%ebx
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <unbase64@plt>
  shl    $0x12,%eax
  or     %ebx,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  mov    -0x24(%rbp),%edx
  mov    %dl,(%rax)
  mov    -0x24(%rbp),%eax
  sar    $0x8,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  mov    %dl,(%rax)
  mov    -0x24(%rbp),%eax
  sar    $0x10,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %dl,(%rax)
  addq   $0x4,-0x20(%rbp)
  addq   $0x3,-0x18(%rbp)
L13:
  mov    -0x20(%rbp),%rax
  lea    0x3(%rax),%rdx
  mov    -0x38(%rbp),%rcx
  mov    -0x40(%rbp),%rax
  add    %rcx,%rax
  cmp    %rax,%rdx
  jb     L3
  mov    -0x18(%rbp),%rax
  sub    -0x38(%rbp),%rax
  mov    %rax,%rcx
  mov    -0x40(%rbp),%rax
  sub    %rcx,%rax
  mov    %rax,%rdx
  mov    -0x18(%rbp),%rax
  mov    $0x20,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x18(%rbp),%rax
  sub    -0x38(%rbp),%rax
  mov    -0x28(%rbp),%edx
  movslq %edx,%rdx
  sub    %rdx,%rax
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
size_t decode_base64(uint8_t *buf, size_t len) {
  uint8_t *rd, *wr;
  int nuls = 0;
  nuls = (buf[len - 1] == '=') + (buf[len - 2] == '=');
  for (rd = buf, wr = buf; rd + 3 < buf + len; rd += 4, wr += 3) {
    uint_least32_t X;
    X = unbase64(rd[3]) | (unbase64(rd[2]) << 6) | (unbase64(rd[1]) << 12) | (unbase64(rd[0]) << 18);
    wr[2] = X & 0xff;
    wr[1] = (X >> 8) & 0xff;
    wr[0] = (X >> 16) & 0xff;
  }
  memset(wr, ' ', len - (wr - buf));
  return wr - buf - nuls;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<decode_base64>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r13
  mov    %rsi,%r14
  cmpb   $0x3d,-0x1(%rdi,%rsi,1)
  sete   %dl
  movzbl %dl,%edx
  cmpb   $0x3d,-0x2(%rdi,%rsi,1)
  sete   %al
  movzbl %al,%eax
  add    %edx,%eax
  mov    %eax,0x4(%rsp)
  lea    (%rdi,%rsi,1),%rax
  lea    0x3(%rdi),%rdx
  cmp    %rdx,%rax
  jbe    L19
  sub    %rdi,%rax
  lea    -0x4(%rax),%rax
  shr    $0x2,%rax
  add    $0x1,%rax
  mov    %rax,0x8(%rsp)
  lea    (%rdi,%rax,4),%r15
  mov    %rdi,%r12
  mov    %rdi,%rbp
L0:
  movsbl 0x3(%rbp),%edi
  call   <unbase64@plt>
  mov    %eax,(%rsp)
  movsbl 0x2(%rbp),%edi
  call   <unbase64@plt>
  mov    %eax,%ebx
  movsbl 0x1(%rbp),%edi
  call   <unbase64@plt>
  shl    $0x6,%ebx
  shl    $0xc,%eax
  or     %eax,%ebx
  or     (%rsp),%ebx
  movsbl 0x0(%rbp),%edi
  call   <unbase64@plt>
  shl    $0x12,%eax
  or     %ebx,%eax
  mov    %al,0x2(%r12)
  movzbl %ah,%ecx
  mov    %cl,0x1(%r12)
  sar    $0x10,%eax
  mov    %al,(%r12)
  add    $0x4,%rbp
  add    $0x3,%r12
  cmp    %r15,%rbp
  jne    L0
  mov    0x8(%rsp),%rax
  lea    (%rax,%rax,2),%rdi
  add    %r13,%rdi
L19:
  mov    %rdi,%rbx
  sub    %r13,%rbx
  mov    %r14,%rdx
  sub    %rbx,%rdx
  mov    $0x20,%esi
  call   <memset@plt>
  movslq 0x4(%rsp),%rdx
  mov    %rbx,%rax
  sub    %rdx,%rax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
size_t decode_base64(uint8_t *buf, size_t len) {
  uint8_t *rd, *wr;
  int nuls = 0;
  nuls = (buf[len - 1] == '=') + (buf[len - 2] == '=');
  for (rd = buf, wr = buf; rd + 3 < buf + len; rd += 4, wr += 3) {
    uint_least32_t X;
    X = unbase64(rd[3]) | (unbase64(rd[2]) << 6) | (unbase64(rd[1]) << 12) | (unbase64(rd[0]) << 18);
    wr[2] = X & 0xff;
    wr[1] = (X >> 8) & 0xff;
    wr[0] = (X >> 16) & 0xff;
  }
  memset(wr, ' ', len - (wr - buf));
  return wr - buf - nuls;
}
```