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

```asm
<sum_addc>:
  endbr64
  lea    (%rdi,%rsi,1),%rax
  xor    %edx,%edx
  cmp    %rax,%rdi
  setg   %dl
  add    %rdx,%rax
  ret
```

assistant: ```c
uint32_t sum_addc(uint32_t a, uint32_t b) {
  uint32_t c;
  c = a + b;
  if (c < a)
    c++;
  return c;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<sum_addc>:
  endbr64
  lea    (%rdi,%rsi,1),%rax
  xor    %edx,%edx
  cmp    %rax,%rdi
  setg   %dl
  add    %rdx,%rax
  ret
```

assistant: ```c
uint32_t sum_addc(uint32_t a, uint32_t b) {
  uint32_t c;
  c = a + b;
  if (c < a)
    c++;
  return c;
}
```
user: Translate the below assembly code into C programming language:

```asm
<cijfersom>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  jmp    L11
L2:
  mov    -0x14(%rbp),%ecx
  movslq %ecx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %ecx,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  sub    %eax,%ecx
  mov    %ecx,%edx
  add    %edx,-0x4(%rbp)
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x14(%rbp)
L11:
  cmpl   $0x0,-0x14(%rbp)
  jg     L2
  mov    -0x20(%rbp),%rax
  mov    -0x4(%rbp),%edx
  mov    %edx,(%rax)
  nop
  pop    %rbp
  ret
```

assistant: ```c
void cijfersom(int n, int *r) {
  int totaal;
  while (n > 0) {
    totaal = totaal + (n % 10);
    n = n / 10;
  }
  *r = totaal;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<cijfersom>:
  endbr64
  test   %edi,%edi
  jle    L4
L6:
  movslq %edi,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x22,%rax
  mov    %edi,%edx
  sar    $0x1f,%edx
  sub    %edx,%eax
  lea    (%rax,%rax,4),%edx
  add    %edx,%edx
  mov    %edi,%r8d
  sub    %edx,%r8d
  add    %r8d,%ecx
  mov    %edi,%edx
  mov    %eax,%edi
  cmp    $0x9,%edx
  jg     L6
L4:
  mov    %ecx,(%rsi)
  ret
```

assistant: ```c
void cijfersom(int n, int *r) {
  int totaal;
  while (n > 0) {
    totaal = totaal + (n % 10);
    n = n / 10;
  }
  *r = totaal;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<cijfersom>:
  endbr64
  test   %edi,%edi
  jle    L13
  mov    $0xcccccccd,%r9d
  xchg   %ax,%ax
L14:
  mov    %edi,%eax
  mov    %edi,%r8d
  imul   %r9,%rax
  shr    $0x23,%rax
  lea    (%rax,%rax,4),%edx
  add    %edx,%edx
  sub    %edx,%r8d
  mov    %edi,%edx
  mov    %eax,%edi
  add    %r8d,%ecx
  cmp    $0x9,%edx
  jg     L14
L13:
  mov    %ecx,(%rsi)
  ret
```

assistant: ```c
void cijfersom(int n, int *r) {
  int totaal;
  while (n > 0) {
    totaal = totaal + (n % 10);
    n = n / 10;
  }
  *r = totaal;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<cijfersom>:
  endbr64
  test   %edi,%edi
  jle    L17
  mov    $0xcccccccd,%r9d
  xchg   %ax,%ax
L18:
  mov    %edi,%eax
  mov    %edi,%r8d
  imul   %r9,%rax
  shr    $0x23,%rax
  lea    (%rax,%rax,4),%edx
  add    %edx,%edx
  sub    %edx,%r8d
  mov    %edi,%edx
  mov    %eax,%edi
  add    %r8d,%ecx
  cmp    $0x9,%edx
  jg     L18
L17:
  mov    %ecx,(%rsi)
  ret
```

assistant: ```c
void cijfersom(int n, int *r) {
  int totaal;
  while (n > 0) {
    totaal = totaal + (n % 10);
    n = n / 10;
  }
  *r = totaal;
}
```
user: Translate the below assembly code into C programming language:

