ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请从给定的汇编指令推导出C源代码:

```asm
<aeron_format_number_next>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rcx,%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  sub    $0x8,%rsp
  cmp    $0x3e7,%rdi
  jbe    L27
  cmp    $0xfffffffffffffc19,%rdi
  jb     L10
  mov    %rcx,%rsi
  mov    $0x5,%edi
L19:
  call   <aeron_format_min@plt>
  add    $0x8,%rsp
  mov    %r12,%rcx
  mov    %rbp,%rdi
  pop    %rbx
  mov    %eax,%esi
  pop    %rbp
  xor    %eax,%eax
  pop    %r12
  lea    D17(%rip),%rdx
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1070 <snprintf@plt>
  nopw   0x0(%rax,%rax,1)
L10:
  movabs $0x20c49ba5e353f7cf,%rdx
  mov    %rdi,%rax
  mov    %rsi,%r15
  imul   %rdx
  mov    %rdi,%rax
  sar    $0x3f,%rax
  sar    $0x7,%rdx
  mov    %rdx,%rbx
  mov    %rbp,%rdx
  sub    %rax,%rbx
  mov    %rbx,%rdi
  imul   $0x3e8,%rbx,%rbx
  call   <aeron_format_number_next>
  mov    %r12,%rdi
  mov    %rax,%r14
  sub    %rbx,%rdi
  call   <llabs@plt>
  mov    %r13,%rsi
  mov    $0x5,%edi
  sub    %r14,%rsi
  mov    %eax,%ebx
  call   <aeron_format_min@plt>
  lea    0x0(%rbp,%r14,1),%rdi
  mov    %ebx,%r8d
  mov    %r15,%rcx
  mov    %eax,%esi
  lea    D1(%rip),%rdx
  xor    %eax,%eax
  call   <snprintf@plt>
  add    $0x8,%rsp
  pop    %rbx
  add    %r14,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L27:
  mov    %rcx,%rsi
  mov    $0x4,%edi
  jmp    L19
```

tool_calls: name: disassemble_data
arguments: label: D17
type: string
name: disassemble_data
arguments: label: D1
type: string

tool: D17: %lld

tool: D1: %s%03lld

assistant: ```c
size_t aeron_format_number_next(long long value, const char *sep, char *buffer, size_t buffer_len) {
  if (0 <= value && value < 1000) {
    return snprintf(buffer, aeron_format_min(4, buffer_len), "%lld", value);
  } else if (-1000 < value && value < 0) {
    return snprintf(buffer, aeron_format_min(5, buffer_len), "%lld", value);
  } else {
    size_t printed_len = aeron_format_number_next(value / 1000, sep, buffer, buffer_len);
    return printed_len + snprintf(buffer + printed_len, aeron_format_min(5, buffer_len - printed_len), "%s%03lld", sep, llabs(value % 1000));
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<nrf_set_mode_ptx>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x18(%rbp),%rdx
  lea    -0xd(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <nrf_read_register@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  jns    L24
  mov    -0xc(%rbp),%eax
  jmp    L21
L24:
  movzbl -0xd(%rbp),%eax
  and    $0xfffffffe,%eax
  mov    %al,-0xd(%rbp)
  movzbl -0xd(%rbp),%eax
  movsbl %al,%eax
  mov    -0x18(%rbp),%rdx
  mov    %eax,%esi
  mov    $0x0,%edi
  call   <nrf_write_register@plt>
  mov    %eax,-0xc(%rbp)
  mov    $0x8c,%edi
  call   <timer_wait_us@plt>
  mov    -0xc(%rbp),%eax
L21:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L14
  call   <__stack_chk_fail@plt>
L14:
  leave
  ret
```

