ylfeng/ReF-Decompile-dataset huggingface dataset:
user: What would the C source look like for the assembly code provided here?

```asm
<rand_permutation>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L1
L6:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0xc(%rbp),%edx
  add    $0x1,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0xc(%rbp)
L1:
  mov    -0xc(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L6
  movl   $0x0,-0xc(%rbp)
  jmp    L2
L0:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x1c(%rbp),%eax
  sub    -0xc(%rbp),%eax
  mov    %eax,%edi
  call   <rand_int@plt>
  mov    -0xc(%rbp),%edx
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0xc(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0xc(%rbp)
L2:
  mov    -0xc(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L0
  nop
  nop
  leave
  ret
```

assistant: ```c
void rand_permutation(int *perm, int n) {
  int i, j, t;
  for (i = 0; i < n; i++) {
    perm[i] = i + 1;
  }
  for (i = 0; i < n; i++) {
    t = perm[i];
    j = i + rand_int(n - i);
    perm[i] = perm[j];
    perm[j] = t;
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<rand_permutation>:
  endbr64
  test   %esi,%esi
  jle    L8
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbp
  mov    %esi,%r13d
  lea    -0x1(%rsi),%edx
  add    $0x2,%rdx
  mov    $0x1,%eax
L1:
  mov    %eax,-0x4(%rbp,%rax,4)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L1
  mov    %r13d,%r14d
  mov    $0x0,%ebx
L21:
  mov    0x0(%rbp,%rbx,4),%r12d
  mov    %r13d,%edi
  sub    %ebx,%edi
  call   <rand_int@plt>
  add    %ebx,%eax
  cltq
  lea    0x0(%rbp,%rax,4),%rax
  mov    (%rax),%edx
  mov    %edx,0x0(%rbp,%rbx,4)
  mov    %r12d,(%rax)
  add    $0x1,%rbx
  cmp    %r14,%rbx
  jne    L21
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L8:
  ret
```

assistant: ```c
void rand_permutation(int *perm, int n) {
  int i, j, t;
  for (i = 0; i < n; i++) {
    perm[i] = i + 1;
  }
  for (i = 0; i < n; i++) {
    t = perm[i];
    j = i + rand_int(n - i);
    perm[i] = perm[j];
    perm[j] = t;
  }
}
```
user: What is the c source code of the assembly code below?

```asm
<rand_permutation>:
  endbr64
  test   %esi,%esi
  jle    L10
  push   %r14
  lea    -0x1(%rsi),%edx
  mov    $0x1,%eax
  push   %r13
  add    $0x2,%rdx
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  nopl   0x0(%rax)
L11:
  mov    %eax,-0x4(%r13,%rax,4)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L11
  mov    %ebp,%r12d
  xor    %ebx,%ebx
  nopl   0x0(%rax,%rax,1)
L22:
  mov    %ebp,%edi
  mov    0x0(%r13,%rbx,4),%r14d
  sub    %ebx,%edi
  call   <rand_int@plt>
  add    %ebx,%eax
  cltq
  lea    0x0(%r13,%rax,4),%rax
  mov    (%rax),%edx
  mov    %edx,0x0(%r13,%rbx,4)
  add    $0x1,%rbx
  mov    %r14d,(%rax)
  cmp    %r12,%rbx
  jne    L22
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L10:
  ret
```