```asm
<rndstr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  movq   $0x0,-0x20(%rbp)
  jmp    L1
L8:
  mov    -0x18(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <rndchr@plt>
  mov    %al,(%rbx)
  addq   $0x1,-0x20(%rbp)
L1:
  mov    -0x20(%rbp),%rax
  cmp    -0x30(%rbp),%rax
  jb     L8
  mov    -0x18(%rbp),%rax
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
char *rndstr(char *map, size_t strsize) {
  char *result = malloc(strsize);
  size_t i;
  for (i = 0; i < strsize; i++) {
    *(result + i) = rndchr(map);
  };
  return result;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<rndstr>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r12
  mov    %rsi,%rbp
  mov    %rsi,%rdi
  call   <malloc@plt>
  mov    %rax,%r13
  test   %rbp,%rbp
  je     L8
  mov    %rax,%rbx
  add    %rax,%rbp
L11:
  mov    %r12,%rdi
  call   <rndchr@plt>
  mov    %al,(%rbx)
  add    $0x1,%rbx
  cmp    %rbp,%rbx
  jne    L11
L8:
  mov    %r13,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
char *rndstr(char *map, size_t strsize) {
  char *result = malloc(strsize);
  size_t i;
  for (i = 0; i < strsize; i++) {
    *(result + i) = rndchr(map);
  };
  return result;
}
```
user: What is the c source code of the assembly code below?

```asm
<rndstr>:
  endbr64
  push   %r13
  push   %r12
  mov    %rdi,%r12
  mov    %rsi,%rdi
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  call   <malloc@plt>
  mov    %rax,%r13
  test   %rbp,%rbp
  je     L4
  mov    %rax,%rbx
  add    %rax,%rbp
  nopw   0x0(%rax,%rax,1)
L6:
  mov    %r12,%rdi
  add    $0x1,%rbx
  call   <rndchr@plt>
  mov    %al,-0x1(%rbx)
  cmp    %rbp,%rbx
  jne    L6
L4:
  add    $0x8,%rsp
  mov    %r13,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
char *rndstr(char *map, size_t strsize) {
  char *result = malloc(strsize);
  size_t i;
  for (i = 0; i < strsize; i++) {
    *(result + i) = rndchr(map);
  };
  return result;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<rndstr>:
  endbr64
  push   %r13
  push   %r12
  mov    %rdi,%r12
  mov    %rsi,%rdi
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  call   <malloc@plt>
  mov    %rax,%r13
  test   %rbp,%rbp
  je     L10
  mov    %rax,%rbx
  add    %rax,%rbp
  nopw   0x0(%rax,%rax,1)
L19:
  mov    %r12,%rdi
  add    $0x1,%rbx
  call   <rndchr@plt>
  mov    %al,-0x1(%rbx)
  cmp    %rbp,%rbx
  jne    L19
L10:
  add    $0x8,%rsp
  mov    %r13,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
char *rndstr(char *map, size_t strsize) {
  char *result = malloc(strsize);
  size_t i;
  for (i = 0; i < strsize; i++) {
    *(result + i) = rndchr(map);
  };
  return result;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<GrOffScreen24BPPLineDrawH>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    %ecx,-0x24(%rbp)
  mov    %r8d,-0x28(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  shl    $0x2,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  imul   -0x24(%rbp),%eax
  mov    %eax,%edx
  mov    -0x1c(%rbp),%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    $0x4,%eax
  cltq
  add    $0x20,%rax
  add    %rax,-0x8(%rbp)
  jmp    L19
L5:
  mov    -0x8(%rbp),%rax
  mov    -0x28(%rbp),%edx
  mov    %edx,(%rax)
  addq   $0x4,-0x8(%rbp)
  addl   $0x1,-0x1c(%rbp)
L19:
  mov    -0x1c(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jle    L5
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void GrOffScreen24BPPLineDrawH(void *pvDisplayData, int lX1, int lX2, int lY, unsigned int ulValue) {
  unsigned char *pucData;
  int lBytesPerRow;
  ;
  pucData = (unsigned char *)pvDisplayData;
  lBytesPerRow = (*(unsigned short *)(pucData)) * 4;
  pucData += ((lBytesPerRow * lY) + (lX1 * 4) + 4 + (16 * 2));
  while ((lX1) <= lX2) {
    *(unsigned int *)pucData = ulValue;
    pucData += 4;
    lX1 += 1;
  }
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<GrOffScreen24BPPLineDrawH>:
  endbr64
  movzwl (%rdi),%eax
  imul   %ecx,%eax
  lea    0x1(%rsi,%rax,1),%eax
  shl    $0x2,%eax
  cltq
  lea    0x20(%rdi,%rax,1),%rax
  cmp    %edx,%esi
  jg     L14
  sub    %esi,%edx
  lea    0x4(%rax,%rdx,4),%rdx
L7:
  mov    %r8d,(%rax)
  add    $0x4,%rax
  cmp    %rdx,%rax
  jne    L7
L14:
  ret
```