assistant: ```c
int nrf_set_mode_ptx(char *retstatus) {
  char confreg;
  int ret;
  ret = nrf_read_register(0x00, &confreg, retstatus);
  if (ret < 0)
    return ret;
  confreg &= ~0x01;
  ret = nrf_write_register(0x00, confreg, retstatus);
  timer_wait_us(140);
  return ret;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<nrf_set_mode_ptx>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x7(%rsp),%rsi
  mov    %rdi,%rdx
  mov    $0x0,%edi
  call   <nrf_read_register@plt>
  mov    %eax,%ebx
  test   %eax,%eax
  js     L13
  movzbl 0x7(%rsp),%esi
  and    $0xfffffffe,%esi
  mov    %sil,0x7(%rsp)
  movsbl %sil,%esi
  mov    %rbp,%rdx
  mov    $0x0,%edi
  call   <nrf_write_register@plt>
  mov    %eax,%ebx
  mov    $0x8c,%edi
  call   <timer_wait_us@plt>
L13:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L18
  mov    %ebx,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
L18:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int nrf_set_mode_ptx(char *retstatus) {
  char confreg;
  int ret;
  ret = nrf_read_register(0x00, &confreg, retstatus);
  if (ret < 0)
    return ret;
  confreg &= ~0x01;
  ret = nrf_write_register(0x00, confreg, retstatus);
  timer_wait_us(140);
  return ret;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<nrf_set_mode_ptx>:
  endbr64
  push   %r13
  mov    %rdi,%rdx
  mov    %rdi,%r13
  xor    %edi,%edi
  push   %r12
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x7(%rsp),%rsi
  call   <nrf_read_register@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  js     L7
  movzbl 0x7(%rsp),%esi
  xor    %edi,%edi
  mov    %r13,%rdx
  and    $0xfffffffe,%esi
  mov    %sil,0x7(%rsp)
  movsbl %sil,%esi
  call   <nrf_write_register@plt>
  mov    $0x8c,%edi
  mov    %eax,%r12d
  call   <timer_wait_us@plt>
L7:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L17
  add    $0x18,%rsp
  mov    %r12d,%eax
  pop    %r12
  pop    %r13
  ret
L17:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int nrf_set_mode_ptx(char *retstatus) {
  char confreg;
  int ret;
  ret = nrf_read_register(0x00, &confreg, retstatus);
  if (ret < 0)
    return ret;
  confreg &= ~0x01;
  ret = nrf_write_register(0x00, confreg, retstatus);
  timer_wait_us(140);
  return ret;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<nrf_set_mode_ptx>:
  endbr64
  push   %r13
  mov    %rdi,%rdx
  mov    %rdi,%r13
  xor    %edi,%edi
  push   %r12
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x7(%rsp),%rsi
  call   <nrf_read_register@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  js     L7
  movzbl 0x7(%rsp),%esi
  xor    %edi,%edi
  mov    %r13,%rdx
  and    $0xfffffffe,%esi
  mov    %sil,0x7(%rsp)
  movsbl %sil,%esi
  call   <nrf_write_register@plt>
  mov    $0x8c,%edi
  mov    %eax,%r12d
  call   <timer_wait_us@plt>
L7:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L0
  add    $0x18,%rsp
  mov    %r12d,%eax
  pop    %r12
  pop    %r13
  ret
L0:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int nrf_set_mode_ptx(char *retstatus) {
  char confreg;
  int ret;
  ret = nrf_read_register(0x00, &confreg, retstatus);
  if (ret < 0)
    return ret;
  confreg &= ~0x01;
  ret = nrf_write_register(0x00, confreg, retstatus);
  timer_wait_us(140);
  return ret;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<select_task>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,-0x50(%rbp)
  mov    %esi,%r14d
  mov    %edx,%r15d
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  movslq %esi,%rax
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L25:
  cmp    %rdx,%rsp
  je     L111
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L25
L111:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L1
  orq    $0x0,-0x8(%rsp,%rax,1)
L1:
  mov    %rsp,%r13
  test   %r14d,%r14d
  jle    L92
  mov    %r13,%rax
  mov    %r14d,%edx
  lea    0x0(%r13,%rdx,4),%rdx
L91:
  movl   $0x1,(%rax)
  add    $0x4,%rax
  cmp    %rax,%rdx
  jne    L91
  mov    %r14d,-0x44(%rbp)
  mov    $0x0,%ebx
  cmp    $0x1,%r14d
  jg     L74
L53:
  mov    $0x0,%eax
L29:
  cmpl   $0x0,0x0(%r13,%rax,4)
  jne    L131
  add    $0x1,%rax
  cmp    %eax,%r14d
  jg     L29
  mov    $0x0,%eax
  jmp    L139
L14:
  mov    %ebx,%edx
  mov    %r13,%rsi
  mov    %r14d,%edi
  call   <cycle_next@plt>
  mov    %eax,%ebx
  add    $0x1,%r12d
  cmp    %r12d,%r15d
  jne    L14
L76:
  movslq %ebx,%rax
  movl   $0x0,0x0(%r13,%rax,4)
  mov    -0x50(%rbp),%rcx
  mov    (%rcx,%rax,8),%rsi
  lea    D0(%rip),%rdi
  call   <printf@plt>
  subl   $0x1,-0x44(%rbp)
  mov    -0x44(%rbp),%r12d
  mov    %ebx,%edx
  mov    %r13,%rsi
  mov    %r14d,%edi
  call   <cycle_next@plt>
  mov    %eax,%ebx
  cmp    $0x1,%r12d
  jle    L53
L74:
  mov    $0x1,%r12d
  cmp    $0x1,%r15d
  jg     L14
  jmp    L76
L131:
  movslq %eax,%rdx
  mov    -0x50(%rbp),%rax
  mov    (%rax,%rdx,8),%rax
L139:
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L12
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L92:
  mov    $0x0,%eax
  jmp    L139
L12:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D0
type_guessed: string

tool: D0: drop %s


assistant: ```c
char *select_task(char *tasks[], int size, int steps) {
  int i, curr = 0, tasks_left = size;
  bool used[size];
  for (i = 0; i < size; i++)
    used[i] = true;
  while (tasks_left > 1) {
    for (i = 1; i < steps; i++) {
      curr = cycle_next(size, used, curr);
    }
    used[curr] = false;
    printf("drop %s\n", tasks[curr]);
    tasks_left--;
    curr = cycle_next(size, used, curr);
  }
  for (i = 0; i < size; i++)
    if (used[i])
      return tasks[i];
  return NULL;
}
```
user: What is the c source code of the assembly code below:

```asm
<select_task>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  mov    %edx,%r13d
  push   %r12
  mov    %esi,%r12d
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,-0x50(%rbp)
  mov    %rsp,%rcx
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  movslq %esi,%rax
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L39
L128:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L128
L39:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L130
L119:
  mov    %rsp,%rbx
  test   %r12d,%r12d
  jle    L42
  mov    %r12d,%edx
  mov    %rbx,%rax
  lea    (%rbx,%rdx,4),%rdx
  xchg   %ax,%ax
