ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Converte this assembly snippet into its equivalent C code:

```asm
<pike>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %edx,-0x30(%rbp)
  mov    %ecx,-0x34(%rbp)
  mov    %r8d,-0x38(%rbp)
  movss  %xmm0,-0x3c(%rbp)
  movl   $0x0,-0x18(%rbp)
  movl   $0xff,-0x14(%rbp)
  movl   $0x0,-0x20(%rbp)
  jmp    L53
L11:
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x18(%rbp),%edx
  mov    %dl,(%rax)
  addl   $0x1,-0x20(%rbp)
L53:
  mov    -0x2c(%rbp),%eax
  imul   -0x30(%rbp),%eax
  cmp    %eax,-0x20(%rbp)
  jl     L11
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x34(%rbp),%xmm0
  divss  -0x3c(%rbp),%xmm0
  cvttss2si %xmm0,%eax
  mov    %eax,-0x10(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x38(%rbp),%xmm0
  divss  -0x3c(%rbp),%xmm0
  cvttss2si %xmm0,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x30(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  cltd
  idivl  -0x34(%rbp)
  mov    %edx,-0x8(%rbp)
  mov    -0x2c(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  cltd
  idivl  -0x10(%rbp)
  mov    %edx,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  mov    %eax,-0x20(%rbp)
  jmp    L3
L32:
  mov    -0x4(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L22
L24:
  mov    -0x38(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  neg    %eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%eax
  lea    (%rdx,%rax,1),%r10d
  mov    -0x38(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  neg    %eax
  mov    %eax,%edx
  mov    -0x1c(%rbp),%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0xc(%rbp),%r8d
  mov    -0x30(%rbp),%edx
  mov    -0x2c(%rbp),%esi
  mov    -0x28(%rbp),%rax
  mov    -0x14(%rbp),%edi
  push   %rdi
  mov    -0x38(%rbp),%edi
  push   %rdi
  mov    %r8d,%r9d
  mov    %r10d,%r8d
  mov    %rax,%rdi
  call   <draw_rectangle@plt>
  add    $0x10,%rsp
  mov    -0x10(%rbp),%eax
  add    %eax,-0x1c(%rbp)
L22:
  mov    -0x1c(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L24
  mov    -0x34(%rbp),%eax
  add    %eax,-0x20(%rbp)
L3:
  mov    -0x20(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jl     L32
  nop
  nop
  leave
  ret
```