assistant: ```c
void GrOffScreen24BPPLineDrawH(void *pvDisplayData, int lX1, int lX2, int lY, unsigned int ulValue) {
  unsigned char *pucData;
  int lBytesPerRow;
  ;
  pucData = (unsigned char *)pvDisplayData;
  lBytesPerRow = (*(unsigned short *)(pucData)) * 4;
  pucData += ((lBytesPerRow * lY) + (lX1 * 4) + 4 + (16 * 2));
  while ((lX1) <= lX2) {
    *(unsigned int *)pucData = ulValue;
    pucData += 4;
    lX1 += 1;
  }
}
```
user: What is the c source code of the assembly code below:

```asm
<GrOffScreen24BPPLineDrawH>:
  endbr64
  movzwl (%rdi),%eax
  imul   %ecx,%eax
  lea    0x1(%rsi,%rax,1),%eax
  shl    $0x2,%eax
  cltq
  lea    0x20(%rdi,%rax,1),%rax
  cmp    %edx,%esi
  jg     L18
  sub    %esi,%edx
  lea    0x4(%rax,%rdx,4),%rdx
  nopl   0x0(%rax,%rax,1)
L19:
  mov    %r8d,(%rax)
  add    $0x4,%rax
  cmp    %rdx,%rax
  jne    L19
L18:
  ret
```

assistant: ```c
void GrOffScreen24BPPLineDrawH(void *pvDisplayData, int lX1, int lX2, int lY, unsigned int ulValue) {
  unsigned char *pucData;
  int lBytesPerRow;
  ;
  pucData = (unsigned char *)pvDisplayData;
  lBytesPerRow = (*(unsigned short *)(pucData)) * 4;
  pucData += ((lBytesPerRow * lY) + (lX1 * 4) + 4 + (16 * 2));
  while ((lX1) <= lX2) {
    *(unsigned int *)pucData = ulValue;
    pucData += 4;
    lX1 += 1;
  }
}
```
user: What is the c source code of the assembly code below:

```asm
<GrOffScreen24BPPLineDrawH>:
  endbr64
  mov    %rdi,%r9
  mov    %edx,%edi
  movzwl (%r9),%eax
  imul   %ecx,%eax
  lea    0x1(%rax,%rsi,1),%edx
  shl    $0x2,%edx
  movslq %edx,%rdx
  lea    0x20(%r9,%rdx,1),%rcx
  cmp    %edi,%esi
  jg     L39
  mov    %edi,%edx
  sub    %esi,%edx
  lea    0x1(%rdx),%r10d
  cmp    $0x2,%edx
  jbe    L36
  movslq %esi,%rdx
  cltq
  movd   %r8d,%xmm1
  lea    0x9(%rdx,%rax,1),%rax
  mov    %r10d,%edx
  pshufd $0x0,%xmm1,%xmm0
  shr    $0x2,%edx
  lea    (%r9,%rax,4),%rax
  shl    $0x4,%rdx
  add    %rax,%rdx
  nopl   (%rax)
L33:
  movups %xmm0,(%rax)
  add    $0x10,%rax
  cmp    %rax,%rdx
  jne    L33
  mov    %r10d,%eax
  and    $0xfffffffc,%eax
  mov    %eax,%edx
  add    %eax,%esi
  lea    (%rcx,%rdx,4),%rcx
  cmp    %eax,%r10d
  je     L39
L36:
  lea    0x1(%rsi),%eax
  mov    %r8d,(%rcx)
  cmp    %eax,%edi
  jl     L39
  add    $0x2,%esi
  mov    %r8d,0x4(%rcx)
  cmp    %esi,%edi
  jl     L39
  mov    %r8d,0x8(%rcx)
L39:
  ret
```

