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

```asm
<printAllShortestPath>:
  endbr64
  push   %r15
  lea    D16(%rip),%rdi
  push   %r14
  push   %r13
  push   %r12
  mov    %ecx,%r12d
  push   %rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x18,%rsp
  mov    %rsi,0x8(%rsp)
  call   <puts@plt>
  sub    $0x1,%r12d
  js     L57
  movslq %r12d,%r12
  lea    D19(%rip),%r14
  lea    D14(%rip),%rbp
  lea    D21(%rip),%r15
  nopl   0x0(%rax,%rax,1)
L12:
  mov    %r12d,%esi
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    (%rbx,%r12,4),%r13d
  cmp    $0xffffffff,%r13d
  je     L32
  nopw   0x0(%rax,%rax,1)
L5:
  mov    %r13d,%esi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  movslq %r13d,%rdx
  mov    (%rbx,%rdx,4),%r13d
  cmp    $0xffffffff,%r13d
  jne    L5
L32:
  mov    0x8(%rsp),%rax
  mov    (%rax,%r12,4),%esi
  cmp    $0x8000,%esi
  je     L37
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <printf@plt>
L40:
  mov    $0xa,%edi
  sub    $0x1,%r12
  call   <putchar@plt>
  test   %r12d,%r12d
  jns    L12
L57:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L37:
  lea    D40(%rip),%rsi
  lea    D3(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L40
```

tool_calls: name: parse_data
arguments: label: D16
datatype: string
name: parse_data
arguments: label: D19
datatype: string
name: parse_data
arguments: label: D14
datatype: string
name: parse_data
arguments: label: D21
datatype: string
name: parse_data
arguments: label: D40
datatype: string
name: parse_data
arguments: label: D3
datatype: string

tool: D16: Vertex: revert path (weight)

tool: D19: %6d

tool: D14:  -> %2d

tool: D21:  (%2d)

tool: D40: MAX

tool: D3:  (%s)

assistant: ```c
void printAllShortestPath(int checkedVertex[], int vertexWeight[], int vertexParent[], int size) {
  int i;
  printf("Vertex: revert path (weight)\n");
  for (i = size - 1; i >= 0; i--) {
    printf("%6d", i);
    int current = i;
    while (vertexParent[current] != -1) {
      current = vertexParent[current];
      printf(" -> %2d", current);
    }
    if (vertexWeight[i] == 32768) {
      printf(" (%s)", "MAX");
    } else {
      printf(" (%2d)", vertexWeight[i]);
    }
    printf("\n");
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<core_tick>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0x0,%eax
  call   <TypeCTick@plt>
  mov    $0x0,%eax
  call   <PolicyTick@plt>
  nop
  pop    %rbp
  ret
```

assistant: ```c
void core_tick(void) {
  TypeCTick();
  PolicyTick();
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<core_tick>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%eax
  call   <TypeCTick@plt>
  mov    $0x0,%eax
  call   <PolicyTick@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
void core_tick(void) {
  TypeCTick();
  PolicyTick();
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<core_tick>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <TypeCTick@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  jmp    1070 <PolicyTick@plt>
```

assistant: ```c
void core_tick(void) {
  TypeCTick();
  PolicyTick();
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<core_tick>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <TypeCTick@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  jmp    1070 <PolicyTick@plt>
```