L49:
  movl   $0x1,(%rax)
  add    $0x4,%rax
  cmp    %rdx,%rax
  jne    L49
  mov    %r12d,%r14d
  xor    %edx,%edx
  cmp    $0x1,%r12d
  je     L1
  nopw   0x0(%rax,%rax,1)
L121:
  mov    $0x1,%r15d
  cmp    $0x1,%r13d
  jle    L137
  nopl   0x0(%rax)
L83:
  mov    %rbx,%rsi
  mov    %r12d,%edi
  add    $0x1,%r15d
  call   <cycle_next@plt>
  mov    %eax,%edx
  cmp    %r15d,%r13d
  jne    L83
L137:
  mov    -0x50(%rbp),%rcx
  movslq %edx,%rax
  mov    %edx,-0x44(%rbp)
  sub    $0x1,%r14d
  lea    D0(%rip),%rdi
  movl   $0x0,(%rbx,%rax,4)
  mov    (%rcx,%rax,8),%rsi
  call   <printf@plt>
  mov    -0x44(%rbp),%edx
  mov    %rbx,%rsi
  mov    %r12d,%edi
  call   <cycle_next@plt>
  mov    %eax,%edx
  cmp    $0x1,%r14d
  jne    L121
L1:
  xor    %eax,%eax
  jmp    L29
  nopl   (%rax)
