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

```asm
<createpop>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x210,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    $0xff,%esi
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    -0x210(%rbp),%rax
  mov    %rax,%rsi
  lea    D27(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    $0xff,%esi
  lea    D39(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    -0x110(%rbp),%rax
  mov    %rax,%rsi
  lea    D27(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  lea    -0x110(%rbp),%rdx
  lea    -0x210(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <makepop@plt>
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L2
  call   <__stack_chk_fail@plt>
L2:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D7
type: string
name: extract_symbolic_data
arguments: tag: D27
type: string
name: extract_symbolic_data
arguments: tag: D39
type: string

tool: D7: 
  choose table file (.len) (max %d character): 

tool: D27: %s

tool: D39: 
  insert name for sample file (no extension) (max %d character): 

assistant: ```c
int createpop() {
  char str[256], input[256], output[256];
  printf("\n  choose table file (.len) (max %d character): ", 256 - 1);
  scanf("%s", input);
  printf("\n  insert name for sample file (no extension) (max %d character): ", 256 - 1);
  scanf("%s", output);
  return makepop(input, output);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<createpop>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x210,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x208(%rsp)
  xor    %eax,%eax
  mov    $0xff,%esi
  lea    D25(%rip),%rdi
  call   <printf@plt>
  mov    %rsp,%rbx
  mov    %rbx,%rsi
  lea    D11(%rip),%r12
  mov    %r12,%rdi
  call   <scanf@plt>
  mov    $0xff,%esi
  lea    D2(%rip),%rdi
  call   <printf@plt>
  lea    0x100(%rsp),%rbp
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <scanf@plt>
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <makepop@plt>
  mov    0x208(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L2
  add    $0x210,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L2:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D25
datatype: string
name: read_data
arguments: tag: D11
datatype: string
name: read_data
arguments: tag: D2
datatype: string

tool: D25: 
  choose table file (.len) (max %d character): 

tool: D11: %s

tool: D2: 
  insert name for sample file (no extension) (max %d character): 

assistant: ```c
int createpop() {
  char str[256], input[256], output[256];
  printf("\n  choose table file (.len) (max %d character): ", 256 - 1);
  scanf("%s", input);
  printf("\n  insert name for sample file (no extension) (max %d character): ", 256 - 1);
  scanf("%s", output);
  return makepop(input, output);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<createpop>:
  endbr64
  push   %r13
  mov    $0xff,%esi
  lea    D18(%rip),%rdi
  lea    D1(%rip),%r13
  push   %r12
  push   %rbp
  sub    $0x210,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x208(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  lea    0x100(%rsp),%r12
  call   <printf@plt>
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <scanf@plt>
  mov    $0xff,%esi
  lea    D23(%rip),%rdi
  call   <printf@plt>
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <scanf@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <makepop@plt>
  mov    0x208(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L9
  add    $0x210,%rsp
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L9:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D18
type: string
name: unpack_data
arguments: label: D1
type: string
name: unpack_data
arguments: label: D23
type: string

tool: D18: 
  choose table file (.len) (max %d character): 

tool: D1: %s

tool: D23: 
  insert name for sample file (no extension) (max %d character): 

assistant: ```c
int createpop() {
  char str[256], input[256], output[256];
  printf("\n  choose table file (.len) (max %d character): ", 256 - 1);
  scanf("%s", input);
  printf("\n  insert name for sample file (no extension) (max %d character): ", 256 - 1);
  scanf("%s", output);
  return makepop(input, output);
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<createpop>:
  endbr64
  push   %r13
  mov    $0xff,%esi
  lea    D0(%rip),%rdi
  lea    D19(%rip),%r13
  push   %r12
  push   %rbp
  sub    $0x210,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x208(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  lea    0x100(%rsp),%r12
  call   <printf@plt>
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <scanf@plt>
  mov    $0xff,%esi
  lea    D2(%rip),%rdi
  call   <printf@plt>
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <scanf@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <makepop@plt>
  mov    0x208(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L7
  add    $0x210,%rsp
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L7:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D0
data_type: string
name: read_data
arguments: data_tag: D19
data_type: string
name: read_data
arguments: data_tag: D2
data_type: string

tool: D0: 
  choose table file (.len) (max %d character): 

tool: D19: %s

tool: D2: 
  insert name for sample file (no extension) (max %d character): 

assistant: ```c
int createpop() {
  char str[256], input[256], output[256];
  printf("\n  choose table file (.len) (max %d character): ", 256 - 1);
  scanf("%s", input);
  printf("\n  insert name for sample file (no extension) (max %d character): ", 256 - 1);
  scanf("%s", output);
  return makepop(input, output);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<decFixed>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x8(%rbp)
  mov    %esi,-0xc(%rbp)
  mov    %rdx,-0x18(%rbp)
  mov    -0x8(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x8(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0xc(%rbp),%eax
  cltq
  add    %rax,%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,(%rax)
  mov    $0x0,%eax
  pop    %rbp
  ret
```

assistant: ```c
int decFixed(char **buf, int sz, char **r) {
  *r = *buf;
  *buf += sz;
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<decFixed>:
  endbr64
  mov    (%rdi),%rax
  mov    %rax,(%rdx)
  movslq %esi,%rsi
  add    %rsi,%rax
  mov    %rax,(%rdi)
  mov    $0x0,%eax
  ret
```

assistant: ```c
int decFixed(char **buf, int sz, char **r) {
  *r = *buf;
  *buf += sz;
  return 0;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<decFixed>:
  endbr64
  mov    (%rdi),%rax
  movslq %esi,%rsi
  mov    %rax,(%rdx)
  add    %rsi,%rax
  mov    %rax,(%rdi)
  xor    %eax,%eax
  ret
```

assistant: ```c
int decFixed(char **buf, int sz, char **r) {
  *r = *buf;
  *buf += sz;
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<decFixed>:
  endbr64
  mov    (%rdi),%rax
  movslq %esi,%rsi
  mov    %rax,(%rdx)
  add    %rsi,%rax
  mov    %rax,(%rdi)
  xor    %eax,%eax
  ret
```

assistant: ```c
int decFixed(char **buf, int sz, char **r) {
  *r = *buf;
  *buf += sz;
  return 0;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<getRotY>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  movss  %xmm0,-0x14(%rbp)
  mov    %rdi,-0x20(%rbp)
  mov    -0x14(%rbp),%eax
  movd   %eax,%xmm0
  call   <fdegsin@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x14(%rbp),%eax
  movd   %eax,%xmm0
  call   <fdegcos@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x20(%rbp),%rax
  movss  -0x4(%rbp),%xmm0
  movss  %xmm0,(%rax)
  mov    -0x20(%rbp),%rax
  add    $0x10,%rax
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x20(%rbp),%rax
  add    $0x20,%rax
  movss  -0x8(%rbp),%xmm0
  movss  %xmm0,(%rax)
  mov    -0x20(%rbp),%rax
  add    $0x30,%rax
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x20(%rbp),%rax
  add    $0x4,%rax
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x20(%rbp),%rax
  add    $0x14,%rax
  movss  D13(%rip),%xmm0
  movss  %xmm0,(%rax)
  mov    -0x20(%rbp),%rax
  add    $0x24,%rax
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x20(%rbp),%rax
  add    $0x34,%rax
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  movss  -0x8(%rbp),%xmm0
  movss  D10(%rip),%xmm1
  xorps  %xmm1,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x20(%rbp),%rax
  add    $0x18,%rax
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x20(%rbp),%rax
  add    $0x28,%rax
  movss  -0x4(%rbp),%xmm0
  movss  %xmm0,(%rax)
  mov    -0x20(%rbp),%rax
  add    $0x38,%rax
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x20(%rbp),%rax
  add    $0xc,%rax
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x20(%rbp),%rax
  add    $0x1c,%rax
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x20(%rbp),%rax
  add    $0x2c,%rax
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x20(%rbp),%rax
  add    $0x3c,%rax
  movss  D13(%rip),%xmm0
  movss  %xmm0,(%rax)
  nop
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D13
data_type: byte[4]
name: retrieve_data
arguments: data_label: D10
data_type: byte[4]

tool: {"D13": [0x00,0x00,0x80,0x3f]}

tool: {"D10": [0x00,0x00,0x00,0x80]}

assistant: ```c
void getRotY(float a, float m[16]) {
  float sina = fdegsin(a);
  float cosa = fdegcos(a);
  m[0] = cosa;
  m[4] = 0.0f;
  m[8] = sina;
  m[12] = 0.0f;
  m[1] = 0.0f;
  m[5] = 1.0f;
  m[9] = 0.0f;
  m[13] = 0.0f;
  m[2] = -sina;
  m[6] = 0.0f;
  m[10] = cosa;
  m[14] = 0.0f;
  m[3] = 0.0f;
  m[7] = 0.0f;
  m[11] = 0.0f;
  m[15] = 1.0f;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<getRotY>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbx
  movss  %xmm0,0xc(%rsp)
  call   <fdegsin@plt>
  movd   %xmm0,%ebp
  movss  0xc(%rsp),%xmm0
  call   <fdegcos@plt>
  movss  %xmm0,(%rbx)
  movl   $0x0,0x10(%rbx)
  mov    %ebp,0x20(%rbx)
  movl   $0x0,0x30(%rbx)
  movl   $0x0,0x4(%rbx)
  movss  D18(%rip),%xmm1
  movss  %xmm1,0x14(%rbx)
  movl   $0x0,0x24(%rbx)
  movl   $0x0,0x34(%rbx)
  movd   %ebp,%xmm2
  xorps  D1(%rip),%xmm2
  movss  %xmm2,0x8(%rbx)
  movl   $0x0,0x18(%rbx)
  movss  %xmm0,0x28(%rbx)
  movl   $0x0,0x38(%rbx)
  movl   $0x0,0xc(%rbx)
  movl   $0x0,0x1c(%rbx)
  movl   $0x0,0x2c(%rbx)
  movss  %xmm1,0x3c(%rbx)
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

tool_calls: name: read_data
arguments: tag: D18
type: byte[4]
name: read_data
arguments: tag: D1
type: byte[16]

tool: {"D18": [0x00,0x00,0x80,0x3f]}

tool: {"D1": [0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

assistant: ```c
void getRotY(float a, float m[16]) {
  float sina = fdegsin(a);
  float cosa = fdegcos(a);
  m[0] = cosa;
  m[4] = 0.0f;
  m[8] = sina;
  m[12] = 0.0f;
  m[1] = 0.0f;
  m[5] = 1.0f;
  m[9] = 0.0f;
  m[13] = 0.0f;
  m[2] = -sina;
  m[6] = 0.0f;
  m[10] = cosa;
  m[14] = 0.0f;
  m[3] = 0.0f;
  m[7] = 0.0f;
  m[11] = 0.0f;
  m[15] = 1.0f;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<getRotY>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x10,%rsp
  movss  %xmm0,0xc(%rsp)
  call   <fdegsin@plt>
  movss  0xc(%rsp),%xmm2
  movss  %xmm0,0x8(%rsp)
  movaps %xmm2,%xmm0
  call   <fdegcos@plt>
  movss  0x8(%rsp),%xmm1
  movl   $0x0,0x4(%rbx)
  movl   $0x0,0x24(%rbx)
  movss  %xmm1,0x20(%rbx)
  xorps  D3(%rip),%xmm1
  movq   $0x0,0xc(%rbx)
  movq   $0x3f800000,0x14(%rbx)
  movl   $0x0,0x1c(%rbx)
  movq   $0x0,0x2c(%rbx)
  movq   $0x0,0x34(%rbx)
  movl   $0x3f800000,0x3c(%rbx)
  movss  %xmm0,(%rbx)
  movss  %xmm1,0x8(%rbx)
  movss  %xmm0,0x28(%rbx)
  add    $0x10,%rsp
  pop    %rbx
  ret
```

tool_calls: name: read_data
arguments: label: D3
datatype: byte[16]

tool: {"D3": [0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

assistant: ```c
void getRotY(float a, float m[16]) {
  float sina = fdegsin(a);
  float cosa = fdegcos(a);
  m[0] = cosa;
  m[4] = 0.0f;
  m[8] = sina;
  m[12] = 0.0f;
  m[1] = 0.0f;
  m[5] = 1.0f;
  m[9] = 0.0f;
  m[13] = 0.0f;
  m[2] = -sina;
  m[6] = 0.0f;
  m[10] = cosa;
  m[14] = 0.0f;
  m[3] = 0.0f;
  m[7] = 0.0f;
  m[11] = 0.0f;
  m[15] = 1.0f;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<getRotY>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x10,%rsp
  movss  %xmm0,0xc(%rsp)
  call   <fdegsin@plt>
  movss  0xc(%rsp),%xmm2
  movss  %xmm0,0x8(%rsp)
  movaps %xmm2,%xmm0
  call   <fdegcos@plt>
  movss  0x8(%rsp),%xmm1
  movl   $0x0,0x4(%rbx)
  movl   $0x0,0x24(%rbx)
  movss  %xmm1,0x20(%rbx)
  xorps  D3(%rip),%xmm1
  movq   $0x0,0xc(%rbx)
  movq   $0x3f800000,0x14(%rbx)
  movl   $0x0,0x1c(%rbx)
  movq   $0x0,0x2c(%rbx)
  movq   $0x0,0x34(%rbx)
  movl   $0x3f800000,0x3c(%rbx)
  movss  %xmm0,(%rbx)
  movss  %xmm1,0x8(%rbx)
  movss  %xmm0,0x28(%rbx)
  add    $0x10,%rsp
  pop    %rbx
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D3
data_type: byte[16]

tool: {"D3": [0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

assistant: ```c
void getRotY(float a, float m[16]) {
  float sina = fdegsin(a);
  float cosa = fdegcos(a);
  m[0] = cosa;
  m[4] = 0.0f;
  m[8] = sina;
  m[12] = 0.0f;
  m[1] = 0.0f;
  m[5] = 1.0f;
  m[9] = 0.0f;
  m[13] = 0.0f;
  m[2] = -sina;
  m[6] = 0.0f;
  m[10] = cosa;
  m[14] = 0.0f;
  m[3] = 0.0f;
  m[7] = 0.0f;
  m[11] = 0.0f;
  m[15] = 1.0f;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<power>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  movl   $0x1,-0x4(%rbp)
  jmp    L7
L8:
  mov    -0x4(%rbp),%eax
  imul   -0x14(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  subl   $0x1,-0x18(%rbp)
L7:
  cmpl   $0x0,-0x18(%rbp)
  jne    L8
  mov    -0x4(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int power(int x, int y) {
  int pow = 1;
  while (y != 0) {
    pow *= x;
    y--;
  }
  return pow;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<power>:
  endbr64
  test   %esi,%esi
  je     L9
  mov    $0x1,%eax
L16:
  imul   %edi,%eax
  sub    $0x1,%esi
  jne    L16
  ret
L9:
  mov    $0x1,%eax
  ret
```

assistant: ```c
int power(int x, int y) {
  int pow = 1;
  while (y != 0) {
    pow *= x;
    y--;
  }
  return pow;
}
```
user: Translate the below assembly code into C programming language:

```asm
<power>:
  endbr64
  mov    $0x1,%eax
  test   %esi,%esi
  je     L16
  nopl   (%rax)
L6:
  imul   %edi,%eax
  sub    $0x1,%esi
  jne    L6
  ret
  nopl   0x0(%rax)
L16:
  ret
```

assistant: ```c
int power(int x, int y) {
  int pow = 1;
  while (y != 0) {
    pow *= x;
    y--;
  }
  return pow;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<power>:
  endbr64
  mov    $0x1,%eax
  test   %esi,%esi
  je     L14
  nopl   (%rax)
L1:
  imul   %edi,%eax
  sub    $0x1,%esi
  jne    L1
  ret
  nopl   0x0(%rax)
L14:
  ret
```

assistant: ```c
int power(int x, int y) {
  int pow = 1;
  while (y != 0) {
    pow *= x;
    y--;
  }
  return pow;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<pd_socket_get_port>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  movl   $0xffffffff,-0x4(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  je     L1
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <ntohs@plt>
  mov    %eax,-0x4(%rbp)
L1:
  mov    -0x4(%rbp),%eax
  leave
  ret
```

assistant: ```c
int pd_socket_get_port(struct sockaddr_in *addr) {
  int ret = -1;
  if (NULL != addr) {
    ret = ntohs(addr->sin_port);
  }
  return ret;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<pd_socket_get_port>:
  endbr64
  test   %rdi,%rdi
  je     L2
  sub    $0x8,%rsp
  mov    (%rdi),%edi
  call   <ntohs@plt>
  add    $0x8,%rsp
  ret
L2:
  mov    $0xffffffff,%eax
  ret
```

assistant: ```c
int pd_socket_get_port(struct sockaddr_in *addr) {
  int ret = -1;
  if (NULL != addr) {
    ret = ntohs(addr->sin_port);
  }
  return ret;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<pd_socket_get_port>:
  endbr64
  test   %rdi,%rdi
  je     L9
  mov    (%rdi),%edi
  jmp    1050 <ntohs@plt>
L9:
  mov    $0xffffffff,%eax
  ret
```

assistant: ```c
int pd_socket_get_port(struct sockaddr_in *addr) {
  int ret = -1;
  if (NULL != addr) {
    ret = ntohs(addr->sin_port);
  }
  return ret;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<pd_socket_get_port>:
  endbr64
  test   %rdi,%rdi
  je     L6
  mov    (%rdi),%edi
  jmp    1050 <ntohs@plt>
L6:
  mov    $0xffffffff,%eax
  ret
```

assistant: ```c
int pd_socket_get_port(struct sockaddr_in *addr) {
  int ret = -1;
  if (NULL != addr) {
    ret = ntohs(addr->sin_port);
  }
  return ret;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<yuv2yv12>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %rcx,-0x50(%rbp)
  mov    %r8,-0x58(%rbp)
  mov    %r9d,-0x5c(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x68(%rbp)
  mov    -0x40(%rbp),%r14
  mov    -0x48(%rbp),%r15
  mov    -0x5c(%rbp),%eax
  sar    %eax
  mov    %eax,%r13d
  mov    0x10(%rbp),%eax
  sar    %eax
  mov    %eax,-0x60(%rbp)
  mov    -0x58(%rbp),%rax
  shr    %rax
  mov    %eax,-0x6c(%rbp)
  mov    -0x50(%rbp),%r12
  mov    $0x0,%ebx
  jmp    L56
L45:
  mov    -0x5c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x68(%rbp),%rsi
  mov    %r12,%rdi
  call   <memcpy@plt>
  mov    -0x5c(%rbp),%eax
  cltq
  add    %rax,-0x68(%rbp)
  mov    -0x58(%rbp),%rax
  add    %r12,%rax
  mov    %rax,%r12
  add    $0x1,%ebx
L56:
  cmp    0x10(%rbp),%ebx
  jl     L45
  mov    0x10(%rbp),%eax
  cltq
  imul   -0x58(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x50(%rbp),%rax
  lea    (%rdx,%rax,1),%r12
  mov    $0x0,%ebx
  jmp    L30
L0:
  mov    %r13d,%edx
  mov    %r15,%rsi
  mov    %r12,%rdi
  call   <memcpy@plt>
  movslq %r13d,%rax
  add    %rax,%r15
  movslq -0x6c(%rbp),%rax
  add    %rax,%r12
  add    $0x1,%ebx
L30:
  cmp    -0x60(%rbp),%ebx
  jl     L0
  mov    0x10(%rbp),%eax
  cltq
  imul   -0x58(%rbp),%rax
  mov    %rax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  shr    $0x2,%rax
  mov    %rax,%rdx
  mov    -0x50(%rbp),%rax
  lea    (%rdx,%rax,1),%r12
  mov    $0x0,%ebx
  jmp    L58
L33:
  mov    %r13d,%edx
  mov    %r14,%rsi
  mov    %r12,%rdi
  call   <memcpy@plt>
  movslq %r13d,%rax
  add    %rax,%r14
  movslq -0x6c(%rbp),%rax
  add    %rax,%r12
  add    $0x1,%ebx
L58:
  cmp    -0x60(%rbp),%ebx
  jl     L33
  nop
  nop
  add    $0x48,%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

assistant: ```c
void yuv2yv12(unsigned char *py, unsigned char *pu, unsigned char *pv, unsigned char *dst, unsigned long pitch, int width, int height) {
  register unsigned char *tmpdst;
  register unsigned char *y, *u, *v;
  register int i;
  register int halfh, halfw, halfp;
  y = py;
  u = pu;
  v = pv;
  halfw = (width >> 1);
  halfh = (height >> 1);
  halfp = (pitch >> 1);
  tmpdst = dst;
  for (i = 0; i < height; ++i) {
    memcpy(tmpdst, y, width);
    y += width;
    tmpdst += pitch;
  }
  tmpdst = dst + height * pitch;
  for (i = 0; i < halfh; ++i) {
    memcpy(tmpdst, v, halfw);
    v += halfw;
    tmpdst += halfp;
  }
  tmpdst = dst + height * pitch * 5 / 4;
  for (i = 0; i < halfh; ++i) {
    memcpy(tmpdst, u, halfw);
    u += halfw;
    tmpdst += halfp;
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<yuv2yv12>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rsi,%rbx
  mov    %rdx,%rbp
  mov    %rcx,0x10(%rsp)
  mov    %r8,(%rsp)
  mov    %r9d,%eax
  sar    %eax
  mov    %eax,0x20(%rsp)
  mov    0x70(%rsp),%r14d
  sar    %r14d
  mov    %r8,%rax
  shr    %rax
  mov    %eax,0x18(%rsp)
  cmpl   $0x0,0x70(%rsp)
  jle    L30
  mov    %rdi,%r12
  mov    %rcx,%r15
  mov    $0x0,%r13d
  movslq %r9d,%rcx
  mov    %rcx,0x8(%rsp)
  mov    %r14d,0x24(%rsp)
  mov    %rsi,0x28(%rsp)
  mov    %r9d,%r14d
  mov    0x70(%rsp),%ebx
L43:
  mov    %r14d,%edx
  mov    %r12,%rsi
  mov    %r15,%rdi
  call   <memcpy@plt>
  add    0x8(%rsp),%r12
  add    (%rsp),%r15
  add    $0x1,%r13d
  cmp    %r13d,%ebx
  jne    L43
  mov    0x24(%rsp),%r14d
  mov    0x28(%rsp),%rbx
L30:
  movslq 0x70(%rsp),%rax
  imul   (%rsp),%rax
  mov    %rax,0x8(%rsp)
  mov    0x10(%rsp),%r12
  add    %rax,%r12
  test   %r14d,%r14d
  jle    L21
  mov    $0x0,%r13d
  mov    0x20(%rsp),%eax
  movslq %eax,%rcx
  mov    %rcx,(%rsp)
  mov    0x18(%rsp),%r15d
  mov    %rbx,0x18(%rsp)
  mov    %eax,%ebx
L36:
  mov    %ebx,%edx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <memcpy@plt>
  add    (%rsp),%rbp
  movslq %r15d,%rax
  add    %rax,%r12
  add    $0x1,%r13d
  cmp    %r13d,%r14d
  jne    L36
  mov    %rax,%r15
  mov    0x18(%rsp),%rbx
  mov    0x8(%rsp),%rax
  lea    (%rax,%rax,4),%rbp
  shr    $0x2,%rbp
  add    0x10(%rsp),%rbp
  mov    $0x0,%r12d
  mov    0x20(%rsp),%r13d
L20:
  mov    %r13d,%edx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <memcpy@plt>
  add    (%rsp),%rbx
  add    %r15,%rbp
  add    $0x1,%r12d
  cmp    %r12d,%r14d
  jne    L20
L21:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void yuv2yv12(unsigned char *py, unsigned char *pu, unsigned char *pv, unsigned char *dst, unsigned long pitch, int width, int height) {
  register unsigned char *tmpdst;
  register unsigned char *y, *u, *v;
  register int i;
  register int halfh, halfw, halfp;
  y = py;
  u = pu;
  v = pv;
  halfw = (width >> 1);
  halfh = (height >> 1);
  halfp = (pitch >> 1);
  tmpdst = dst;
  for (i = 0; i < height; ++i) {
    memcpy(tmpdst, y, width);
    y += width;
    tmpdst += pitch;
  }
  tmpdst = dst + height * pitch;
  for (i = 0; i < halfh; ++i) {
    memcpy(tmpdst, v, halfw);
    v += halfw;
    tmpdst += halfp;
  }
  tmpdst = dst + height * pitch * 5 / 4;
  for (i = 0; i < halfh; ++i) {
    memcpy(tmpdst, u, halfw);
    u += halfw;
    tmpdst += halfp;
  }
}
```