assistant: ```c
void core_tick(void) {
  TypeCTick();
  PolicyTick();
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<canonical>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebx
  mov    $0x1,%ebp
  jmp    L17
L19:
  mov    %ebx,%edx
  shr    $0x4,%edx
  and    $0xc0,%edx
  mov    %ebx,%eax
  shr    $0x10,%eax
  shl    $0xc,%eax
  mov    %ebx,%ecx
  shl    $0x4,%ecx
  and    $0x30,%ecx
  or     %ecx,%eax
  mov    %ebx,%ecx
  and    $0xc30c,%ecx
  or     %ecx,%eax
  mov    %ebx,%ecx
  shr    $0x4,%ecx
  and    $0x3,%ecx
  or     %ecx,%eax
  mov    %ebx,%ecx
  shl    $0x4,%ecx
  and    $0x30000,%ecx
  or     %ecx,%eax
  shl    $0x4,%ebx
  and    $0xc00,%ebx
  or     %eax,%ebx
  or     %edx,%ebx
  mov    %ebx,%esi
  call   <umin@plt>
  mov    %eax,%edi
L21:
  add    $0x1,%ebp
L17:
  mov    %ebx,%edx
  shr    $0x8,%edx
  and    $0xc,%edx
  mov    %ebx,%eax
  shl    $0xc,%eax
  and    $0x3000,%eax
  mov    %ebx,%ecx
  shr    $0x4,%ecx
  and    $0x3,%ecx
  or     %ecx,%eax
  mov    %ebx,%ecx
  and    $0x300,%ecx
  or     %ecx,%eax
  mov    %ebx,%ecx
  shl    $0x4,%ecx
  and    $0x30000,%ecx
  or     %ecx,%eax
  mov    %ebx,%ecx
  shl    $0x8,%ecx
  and    $0xc000,%ecx
  or     %ecx,%eax
  mov    %ebx,%ecx
  shr    $0x4,%ecx
  and    $0xc00,%ecx
  or     %ecx,%eax
  mov    %ebx,%ecx
  shl    $0x4,%ecx
  and    $0xc0,%ecx
  or     %ecx,%eax
  shr    $0xc,%ebx
  and    $0x30,%ebx
  or     %eax,%ebx
  or     %edx,%ebx
  cmp    $0x4,%ebp
  je     L19
  mov    %ebx,%esi
  call   <umin@plt>
  mov    %eax,%edi
  cmp    $0x7,%ebp
  jle    L21
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
unsigned canonical(unsigned conf0) {
  unsigned minconf = conf0;
  int r;
  for (r = 0; r <= 7; ++r) {
    conf0 = ((((((conf0) >> (2 * (6))) & 3)) << 16) | (((((conf0) >> (2 * (3))) & 3)) << 14) | (((((conf0) >> (2 * (0))) & 3)) << 12) | (((((conf0) >> (2 * (7))) & 3)) << 10) | (((((conf0) >> (2 * (4))) & 3)) << 8) | (((((conf0) >> (2 * (1))) & 3)) << 6) | (((((conf0) >> (2 * (8))) & 3)) << 4) | (((((conf0) >> (2 * (5))) & 3)) << 2) | ((((conf0) >> (2 * (2))) & 3)));
    if (r == 3)
      conf0 = ((((((conf0) >> (2 * (6))) & 3)) << 16) | (((((conf0) >> (2 * (7))) & 3)) << 14) | (((((conf0) >> (2 * (8))) & 3)) << 12) | (((((conf0) >> (2 * (3))) & 3)) << 10) | (((((conf0) >> (2 * (4))) & 3)) << 8) | (((((conf0) >> (2 * (5))) & 3)) << 6) | (((((conf0) >> (2 * (0))) & 3)) << 4) | (((((conf0) >> (2 * (1))) & 3)) << 2) | ((((conf0) >> (2 * (2))) & 3)));
    minconf = umin(minconf, conf0);
  }
  return minconf;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<canonical>:
  endbr64
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  mov    %edi,%ebx
  sub    $0x8,%rsp
  xchg   %ax,%ax
L12:
  mov    %ebx,%eax
  mov    %ebx,%ecx
  mov    %ebx,%edx
  add    $0x1,%ebp
  shl    $0xc,%eax
  shr    $0x4,%ecx
  and    $0x3,%ecx
  and    $0x3000,%eax
  shr    $0x8,%edx
  or     %ecx,%eax
  mov    %ebx,%ecx
  and    $0xc,%edx
  and    $0x300,%ecx
  or     %ecx,%eax
  mov    %ebx,%ecx
  shl    $0x4,%ecx
  and    $0x30000,%ecx
  or     %ecx,%eax
  mov    %ebx,%ecx
  shl    $0x8,%ecx
  and    $0xc000,%ecx
  or     %ecx,%eax
  mov    %ebx,%ecx
  shr    $0x4,%ecx
  and    $0xc00,%ecx
  or     %ecx,%eax
  mov    %ebx,%ecx
  shr    $0xc,%ebx
  shl    $0x4,%ecx
  and    $0x30,%ebx
  and    $0xc0,%ecx
  or     %ecx,%eax
  or     %eax,%ebx
  or     %edx,%ebx
  cmp    $0x4,%ebp
  je     L21
  mov    %ebx,%esi
  call   <umin@plt>
  mov    %eax,%edi
  cmp    $0x8,%ebp
  jne    L12
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax)
L21:
  mov    %ebx,%eax
  mov    %ebx,%ecx
  mov    %ebx,%edx
  shr    $0x10,%eax
  shl    $0x4,%ecx
  shl    $0xc,%eax
  and    $0x30,%ecx
  shr    $0x4,%edx
  or     %ecx,%eax
  mov    %ebx,%ecx
  and    $0xc0,%edx
  and    $0xc30c,%ecx
  or     %ecx,%eax
  mov    %ebx,%ecx
  shr    $0x4,%ecx
  and    $0x3,%ecx
  or     %ecx,%eax
  mov    %ebx,%ecx
  shl    $0x4,%ebx
  shl    $0x4,%ecx
  and    $0xc00,%ebx
  and    $0x30000,%ecx
  or     %ecx,%eax
  or     %eax,%ebx
  or     %edx,%ebx
  mov    %ebx,%esi
  call   <umin@plt>
  mov    %eax,%edi
  jmp    L12
```