assistant: ```c
void pike(unsigned char *sl, int w, int h, int size1, int size2, float ar) {
  int i, j, iz, jz;
  int black, white;
  int size1a, size2a;
  black = 0;
  white = 255;
  for (i = 0; i < (w * h); i++)
    sl[i] = black;
  size1a = size1 / ar;
  size2a = size2 / ar;
  iz = h / 2 - size1 * ((h / 2) / size1);
  jz = w / 2 - size1a * ((w / 2) / size1a);
  for (i = iz; i < h; i = i + size1)
    for (j = jz; j < w; j = j + size1a)
      draw_rectangle(sl, w, h, j - size2 / 2, i - size2 / 2, size2a, size2, white);
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<pike>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%r15
  mov    %esi,%ebp
  mov    %edx,%r12d
  mov    %ecx,0x18(%rsp)
  mov    %r8d,%r14d
  mov    %esi,%edx
  imul   %r12d,%edx
  test   %edx,%edx
  jle    L78
  mov    %rdi,%rax
  lea    -0x1(%rdx),%edx
  lea    0x1(%rdi,%rdx,1),%rdx
L53:
  movb   $0x0,(%rax)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L53
L78:
  mov    0x18(%rsp),%esi
  pxor   %xmm1,%xmm1
  cvtsi2ss %esi,%xmm1
  divss  %xmm0,%xmm1
  cvttss2si %xmm1,%edi
  mov    %edi,0xc(%rsp)
  pxor   %xmm1,%xmm1
  cvtsi2ss %r14d,%xmm1
  divss  %xmm0,%xmm1
  cvttss2si %xmm1,%eax
  mov    %eax,0x10(%rsp)
  mov    %r12d,%eax
  shr    $0x1f,%eax
  add    %r12d,%eax
  sar    %eax
  cltd
  idiv   %esi
  mov    %edx,%ecx
  mov    %edx,0x14(%rsp)
  mov    %ebp,%eax
  shr    $0x1f,%eax
  add    %ebp,%eax
  sar    %eax
  cltd
  idiv   %edi
  mov    %edx,0x1c(%rsp)
  cmp    %ecx,%r12d
  jle    L58
  mov    %r14d,%eax
  shr    $0x1f,%eax
  add    %r14d,%eax
  sar    %eax
  neg    %eax
  mov    %eax,0x8(%rsp)
  jmp    L6
L43:
  mov    0x8(%rsp),%eax
  lea    (%rbx,%rax,1),%ecx
  push   $0xff
  push   %r14
  mov    0x20(%rsp),%r9d
  mov    %r13d,%r8d
  mov    %r12d,%edx
  mov    %ebp,%esi
  mov    %r15,%rdi
  call   <draw_rectangle@plt>
  add    0x1c(%rsp),%ebx
  add    $0x10,%rsp
  cmp    %ebx,%ebp
  jg     L43
L22:
  mov    0x18(%rsp),%esi
  add    %esi,0x14(%rsp)
  mov    0x14(%rsp),%eax
  cmp    %eax,%r12d
  jle    L58
L6:
  mov    0x14(%rsp),%r13d
  add    0x8(%rsp),%r13d
  mov    0x1c(%rsp),%eax
  mov    %eax,%ebx
  cmp    %eax,%ebp
  jg     L43
  jmp    L22
L58:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void pike(unsigned char *sl, int w, int h, int size1, int size2, float ar) {
  int i, j, iz, jz;
  int black, white;
  int size1a, size2a;
  black = 0;
  white = 255;
  for (i = 0; i < (w * h); i++)
    sl[i] = black;
  size1a = size1 / ar;
  size2a = size2 / ar;
  iz = h / 2 - size1 * ((h / 2) / size1);
  jz = w / 2 - size1a * ((w / 2) / size1a);
  for (i = iz; i < h; i = i + size1)
    for (j = jz; j < w; j = j + size1a)
      draw_rectangle(sl, w, h, j - size2 / 2, i - size2 / 2, size2a, size2, white);
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<pike>:
  endbr64
  push   %r15
  mov    %esi,%eax
  push   %r14
  imul   %edx,%eax
  mov    %esi,%r14d
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edx,%ebx
  sub    $0x28,%rsp
  mov    %ecx,0x18(%rsp)
  mov    %r8d,0xc(%rsp)
  test   %eax,%eax
  jle    L24
  movslq %eax,%rdx
  xor    %esi,%esi
  movss  %xmm0,0x8(%rsp)
  call   <memset@plt>
  movss  0x8(%rsp),%xmm0
L24:
  mov    %ebx,%eax
  mov    0x18(%rsp),%edx
  pxor   %xmm1,%xmm1
  mov    0xc(%rsp),%edi
  shr    $0x1f,%eax
  add    %ebx,%eax
  cvtsi2ss %edx,%xmm1
  mov    %edx,%ecx
  sar    %eax
  cltd
  idiv   %ecx
  divss  %xmm0,%xmm1
  mov    %r14d,%eax
  shr    $0x1f,%eax
  add    %r14d,%eax
  sar    %eax
  mov    %edx,0x14(%rsp)
  cltd
  cvttss2si %xmm1,%esi
  pxor   %xmm1,%xmm1
  cvtsi2ss %edi,%xmm1
  idiv   %esi
  mov    %esi,0x10(%rsp)
  divss  %xmm0,%xmm1
  mov    %edx,0x1c(%rsp)
  cvttss2si %xmm1,%r15d
  cmp    0x14(%rsp),%ebx
  jle    L15
  mov    %edi,%ebp
  mov    %r14d,%eax
  mov    %r13,%r14
  mov    %r15d,%r13d
  shr    $0x1f,%ebp
  mov    %eax,%r15d
  add    %edi,%ebp
  sar    %ebp
  neg    %ebp
  mov    %ebp,0x8(%rsp)
  nopl   0x0(%rax,%rax,1)
L21:
  mov    0x1c(%rsp),%eax
  mov    0x14(%rsp),%r12d
  add    0x8(%rsp),%r12d
  mov    %eax,%ebp
  cmp    %eax,%r15d
  jle    L43
  mov    %ebp,%eax
  mov    %r13d,%ebp
  mov    %eax,%r13d
  nopl   (%rax)
L20:
  mov    0x8(%rsp),%eax
  push   $0xff
  mov    %ebx,%edx
  mov    %ebp,%r9d
  mov    %r12d,%r8d
  mov    %r15d,%esi
  mov    %r14,%rdi
  lea    0x0(%r13,%rax,1),%ecx
  mov    0x14(%rsp),%eax
  push   %rax
  call   <draw_rectangle@plt>
  add    0x20(%rsp),%r13d
  pop    %rax
  pop    %rdx
  cmp    %r13d,%r15d
  jg     L20
  mov    %ebp,%r13d
L43:
  mov    0x18(%rsp),%esi
  add    %esi,0x14(%rsp)
  mov    0x14(%rsp),%eax
  cmp    %eax,%ebx
  jg     L21
L15:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void pike(unsigned char *sl, int w, int h, int size1, int size2, float ar) {
  int i, j, iz, jz;
  int black, white;
  int size1a, size2a;
  black = 0;
  white = 255;
  for (i = 0; i < (w * h); i++)
    sl[i] = black;
  size1a = size1 / ar;
  size2a = size2 / ar;
  iz = h / 2 - size1 * ((h / 2) / size1);
  jz = w / 2 - size1a * ((w / 2) / size1a);
  for (i = iz; i < h; i = i + size1)
    for (j = jz; j < w; j = j + size1a)
      draw_rectangle(sl, w, h, j - size2 / 2, i - size2 / 2, size2a, size2, white);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<pike>:
  endbr64
  push   %r15
  mov    %esi,%eax
  mov    %esi,%r15d
  push   %r14
  imul   %edx,%eax
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edx,%ebx
  sub    $0x28,%rsp
  mov    %ecx,0x18(%rsp)
  mov    %r8d,0xc(%rsp)
  test   %eax,%eax
  jle    L39
  movslq %eax,%rdx
  xor    %esi,%esi
  movss  %xmm0,0x8(%rsp)
  call   <memset@plt>
  movss  0x8(%rsp),%xmm0
L39:
  mov    %ebx,%eax
  mov    0x18(%rsp),%edx
  pxor   %xmm1,%xmm1
  mov    0xc(%rsp),%edi
  shr    $0x1f,%eax
  add    %ebx,%eax
  cvtsi2ss %edx,%xmm1
  mov    %edx,%ecx
  sar    %eax
  cltd
  idiv   %ecx
  divss  %xmm0,%xmm1
  mov    %r15d,%eax
  shr    $0x1f,%eax
  add    %r15d,%eax
  sar    %eax
  mov    %edx,0x14(%rsp)
  cltd
  cvttss2si %xmm1,%esi
  pxor   %xmm1,%xmm1
  cvtsi2ss %edi,%xmm1
  idiv   %esi
  mov    %esi,0x10(%rsp)
  divss  %xmm0,%xmm1
  mov    %edx,0x1c(%rsp)
  cvttss2si %xmm1,%r14d
  cmp    0x14(%rsp),%ebx
  jle    L53
  mov    %edi,%ebp
  shr    $0x1f,%ebp
  add    %edi,%ebp
  sar    %ebp
  neg    %ebp
  mov    %ebp,0x8(%rsp)
  cmp    %edx,%r15d
  jle    L53
  mov    %r13,%rax
  mov    0x14(%rsp),%r12d
  mov    %r14d,%r13d
  mov    %rax,%r14
  nop
L20:
  mov    0x1c(%rsp),%eax
  mov    %r13d,%ebp
  add    0x8(%rsp),%r12d
  mov    %eax,%r13d
  nop
L31:
  mov    0x8(%rsp),%eax
  push   $0xff
  mov    %ebx,%edx
  mov    %ebp,%r9d
  mov    %r12d,%r8d
  mov    %r15d,%esi
  mov    %r14,%rdi
  lea    0x0(%r13,%rax,1),%ecx
  mov    0x14(%rsp),%eax
  push   %rax
  call   <draw_rectangle@plt>
  add    0x20(%rsp),%r13d
  pop    %rax
  pop    %rdx
  cmp    %r13d,%r15d
  jg     L31
  mov    0x18(%rsp),%esi
  add    %esi,0x14(%rsp)
  mov    %ebp,%r13d
  mov    0x14(%rsp),%eax
  cmp    %eax,%ebx
  jle    L53
  mov    %eax,%r12d
  jmp    L20
  nopw   0x0(%rax,%rax,1)
L53:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void pike(unsigned char *sl, int w, int h, int size1, int size2, float ar) {
  int i, j, iz, jz;
  int black, white;
  int size1a, size2a;
  black = 0;
  white = 255;
  for (i = 0; i < (w * h); i++)
    sl[i] = black;
  size1a = size1 / ar;
  size2a = size2 / ar;
  iz = h / 2 - size1 * ((h / 2) / size1);
  jz = w / 2 - size1a * ((w / 2) / size1a);
  for (i = iz; i < h; i = i + size1)
    for (j = jz; j < w; j = j + size1a)
      draw_rectangle(sl, w, h, j - size2 / 2, i - size2 / 2, size2a, size2, white);
}
```
user: What is the c source code of the assembly code below:

```asm
<uart_init>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0x90000002,%eax
  movb   $0xc7,(%rax)
  mov    $0x90000001,%eax
  movb   $0x0,(%rax)
  mov    $0x90000003,%eax
  movb   $0x3,(%rax)
  movl   $0x20,-0x4(%rbp)
  mov    $0x90000003,%eax
  movzbl (%rax),%edx
  mov    $0x90000003,%eax
  or     $0xffffff80,%edx
  mov    %dl,(%rax)
  mov    $0x90000000,%eax
  mov    -0x4(%rbp),%edx
  mov    %dl,(%rax)
  mov    -0x4(%rbp),%eax
  sar    $0x8,%eax
  mov    %eax,%edx
  mov    $0x90000001,%eax
  mov    %dl,(%rax)
  mov    $0x90000003,%eax
  movzbl (%rax),%edx
  mov    $0x90000003,%eax
  and    $0x7f,%edx
  mov    %dl,(%rax)
  nop
  pop    %rbp
  ret
```

assistant: ```c
void uart_init(void) {
  int divisor;
  *((volatile unsigned char *)(0x90000000 + 2)) = 0x01 | 0x02 | 0x04 | 0xC0;
  *((volatile unsigned char *)(0x90000000 + 1)) = 0x00;
  *((volatile unsigned char *)(0x90000000 + 3)) = 0x03 & ~(0x04 | 0x08);
  divisor = 5000000 / (16 * 9600);
  *((volatile unsigned char *)(0x90000000 + 3)) |= 0x80;
  *((volatile unsigned char *)(0x90000000 + 0)) = divisor & 0x000000ff;
  *((volatile unsigned char *)(0x90000000 + 1)) = (divisor >> 8) & 0x000000ff;
  *((volatile unsigned char *)(0x90000000 + 3)) &= ~(0x80);
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<uart_init>:
  endbr64
  mov    $0x90000002,%eax
  movb   $0xc7,(%rax)
  mov    $0x90000001,%ecx
  movb   $0x0,(%rcx)
  lea    0x1(%rax),%rax
  movb   $0x3,(%rax)
  movzbl (%rax),%edx
  or     $0xffffff80,%edx
  mov    %dl,(%rax)
  mov    $0x90000000,%esi
  movb   $0x20,(%rsi)
  movb   $0x0,(%rcx)
  movzbl (%rax),%edx
  and    $0x7f,%edx
  mov    %dl,(%rax)
  ret
```