L73:
  add    $0x1,%rax
  cmp    %eax,%r12d
  jle    L42
L29:
  mov    (%rbx,%rax,4),%ecx
  movslq %eax,%rdx
  test   %ecx,%ecx
  je     L73
  mov    -0x50(%rbp),%rax
  mov    (%rax,%rdx,8),%rax
L80:
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L45
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L42:
  xor    %eax,%eax
  jmp    L80
L130:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L119
L45:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D0
type_infered: string

tool: D0: drop %s


assistant: ```c
char *select_task(char *tasks[], int size, int steps) {
  int i, curr = 0, tasks_left = size;
  bool used[size];
  for (i = 0; i < size; i++)
    used[i] = true;
  while (tasks_left > 1) {
    for (i = 1; i < steps; i++) {
      curr = cycle_next(size, used, curr);
    }
    used[curr] = false;
    printf("drop %s\n", tasks[curr]);
    tasks_left--;
    curr = cycle_next(size, used, curr);
  }
  for (i = 0; i < size; i++)
    if (used[i])
      return tasks[i];
  return NULL;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<quaddobl_Newton_Laurent_step>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    -0x8(%rbp),%rcx
  mov    -0x10(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    $0x0,%r8d
  mov    %rax,%rsi
  mov    $0x148,%edi
  call   <_ada_use_c2phc@plt>
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  leave
  ret
```

assistant: ```c
int quaddobl_Newton_Laurent_step(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(328, a, b, c, 0);
  return fail;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<quaddobl_Newton_Laurent_step>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    $0x148,%edi
  call   <_ada_use_c2phc@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
int quaddobl_Newton_Laurent_step(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(328, a, b, c, 0);
  return fail;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<quaddobl_Newton_Laurent_step>:
  endbr64
  xor    %r8d,%r8d
  xor    %ecx,%ecx
  xor    %edx,%edx
  xor    %esi,%esi
  mov    $0x148,%edi
  jmp    1050 <_ada_use_c2phc@plt>
```

assistant: ```c
int quaddobl_Newton_Laurent_step(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(328, a, b, c, 0);
  return fail;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<quaddobl_Newton_Laurent_step>:
  endbr64
  xor    %r8d,%r8d
  xor    %ecx,%ecx
  xor    %edx,%edx
  xor    %esi,%esi
  mov    $0x148,%edi
  jmp    1050 <_ada_use_c2phc@plt>
```