assistant: ```c
unsigned canonical(unsigned conf0) {
  unsigned minconf = conf0;
  int r;
  for (r = 0; r <= 7; ++r) {
    conf0 = ((((((conf0) >> (2 * (6))) & 3)) << 16) | (((((conf0) >> (2 * (3))) & 3)) << 14) | (((((conf0) >> (2 * (0))) & 3)) << 12) | (((((conf0) >> (2 * (7))) & 3)) << 10) | (((((conf0) >> (2 * (4))) & 3)) << 8) | (((((conf0) >> (2 * (1))) & 3)) << 6) | (((((conf0) >> (2 * (8))) & 3)) << 4) | (((((conf0) >> (2 * (5))) & 3)) << 2) | ((((conf0) >> (2 * (2))) & 3)));
    if (r == 3)
      conf0 = ((((((conf0) >> (2 * (6))) & 3)) << 16) | (((((conf0) >> (2 * (7))) & 3)) << 14) | (((((conf0) >> (2 * (8))) & 3)) << 12) | (((((conf0) >> (2 * (3))) & 3)) << 10) | (((((conf0) >> (2 * (4))) & 3)) << 8) | (((((conf0) >> (2 * (5))) & 3)) << 6) | (((((conf0) >> (2 * (0))) & 3)) << 4) | (((((conf0) >> (2 * (1))) & 3)) << 2) | ((((conf0) >> (2 * (2))) & 3)));
    minconf = umin(minconf, conf0);
  }
  return minconf;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<canonical>:
  endbr64
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  mov    %edi,%ebx
  sub    $0x8,%rsp
  xchg   %ax,%ax
L29:
  mov    %ebx,%eax
  mov    %ebx,%ecx
  mov    %ebx,%edx
  add    $0x1,%ebp
  shl    $0xc,%eax
  shr    $0x4,%ecx
  and    $0x3,%ecx
  and    $0x3000,%eax
  shr    $0x8,%edx
  or     %ecx,%eax
  mov    %ebx,%ecx
  and    $0xc,%edx
  and    $0x300,%ecx
  or     %ecx,%eax
  mov    %ebx,%ecx
  shl    $0x4,%ecx
  and    $0x30000,%ecx
  or     %ecx,%eax
  mov    %ebx,%ecx
  shl    $0x8,%ecx
  and    $0xc000,%ecx
  or     %ecx,%eax
  mov    %ebx,%ecx
  shr    $0x4,%ecx
  and    $0xc00,%ecx
  or     %ecx,%eax
  mov    %ebx,%ecx
  shr    $0xc,%ebx
  shl    $0x4,%ecx
  and    $0x30,%ebx
  and    $0xc0,%ecx
  or     %ecx,%eax
  or     %eax,%ebx
  or     %edx,%ebx
  cmp    $0x4,%ebp
  je     L28
  mov    %ebx,%esi
  call   <umin@plt>
  mov    %eax,%edi
  cmp    $0x8,%ebp
  jne    L29
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax)
L28:
  mov    %ebx,%eax
  mov    %ebx,%ecx
  mov    %ebx,%edx
  shr    $0x10,%eax
  shl    $0x4,%ecx
  shl    $0xc,%eax
  and    $0x30,%ecx
  shr    $0x4,%edx
  or     %ecx,%eax
  mov    %ebx,%ecx
  and    $0xc0,%edx
  and    $0xc30c,%ecx
  or     %ecx,%eax
  mov    %ebx,%ecx
  shr    $0x4,%ecx
  and    $0x3,%ecx
  or     %ecx,%eax
  mov    %ebx,%ecx
  shl    $0x4,%ebx
  shl    $0x4,%ecx
  and    $0xc00,%ebx
  and    $0x30000,%ecx
  or     %ecx,%eax
  or     %eax,%ebx
  or     %edx,%ebx
  mov    %ebx,%esi
  call   <umin@plt>
  mov    %eax,%edi
  jmp    L29
```