assistant: ```c
void GrOffScreen24BPPLineDrawH(void *pvDisplayData, int lX1, int lX2, int lY, unsigned int ulValue) {
  unsigned char *pucData;
  int lBytesPerRow;
  ;
  pucData = (unsigned char *)pvDisplayData;
  lBytesPerRow = (*(unsigned short *)(pucData)) * 4;
  pucData += ((lBytesPerRow * lY) + (lX1 * 4) + 4 + (16 * 2));
  while ((lX1) <= lX2) {
    *(unsigned int *)pucData = ulValue;
    pucData += 4;
    lX1 += 1;
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<Ten90DecodeMovementField>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  je     L91
  cmpl   $0x7d,-0x14(%rbp)
  je     L91
  cmpl   $0x7e,-0x14(%rbp)
  je     L91
  cmpl   $0x7f,-0x14(%rbp)
  jne    L53
L91:
  mov    $0xffffffff,%eax
  jmp    L82
L53:
  cmpl   $0x7b,-0x14(%rbp)
  jle    L79
  movl   $0xc7,-0x4(%rbp)
  jmp    L20
L79:
  cmpl   $0x6c,-0x14(%rbp)
  jle    L135
  mov    -0x14(%rbp),%eax
  lea    -0x6c(%rax),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    $0x64,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L20
L135:
  cmpl   $0x5d,-0x14(%rbp)
  jle    L64
  mov    -0x14(%rbp),%eax
  sub    $0x3a,%eax
  add    %eax,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L20
L64:
  cmpl   $0x26,-0x14(%rbp)
  jle    L119
  mov    -0x14(%rbp),%eax
  sub    $0x17,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L20
L119:
  cmpl   $0xc,-0x14(%rbp)
  jle    L24
  mov    -0x14(%rbp),%eax
  sub    $0xb,%eax
  sar    %eax
  add    $0x2,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L20
L24:
  cmpl   $0x8,-0x14(%rbp)
  jle    L80
  mov    -0x14(%rbp),%eax
  sub    $0x6,%eax
  sar    $0x2,%eax
  add    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L20
L80:
  movl   $0x0,-0x4(%rbp)
L20:
  mov    -0x4(%rbp),%eax
L82:
  pop    %rbp
  ret
```