assistant: ```c
void rand_permutation(int *perm, int n) {
  int i, j, t;
  for (i = 0; i < n; i++) {
    perm[i] = i + 1;
  }
  for (i = 0; i < n; i++) {
    t = perm[i];
    j = i + rand_int(n - i);
    perm[i] = perm[j];
    perm[j] = t;
  }
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<rand_permutation>:
  endbr64
  test   %esi,%esi
  jle    L77
  lea    -0x1(%rsi),%eax
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  cmp    $0x2,%eax
  jbe    L57
  mov    %esi,%edx
  movdqa D11(%rip),%xmm1
  mov    %rdi,%rax
  movdqa D24(%rip),%xmm3
  shr    $0x2,%edx
  movdqa D23(%rip),%xmm2
  sub    $0x1,%edx
  shl    $0x4,%rdx
  lea    0x10(%rdi,%rdx,1),%rdx
  nopl   0x0(%rax)
L34:
  movdqa %xmm1,%xmm0
  add    $0x10,%rax
  paddd  %xmm3,%xmm1
  paddd  %xmm2,%xmm0
  movups %xmm0,-0x10(%rax)
  cmp    %rdx,%rax
  jne    L34
  mov    %ebp,%eax
  and    $0xfffffffc,%eax
  test   $0x3,%bpl
  je     L67
L25:
  movslq %eax,%rcx
  lea    0x1(%rax),%edx
  mov    %edx,0x0(%r13,%rcx,4)
  lea    0x0(,%rcx,4),%rsi
  cmp    %edx,%ebp
  jle    L67
  lea    0x2(%rax),%edx
  mov    %edx,0x4(%r13,%rsi,1)
  cmp    %edx,%ebp
  jle    L67
  add    $0x3,%eax
  mov    %eax,0x8(%r13,%rsi,1)
L67:
  mov    %ebp,%r12d
  xor    %ebx,%ebx
  nopl   0x0(%rax)
L31:
  mov    %ebp,%edi
  mov    0x0(%r13,%rbx,4),%r14d
  sub    %ebx,%edi
  call   <rand_int@plt>
  add    %ebx,%eax
  cltq
  lea    0x0(%r13,%rax,4),%rax
  mov    (%rax),%edx
  mov    %edx,0x0(%r13,%rbx,4)
  add    $0x1,%rbx
  mov    %r14d,(%rax)
  cmp    %r12,%rbx
  jne    L31
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L77:
  ret
L57:
  xor    %eax,%eax
  jmp    L25
```

tool_calls: name: disassemble_data
arguments: label: D11
type_infered: byte[16]
name: disassemble_data
arguments: label: D24
type_infered: byte[16]
name: disassemble_data
arguments: label: D23
type_infered: byte[16]

tool: {"D11": [0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x03,0x00,0x00,0x00]}

tool: {"D24": [0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00]}

tool: {"D23": [0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00]}

