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

```asm
<HariMain>:
  endbr64
  nopl   0x0(%rax)
L8:
  jmp    L8
```

assistant: ```c
void HariMain(void) {
  for (;;) {
  }
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<gpio_write>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0xffffffff,-0xc(%rbp)
  mov    D6(%rip),%rax
  mov    (%rax),%edx
  mov    -0x14(%rbp),%eax
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <lseek@plt>
  test   %rax,%rax
  js     L1
  cmpl   $0x0,-0x18(%rbp)
  je     L41
  mov    $0x31,%eax
  jmp    L21
L41:
  mov    $0x30,%eax
L21:
  mov    %al,-0xd(%rbp)
  lea    -0xd(%rbp),%rcx
  mov    -0x14(%rbp),%eax
  mov    $0x1,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <write@plt>
  test   %rax,%rax
  js     L59
  movl   $0x0,-0xc(%rbp)
  jmp    L3
L1:
  nop
  jmp    L3
L59:
  nop
L3:
  mov    -0xc(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L69
  call   <__stack_chk_fail@plt>
L69:
  leave
  ret
```

assistant: ```c
int gpio_write(int fd, int val) {
  char c;
  int rc = -1;
  if (lseek(fd, 0, SEEK_SET) < 0)
    goto done;
  c = val ? '1' : '0';
  if (write(fd, &c, 1) < 0)
    goto done;
  rc = 0;
done:
  return rc;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<gpio_write>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %edi,%ebx
  mov    %esi,%ebp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    D8(%rip),%rax
  mov    (%rax),%edx
  mov    $0x0,%esi
  call   <lseek@plt>
  test   %rax,%rax
  js     L9
  cmp    $0x1,%ebp
  mov    $0x30,%eax
  sbb    $0xff,%al
  mov    %al,0x7(%rsp)
  lea    0x7(%rsp),%rsi
  mov    $0x1,%edx
  mov    %ebx,%edi
  call   <write@plt>
  sar    $0x3f,%rax
L19:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L2
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
L9:
  mov    $0xffffffff,%eax
  jmp    L19
L2:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int gpio_write(int fd, int val) {
  char c;
  int rc = -1;
  if (lseek(fd, 0, SEEK_SET) < 0)
    goto done;
  c = val ? '1' : '0';
  if (write(fd, &c, 1) < 0)
    goto done;
  rc = 0;
done:
  return rc;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<gpio_write>:
  endbr64
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  mov    %esi,%ebx
  xor    %esi,%esi
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  mov    D8(%rip),%rax
  mov    (%rax),%edx
  call   <lseek@plt>
  test   %rax,%rax
  js     L23
  cmp    $0x1,%ebx
  mov    $0x30,%eax
  lea    0x7(%rsp),%rsi
  mov    %ebp,%edi
  sbb    $0xff,%al
  mov    $0x1,%edx
  mov    %al,0x7(%rsp)
  call   <write@plt>
  sar    $0x3f,%rax
L17:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L9
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
L23:
  mov    $0xffffffff,%eax
  jmp    L17
L9:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int gpio_write(int fd, int val) {
  char c;
  int rc = -1;
  if (lseek(fd, 0, SEEK_SET) < 0)
    goto done;
  c = val ? '1' : '0';
  if (write(fd, &c, 1) < 0)
    goto done;
  rc = 0;
done:
  return rc;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<gpio_write>:
  endbr64
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  mov    %esi,%ebx
  xor    %esi,%esi
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  mov    D2(%rip),%rax
  mov    (%rax),%edx
  call   <lseek@plt>
  test   %rax,%rax
  js     L8
  cmp    $0x1,%ebx
  mov    $0x30,%eax
  lea    0x7(%rsp),%rsi
  mov    %ebp,%edi
  sbb    $0xff,%al
  mov    $0x1,%edx
  mov    %al,0x7(%rsp)
  call   <write@plt>
  sar    $0x3f,%rax
L5:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L22
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
L8:
  mov    $0xffffffff,%eax
  jmp    L5
L22:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int gpio_write(int fd, int val) {
  char c;
  int rc = -1;
  if (lseek(fd, 0, SEEK_SET) < 0)
    goto done;
  c = val ? '1' : '0';
  if (write(fd, &c, 1) < 0)
    goto done;
  rc = 0;
done:
  return rc;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<div>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    -0x14(%rbp),%eax
  cltd
  idivl  -0x18(%rbp)
  mov    %eax,-0x8(%rbp)
  mov    -0x14(%rbp),%eax
  cltd
  idivl  -0x18(%rbp)
  mov    %edx,%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  js     L2
  mov    -0x4(%rbp),%eax
  test   %eax,%eax
  jns    L2
  mov    -0x8(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x4(%rbp),%eax
  sub    -0x18(%rbp),%eax
  mov    %eax,-0x4(%rbp)
L2:
  mov    -0x8(%rbp),%rax
  pop    %rbp
  ret
```

