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

```asm
<_ldiv5>:
  endbr64
  mov    (%rdi),%eax
  mov    %rdi,%rsi
  mov    $0x20,%ecx
  lea    0x2(%rax),%edi
  mov    %edi,%eax
  sar    %cl,%eax
  movslq %eax,%rdx
  sar    $0x1f,%eax
  imul   $0x66666667,%rdx,%rdx
  sar    $0x21,%rdx
  sub    %eax,%edx
  shl    %cl,%edx
  lea    (%rdx,%rdx,4),%eax
  sub    %eax,%edi
  mov    %edi,%eax
  mov    %edi,%ecx
  sar    $0x1f,%edi
  sar    $0x3,%eax
  cltq
  imul   $0x66666667,%rax,%rax
  sar    $0x21,%rax
  sub    %edi,%eax
  lea    0x0(,%rax,8),%edi
  shl    $0x5,%eax
  add    %edi,%eax
  add    %edi,%edx
  sub    %eax,%ecx
  movslq %ecx,%rax
  sar    $0x1f,%ecx
  imul   $0x66666667,%rax,%rax
  sar    $0x21,%rax
  sub    %ecx,%eax
  add    %edx,%eax
  mov    %eax,(%rsi)
  ret
```

assistant: ```c
void _ldiv5(uint64_t *v) {
  uint32_t i, hi;
  uint64_t rem = *v, quot = 0U, q;
  static const char shifts[] = {32, 3, 0};
  rem += 2;
  for (i = 0U; i < 3; i++) {
    hi = rem >> shifts[i];
    q = (uint64_t)(hi / 5) << shifts[i];
    rem -= q * 5;
    quot += q;
  }
  *v = quot;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<_ldiv5>:
  endbr64
  mov    (%rdi),%eax
  mov    %rdi,%rsi
  mov    $0x20,%ecx
  lea    0x2(%rax),%edi
  mov    %edi,%eax
  sar    %cl,%eax
  movslq %eax,%rdx
  sar    $0x1f,%eax
  imul   $0x66666667,%rdx,%rdx
  sar    $0x21,%rdx
  sub    %eax,%edx
  shl    %cl,%edx
  lea    (%rdx,%rdx,4),%eax
  sub    %eax,%edi
  mov    %edi,%eax
  mov    %edi,%ecx
  sar    $0x1f,%edi
  sar    $0x3,%eax
  cltq
  imul   $0x66666667,%rax,%rax
  sar    $0x21,%rax
  sub    %edi,%eax
  lea    0x0(,%rax,8),%edi
  shl    $0x5,%eax
  add    %edi,%eax
  add    %edi,%edx
  sub    %eax,%ecx
  movslq %ecx,%rax
  sar    $0x1f,%ecx
  imul   $0x66666667,%rax,%rax
  sar    $0x21,%rax
  sub    %ecx,%eax
  add    %edx,%eax
  mov    %eax,(%rsi)
  ret
```

