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

```asm
<ds1621_write_value>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %esi,%eax
  mov    %edx,-0xc(%rbp)
  mov    %al,-0x8(%rbp)
  cmpb   $0xee,-0x8(%rbp)
  je     L11
  cmpb   $0x22,-0x8(%rbp)
  jne    L1
L11:
  movzbl -0x8(%rbp),%edx
  mov    -0x4(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <i2c_smbus_write_byte@plt>
  jmp    L60
L1:
  cmpb   $0xac,-0x8(%rbp)
  je     L51
  cmpb   $0xa8,-0x8(%rbp)
  je     L51
  cmpb   $0xa9,-0x8(%rbp)
  jne    L22
L51:
  movzbl -0x8(%rbp),%ecx
  mov    -0xc(%rbp),%edx
  mov    -0x4(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <i2c_smbus_write_byte_data@plt>
  jmp    L60
L22:
  mov    -0xc(%rbp),%eax
  mov    %eax,%edi
  call   <swap16@plt>
  mov    %eax,%edx
  movzbl -0x8(%rbp),%ecx
  mov    -0x4(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <i2c_smbus_write_word_data@plt>
L60:
  leave
  ret
```

assistant: ```c
int ds1621_write_value(int client, unsigned char reg, unsigned int value) {
  if ((reg == 0xEE) || (reg == 0x22))
    return i2c_smbus_write_byte(client, reg);
  else if ((reg == 0xAC) || (reg == 0xA8) || (reg == 0xA9))
    return i2c_smbus_write_byte_data(client, reg, value);
  else
    return i2c_smbus_write_word_data(client, reg, swap16(value));
}
```
user: Translate the below assembly code into C programming language:

```asm
<ds1621_write_value>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebp
  mov    %esi,%ebx
  cmp    $0xee,%sil
  je     L0
  cmp    $0x22,%sil
  je     L0
  lea    0x58(%rsi),%eax
  cmp    $0x1,%al
  jbe    L50
  cmp    $0xac,%sil
  je     L50
  mov    %edx,%edi
  call   <swap16@plt>
  mov    %eax,%edx
  movzbl %bl,%esi
  mov    %ebp,%edi
  call   <i2c_smbus_write_word_data@plt>
  jmp    L54
L0:
  movzbl %bl,%esi
  mov    %ebp,%edi
  call   <i2c_smbus_write_byte@plt>
  jmp    L54
L50:
  movzbl %bl,%esi
  mov    %ebp,%edi
  call   <i2c_smbus_write_byte_data@plt>
L54:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
int ds1621_write_value(int client, unsigned char reg, unsigned int value) {
  if ((reg == 0xEE) || (reg == 0x22))
    return i2c_smbus_write_byte(client, reg);
  else if ((reg == 0xAC) || (reg == 0xA8) || (reg == 0xA9))
    return i2c_smbus_write_byte_data(client, reg, value);
  else
    return i2c_smbus_write_word_data(client, reg, swap16(value));
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<ds1621_write_value>:
  endbr64
  push   %r12
  movzbl %sil,%r12d
  push   %rbp
  mov    %edi,%ebp
  sub    $0x8,%rsp
  cmp    $0xee,%sil
  je     L1
  cmp    $0x22,%sil
  je     L1
  lea    0x58(%rsi),%eax
  cmp    $0x1,%al
  jbe    L13
  cmp    $0xac,%sil
  je     L13
  mov    %edx,%edi
  call   <swap16@plt>
  add    $0x8,%rsp
  mov    %r12d,%esi
  mov    %ebp,%edi
  mov    %eax,%edx
  pop    %rbp
  pop    %r12
  jmp    10b0 <i2c_smbus_write_word_data@plt>
  nopl   0x0(%rax)
L13:
  add    $0x8,%rsp
  mov    %r12d,%esi
  mov    %ebp,%edi
  pop    %rbp
  pop    %r12
  jmp    10a0 <i2c_smbus_write_byte_data@plt>
  nopl   0x0(%rax)
L1:
  add    $0x8,%rsp
  mov    %r12d,%esi
  mov    %ebp,%edi
  pop    %rbp
  pop    %r12
  jmp    1090 <i2c_smbus_write_byte@plt>
```