assistant: ```c
unsigned canonical(unsigned conf0) {
  unsigned minconf = conf0;
  int r;
  for (r = 0; r <= 7; ++r) {
    conf0 = ((((((conf0) >> (2 * (6))) & 3)) << 16) | (((((conf0) >> (2 * (3))) & 3)) << 14) | (((((conf0) >> (2 * (0))) & 3)) << 12) | (((((conf0) >> (2 * (7))) & 3)) << 10) | (((((conf0) >> (2 * (4))) & 3)) << 8) | (((((conf0) >> (2 * (1))) & 3)) << 6) | (((((conf0) >> (2 * (8))) & 3)) << 4) | (((((conf0) >> (2 * (5))) & 3)) << 2) | ((((conf0) >> (2 * (2))) & 3)));
    if (r == 3)
      conf0 = ((((((conf0) >> (2 * (6))) & 3)) << 16) | (((((conf0) >> (2 * (7))) & 3)) << 14) | (((((conf0) >> (2 * (8))) & 3)) << 12) | (((((conf0) >> (2 * (3))) & 3)) << 10) | (((((conf0) >> (2 * (4))) & 3)) << 8) | (((((conf0) >> (2 * (5))) & 3)) << 6) | (((((conf0) >> (2 * (0))) & 3)) << 4) | (((((conf0) >> (2 * (1))) & 3)) << 2) | ((((conf0) >> (2 * (2))) & 3)));
    minconf = umin(minconf, conf0);
  }
  return minconf;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<pl_trim_whitespaces>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x18(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L46
L80:
  subq   $0x1,-0x8(%rbp)
L46:
  mov    -0x8(%rbp),%rax
  cmp    -0x10(%rbp),%rax
  jbe    L42
  mov    -0x8(%rbp),%rax
  sub    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L80
  mov    -0x8(%rbp),%rax
  sub    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L80
  mov    -0x8(%rbp),%rax
  sub    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0xd,%al
  je     L80
  mov    -0x8(%rbp),%rax
  sub    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  je     L80
L42:
  mov    -0x8(%rbp),%rax
  movb   $0x0,(%rax)
  jmp    L60
L72:
  addq   $0x1,-0x10(%rbp)
L60:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L72
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L72
  mov    -0x10(%rbp),%rax
  leave
  ret
```

assistant: ```c
char *pl_trim_whitespaces(char *str) {
  char *its, *ite;
  its = str;
  ite = strchr(str, '\0');
  while (ite > its && (*(ite - 1) == ' ' || *(ite - 1) == '\t' || *(ite - 1) == '\r' || *(ite - 1) == '\n'))
    ite--;
  *ite = '\0';
  while (*its == ' ' || *its == '\t')
    its++;
  return its;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<pl_trim_whitespaces>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  mov    $0x0,%esi
  call   <strchr@plt>
  movabs $0x100002600,%rcx
  cmp    %rax,%rbx
  jb     L4
  jmp    L91
L71:
  bt     %rdx,%rcx
  jae    L91
  sub    $0x1,%rax
  cmp    %rax,%rbx
  je     L94
L4:
  movzbl -0x1(%rax),%edx
  cmp    $0x20,%dl
  jbe    L71
L91:
  movb   $0x0,(%rax)
  movzbl (%rbx),%eax
  cmp    $0x20,%al
  je     L57
  cmp    $0x9,%al
  jne    L68
L57:
  add    $0x1,%rbx
  movzbl (%rbx),%eax
  cmp    $0x20,%al
  je     L57
  cmp    $0x9,%al
  je     L57
L68:
  mov    %rbx,%rax
  pop    %rbx
  ret
L94:
  mov    %rbx,%rax
  jmp    L91
```