assistant: ```c
void rand_permutation(int *perm, int n) {
  int i, j, t;
  for (i = 0; i < n; i++) {
    perm[i] = i + 1;
  }
  for (i = 0; i < n; i++) {
    t = perm[i];
    j = i + rand_int(n - i);
    perm[i] = perm[j];
    perm[j] = t;
  }
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<inner_product_single>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%r15
  mov    %rsi,%r14
  mov    %edx,%r13d
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x14(%rsp)
  call   <_mm_setzero_ps@plt>
  mov    $0x0,%ebx
  cmp    $0x7,%r13d
  jbe    L7
  mov    %eax,%ebp
  mov    %r14,%rbx
  mov    %r15,%r12
  lea    -0x8(%r13),%eax
  shr    $0x3,%eax
  mov    %eax,0xc(%rsp)
  mov    %eax,%eax
  shl    $0x5,%rax
  lea    0x20(%r14,%rax,1),%rax
  mov    %rax,(%rsp)
L41:
  mov    %rbx,%rdi
  call   <_mm_loadu_ps@plt>
  mov    %eax,0x8(%rsp)
  mov    %r12,%rdi
  call   <_mm_loadu_ps@plt>
  mov    %eax,%edi
  mov    0x8(%rsp),%esi
  call   <_mm_mul_ps@plt>
  mov    %eax,%esi
  mov    %ebp,%edi
  call   <_mm_add_ps@plt>
  mov    %eax,0x8(%rsp)
  lea    0x10(%rbx),%rdi
  call   <_mm_loadu_ps@plt>
  mov    %eax,%ebp
  lea    0x10(%r12),%rdi
  call   <_mm_loadu_ps@plt>
  mov    %eax,%edi
  mov    %ebp,%esi
  call   <_mm_mul_ps@plt>
  mov    %eax,%esi
  mov    0x8(%rsp),%edi
  call   <_mm_add_ps@plt>
  mov    %eax,%ebp
  add    $0x20,%rbx
  add    $0x20,%r12
  cmp    (%rsp),%rbx
  jne    L41
  mov    0xc(%rsp),%eax
  lea    0x8(,%rax,8),%ebx
  mov    %ebp,%esi
  mov    %ebp,%edi
  call   <_mm_movehl_ps@plt>
  mov    %eax,%esi
  mov    %ebp,%edi
  call   <_mm_add_ps@plt>
  mov    %eax,%ebp
  mov    $0x55,%edx
  mov    %eax,%esi
  mov    %eax,%edi
  call   <_mm_shuffle_ps@plt>
  mov    %eax,%esi
  mov    %ebp,%edi
  call   <_mm_add_ss@plt>
  mov    %eax,%esi
  lea    0x14(%rsp),%rdi
  call   <_mm_store_ss@plt>
L7:
  cmp    %ebx,%r13d
  jbe    L29
  movss  0x14(%rsp),%xmm1
  movslq %ebx,%rax
L28:
  movss  (%r15,%rax,4),%xmm0
  mulss  (%r14,%rax,4),%xmm0
  addss  %xmm0,%xmm1
  add    $0x1,%rax
  cmp    %eax,%r13d
  ja     L28
  movss  %xmm1,0x14(%rsp)
L29:
  movss  0x14(%rsp),%xmm0
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L22
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L22:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
float inner_product_single(const float *a, const float *b, unsigned int len) {
  int i = 0;
  float ret = 0;
  __m128 sum = _mm_setzero_ps();
  if (len > 7) {
    for (; i < len - 7; i += 8) {
      sum = _mm_add_ps(sum, _mm_mul_ps(_mm_loadu_ps(a + i), _mm_loadu_ps(b + i)));
      sum = _mm_add_ps(sum, _mm_mul_ps(_mm_loadu_ps(a + i + 4), _mm_loadu_ps(b + i + 4)));
    }
    sum = _mm_add_ps(sum, _mm_movehl_ps(sum, sum));
    sum = _mm_add_ss(sum, _mm_shuffle_ps(sum, sum, 0x55));
    _mm_store_ss(&ret, sum);
  }
  for (; i < len; i++)
    ret += a[i] * b[i];
  return ret;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<inner_product_single>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x24(%rsp)
  call   <_mm_setzero_ps@plt>
  cmp    $0x7,%ebp
  jbe    L14
  mov    %eax,%r13d
  lea    -0x8(%rbp),%eax
  mov    %r12,%r14
  mov    %r15,%rbx
  mov    %eax,0x18(%rsp)
  shr    $0x3,%eax
  mov    %eax,0x1c(%rsp)
  shl    $0x5,%rax
  lea    0x20(%r12,%rax,1),%rax
  mov    %rax,0x10(%rsp)
  nopl   (%rax)
L50:
  mov    %r14,%rdi
  call   <_mm_loadu_ps@plt>
  mov    %rbx,%rdi
  mov    %eax,0xc(%rsp)
  call   <_mm_loadu_ps@plt>
  mov    0xc(%rsp),%esi
  mov    %eax,%edi
  call   <_mm_mul_ps@plt>
  mov    %r13d,%edi
  mov    %eax,%esi
  call   <_mm_add_ps@plt>
  lea    0x10(%r14),%rdi
  add    $0x20,%r14
  mov    %eax,%r13d
  call   <_mm_loadu_ps@plt>
  lea    0x10(%rbx),%rdi
  add    $0x20,%rbx
  mov    %eax,0xc(%rsp)
  call   <_mm_loadu_ps@plt>
  mov    0xc(%rsp),%esi
  mov    %eax,%edi
  call   <_mm_mul_ps@plt>
  mov    %r13d,%edi
  mov    %eax,%esi
  call   <_mm_add_ps@plt>
  mov    %eax,%r13d
  cmp    %r14,0x10(%rsp)
  jne    L50
  mov    0x1c(%rsp),%eax
  mov    %r13d,%esi
  mov    %r13d,%edi
  mov    0x18(%rsp),%r14d
  lea    0x8(,%rax,8),%ebx
  and    $0xfffffff8,%r14d
  call   <_mm_movehl_ps@plt>
  mov    %r13d,%edi
  add    $0x8,%r14d
  mov    %eax,%esi
  call   <_mm_add_ps@plt>
  mov    $0x55,%edx
  mov    %eax,%esi
  mov    %eax,%edi
  mov    %eax,%r13d
  call   <_mm_shuffle_ps@plt>
  mov    %r13d,%edi
  mov    %eax,%esi
  call   <_mm_add_ss@plt>
  lea    0x24(%rsp),%rdi
  mov    %eax,%esi
  call   <_mm_store_ss@plt>
L49:
  movss  0x24(%rsp),%xmm1
  cmp    %r14d,%ebp
  jbe    L20
  movslq %ebx,%rax
  nopl   0x0(%rax,%rax,1)
L55:
  movss  (%r15,%rax,4),%xmm0
  mulss  (%r12,%rax,4),%xmm0
  add    $0x1,%rax
  addss  %xmm0,%xmm1
  cmp    %eax,%ebp
  ja     L55
L20:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L23
  add    $0x38,%rsp
  movaps %xmm1,%xmm0
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L14:
  xor    %r14d,%r14d
  xor    %ebx,%ebx
  jmp    L49
L23:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
float inner_product_single(const float *a, const float *b, unsigned int len) {
  int i = 0;
  float ret = 0;
  __m128 sum = _mm_setzero_ps();
  if (len > 7) {
    for (; i < len - 7; i += 8) {
      sum = _mm_add_ps(sum, _mm_mul_ps(_mm_loadu_ps(a + i), _mm_loadu_ps(b + i)));
      sum = _mm_add_ps(sum, _mm_mul_ps(_mm_loadu_ps(a + i + 4), _mm_loadu_ps(b + i + 4)));
    }
    sum = _mm_add_ps(sum, _mm_movehl_ps(sum, sum));
    sum = _mm_add_ss(sum, _mm_shuffle_ps(sum, sum, 0x55));
    _mm_store_ss(&ret, sum);
  }
  for (; i < len; i++)
    ret += a[i] * b[i];
  return ret;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<base64_decode>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  movl   $0x0,-0x18(%rbp)
  movb   $0x0,-0x19(%rbp)
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <getcode@plt>
  shl    $0x2,%eax
  mov    %eax,-0x14(%rbp)
  movl   $0x0,-0x10(%rbp)
  movl   $0x2,-0xc(%rbp)
  movl   $0x1,-0x8(%rbp)
  jmp    L66
L21:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <getcode@plt>
  mov    %eax,-0x10(%rbp)
  cmpl   $0xff,-0x10(%rbp)
  je     L45
  cmpl   $0xfe,-0x10(%rbp)
  je     L45
  mov    -0xc(%rbp),%eax
  add    %eax,%eax
  mov    $0xff,%edx
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  movzbl %al,%eax
  and    -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %eax,%eax
  mov    %eax,%ecx
  sar    %cl,%edx
  mov    %edx,%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  mov    %al,-0x19(%rbp)
  mov    -0x4(%rbp),%eax
  not    %eax
  movzbl %al,%eax
  and    -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    $0x4,%eax
  sub    -0xc(%rbp),%eax
  add    %eax,%eax
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  mov    %eax,-0x14(%rbp)
  cmpl   $0x3,-0xc(%rbp)
  je     L82
  mov    -0x18(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x18(%rbp)
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x19(%rbp),%eax
  mov    %al,(%rdx)
L82:
  cmpl   $0x0,-0xc(%rbp)
  jne    L63
  movl   $0x3,-0xc(%rbp)
  jmp    L17
L63:
  mov    -0xc(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  jmp    L17
L45:
  nop
L17:
  addl   $0x1,-0x8(%rbp)
L66:
  mov    -0x30(%rbp),%rax
  cmp    %eax,-0x8(%rbp)
  jl     L21
  cmpl   $0xfe,-0x10(%rbp)
  jne    L25
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x19(%rbp),%eax
  mov    %al,(%rdx)
L25:
  nop
  leave
  ret
```

