ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<RandomFunc>:
  endbr64
  movzwl (%rdi),%eax
  shr    $0x3,%rax
  or     $0xbab5,%ax
  rol    $0x8,%ax
  and    $0x7c57,%ax
  mov    %ax,(%rsi)
  ret
```

assistant: ```c
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  unsigned short local1;
  char copy11;
  char copy14;
  {
    state[0UL] = (input[0UL] | 51238316UL) >> (unsigned short)3;
    local1 = 0UL;
    while (local1 < 1UL) {
      if (state[0UL] > local1) {
        copy11 = *((char *)(&state[local1]) + 1);
        *((char *)(&state[local1]) + 1) = *((char *)(&state[local1]) + 0);
        *((char *)(&state[local1]) + 0) = copy11;
      } else {
        copy14 = *((char *)(&state[local1]) + 1);
        *((char *)(&state[local1]) + 1) = *((char *)(&state[local1]) + 0);
        *((char *)(&state[local1]) + 0) = copy14;
        copy14 = *((char *)(&state[local1]) + 0);
        *((char *)(&state[local1]) + 0) = *((char *)(&state[local1]) + 1);
        *((char *)(&state[local1]) + 1) = copy14;
      }
      if (state[0UL] <= local1) {
        state[local1] |= state[0UL];
      }
      local1 += 2UL;
    }
    output[0UL] = state[0UL] & 638614615UL;
  }
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x28(%rbp),%rax
  mov    %rax,%rsi
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  jmp    L99
L44:
  movl   $0x0,-0x20(%rbp)
  movl   $0x0,-0x1c(%rbp)
  lea    -0x12(%rbp),%rax
  mov    %rax,%rsi
  lea    D22(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  movl   $0x0,-0x24(%rbp)
  jmp    L119
L115:
  mov    -0x24(%rbp),%eax
  cltq
  movzbl -0x12(%rbp,%rax,1),%eax
  cmp    $0x5a,%al
  jg     L143
  mov    -0x24(%rbp),%eax
  cltq
  movzbl -0x12(%rbp,%rax,1),%eax
  cmp    $0x40,%al
  jg     L114
L143:
  movl   $0x1,-0x20(%rbp)
L114:
  addl   $0x1,-0x24(%rbp)
L119:
  cmpl   $0x4,-0x24(%rbp)
  jle    L115
  movl   $0x5,-0x24(%rbp)
  jmp    L38
L64:
  mov    -0x24(%rbp),%eax
  cltq
  movzbl -0x12(%rbp,%rax,1),%eax
  cmp    $0x2f,%al
  jle    L78
  mov    -0x24(%rbp),%eax
  cltq
  movzbl -0x12(%rbp,%rax,1),%eax
  cmp    $0x39,%al
  jle    L17
L78:
  movl   $0x1,-0x1c(%rbp)
L17:
  addl   $0x1,-0x24(%rbp)
L38:
  cmpl   $0x8,-0x24(%rbp)
  jle    L64
  movl   $0x0,-0x18(%rbp)
  movzbl -0x9(%rbp),%eax
  cmp    $0x40,%al
  jle    L107
  movzbl -0x9(%rbp),%eax
  cmp    $0x5a,%al
  jle    L138
L107:
  movl   $0x1,-0x18(%rbp)
L138:
  cmpl   $0x0,-0x20(%rbp)
  jne    L71
  cmpl   $0x0,-0x1c(%rbp)
  jne    L71
  cmpl   $0x0,-0x18(%rbp)
  jne    L71
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L99
L71:
  lea    D34(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L99:
  mov    -0x28(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x28(%rbp)
  test   %eax,%eax
  jne    L44
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L60
  call   <__stack_chk_fail@plt>
L60:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D12
type_infered: string
name: extract_symbolic_data
arguments: data_label: D22
type_infered: string
name: extract_symbolic_data
arguments: data_label: D3
type_infered: string
name: extract_symbolic_data
arguments: data_label: D34
type_infered: string

tool: D12: %d

tool: D22: %s

tool: D3: YES


tool: D34: NO


assistant: ```c
int main() {
  int i, j, k, t, flag1, flag2, flag3;
  char str[10];
  scanf("%d", &t);
  while (t--) {
    flag1 = 0;
    flag2 = 0;
    scanf("%s", str);
    for (i = 0; i < 5; i++) {
      if (str[i] <= 90 && str[i] >= 65) {
      } else {
        flag1 = 1;
      }
    }
    for (i = 5; i < 9; i++) {
      if (str[i] >= 48 && str[i] <= 57) {
      } else {
        flag2 = 1;
      }
    }
    flag3 = 0;
    if (str[9] >= 65 && str[9] <= 90) {
    } else
      flag3 = 1;
    if (flag1 == 0 && flag2 == 0 && flag3 == 0)
      printf("YES\n");
    else
      printf("NO\n");
  }
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<main>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x8(%rsp),%rsi
  lea    D28(%rip),%rdi
  call   <scanf@plt>
  mov    0x8(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x8(%rsp)
  test   %eax,%eax
  je     L16
  lea    0xe(%rsp),%r12
  lea    D17(%rip),%r13
  mov    $0x1,%ebx
  lea    0x12(%rsp),%rbp
  jmp    L60
L28:
  lea    D34(%rip),%rdi
  call   <printf@plt>
L8:
  mov    0x8(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x8(%rsp)
  test   %eax,%eax
  je     L16
L60:
  mov    %r12,%rsi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    %r12,%rcx
  lea    0x13(%rsp),%rdi
  mov    %r12,%rax
  mov    $0x0,%esi
L17:
  movzbl (%rax),%edx
  sub    $0x41,%edx
  cmp    $0x1a,%dl
  cmovae %ebx,%esi
  add    $0x1,%rax
  cmp    %rdi,%rax
  jne    L17
  mov    $0x0,%edx
L27:
  movzbl 0x5(%rcx),%eax
  sub    $0x30,%eax
  cmp    $0xa,%al
  cmovae %ebx,%edx
  add    $0x1,%rcx
  cmp    %rbp,%rcx
  jne    L27
  movzbl 0x17(%rsp),%eax
  sub    $0x41,%eax
  cmp    $0x19,%al
  seta   %al
  movzbl %al,%eax
  or     %esi,%eax
  or     %edx,%eax
  jne    L28
  lea    D31(%rip),%rdi
  call   <printf@plt>
  jmp    L8
L16:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L79
  mov    $0x0,%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L79:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D28
type_guessed: string
name: disassemble_data
arguments: data_label: D17
type_guessed: string
name: disassemble_data
arguments: data_label: D34
type_guessed: string
name: disassemble_data
arguments: data_label: D31
type_guessed: string

tool: D28: %d

tool: D17: %s

tool: D34: NO


tool: D31: YES


assistant: ```c
int main() {
  int i, j, k, t, flag1, flag2, flag3;
  char str[10];
  scanf("%d", &t);
  while (t--) {
    flag1 = 0;
    flag2 = 0;
    scanf("%s", str);
    for (i = 0; i < 5; i++) {
      if (str[i] <= 90 && str[i] >= 65) {
      } else {
        flag1 = 1;
      }
    }
    for (i = 5; i < 9; i++) {
      if (str[i] >= 48 && str[i] <= 57) {
      } else {
        flag2 = 1;
      }
    }
    flag3 = 0;
    if (str[9] >= 65 && str[9] <= 90) {
    } else
      flag3 = 1;
    if (flag1 == 0 && flag2 == 0 && flag3 == 0)
      printf("YES\n");
    else
      printf("NO\n");
  }
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<main>:
  endbr64
  push   %r15
  lea    D12(%rip),%rdi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x8(%rsp),%rsi
  call   <scanf@plt>
  mov    0x8(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x8(%rsp)
  test   %eax,%eax
  je     L6
  lea    0xe(%rsp),%rbp
  lea    D30(%rip),%r12
  mov    $0x1,%r15d
  lea    0x13(%rsp),%r13
  lea    0x12(%rsp),%rbx
  lea    D37(%rip),%r14
  nopl   0x0(%rax)
L16:
  mov    %rbp,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    %rbp,%rcx
  mov    %rbp,%rax
  xor    %esi,%esi
L39:
  movzbl (%rax),%edi
  lea    -0x41(%rdi),%edx
  cmp    $0x1a,%dl
  cmovae %r15d,%esi
  add    $0x1,%rax
  cmp    %r13,%rax
  jne    L39
  xor    %edx,%edx
L37:
  movzbl 0x5(%rcx),%eax
  sub    $0x30,%eax
  cmp    $0xa,%al
  cmovae %r15d,%edx
  add    $0x1,%rcx
  cmp    %rbx,%rcx
  jne    L37
  movzbl 0x17(%rsp),%eax
  sub    $0x41,%eax
  cmp    $0x19,%al
  ja     L9
  or     %edx,%esi
  jne    L9
  lea    D20(%rip),%rdi
  call   <printf@plt>
L11:
  mov    0x8(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x8(%rsp)
  test   %eax,%eax
  jne    L16
L6:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L63
  add    $0x28,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L9:
  mov    %r14,%rdi
  call   <printf@plt>
  jmp    L11
L63:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D12
datatype: string
name: parse_data
arguments: tag: D30
datatype: string
name: parse_data
arguments: tag: D37
datatype: string
name: parse_data
arguments: tag: D20
datatype: string

tool: D12: %d

tool: D30: %s

tool: D37: NO


tool: D20: YES


assistant: ```c
int main() {
  int i, j, k, t, flag1, flag2, flag3;
  char str[10];
  scanf("%d", &t);
  while (t--) {
    flag1 = 0;
    flag2 = 0;
    scanf("%s", str);
    for (i = 0; i < 5; i++) {
      if (str[i] <= 90 && str[i] >= 65) {
      } else {
        flag1 = 1;
      }
    }
    for (i = 5; i < 9; i++) {
      if (str[i] >= 48 && str[i] <= 57) {
      } else {
        flag2 = 1;
      }
    }
    flag3 = 0;
    if (str[9] >= 65 && str[9] <= 90) {
    } else
      flag3 = 1;
    if (flag1 == 0 && flag2 == 0 && flag3 == 0)
      printf("YES\n");
    else
      printf("NO\n");
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %r14
  lea    D19(%rip),%rdi
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x8(%rsp),%rsi
  call   <scanf@plt>
  mov    0x8(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x8(%rsp)
  test   %eax,%eax
  je     L40
  lea    0xe(%rsp),%r12
  lea    D37(%rip),%rbp
  mov    $0x1,%ebx
  lea    D16(%rip),%r14
  lea    D21(%rip),%r13
  jmp    L50
  nopl   (%rax)
L93:
  movzbl 0x17(%rsp),%edi
  lea    -0x41(%rdi),%ecx
  cmp    $0x19,%cl
  ja     L9
  or     %eax,%edx
  jne    L9
  mov    %r13,%rdi
  call   <printf@plt>
  mov    0x8(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x8(%rsp)
  test   %eax,%eax
  je     L40
L50:
  mov    %r12,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  movzbl 0xf(%rsp),%eax
  movzbl 0xe(%rsp),%ecx
  lea    -0x41(%rax),%edx
  mov    $0x1,%eax
  cmp    $0x19,%dl
  ja     L15
  sub    $0x41,%ecx
  xor    %eax,%eax
  cmp    $0x19,%cl
  seta   %al
L15:
  movzbl 0x10(%rsp),%edi
  movzbl 0x11(%rsp),%esi
  lea    -0x41(%rdi),%edx
  movzbl 0x12(%rsp),%edi
  cmp    $0x1a,%dl
  lea    -0x41(%rsi),%edx
  movzbl 0x13(%rsp),%esi
  cmovae %ebx,%eax
  cmp    $0x1a,%dl
  lea    -0x41(%rdi),%edx
  movzbl 0x14(%rsp),%edi
  cmovae %ebx,%eax
  lea    -0x30(%rdi),%ecx
  cmp    $0x1a,%dl
  mov    $0x1,%edx
  cmovae %ebx,%eax
  cmp    $0x9,%cl
  ja     L16
  sub    $0x30,%esi
  xor    %edx,%edx
  cmp    $0x9,%sil
  seta   %dl
L16:
  movzbl 0x15(%rsp),%esi
  lea    -0x30(%rsi),%ecx
  movzbl 0x16(%rsp),%esi
  cmp    $0xa,%cl
  lea    -0x30(%rsi),%ecx
  cmovae %ebx,%edx
  cmp    $0x9,%cl
  jbe    L93
L9:
  mov    %r14,%rdi
  call   <printf@plt>
  mov    0x8(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x8(%rsp)
  test   %eax,%eax
  jne    L50
L40:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L25
  add    $0x20,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L25:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D19
type: string
name: disassemble_data
arguments: label: D37
type: string
name: disassemble_data
arguments: label: D16
type: string
name: disassemble_data
arguments: label: D21
type: string

tool: D19: %d

tool: D37: %s

tool: D16: NO


tool: D21: YES


assistant: ```c
int main() {
  int i, j, k, t, flag1, flag2, flag3;
  char str[10];
  scanf("%d", &t);
  while (t--) {
    flag1 = 0;
    flag2 = 0;
    scanf("%s", str);
    for (i = 0; i < 5; i++) {
      if (str[i] <= 90 && str[i] >= 65) {
      } else {
        flag1 = 1;
      }
    }
    for (i = 5; i < 9; i++) {
      if (str[i] >= 48 && str[i] <= 57) {
      } else {
        flag2 = 1;
      }
    }
    flag3 = 0;
    if (str[9] >= 65 && str[9] <= 90) {
    } else
      flag3 = 1;
    if (flag1 == 0 && flag2 == 0 && flag3 == 0)
      printf("YES\n");
    else
      printf("NO\n");
  }
}
```
user: What is the c source code of the assembly code below?

```asm
<row_with_min_negs>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    -0x20(%rbp),%ecx
  mov    -0x1c(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <neg_nums_in_row@plt>
  mov    %eax,-0xc(%rbp)
  movl   $0x1,-0x8(%rbp)
  movl   $0x2,-0x4(%rbp)
  jmp    L23
L27:
  mov    -0x20(%rbp),%ecx
  mov    -0x1c(%rbp),%edx
  mov    -0x4(%rbp),%esi
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <neg_nums_in_row@plt>
  cmp    %eax,-0xc(%rbp)
  jbe    L4
  mov    -0x20(%rbp),%ecx
  mov    -0x1c(%rbp),%edx
  mov    -0x4(%rbp),%esi
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <neg_nums_in_row@plt>
  mov    %eax,-0xc(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,-0x8(%rbp)
L4:
  addl   $0x1,-0x4(%rbp)
L23:
  mov    -0x4(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jbe    L27
  mov    -0x8(%rbp),%eax
  leave
  ret
```

assistant: ```c
unsigned int row_with_min_negs(int *arr, unsigned int rows, unsigned int columns) {
  unsigned int min_num = neg_nums_in_row(arr, 1, rows, columns);
  unsigned int min_index = 1;
  for (unsigned int row = 2; row <= rows; row++)
    if (neg_nums_in_row(arr, row, rows, columns) < min_num) {
      min_num = neg_nums_in_row(arr, row, rows, columns);
      min_index = row;
    };
  return min_index;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<row_with_min_negs>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r13
  mov    %esi,%ebp
  mov    %edx,%r14d
  mov    %edx,%ecx
  mov    %esi,%edx
  mov    $0x1,%esi
  call   <neg_nums_in_row@plt>
  cmp    $0x1,%ebp
  jbe    L29
  mov    %eax,%r12d
  mov    $0x2,%ebx
  mov    $0x1,%r15d
  jmp    L38
L21:
  add    $0x1,%ebx
  cmp    %ebx,%ebp
  jb     L49
L38:
  mov    %r14d,%ecx
  mov    %ebp,%edx
  mov    %ebx,%esi
  mov    %r13,%rdi
  call   <neg_nums_in_row@plt>
  cmp    %r12d,%eax
  jae    L21
  mov    %r14d,%ecx
  mov    %ebp,%edx
  mov    %ebx,%esi
  mov    %r13,%rdi
  call   <neg_nums_in_row@plt>
  mov    %eax,%r12d
  mov    %ebx,%r15d
  jmp    L21
L29:
  mov    $0x1,%r15d
L49:
  mov    %r15d,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
unsigned int row_with_min_negs(int *arr, unsigned int rows, unsigned int columns) {
  unsigned int min_num = neg_nums_in_row(arr, 1, rows, columns);
  unsigned int min_index = 1;
  for (unsigned int row = 2; row <= rows; row++)
    if (neg_nums_in_row(arr, row, rows, columns) < min_num) {
      min_num = neg_nums_in_row(arr, row, rows, columns);
      min_index = row;
    };
  return min_index;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<row_with_min_negs>:
  endbr64
  push   %r15
  mov    %edx,%ecx
  push   %r14
  mov    %edx,%r14d
  mov    %esi,%edx
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  mov    $0x1,%esi
  push   %rbx
  sub    $0x8,%rsp
  call   <neg_nums_in_row@plt>
  cmp    $0x1,%ebp
  jbe    L3
  mov    %eax,%r12d
  mov    $0x2,%ebx
  mov    $0x1,%r15d
  jmp    L10
  nopl   (%rax)
L39:
  add    $0x1,%ebx
  cmp    %ebx,%ebp
  jb     L20
L10:
  mov    %r14d,%ecx
  mov    %ebp,%edx
  mov    %ebx,%esi
  mov    %r13,%rdi
  call   <neg_nums_in_row@plt>
  cmp    %r12d,%eax
  jae    L39
  mov    %ebx,%esi
  mov    %r14d,%ecx
  mov    %ebp,%edx
  mov    %r13,%rdi
  call   <neg_nums_in_row@plt>
  mov    %ebx,%r15d
  add    $0x1,%ebx
  mov    %eax,%r12d
  cmp    %ebx,%ebp
  jae    L10
L20:
  add    $0x8,%rsp
  mov    %r15d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L3:
  mov    $0x1,%r15d
  jmp    L20
```

assistant: ```c
unsigned int row_with_min_negs(int *arr, unsigned int rows, unsigned int columns) {
  unsigned int min_num = neg_nums_in_row(arr, 1, rows, columns);
  unsigned int min_index = 1;
  for (unsigned int row = 2; row <= rows; row++)
    if (neg_nums_in_row(arr, row, rows, columns) < min_num) {
      min_num = neg_nums_in_row(arr, row, rows, columns);
      min_index = row;
    };
  return min_index;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<row_with_min_negs>:
  endbr64
  push   %r15
  mov    %edx,%ecx
  push   %r14
  mov    %edx,%r14d
  mov    %esi,%edx
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  mov    $0x1,%esi
  push   %rbx
  sub    $0x8,%rsp
  call   <neg_nums_in_row@plt>
  cmp    $0x1,%ebp
  jbe    L17
  mov    %eax,%r12d
  mov    $0x2,%ebx
  mov    $0x1,%r15d
  jmp    L20
  nopl   (%rax)
L29:
  add    $0x1,%ebx
  cmp    %ebx,%ebp
  jb     L10
L20:
  mov    %r14d,%ecx
  mov    %ebp,%edx
  mov    %ebx,%esi
  mov    %r13,%rdi
  call   <neg_nums_in_row@plt>
  cmp    %r12d,%eax
  jae    L29
  mov    %ebx,%esi
  mov    %r14d,%ecx
  mov    %ebp,%edx
  mov    %r13,%rdi
  call   <neg_nums_in_row@plt>
  mov    %ebx,%r15d
  add    $0x1,%ebx
  mov    %eax,%r12d
  cmp    %ebx,%ebp
  jae    L20
L10:
  add    $0x8,%rsp
  mov    %r15d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L17:
  mov    $0x1,%r15d
  jmp    L10
```

assistant: ```c
unsigned int row_with_min_negs(int *arr, unsigned int rows, unsigned int columns) {
  unsigned int min_num = neg_nums_in_row(arr, 1, rows, columns);
  unsigned int min_index = 1;
  for (unsigned int row = 2; row <= rows; row++)
    if (neg_nums_in_row(arr, row, rows, columns) < min_num) {
      min_num = neg_nums_in_row(arr, row, rows, columns);
      min_index = row;
    };
  return min_index;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<test_phsubd_c>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L30
L28:
  mov    -0x4(%rbp),%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%ecx
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x18(%rbp),%rax
  add    %rsi,%rax
  sub    %ecx,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0x4(%rbp)
L30:
  mov    -0x24(%rbp),%eax
  mov    $0x1,%edx
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  cmp    %eax,-0x4(%rbp)
  jl     L28
  movl   $0x0,-0x4(%rbp)
  jmp    L5
L13:
  mov    -0x4(%rbp),%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rcx
  mov    -0x20(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%esi
  mov    -0x24(%rbp),%eax
  mov    $0x1,%edi
  mov    %eax,%ecx
  shl    %cl,%edi
  mov    %edi,%ecx
  mov    -0x4(%rbp),%eax
  add    %ecx,%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  sub    %esi,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0x4(%rbp)
L5:
  mov    -0x24(%rbp),%eax
  mov    $0x1,%edx
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  cmp    %eax,-0x4(%rbp)
  jl     L13
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void test_phsubd_c(unsigned int *pDst, unsigned int *pSrc, int xmm) {
  int i;
  for (i = 0; i < (1 << xmm); i++)
    pDst[i] = pDst[i * 2] - pDst[i * 2 + 1];
  for (i = 0; i < (1 << xmm); i++)
    pDst[i + (1 << xmm)] = pSrc[i * 2] - pSrc[i * 2 + 1];
}
```
user: What is the c source code of the assembly code below?

```asm
<test_phsubd_c>:
  endbr64
  mov    $0x1,%r8d
  mov    %edx,%ecx
  shl    %cl,%r8d
  test   %r8d,%r8d
  jle    L0
  mov    %r8d,%ecx
  mov    $0x0,%eax
L28:
  mov    (%rdi,%rax,8),%edx
  sub    0x4(%rdi,%rax,8),%edx
  mov    %edx,(%rdi,%rax,4)
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L28
  movslq %r8d,%r8
  lea    (%rdi,%r8,4),%rdi
  mov    $0x0,%eax
L14:
  mov    (%rsi,%rax,8),%edx
  sub    0x4(%rsi,%rax,8),%edx
  mov    %edx,(%rdi,%rax,4)
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L14
L0:
  ret
```

assistant: ```c
void test_phsubd_c(unsigned int *pDst, unsigned int *pSrc, int xmm) {
  int i;
  for (i = 0; i < (1 << xmm); i++)
    pDst[i] = pDst[i * 2] - pDst[i * 2 + 1];
  for (i = 0; i < (1 << xmm); i++)
    pDst[i + (1 << xmm)] = pSrc[i * 2] - pSrc[i * 2 + 1];
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<test_phsubd_c>:
  endbr64
  mov    %edx,%ecx
  mov    $0x1,%eax
  shl    %cl,%eax
  movslq %eax,%rcx
  test   %ecx,%ecx
  jle    L0
  xor    %eax,%eax
  cs nopw 0x0(%rax,%rax,1)
L19:
  mov    (%rdi,%rax,8),%edx
  sub    0x4(%rdi,%rax,8),%edx
  mov    %edx,(%rdi,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%rcx
  jne    L19
  lea    (%rdi,%rcx,4),%rdi
  xor    %eax,%eax
  nopl   0x0(%rax)
L6:
  mov    (%rsi,%rax,8),%edx
  sub    0x4(%rsi,%rax,8),%edx
  mov    %edx,(%rdi,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%rcx
  jne    L6
L0:
  ret
```

assistant: ```c
void test_phsubd_c(unsigned int *pDst, unsigned int *pSrc, int xmm) {
  int i;
  for (i = 0; i < (1 << xmm); i++)
    pDst[i] = pDst[i * 2] - pDst[i * 2 + 1];
  for (i = 0; i < (1 << xmm); i++)
    pDst[i + (1 << xmm)] = pSrc[i * 2] - pSrc[i * 2 + 1];
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<test_phsubd_c>:
  endbr64
  mov    $0x1,%eax
  mov    %edx,%ecx
  shl    %cl,%eax
  test   %eax,%eax
  jle    L30
  mov    %eax,%edx
  lea    -0x1(%rax),%eax
  push   %rbx
  cmp    $0x2,%eax
  movslq %edx,%r11
  mov    %edx,%r9d
  seta   %bl
  lea    0x0(,%r11,8),%r10
  xor    %eax,%eax
L87:
  mov    (%rdi,%rax,8),%ecx
  sub    0x4(%rdi,%rax,8),%ecx
  mov    %ecx,(%rdi,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%r9
  jne    L87
  lea    (%rdi,%r11,8),%rax
  lea    (%rdi,%r11,4),%r8
  cmp    %rax,%rsi
  lea    (%rsi,%r10,1),%rax
  setae  %cl
  cmp    %rax,%r8
  setae  %al
  or     %al,%cl
  je     L12
  test   %bl,%bl
  je     L12
  mov    %edx,%ecx
  xor    %eax,%eax
  shr    $0x2,%ecx
  shl    $0x4,%rcx
  nopw   0x0(%rax,%rax,1)
L53:
  movdqu (%rsi,%rax,2),%xmm0
  movdqu 0x10(%rsi,%rax,2),%xmm2
  movdqa %xmm0,%xmm1
  shufps $0xdd,%xmm2,%xmm0
  shufps $0x88,%xmm2,%xmm1
  psubd  %xmm0,%xmm1
  movups %xmm1,(%r8,%rax,1)
  add    $0x10,%rax
  cmp    %rax,%rcx
  jne    L53
  mov    %edx,%eax
  and    $0xfffffffc,%eax
  test   $0x3,%dl
  je     L66
  lea    (%rax,%rax,1),%r8d
  lea    (%rdx,%rax,1),%ecx
  movslq %r8d,%r9
  movslq %ecx,%rcx
  mov    (%rsi,%r9,4),%r11d
  sub    0x4(%rsi,%r9,4),%r11d
  lea    0x0(,%r9,4),%r10
  mov    %r11d,(%rdi,%rcx,4)
  lea    0x1(%rax),%ecx
  cmp    %edx,%ecx
  jge    L66
  add    $0x3,%r8d
  add    %edx,%ecx
  mov    0x8(%rsi,%r10,1),%r11d
  add    $0x2,%eax
  movslq %r8d,%r8
  movslq %ecx,%rcx
  sub    (%rsi,%r8,4),%r11d
  mov    %r11d,(%rdi,%rcx,4)
  cmp    %eax,%edx
  jle    L66
  add    %eax,%edx
  mov    0x10(%rsi,%r10,1),%eax
  sub    0x14(%rsi,%r9,4),%eax
  movslq %edx,%rdx
  mov    %eax,(%rdi,%rdx,4)
L66:
  pop    %rbx
  ret
L12:
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L59:
  mov    (%rsi,%rax,8),%edx
  sub    0x4(%rsi,%rax,8),%edx
  mov    %edx,(%r8,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%r9
  jne    L59
  pop    %rbx
  ret
  xchg   %ax,%ax
L30:
  ret
```

assistant: ```c
void test_phsubd_c(unsigned int *pDst, unsigned int *pSrc, int xmm) {
  int i;
  for (i = 0; i < (1 << xmm); i++)
    pDst[i] = pDst[i * 2] - pDst[i * 2 + 1];
  for (i = 0; i < (1 << xmm); i++)
    pDst[i + (1 << xmm)] = pSrc[i * 2] - pSrc[i * 2 + 1];
}
```