assistant: ```c
void _ldiv5(uint64_t *v) {
  uint32_t i, hi;
  uint64_t rem = *v, quot = 0U, q;
  static const char shifts[] = {32, 3, 0};
  rem += 2;
  for (i = 0U; i < 3; i++) {
    hi = rem >> shifts[i];
    q = (uint64_t)(hi / 5) << shifts[i];
    rem -= q * 5;
    quot += q;
  }
  *v = quot;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<usage>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  nop
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D3
data_type: string

tool: D3: USAGE: %s [-v] [-i <niter>] [-k <file>] [-p <proj>] -s <size>

  -i <niter>  number of iterations, default=5
  -k <file>   file name used to generate shm key, default=this executable
  -p <proj>   project number used to generate shm key, default=0
  -s <size>   shared memory size in bytes
              (specify K, M, G for kilo, mega, giga bytes)

  -v          verbose, display more diagnostic messages



assistant: ```c
void usage(const char *prg) {
  printf("USAGE: %s [-v] [-i <niter>] [-k <file>] [-p <proj>] -s <size>\n"
         "\n"
         "  -i <niter>  number of iterations, default=5\n"
         "  -k <file>   file name used to generate shm key, default=this executable\n"
         "  -p <proj>   project number used to generate shm key, default=0\n"
         "  -s <size>   shared memory size in bytes\n"
         "              (specify K, M, G for kilo, mega, giga bytes)\n"
         "\n"
         "  -v          verbose, display more diagnostic messages\n"
         "\n",
         prg);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<usage>:
  endbr64
  sub    $0x8,%rsp
  mov    %rdi,%rsi
  lea    D1(%rip),%rdi
  call   <printf@plt>
  add    $0x8,%rsp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D1
type: string

tool: D1: USAGE: %s [-v] [-i <niter>] [-k <file>] [-p <proj>] -s <size>

  -i <niter>  number of iterations, default=5
  -k <file>   file name used to generate shm key, default=this executable
  -p <proj>   project number used to generate shm key, default=0
  -s <size>   shared memory size in bytes
              (specify K, M, G for kilo, mega, giga bytes)

  -v          verbose, display more diagnostic messages



assistant: ```c
void usage(const char *prg) {
  printf("USAGE: %s [-v] [-i <niter>] [-k <file>] [-p <proj>] -s <size>\n"
         "\n"
         "  -i <niter>  number of iterations, default=5\n"
         "  -k <file>   file name used to generate shm key, default=this executable\n"
         "  -p <proj>   project number used to generate shm key, default=0\n"
         "  -s <size>   shared memory size in bytes\n"
         "              (specify K, M, G for kilo, mega, giga bytes)\n"
         "\n"
         "  -v          verbose, display more diagnostic messages\n"
         "\n",
         prg);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<usage>:
  endbr64
  mov    %rdi,%rsi
  lea    D4(%rip),%rdi
  jmp    1050 <printf@plt>
```

tool_calls: name: read_data
arguments: data_label: D4
type_guessed: string

tool: D4: USAGE: %s [-v] [-i <niter>] [-k <file>] [-p <proj>] -s <size>

  -i <niter>  number of iterations, default=5
  -k <file>   file name used to generate shm key, default=this executable
  -p <proj>   project number used to generate shm key, default=0
  -s <size>   shared memory size in bytes
              (specify K, M, G for kilo, mega, giga bytes)

  -v          verbose, display more diagnostic messages



assistant: ```c
void usage(const char *prg) {
  printf("USAGE: %s [-v] [-i <niter>] [-k <file>] [-p <proj>] -s <size>\n"
         "\n"
         "  -i <niter>  number of iterations, default=5\n"
         "  -k <file>   file name used to generate shm key, default=this executable\n"
         "  -p <proj>   project number used to generate shm key, default=0\n"
         "  -s <size>   shared memory size in bytes\n"
         "              (specify K, M, G for kilo, mega, giga bytes)\n"
         "\n"
         "  -v          verbose, display more diagnostic messages\n"
         "\n",
         prg);
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<usage>:
  endbr64
  mov    %rdi,%rsi
  lea    D2(%rip),%rdi
  jmp    1050 <printf@plt>
```

tool_calls: name: unpack_data
arguments: label: D2
type_infered: string

tool: D2: USAGE: %s [-v] [-i <niter>] [-k <file>] [-p <proj>] -s <size>

  -i <niter>  number of iterations, default=5
  -k <file>   file name used to generate shm key, default=this executable
  -p <proj>   project number used to generate shm key, default=0
  -s <size>   shared memory size in bytes
              (specify K, M, G for kilo, mega, giga bytes)

  -v          verbose, display more diagnostic messages



assistant: ```c
void usage(const char *prg) {
  printf("USAGE: %s [-v] [-i <niter>] [-k <file>] [-p <proj>] -s <size>\n"
         "\n"
         "  -i <niter>  number of iterations, default=5\n"
         "  -k <file>   file name used to generate shm key, default=this executable\n"
         "  -p <proj>   project number used to generate shm key, default=0\n"
         "  -s <size>   shared memory size in bytes\n"
         "              (specify K, M, G for kilo, mega, giga bytes)\n"
         "\n"
         "  -v          verbose, display more diagnostic messages\n"
         "\n",
         prg);
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<bubble>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  jmp    L31
L15:
  movl   $0x1,-0x8(%rbp)
  jmp    L2
L17:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x8(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jle    L12
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x8(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x8(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,(%rdx)
L12:
  addl   $0x1,-0x8(%rbp)
L2:
  mov    -0x8(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jl     L17
  subl   $0x1,-0xc(%rbp)
L31:
  cmpl   $0x1,-0xc(%rbp)
  jg     L15
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void bubble(v, n) int v[], n;
{
  int i, j, k;
  for (i = n; i > 1; --i)
    for (j = 1; j < i; ++j)
      if (v[j] > v[j + 1]) {
        k = v[j];
        v[j] = v[j + 1];
        v[j + 1] = k;
      }
}
```
user: Translate the below assembly code into C programming language:

```asm
<bubble>:
  endbr64
  lea    0x8(%rdi),%r9
  cmp    $0x1,%esi
  jg     L55
  ret
L19:
  add    $0x4,%rax
  cmp    %r8,%rax
  je     L28
L30:
  mov    (%rax),%edx
  mov    0x4(%rax),%ecx
  cmp    %ecx,%edx
  jle    L19
  mov    %ecx,(%rax)
  mov    %edx,0x4(%rax)
  jmp    L19
L28:
  sub    $0x1,%esi
  cmp    $0x1,%esi
  je     L16
L55:
  cmp    $0x1,%esi
  jle    L28
  lea    0x4(%rdi),%rax
  lea    -0x2(%rsi),%edx
  lea    (%r9,%rdx,4),%r8
  jmp    L30
L16:
  ret
```

assistant: ```c
void bubble(v, n) int v[], n;
{
  int i, j, k;
  for (i = n; i > 1; --i)
    for (j = 1; j < i; ++j)
      if (v[j] > v[j + 1]) {
        k = v[j];
        v[j] = v[j + 1];
        v[j + 1] = k;
      }
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<bubble>:
  endbr64
  cmp    $0x1,%esi
  jle    L3
  nopl   0x0(%rax)
L9:
  mov    $0x1,%eax
  nopl   (%rax)
L17:
  mov    (%rdi,%rax,4),%edx
  mov    0x4(%rdi,%rax,4),%ecx
  cmp    %ecx,%edx
  jle    L32
  mov    %ecx,(%rdi,%rax,4)
  mov    %edx,0x4(%rdi,%rax,4)
L32:
  add    $0x1,%rax
  cmp    %eax,%esi
  jg     L17
  sub    $0x1,%esi
  cmp    $0x1,%esi
  jne    L9
L3:
  ret
```

assistant: ```c
void bubble(v, n) int v[], n;
{
  int i, j, k;
  for (i = n; i > 1; --i)
    for (j = 1; j < i; ++j)
      if (v[j] > v[j + 1]) {
        k = v[j];
        v[j] = v[j + 1];
        v[j + 1] = k;
      }
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<bubble>:
  endbr64
  cmp    $0x1,%esi
  jle    L22
  nopl   0x0(%rax)
L34:
  mov    $0x1,%edx
  nopl   (%rax)
L31:
  movq   (%rdi,%rdx,4),%xmm0
  pshufd $0xe5,%xmm0,%xmm2
  movd   %xmm0,%ecx
  movd   %xmm2,%eax
  pshufd $0xe1,%xmm0,%xmm1
  cmp    %eax,%ecx
  jle    L35
  movq   %xmm1,(%rdi,%rdx,4)
L35:
  add    $0x1,%rdx
  cmp    %edx,%esi
  jg     L31
  sub    $0x1,%esi
  cmp    $0x1,%esi
  jne    L34
L22:
  ret
```

assistant: ```c
void bubble(v, n) int v[], n;
{
  int i, j, k;
  for (i = n; i > 1; --i)
    for (j = 1; j < i; ++j)
      if (v[j] > v[j + 1]) {
        k = v[j];
        v[j] = v[j + 1];
        v[j + 1] = k;
      }
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<bcmp_translate>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r12
  push   %rbx
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,%eax
  mov    %rcx,-0x28(%rbp)
  mov    -0x18(%rbp),%rbx
  mov    -0x20(%rbp),%r12
  jmp    L28
L33:
  mov    %rbx,%rdx
  lea    0x1(%rdx),%rbx
  movzbl (%rdx),%edx
  movzbl %dl,%ecx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rdx),%ecx
  mov    %r12,%rdx
  lea    0x1(%rdx),%r12
  movzbl (%rdx),%edx
  movzbl %dl,%esi
  mov    -0x28(%rbp),%rdx
  add    %rsi,%rdx
  movzbl (%rdx),%edx
  cmp    %dl,%cl
  je     L37
  mov    $0x1,%eax
  jmp    L32
L37:
  sub    $0x1,%eax
L28:
  test   %eax,%eax
  jne    L33
  mov    $0x0,%eax
L32:
  pop    %rbx
  pop    %r12
  pop    %rbp
  ret
```

assistant: ```c
int bcmp_translate(unsigned char const *s1, unsigned char const *s2, register int len, char *translate) {
  register unsigned char const *p1 = s1, *p2 = s2;
  while (len) {
    if (translate[*p1++] != translate[*p2++])
      return 1;
    len--;
  }
  return 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<bcmp_translate>:
  endbr64
  test   %edx,%edx
  je     L21
  mov    %edx,%eax
  mov    $0x0,%r8d
L3:
  movzbl (%rdi,%r8,1),%r10d
  movzbl (%rsi,%r8,1),%r9d
  movzbl (%rcx,%r9,1),%edx
  cmp    %dl,(%rcx,%r10,1)
  jne    L13
  add    $0x1,%r8
  cmp    %rax,%r8
  jne    L3
  mov    $0x0,%eax
  ret
L21:
  mov    %edx,%eax
  ret
L13:
  mov    $0x1,%eax
  ret
```

assistant: ```c
int bcmp_translate(unsigned char const *s1, unsigned char const *s2, register int len, char *translate) {
  register unsigned char const *p1 = s1, *p2 = s2;
  while (len) {
    if (translate[*p1++] != translate[*p2++])
      return 1;
    len--;
  }
  return 0;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<bcmp_translate>:
  endbr64
  test   %edx,%edx
  je     L17
  mov    %edx,%edx
  xor    %eax,%eax
  jmp    L10
  xchg   %ax,%ax
L3:
  add    $0x1,%rax
  cmp    %rax,%rdx
  je     L17
L10:
  movzbl (%rsi,%rax,1),%r8d
  movzbl (%rdi,%rax,1),%r9d
  movzbl (%rcx,%r8,1),%r10d
  cmp    %r10b,(%rcx,%r9,1)
  je     L3
  mov    $0x1,%eax
  ret
  nopl   0x0(%rax)
L17:
  xor    %eax,%eax
  ret
```

assistant: ```c
int bcmp_translate(unsigned char const *s1, unsigned char const *s2, register int len, char *translate) {
  register unsigned char const *p1 = s1, *p2 = s2;
  while (len) {
    if (translate[*p1++] != translate[*p2++])
      return 1;
    len--;
  }
  return 0;
}
```
user: What is the c source code of the assembly code below:

```asm
<bcmp_translate>:
  endbr64
  test   %edx,%edx
  je     L1
  mov    %edx,%edx
  xor    %eax,%eax
  jmp    L28
  xchg   %ax,%ax
L21:
  add    $0x1,%rax
  cmp    %rax,%rdx
  je     L1
L28:
  movzbl (%rsi,%rax,1),%r8d
  movzbl (%rdi,%rax,1),%r9d
  movzbl (%rcx,%r8,1),%r10d
  cmp    %r10b,(%rcx,%r9,1)
  je     L21
  mov    $0x1,%eax
  ret
  nopl   0x0(%rax)
L1:
  xor    %eax,%eax
  ret
```

assistant: ```c
int bcmp_translate(unsigned char const *s1, unsigned char const *s2, register int len, char *translate) {
  register unsigned char const *p1 = s1, *p2 = s2;
  while (len) {
    if (translate[*p1++] != translate[*p2++])
      return 1;
    len--;
  }
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<pos>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    -0x10(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L7
  mov    -0x10(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  jmp    L14
L7:
  mov    $0xffffffff,%eax
L14:
  leave
  ret
```

assistant: ```c
int pos(char *haystack, char *needle) {
  if (strstr(haystack, needle)) {
    return (int)strstr(haystack, needle) - (int)haystack;
  } else {
    return -1;
  }
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<pos>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  call   <strstr@plt>
  test   %rax,%rax
  je     L6
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <strstr@plt>
  sub    %ebx,%eax
L16:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L6:
  mov    $0xffffffff,%eax
  jmp    L16
```

assistant: ```c
int pos(char *haystack, char *needle) {
  if (strstr(haystack, needle)) {
    return (int)strstr(haystack, needle) - (int)haystack;
  } else {
    return -1;
  }
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<pos>:
  endbr64
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  call   <strstr@plt>
  test   %rax,%rax
  je     L1
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <strstr@plt>
  sub    %ebx,%eax
L7:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  xchg   %ax,%ax
L1:
  mov    $0xffffffff,%eax
  jmp    L7
```

assistant: ```c
int pos(char *haystack, char *needle) {
  if (strstr(haystack, needle)) {
    return (int)strstr(haystack, needle) - (int)haystack;
  } else {
    return -1;
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<pos>:
  endbr64
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  call   <strstr@plt>
  test   %rax,%rax
  je     L18
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <strstr@plt>
  sub    %ebx,%eax
L3:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  xchg   %ax,%ax
L18:
  mov    $0xffffffff,%eax
  jmp    L3
```

assistant: ```c
int pos(char *haystack, char *needle) {
  if (strstr(haystack, needle)) {
    return (int)strstr(haystack, needle) - (int)haystack;
  } else {
    return -1;
  }
}
```
user: What is the c source code of the assembly code below?

```asm
<c_trans16>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %ecx,-0x2c(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L45
L65:
  movl   $0x0,-0xc(%rbp)
  jmp    L47
L38:
  mov    -0x20(%rbp),%rax
  movsd  (%rax),%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x10(%rbp),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm2
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0xc(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x20(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <round@plt>
  mov    %eax,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x10(%rbp),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x20(%rbp),%rax
  add    $0x20,%rax
  movsd  (%rax),%xmm2
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0xc(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x20(%rbp),%rax
  add    $0x28,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <round@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x8(%rbp)
  js     L56
  mov    -0x8(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jge    L56
  cmpl   $0x0,-0x4(%rbp)
  js     L56
  mov    -0x4(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jge    L56
  mov    -0x10(%rbp),%eax
  imul   -0x2c(%rbp),%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    (%rax,%rax,1),%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x8(%rbp),%eax
  imul   -0x2c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    (%rax,%rax,1),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  movzwl (%rcx),%eax
  mov    %ax,(%rdx)
L56:
  addl   $0x1,-0xc(%rbp)
L47:
  mov    -0xc(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L38
  addl   $0x1,-0x10(%rbp)
L45:
  mov    -0x10(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L65
  nop
  leave
  ret
```

assistant: ```c
void c_trans16(unsigned short *frame, double *U, unsigned short *ret, int m) {
  int i, j;
  int x, y;
  for (i = 0; i < m; i++) {
    for (j = 0; j < m; j++) {
      x = round(U[0] * i + U[1] * j + U[2]);
      y = round(U[3] * i + U[4] * j + U[5]);
      if (0 <= x && x < m && 0 <= y && y < m)
        ret[x * m + y] = frame[i * m + j];
    }
  }
  return;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<c_trans16>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,0x18(%rsp)
  test   %ecx,%ecx
  jle    L19
  mov    %rsi,%rbp
  mov    %rdx,%r15
  mov    %ecx,%r13d
  mov    $0x0,%r14d
  movl   $0x0,0x14(%rsp)
  jmp    L44
L78:
  lea    (%r12,%r14,1),%edx
  movslq %edx,%rdx
  mov    0x18(%rsp),%rsi
  movzwl (%rsi,%rdx,2),%edx
  imul   %r13d,%ebx
  add    %eax,%ebx
  movslq %ebx,%rbx
  mov    %dx,(%r15,%rbx,2)
L25:
  lea    0x1(%r12),%eax
  cmp    %eax,%r13d
  je     L69
  mov    %eax,%r12d
L1:
  pxor   %xmm1,%xmm1
  cvtsi2sd %r12d,%xmm1
  movsd  0x8(%rsp),%xmm0
  mulsd  0x0(%rbp),%xmm0
  movsd  %xmm1,(%rsp)
  mulsd  0x8(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  addsd  0x10(%rbp),%xmm0
  call   <round@plt>
  mov    %eax,%ebx
  movsd  0x8(%rsp),%xmm0
  mulsd  0x18(%rbp),%xmm0
  movsd  (%rsp),%xmm1
  mulsd  0x20(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  addsd  0x28(%rbp),%xmm0
  call   <round@plt>
  cmp    %ebx,%r13d
  jle    L25
  mov    %ebx,%ecx
  or     %eax,%ecx
  js     L25
  cmp    %eax,%r13d
  jg     L78
  jmp    L25
L69:
  mov    0x14(%rsp),%edi
  lea    0x1(%rdi),%eax
  add    %r13d,%r14d
  cmp    %r12d,%edi
  je     L19
  mov    %eax,0x14(%rsp)
L44:
  mov    $0x0,%r12d
  pxor   %xmm2,%xmm2
  cvtsi2sdl 0x14(%rsp),%xmm2
  movsd  %xmm2,0x8(%rsp)
  jmp    L1
L19:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void c_trans16(unsigned short *frame, double *U, unsigned short *ret, int m) {
  int i, j;
  int x, y;
  for (i = 0; i < m; i++) {
    for (j = 0; j < m; j++) {
      x = round(U[0] * i + U[1] * j + U[2]);
      y = round(U[3] * i + U[4] * j + U[5]);
      if (0 <= x && x < m && 0 <= y && y < m)
        ret[x * m + y] = frame[i * m + j];
    }
  }
  return;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<c_trans16>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,0x10(%rsp)
  mov    %rdx,0x18(%rsp)
  test   %ecx,%ecx
  jle    L24
  mov    %rsi,%r15
  mov    %ecx,%r12d
  xor    %ebx,%ebx
  xor    %ebp,%ebp
  xchg   %ax,%ax
L33:
  pxor   %xmm3,%xmm3
  xor    %r13d,%r13d
  cvtsi2sd %ebp,%xmm3
  movsd  %xmm3,(%rsp)
  jmp    L17
  nopw   0x0(%rax,%rax,1)
L23:
  mov    %eax,%r13d
L17:
  pxor   %xmm1,%xmm1
  movsd  (%rsp),%xmm0
  cvtsi2sd %r13d,%xmm1
  mulsd  (%r15),%xmm0
  movapd %xmm1,%xmm2
  movsd  %xmm1,0x8(%rsp)
  mulsd  0x8(%r15),%xmm2
  addsd  %xmm2,%xmm0
  addsd  0x10(%r15),%xmm0
  call   <round@plt>
  movsd  (%rsp),%xmm0
  movsd  0x8(%rsp),%xmm1
  mulsd  0x18(%r15),%xmm0
  mov    %eax,%r14d
  mulsd  0x20(%r15),%xmm1
  addsd  %xmm1,%xmm0
  addsd  0x28(%r15),%xmm0
  call   <round@plt>
  cmp    %r14d,%r12d
  jle    L49
  mov    %r14d,%edx
  or     %eax,%edx
  js     L49
  cmp    %eax,%r12d
  jle    L49
  imul   %r12d,%r14d
  mov    0x10(%rsp),%rcx
  lea    0x0(%r13,%rbx,1),%esi
  movslq %esi,%rsi
  movzwl (%rcx,%rsi,2),%esi
  add    %eax,%r14d
  mov    0x18(%rsp),%rax
  movslq %r14d,%r14
  mov    %si,(%rax,%r14,2)
L49:
  lea    0x1(%r13),%eax
  cmp    %eax,%r12d
  jne    L23
  lea    0x1(%rbp),%eax
  add    %r12d,%ebx
  cmp    %r13d,%ebp
  je     L24
  mov    %eax,%ebp
  jmp    L33
  nopl   0x0(%rax,%rax,1)
L24:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void c_trans16(unsigned short *frame, double *U, unsigned short *ret, int m) {
  int i, j;
  int x, y;
  for (i = 0; i < m; i++) {
    for (j = 0; j < m; j++) {
      x = round(U[0] * i + U[1] * j + U[2]);
      y = round(U[3] * i + U[4] * j + U[5]);
      if (0 <= x && x < m && 0 <= y && y < m)
        ret[x * m + y] = frame[i * m + j];
    }
  }
  return;
}
```