assistant: ```c
int quaddobl_Newton_Laurent_step(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(328, a, b, c, 0);
  return fail;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<uh_b64decode>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r9
  mov    %esi,%r11d
  mov    %rdx,%r10
  mov    %ecx,%r8d
  mov    $0x0,%esi
  mov    $0x0,%eax
  mov    $0x0,%edi
  mov    $0x3e,%r14d
  mov    $0x3f,%ebp
  mov    $0x0,%r12d
  test   %ecx,%ecx
  jns    L147
L17:
  movslq %edi,%rax
  movb   $0x0,(%r9,%rax,1)
  lea    0x1(%rdi),%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L50:
  lea    -0x41(%rcx),%r13d
  cmp    $0x19,%r13d
  jbe    L4
  lea    -0x61(%rcx),%r13d
  cmp    $0x19,%r13d
  ja     L83
  lea    -0x47(%rcx),%r13d
L4:
  shl    $0x6,%eax
  or     %r13d,%eax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  shr    $0x1e,%ecx
  add    %ecx,%edx
  and    $0x3,%edx
  sub    %ecx,%edx
  cmp    $0x3,%edx
  je     L121
L151:
  add    $0x1,%rsi
  cmp    %esi,%r8d
  jl     L17
L147:
  mov    %esi,%edx
  movzbl (%r10,%rsi,1),%ecx
  test   %cl,%cl
  je     L17
  movzbl %cl,%ecx
  lea    -0x30(%rcx),%r13d
  cmp    $0x9,%r13d
  ja     L50
  lea    0x4(%rcx),%r13d
  jmp    L4
L83:
  cmp    $0x2b,%ecx
  je     L18
  cmp    $0x2f,%ecx
  je     L53
  mov    %r12d,%r13d
  cmp    $0x3d,%ecx
  je     L4
  jmp    L151
L18:
  mov    %r14d,%r13d
  jmp    L4
L53:
  mov    %ebp,%r13d
  jmp    L4
L121:
  lea    0x3(%rdi),%ecx
  cmp    %r11d,%ecx
  jge    L17
  movslq %edi,%rdx
  mov    %eax,%r13d
  shr    $0x10,%r13d
  mov    %r13b,(%r9,%rdx,1)
  lea    0x1(%rdi),%edx
  movslq %edx,%rdx
  movzbl %ah,%ebx
  mov    %bl,(%r9,%rdx,1)
  add    $0x2,%edi
  movslq %edi,%rdi
  mov    %al,(%r9,%rdi,1)
  mov    %ecx,%edi
  jmp    L151
```

assistant: ```c
int uh_b64decode(char *buf, int blen, const unsigned char *src, int slen) {
  int i = 0;
  int len = 0;
  unsigned int cin = 0;
  unsigned int cout = 0;
  for (i = 0; (i <= slen) && (src[i] != 0); i++) {
    cin = src[i];
    if ((cin >= '0') && (cin <= '9'))
      cin = cin - '0' + 52;
    else if ((cin >= 'A') && (cin <= 'Z'))
      cin = cin - 'A';
    else if ((cin >= 'a') && (cin <= 'z'))
      cin = cin - 'a' + 26;
    else if (cin == '+')
      cin = 62;
    else if (cin == '/')
      cin = 63;
    else if (cin == '=')
      cin = 0;
    else
      continue;
    cout = (cout << 6) | cin;
    if ((i % 4) == 3) {
      if ((len + 3) < blen) {
        buf[len++] = (char)(cout >> 16);
        buf[len++] = (char)(cout >> 8);
        buf[len++] = (char)(cout);
      } else {
        break;
      }
    }
  }
  buf[len++] = 0;
  return len;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<uh_b64decode>:
  endbr64
  push   %r12
  mov    %rdi,%r9
  mov    %rdi,%rax
  mov    $0x1,%r12d
  push   %rbx
  mov    %ecx,%ebx
  test   %ecx,%ecx
  js     L72
  mov    %rdx,%r11
  mov    %esi,%r10d
  xor    %edx,%edx
  xor    %ecx,%ecx
  xor    %r8d,%r8d
  jmp    L65
  nopl   0x0(%rax)
L41:
  lea    0x4(%rax),%edi
L134:
  shl    $0x6,%ecx
  and    $0x3,%esi
  or     %edi,%ecx
  cmp    $0x3,%esi
  je     L60
L132:
  add    $0x1,%rdx
  cmp    %edx,%ebx
  jl     L88
L65:
  movzbl (%r11,%rdx,1),%eax
  mov    %edx,%esi
  test   %al,%al
  je     L88
  lea    -0x30(%rax),%edi
  cmp    $0x9,%edi
  jbe    L41
  lea    -0x41(%rax),%edi
  cmp    $0x19,%edi
  jbe    L134
  lea    -0x61(%rax),%edi
  cmp    $0x19,%edi
  ja     L28
  lea    -0x47(%rax),%edi
  shl    $0x6,%ecx
  and    $0x3,%esi
  or     %edi,%ecx
  cmp    $0x3,%esi
  jne    L132
  nopl   0x0(%rax,%rax,1)
L60:
  movslq %r8d,%rax
  lea    0x3(%r8),%esi
  lea    0x1(%r8),%r12d
  add    %r9,%rax
  cmp    %r10d,%esi
  jge    L72
  mov    %ecx,%edi
  add    $0x2,%r8d
  movslq %r12d,%r12
  add    $0x1,%rdx
  shr    $0x10,%edi
  movslq %r8d,%r8
  mov    %dil,(%rax)
  movzbl %ch,%eax
  mov    %al,(%r9,%r12,1)
  mov    %cl,(%r9,%r8,1)
  mov    %esi,%r8d
  cmp    %edx,%ebx
  jge    L65
  nopl   0x0(%rax,%rax,1)
L88:
  movslq %r8d,%rax
  lea    0x1(%r8),%r12d
  add    %r9,%rax
L72:
  movb   $0x0,(%rax)
  mov    %r12d,%eax
  pop    %rbx
  pop    %r12
  ret
  nopl   0x0(%rax)
L28:
  cmp    $0x2b,%eax
  je     L50
  cmp    $0x2f,%eax
  je     L93
  xor    %edi,%edi
  cmp    $0x3d,%eax
  je     L134
  jmp    L132
  nopw   0x0(%rax,%rax,1)
L50:
  mov    $0x3e,%edi
  jmp    L134
  nopw   0x0(%rax,%rax,1)
L93:
  mov    $0x3f,%edi
  jmp    L134
```