assistant: ```c
void uart_init(void) {
  int divisor;
  *((volatile unsigned char *)(0x90000000 + 2)) = 0x01 | 0x02 | 0x04 | 0xC0;
  *((volatile unsigned char *)(0x90000000 + 1)) = 0x00;
  *((volatile unsigned char *)(0x90000000 + 3)) = 0x03 & ~(0x04 | 0x08);
  divisor = 5000000 / (16 * 9600);
  *((volatile unsigned char *)(0x90000000 + 3)) |= 0x80;
  *((volatile unsigned char *)(0x90000000 + 0)) = divisor & 0x000000ff;
  *((volatile unsigned char *)(0x90000000 + 1)) = (divisor >> 8) & 0x000000ff;
  *((volatile unsigned char *)(0x90000000 + 3)) &= ~(0x80);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<uart_init>:
  endbr64
  mov    $0x90000002,%eax
  mov    $0x90000001,%ecx
  mov    $0x90000000,%esi
  movb   $0xc7,(%rax)
  movb   $0x0,(%rcx)
  movb   $0x3,0x1(%rax)
  movzbl 0x1(%rax),%edx
  or     $0xffffff80,%edx
  mov    %dl,0x1(%rax)
  movb   $0x20,(%rsi)
  movb   $0x0,(%rcx)
  movzbl 0x1(%rax),%edx
  and    $0x7f,%edx
  mov    %dl,0x1(%rax)
  ret
```