assistant: ```c
int ds1621_write_value(int client, unsigned char reg, unsigned int value) {
  if ((reg == 0xEE) || (reg == 0x22))
    return i2c_smbus_write_byte(client, reg);
  else if ((reg == 0xAC) || (reg == 0xA8) || (reg == 0xA9))
    return i2c_smbus_write_byte_data(client, reg, value);
  else
    return i2c_smbus_write_word_data(client, reg, swap16(value));
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<ds1621_write_value>:
  endbr64
  push   %r12
  movzbl %sil,%r12d
  push   %rbp
  mov    %edi,%ebp
  sub    $0x8,%rsp
  cmp    $0xee,%sil
  je     L37
  cmp    $0x22,%sil
  je     L37
  lea    0x58(%rsi),%eax
  cmp    $0x1,%al
  jbe    L33
  cmp    $0xac,%sil
  je     L33
  mov    %edx,%edi
  call   <swap16@plt>
  add    $0x8,%rsp
  mov    %r12d,%esi
  mov    %ebp,%edi
  mov    %eax,%edx
  pop    %rbp
  pop    %r12
  jmp    10b0 <i2c_smbus_write_word_data@plt>
  nopl   0x0(%rax)
L33:
  add    $0x8,%rsp
  mov    %r12d,%esi
  mov    %ebp,%edi
  pop    %rbp
  pop    %r12
  jmp    10a0 <i2c_smbus_write_byte_data@plt>
  nopl   0x0(%rax)
L37:
  add    $0x8,%rsp
  mov    %r12d,%esi
  mov    %ebp,%edi
  pop    %rbp
  pop    %r12
  jmp    1090 <i2c_smbus_write_byte@plt>
```

assistant: ```c
int ds1621_write_value(int client, unsigned char reg, unsigned int value) {
  if ((reg == 0xEE) || (reg == 0x22))
    return i2c_smbus_write_byte(client, reg);
  else if ((reg == 0xAC) || (reg == 0xA8) || (reg == 0xA9))
    return i2c_smbus_write_byte_data(client, reg, value);
  else
    return i2c_smbus_write_word_data(client, reg, swap16(value));
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<my_memcpy>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    %edx,-0x14(%rbp)
  mov    -0x8(%rbp),%rax
  mov    (%rax),%rax
  mov    -0x14(%rbp),%edx
  mov    -0x10(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x8(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rax,%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,(%rax)
  nop
  leave
  ret
```