assistant: ```c
int uh_b64decode(char *buf, int blen, const unsigned char *src, int slen) {
  int i = 0;
  int len = 0;
  unsigned int cin = 0;
  unsigned int cout = 0;
  for (i = 0; (i <= slen) && (src[i] != 0); i++) {
    cin = src[i];
    if ((cin >= '0') && (cin <= '9'))
      cin = cin - '0' + 52;
    else if ((cin >= 'A') && (cin <= 'Z'))
      cin = cin - 'A';
    else if ((cin >= 'a') && (cin <= 'z'))
      cin = cin - 'a' + 26;
    else if (cin == '+')
      cin = 62;
    else if (cin == '/')
      cin = 63;
    else if (cin == '=')
      cin = 0;
    else
      continue;
    cout = (cout << 6) | cin;
    if ((i % 4) == 3) {
      if ((len + 3) < blen) {
        buf[len++] = (char)(cout >> 16);
        buf[len++] = (char)(cout >> 8);
        buf[len++] = (char)(cout);
      } else {
        break;
      }
    }
  }
  buf[len++] = 0;
  return len;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<uh_b64decode>:
  endbr64
  push   %r12
  mov    %rdi,%r9
  mov    %rdi,%rax
  mov    $0x1,%r12d
  push   %rbx
  mov    %ecx,%ebx
  test   %ecx,%ecx
  js     L80
  mov    %rdx,%r11
  mov    %esi,%r10d
  xor    %edx,%edx
  xor    %ecx,%ecx
  xor    %r8d,%r8d
  jmp    L145
  nopl   0x0(%rax)
L102:
  lea    0x4(%rax),%edi
L134:
  shl    $0x6,%ecx
  and    $0x3,%esi
  or     %edi,%ecx
  cmp    $0x3,%esi
  je     L21
L2:
  add    $0x1,%rdx
  cmp    %edx,%ebx
  jl     L150
L145:
  movzbl (%r11,%rdx,1),%eax
  mov    %edx,%esi
  test   %al,%al
  je     L150
  lea    -0x30(%rax),%edi
  cmp    $0x9,%edi
  jbe    L102
  lea    -0x41(%rax),%edi
  cmp    $0x19,%edi
  jbe    L134
  lea    -0x61(%rax),%edi
  cmp    $0x19,%edi
  ja     L25
  lea    -0x47(%rax),%edi
  shl    $0x6,%ecx
  and    $0x3,%esi
  or     %edi,%ecx
  cmp    $0x3,%esi
  jne    L2
  nopl   0x0(%rax,%rax,1)
L21:
  movslq %r8d,%rax
  lea    0x3(%r8),%esi
  lea    0x1(%r8),%r12d
  add    %r9,%rax
  cmp    %r10d,%esi
  jge    L80
  mov    %ecx,%edi
  add    $0x2,%r8d
  movslq %r12d,%r12
  add    $0x1,%rdx
  shr    $0x10,%edi
  movslq %r8d,%r8
  mov    %dil,(%rax)
  movzbl %ch,%eax
  mov    %al,(%r9,%r12,1)
  mov    %cl,(%r9,%r8,1)
  mov    %esi,%r8d
  cmp    %edx,%ebx
  jge    L145
  nopl   0x0(%rax,%rax,1)
L150:
  movslq %r8d,%rax
  lea    0x1(%r8),%r12d
  add    %r9,%rax
L80:
  movb   $0x0,(%rax)
  mov    %r12d,%eax
  pop    %rbx
  pop    %r12
  ret
  nopl   0x0(%rax)
L25:
  cmp    $0x2b,%eax
  je     L62
  cmp    $0x2f,%eax
  je     L110
  xor    %edi,%edi
  cmp    $0x3d,%eax
  je     L134
  jmp    L2
  nopw   0x0(%rax,%rax,1)
L62:
  mov    $0x3e,%edi
  jmp    L134
  nopw   0x0(%rax,%rax,1)
L110:
  mov    $0x3f,%edi
  jmp    L134
```

