ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<ShbIpcCrc32GetCrc>:
  endbr64
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  mov    $0xffffffff,%ebx
  sub    $0x8,%rsp
  jmp    L1
  nopl   (%rax)
L19:
  mov    %rbx,%rax
  xor    0x0(%r13,%rbp,1),%bl
  add    $0x1,%rbp
  movzbl %bl,%ebx
  shr    $0x8,%rax
  and    $0xffffff,%eax
  xor    (%r12,%rbx,8),%rax
  mov    %rax,%rbx
L1:
  mov    %r13,%rdi
  call   <strlen@plt>
  cmp    %ebp,%eax
  jg     L19
  add    $0x8,%rsp
  mov    $0xffffffff,%eax
  xor    %rbx,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
unsigned long ShbIpcCrc32GetCrc(char *pcString, unsigned long aulCrcTable[]) {
  unsigned long ulCrc;
  int iIndex;
  ulCrc = 0xFFFFFFFF;
  for (iIndex = 0; iIndex < strlen(pcString); iIndex++) {
    ulCrc = ((ulCrc >> 8) & 0x00FFFFFF) ^ aulCrcTable[(ulCrc ^ pcString[iIndex]) & 0xFF];
  }
  return (ulCrc ^ 0xFFFFFFFF);
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<ShbIpcCrc32GetCrc>:
  endbr64
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  mov    $0xffffffff,%ebx
  sub    $0x8,%rsp
  jmp    L8
  nopl   (%rax)
L0:
  mov    %rbx,%rax
  xor    0x0(%r13,%rbp,1),%bl
  add    $0x1,%rbp
  movzbl %bl,%ebx
  shr    $0x8,%rax
  and    $0xffffff,%eax
  xor    (%r12,%rbx,8),%rax
  mov    %rax,%rbx
L8:
  mov    %r13,%rdi
  call   <strlen@plt>
  cmp    %ebp,%eax
  jg     L0
  add    $0x8,%rsp
  mov    $0xffffffff,%eax
  xor    %rbx,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
unsigned long ShbIpcCrc32GetCrc(char *pcString, unsigned long aulCrcTable[]) {
  unsigned long ulCrc;
  int iIndex;
  ulCrc = 0xFFFFFFFF;
  for (iIndex = 0; iIndex < strlen(pcString); iIndex++) {
    ulCrc = ((ulCrc >> 8) & 0x00FFFFFF) ^ aulCrcTable[(ulCrc ^ pcString[iIndex]) & 0xFF];
  }
  return (ulCrc ^ 0xFFFFFFFF);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<aes256gcmdecrypt>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x168,%rsp
  mov    %rdi,(%rsp)
  mov    %r8,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x158(%rsp)
  xor    %eax,%eax
  cmp    $0xf,%rdx
  jbe    L44
  mov    %rsi,%rbx
  mov    %rdx,%rbp
  mov    %rcx,%r12
  mov    %r8,%r13
  lea    0x100(%rsp),%r14
  mov    $0x10,%esi
  mov    %r14,%rdi
  call   <bzero@plt>
  lea    0x120(%rsp),%r15
  mov    $0xc,%edx
  mov    %r12,%rsi
  mov    %r15,%rdi
  call   <memcpy@plt>
  movb   $0x0,0x12c(%rsp)
  movb   $0x0,0x12d(%rsp)
  movb   $0x0,0x12e(%rsp)
  movb   $0x1,0x12f(%rsp)
  lea    0x10(%rsp),%r12
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <aeskey@plt>
  lea    0x110(%rsp),%r13
  mov    %r12,%rdx
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   <aescrypt@plt>
  lea    0x130(%rsp),%r14
  mov    %r12,%rdx
  mov    %r15,%rsi
  mov    %r14,%rdi
  call   <aescrypt@plt>
  lea    -0x10(%rbp),%rdx
  lea    0x10(%rbx),%rsi
  lea    0x140(%rsp),%r12
  mov    %r14,%r8
  mov    %r13,%rcx
  mov    %r12,%rdi
  call   <crypto_ghash@plt>
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <verify16@plt>
  test   %rax,%rax
  jne    L58
  lea    0x120(%rsp),%r8
  mov    0x8(%rsp),%rcx
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  mov    (%rsp),%rbx
  mov    %rbx,%rdi
  call   <aes256ctr@plt>
  mov    $0x10,%esi
  mov    %rbx,%rdi
  call   <bzero@plt>
  lea    0x110(%rsp),%rdi
  mov    $0x10,%esi
  call   <bzero@plt>
  mov    $0x3c,%eax
L53:
  sub    $0x1,%eax
  jne    L53
  mov    $0x0,%eax
L6:
  mov    0x158(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L23
  add    $0x168,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L58:
  mov    %r13,%rdi
  mov    $0x10,%esi
  call   <bzero@plt>
  mov    $0x3c,%eax
L10:
  sub    $0x1,%eax
  jne    L10
  mov    $0xffffffff,%eax
  jmp    L6
L44:
  mov    $0xffffffff,%eax
  jmp    L6
L23:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
extern int aes256gcmdecrypt(unsigned char *m, unsigned char *c, unsigned long long clen, unsigned char *nonce, unsigned char *key) {
  unsigned char zeros[16];
  unsigned char h[16];
  unsigned int space[60];
  unsigned char j0[16];
  unsigned char tagkey[16];
  unsigned char tag[16];
  if (clen < 16)
    return -1;
  bzero(zeros, 16);
  memcpy(j0, nonce, 12);
  j0[12] = 0;
  j0[13] = 0;
  j0[14] = 0;
  j0[15] = 1;
  aeskey(space, key);
  aescrypt(h, zeros, space);
  aescrypt(tagkey, j0, space);
  crypto_ghash(tag, c + 16, clen - 16, h, tagkey);
  if (verify16(tag, c)) {
    bzero(h, 16);
    for (int i = 0; i < 60; i++) {
      space[i] = 0;
    }
    return -1;
  }
  aes256ctr(m, c, clen, key, j0);
  bzero(m, 16);
  bzero(h, 16);
  for (int i = 0; i < 60; i++) {
    space[i] = 0;
  }
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<aes256gcmdecrypt>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x168,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x158(%rsp)
  xor    %eax,%eax
  cmp    $0xf,%rdx
  jbe    L15
  mov    %r8,%r13
  mov    %rsi,%rbp
  mov    %rdi,%r14
  mov    $0x10,%esi
  lea    0x100(%rsp),%r8
  mov    %rcx,%r15
  mov    %rdx,%r12
  mov    %r8,%rdi
  mov    %r8,0x8(%rsp)
  lea    0x110(%rsp),%rbx
  call   <bzero@plt>
  lea    0x120(%rsp),%r9
  mov    $0xc,%edx
  mov    %r15,%rsi
  mov    %r9,%rdi
  lea    0x10(%rsp),%r15
  mov    %r9,(%rsp)
  call   <memcpy@plt>
  mov    %r15,%rdi
  mov    %r13,%rsi
  movl   $0x1000000,0x12c(%rsp)
  call   <aeskey@plt>
  mov    0x8(%rsp),%rsi
  mov    %r15,%rdx
  mov    %rbx,%rdi
  call   <aescrypt@plt>
  mov    (%rsp),%r9
  lea    0x130(%rsp),%r8
  mov    %r15,%rdx
  mov    %r8,%rdi
  mov    %r8,(%rsp)
  lea    0x140(%rsp),%r15
  mov    %r9,%rsi
  mov    %r9,0x8(%rsp)
  call   <aescrypt@plt>
  mov    (%rsp),%r8
  lea    0x10(%rbp),%rsi
  mov    %rbx,%rcx
  lea    -0x10(%r12),%rdx
  mov    %r15,%rdi
  call   <crypto_ghash@plt>
  mov    %rbp,%rsi
  mov    %r15,%rdi
  call   <verify16@plt>
  mov    0x8(%rsp),%r9
  test   %rax,%rax
  jne    L0
  mov    %r9,%r8
  mov    %r13,%rcx
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <aes256ctr@plt>
  mov    $0x10,%esi
  mov    %r14,%rdi
  call   <bzero@plt>
  mov    $0x10,%esi
  mov    %rbx,%rdi
  call   <bzero@plt>
  xor    %eax,%eax
L11:
  mov    0x158(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L19
  add    $0x168,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L15:
  mov    $0xffffffff,%eax
  jmp    L11
  nopw   0x0(%rax,%rax,1)
L0:
  mov    $0x10,%esi
  mov    %rbx,%rdi
  call   <bzero@plt>
  mov    $0xffffffff,%eax
  jmp    L11
L19:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
extern int aes256gcmdecrypt(unsigned char *m, unsigned char *c, unsigned long long clen, unsigned char *nonce, unsigned char *key) {
  unsigned char zeros[16];
  unsigned char h[16];
  unsigned int space[60];
  unsigned char j0[16];
  unsigned char tagkey[16];
  unsigned char tag[16];
  if (clen < 16)
    return -1;
  bzero(zeros, 16);
  memcpy(j0, nonce, 12);
  j0[12] = 0;
  j0[13] = 0;
  j0[14] = 0;
  j0[15] = 1;
  aeskey(space, key);
  aescrypt(h, zeros, space);
  aescrypt(tagkey, j0, space);
  crypto_ghash(tag, c + 16, clen - 16, h, tagkey);
  if (verify16(tag, c)) {
    bzero(h, 16);
    for (int i = 0; i < 60; i++) {
      space[i] = 0;
    }
    return -1;
  }
  aes256ctr(m, c, clen, key, j0);
  bzero(m, 16);
  bzero(h, 16);
  for (int i = 0; i < 60; i++) {
    space[i] = 0;
  }
  return 0;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<aes256gcmdecrypt>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x168,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x158(%rsp)
  xor    %eax,%eax
  cmp    $0xf,%rdx
  jbe    L28
  mov    %r8,%r13
  mov    %rsi,%rbp
  mov    %rdi,%r14
  mov    $0x10,%esi
  lea    0x100(%rsp),%r8
  mov    %rcx,%r15
  mov    %rdx,%r12
  mov    %r8,%rdi
  mov    %r8,0x8(%rsp)
  lea    0x110(%rsp),%rbx
  call   <bzero@plt>
  lea    0x120(%rsp),%r9
  mov    $0xc,%edx
  mov    %r15,%rsi
  mov    %r9,%rdi
  lea    0x10(%rsp),%r15
  mov    %r9,(%rsp)
  call   <memcpy@plt>
  mov    %r15,%rdi
  mov    %r13,%rsi
  movl   $0x1000000,0x12c(%rsp)
  call   <aeskey@plt>
  mov    0x8(%rsp),%rsi
  mov    %r15,%rdx
  mov    %rbx,%rdi
  call   <aescrypt@plt>
  mov    (%rsp),%r9
  lea    0x130(%rsp),%r8
  mov    %r15,%rdx
  mov    %r8,%rdi
  mov    %r8,(%rsp)
  lea    0x140(%rsp),%r15
  mov    %r9,%rsi
  mov    %r9,0x8(%rsp)
  call   <aescrypt@plt>
  mov    (%rsp),%r8
  lea    0x10(%rbp),%rsi
  mov    %rbx,%rcx
  lea    -0x10(%r12),%rdx
  mov    %r15,%rdi
  call   <crypto_ghash@plt>
  mov    %rbp,%rsi
  mov    %r15,%rdi
  call   <verify16@plt>
  mov    0x8(%rsp),%r9
  test   %rax,%rax
  jne    L34
  mov    %r9,%r8
  mov    %r13,%rcx
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <aes256ctr@plt>
  mov    $0x10,%esi
  mov    %r14,%rdi
  call   <bzero@plt>
  mov    $0x10,%esi
  mov    %rbx,%rdi
  call   <bzero@plt>
  xor    %eax,%eax
L23:
  mov    0x158(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L13
  add    $0x168,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L28:
  mov    $0xffffffff,%eax
  jmp    L23
  nopw   0x0(%rax,%rax,1)
L34:
  mov    $0x10,%esi
  mov    %rbx,%rdi
  call   <bzero@plt>
  mov    $0xffffffff,%eax
  jmp    L23
L13:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
extern int aes256gcmdecrypt(unsigned char *m, unsigned char *c, unsigned long long clen, unsigned char *nonce, unsigned char *key) {
  unsigned char zeros[16];
  unsigned char h[16];
  unsigned int space[60];
  unsigned char j0[16];
  unsigned char tagkey[16];
  unsigned char tag[16];
  if (clen < 16)
    return -1;
  bzero(zeros, 16);
  memcpy(j0, nonce, 12);
  j0[12] = 0;
  j0[13] = 0;
  j0[14] = 0;
  j0[15] = 1;
  aeskey(space, key);
  aescrypt(h, zeros, space);
  aescrypt(tagkey, j0, space);
  crypto_ghash(tag, c + 16, clen - 16, h, tagkey);
  if (verify16(tag, c)) {
    bzero(h, 16);
    for (int i = 0; i < 60; i++) {
      space[i] = 0;
    }
    return -1;
  }
  aes256ctr(m, c, clen, key, j0);
  bzero(m, 16);
  bzero(h, 16);
  for (int i = 0; i < 60; i++) {
    space[i] = 0;
  }
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<skip_digits>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movl   $0x0,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L26
L11:
  addl   $0x1,-0xc(%rbp)
  addq   $0x1,-0x8(%rbp)
L26:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L17
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L11
L17:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0xc(%rbp),%eax
  cltq
  add    %rax,%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0xc(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int skip_digits(const char **p) {
  int skipped = 0;
  const char *c;
  for (c = *p; *c >= '0' && *c <= '9'; ++c) {
    skipped += 1;
  }
  *p = (*p) + skipped;
  return skipped;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<skip_digits>:
  endbr64
  mov    (%rdi),%r8
  movzbl (%r8),%eax
  sub    $0x30,%eax
  cmp    $0x9,%al
  ja     L14
  mov    %r8,%rax
  mov    $0x1,%ecx
  sub    %r8d,%ecx
L6:
  lea    (%rcx,%rax,1),%esi
  add    $0x1,%rax
  movzbl (%rax),%edx
  sub    $0x30,%edx
  cmp    $0x9,%dl
  jbe    L6
L10:
  movslq %esi,%rax
  add    %rax,%r8
  mov    %r8,(%rdi)
  mov    %esi,%eax
  ret
L14:
  mov    $0x0,%esi
  jmp    L10
```

assistant: ```c
int skip_digits(const char **p) {
  int skipped = 0;
  const char *c;
  for (c = *p; *c >= '0' && *c <= '9'; ++c) {
    skipped += 1;
  }
  *p = (*p) + skipped;
  return skipped;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<skip_digits>:
  endbr64
  mov    (%rdi),%rsi
  movzbl (%rsi),%eax
  sub    $0x30,%eax
  cmp    $0x9,%al
  ja     L4
  mov    $0x1,%ecx
  mov    %rsi,%rax
  sub    %esi,%ecx
  nopl   0x0(%rax,%rax,1)
L3:
  lea    (%rcx,%rax,1),%r8d
  movzbl 0x1(%rax),%edx
  add    $0x1,%rax
  sub    $0x30,%edx
  cmp    $0x9,%dl
  jbe    L3
  movslq %r8d,%rax
  add    %rax,%rsi
  mov    %r8d,%eax
  mov    %rsi,(%rdi)
  ret
  nopl   0x0(%rax)
L4:
  xor    %r8d,%r8d
  mov    %rsi,(%rdi)
  mov    %r8d,%eax
  ret
```

assistant: ```c
int skip_digits(const char **p) {
  int skipped = 0;
  const char *c;
  for (c = *p; *c >= '0' && *c <= '9'; ++c) {
    skipped += 1;
  }
  *p = (*p) + skipped;
  return skipped;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<skip_digits>:
  endbr64
  mov    (%rdi),%rsi
  movzbl (%rsi),%eax
  sub    $0x30,%eax
  cmp    $0x9,%al
  ja     L18
  mov    $0x1,%ecx
  mov    %rsi,%rax
  sub    %esi,%ecx
  nopl   0x0(%rax,%rax,1)
L6:
  lea    (%rcx,%rax,1),%r8d
  movzbl 0x1(%rax),%edx
  add    $0x1,%rax
  sub    $0x30,%edx
  cmp    $0x9,%dl
  jbe    L6
  movslq %r8d,%rax
  add    %rax,%rsi
  mov    %r8d,%eax
  mov    %rsi,(%rdi)
  ret
  nopl   0x0(%rax)
L18:
  xor    %r8d,%r8d
  mov    %rsi,(%rdi)
  mov    %r8d,%eax
  ret
```

assistant: ```c
int skip_digits(const char **p) {
  int skipped = 0;
  const char *c;
  for (c = *p; *c >= '0' && *c <= '9'; ++c) {
    skipped += 1;
  }
  *p = (*p) + skipped;
  return skipped;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<SwapTileBlock>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    %edx,-0x1c(%rbp)
  mov    -0x18(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jge    L27
  mov    -0x14(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x18(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,-0x18(%rbp)
L27:
  mov    -0x18(%rbp),%ecx
  movslq %ecx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x3,%eax
  mov    %ecx,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  shl    $0x2,%eax
  sub    %eax,%ecx
  mov    %ecx,%edx
  mov    -0x14(%rbp),%ecx
  movslq %ecx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x3,%eax
  mov    %ecx,%edi
  sar    $0x1f,%edi
  sub    %edi,%eax
  mov    %eax,%esi
  mov    %esi,%eax
  shl    $0x2,%eax
  add    %esi,%eax
  shl    $0x2,%eax
  mov    %ecx,%esi
  sub    %eax,%esi
  mov    %edx,%eax
  sub    %esi,%eax
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  jns    L4
  mov    -0xc(%rbp),%eax
  sub    %eax,-0x14(%rbp)
  mov    -0xc(%rbp),%eax
  add    %eax,-0x18(%rbp)
  negl   -0xc(%rbp)
L4:
  movl   $0x0,-0x8(%rbp)
  jmp    L49
L25:
  mov    -0x8(%rbp),%ecx
  movslq %ecx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x3,%eax
  mov    %ecx,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  shl    $0x2,%eax
  mov    %ecx,%edx
  sub    %eax,%edx
  cmp    %edx,-0xc(%rbp)
  jl     L34
  mov    -0x1c(%rbp),%edx
  mov    -0x8(%rbp),%eax
  add    %eax,%edx
  mov    -0x14(%rbp),%ecx
  mov    -0x8(%rbp),%eax
  add    %ecx,%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <SwapTile@plt>
L34:
  addl   $0x1,-0x8(%rbp)
L49:
  mov    -0x18(%rbp),%eax
  sub    -0x14(%rbp),%eax
  cmp    %eax,-0x8(%rbp)
  jle    L25
  nop
  nop
  leave
  ret
```

assistant: ```c
void SwapTileBlock(int first, int last, int second) {
  if (last < first) {
    int swap = first;
    first = last;
    last = swap;
  }
  int w = last % 20 - first % 20;
  if (w < 0) {
    first -= w;
    last += w;
    w = -w;
  }
  for (int i = 0; i <= last - first; i++)
    if (i % 20 <= w)
      SwapTile(first + i, second + i);
}
```
user: Translate the below assembly code into C programming language:

```asm
<SwapTileBlock>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%r12d
  mov    %esi,%ebp
  mov    %edx,%r14d
  cmp    %edi,%esi
  jge    L34
  mov    %esi,%r12d
  mov    %edi,%ebp
L34:
  movslq %ebp,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x23,%rax
  mov    %ebp,%edx
  sar    $0x1f,%edx
  sub    %edx,%eax
  lea    (%rax,%rax,4),%edx
  shl    $0x2,%edx
  mov    %ebp,%eax
  sub    %edx,%eax
  movslq %r12d,%rdx
  imul   $0x66666667,%rdx,%rdx
  sar    $0x23,%rdx
  mov    %r12d,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  lea    (%rdx,%rdx,4),%ecx
  shl    $0x2,%ecx
  mov    %r12d,%edx
  sub    %ecx,%edx
  mov    %eax,%r13d
  sub    %edx,%r13d
  js     L45
L78:
  sub    %r12d,%ebp
  js     L46
  mov    $0x0,%ebx
  jmp    L35
L45:
  sub    %r13d,%r12d
  add    %r13d,%ebp
  sub    %eax,%edx
  mov    %edx,%r13d
  jmp    L78
L57:
  add    $0x1,%ebx
  cmp    %ebp,%ebx
  jg     L46
L35:
  movslq %ebx,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x23,%rax
  mov    %ebx,%edx
  sar    $0x1f,%edx
  sub    %edx,%eax
  lea    (%rax,%rax,4),%eax
  shl    $0x2,%eax
  mov    %ebx,%edx
  sub    %eax,%edx
  cmp    %r13d,%edx
  jg     L57
  lea    (%r14,%rbx,1),%esi
  lea    (%r12,%rbx,1),%edi
  call   <SwapTile@plt>
  jmp    L57
L46:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
void SwapTileBlock(int first, int last, int second) {
  if (last < first) {
    int swap = first;
    first = last;
    last = swap;
  }
  int w = last % 20 - first % 20;
  if (w < 0) {
    first -= w;
    last += w;
    w = -w;
  }
  for (int i = 0; i <= last - first; i++)
    if (i % 20 <= w)
      SwapTile(first + i, second + i);
}
```
user: What is the c source code of the assembly code below:

```asm
<SwapTileBlock>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %edi,%r13d
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  sub    $0x8,%rsp
  cmp    %edi,%esi
  jge    L30
  mov    %esi,%r13d
  mov    %edi,%r12d
L30:
  movslq %r12d,%rax
  mov    %r12d,%edx
  mov    %r13d,%ecx
  imul   $0x66666667,%rax,%rax
  sar    $0x1f,%edx
  sar    $0x1f,%ecx
  sar    $0x23,%rax
  sub    %edx,%eax
  lea    (%rax,%rax,4),%edx
  mov    %r12d,%eax
  shl    $0x2,%edx
  sub    %edx,%eax
  movslq %r13d,%rdx
  imul   $0x66666667,%rdx,%rdx
  mov    %eax,%r14d
  sar    $0x23,%rdx
  sub    %ecx,%edx
  lea    (%rdx,%rdx,4),%ecx
  mov    %r13d,%edx
  shl    $0x2,%ecx
  sub    %ecx,%edx
  sub    %edx,%r14d
  jns    L64
  sub    %eax,%edx
  sub    %r14d,%r13d
  add    %r14d,%r12d
  mov    %edx,%r14d
L64:
  sub    %r13d,%r12d
  js     L41
  xor    %ebx,%ebx
  mov    $0xcccccccd,%r15d
  jmp    L61
  nopl   0x0(%rax,%rax,1)
L58:
  add    $0x1,%ebx
  cmp    %r12d,%ebx
  jg     L41
L61:
  mov    %ebx,%eax
  mov    %ebx,%edx
  imul   %r15,%rax
  shr    $0x24,%rax
  lea    (%rax,%rax,4),%eax
  shl    $0x2,%eax
  sub    %eax,%edx
  cmp    %r14d,%edx
  jg     L58
  lea    0x0(%rbp,%rbx,1),%esi
  lea    0x0(%r13,%rbx,1),%edi
  add    $0x1,%ebx
  call   <SwapTile@plt>
  cmp    %r12d,%ebx
  jle    L61
L41:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void SwapTileBlock(int first, int last, int second) {
  if (last < first) {
    int swap = first;
    first = last;
    last = swap;
  }
  int w = last % 20 - first % 20;
  if (w < 0) {
    first -= w;
    last += w;
    w = -w;
  }
  for (int i = 0; i <= last - first; i++)
    if (i % 20 <= w)
      SwapTile(first + i, second + i);
}
```
user: Translate the below assembly code into C programming language:

```asm
<SwapTileBlock>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %edi,%r13d
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  sub    $0x8,%rsp
  cmp    %edi,%esi
  jge    L15
  mov    %esi,%r13d
  mov    %edi,%r12d
L15:
  movslq %r12d,%rax
  mov    %r12d,%edx
  mov    %r13d,%ecx
  imul   $0x66666667,%rax,%rax
  sar    $0x1f,%edx
  sar    $0x1f,%ecx
  sar    $0x23,%rax
  sub    %edx,%eax
  lea    (%rax,%rax,4),%edx
  mov    %r12d,%eax
  shl    $0x2,%edx
  sub    %edx,%eax
  movslq %r13d,%rdx
  imul   $0x66666667,%rdx,%rdx
  mov    %eax,%r14d
  sar    $0x23,%rdx
  sub    %ecx,%edx
  lea    (%rdx,%rdx,4),%ecx
  mov    %r13d,%edx
  shl    $0x2,%ecx
  sub    %ecx,%edx
  sub    %edx,%r14d
  jns    L2
  sub    %eax,%edx
  sub    %r14d,%r13d
  add    %r14d,%r12d
  mov    %edx,%r14d
L2:
  sub    %r13d,%r12d
  js     L32
  xor    %ebx,%ebx
  mov    $0xcccccccd,%r15d
  jmp    L49
  nopl   0x0(%rax,%rax,1)
L36:
  add    $0x1,%ebx
  cmp    %r12d,%ebx
  jg     L32
L49:
  mov    %ebx,%eax
  mov    %ebx,%edx
  imul   %r15,%rax
  shr    $0x24,%rax
  lea    (%rax,%rax,4),%eax
  shl    $0x2,%eax
  sub    %eax,%edx
  cmp    %r14d,%edx
  jg     L36
  lea    0x0(%rbp,%rbx,1),%esi
  lea    0x0(%r13,%rbx,1),%edi
  add    $0x1,%ebx
  call   <SwapTile@plt>
  cmp    %r12d,%ebx
  jle    L49
L32:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void SwapTileBlock(int first, int last, int second) {
  if (last < first) {
    int swap = first;
    first = last;
    last = swap;
  }
  int w = last % 20 - first % 20;
  if (w < 0) {
    first -= w;
    last += w;
    w = -w;
  }
  for (int i = 0; i <= last - first; i++)
    if (i % 20 <= w)
      SwapTile(first + i, second + i);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<vec2pix_nest>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    -0x20(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x20(%rbp),%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm2
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x20(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm2
  mov    -0x20(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <atan2@plt>
  mov    %eax,%ecx
  mov    -0x20(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  divsd  -0x8(%rbp),%xmm0
  movq   %xmm0,%rdx
  mov    -0x18(%rbp),%rax
  mov    %ecx,%esi
  movq   %rdx,%xmm0
  mov    %rax,%rdi
  call   <ang2pix_nest_z_phi@plt>
  mov    -0x28(%rbp),%rdx
  mov    %rax,(%rdx)
  nop
  leave
  ret
```

assistant: ```c
void vec2pix_nest(long nside, const double *vec, long *ipix) {
  double vlen = sqrt(vec[0] * vec[0] + vec[1] * vec[1] + vec[2] * vec[2]);
  *ipix = ang2pix_nest_z_phi(nside, vec[2] / vlen, atan2(vec[1], vec[0]));
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<vec2pix_nest>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %rdi,%r12
  mov    %rsi,%rbx
  mov    %rdx,%rbp
  mov    (%rsi),%r14
  mov    0x8(%rsi),%r13
  movsd  0x10(%rsi),%xmm1
  movq   %r14,%xmm0
  mulsd  %xmm0,%xmm0
  movq   %r13,%xmm2
  mulsd  %xmm2,%xmm2
  addsd  %xmm2,%xmm0
  mulsd  %xmm1,%xmm1
  addsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L14
  sqrtsd %xmm0,%xmm0
  movsd  %xmm0,0x8(%rsp)
L4:
  movq   %r14,%xmm1
  movq   %r13,%xmm0
  call   <atan2@plt>
  mov    %eax,%esi
  movsd  0x10(%rbx),%xmm0
  divsd  0x8(%rsp),%xmm0
  mov    %r12,%rdi
  call   <ang2pix_nest_z_phi@plt>
  mov    %rax,0x0(%rbp)
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L14:
  call   <sqrt@plt>
  movsd  %xmm0,0x8(%rsp)
  jmp    L4
```

assistant: ```c
void vec2pix_nest(long nside, const double *vec, long *ipix) {
  double vlen = sqrt(vec[0] * vec[0] + vec[1] * vec[1] + vec[2] * vec[2]);
  *ipix = ang2pix_nest_z_phi(nside, vec[2] / vlen, atan2(vec[1], vec[0]));
}
```