assistant: ```c
div_t div(int num, int denom) {
  div_t r;
  r.quot = num / denom;
  r.rem = num % denom;
  if (num >= 0 && r.rem < 0) {
    r.quot++;
    r.rem -= denom;
  }
  return (r);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<div>:
  endbr64
  mov    %edi,%eax
  cltd
  idiv   %esi
  mov    %eax,%ecx
  mov    %edx,%r8d
  not    %edi
  test   %edx,%edi
  js     L18
L6:
  shl    $0x20,%r8
  mov    %ecx,%eax
  or     %r8,%rax
  ret
L18:
  lea    0x1(%rax),%ecx
  sub    %esi,%edx
  mov    %edx,%r8d
  jmp    L6
```

assistant: ```c
div_t div(int num, int denom) {
  div_t r;
  r.quot = num / denom;
  r.rem = num % denom;
  if (num >= 0 && r.rem < 0) {
    r.quot++;
    r.rem -= denom;
  }
  return (r);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<div>:
  endbr64
  mov    %edi,%eax
  not    %edi
  cltd
  idiv   %esi
  test   %edx,%edi
  js     L2
  shl    $0x20,%rdx
  mov    %eax,%eax
  or     %rdx,%rax
  ret
  nopl   0x0(%rax)
L2:
  add    $0x1,%eax
  sub    %esi,%edx
  shl    $0x20,%rdx
  mov    %eax,%eax
  or     %rdx,%rax
  ret
```

assistant: ```c
div_t div(int num, int denom) {
  div_t r;
  r.quot = num / denom;
  r.rem = num % denom;
  if (num >= 0 && r.rem < 0) {
    r.quot++;
    r.rem -= denom;
  }
  return (r);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<div>:
  endbr64
  mov    %edi,%eax
  not    %edi
  cltd
  idiv   %esi
  test   %edx,%edi
  js     L10
L9:
  movd   %eax,%xmm0
  movd   %edx,%xmm1
  punpckldq %xmm1,%xmm0
  movq   %xmm0,%rax
  ret
  nopl   0x0(%rax)
L10:
  add    $0x1,%eax
  sub    %esi,%edx
  jmp    L9
```