assistant: ```c
void uart_init(void) {
  int divisor;
  *((volatile unsigned char *)(0x90000000 + 2)) = 0x01 | 0x02 | 0x04 | 0xC0;
  *((volatile unsigned char *)(0x90000000 + 1)) = 0x00;
  *((volatile unsigned char *)(0x90000000 + 3)) = 0x03 & ~(0x04 | 0x08);
  divisor = 5000000 / (16 * 9600);
  *((volatile unsigned char *)(0x90000000 + 3)) |= 0x80;
  *((volatile unsigned char *)(0x90000000 + 0)) = divisor & 0x000000ff;
  *((volatile unsigned char *)(0x90000000 + 1)) = (divisor >> 8) & 0x000000ff;
  *((volatile unsigned char *)(0x90000000 + 3)) &= ~(0x80);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<uart_init>:
  endbr64
  mov    $0x90000002,%eax
  mov    $0x90000001,%ecx
  mov    $0x90000000,%esi
  movb   $0xc7,(%rax)
  movb   $0x0,(%rcx)
  movb   $0x3,0x1(%rax)
  movzbl 0x1(%rax),%edx
  or     $0xffffff80,%edx
  mov    %dl,0x1(%rax)
  movb   $0x20,(%rsi)
  movb   $0x0,(%rcx)
  movzbl 0x1(%rax),%edx
  and    $0x7f,%edx
  mov    %dl,0x1(%rax)
  ret
```

assistant: ```c
void uart_init(void) {
  int divisor;
  *((volatile unsigned char *)(0x90000000 + 2)) = 0x01 | 0x02 | 0x04 | 0xC0;
  *((volatile unsigned char *)(0x90000000 + 1)) = 0x00;
  *((volatile unsigned char *)(0x90000000 + 3)) = 0x03 & ~(0x04 | 0x08);
  divisor = 5000000 / (16 * 9600);
  *((volatile unsigned char *)(0x90000000 + 3)) |= 0x80;
  *((volatile unsigned char *)(0x90000000 + 0)) = divisor & 0x000000ff;
  *((volatile unsigned char *)(0x90000000 + 1)) = (divisor >> 8) & 0x000000ff;
  *((volatile unsigned char *)(0x90000000 + 3)) &= ~(0x80);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<syscon_store_dobldobl_polynomial>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %edi,-0x54(%rbp)
  mov    %esi,-0x58(%rbp)
  mov    %edx,-0x5c(%rbp)
  mov    %rcx,-0x68(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  mov    -0x54(%rbp),%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x40(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r10
  mov    $0x0,%r11d
  movslq %eax,%rdx
  mov    %rdx,%r8
  mov    $0x0,%r9d
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L39:
  cmp    %rdx,%rsp
  je     L51
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L39
L51:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L54
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L54:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x54(%rbp),%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x58(%rbp),%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x5c(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
  movl   $0x0,-0x48(%rbp)
  jmp    L14
L4:
  mov    -0x48(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%ecx
  mov    -0x38(%rbp),%rax
  mov    -0x48(%rbp),%edx
  movslq %edx,%rdx
  mov    %ecx,(%rax,%rdx,4)
  addl   $0x1,-0x48(%rbp)
L14:
  mov    -0x48(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jl     L4
  mov    -0x30(%rbp),%rcx
  mov    -0x38(%rbp),%rdx
  lea    -0x24(%rbp),%rax
  mov    $0x0,%r8d
  mov    %rax,%rsi
  mov    $0x152,%edi
  call   <_ada_use_c2phc4c@plt>
  mov    %eax,-0x44(%rbp)
  mov    -0x44(%rbp),%eax
  mov    %rbx,%rsp
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L49
  call   <__stack_chk_fail@plt>
L49:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int syscon_store_dobldobl_polynomial(int nc, int n, int k, char *p) {
  int a[3], b[nc], i, fail;
  double *c;
  a[0] = nc;
  a[1] = n;
  a[2] = k;
  for (i = 0; i < nc; i++)
    b[i] = (int)p[i];
  fail = _ada_use_c2phc4c(338, a, b, c, 0);
  return fail;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<syscon_store_dobldobl_polynomial>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,%eax
  mov    %esi,%r9d
  mov    %edx,%r8d
  mov    %rcx,%rsi
  mov    %fs:0x28,%rdx
  mov    %rdx,-0x8(%rbp)
  xor    %edx,%edx
  movslq %edi,%rdx
  lea    0xf(,%rdx,4),%rdx
  mov    %rdx,%rdi
  and    $0xfffffffffffffff0,%rdi
  and    $0xfffffffffffff000,%rdx
  mov    %rsp,%rcx
  sub    %rdx,%rcx
L40:
  cmp    %rcx,%rsp
  je     L14
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L40
L14:
  mov    %rdi,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L53
  orq    $0x0,-0x8(%rsp,%rdx,1)
L53:
  mov    %rsp,%rdi
  mov    %eax,-0x14(%rbp)
  mov    %r9d,-0x10(%rbp)
  mov    %r8d,-0xc(%rbp)
  test   %eax,%eax
  jle    L23
  mov    %eax,%ecx
  mov    $0x0,%eax
L11:
  movsbl (%rsi,%rax,1),%edx
  mov    %edx,(%rdi,%rax,4)
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L11
L23:
  lea    -0x14(%rbp),%rsi
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    %rdi,%rdx
  mov    $0x152,%edi
  call   <_ada_use_c2phc4c@plt>
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L18
  leave
  ret
L18:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int syscon_store_dobldobl_polynomial(int nc, int n, int k, char *p) {
  int a[3], b[nc], i, fail;
  double *c;
  a[0] = nc;
  a[1] = n;
  a[2] = k;
  for (i = 0; i < nc; i++)
    b[i] = (int)p[i];
  fail = _ada_use_c2phc4c(338, a, b, c, 0);
  return fail;
}
```
user: Translate the below assembly code into C programming language:

```asm
<syscon_store_dobldobl_polynomial>:
  endbr64
  push   %rbp
  mov    %esi,%r8d
  movslq %edi,%rsi
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    0xf(,%rsi,4),%rax
  mov    %rsp,%r10
  mov    %rax,%r9
  and    $0xfffffffffffff000,%rax
  sub    %rax,%r10
  and    $0xfffffffffffffff0,%r9
  cmp    %r10,%rsp
  je     L36
L25:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %r10,%rsp
  jne    L25
L36:
  and    $0xfff,%r9d
  sub    %r9,%rsp
  test   %r9,%r9
  jne    L54
L59:
  mov    %edi,-0x14(%rbp)
  mov    %rsp,%r9
  mov    %r8d,-0x10(%rbp)
  mov    %edx,-0xc(%rbp)
  test   %edi,%edi
  jle    L12
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L49:
  movsbl (%rcx,%rax,1),%edx
  mov    %edx,(%r9,%rax,4)
  add    $0x1,%rax
  cmp    %rsi,%rax
  jne    L49
L12:
  xor    %r8d,%r8d
  xor    %ecx,%ecx
  mov    %r9,%rdx
  mov    $0x152,%edi
  lea    -0x14(%rbp),%rsi
  call   <_ada_use_c2phc4c@plt>
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L6
  leave
  ret
  nopl   0x0(%rax,%rax,1)
L54:
  orq    $0x0,-0x8(%rsp,%r9,1)
  jmp    L59
L6:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int syscon_store_dobldobl_polynomial(int nc, int n, int k, char *p) {
  int a[3], b[nc], i, fail;
  double *c;
  a[0] = nc;
  a[1] = n;
  a[2] = k;
  for (i = 0; i < nc; i++)
    b[i] = (int)p[i];
  fail = _ada_use_c2phc4c(338, a, b, c, 0);
  return fail;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<util_hex_to_nib>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,%eax
  mov    %al,-0x14(%rbp)
  movsbl -0x14(%rbp),%eax
  sub    $0x41,%eax
  cmp    $0x25,%eax
  ja     L72
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D6(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D6(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  movl   $0xa,-0x4(%rbp)
  jmp    L47
  movl   $0xb,-0x4(%rbp)
  jmp    L47
  movl   $0xc,-0x4(%rbp)
  jmp    L47
  movl   $0xd,-0x4(%rbp)
  jmp    L47
  movl   $0xe,-0x4(%rbp)
  jmp    L47
  movl   $0xf,-0x4(%rbp)
  jmp    L47
L72:
  movsbl -0x14(%rbp),%eax
  sub    $0x30,%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  js     L36
  cmpl   $0x9,-0x4(%rbp)
  jle    L67
L36:
  movl   $0xffffffff,-0x4(%rbp)
L67:
  nop
L47:
  mov    -0x4(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int util_hex_to_nib(char ch) {
  int val;
  switch (ch) {
  case 'a':
  case 'A':
    val = 10;
    break;
  case 'b':
  case 'B':
    val = 11;
    break;
  case 'c':
  case 'C':
    val = 12;
    break;
  case 'd':
  case 'D':
    val = 13;
    break;
  case 'e':
  case 'E':
    val = 14;
    break;
  case 'f':
  case 'F':
    val = 15;
    break;
  default:
    val = (int)ch - (int)'0';
    if ((val < 0) || (val > 9)) {
      val = -1;
    }
    break;
  }
  return val;
}
```
user: What is the c source code of the assembly code below?