assistant: ```c
void base64_decode(unsigned char *base64_in, size_t base64_in_size, unsigned char *data_out) {
  int iterate_data_buffer = 0;
  unsigned char nNum = 0;
  int nLst = getcode(base64_in[0]) << 2;
  int code = 0;
  int mask = 2;
  for (int i = 1; i < (int)(base64_in_size); i++) {
    code = getcode(base64_in[i]);
    if (code == (0xFF) || code == (0xFE)) {
      continue;
    }
    int nm = (0xFF << (2 * mask));
    nNum = nLst + ((code & (0xFF & nm)) >> (2 * mask));
    nLst = (code & (0xFF & ~nm)) << (8 - (2 * mask));
    (mask != 3) ? data_out[iterate_data_buffer++] = nNum : nNum;
    (mask == 0) ? mask = 3 : mask--;
  }
  if (code == (0xFE)) {
    data_out[iterate_data_buffer] = nNum;
  }
}
```
user: What is the c source code of the assembly code below?

```asm
<base64_decode>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%r12
  mov    %rdx,0x8(%rsp)
  movzbl (%rdi),%edi
  call   <getcode@plt>
  cmp    $0x1,%r12d
  jle    L88
  lea    0x0(,%rax,4),%r14d
  lea    0x1(%rbx),%rbp
  lea    -0x2(%r12),%eax
  lea    0x2(%rbx,%rax,1),%r15
  mov    $0x2,%r12d
  mov    $0x0,%ebx
  mov    $0x0,%r13d
  jmp    L45
L9:
  mov    %eax,%r13d
L50:
  sub    $0x1,%r12d
L10:
  add    $0x1,%rbp
  cmp    %r15,%rbp
  je     L0
L45:
  movzbl 0x0(%rbp),%edi
  call   <getcode@plt>
  mov    %eax,%edx
  lea    -0xfe(%rax),%eax
  cmp    $0x1,%eax
  jbe    L10
  lea    (%r12,%r12,1),%ecx
  mov    $0xff,%eax
  shl    %cl,%eax
  mov    %edx,%ebx
  and    %eax,%ebx
  movzbl %bl,%ebx
  sar    %cl,%ebx
  add    %r14d,%ebx
  not    %eax
  and    %edx,%eax
  movzbl %al,%eax
  mov    $0x4,%ecx
  sub    %r12d,%ecx
  add    %ecx,%ecx
  shl    %cl,%eax
  mov    %eax,%r14d
  cmp    $0x3,%r12d
  je     L50
  lea    0x1(%r13),%eax
  movslq %r13d,%r13
  mov    0x8(%rsp),%rsi
  mov    %bl,(%rsi,%r13,1)
  test   %r12d,%r12d
  jne    L9
  mov    %eax,%r13d
  mov    $0x3,%r12d
  jmp    L10
L0:
  cmp    $0xfe,%edx
  je     L47
L88:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L47:
  movslq %r13d,%r13
  mov    0x8(%rsp),%rax
  mov    %bl,(%rax,%r13,1)
  jmp    L88
```