assistant: ```c
div_t div(int num, int denom) {
  div_t r;
  r.quot = num / denom;
  r.rem = num % denom;
  if (num >= 0 && r.rem < 0) {
    r.quot++;
    r.rem -= denom;
  }
  return (r);
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    $0x0,%edi
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  mov    $0x0,%eax
  call   <print_version@plt>
  movl   $0x0,-0x1c(%rbp)
  movl   $0x1,-0x18(%rbp)
  jmp    L26
L28:
  mov    -0x18(%rbp),%eax
  mov    %eax,%esi
  mov    $0xa,%edi
  call   <pow@plt>
  mov    %eax,-0x10(%rbp)
  mov    -0x18(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,%esi
  mov    $0xa,%edi
  call   <pow@plt>
  mov    %eax,%ecx
  mov    $0xf4240,%eax
  cltd
  idiv   %ecx
  mov    %eax,-0xc(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L24
L11:
  addl   $0x1,-0x1c(%rbp)
  mov    -0x10(%rbp),%eax
  mov    %eax,%edx
  lea    D9(%rip),%rax
  mov    %rax,%rsi
  lea    D10(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x10(%rbp),%edx
  mov    -0xc(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <benchmark@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rdx
  mov    -0xc(%rbp),%eax
  movq   %rdx,%xmm0
  mov    %eax,%edi
  call   <print_results@plt>
  mov    -0x1c(%rbp),%eax
  mov    %eax,%esi
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x1,-0x14(%rbp)
L24:
  cmpl   $0x2,-0x14(%rbp)
  jle    L11
  addl   $0x1,-0x18(%rbp)
L26:
  cmpl   $0x6,-0x18(%rbp)
  jle    L28
  mov    -0x1c(%rbp),%edx
  mov    -0x1c(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <print_summary@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_label: D9
type: string
name: parse_data
arguments: data_label: D10
type: string
name: parse_data
arguments: data_label: D3
type: string

tool: D9: dmeanpw

tool: D10: # c::%s:len=%d


tool: D3: ok %d benchmark finished


assistant: ```c
int main(void) {
  double elapsed;
  int count;
  int iter;
  int len;
  int i;
  int j;
  srand(time(NULL));
  print_version();
  count = 0;
  for (i = 1; i <= 6; i++) {
    len = pow(10, i);
    iter = 1000000 / pow(10, i - 1);
    for (j = 0; j < 3; j++) {
      count += 1;
      printf("# c::%s:len=%d\n", "dmeanpw", len);
      elapsed = benchmark(iter, len);
      print_results(iter, elapsed);
      printf("ok %d benchmark finished\n", count);
    }
  }
  print_summary(count, count);
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    $0x0,%edi
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  mov    $0x0,%eax
  call   <print_version@plt>
  mov    $0x3,%r12d
  mov    $0x1,%r14d
  lea    D18(%rip),%r15
  jmp    L28
L12:
  add    $0x1,%r14d
  add    $0x3,%r12d
  cmp    $0x15,%r12d
  je     L37
L28:
  lea    -0x3(%r12),%ebx
  mov    %r14d,%esi
  mov    $0xa,%edi
  call   <pow@plt>
  mov    %eax,%ebp
  lea    -0x1(%r14),%esi
  mov    $0xa,%edi
  call   <pow@plt>
  mov    %eax,%ecx
  mov    $0xf4240,%eax
  cltd
  idiv   %ecx
  mov    %eax,%r13d
L8:
  add    $0x1,%ebx
  mov    %ebp,%edx
  mov    %r15,%rsi
  lea    D7(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %ebp,%esi
  mov    %r13d,%edi
  call   <benchmark@plt>
  mov    %r13d,%edi
  call   <print_results@plt>
  mov    %ebx,%esi
  lea    D27(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmp    %r12d,%ebx
  jne    L8
  jmp    L12
L37:
  mov    $0x12,%esi
  mov    $0x12,%edi
  call   <print_summary@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D18
datatype: string
name: unpack_data
arguments: data_label: D7
datatype: string
name: unpack_data
arguments: data_label: D27
datatype: string

tool: D18: dmeanpw

tool: D7: # c::%s:len=%d


tool: D27: ok %d benchmark finished


assistant: ```c
int main(void) {
  double elapsed;
  int count;
  int iter;
  int len;
  int i;
  int j;
  srand(time(NULL));
  print_version();
  count = 0;
  for (i = 1; i <= 6; i++) {
    len = pow(10, i);
    iter = 1000000 / pow(10, i - 1);
    for (j = 0; j < 3; j++) {
      count += 1;
      printf("# c::%s:len=%d\n", "dmeanpw", len);
      elapsed = benchmark(iter, len);
      print_results(iter, elapsed);
      printf("ok %d benchmark finished\n", count);
    }
  }
  print_summary(count, count);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<main>:
  endbr64
  push   %r15
  xor    %edi,%edi
  lea    D2(%rip),%r15
  push   %r14
  lea    D13(%rip),%r14
  push   %r13
  lea    D10(%rip),%r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  xor    %eax,%eax
  call   <print_version@plt>
  movl   $0x3,0x8(%rsp)
  movl   $0x1,0xc(%rsp)
  nopl   0x0(%rax)
L9:
  mov    0xc(%rsp),%ebp
  mov    0x8(%rsp),%eax
  mov    $0xa,%edi
  mov    %ebp,%esi
  lea    -0x3(%rax),%r12d
  call   <pow@plt>
  lea    -0x1(%rbp),%esi
  mov    $0xa,%edi
  mov    %eax,%ebx
  call   <pow@plt>
  mov    %eax,%r8d
  mov    $0xf4240,%eax
  cltd
  idiv   %r8d
  mov    %eax,%ebp
L13:
  mov    %ebx,%edx
  mov    %r15,%rsi
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %ebx,%esi
  mov    %ebp,%edi
  add    $0x1,%r12d
  call   <benchmark@plt>
  mov    %ebp,%edi
  call   <print_results@plt>
  xor    %eax,%eax
  mov    %r12d,%esi
  mov    %r13,%rdi
  call   <printf@plt>
  cmp    0x8(%rsp),%r12d
  jne    L13
  lea    0x3(%r12),%eax
  addl   $0x1,0xc(%rsp)
  mov    %eax,0x8(%rsp)
  cmp    $0x12,%r12d
  jne    L9
  mov    $0x12,%esi
  mov    $0x12,%edi
  call   <print_summary@plt>
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: unpack_data
arguments: label: D2
type: string
name: unpack_data
arguments: label: D13
type: string
name: unpack_data
arguments: label: D10
type: string

tool: D2: dmeanpw

tool: D13: # c::%s:len=%d


tool: D10: ok %d benchmark finished


assistant: ```c
int main(void) {
  double elapsed;
  int count;
  int iter;
  int len;
  int i;
  int j;
  srand(time(NULL));
  print_version();
  count = 0;
  for (i = 1; i <= 6; i++) {
    len = pow(10, i);
    iter = 1000000 / pow(10, i - 1);
    for (j = 0; j < 3; j++) {
      count += 1;
      printf("# c::%s:len=%d\n", "dmeanpw", len);
      elapsed = benchmark(iter, len);
      print_results(iter, elapsed);
      printf("ok %d benchmark finished\n", count);
    }
  }
  print_summary(count, count);
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %r15
  xor    %edi,%edi
  lea    D27(%rip),%r15
  push   %r14
  lea    D1(%rip),%r14
  push   %r13
  lea    D4(%rip),%r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  xor    %eax,%eax
  call   <print_version@plt>
  movl   $0x3,0x8(%rsp)
  movl   $0x1,0xc(%rsp)
  nopl   0x0(%rax)
L3:
  mov    0xc(%rsp),%ebp
  mov    0x8(%rsp),%eax
  mov    $0xa,%edi
  mov    %ebp,%esi
  lea    -0x3(%rax),%r12d
  call   <pow@plt>
  lea    -0x1(%rbp),%esi
  mov    $0xa,%edi
  mov    %eax,%ebx
  call   <pow@plt>
  mov    %eax,%r8d
  mov    $0xf4240,%eax
  cltd
  idiv   %r8d
  mov    %eax,%ebp
L6:
  mov    %ebx,%edx
  mov    %r15,%rsi
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %ebx,%esi
  mov    %ebp,%edi
  add    $0x1,%r12d
  call   <benchmark@plt>
  mov    %ebp,%edi
  call   <print_results@plt>
  xor    %eax,%eax
  mov    %r12d,%esi
  mov    %r13,%rdi
  call   <printf@plt>
  cmp    0x8(%rsp),%r12d
  jne    L6
  lea    0x3(%r12),%eax
  addl   $0x1,0xc(%rsp)
  mov    %eax,0x8(%rsp)
  cmp    $0x12,%r12d
  jne    L3
  mov    $0x12,%esi
  mov    $0x12,%edi
  call   <print_summary@plt>
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D27
type_guessed: string
name: extract_symbolic_data
arguments: label: D1
type_guessed: string
name: extract_symbolic_data
arguments: label: D4
type_guessed: string

tool: D27: dmeanpw

tool: D1: # c::%s:len=%d


tool: D4: ok %d benchmark finished


assistant: ```c
int main(void) {
  double elapsed;
  int count;
  int iter;
  int len;
  int i;
  int j;
  srand(time(NULL));
  print_version();
  count = 0;
  for (i = 1; i <= 6; i++) {
    len = pow(10, i);
    iter = 1000000 / pow(10, i - 1);
    for (j = 0; j < 3; j++) {
      count += 1;
      printf("# c::%s:len=%d\n", "dmeanpw", len);
      elapsed = benchmark(iter, len);
      print_results(iter, elapsed);
      printf("ok %d benchmark finished\n", count);
    }
  }
  print_summary(count, count);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<gfx_set_cursor_shape32>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L20
L28:
  mov    -0x18(%rbp),%rax
  mov    $0xffffffff,%esi
  mov    %rax,%rdi
  call   <WRITE_FB32@plt>
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  add    $0x4,%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <WRITE_FB32@plt>
  mov    -0x18(%rbp),%rax
  add    $0x8,%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <WRITE_FB32@plt>
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  add    $0xc,%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <WRITE_FB32@plt>
  addq   $0x10,-0x18(%rbp)
  addl   $0x1,-0x4(%rbp)
L20:
  cmpl   $0x1f,-0x4(%rbp)
  jle    L28
  movl   $0x0,-0x4(%rbp)
  jmp    L22
L3:
  mov    -0x18(%rbp),%rax
  mov    $0xffffffff,%esi
  mov    %rax,%rdi
  call   <WRITE_FB32@plt>
  mov    -0x18(%rbp),%rax
  add    $0x4,%rax
  mov    $0xffffffff,%esi
  mov    %rax,%rdi
  call   <WRITE_FB32@plt>
  mov    -0x18(%rbp),%rax
  add    $0x8,%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <WRITE_FB32@plt>
  mov    -0x18(%rbp),%rax
  add    $0xc,%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <WRITE_FB32@plt>
  addq   $0x10,-0x18(%rbp)
  addl   $0x1,-0x4(%rbp)
L22:
  cmpl   $0x1f,-0x4(%rbp)
  jle    L3
  nop
  nop
  leave
  ret
```

assistant: ```c
void gfx_set_cursor_shape32(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask) {
  int i;
  for (i = 0; i < 32; i++) {
    WRITE_FB32(memoffset, 0xFFFFFFFF);
    WRITE_FB32(memoffset + 4, andmask[i]);
    WRITE_FB32(memoffset + 8, 0x00000000);
    WRITE_FB32(memoffset + 12, xormask[i]);
    memoffset += 16;
  }
  for (i = 0; i < 32; i++) {
    WRITE_FB32(memoffset, 0xFFFFFFFF);
    WRITE_FB32(memoffset + 4, 0xFFFFFFFF);
    WRITE_FB32(memoffset + 8, 0x00000000);
    WRITE_FB32(memoffset + 12, 0x00000000);
    memoffset += 16;
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<gfx_set_cursor_shape32>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r12
  mov    %rsi,%r14
  mov    %rdx,%r13
  mov    %rdi,%rbx
  mov    $0x0,%ebp
L12:
  mov    $0xffffffff,%esi
  mov    %rbx,%rdi
  call   <WRITE_FB32@plt>
  lea    0x4(%rbx),%rdi
  mov    (%r14,%rbp,8),%esi
  call   <WRITE_FB32@plt>
  lea    0x8(%rbx),%rdi
  mov    $0x0,%esi
  call   <WRITE_FB32@plt>
  lea    0xc(%rbx),%rdi
  mov    0x0(%r13,%rbp,8),%esi
  call   <WRITE_FB32@plt>
  add    $0x10,%rbx
  add    $0x1,%rbp
  cmp    $0x20,%rbp
  jne    L12
  lea    0x200(%r12),%rbx
  add    $0x400,%r12
L10:
  mov    $0xffffffff,%esi
  mov    %rbx,%rdi
  call   <WRITE_FB32@plt>
  lea    0x4(%rbx),%rdi
  mov    $0xffffffff,%esi
  call   <WRITE_FB32@plt>
  lea    0x8(%rbx),%rdi
  mov    $0x0,%esi
  call   <WRITE_FB32@plt>
  lea    0xc(%rbx),%rdi
  mov    $0x0,%esi
  call   <WRITE_FB32@plt>
  add    $0x10,%rbx
  cmp    %rbx,%r12
  jne    L10
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
void gfx_set_cursor_shape32(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask) {
  int i;
  for (i = 0; i < 32; i++) {
    WRITE_FB32(memoffset, 0xFFFFFFFF);
    WRITE_FB32(memoffset + 4, andmask[i]);
    WRITE_FB32(memoffset + 8, 0x00000000);
    WRITE_FB32(memoffset + 12, xormask[i]);
    memoffset += 16;
  }
  for (i = 0; i < 32; i++) {
    WRITE_FB32(memoffset, 0xFFFFFFFF);
    WRITE_FB32(memoffset + 4, 0xFFFFFFFF);
    WRITE_FB32(memoffset + 8, 0x00000000);
    WRITE_FB32(memoffset + 12, 0x00000000);
    memoffset += 16;
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<gfx_set_cursor_shape32>:
  endbr64
  push   %r14
  mov    %rsi,%r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  mov    %rdi,%rbx
  nopw   0x0(%rax,%rax,1)
L12:
  mov    %rbx,%rdi
  mov    $0xffffffff,%esi
  call   <WRITE_FB32@plt>
  mov    (%r14,%rbp,8),%esi
  lea    0x4(%rbx),%rdi
  call   <WRITE_FB32@plt>
  lea    0x8(%rbx),%rdi
  xor    %esi,%esi
  call   <WRITE_FB32@plt>
  mov    0x0(%r13,%rbp,8),%esi
  lea    0xc(%rbx),%rdi
  add    $0x1,%rbp
  add    $0x10,%rbx
  call   <WRITE_FB32@plt>
  cmp    $0x20,%rbp
  jne    L12
  lea    0x200(%r12),%rbx
  add    $0x400,%r12
L10:
  mov    %rbx,%rdi
  mov    $0xffffffff,%esi
  call   <WRITE_FB32@plt>
  lea    0x4(%rbx),%rdi
  mov    $0xffffffff,%esi
  call   <WRITE_FB32@plt>
  lea    0x8(%rbx),%rdi
  xor    %esi,%esi
  call   <WRITE_FB32@plt>
  lea    0xc(%rbx),%rdi
  xor    %esi,%esi
  add    $0x10,%rbx
  call   <WRITE_FB32@plt>
  cmp    %rbx,%r12
  jne    L10
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
void gfx_set_cursor_shape32(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask) {
  int i;
  for (i = 0; i < 32; i++) {
    WRITE_FB32(memoffset, 0xFFFFFFFF);
    WRITE_FB32(memoffset + 4, andmask[i]);
    WRITE_FB32(memoffset + 8, 0x00000000);
    WRITE_FB32(memoffset + 12, xormask[i]);
    memoffset += 16;
  }
  for (i = 0; i < 32; i++) {
    WRITE_FB32(memoffset, 0xFFFFFFFF);
    WRITE_FB32(memoffset + 4, 0xFFFFFFFF);
    WRITE_FB32(memoffset + 8, 0x00000000);
    WRITE_FB32(memoffset + 12, 0x00000000);
    memoffset += 16;
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<gfx_set_cursor_shape32>:
  endbr64
  push   %r14
  mov    %rsi,%r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  mov    %rdi,%rbx
  nopw   0x0(%rax,%rax,1)
L6:
  mov    %rbx,%rdi
  mov    $0xffffffff,%esi
  call   <WRITE_FB32@plt>
  mov    (%r14,%rbp,8),%esi
  lea    0x4(%rbx),%rdi
  call   <WRITE_FB32@plt>
  lea    0x8(%rbx),%rdi
  xor    %esi,%esi
  call   <WRITE_FB32@plt>
  mov    0x0(%r13,%rbp,8),%esi
  lea    0xc(%rbx),%rdi
  add    $0x1,%rbp
  add    $0x10,%rbx
  call   <WRITE_FB32@plt>
  cmp    $0x20,%rbp
  jne    L6
  lea    0x200(%r12),%rbx
  add    $0x400,%r12
L11:
  mov    %rbx,%rdi
  mov    $0xffffffff,%esi
  call   <WRITE_FB32@plt>
  lea    0x4(%rbx),%rdi
  mov    $0xffffffff,%esi
  call   <WRITE_FB32@plt>
  lea    0x8(%rbx),%rdi
  xor    %esi,%esi
  call   <WRITE_FB32@plt>
  lea    0xc(%rbx),%rdi
  xor    %esi,%esi
  add    $0x10,%rbx
  call   <WRITE_FB32@plt>
  cmp    %r12,%rbx
  jne    L11
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
void gfx_set_cursor_shape32(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask) {
  int i;
  for (i = 0; i < 32; i++) {
    WRITE_FB32(memoffset, 0xFFFFFFFF);
    WRITE_FB32(memoffset + 4, andmask[i]);
    WRITE_FB32(memoffset + 8, 0x00000000);
    WRITE_FB32(memoffset + 12, xormask[i]);
    memoffset += 16;
  }
  for (i = 0; i < 32; i++) {
    WRITE_FB32(memoffset, 0xFFFFFFFF);
    WRITE_FB32(memoffset + 4, 0xFFFFFFFF);
    WRITE_FB32(memoffset + 8, 0x00000000);
    WRITE_FB32(memoffset + 12, 0x00000000);
    memoffset += 16;
  }
}
```
user: What is the c source code of the assembly code below:

```asm
<base64_enc_len>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  lea    0x2(%rax),%esi
  mov    -0x4(%rbp),%eax
  add    $0x2,%eax
  movslq %eax,%rdx
  imul   $0x55555556,%rdx,%rdx
  shr    $0x20,%rdx
  mov    %eax,%edi
  sar    $0x1f,%edi
  mov    %edx,%ecx
  sub    %edi,%ecx
  mov    %ecx,%edx
  add    %edx,%edx
  add    %ecx,%edx
  sub    %edx,%eax
  mov    %eax,%ecx
  mov    %esi,%eax
  sub    %ecx,%eax
  movslq %eax,%rdx
  imul   $0x55555556,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  shl    $0x2,%eax
  pop    %rbp
  ret
```

assistant: ```c
int base64_enc_len(int plainLen) {
  int n = plainLen;
  return (n + 2 - ((n + 2) % 3)) / 3 * 4;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<base64_enc_len>:
  endbr64
  add    $0x2,%edi
  movslq %edi,%rax
  imul   $0x55555556,%rax,%rax
  shr    $0x20,%rax
  sar    $0x1f,%edi
  sub    %edi,%eax
  lea    (%rax,%rax,2),%edx
  movslq %edx,%rax
  imul   $0x55555556,%rax,%rax
  shr    $0x20,%rax
  sar    $0x1f,%edx
  sub    %edx,%eax
  shl    $0x2,%eax
  ret
```

assistant: ```c
int base64_enc_len(int plainLen) {
  int n = plainLen;
  return (n + 2 - ((n + 2) % 3)) / 3 * 4;
}
```