assistant: ```c
void my_memcpy(uint8_t **dest, void *src, int size) {
  memcpy(*dest, src, size);
  *dest += size;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<my_memcpy>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  mov    %edx,%ebx
  mov    (%rdi),%rdi
  call   <memcpy@plt>
  movslq %ebx,%rbx
  shl    $0x2,%rbx
  add    %rbx,0x0(%rbp)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void my_memcpy(uint8_t **dest, void *src, int size) {
  memcpy(*dest, src, size);
  *dest += size;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<my_memcpy>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  movslq %edx,%rbx
  mov    %ebx,%edx
  shl    $0x2,%rbx
  sub    $0x8,%rsp
  mov    (%rdi),%rdi
  call   <memcpy@plt>
  add    %rbx,0x0(%rbp)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void my_memcpy(uint8_t **dest, void *src, int size) {
  memcpy(*dest, src, size);
  *dest += size;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<my_memcpy>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  movslq %edx,%rbx
  mov    %ebx,%edx
  shl    $0x2,%rbx
  sub    $0x8,%rsp
  mov    (%rdi),%rdi
  call   <memcpy@plt>
  add    %rbx,0x0(%rbp)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void my_memcpy(uint8_t **dest, void *src, int size) {
  memcpy(*dest, src, size);
  *dest += size;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<rc4hash_print>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x90,%rsp
  mov    %rdi,-0x88(%rbp)
  mov    %rsi,-0x90(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x70(%rbp),%rdx
  mov    -0x88(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <rc4hash_pack@plt>
  movl   $0x0,-0x74(%rbp)
  jmp    L20
L17:
  mov    -0x74(%rbp),%eax
  cltq
  mov    -0x70(%rbp,%rax,4),%edx
  mov    -0x90(%rbp),%rax
  lea    D6(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <fprintf@plt>
  addl   $0x1,-0x74(%rbp)
L20:
  cmpl   $0x19,-0x74(%rbp)
  jle    L17
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L14
  call   <__stack_chk_fail@plt>
L14:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D6
data_type: string

tool: D6: %02x

assistant: ```c
void rc4hash_print(const struct rc4hash *hash, FILE *out) {
  uint8_t packed[26];
  rc4hash_pack(hash, packed);
  for (int i = 0; i < 26; i++) {
    fprintf(out, "%02x", packed[i]);
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<rc4hash_print>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %rsi,%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbx
  mov    %rbx,%rsi
  call   <rc4hash_pack@plt>
  lea    0x68(%rsp),%r13
  lea    D6(%rip),%r12
L5:
  mov    (%rbx),%edx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  add    $0x4,%rbx
  cmp    %r13,%rbx
  jne    L5
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L7
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L7:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D6
type_infered: string

tool: D6: %02x

assistant: ```c
void rc4hash_print(const struct rc4hash *hash, FILE *out) {
  uint8_t packed[26];
  rc4hash_pack(hash, packed);
  for (int i = 0; i < 26; i++) {
    fprintf(out, "%02x", packed[i]);
  }
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<rc4hash_print>:
  endbr64
  push   %r13
  push   %r12
  lea    D3(%rip),%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbx
  lea    0x68(%rsp),%r13
  mov    %rbx,%rsi
  call   <rc4hash_pack@plt>
  nopl   0x0(%rax,%rax,1)
L1:
  mov    (%rbx),%edx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  add    $0x4,%rbx
  call   <fprintf@plt>
  cmp    %r13,%rbx
  jne    L1
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L17
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L17:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D3
data_type: string

tool: D3: %02x

assistant: ```c
void rc4hash_print(const struct rc4hash *hash, FILE *out) {
  uint8_t packed[26];
  rc4hash_pack(hash, packed);
  for (int i = 0; i < 26; i++) {
    fprintf(out, "%02x", packed[i]);
  }
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<rc4hash_print>:
  endbr64
  push   %r13
  push   %r12
  lea    D9(%rip),%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbx
  lea    0x68(%rsp),%r13
  mov    %rbx,%rsi
  call   <rc4hash_pack@plt>
  nopl   0x0(%rax,%rax,1)
L18:
  mov    (%rbx),%edx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  add    $0x4,%rbx
  call   <fprintf@plt>
  cmp    %r13,%rbx
  jne    L18
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L1
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L1:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D9
data_type: string

tool: D9: %02x

assistant: ```c
void rc4hash_print(const struct rc4hash *hash, FILE *out) {
  uint8_t packed[26];
  rc4hash_pack(hash, packed);
  for (int i = 0; i < 26; i++) {
    fprintf(out, "%02x", packed[i]);
  }
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<f>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  movl   $0x1,-0x8(%rbp)
  jmp    L60
L53:
  cmpl   $0x7,-0x8(%rbp)
  je     L88
  movl   $0x5,-0x4(%rbp)
  jmp    L80
L63:
  cmpl   $0x6,-0x8(%rbp)
  jne    L27
  cmpl   $0x7,-0x4(%rbp)
  je     L2
L27:
  addl   $0x1,-0x4(%rbp)
L80:
  cmpl   $0x9,-0x4(%rbp)
  jle    L63
  addl   $0x1,-0x8(%rbp)
L60:
  cmpl   $0x1d,-0x8(%rbp)
  jle    L53
  jmp    L49
L88:
  nop
  jmp    L49
L2:
  nop
L49:
  nop
  pop    %rbp
  ret
```

assistant: ```c
void f(void) {
  int i, j;
#pragma acc loop
  for (i = 1; i < 30; i++) {
    if (i == 7)
      goto out;
#pragma acc loop
    for (j = 5; j < 10; j++) {
      if (i == 6 && j == 7)
        goto out;
    }
  }
out:;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<f>:
  endbr64
  mov    $0x1,%eax
L19:
  cmp    $0x6,%eax
  je     L22
  add    $0x1,%eax
  cmp    $0x7,%eax
  je     L22
  cmp    $0x1d,%eax
  jle    L19
L22:
  ret
```

assistant: ```c
void f(void) {
  int i, j;
#pragma acc loop
  for (i = 1; i < 30; i++) {
    if (i == 7)
      goto out;
#pragma acc loop
    for (j = 5; j < 10; j++) {
      if (i == 6 && j == 7)
        goto out;
    }
  }
out:;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<f>:
  endbr64
  ret
```

assistant: ```c
void f(void) {
  int i, j;
#pragma acc loop
  for (i = 1; i < 30; i++) {
    if (i == 7)
      goto out;
#pragma acc loop
    for (j = 5; j < 10; j++) {
      if (i == 6 && j == 7)
        goto out;
    }
  }
out:;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<f>:
  endbr64
  ret
```

assistant: ```c
void f(void) {
  int i, j;
#pragma acc loop
  for (i = 1; i < 30; i++) {
    if (i == 7)
      goto out;
#pragma acc loop
    for (j = 5; j < 10; j++) {
      if (i == 6 && j == 7)
        goto out;
    }
  }
out:;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<ConvertSequenceToIntegers>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L5
L3:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x30(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  mov    %eax,%edi
  call   <BaseToInt@plt>
  mov    %eax,(%rbx)
  addl   $0x1,-0x14(%rbp)
L5:
  mov    -0x14(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L3
  nop
  nop
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
void ConvertSequenceToIntegers(char *seq, int8_t *dest, int32_t seqLength) {
  int i;
  for (i = 0; i < seqLength; i++) {
    dest[i] = BaseToInt(seq[i]);
  }
}
```
user: What is the c source code of the assembly code below:

```asm
<ConvertSequenceToIntegers>:
  endbr64
  test   %edx,%edx
  jle    L7
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r12
  mov    %rsi,%r13
  mov    %edx,%ebp
  mov    $0x0,%ebx
L17:
  movsbl (%r12,%rbx,1),%edi
  call   <BaseToInt@plt>
  mov    %eax,0x0(%r13,%rbx,4)
  add    $0x1,%rbx
  cmp    %rbp,%rbx
  jne    L17
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L7:
  ret
```

assistant: ```c
void ConvertSequenceToIntegers(char *seq, int8_t *dest, int32_t seqLength) {
  int i;
  for (i = 0; i < seqLength; i++) {
    dest[i] = BaseToInt(seq[i]);
  }
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<ConvertSequenceToIntegers>:
  endbr64
  test   %edx,%edx
  jle    L19
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  movslq %edx,%rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x8,%rsp
  nopl   (%rax)
L7:
  movsbl (%r12,%rbx,1),%edi
  call   <BaseToInt@plt>
  mov    %eax,0x0(%r13,%rbx,4)
  add    $0x1,%rbx
  cmp    %rbx,%rbp
  jne    L7
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L19:
  ret
```

assistant: ```c
void ConvertSequenceToIntegers(char *seq, int8_t *dest, int32_t seqLength) {
  int i;
  for (i = 0; i < seqLength; i++) {
    dest[i] = BaseToInt(seq[i]);
  }
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<ConvertSequenceToIntegers>:
  endbr64
  test   %edx,%edx
  jle    L11
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  movslq %edx,%rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x8,%rsp
  nopl   (%rax)
L7:
  movsbl (%r12,%rbx,1),%edi
  call   <BaseToInt@plt>
  mov    %eax,0x0(%r13,%rbx,4)
  add    $0x1,%rbx
  cmp    %rbx,%rbp
  jne    L7
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L11:
  ret
```

assistant: ```c
void ConvertSequenceToIntegers(char *seq, int8_t *dest, int32_t seqLength) {
  int i;
  for (i = 0; i < seqLength; i++) {
    dest[i] = BaseToInt(seq[i]);
  }
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<mt_set_alarm>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    D3(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,-0x1c(%rbp)
  mov    D21(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,-0x20(%rbp)
  mov    D24(%rip),%rax
  mov    (%rax),%eax
  mov    -0x48(%rbp),%rdx
  lea    -0x20(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <timer_create@plt>
  mov    %eax,-0x24(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  je     L41
  mov    -0x24(%rbp),%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  neg    %eax
  jmp    L16
L41:
  lea    -0x28(%rbp),%rax
  mov    $0x4,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x34(%rbp),%eax
  mov    %eax,-0x28(%rbp)
  mov    D20(%rip),%rax
  mov    (%rax),%esi
  mov    -0x48(%rbp),%rax
  mov    (%rax),%eax
  lea    -0x28(%rbp),%rdx
  mov    $0x0,%ecx
  mov    %eax,%edi
  call   <timer_settime@plt>
  mov    %eax,-0x24(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  je     L33
  mov    -0x48(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <timer_delete@plt>
  mov    -0x24(%rbp),%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  neg    %eax
  jmp    L16
L33:
  mov    $0x0,%eax
L16:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L12
  call   <__stack_chk_fail@plt>
L12:
  leave
  ret
```

assistant: ```c
int mt_set_alarm(time_t at, const char *death_msg, timer_t *timer) {
  struct itimerspec ispec;
  struct sigevent evp;
  int ret;
  evp.sigev_value.sival_ptr = (void *)death_msg;
  evp.sigev_notify = SIGEV_SIGNAL;
  evp.sigev_signo = SIGALRM;
  ret = timer_create(CLOCK_MONOTONIC, &evp, timer);
  if (ret)
    return ((ret > 0) ? -ret : ret);
  memset(&ispec, 0, sizeof(ispec));
  ispec.it_value.tv_sec = at;
  ret = timer_settime(*timer, TIMER_ABSTIME, &ispec, NULL);
  if (ret) {
    timer_delete(*timer);
    return ((ret > 0) ? -ret : ret);
  }
  return 0;
}
```
user: What is the c source code of the assembly code below?

```asm
<mt_set_alarm>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x30,%rsp
  mov    %edi,%ebx
  mov    %rdx,%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    %rsi,0x18(%rsp)
  mov    D11(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,0x14(%rsp)
  mov    D12(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,0x10(%rsp)
  lea    0x10(%rsp),%rsi
  mov    D28(%rip),%rax
  mov    (%rax),%edi
  call   <timer_create@plt>
  test   %eax,%eax
  je     L28
  mov    %eax,%ebx
  neg    %ebx
  cmovs  %eax,%ebx
  neg    %ebx
L38:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L35
  mov    %ebx,%eax
  add    $0x30,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L28:
  lea    0xc(%rsp),%r12
  mov    $0x4,%edx
  mov    $0x0,%esi
  mov    %r12,%rdi
  call   <memset@plt>
  mov    %ebx,0xc(%rsp)
  mov    $0x0,%ecx
  mov    %r12,%rdx
  mov    D33(%rip),%rax
  mov    (%rax),%esi
  mov    0x0(%rbp),%edi
  call   <timer_settime@plt>
  mov    %eax,%ebx
  test   %eax,%eax
  je     L38
  mov    0x0(%rbp),%edi
  call   <timer_delete@plt>
  mov    %ebx,%eax
  neg    %eax
  cmovns %eax,%ebx
  neg    %ebx
  jmp    L38
L35:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int mt_set_alarm(time_t at, const char *death_msg, timer_t *timer) {
  struct itimerspec ispec;
  struct sigevent evp;
  int ret;
  evp.sigev_value.sival_ptr = (void *)death_msg;
  evp.sigev_notify = SIGEV_SIGNAL;
  evp.sigev_signo = SIGALRM;
  ret = timer_create(CLOCK_MONOTONIC, &evp, timer);
  if (ret)
    return ((ret > 0) ? -ret : ret);
  memset(&ispec, 0, sizeof(ispec));
  ispec.it_value.tv_sec = at;
  ret = timer_settime(*timer, TIMER_ABSTIME, &ispec, NULL);
  if (ret) {
    timer_delete(*timer);
    return ((ret > 0) ? -ret : ret);
  }
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<mt_set_alarm>:
  endbr64
  push   %r13
  push   %r12
  mov    %edi,%r12d
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    D6(%rip),%rax
  mov    %rsi,0x18(%rsp)
  lea    0x10(%rsp),%rsi
  mov    (%rax),%eax
  mov    %eax,0x14(%rsp)
  mov    D35(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,0x10(%rsp)
  mov    D21(%rip),%rax
  mov    (%rax),%edi
  call   <timer_create@plt>
  test   %eax,%eax
  je     L32
  mov    %eax,%r12d
  neg    %r12d
  cmovs  %eax,%r12d
  neg    %r12d
L39:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L26
  add    $0x30,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L32:
  lea    0xc(%rsp),%r13
  mov    $0x4,%edx
  xor    %esi,%esi
  mov    %r13,%rdi
  call   <memset@plt>
  mov    D25(%rip),%rax
  mov    (%rbx),%edi
  xor    %ecx,%ecx
  mov    %r13,%rdx
  mov    %r12d,0xc(%rsp)
  mov    (%rax),%esi
  call   <timer_settime@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  je     L39
  mov    (%rbx),%edi
  call   <timer_delete@plt>
  mov    %r12d,%eax
  neg    %eax
  cmovns %eax,%r12d
  neg    %r12d
  jmp    L39
L26:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int mt_set_alarm(time_t at, const char *death_msg, timer_t *timer) {
  struct itimerspec ispec;
  struct sigevent evp;
  int ret;
  evp.sigev_value.sival_ptr = (void *)death_msg;
  evp.sigev_notify = SIGEV_SIGNAL;
  evp.sigev_signo = SIGALRM;
  ret = timer_create(CLOCK_MONOTONIC, &evp, timer);
  if (ret)
    return ((ret > 0) ? -ret : ret);
  memset(&ispec, 0, sizeof(ispec));
  ispec.it_value.tv_sec = at;
  ret = timer_settime(*timer, TIMER_ABSTIME, &ispec, NULL);
  if (ret) {
    timer_delete(*timer);
    return ((ret > 0) ? -ret : ret);
  }
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<mt_set_alarm>:
  endbr64
  push   %r13
  push   %r12
  mov    %edi,%r12d
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x30,%rsp
  mov    D10(%rip),%rdx
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    D25(%rip),%rax
  mov    %rsi,0x18(%rsp)
  lea    0x10(%rsp),%rsi
  movd   (%rdx),%xmm0
  mov    %rbx,%rdx
  mov    (%rax),%eax
  movd   %eax,%xmm1
  mov    D29(%rip),%rax
  punpckldq %xmm1,%xmm0
  mov    (%rax),%edi
  movq   %xmm0,0x10(%rsp)
  call   <timer_create@plt>
  test   %eax,%eax
  je     L13
  mov    %eax,%r12d
  neg    %r12d
  cmovs  %eax,%r12d
  neg    %r12d
L27:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L14
  add    $0x30,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %r12
  pop    %r13
  ret
  xchg   %ax,%ax
L13:
  lea    0xc(%rsp),%r13
  mov    $0x4,%edx
  xor    %esi,%esi
  mov    %r13,%rdi
  call   <memset@plt>
  mov    D21(%rip),%rax
  mov    (%rbx),%edi
  xor    %ecx,%ecx
  mov    %r13,%rdx
  mov    %r12d,0xc(%rsp)
  mov    (%rax),%esi
  call   <timer_settime@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  je     L27
  mov    (%rbx),%edi
  call   <timer_delete@plt>
  mov    %r12d,%eax
  neg    %eax
  cmovns %eax,%r12d
  neg    %r12d
  jmp    L27
L14:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int mt_set_alarm(time_t at, const char *death_msg, timer_t *timer) {
  struct itimerspec ispec;
  struct sigevent evp;
  int ret;
  evp.sigev_value.sival_ptr = (void *)death_msg;
  evp.sigev_notify = SIGEV_SIGNAL;
  evp.sigev_signo = SIGALRM;
  ret = timer_create(CLOCK_MONOTONIC, &evp, timer);
  if (ret)
    return ((ret > 0) ? -ret : ret);
  memset(&ispec, 0, sizeof(ispec));
  ispec.it_value.tv_sec = at;
  ret = timer_settime(*timer, TIMER_ABSTIME, &ispec, NULL);
  if (ret) {
    timer_delete(*timer);
    return ((ret > 0) ? -ret : ret);
  }
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<cstr_assignstrn>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <cstr_clear@plt>
  cmpl   $0x0,-0x24(%rbp)
  js     L10
  mov    -0x24(%rbp),%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <strnlen@plt>
  jmp    L15
L10:
  mov    $0x0,%eax
L15:
  mov    %eax,-0x4(%rbp)
  mov    -0x20(%rbp),%rdx
  mov    -0x4(%rbp),%ecx
  mov    -0x18(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <cstr_appendm@plt>
  nop
  leave
  ret
```

assistant: ```c
void cstr_assignstrn(struct cstr_t *dst, const char *src, int n) {
  ;
  cstr_clear(dst);
  int l = n < 0 ? 0 : strnlen(src, n);
  cstr_appendm(dst, l, src);
  { return; };
}
```