assistant: ```c
void base64_decode(unsigned char *base64_in, size_t base64_in_size, unsigned char *data_out) {
  int iterate_data_buffer = 0;
  unsigned char nNum = 0;
  int nLst = getcode(base64_in[0]) << 2;
  int code = 0;
  int mask = 2;
  for (int i = 1; i < (int)(base64_in_size); i++) {
    code = getcode(base64_in[i]);
    if (code == (0xFF) || code == (0xFE)) {
      continue;
    }
    int nm = (0xFF << (2 * mask));
    nNum = nLst + ((code & (0xFF & nm)) >> (2 * mask));
    nLst = (code & (0xFF & ~nm)) << (8 - (2 * mask));
    (mask != 3) ? data_out[iterate_data_buffer++] = nNum : nNum;
    (mask == 0) ? mask = 3 : mask--;
  }
  if (code == (0xFE)) {
    data_out[iterate_data_buffer] = nNum;
  }
}
```
user: What is the c source code of the assembly code below:

```asm
<base64_decode>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x18,%rsp
  movzbl (%rdi),%edi
  mov    %rdx,0x8(%rsp)
  call   <getcode@plt>
  cmp    $0x1,%ebp
  jle    L10
  lea    0x0(,%rax,4),%r12d
  lea    -0x2(%rbp),%eax
  xor    %ebp,%ebp
  mov    $0x2,%r14d
  lea    0x1(%rbx),%r15
  lea    0x2(%rbx,%rax,1),%r13
  xor    %ebx,%ebx
  jmp    L29
  xchg   %ax,%ax
L52:
  mov    0x8(%rsp),%rdx
  lea    0x1(%rbp),%eax
  mov    %bl,(%rdx,%rbp,1)
  movslq %eax,%rbp
  test   %r14d,%r14d
  jne    L48
  mov    $0x3,%r14d
L61:
  add    $0x1,%r15
  cmp    %r13,%r15
  je     L51
L29:
  movzbl (%r15),%edi
  call   <getcode@plt>
  mov    %eax,%edi
  lea    -0xfe(%rax),%eax
  cmp    $0x1,%eax
  jbe    L61
  lea    (%r14,%r14,1),%ecx
  mov    $0xff,%eax
  mov    %edi,%ebx
  shl    %cl,%eax
  and    %eax,%ebx
  not    %eax
  movzbl %bl,%ebx
  and    %edi,%eax
  sar    %cl,%ebx
  mov    $0x4,%ecx
  movzbl %al,%eax
  sub    %r14d,%ecx
  add    %r12d,%ebx
  add    %ecx,%ecx
  shl    %cl,%eax
  mov    %eax,%r12d
  cmp    $0x3,%r14d
  jne    L52
L48:
  add    $0x1,%r15
  sub    $0x1,%r14d
  cmp    %r13,%r15
  jne    L29
L51:
  cmp    $0xfe,%edi
  je     L37
L10:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L37:
  mov    0x8(%rsp),%rax
  mov    %bl,(%rax,%rbp,1)
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void base64_decode(unsigned char *base64_in, size_t base64_in_size, unsigned char *data_out) {
  int iterate_data_buffer = 0;
  unsigned char nNum = 0;
  int nLst = getcode(base64_in[0]) << 2;
  int code = 0;
  int mask = 2;
  for (int i = 1; i < (int)(base64_in_size); i++) {
    code = getcode(base64_in[i]);
    if (code == (0xFF) || code == (0xFE)) {
      continue;
    }
    int nm = (0xFF << (2 * mask));
    nNum = nLst + ((code & (0xFF & nm)) >> (2 * mask));
    nLst = (code & (0xFF & ~nm)) << (8 - (2 * mask));
    (mask != 3) ? data_out[iterate_data_buffer++] = nNum : nNum;
    (mask == 0) ? mask = 3 : mask--;
  }
  if (code == (0xFE)) {
    data_out[iterate_data_buffer] = nNum;
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<base64_decode>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x18,%rsp
  movzbl (%rdi),%edi
  mov    %rdx,0x8(%rsp)
  call   <getcode@plt>
  cmp    $0x1,%ebp
  jle    L48
  lea    0x0(,%rax,4),%r12d
  lea    -0x2(%rbp),%eax
  xor    %ebp,%ebp
  mov    $0x2,%r14d
  lea    0x1(%rbx),%r15
  lea    0x2(%rbx,%rax,1),%r13
  xor    %ebx,%ebx
  jmp    L74
  xchg   %ax,%ax
L50:
  mov    0x8(%rsp),%rdx
  lea    0x1(%rbp),%eax
  mov    %bl,(%rdx,%rbp,1)
  movslq %eax,%rbp
  test   %r14d,%r14d
  jne    L34
  mov    $0x3,%r14d
L43:
  add    $0x1,%r15
  cmp    %r15,%r13
  je     L68
L74:
  movzbl (%r15),%edi
  call   <getcode@plt>
  mov    %eax,%edi
  lea    -0xfe(%rax),%eax
  cmp    $0x1,%eax
  jbe    L43
  lea    (%r14,%r14,1),%ecx
  mov    $0xff,%eax
  mov    %edi,%ebx
  shl    %cl,%eax
  and    %eax,%ebx
  not    %eax
  movzbl %bl,%ebx
  and    %edi,%eax
  sar    %cl,%ebx
  mov    $0x4,%ecx
  movzbl %al,%eax
  sub    %r14d,%ecx
  add    %r12d,%ebx
  add    %ecx,%ecx
  shl    %cl,%eax
  mov    %eax,%r12d
  cmp    $0x3,%r14d
  jne    L50
L34:
  add    $0x1,%r15
  sub    $0x1,%r14d
  cmp    %r15,%r13
  jne    L74
L68:
  cmp    $0xfe,%edi
  je     L62
L48:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L62:
  mov    0x8(%rsp),%rax
  mov    %bl,(%rax,%rbp,1)
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void base64_decode(unsigned char *base64_in, size_t base64_in_size, unsigned char *data_out) {
  int iterate_data_buffer = 0;
  unsigned char nNum = 0;
  int nLst = getcode(base64_in[0]) << 2;
  int code = 0;
  int mask = 2;
  for (int i = 1; i < (int)(base64_in_size); i++) {
    code = getcode(base64_in[i]);
    if (code == (0xFF) || code == (0xFE)) {
      continue;
    }
    int nm = (0xFF << (2 * mask));
    nNum = nLst + ((code & (0xFF & nm)) >> (2 * mask));
    nLst = (code & (0xFF & ~nm)) << (8 - (2 * mask));
    (mask != 3) ? data_out[iterate_data_buffer++] = nNum : nNum;
    (mask == 0) ? mask = 3 : mask--;
  }
  if (code == (0xFE)) {
    data_out[iterate_data_buffer] = nNum;
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<decode_base64>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    -0x28(%rbp),%rax
  movq   $0x0,(%rax)
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L37
  mov    $0x0,%eax
  jmp    L13
L37:
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rcx
  mov    -0x20(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <b64_pton@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  jg     L36
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rax
  mov    -0x20(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <_explicit_bzero@plt>
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x28(%rbp),%rax
  movq   $0x0,(%rax)
  mov    $0x0,%eax
  jmp    L13
L36:
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%eax
  cltq
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  mov    %rdx,(%rax)
  mov    $0x1,%eax
L13:
  leave
  ret
```

assistant: ```c
int decode_base64(const char *src, size_t src_len, char **dst, size_t *dst_len) {
  int sz;
  *dst = NULL;
  if ((*dst = (char *)malloc(src_len + 1)) == NULL)
    return 0;
  if ((sz = b64_pton(src, (unsigned char *)*dst, src_len)) <= 0) {
    _explicit_bzero(*dst, src_len);
    free(*dst);
    *dst = NULL;
    return 0;
  }
  (*dst)[sz] = 0;
  *dst_len = (size_t)sz;
  return 1;
}
```