assistant: ```c
int Ten90DecodeMovementField(int movement) {
  int gspeed;
  if (0 == movement || 125 == movement || 126 == movement || 127 == movement) {
    return -1;
  }
  if (movement > 123)
    gspeed = 199;
  else if (movement > 108)
    gspeed = ((movement - 108) * 5) + 100;
  else if (movement > 93)
    gspeed = ((movement - 93) * 2) + 70;
  else if (movement > 38)
    gspeed = ((movement - 38)) + 15;
  else if (movement > 12)
    gspeed = ((movement - 11) >> 1) + 2;
  else if (movement > 8)
    gspeed = ((movement - 6) >> 2) + 1;
  else
    gspeed = 0;
  return (gspeed);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<Ten90DecodeMovementField>:
  endbr64
  lea    -0x7d(%rdi),%eax
  cmp    $0x2,%eax
  jbe    L62
  test   %edi,%edi
  je     L62
  mov    $0xc7,%eax
  cmp    $0x7b,%edi
  jg     L36
  cmp    $0x6c,%edi
  jle    L76
  lea    -0x1b8(%rdi,%rdi,4),%eax
  ret
L76:
  cmp    $0x5d,%edi
  jle    L77
  lea    -0x74(%rdi,%rdi,1),%eax
  ret
L77:
  cmp    $0x26,%edi
  jle    L9
  lea    -0x17(%rdi),%eax
  ret
L9:
  cmp    $0xc,%edi
  jle    L38
  sub    $0xb,%edi
  sar    %edi
  lea    0x2(%rdi),%eax
  ret
L38:
  mov    $0x0,%eax
  cmp    $0x8,%edi
  jle    L36
  sub    $0x6,%edi
  sar    $0x2,%edi
  lea    0x1(%rdi),%eax
  ret
L62:
  mov    $0xffffffff,%eax
L36:
  ret
```

assistant: ```c
int Ten90DecodeMovementField(int movement) {
  int gspeed;
  if (0 == movement || 125 == movement || 126 == movement || 127 == movement) {
    return -1;
  }
  if (movement > 123)
    gspeed = 199;
  else if (movement > 108)
    gspeed = ((movement - 108) * 5) + 100;
  else if (movement > 93)
    gspeed = ((movement - 93) * 2) + 70;
  else if (movement > 38)
    gspeed = ((movement - 38)) + 15;
  else if (movement > 12)
    gspeed = ((movement - 11) >> 1) + 2;
  else if (movement > 8)
    gspeed = ((movement - 6) >> 2) + 1;
  else
    gspeed = 0;
  return (gspeed);
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<Ten90DecodeMovementField>:
  endbr64
  lea    -0x7d(%rdi),%eax
  cmp    $0x2,%eax
  jbe    L34
  test   %edi,%edi
  je     L34
  mov    $0xc7,%eax
  cmp    $0x7b,%edi
  jg     L8
  cmp    $0x6c,%edi
  jle    L60
  lea    -0x1b8(%rdi,%rdi,4),%eax
  ret
  nopw   0x0(%rax,%rax,1)
L34:
  mov    $0xffffffff,%eax
L8:
  ret
  cs nopw 0x0(%rax,%rax,1)
L60:
  cmp    $0x5d,%edi
  jg     L5
  cmp    $0x26,%edi
  jle    L42
  lea    -0x17(%rdi),%eax
  ret
  xchg   %ax,%ax
L5:
  lea    -0x74(%rdi,%rdi,1),%eax
  ret
  nopl   (%rax)
L42:
  cmp    $0xc,%edi
  jg     L53
  xor    %eax,%eax
  cmp    $0x8,%edi
  jle    L8
  sub    $0x6,%edi
  sar    $0x2,%edi
  lea    0x1(%rdi),%eax
  ret
  xchg   %ax,%ax
L53:
  sub    $0xb,%edi
  sar    %edi
  lea    0x2(%rdi),%eax
  ret
```