assistant: ```c
int uh_b64decode(char *buf, int blen, const unsigned char *src, int slen) {
  int i = 0;
  int len = 0;
  unsigned int cin = 0;
  unsigned int cout = 0;
  for (i = 0; (i <= slen) && (src[i] != 0); i++) {
    cin = src[i];
    if ((cin >= '0') && (cin <= '9'))
      cin = cin - '0' + 52;
    else if ((cin >= 'A') && (cin <= 'Z'))
      cin = cin - 'A';
    else if ((cin >= 'a') && (cin <= 'z'))
      cin = cin - 'a' + 26;
    else if (cin == '+')
      cin = 62;
    else if (cin == '/')
      cin = 63;
    else if (cin == '=')
      cin = 0;
    else
      continue;
    cout = (cout << 6) | cin;
    if ((i % 4) == 3) {
      if ((len + 3) < blen) {
        buf[len++] = (char)(cout >> 16);
        buf[len++] = (char)(cout >> 8);
        buf[len++] = (char)(cout);
      } else {
        break;
      }
    }
  }
  buf[len++] = 0;
  return len;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<ts_sleep>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movq   %rax,%xmm0
  call   <usleep@plt>
  nop
  leave
  ret
```

assistant: ```c
void ts_sleep(uint64_t no_of_ts) {
  no_of_ts = no_of_ts / ((double)1000000ull / 1000000ull);
  usleep(no_of_ts);
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<ts_sleep>:
  endbr64
  sub    $0x8,%rsp
  call   <usleep@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
void ts_sleep(uint64_t no_of_ts) {
  no_of_ts = no_of_ts / ((double)1000000ull / 1000000ull);
  usleep(no_of_ts);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<ts_sleep>:
  endbr64
  jmp    1050 <usleep@plt>
```

assistant: ```c
void ts_sleep(uint64_t no_of_ts) {
  no_of_ts = no_of_ts / ((double)1000000ull / 1000000ull);
  usleep(no_of_ts);
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<ts_sleep>:
  endbr64
  jmp    1050 <usleep@plt>
```

assistant: ```c
void ts_sleep(uint64_t no_of_ts) {
  no_of_ts = no_of_ts / ((double)1000000ull / 1000000ull);
  usleep(no_of_ts);
}
```