```asm
<util_hex_to_nib>:
  endbr64
  lea    -0x41(%rdi),%eax
  cmp    $0x25,%al
  ja     L5
  movzbl %al,%eax
  lea    D2(%rip),%rdx
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  mov    $0xb,%eax
  ret
  mov    $0xc,%eax
  ret
  mov    $0xd,%eax
  ret
  mov    $0xe,%eax
  ret
  mov    $0xf,%eax
  ret
L5:
  movsbl %dil,%edi
  lea    -0x30(%rdi),%eax
  cmp    $0x9,%eax
  ja     L24
L21:
  ret
L24:
  mov    $0xffffffff,%eax
  ret
  mov    $0xa,%eax
  jmp    L21
```

assistant: ```c
int util_hex_to_nib(char ch) {
  int val;
  switch (ch) {
  case 'a':
  case 'A':
    val = 10;
    break;
  case 'b':
  case 'B':
    val = 11;
    break;
  case 'c':
  case 'C':
    val = 12;
    break;
  case 'd':
  case 'D':
    val = 13;
    break;
  case 'e':
  case 'E':
    val = 14;
    break;
  case 'f':
  case 'F':
    val = 15;
    break;
  default:
    val = (int)ch - (int)'0';
    if ((val < 0) || (val > 9)) {
      val = -1;
    }
    break;
  }
  return val;
}
```
user: Translate the below assembly code into C programming language:

```asm
<util_hex_to_nib>:
  endbr64
  lea    -0x41(%rdi),%eax
  cmp    $0x25,%al
  ja     L12
  lea    D4(%rip),%rdx
  movzbl %al,%eax
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  nop
L12:
  movsbl %dil,%edi
  lea    -0x30(%rdi),%eax
  cmp    $0x9,%eax
  ja     L2
  ret
  nopl   (%rax)
  mov    $0xc,%eax
  ret
  cs nopw 0x0(%rax,%rax,1)
  mov    $0xd,%eax
  ret
  cs nopw 0x0(%rax,%rax,1)
  mov    $0xe,%eax
  ret
  cs nopw 0x0(%rax,%rax,1)
  mov    $0xf,%eax
  ret
  cs nopw 0x0(%rax,%rax,1)
  mov    $0xa,%eax
  ret
  cs nopw 0x0(%rax,%rax,1)
  mov    $0xb,%eax
  ret
L2:
  mov    $0xffffffff,%eax
  ret
```

assistant: ```c
int util_hex_to_nib(char ch) {
  int val;
  switch (ch) {
  case 'a':
  case 'A':
    val = 10;
    break;
  case 'b':
  case 'B':
    val = 11;
    break;
  case 'c':
  case 'C':
    val = 12;
    break;
  case 'd':
  case 'D':
    val = 13;
    break;
  case 'e':
  case 'E':
    val = 14;
    break;
  case 'f':
  case 'F':
    val = 15;
    break;
  default:
    val = (int)ch - (int)'0';
    if ((val < 0) || (val > 9)) {
      val = -1;
    }
    break;
  }
  return val;
}
```