assistant: ```c
int Ten90DecodeMovementField(int movement) {
  int gspeed;
  if (0 == movement || 125 == movement || 126 == movement || 127 == movement) {
    return -1;
  }
  if (movement > 123)
    gspeed = 199;
  else if (movement > 108)
    gspeed = ((movement - 108) * 5) + 100;
  else if (movement > 93)
    gspeed = ((movement - 93) * 2) + 70;
  else if (movement > 38)
    gspeed = ((movement - 38)) + 15;
  else if (movement > 12)
    gspeed = ((movement - 11) >> 1) + 2;
  else if (movement > 8)
    gspeed = ((movement - 6) >> 2) + 1;
  else
    gspeed = 0;
  return (gspeed);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<Ten90DecodeMovementField>:
  endbr64
  lea    -0x7d(%rdi),%eax
  cmp    $0x2,%eax
  jbe    L42
  test   %edi,%edi
  je     L42
  mov    $0xc7,%eax
  cmp    $0x7b,%edi
  jg     L30
  cmp    $0x6c,%edi
  jle    L56
  lea    -0x1b8(%rdi,%rdi,4),%eax
  ret
  nopw   0x0(%rax,%rax,1)
L42:
  mov    $0xffffffff,%eax
L30:
  ret
  cs nopw 0x0(%rax,%rax,1)
L56:
  cmp    $0x5d,%edi
  jg     L78
  cmp    $0x26,%edi
  jle    L27
  lea    -0x17(%rdi),%eax
  ret
  xchg   %ax,%ax
L78:
  lea    -0x74(%rdi,%rdi,1),%eax
  ret
  nopl   (%rax)
L27:
  cmp    $0xc,%edi
  jg     L18
  xor    %eax,%eax
  cmp    $0x8,%edi
  jle    L30
  sub    $0x6,%edi
  sar    $0x2,%edi
  lea    0x1(%rdi),%eax
  ret
  xchg   %ax,%ax
L18:
  sub    $0xb,%edi
  sar    %edi
  lea    0x2(%rdi),%eax
  ret
```

assistant: ```c
int Ten90DecodeMovementField(int movement) {
  int gspeed;
  if (0 == movement || 125 == movement || 126 == movement || 127 == movement) {
    return -1;
  }
  if (movement > 123)
    gspeed = 199;
  else if (movement > 108)
    gspeed = ((movement - 108) * 5) + 100;
  else if (movement > 93)
    gspeed = ((movement - 93) * 2) + 70;
  else if (movement > 38)
    gspeed = ((movement - 38)) + 15;
  else if (movement > 12)
    gspeed = ((movement - 11) >> 1) + 2;
  else if (movement > 8)
    gspeed = ((movement - 6) >> 2) + 1;
  else
    gspeed = 0;
  return (gspeed);
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<decrypt>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x38(%rbp),%rax
  mov    0x4(%rax),%eax
  mov    %eax,-0x20(%rbp)
  movl   $0xc6ef3720,-0x1c(%rbp)
  movl   $0x9e3779b9,-0x14(%rbp)
  mov    -0x40(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x40(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x40(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x40(%rbp),%rax
  add    $0xc,%rax
  mov    (%rax),%eax
  mov    %eax,-0x4(%rbp)
  movl   $0x0,-0x18(%rbp)
  jmp    L13
L7:
  mov    -0x24(%rbp),%eax
  shl    $0x4,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0x24(%rbp),%edx
  mov    -0x1c(%rbp),%eax
  add    %edx,%eax
  xor    %eax,%ecx
  mov    %ecx,%edx
  mov    -0x24(%rbp),%eax
  sar    $0x5,%eax
  mov    %eax,%ecx
  mov    -0x4(%rbp),%eax
  add    %ecx,%eax
  xor    %edx,%eax
  sub    %eax,-0x20(%rbp)
  mov    -0x20(%rbp),%eax
  shl    $0x4,%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0x20(%rbp),%edx
  mov    -0x1c(%rbp),%eax
  add    %edx,%eax
  xor    %eax,%ecx
  mov    %ecx,%edx
  mov    -0x20(%rbp),%eax
  sar    $0x5,%eax
  mov    %eax,%ecx
  mov    -0xc(%rbp),%eax
  add    %ecx,%eax
  xor    %edx,%eax
  sub    %eax,-0x24(%rbp)
  mov    -0x14(%rbp),%eax
  sub    %eax,-0x1c(%rbp)
  addl   $0x1,-0x18(%rbp)
L13:
  cmpl   $0x1f,-0x18(%rbp)
  jle    L7
  mov    -0x38(%rbp),%rax
  mov    -0x24(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x38(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    -0x20(%rbp),%eax
  mov    %eax,(%rdx)
  nop
  pop    %rbp
  ret
```