assistant: ```c
char *pl_trim_whitespaces(char *str) {
  char *its, *ite;
  its = str;
  ite = strchr(str, '\0');
  while (ite > its && (*(ite - 1) == ' ' || *(ite - 1) == '\t' || *(ite - 1) == '\r' || *(ite - 1) == '\n'))
    ite--;
  *ite = '\0';
  while (*its == ' ' || *its == '\t')
    its++;
  return its;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<pl_trim_whitespaces>:
  endbr64
  push   %r12
  xor    %esi,%esi
  mov    %rdi,%r12
  call   <strchr@plt>
  movabs $0xfffffffeffffd9ff,%rcx
  cmp    %rax,%r12
  jae    L78
  nop
L63:
  movzbl -0x1(%rax),%edx
  cmp    $0x20,%dl
  jbe    L31
L78:
  movb   $0x0,(%rax)
  movzbl (%r12),%eax
  cmp    $0x20,%al
  jne    L55
  nopl   (%rax)
L10:
  movzbl 0x1(%r12),%eax
  add    $0x1,%r12
  cmp    $0x20,%al
  je     L10
L55:
  cmp    $0x9,%al
  je     L10
  mov    %r12,%rax
  pop    %r12
  ret
L31:
  bt     %rdx,%rcx
  jb     L78
  sub    $0x1,%rax
  cmp    %rax,%r12
  jne    L63
  jmp    L78
```

assistant: ```c
char *pl_trim_whitespaces(char *str) {
  char *its, *ite;
  its = str;
  ite = strchr(str, '\0');
  while (ite > its && (*(ite - 1) == ' ' || *(ite - 1) == '\t' || *(ite - 1) == '\r' || *(ite - 1) == '\n'))
    ite--;
  *ite = '\0';
  while (*its == ' ' || *its == '\t')
    its++;
  return its;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<pl_trim_whitespaces>:
  endbr64
  push   %r12
  xor    %esi,%esi
  mov    %rdi,%r12
  call   <strchr@plt>
  movabs $0xfffffffeffffd9ff,%rcx
  cmp    %rax,%r12
  jae    L59
  nop
L24:
  movzbl -0x1(%rax),%edx
  cmp    $0x20,%dl
  jbe    L66
L59:
  movb   $0x0,(%rax)
  movzbl (%r12),%eax
  cmp    $0x20,%al
  jne    L61
  nopl   (%rax)
L47:
  movzbl 0x1(%r12),%eax
  add    $0x1,%r12
  cmp    $0x20,%al
  je     L47
L61:
  cmp    $0x9,%al
  je     L47
  mov    %r12,%rax
  pop    %r12
  ret
L66:
  bt     %rdx,%rcx
  jb     L59
  sub    $0x1,%rax
  cmp    %rax,%r12
  jne    L24
  jmp    L59
```

assistant: ```c
char *pl_trim_whitespaces(char *str) {
  char *its, *ite;
  its = str;
  ite = strchr(str, '\0');
  while (ite > its && (*(ite - 1) == ' ' || *(ite - 1) == '\t' || *(ite - 1) == '\r' || *(ite - 1) == '\n'))
    ite--;
  *ite = '\0';
  while (*its == ' ' || *its == '\t')
    its++;
  return its;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<RandomFunc>:
  endbr64
  mov    %rsi,%rdx
  movzwl (%rdi),%ecx
  lea    0x2cdb(%rcx),%eax
  test   $0x1,%cl
  jne    L46
  test   $0x4,%al
  je     L33
  mov    %eax,%ecx
  shr    $0x3,%cx
  test   $0x8,%al
  je     L45
  push   %rbx
  mov    $0x0,%ebx
  mov    %ah,%bh
  mov    %al,%bl
  mov    %ebx,%ecx
  shr    %cx
  and    $0xe,%ecx
  or     $0x1,%ecx
  mov    %ebx,%eax
  ror    %cl,%ax
  add    $0x34fb,%ax
  mov    %ax,(%rsi)
  pop    %rbx
  ret
L45:
  and    $0xe,%ecx
  or     $0x1,%ecx
  ror    %cl,%ax
  mov    %eax,%ecx
  shl    $0x4,%ecx
  and    $0x3f0,%cx
  or     %ecx,%eax
  jmp    L41
L33:
  lea    0x0(,%rax,8),%ecx
  and    $0x78,%ecx
  or     %eax,%ecx
  movzwl %cx,%eax
  shr    $0x3,%cx
  and    $0x6,%ecx
  or     $0x1,%ecx
  sar    %cl,%eax
  jmp    L41
L46:
  imul   %eax,%eax
L41:
  add    $0x34fb,%ax
  mov    %ax,(%rdx)
  ret
```

