ylfeng/ReF-Decompile-dataset huggingface dataset:
user: What is the c source code of the assembly code below:

```asm
<int_ripples>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  movdqa D8(%rip),%xmm0
  mov    %esi,0x14(%rsp)
  lea    0x20(%rsp),%rcx
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    0x0(,%rdi,4),%eax
  movl   $0x0,0xc(%rsp)
  mov    %eax,0x10(%rsp)
  mov    %rcx,0x18(%rsp)
  movaps %xmm0,0x20(%rsp)
  test   %eax,%eax
  jle    L34
  nopl   0x0(%rax,%rax,1)
L43:
  xor    %edi,%edi
  call   <fill@plt>
  movzbl 0xc(%rsp),%eax
  mov    0x18(%rsp),%r12
  movq   $0x0,(%rsp)
  mov    $0x31,%edi
  mov    %al,0xb(%rsp)
L49:
  mov    (%rsp),%rax
  mov    $0x7,%ebx
  xor    %r15d,%r15d
  mov    %eax,%ebp
  sub    %eax,%ebx
L56:
  add    0xb(%rsp),%dil
  mov    $0x7,%r14d
  movzbl %dil,%edi
  sub    %r15d,%r14d
  call   <totty_sin@plt>
  mov    %r15d,%esi
  mov    %ebp,%edi
  add    $0xc4,%eax
  movslq %eax,%r13
  sar    $0x1f,%eax
  imul   $0x5397829d,%r13,%r13
  sar    $0x24,%r13
  sub    %eax,%r13d
  movzbl %r13b,%r13d
  mov    %r13d,%edx
  call   <setvoxel@plt>
  mov    %r15d,%esi
  mov    %r13d,%edx
  mov    %ebx,%edi
  call   <setvoxel@plt>
  mov    %r13d,%edx
  mov    %r14d,%esi
  mov    %ebp,%edi
  call   <setvoxel@plt>
  add    $0x1,%r15
  mov    %r13d,%edx
  mov    %r14d,%esi
  mov    %ebx,%edi
  call   <setvoxel@plt>
  cmp    $0x4,%r15
  je     L1
  movzbl (%r12,%r15,4),%edi
  jmp    L56
  nopl   0x0(%rax,%rax,1)
L1:
  addq   $0x1,(%rsp)
  mov    (%rsp),%rax
  add    $0x1,%r12
  cmp    $0x4,%rax
  je     L10
  movzbl (%r12),%edi
  jmp    L49
  nopl   (%rax)
L10:
  mov    0x14(%rsp),%edi
  call   <delay_ms@plt>
  addl   $0x4,0xc(%rsp)
  mov    0xc(%rsp),%eax
  cmp    %eax,0x10(%rsp)
  jg     L43
L34:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L42
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L42:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D8
datatype: byte[16]

tool: {"D8": [0x31,0x2b,0x26,0x23,0x2b,0x23,0x1d,0x1a,0x26,0x1d,0x15,0x10,0x23,0x19,0x10,0x07]}

assistant: ```c
void int_ripples(int iterations, int delay) {
  unsigned char sqrt_LUT[] = {49, 43, 38, 35, 43, 35, 29, 26, 38, 29, 21, 16, 35, 25, 16, 7};
  unsigned char x, y, height, distance;
  int i;
  for (i = 0; i < iterations * 4; i += 4) {
    fill(0x00);
    for (x = 0; x < 4; x++)
      for (y = 0; y < 4; y++) {
        distance = sqrt_LUT[x + y * 4];
        height = (196 + totty_sin(distance + i)) / 49;
        setvoxel(x, y, height);
        setvoxel(7 - x, y, height);
        setvoxel(x, 7 - y, height);
        setvoxel(7 - x, 7 - y, height);
      }
    delay_ms(delay);
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<int_ripples>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  movdqa D0(%rip),%xmm0
  mov    %esi,0x14(%rsp)
  lea    0x20(%rsp),%rcx
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    0x0(,%rdi,4),%eax
  movl   $0x0,0xc(%rsp)
  mov    %eax,0x10(%rsp)
  mov    %rcx,0x18(%rsp)
  movaps %xmm0,0x20(%rsp)
  test   %eax,%eax
  jle    L38
  nopl   0x0(%rax,%rax,1)
L43:
  xor    %edi,%edi
  xor    %ebx,%ebx
  call   <fill@plt>
  movzbl 0xc(%rsp),%eax
  mov    0x18(%rsp),%r12
  mov    %al,0xb(%rsp)
L42:
  mov    $0x7,%ebp
  xor    %r15d,%r15d
  sub    %ebx,%ebp
L3:
  movzbl 0xb(%rsp),%edi
  add    (%r12,%r15,4),%dil
  mov    $0x7,%r13d
  movzbl %dil,%edi
  sub    %r15d,%r13d
  call   <totty_sin@plt>
  mov    %r15d,%esi
  mov    %ebx,%edi
  add    $0xc4,%eax
  movslq %eax,%rdx
  sar    $0x1f,%eax
  imul   $0x5397829d,%rdx,%rdx
  sar    $0x24,%rdx
  sub    %eax,%edx
  movzbl %dl,%r14d
  mov    %r14d,%edx
  call   <setvoxel@plt>
  mov    %r15d,%esi
  mov    %r14d,%edx
  mov    %ebp,%edi
  call   <setvoxel@plt>
  mov    %r14d,%edx
  mov    %r13d,%esi
  mov    %ebx,%edi
  call   <setvoxel@plt>
  add    $0x1,%r15
  mov    %r14d,%edx
  mov    %r13d,%esi
  mov    %ebp,%edi
  call   <setvoxel@plt>
  cmp    $0x4,%r15
  jne    L3
  add    $0x1,%ebx
  add    $0x1,%r12
  cmp    $0x4,%ebx
  jne    L42
  mov    0x14(%rsp),%edi
  call   <delay_ms@plt>
  addl   $0x4,0xc(%rsp)
  mov    0xc(%rsp),%eax
  cmp    %eax,0x10(%rsp)
  jg     L43
L38:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L15
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L15:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D0
type_infered: byte[16]

tool: {"D0": [0x31,0x2b,0x26,0x23,0x2b,0x23,0x1d,0x1a,0x26,0x1d,0x15,0x10,0x23,0x19,0x10,0x07]}

assistant: ```c
void int_ripples(int iterations, int delay) {
  unsigned char sqrt_LUT[] = {49, 43, 38, 35, 43, 35, 29, 26, 38, 29, 21, 16, 35, 25, 16, 7};
  unsigned char x, y, height, distance;
  int i;
  for (i = 0; i < iterations * 4; i += 4) {
    fill(0x00);
    for (x = 0; x < 4; x++)
      for (y = 0; y < 4; y++) {
        distance = sqrt_LUT[x + y * 4];
        height = (196 + totty_sin(distance + i)) / 49;
        setvoxel(x, y, height);
        setvoxel(7 - x, y, height);
        setvoxel(x, 7 - y, height);
        setvoxel(7 - x, 7 - y, height);
      }
    delay_ms(delay);
  }
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<TestHashes>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  movl   $0x1,-0x8(%rbp)
  mov    $0x0,%eax
  call   <TestMd5@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  jne    L86
  movl   $0x0,-0x8(%rbp)
L86:
  cmpl   $0x0,-0x4(%rbp)
  je     L31
  lea    D119(%rip),%rax
  jmp    L112
L31:
  lea    D116(%rip),%rax
L112:
  mov    %rax,%rsi
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  call   <TestSha1@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  jne    L88
  movl   $0x0,-0x8(%rbp)
L88:
  cmpl   $0x0,-0x4(%rbp)
  je     L69
  lea    D119(%rip),%rax
  jmp    L101
L69:
  lea    D116(%rip),%rax
L101:
  mov    %rax,%rsi
  lea    D20(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  call   <TestSha256@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  jne    L28
  movl   $0x0,-0x8(%rbp)
L28:
  cmpl   $0x0,-0x4(%rbp)
  je     L40
  lea    D119(%rip),%rax
  jmp    L91
L40:
  lea    D116(%rip),%rax
L91:
  mov    %rax,%rsi
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  call   <TestSha512@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  jne    L48
  movl   $0x0,-0x8(%rbp)
L48:
  cmpl   $0x0,-0x4(%rbp)
  je     L119
  lea    D119(%rip),%rax
  jmp    L90
L119:
  lea    D116(%rip),%rax
L90:
  mov    %rax,%rsi
  lea    D26(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x8(%rbp),%eax
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D119
datatype: string
name: parse_data
arguments: label: D116
datatype: string
name: parse_data
arguments: label: D2
datatype: string
name: parse_data
arguments: label: D20
datatype: string
name: parse_data
arguments: label: D13
datatype: string
name: parse_data
arguments: label: D26
datatype: string

tool: D119: Pass

tool: D116: Fail

tool: D2: Test MD5     - %s


tool: D20: Test SHA1    - %s


tool: D13: Test SHA256  - %s


tool: D26: Test SHA512  - %s


assistant: ```c
bool TestHashes(void) {
  bool success;
  bool allSuccess = true;
  success = TestMd5();
  if (!success) {
    allSuccess = false;
  }
  printf("Test MD5     - %s\n", success ? "Pass" : "Fail");
  success = TestSha1();
  if (!success) {
    allSuccess = false;
  }
  printf("Test SHA1    - %s\n", success ? "Pass" : "Fail");
  success = TestSha256();
  if (!success) {
    allSuccess = false;
  }
  printf("Test SHA256  - %s\n", success ? "Pass" : "Fail");
  success = TestSha512();
  if (!success) {
    allSuccess = false;
  }
  printf("Test SHA512  - %s\n", success ? "Pass" : "Fail");
  return allSuccess;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<TestHashes>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    $0x0,%eax
  call   <TestMd5@plt>
  mov    %eax,%ebx
  test   %eax,%eax
  lea    D76(%rip),%rsi
  lea    D65(%rip),%rax
  cmove  %rax,%rsi
  lea    D89(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  call   <TestSha1@plt>
  mov    %eax,%ebp
  lea    D65(%rip),%rsi
  test   %eax,%eax
  je     L17
  test   %ebx,%ebx
  setne  %bpl
  movzbl %bpl,%ebp
  lea    D76(%rip),%rsi
L17:
  lea    D49(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  call   <TestSha256@plt>
  mov    %eax,%ebx
  lea    D65(%rip),%rsi
  test   %eax,%eax
  je     L10
  mov    %ebp,%ebx
  lea    D76(%rip),%rsi
L10:
  lea    D96(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  call   <TestSha512@plt>
  test   %eax,%eax
  cmove  %eax,%ebx
  lea    D76(%rip),%rsi
  lea    D65(%rip),%rax
  cmove  %rax,%rsi
  lea    D10(%rip),%rdi
  call   <printf@plt>
  mov    %ebx,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

tool_calls: name: parse_data
arguments: tag: D76
type: string
name: parse_data
arguments: tag: D65
type: string
name: parse_data
arguments: tag: D89
type: string
name: parse_data
arguments: tag: D49
type: string
name: parse_data
arguments: tag: D96
type: string
name: parse_data
arguments: tag: D10
type: string

tool: D76: Pass

tool: D65: Fail

tool: D89: Test MD5     - %s


tool: D49: Test SHA1    - %s


tool: D96: Test SHA256  - %s


tool: D10: Test SHA512  - %s


assistant: ```c
bool TestHashes(void) {
  bool success;
  bool allSuccess = true;
  success = TestMd5();
  if (!success) {
    allSuccess = false;
  }
  printf("Test MD5     - %s\n", success ? "Pass" : "Fail");
  success = TestSha1();
  if (!success) {
    allSuccess = false;
  }
  printf("Test SHA1    - %s\n", success ? "Pass" : "Fail");
  success = TestSha256();
  if (!success) {
    allSuccess = false;
  }
  printf("Test SHA256  - %s\n", success ? "Pass" : "Fail");
  success = TestSha512();
  if (!success) {
    allSuccess = false;
  }
  printf("Test SHA512  - %s\n", success ? "Pass" : "Fail");
  return allSuccess;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<TestHashes>:
  endbr64
  push   %r13
  xor    %eax,%eax
  push   %r12
  push   %rbp
  push   %rbx
  mov    $0x1,%ebx
  sub    $0x8,%rsp
  call   <TestMd5@plt>
  lea    D34(%rip),%rsi
  test   %eax,%eax
  jne    L4
  mov    %eax,%ebx
  lea    D47(%rip),%rsi
L4:
  lea    D49(%rip),%rdi
  lea    D47(%rip),%rbp
  xor    %r12d,%r12d
  call   <printf@plt>
  xor    %eax,%eax
  lea    D34(%rip),%r13
  call   <TestSha1@plt>
  mov    %rbp,%rsi
  lea    D2(%rip),%rdi
  test   %eax,%eax
  cmovne %r13,%rsi
  cmove  %r12d,%ebx
  call   <printf@plt>
  xor    %eax,%eax
  call   <TestSha256@plt>
  mov    %rbp,%rsi
  lea    D10(%rip),%rdi
  test   %eax,%eax
  cmovne %r13,%rsi
  cmove  %r12d,%ebx
  call   <printf@plt>
  xor    %eax,%eax
  call   <TestSha512@plt>
  mov    %rbp,%rsi
  mov    %eax,%r12d
  test   %eax,%eax
  je     L5
  mov    %ebx,%r12d
  mov    %r13,%rsi
L5:
  lea    D67(%rip),%rdi
  call   <printf@plt>
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: read_data
arguments: label: D34
type: string
name: read_data
arguments: label: D47
type: string
name: read_data
arguments: label: D49
type: string
name: read_data
arguments: label: D2
type: string
name: read_data
arguments: label: D10
type: string
name: read_data
arguments: label: D67
type: string

tool: D34: Pass

tool: D47: Fail

tool: D49: Test MD5     - %s


tool: D2: Test SHA1    - %s


tool: D10: Test SHA256  - %s


tool: D67: Test SHA512  - %s


assistant: ```c
bool TestHashes(void) {
  bool success;
  bool allSuccess = true;
  success = TestMd5();
  if (!success) {
    allSuccess = false;
  }
  printf("Test MD5     - %s\n", success ? "Pass" : "Fail");
  success = TestSha1();
  if (!success) {
    allSuccess = false;
  }
  printf("Test SHA1    - %s\n", success ? "Pass" : "Fail");
  success = TestSha256();
  if (!success) {
    allSuccess = false;
  }
  printf("Test SHA256  - %s\n", success ? "Pass" : "Fail");
  success = TestSha512();
  if (!success) {
    allSuccess = false;
  }
  printf("Test SHA512  - %s\n", success ? "Pass" : "Fail");
  return allSuccess;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<TestHashes>:
  endbr64
  push   %r13
  xor    %eax,%eax
  push   %r12
  push   %rbp
  push   %rbx
  mov    $0x1,%ebx
  sub    $0x8,%rsp
  call   <TestMd5@plt>
  lea    D24(%rip),%rsi
  test   %eax,%eax
  jne    L12
  mov    %eax,%ebx
  lea    D61(%rip),%rsi
L12:
  lea    D34(%rip),%rdi
  lea    D61(%rip),%rbp
  xor    %r12d,%r12d
  call   <printf@plt>
  xor    %eax,%eax
  lea    D24(%rip),%r13
  call   <TestSha1@plt>
  mov    %rbp,%rsi
  lea    D38(%rip),%rdi
  test   %eax,%eax
  cmovne %r13,%rsi
  cmove  %r12d,%ebx
  call   <printf@plt>
  xor    %eax,%eax
  call   <TestSha256@plt>
  mov    %rbp,%rsi
  lea    D67(%rip),%rdi
  test   %eax,%eax
  cmovne %r13,%rsi
  cmove  %r12d,%ebx
  call   <printf@plt>
  xor    %eax,%eax
  call   <TestSha512@plt>
  mov    %rbp,%rsi
  mov    %eax,%r12d
  test   %eax,%eax
  je     L16
  mov    %ebx,%r12d
  mov    %r13,%rsi
L16:
  lea    D1(%rip),%rdi
  call   <printf@plt>
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D24
datatype: string
name: extract_symbolic_data
arguments: label: D61
datatype: string
name: extract_symbolic_data
arguments: label: D34
datatype: string
name: extract_symbolic_data
arguments: label: D38
datatype: string
name: extract_symbolic_data
arguments: label: D67
datatype: string
name: extract_symbolic_data
arguments: label: D1
datatype: string

tool: D24: Pass

tool: D61: Fail

tool: D34: Test MD5     - %s


tool: D38: Test SHA1    - %s


tool: D67: Test SHA256  - %s


tool: D1: Test SHA512  - %s


assistant: ```c
bool TestHashes(void) {
  bool success;
  bool allSuccess = true;
  success = TestMd5();
  if (!success) {
    allSuccess = false;
  }
  printf("Test MD5     - %s\n", success ? "Pass" : "Fail");
  success = TestSha1();
  if (!success) {
    allSuccess = false;
  }
  printf("Test SHA1    - %s\n", success ? "Pass" : "Fail");
  success = TestSha256();
  if (!success) {
    allSuccess = false;
  }
  printf("Test SHA256  - %s\n", success ? "Pass" : "Fail");
  success = TestSha512();
  if (!success) {
    allSuccess = false;
  }
  printf("Test SHA512  - %s\n", success ? "Pass" : "Fail");
  return allSuccess;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<subStrleng>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,%eax
  mov    %al,-0x1c(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L13
L11:
  addl   $0x1,-0x4(%rbp)
L13:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    %al,-0x1c(%rbp)
  je     L2
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L11
L2:
  mov    -0x4(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int subStrleng(const char *s, const char c) {
  int i = 0;
  while (*(s + i) != c && *(s + i) != 0) {
    i++;
  }
  return i;
}
```
user: What is the c source code of the assembly code below:

```asm
<subStrleng>:
  endbr64
  mov    %esi,%r8d
  movzbl (%rdi),%eax
  test   %al,%al
  je     L15
  cmp    %sil,%al
  je     L15
  mov    $0x1,%eax
L43:
  mov    %eax,%ecx
  movzbl (%rdi,%rax,1),%edx
  add    $0x1,%rax
  test   %dl,%dl
  je     L36
  cmp    %r8b,%dl
  jne    L43
L36:
  mov    %ecx,%eax
  ret
L15:
  mov    $0x0,%ecx
  jmp    L36
```

assistant: ```c
int subStrleng(const char *s, const char c) {
  int i = 0;
  while (*(s + i) != c && *(s + i) != 0) {
    i++;
  }
  return i;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<subStrleng>:
  endbr64
  movzbl (%rdi),%eax
  mov    %esi,%ecx
  test   %al,%al
  je     L24
  cmp    %sil,%al
  je     L24
  mov    $0x1,%eax
  jmp    L30
  nopl   0x0(%rax)
L25:
  cmp    %cl,%dl
  je     L20
L30:
  movzbl (%rdi,%rax,1),%edx
  mov    %eax,%r8d
  add    $0x1,%rax
  test   %dl,%dl
  jne    L25
L20:
  mov    %r8d,%eax
  ret
  nopw   0x0(%rax,%rax,1)
L24:
  xor    %r8d,%r8d
  mov    %r8d,%eax
  ret
```

assistant: ```c
int subStrleng(const char *s, const char c) {
  int i = 0;
  while (*(s + i) != c && *(s + i) != 0) {
    i++;
  }
  return i;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<subStrleng>:
  endbr64
  movzbl (%rdi),%eax
  mov    %esi,%ecx
  test   %al,%al
  je     L18
  cmp    %sil,%al
  je     L18
  mov    $0x1,%eax
  jmp    L16
  nopl   0x0(%rax)
L25:
  cmp    %cl,%dl
  je     L21
L16:
  movzbl (%rdi,%rax,1),%edx
  mov    %eax,%r8d
  add    $0x1,%rax
  test   %dl,%dl
  jne    L25
L21:
  mov    %r8d,%eax
  ret
  nopw   0x0(%rax,%rax,1)
L18:
  xor    %r8d,%r8d
  mov    %r8d,%eax
  ret
```

assistant: ```c
int subStrleng(const char *s, const char c) {
  int i = 0;
  while (*(s + i) != c && *(s + i) != 0) {
    i++;
  }
  return i;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<set_default_priority>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x10(%rbp),%rax
  mov    $0x8,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  movq   $0x0,-0x10(%rbp)
  mov    D2(%rip),%rax
  mov    (%rax),%eax
  lea    -0x10(%rbp),%rdx
  mov    %eax,%esi
  mov    $0x0,%edi
  call   <sched_setscheduler@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L5
  call   <__stack_chk_fail@plt>
L5:
  leave
  ret
```

assistant: ```c
void set_default_priority(void) {
  struct sched_param sched;
  memset(&sched, 0, sizeof(sched));
  sched.sched_priority = 0;
  sched_setscheduler(0, SCHED_OTHER, &sched);
}
```
user: What is the c source code of the assembly code below:

```asm
<set_default_priority>:
  endbr64
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbx
  mov    $0x8,%edx
  mov    $0x0,%esi
  mov    %rbx,%rdi
  call   <memset@plt>
  movq   $0x0,(%rsp)
  mov    %rbx,%rdx
  mov    D0(%rip),%rax
  mov    (%rax),%esi
  mov    $0x0,%edi
  call   <sched_setscheduler@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L0
  add    $0x10,%rsp
  pop    %rbx
  ret
L0:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void set_default_priority(void) {
  struct sched_param sched;
  memset(&sched, 0, sizeof(sched));
  sched.sched_priority = 0;
  sched_setscheduler(0, SCHED_OTHER, &sched);
}
```
user: Translate the below assembly code into C programming language:

```asm
<set_default_priority>:
  endbr64
  push   %r12
  xor    %esi,%esi
  mov    $0x8,%edx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r12
  mov    %r12,%rdi
  call   <memset@plt>
  mov    D3(%rip),%rax
  xor    %edi,%edi
  mov    %r12,%rdx
  movq   $0x0,(%rsp)
  mov    (%rax),%esi
  call   <sched_setscheduler@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L6
  add    $0x10,%rsp
  pop    %r12
  ret
L6:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void set_default_priority(void) {
  struct sched_param sched;
  memset(&sched, 0, sizeof(sched));
  sched.sched_priority = 0;
  sched_setscheduler(0, SCHED_OTHER, &sched);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<set_default_priority>:
  endbr64
  push   %r12
  xor    %esi,%esi
  mov    $0x8,%edx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r12
  mov    %r12,%rdi
  call   <memset@plt>
  mov    D6(%rip),%rax
  xor    %edi,%edi
  mov    %r12,%rdx
  movq   $0x0,(%rsp)
  mov    (%rax),%esi
  call   <sched_setscheduler@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  add    $0x10,%rsp
  pop    %r12
  ret
L5:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void set_default_priority(void) {
  struct sched_param sched;
  memset(&sched, 0, sizeof(sched));
  sched.sched_priority = 0;
  sched_setscheduler(0, SCHED_OTHER, &sched);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<is_photoframe>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movabs $0x58494e4f52544953,%rax
  mov    %rax,-0x17(%rbp)
  movl   $0x524f4320,-0xf(%rbp)
  movw   $0x2e50,-0xb(%rbp)
  movb   $0x0,-0x9(%rbp)
  mov    $0x200,%edi
  call   <malloc_aligned@plt>
  mov    %rax,-0x20(%rbp)
  mov    D2(%rip),%rax
  mov    (%rax),%edx
  mov    -0x34(%rbp),%eax
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <lseek@plt>
  mov    -0x20(%rbp),%rcx
  mov    -0x34(%rbp),%eax
  mov    $0x200,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <read@plt>
  mov    %eax,-0x28(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0xf,%rax
  movb   $0x0,(%rax)
  lea    -0x17(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  sete   %al
  movzbl %al,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x20(%rbp),%rax
  mov    $0x200,%esi
  mov    %rax,%rdi
  call   <free_aligned@plt>
  mov    -0x24(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L8
  call   <__stack_chk_fail@plt>
L8:
  leave
  ret
```

assistant: ```c
int is_photoframe(int f) {
  int y, res;
  char id[] = "SITRONIX CORP.";
  char *buff;
  buff = malloc_aligned(0x200);
  lseek(f, 0x0, SEEK_SET);
  y = read(f, buff, 0x200);
  buff[15] = 0;
  res = strcmp(buff, id) == 0 ? 1 : 0;
  free_aligned(buff, 0x200);
  return res;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<is_photoframe>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %edi,%ebp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  movabs $0x58494e4f52544953,%rax
  mov    %rax,0x9(%rsp)
  movl   $0x524f4320,0x11(%rsp)
  movw   $0x2e50,0x15(%rsp)
  movb   $0x0,0x17(%rsp)
  mov    $0x200,%edi
  call   <malloc_aligned@plt>
  mov    %rax,%rbx
  mov    D4(%rip),%rax
  mov    (%rax),%edx
  mov    $0x0,%esi
  mov    %ebp,%edi
  call   <lseek@plt>
  mov    $0x200,%edx
  mov    %rbx,%rsi
  mov    %ebp,%edi
  call   <read@plt>
  movb   $0x0,0xf(%rbx)
  lea    0x9(%rsp),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %rax,%rbp
  mov    $0x200,%esi
  mov    %rbx,%rdi
  call   <free_aligned@plt>
  test   %rbp,%rbp
  sete   %al
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L3
  movzbl %al,%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  ret
L3:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int is_photoframe(int f) {
  int y, res;
  char id[] = "SITRONIX CORP.";
  char *buff;
  buff = malloc_aligned(0x200);
  lseek(f, 0x0, SEEK_SET);
  y = read(f, buff, 0x200);
  buff[15] = 0;
  res = strcmp(buff, id) == 0 ? 1 : 0;
  free_aligned(buff, 0x200);
  return res;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<is_photoframe>:
  endbr64
  push   %r12
  mov    %edi,%r12d
  mov    $0x200,%edi
  push   %rbp
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  movabs $0x58494e4f52544953,%rax
  movl   $0x524f4320,0x11(%rsp)
  movb   $0x0,0x17(%rsp)
  mov    %rax,0x9(%rsp)
  mov    $0x2e50,%eax
  mov    %ax,0x15(%rsp)
  call   <malloc_aligned@plt>
  xor    %esi,%esi
  mov    %r12d,%edi
  mov    %rax,%rbp
  mov    D0(%rip),%rax
  mov    (%rax),%edx
  call   <lseek@plt>
  mov    $0x200,%edx
  mov    %r12d,%edi
  mov    %rbp,%rsi
  call   <read@plt>
  movb   $0x0,0xf(%rbp)
  lea    0x9(%rsp),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  mov    $0x200,%esi
  mov    %rbp,%rdi
  mov    %rax,%r12
  call   <free_aligned@plt>
  test   %r12,%r12
  sete   %al
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L3
  add    $0x28,%rsp
  movzbl %al,%eax
  pop    %rbp
  pop    %r12
  ret
L3:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int is_photoframe(int f) {
  int y, res;
  char id[] = "SITRONIX CORP.";
  char *buff;
  buff = malloc_aligned(0x200);
  lseek(f, 0x0, SEEK_SET);
  y = read(f, buff, 0x200);
  buff[15] = 0;
  res = strcmp(buff, id) == 0 ? 1 : 0;
  free_aligned(buff, 0x200);
  return res;
}
```