ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<array_min>:
  endbr64
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rdx
  call   <find_array_min@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L0
  add    $0x18,%rsp
  ret
L0:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
float array_min(const float *array, int length) {
  int i;
  float min = find_array_min(array, length, &i);
  (void)i;
  return min;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<m50setParams4120>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %esi,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L2
  mov    $0x0,%eax
  call   <smb2c_irqEnable@plt>
  jmp    L14
L2:
  mov    $0x0,%eax
  call   <smb2c_irqDisable@plt>
L14:
  nop
  leave
  ret
```

assistant: ```c
void m50setParams4120(uint16_t addr, uint8_t val) {
  (void)addr;
  if (val & 1)
    smb2c_irqEnable();
  else
    smb2c_irqDisable();
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<m50setParams4120>:
  endbr64
  sub    $0x8,%rsp
  test   $0x1,%sil
  je     L13
  mov    $0x0,%eax
  call   <smb2c_irqEnable@plt>
L17:
  add    $0x8,%rsp
  ret
L13:
  mov    $0x0,%eax
  call   <smb2c_irqDisable@plt>
  jmp    L17
```

assistant: ```c
void m50setParams4120(uint16_t addr, uint8_t val) {
  (void)addr;
  if (val & 1)
    smb2c_irqEnable();
  else
    smb2c_irqDisable();
}
```
user: Translate the below assembly code into C programming language:

```asm
<m50setParams4120>:
  endbr64
  xor    %eax,%eax
  and    $0x1,%esi
  je     L7
  jmp    1070 <smb2c_irqEnable@plt>
L7:
  jmp    1060 <smb2c_irqDisable@plt>
```

assistant: ```c
void m50setParams4120(uint16_t addr, uint8_t val) {
  (void)addr;
  if (val & 1)
    smb2c_irqEnable();
  else
    smb2c_irqDisable();
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<m50setParams4120>:
  endbr64
  xor    %eax,%eax
  and    $0x1,%esi
  je     L1
  jmp    1070 <smb2c_irqEnable@plt>
L1:
  jmp    1060 <smb2c_irqDisable@plt>
```

assistant: ```c
void m50setParams4120(uint16_t addr, uint8_t val) {
  (void)addr;
  if (val & 1)
    smb2c_irqEnable();
  else
    smb2c_irqDisable();
}
```
user: What is the c source code of the assembly code below:

```asm
<core_get_int_length>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x4(%rbp)
  cmpl   $0x3b9ac9ff,-0x4(%rbp)
  jle    L107
  mov    $0xa,%eax
  jmp    L111
L107:
  cmpl   $0x5f5e0ff,-0x4(%rbp)
  jle    L176
  mov    $0x9,%eax
  jmp    L111
L176:
  cmpl   $0x98967f,-0x4(%rbp)
  jle    L51
  mov    $0x8,%eax
  jmp    L111
L51:
  cmpl   $0xf423f,-0x4(%rbp)
  jle    L119
  mov    $0x7,%eax
  jmp    L111
L119:
  cmpl   $0x1869f,-0x4(%rbp)
  jle    L98
  mov    $0x6,%eax
  jmp    L111
L98:
  cmpl   $0x270f,-0x4(%rbp)
  jle    L52
  mov    $0x5,%eax
  jmp    L111
L52:
  cmpl   $0x3e7,-0x4(%rbp)
  jle    L14
  mov    $0x4,%eax
  jmp    L111
L14:
  cmpl   $0x63,-0x4(%rbp)
  jle    L90
  mov    $0x3,%eax
  jmp    L111
L90:
  cmpl   $0x9,-0x4(%rbp)
  jle    L63
  mov    $0x2,%eax
  jmp    L111
L63:
  mov    $0x1,%eax
L111:
  pop    %rbp
  ret
```

assistant: ```c
size_t core_get_int_length(const int integer) {
  if (integer > 999999999) {
    return 10;
  } else if (integer > 99999999) {
    return 9;
  } else if (integer > 9999999) {
    return 8;
  } else if (integer > 999999) {
    return 7;
  } else if (integer > 99999) {
    return 6;
  } else if (integer > 9999) {
    return 5;
  } else if (integer > 999) {
    return 4;
  } else if (integer > 99) {
    return 3;
  } else if (integer > 9) {
    return 2;
  }
  return 1;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<core_get_int_length>:
  endbr64
  mov    $0xa,%eax
  cmp    $0x3b9ac9ff,%edi
  jg     L11
  mov    $0x9,%eax
  cmp    $0x5f5e0ff,%edi
  jg     L11
  mov    $0x8,%eax
  cmp    $0x98967f,%edi
  jg     L11
  mov    $0x7,%eax
  cmp    $0xf423f,%edi
  jg     L11
  mov    $0x6,%eax
  cmp    $0x1869f,%edi
  jg     L11
  mov    $0x5,%eax
  cmp    $0x270f,%edi
  jg     L11
  mov    $0x4,%eax
  cmp    $0x3e7,%edi
  jg     L11
  mov    $0x3,%eax
  cmp    $0x63,%edi
  jg     L11
  cmp    $0x9,%edi
  setg   %al
  movzbl %al,%eax
  add    $0x1,%rax
L11:
  ret
```

assistant: ```c
size_t core_get_int_length(const int integer) {
  if (integer > 999999999) {
    return 10;
  } else if (integer > 99999999) {
    return 9;
  } else if (integer > 9999999) {
    return 8;
  } else if (integer > 999999) {
    return 7;
  } else if (integer > 99999) {
    return 6;
  } else if (integer > 9999) {
    return 5;
  } else if (integer > 999) {
    return 4;
  } else if (integer > 99) {
    return 3;
  } else if (integer > 9) {
    return 2;
  }
  return 1;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<core_get_int_length>:
  endbr64
  mov    $0xa,%eax
  cmp    $0x3b9ac9ff,%edi
  jg     L1
  mov    $0x9,%eax
  cmp    $0x5f5e0ff,%edi
  jg     L1
  mov    $0x8,%eax
  cmp    $0x98967f,%edi
  jg     L1
  mov    $0x7,%eax
  cmp    $0xf423f,%edi
  jg     L1
  mov    $0x6,%eax
  cmp    $0x1869f,%edi
  jg     L1
  mov    $0x5,%eax
  cmp    $0x270f,%edi
  jg     L1
  mov    $0x4,%eax
  cmp    $0x3e7,%edi
  jg     L1
  mov    $0x3,%eax
  cmp    $0x63,%edi
  jg     L1
  xor    %eax,%eax
  cmp    $0x9,%edi
  setg   %al
  add    $0x1,%rax
L1:
  ret
```

assistant: ```c
size_t core_get_int_length(const int integer) {
  if (integer > 999999999) {
    return 10;
  } else if (integer > 99999999) {
    return 9;
  } else if (integer > 9999999) {
    return 8;
  } else if (integer > 999999) {
    return 7;
  } else if (integer > 99999) {
    return 6;
  } else if (integer > 9999) {
    return 5;
  } else if (integer > 999) {
    return 4;
  } else if (integer > 99) {
    return 3;
  } else if (integer > 9) {
    return 2;
  }
  return 1;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<core_get_int_length>:
  endbr64
  mov    $0xa,%eax
  cmp    $0x3b9ac9ff,%edi
  jg     L49
  mov    $0x9,%eax
  cmp    $0x5f5e0ff,%edi
  jg     L49
  mov    $0x8,%eax
  cmp    $0x98967f,%edi
  jg     L49
  mov    $0x7,%eax
  cmp    $0xf423f,%edi
  jg     L49
  mov    $0x6,%eax
  cmp    $0x1869f,%edi
  jg     L49
  mov    $0x5,%eax
  cmp    $0x270f,%edi
  jg     L49
  mov    $0x4,%eax
  cmp    $0x3e7,%edi
  jg     L49
  mov    $0x3,%eax
  cmp    $0x63,%edi
  jg     L49
  xor    %eax,%eax
  cmp    $0x9,%edi
  setg   %al
  add    $0x1,%rax
L49:
  ret
```

assistant: ```c
size_t core_get_int_length(const int integer) {
  if (integer > 999999999) {
    return 10;
  } else if (integer > 99999999) {
    return 9;
  } else if (integer > 9999999) {
    return 8;
  } else if (integer > 999999) {
    return 7;
  } else if (integer > 99999) {
    return 6;
  } else if (integer > 9999) {
    return 5;
  } else if (integer > 999) {
    return 4;
  } else if (integer > 99) {
    return 3;
  } else if (integer > 9) {
    return 2;
  }
  return 1;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    D7(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <puts@plt>
  mov    $0x0,%eax
  pop    %rbp
  ret
```

assistant: ```c
int main() {
  puts(OPENSSL_VERSION_TEXT);
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    D7(%rip),%rax
  mov    (%rax),%edi
  call   <puts@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main() {
  puts(OPENSSL_VERSION_TEXT);
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    D1(%rip),%rax
  mov    (%rax),%edi
  call   <puts@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main() {
  puts(OPENSSL_VERSION_TEXT);
  return 0;
}
```
user: What is the c source code of the assembly code below:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    D9(%rip),%rax
  mov    (%rax),%edi
  call   <puts@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main() {
  puts(OPENSSL_VERSION_TEXT);
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x68(%rbp)
L2:
  addl   $0x2,-0x68(%rbp)
  mov    -0x68(%rbp),%eax
  add    $0x2,%eax
  mov    %eax,-0x64(%rbp)
  mov    -0x64(%rbp),%eax
  cltq
  movl   $0x0,-0x60(%rbp,%rax,4)
  cmpl   $0x13,-0x68(%rbp)
  jg     L29
  jmp    L2
L29:
  mov    $0x1,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L27
  call   <__stack_chk_fail@plt>
L27:
  leave
  ret
```

assistant: ```c
int main() {
  int i, j = 0;
  int a[20];
L0 : {
  {
    j = j + 2;
    i = j + 2;
  }
  a[i] = 0;
  if (j < 20)
    goto L0;
}
  return 1;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  mov    $0x1,%eax
  ret
```

assistant: ```c
int main() {
  int i, j = 0;
  int a[20];
L0 : {
  {
    j = j + 2;
    i = j + 2;
  }
  a[i] = 0;
  if (j < 20)
    goto L0;
}
  return 1;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  mov    $0x1,%eax
  ret
```

assistant: ```c
int main() {
  int i, j = 0;
  int a[20];
L0 : {
  {
    j = j + 2;
    i = j + 2;
  }
  a[i] = 0;
  if (j < 20)
    goto L0;
}
  return 1;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<main>:
  endbr64
  mov    $0x1,%eax
  ret
```

assistant: ```c
int main() {
  int i, j = 0;
  int a[20];
L0 : {
  {
    j = j + 2;
    i = j + 2;
  }
  a[i] = 0;
  if (j < 20)
    goto L0;
}
  return 1;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<funge_stack_duplicate>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    $0x0,%eax
  call   <funge_thread_stack@plt>
  mov    %eax,%edx
  lea    -0x10(%rbp),%rax
  mov    %rax,%rsi
  mov    %edx,%edi
  call   <funge_stack_pop@plt>
  mov    %eax,-0xc(%rbp)
  mov    $0x0,%eax
  call   <funge_thread_stack@plt>
  mov    %eax,%edx
  lea    -0x10(%rbp),%rax
  mov    %rax,%rsi
  mov    %edx,%edi
  call   <funge_stack_push@plt>
  mov    %eax,-0xc(%rbp)
  mov    $0x0,%eax
  call   <funge_thread_stack@plt>
  mov    %eax,%edx
  lea    -0x10(%rbp),%rax
  mov    %rax,%rsi
  mov    %edx,%edi
  call   <funge_stack_push@plt>
  mov    %eax,-0xc(%rbp)
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L9
  call   <__stack_chk_fail@plt>
L9:
  leave
  ret
```

assistant: ```c
int32_t funge_stack_duplicate(int32_t funge_char __attribute__((unused))) {
  int32_t val;
  int32_t rc;
  rc = funge_stack_pop(funge_thread_stack(), &val);
  rc = funge_stack_push(funge_thread_stack(), &val);
  rc = funge_stack_push(funge_thread_stack(), &val);
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<funge_stack_duplicate>:
  endbr64
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <funge_thread_stack@plt>
  mov    %eax,%edi
  lea    0x4(%rsp),%rbx
  mov    %rbx,%rsi
  call   <funge_stack_pop@plt>
  mov    $0x0,%eax
  call   <funge_thread_stack@plt>
  mov    %eax,%edi
  mov    %rbx,%rsi
  call   <funge_stack_push@plt>
  mov    $0x0,%eax
  call   <funge_thread_stack@plt>
  mov    %eax,%edi
  mov    %rbx,%rsi
  call   <funge_stack_push@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L0
  mov    $0x0,%eax
  add    $0x10,%rsp
  pop    %rbx
  ret
L0:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int32_t funge_stack_duplicate(int32_t funge_char __attribute__((unused))) {
  int32_t val;
  int32_t rc;
  rc = funge_stack_pop(funge_thread_stack(), &val);
  rc = funge_stack_push(funge_thread_stack(), &val);
  rc = funge_stack_push(funge_thread_stack(), &val);
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<funge_stack_duplicate>:
  endbr64
  push   %rbp
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rbp
  call   <funge_thread_stack@plt>
  mov    %rbp,%rsi
  mov    %eax,%edi
  call   <funge_stack_pop@plt>
  xor    %eax,%eax
  call   <funge_thread_stack@plt>
  mov    %rbp,%rsi
  mov    %eax,%edi
  call   <funge_stack_push@plt>
  xor    %eax,%eax
  call   <funge_thread_stack@plt>
  mov    %rbp,%rsi
  mov    %eax,%edi
  call   <funge_stack_push@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L7
  add    $0x10,%rsp
  xor    %eax,%eax
  pop    %rbp
  ret
L7:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int32_t funge_stack_duplicate(int32_t funge_char __attribute__((unused))) {
  int32_t val;
  int32_t rc;
  rc = funge_stack_pop(funge_thread_stack(), &val);
  rc = funge_stack_push(funge_thread_stack(), &val);
  rc = funge_stack_push(funge_thread_stack(), &val);
  return 0;
}
```
user: What is the c source code of the assembly code below:

```asm
<funge_stack_duplicate>:
  endbr64
  push   %rbp
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rbp
  call   <funge_thread_stack@plt>
  mov    %rbp,%rsi
  mov    %eax,%edi
  call   <funge_stack_pop@plt>
  xor    %eax,%eax
  call   <funge_thread_stack@plt>
  mov    %rbp,%rsi
  mov    %eax,%edi
  call   <funge_stack_push@plt>
  xor    %eax,%eax
  call   <funge_thread_stack@plt>
  mov    %rbp,%rsi
  mov    %eax,%edi
  call   <funge_stack_push@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L8
  add    $0x10,%rsp
  xor    %eax,%eax
  pop    %rbp
  ret
L8:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int32_t funge_stack_duplicate(int32_t funge_char __attribute__((unused))) {
  int32_t val;
  int32_t rc;
  rc = funge_stack_pop(funge_thread_stack(), &val);
  rc = funge_stack_push(funge_thread_stack(), &val);
  rc = funge_stack_push(funge_thread_stack(), &val);
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<STR_BAND>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %esi,-0xc(%rbp)
  mov    %edx,%eax
  mov    %ax,-0x10(%rbp)
  cmpw   $0x0,-0x10(%rbp)
  jne    L3
  mov    $0x0,%eax
  jmp    L0
L3:
  movzwl -0x10(%rbp),%edx
  mov    -0xc(%rbp),%esi
  mov    -0x8(%rbp),%rax
  mov    %edx,%ecx
  lea    D9(%rip),%rdx
  mov    %rax,%rdi
  call   <snprintf@plt>
L0:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D9
datatype: string

tool: D9: band:%d 

assistant: ```c
int STR_BAND(char *p, int n, unsigned short band) {
  if (band == 0)
    return 0;
  return snprintf(p, n, "band:%d ", band);
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<STR_BAND>:
  endbr64
  mov    $0x0,%eax
  test   %dx,%dx
  jne    L9
  ret
L9:
  sub    $0x8,%rsp
  movzwl %dx,%ecx
  lea    D0(%rip),%rdx
  call   <snprintf@plt>
  add    $0x8,%rsp
  ret
```

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

tool: D0: band:%d 

assistant: ```c
int STR_BAND(char *p, int n, unsigned short band) {
  if (band == 0)
    return 0;
  return snprintf(p, n, "band:%d ", band);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<STR_BAND>:
  endbr64
  test   %dx,%dx
  jne    L3
  xor    %eax,%eax
  ret
  nopl   0x0(%rax)
L3:
  movzwl %dx,%ecx
  lea    D7(%rip),%rdx
  jmp    1050 <snprintf@plt>
```

tool_calls: name: read_data
arguments: data_label: D7
type: string

tool: D7: band:%d 

assistant: ```c
int STR_BAND(char *p, int n, unsigned short band) {
  if (band == 0)
    return 0;
  return snprintf(p, n, "band:%d ", band);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<STR_BAND>:
  endbr64
  test   %dx,%dx
  jne    L4
  xor    %eax,%eax
  ret
  nopl   0x0(%rax)
L4:
  movzwl %dx,%ecx
  lea    D9(%rip),%rdx
  jmp    1050 <snprintf@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D9
type_infered: string

tool: D9: band:%d 

assistant: ```c
int STR_BAND(char *p, int n, unsigned short band) {
  if (band == 0)
    return 0;
  return snprintf(p, n, "band:%d ", band);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<my_pthread_attr_getschedparam>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  cltq
  mov    %rax,-0x8(%rbp)
  mov    -0x20(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <pthread_attr_getschedparam@plt>
  leave
  ret
```

assistant: ```c
int my_pthread_attr_getschedparam(pthread_attr_t const *__attr, struct sched_param *param) {
  pthread_attr_t *realattr = (pthread_attr_t *)*(int *)__attr;
  return pthread_attr_getschedparam(realattr, param);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<my_pthread_attr_getschedparam>:
  endbr64
  sub    $0x8,%rsp
  movslq (%rdi),%rdi
  call   <pthread_attr_getschedparam@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
int my_pthread_attr_getschedparam(pthread_attr_t const *__attr, struct sched_param *param) {
  pthread_attr_t *realattr = (pthread_attr_t *)*(int *)__attr;
  return pthread_attr_getschedparam(realattr, param);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<my_pthread_attr_getschedparam>:
  endbr64
  movslq (%rdi),%rdi
  jmp    1050 <pthread_attr_getschedparam@plt>
```

assistant: ```c
int my_pthread_attr_getschedparam(pthread_attr_t const *__attr, struct sched_param *param) {
  pthread_attr_t *realattr = (pthread_attr_t *)*(int *)__attr;
  return pthread_attr_getschedparam(realattr, param);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<my_pthread_attr_getschedparam>:
  endbr64
  movslq (%rdi),%rdi
  jmp    1050 <pthread_attr_getschedparam@plt>
```

assistant: ```c
int my_pthread_attr_getschedparam(pthread_attr_t const *__attr, struct sched_param *param) {
  pthread_attr_t *realattr = (pthread_attr_t *)*(int *)__attr;
  return pthread_attr_getschedparam(realattr, param);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<unicode_read_utf7>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%r12
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  call   <assert@plt>
  mov    %r12,%rdi
  call   <assert@plt>
  movzbl 0x0(%rbp),%eax
  cmp    $0x1f,%al
  setle  %cl
  cmp    $0xa,%al
  setne  %dl
  test   %dl,%cl
  je     L87
  mov    $0x0,%r13d
  cmp    $0xd,%al
  jne    L5
L87:
  cmp    $0x2b,%al
  je     L123
  mov    %al,(%r12)
  mov    $0x1,%r13d
L5:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L117
  mov    %r13d,%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L68:
  add    $0x1,%rbx
L84:
  movsbl 0x0(%rbp,%rbx,1),%edi
  call   <base64_is_valid_char@plt>
  test   %rax,%rax
  jne    L68
  cmp    $0x1,%rbx
  jne    L54
  mov    $0x0,%r13d
  cmpb   $0x2d,0x1(%rbp)
  jne    L5
  movb   $0x2b,(%r12)
  mov    $0x2,%r13d
  jmp    L5
L123:
  mov    $0x1,%ebx
  jmp    L84
L54:
  add    $0x1,%rbp
  lea    -0x1(%rbx),%esi
  mov    %rbp,%rdi
  call   <base64_is_well_formed_up_to@plt>
  mov    %eax,%r13d
  test   %eax,%eax
  je     L5
  lea    0x8(%rsp),%rdx
  lea    -0x1(%rbx),%rsi
  mov    %rbp,%rdi
  call   <base64_decode_up_to@plt>
  mov    %rax,%rbp
  mov    0x8(%rsp),%rsi
  mov    %rax,%rdi
  call   <unicode_is_well_formed_utf16be@plt>
  mov    %eax,%r13d
  test   %eax,%eax
  jne    L127
  mov    %rbp,%rdi
  call   <free@plt>
  jmp    L5
L127:
  lea    0x10(%rsp),%rdx
  mov    0x8(%rsp),%rsi
  mov    %rbp,%rdi
  call   <unicode_read_string_utf16be@plt>
  mov    %rax,%r13
  mov    %rbp,%rdi
  call   <free@plt>
  cmpq   $0x1,0x10(%rsp)
  jne    L15
L112:
  movzbl 0x0(%r13),%eax
  mov    %al,(%r12)
  mov    %r13,%rdi
  call   <free@plt>
  lea    -0x1(%rbx),%r13d
  jmp    L5
L15:
  mov    %r13,%rdi
  call   <free@plt>
  jmp    L112
L117:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int unicode_read_utf7(char *string, uint32_t *code_point) {
  assert(string);
  assert(code_point);
  size_t k, data_length, utf16_data_length;
  char *data;
  uint32_t *utf16_data;
  if ((string[0] < 0x20 && string[0] != '\n' && string[0] != '\r') || string[0] > 0x7F)
    return 0;
  else if (string[0] == '+') {
    for (k = 1; base64_is_valid_char(string[k]); k++) {
    }
    if (k == 1) {
      if (string[1] == '-') {
        code_point[0] = (uint32_t)'+';
        return 2;
      } else
        return 0;
    }
    if (!base64_is_well_formed_up_to(&string[1], (unsigned int)k - 1))
      return 0;
    data = (char *)base64_decode_up_to(&string[1], k - 1, &data_length);
    if (!unicode_is_well_formed_utf16be((char *)data, data_length)) {
      free(data);
      return 0;
    }
    utf16_data = unicode_read_string_utf16be((char *)data, data_length, &utf16_data_length);
    free(data);
    if (utf16_data_length != 1)
      free(utf16_data);
    code_point[0] = utf16_data[0];
    free(utf16_data);
    return (int)k - 1;
  } else {
    code_point[0] = (uint32_t)string[0];
    return 1;
  }
}
```