assistant: ```c
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  char copy11;
  {
    state[0UL] = input[0UL] + (unsigned short)11483;
    if (state[0UL] & (unsigned short)1) {
      if ((state[0UL] >> (unsigned short)2) & (unsigned short)1) {
        if ((state[0UL] >> (unsigned short)3) & (unsigned short)1) {
          copy11 = *((char *)(&state[0UL]) + 0);
          *((char *)(&state[0UL]) + 0) = *((char *)(&state[0UL]) + 1);
          *((char *)(&state[0UL]) + 1) = copy11;
          copy11 = *((char *)(&state[0UL]) + 1);
          *((char *)(&state[0UL]) + 1) = *((char *)(&state[0UL]) + 0);
          *((char *)(&state[0UL]) + 0) = copy11;
          state[0UL] = (state[0UL] >> (((state[0UL] >> (unsigned short)1) & (unsigned short)15) | 1UL)) | (state[0UL] << (16 - (((state[0UL] >> (unsigned short)1) & (unsigned short)15) | 1UL)));
        } else {
          state[0UL] = (state[0UL] >> (((state[0UL] >> (unsigned short)3) & (unsigned short)15) | 1UL)) | (state[0UL] << (16 - (((state[0UL] >> (unsigned short)3) & (unsigned short)15) | 1UL)));
          state[0UL] |= (state[0UL] & (unsigned short)63) << 4UL;
        }
      } else {
        state[0UL] |= (state[0UL] & (unsigned short)15) << 3UL;
        state[0UL] >>= ((state[0UL] >> (unsigned short)3) & (unsigned short)7) | 1UL;
      }
    } else {
      state[0UL] *= state[0UL];
    }
    output[0UL] = (state[0UL] + 576551744UL) - (unsigned short)17989;
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<RandomFunc>:
  endbr64
  movzwl (%rdi),%ecx
  mov    %rsi,%rdx
  lea    0x2cdb(%rcx),%eax
  and    $0x1,%ecx
  jne    L2
  test   $0x4,%al
  je     L25
  mov    %eax,%ecx
  shr    $0x3,%cx
  test   $0x8,%al
  je     L26
  mov    %eax,%ecx
  shr    %cx
  and    $0xe,%ecx
  or     $0x1,%ecx
  ror    %cl,%ax
  add    $0x34fb,%ax
  mov    %ax,(%rdx)
  ret
  nopl   0x0(%rax)
L2:
  imul   %eax,%eax
  add    $0x34fb,%ax
  mov    %ax,(%rdx)
  ret
  nopl   0x0(%rax,%rax,1)
L25:
  lea    0x0(,%rax,8),%ecx
  and    $0x78,%ecx
  or     %eax,%ecx
  movzwl %cx,%eax
  shr    $0x3,%cx
  and    $0x6,%ecx
  or     $0x1,%ecx
  sar    %cl,%eax
  add    $0x34fb,%ax
  mov    %ax,(%rdx)
  ret
  nopl   0x0(%rax,%rax,1)
L26:
  and    $0xe,%ecx
  or     $0x1,%ecx
  ror    %cl,%ax
  mov    %eax,%ecx
  shl    $0x4,%ecx
  and    $0x3f0,%cx
  or     %ecx,%eax
  add    $0x34fb,%ax
  mov    %ax,(%rdx)
  ret
```