assistant: ```c
void decrypt(uint32_t v[2], const uint32_t k[4]) {
  uint32_t v0 = v[0], v1 = v[1], sum = 0xC6EF3720, i;
  uint32_t delta = 0x9E3779B9;
  uint32_t k0 = k[0], k1 = k[1], k2 = k[2], k3 = k[3];
  for (i = 0; i < 32; i++) {
    v1 -= ((v0 << 4) + k2) ^ (v0 + sum) ^ ((v0 >> 5) + k3);
    v0 -= ((v1 << 4) + k0) ^ (v1 + sum) ^ ((v1 >> 5) + k1);
    sum -= delta;
  }
  v[0] = v0;
  v[1] = v1;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<decrypt>:
  endbr64
  push   %rbx
  mov    %rdi,%r10
  mov    (%rdi),%ecx
  mov    0x4(%rdi),%edx
  mov    (%rsi),%r11d
  mov    0x4(%rsi),%r9d
  mov    0x8(%rsi),%r8d
  mov    0xc(%rsi),%edi
  mov    $0xc6ef3720,%esi
L4:
  mov    %ecx,%eax
  shl    $0x4,%eax
  add    %r8d,%eax
  mov    %ecx,%ebx
  sar    $0x5,%ebx
  add    %edi,%ebx
  xor    %ebx,%eax
  lea    (%rcx,%rsi,1),%ebx
  xor    %ebx,%eax
  sub    %eax,%edx
  mov    %edx,%eax
  shl    $0x4,%eax
  add    %r11d,%eax
  mov    %edx,%ebx
  sar    $0x5,%ebx
  add    %r9d,%ebx
  xor    %ebx,%eax
  lea    (%rdx,%rsi,1),%ebx
  xor    %ebx,%eax
  sub    %eax,%ecx
  add    $0x61c88647,%esi
  jne    L4
  mov    %ecx,(%r10)
  mov    %edx,0x4(%r10)
  pop    %rbx
  ret
```

assistant: ```c
void decrypt(uint32_t v[2], const uint32_t k[4]) {
  uint32_t v0 = v[0], v1 = v[1], sum = 0xC6EF3720, i;
  uint32_t delta = 0x9E3779B9;
  uint32_t k0 = k[0], k1 = k[1], k2 = k[2], k3 = k[3];
  for (i = 0; i < 32; i++) {
    v1 -= ((v0 << 4) + k2) ^ (v0 + sum) ^ ((v0 >> 5) + k3);
    v0 -= ((v1 << 4) + k0) ^ (v1 + sum) ^ ((v1 >> 5) + k1);
    sum -= delta;
  }
  v[0] = v0;
  v[1] = v1;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<decrypt>:
  endbr64
  push   %rbp
  mov    %rdi,%r10
  push   %rbx
  mov    $0xc6ef3720,%ebx
  mov    (%rdi),%ecx
  mov    0x4(%rdi),%edx
  mov    (%rsi),%r11d
  mov    0x4(%rsi),%r9d
  mov    0x8(%rsi),%r8d
  mov    0xc(%rsi),%edi
  mov    $0x20,%esi
  cs nopw 0x0(%rax,%rax,1)
L0:
  mov    %ecx,%eax
  mov    %ecx,%ebp
  shl    $0x4,%eax
  sar    $0x5,%ebp
  add    %edi,%ebp
  add    %r8d,%eax
  xor    %ebp,%eax
  lea    (%rcx,%rbx,1),%ebp
  xor    %ebp,%eax
  sub    %eax,%edx
  mov    %edx,%eax
  mov    %edx,%ebp
  add    %edx,%ebx
  shl    $0x4,%eax
  sar    $0x5,%ebp
  add    %r11d,%eax
  add    %r9d,%ebp
  xor    %ebp,%eax
  xor    %ebx,%eax
  mov    $0x28b7bd67,%ebx
  sub    %eax,%ecx
  sub    $0x1,%esi
  jne    L0
  pop    %rbx
  pop    %rbp
  mov    %ecx,(%r10)
  mov    %edx,0x4(%r10)
  ret
```