assistant: ```c
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  char copy11;
  {
    state[0UL] = input[0UL] + (unsigned short)11483;
    if (state[0UL] & (unsigned short)1) {
      if ((state[0UL] >> (unsigned short)2) & (unsigned short)1) {
        if ((state[0UL] >> (unsigned short)3) & (unsigned short)1) {
          copy11 = *((char *)(&state[0UL]) + 0);
          *((char *)(&state[0UL]) + 0) = *((char *)(&state[0UL]) + 1);
          *((char *)(&state[0UL]) + 1) = copy11;
          copy11 = *((char *)(&state[0UL]) + 1);
          *((char *)(&state[0UL]) + 1) = *((char *)(&state[0UL]) + 0);
          *((char *)(&state[0UL]) + 0) = copy11;
          state[0UL] = (state[0UL] >> (((state[0UL] >> (unsigned short)1) & (unsigned short)15) | 1UL)) | (state[0UL] << (16 - (((state[0UL] >> (unsigned short)1) & (unsigned short)15) | 1UL)));
        } else {
          state[0UL] = (state[0UL] >> (((state[0UL] >> (unsigned short)3) & (unsigned short)15) | 1UL)) | (state[0UL] << (16 - (((state[0UL] >> (unsigned short)3) & (unsigned short)15) | 1UL)));
          state[0UL] |= (state[0UL] & (unsigned short)63) << 4UL;
        }
      } else {
        state[0UL] |= (state[0UL] & (unsigned short)15) << 3UL;
        state[0UL] >>= ((state[0UL] >> (unsigned short)3) & (unsigned short)7) | 1UL;
      }
    } else {
      state[0UL] *= state[0UL];
    }
    output[0UL] = (state[0UL] + 576551744UL) - (unsigned short)17989;
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<RandomFunc>:
  endbr64
  movzwl (%rdi),%ecx
  mov    %rsi,%rdx
  lea    0x2cdb(%rcx),%eax
  and    $0x1,%ecx
  jne    L14
  test   $0x4,%al
  je     L8
  mov    %eax,%ecx
  shr    $0x3,%cx
  test   $0x8,%al
  je     L4
  mov    %eax,%ecx
  shr    %cx
  and    $0xe,%ecx
  or     $0x1,%ecx
  ror    %cl,%ax
  add    $0x34fb,%ax
  mov    %ax,(%rdx)
  ret
  nopl   0x0(%rax)
L14:
  imul   %eax,%eax
  add    $0x34fb,%ax
  mov    %ax,(%rdx)
  ret
  nopl   0x0(%rax,%rax,1)
L8:
  lea    0x0(,%rax,8),%ecx
  and    $0x78,%ecx
  or     %eax,%ecx
  movzwl %cx,%eax
  shr    $0x3,%cx
  and    $0x6,%ecx
  or     $0x1,%ecx
  sar    %cl,%eax
  add    $0x34fb,%ax
  mov    %ax,(%rdx)
  ret
  nopl   0x0(%rax,%rax,1)
L4:
  and    $0xe,%ecx
  or     $0x1,%ecx
  ror    %cl,%ax
  mov    %eax,%ecx
  shl    $0x4,%ecx
  and    $0x3f0,%cx
  or     %ecx,%eax
  add    $0x34fb,%ax
  mov    %ax,(%rdx)
  ret
```

assistant: ```c
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  char copy11;
  {
    state[0UL] = input[0UL] + (unsigned short)11483;
    if (state[0UL] & (unsigned short)1) {
      if ((state[0UL] >> (unsigned short)2) & (unsigned short)1) {
        if ((state[0UL] >> (unsigned short)3) & (unsigned short)1) {
          copy11 = *((char *)(&state[0UL]) + 0);
          *((char *)(&state[0UL]) + 0) = *((char *)(&state[0UL]) + 1);
          *((char *)(&state[0UL]) + 1) = copy11;
          copy11 = *((char *)(&state[0UL]) + 1);
          *((char *)(&state[0UL]) + 1) = *((char *)(&state[0UL]) + 0);
          *((char *)(&state[0UL]) + 0) = copy11;
          state[0UL] = (state[0UL] >> (((state[0UL] >> (unsigned short)1) & (unsigned short)15) | 1UL)) | (state[0UL] << (16 - (((state[0UL] >> (unsigned short)1) & (unsigned short)15) | 1UL)));
        } else {
          state[0UL] = (state[0UL] >> (((state[0UL] >> (unsigned short)3) & (unsigned short)15) | 1UL)) | (state[0UL] << (16 - (((state[0UL] >> (unsigned short)3) & (unsigned short)15) | 1UL)));
          state[0UL] |= (state[0UL] & (unsigned short)63) << 4UL;
        }
      } else {
        state[0UL] |= (state[0UL] & (unsigned short)15) << 3UL;
        state[0UL] >>= ((state[0UL] >> (unsigned short)3) & (unsigned short)7) | 1UL;
      }
    } else {
      state[0UL] *= state[0UL];
    }
    output[0UL] = (state[0UL] + 576551744UL) - (unsigned short)17989;
  }
}
```