assistant: ```c
void decrypt(uint32_t v[2], const uint32_t k[4]) {
  uint32_t v0 = v[0], v1 = v[1], sum = 0xC6EF3720, i;
  uint32_t delta = 0x9E3779B9;
  uint32_t k0 = k[0], k1 = k[1], k2 = k[2], k3 = k[3];
  for (i = 0; i < 32; i++) {
    v1 -= ((v0 << 4) + k2) ^ (v0 + sum) ^ ((v0 >> 5) + k3);
    v0 -= ((v1 << 4) + k0) ^ (v1 + sum) ^ ((v1 >> 5) + k1);
    sum -= delta;
  }
  v[0] = v0;
  v[1] = v1;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<decrypt>:
  endbr64
  mov    (%rdi),%edx
  push   %rbx
  mov    (%rsi),%r8d
  mov    0x4(%rsi),%r9d
  mov    0x8(%rsi),%r10d
  mov    %edx,%ecx
  mov    0xc(%rsi),%esi
  mov    %edx,%eax
  sar    $0x5,%ecx
  shl    $0x4,%eax
  add    %r10d,%eax
  add    %esi,%ecx
  xor    %eax,%ecx
  lea    -0x3910c8e0(%rdx),%eax
  xor    %eax,%ecx
  mov    0x4(%rdi),%eax
  sub    %ecx,%eax
  mov    %eax,%ecx
  mov    %eax,%r11d
  sar    $0x5,%ecx
  shl    $0x4,%r11d
  add    %r8d,%r11d
  add    %r9d,%ecx
  xor    %r11d,%ecx
  lea    -0x3910c8e0(%rax),%r11d
  xor    %r11d,%ecx
  sub    %ecx,%edx
  mov    %edx,%ecx
  mov    %edx,%r11d
  sar    $0x5,%ecx
  shl    $0x4,%r11d
  add    %r10d,%r11d
  add    %esi,%ecx
  xor    %r11d,%ecx
  lea    0x28b7bd67(%rdx),%r11d
  xor    %r11d,%ecx
  sub    %ecx,%eax
  mov    %eax,%ecx
  mov    %eax,%r11d
  sar    $0x5,%ecx
  shl    $0x4,%r11d
  add    %r8d,%r11d
  add    %r9d,%ecx
  xor    %r11d,%ecx
  lea    0x28b7bd67(%rax),%r11d
  xor    %r11d,%ecx
  mov    $0x1e,%r11d
  sub    %ecx,%edx
L3:
  mov    %edx,%ecx
  mov    %edx,%ebx
  shl    $0x4,%ecx
  sar    $0x5,%ebx
  add    %esi,%ebx
  add    %r10d,%ecx
  xor    %ebx,%ecx
  lea    0x28b7bd67(%rdx),%ebx
  xor    %ebx,%ecx
  sub    %ecx,%eax
  mov    %eax,%ecx
  mov    %eax,%ebx
  shl    $0x4,%ecx
  sar    $0x5,%ebx
  add    %r9d,%ebx
  add    %r8d,%ecx
  xor    %ebx,%ecx
  lea    0x28b7bd67(%rax),%ebx
  xor    %ebx,%ecx
  sub    %ecx,%edx
  sub    $0x1,%r11d
  jne    L3
  mov    %edx,(%rdi)
  pop    %rbx
  mov    %eax,0x4(%rdi)
  ret
```

assistant: ```c
void decrypt(uint32_t v[2], const uint32_t k[4]) {
  uint32_t v0 = v[0], v1 = v[1], sum = 0xC6EF3720, i;
  uint32_t delta = 0x9E3779B9;
  uint32_t k0 = k[0], k1 = k[1], k2 = k[2], k3 = k[3];
  for (i = 0; i < 32; i++) {
    v1 -= ((v0 << 4) + k2) ^ (v0 + sum) ^ ((v0 >> 5) + k3);
    v0 -= ((v1 << 4) + k0) ^ (v1 + sum) ^ ((v1 >> 5) + k1);
    sum -= delta;
  }
  v[0] = v0;
  v[1] = v1;
}
```