ylfeng/ReF-Decompile-dataset huggingface dataset:
user: What would the C source look like for the assembly code provided here:

```asm
<I2C_Recv2>:
  endbr64
  lea    (%rdi,%rdi,1),%esi
  movzbl %sil,%esi
  mov    $0x1,%edx
L10:
  mov    0x40021004,%eax
  test   $0x1,%al
  jne    L10
  mov    %esi,0x40021000
  mov    0x40021000,%eax
  or     $0x1,%eax
  mov    %eax,0x40021000
  movl   $0xb,0x40021004
L9:
  mov    0x40021004,%eax
  test   $0x1,%al
  jne    L9
  mov    0x40021008,%ecx
  movl   $0x5,0x40021004
L24:
  mov    0x40021004,%eax
  test   $0x1,%al
  jne    L24
  mov    0x40021008,%edi
  add    $0x1,%edx
  mov    0x40021004,%eax
  test   $0x6,%al
  je     L28
  cmp    $0x5,%edx
  jle    L10
L28:
  shl    $0x8,%ecx
  movzwl %cx,%eax
  movzbl %dil,%edi
  add    %edi,%eax
  ret
```

assistant: ```c
uint16_t I2C_Recv2(int8_t slave) {
  uint8_t data1, data2;
  int retryCounter = 1;
  do {
    while ((*((volatile uint32_t *)0x40021004)) & 0x00000001) {
    };
    (*((volatile uint32_t *)0x40021000)) = (slave << 1) & 0xFE;
    (*((volatile uint32_t *)0x40021000)) |= 0x01;
    (*((volatile uint32_t *)0x40021004)) = (0 | 0x00000008 | 0x00000002 | 0x00000001);
    while ((*((volatile uint32_t *)0x40021004)) & 0x00000001) {
    };
    data1 = ((*((volatile uint32_t *)0x40021008)) & 0xFF);
    (*((volatile uint32_t *)0x40021004)) = (0 | 0x00000004 | 0x00000001);
    while ((*((volatile uint32_t *)0x40021004)) & 0x00000001) {
    };
    data2 = ((*((volatile uint32_t *)0x40021008)) & 0xFF);
    retryCounter = retryCounter + 1;
  } while ((((*((volatile uint32_t *)0x40021004)) & (0x00000004 | 0x00000002)) != 0) && (retryCounter <= 5));
  return (data1 << 8) + data2;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<I2C_Recv2>:
  endbr64
  lea    (%rdi,%rdi,1),%esi
  mov    $0x1,%edx
  movzbl %sil,%esi
L48:
  mov    0x40021004,%eax
  test   $0x1,%al
  jne    L48
  mov    %esi,0x40021000
  mov    0x40021000,%eax
  or     $0x1,%eax
  mov    %eax,0x40021000
  movl   $0xb,0x40021004
  xchg   %ax,%ax
L15:
  mov    0x40021004,%eax
  test   $0x1,%al
  jne    L15
  mov    0x40021008,%ecx
  movl   $0x5,0x40021004
  nopl   (%rax)
L12:
  mov    0x40021004,%eax
  test   $0x1,%al
  jne    L12
  mov    0x40021008,%edi
  mov    0x40021004,%eax
  add    $0x1,%edx
  test   $0x6,%al
  je     L40
  cmp    $0x6,%edx
  jne    L48
L40:
  shl    $0x8,%ecx
  movzbl %dil,%edi
  movzwl %cx,%eax
  add    %edi,%eax
  ret
```

assistant: ```c
uint16_t I2C_Recv2(int8_t slave) {
  uint8_t data1, data2;
  int retryCounter = 1;
  do {
    while ((*((volatile uint32_t *)0x40021004)) & 0x00000001) {
    };
    (*((volatile uint32_t *)0x40021000)) = (slave << 1) & 0xFE;
    (*((volatile uint32_t *)0x40021000)) |= 0x01;
    (*((volatile uint32_t *)0x40021004)) = (0 | 0x00000008 | 0x00000002 | 0x00000001);
    while ((*((volatile uint32_t *)0x40021004)) & 0x00000001) {
    };
    data1 = ((*((volatile uint32_t *)0x40021008)) & 0xFF);
    (*((volatile uint32_t *)0x40021004)) = (0 | 0x00000004 | 0x00000001);
    while ((*((volatile uint32_t *)0x40021004)) & 0x00000001) {
    };
    data2 = ((*((volatile uint32_t *)0x40021008)) & 0xFF);
    retryCounter = retryCounter + 1;
  } while ((((*((volatile uint32_t *)0x40021004)) & (0x00000004 | 0x00000002)) != 0) && (retryCounter <= 5));
  return (data1 << 8) + data2;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<I2C_Recv2>:
  endbr64
  lea    (%rdi,%rdi,1),%esi
  mov    $0x1,%edx
  movzbl %sil,%esi
L26:
  mov    0x40021004,%eax
  test   $0x1,%al
  jne    L26
  mov    %esi,0x40021000
  mov    0x40021000,%eax
  or     $0x1,%eax
  mov    %eax,0x40021000
  movl   $0xb,0x40021004
  xchg   %ax,%ax
L30:
  mov    0x40021004,%eax
  test   $0x1,%al
  jne    L30
  mov    0x40021008,%ecx
  movl   $0x5,0x40021004
  nopl   (%rax)
L0:
  mov    0x40021004,%eax
  test   $0x1,%al
  jne    L0
  mov    0x40021008,%edi
  mov    0x40021004,%eax
  add    $0x1,%edx
  test   $0x6,%al
  je     L43
  cmp    $0x6,%edx
  jne    L26
L43:
  shl    $0x8,%ecx
  movzbl %dil,%edi
  movzwl %cx,%eax
  add    %edi,%eax
  ret
```

assistant: ```c
uint16_t I2C_Recv2(int8_t slave) {
  uint8_t data1, data2;
  int retryCounter = 1;
  do {
    while ((*((volatile uint32_t *)0x40021004)) & 0x00000001) {
    };
    (*((volatile uint32_t *)0x40021000)) = (slave << 1) & 0xFE;
    (*((volatile uint32_t *)0x40021000)) |= 0x01;
    (*((volatile uint32_t *)0x40021004)) = (0 | 0x00000008 | 0x00000002 | 0x00000001);
    while ((*((volatile uint32_t *)0x40021004)) & 0x00000001) {
    };
    data1 = ((*((volatile uint32_t *)0x40021008)) & 0xFF);
    (*((volatile uint32_t *)0x40021004)) = (0 | 0x00000004 | 0x00000001);
    while ((*((volatile uint32_t *)0x40021004)) & 0x00000001) {
    };
    data2 = ((*((volatile uint32_t *)0x40021008)) & 0xFF);
    retryCounter = retryCounter + 1;
  } while ((((*((volatile uint32_t *)0x40021004)) & (0x00000004 | 0x00000002)) != 0) && (retryCounter <= 5));
  return (data1 << 8) + data2;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<file_tiff_offset>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x38(%rbp),%rdx
  lea    -0x20(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    $0x4,%esi
  mov    %rax,%rdi
  call   <fread@plt>
  mov    %rax,-0x28(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  jne    L142
  mov    $0x7,%eax
  jmp    L129
L142:
  mov    -0x20(%rbp),%eax
  cmp    $0xff,%eax
  jne    L109
  mov    -0x1c(%rbp),%eax
  cmp    $0xd8,%eax
  jne    L109
  mov    -0x18(%rbp),%eax
  cmp    $0xff,%eax
  jne    L109
  mov    -0x14(%rbp),%eax
  cmp    $0xe1,%eax
  jne    L109
  movl   $0xc,-0x2c(%rbp)
  jmp    L194
L109:
  mov    -0x20(%rbp),%eax
  cmp    $0xff,%eax
  jne    L159
  mov    -0x1c(%rbp),%eax
  cmp    $0xd8,%eax
  jne    L159
  mov    -0x18(%rbp),%eax
  cmp    $0xff,%eax
  jne    L159
  mov    -0x14(%rbp),%eax
  cmp    $0xe0,%eax
  jne    L159
  movl   $0x1e,-0x2c(%rbp)
  jmp    L194
L159:
  mov    -0x20(%rbp),%eax
  cmp    $0x49,%eax
  jne    L57
  mov    -0x1c(%rbp),%eax
  cmp    $0x49,%eax
  jne    L57
  mov    -0x18(%rbp),%eax
  cmp    $0x2a,%eax
  jne    L57
  mov    -0x14(%rbp),%eax
  test   %eax,%eax
  jne    L57
  movl   $0x0,-0x2c(%rbp)
  jmp    L194
L57:
  mov    -0x20(%rbp),%eax
  cmp    $0x4d,%eax
  jne    L191
  mov    -0x1c(%rbp),%eax
  cmp    $0x4d,%eax
  jne    L191
  mov    -0x18(%rbp),%eax
  test   %eax,%eax
  jne    L191
  mov    -0x14(%rbp),%eax
  cmp    $0x2a,%eax
  jne    L191
  movl   $0x0,-0x2c(%rbp)
  jmp    L194
L191:
  movl   $0xffffffff,-0x2c(%rbp)
L194:
  mov    D8(%rip),%rax
  mov    (%rax),%edx
  mov    -0x38(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <fseek@plt>
  mov    -0x2c(%rbp),%eax
L129:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L76
  call   <__stack_chk_fail@plt>
L76:
  leave
  ret
```

assistant: ```c
int file_tiff_offset(FILE *fp) {
  uint8_t magic[4];
  int offset;
  size_t bytes_read;
  bytes_read = fread(magic, 4, 1, fp);
  if (bytes_read == 0) {
    return 7;
  }
  if (magic[0] == 0xFF && magic[1] == 0xD8 && magic[2] == 0xFF && magic[3] == 0xE1) {
    offset = 12;
  } else if (magic[0] == 0xFF && magic[1] == 0xD8 && magic[2] == 0xFF && magic[3] == 0xE0) {
    offset = 30;
  } else if (magic[0] == 0x49 && magic[1] == 0x49 && magic[2] == 0x2A && magic[3] == 0x00) {
    offset = 0;
  } else if (magic[0] == 0x4D && magic[1] == 0x4D && magic[2] == 0x00 && magic[3] == 0x2A) {
    offset = 0;
  } else {
    offset = -1;
  }
  fseek(fp, 0, SEEK_SET);
  return offset;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<file_tiff_offset>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  mov    %rbx,%rcx
  mov    $0x1,%edx
  mov    $0x4,%esi
  call   <fread@plt>
  mov    $0x7,%ebp
  test   %rax,%rax
  je     L101
  mov    (%rsp),%eax
  cmp    $0xff,%eax
  je     L141
  cmp    $0x49,%eax
  jne    L139
  mov    $0xffffffff,%ebp
  cmpl   $0x49,0x4(%rsp)
  jne    L4
  cmpl   $0x2a,0x8(%rsp)
  jne    L4
  mov    0xc(%rsp),%eax
  neg    %eax
  sbb    %ebp,%ebp
  jmp    L4
L141:
  mov    $0xffffffff,%ebp
  cmpl   $0xd8,0x4(%rsp)
  je     L162
L4:
  mov    D7(%rip),%rax
  mov    (%rax),%edx
  mov    $0x0,%esi
  mov    %rbx,%rdi
  call   <fseek@plt>
L101:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L117
  mov    %ebp,%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  ret
L162:
  cmpl   $0xff,0x8(%rsp)
  je     L130
L53:
  mov    $0xffffffff,%ebp
  cmpl   $0xff,0x8(%rsp)
  jne    L4
  cmpl   $0xe0,0xc(%rsp)
  mov    $0xffffffff,%ebp
  mov    $0x1e,%eax
  cmove  %eax,%ebp
  jmp    L4
L130:
  mov    $0xc,%ebp
  cmpl   $0xe1,0xc(%rsp)
  jne    L53
  jmp    L4
L139:
  cmp    $0x4d,%eax
  jne    L50
  mov    $0xffffffff,%ebp
  cmpl   $0x4d,0x4(%rsp)
  jne    L4
  cmpl   $0x0,0x8(%rsp)
  jne    L4
  cmpl   $0x2a,0xc(%rsp)
  setne  %bpl
  movzbl %bpl,%ebp
  neg    %ebp
  jmp    L4
L50:
  mov    $0xffffffff,%ebp
  jmp    L4
L117:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int file_tiff_offset(FILE *fp) {
  uint8_t magic[4];
  int offset;
  size_t bytes_read;
  bytes_read = fread(magic, 4, 1, fp);
  if (bytes_read == 0) {
    return 7;
  }
  if (magic[0] == 0xFF && magic[1] == 0xD8 && magic[2] == 0xFF && magic[3] == 0xE1) {
    offset = 12;
  } else if (magic[0] == 0xFF && magic[1] == 0xD8 && magic[2] == 0xFF && magic[3] == 0xE0) {
    offset = 30;
  } else if (magic[0] == 0x49 && magic[1] == 0x49 && magic[2] == 0x2A && magic[3] == 0x00) {
    offset = 0;
  } else if (magic[0] == 0x4D && magic[1] == 0x4D && magic[2] == 0x00 && magic[3] == 0x2A) {
    offset = 0;
  } else {
    offset = -1;
  }
  fseek(fp, 0, SEEK_SET);
  return offset;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<file_tiff_offset>:
  endbr64
  push   %r12
  mov    $0x1,%edx
  mov    $0x4,%esi
  mov    $0x7,%r12d
  push   %rbp
  mov    %rdi,%rbp
  mov    %rbp,%rcx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  call   <fread@plt>
  test   %rax,%rax
  je     L67
  mov    (%rsp),%eax
  mov    $0xffffffff,%r12d
  cmp    $0xff,%eax
  je     L73
  cmp    $0x49,%eax
  jne    L27
  cmpl   $0x49,0x4(%rsp)
  je     L89
L119:
  mov    D1(%rip),%rax
  xor    %esi,%esi
  mov    %rbp,%rdi
  mov    (%rax),%edx
  call   <fseek@plt>
L67:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L62
  add    $0x28,%rsp
  mov    %r12d,%eax
  pop    %rbp
  pop    %r12
  ret
L27:
  cmp    $0x4d,%eax
  jne    L119
  cmpl   $0x4d,0x4(%rsp)
  jne    L119
  mov    0x8(%rsp),%eax
  test   %eax,%eax
  jne    L119
  xor    %r12d,%r12d
  cmpl   $0x2a,0xc(%rsp)
  setne  %r12b
  neg    %r12d
  jmp    L119
  nopl   (%rax)
L73:
  cmpl   $0xd8,0x4(%rsp)
  jne    L119
  cmpl   $0xff,0x8(%rsp)
  jne    L119
  cmpl   $0xe1,0xc(%rsp)
  mov    $0xc,%r12d
  je     L119
  cmpl   $0xe0,0xc(%rsp)
  mov    $0xffffffff,%r12d
  mov    $0x1e,%eax
  cmove  %eax,%r12d
  jmp    L119
  nopl   0x0(%rax,%rax,1)
L89:
  cmpl   $0x2a,0x8(%rsp)
  jne    L119
  mov    0xc(%rsp),%eax
  neg    %eax
  sbb    %r12d,%r12d
  jmp    L119
L62:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int file_tiff_offset(FILE *fp) {
  uint8_t magic[4];
  int offset;
  size_t bytes_read;
  bytes_read = fread(magic, 4, 1, fp);
  if (bytes_read == 0) {
    return 7;
  }
  if (magic[0] == 0xFF && magic[1] == 0xD8 && magic[2] == 0xFF && magic[3] == 0xE1) {
    offset = 12;
  } else if (magic[0] == 0xFF && magic[1] == 0xD8 && magic[2] == 0xFF && magic[3] == 0xE0) {
    offset = 30;
  } else if (magic[0] == 0x49 && magic[1] == 0x49 && magic[2] == 0x2A && magic[3] == 0x00) {
    offset = 0;
  } else if (magic[0] == 0x4D && magic[1] == 0x4D && magic[2] == 0x00 && magic[3] == 0x2A) {
    offset = 0;
  } else {
    offset = -1;
  }
  fseek(fp, 0, SEEK_SET);
  return offset;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<file_tiff_offset>:
  endbr64
  push   %r12
  mov    $0x1,%edx
  mov    $0x4,%esi
  mov    $0x7,%r12d
  push   %rbp
  mov    %rdi,%rbp
  mov    %rbp,%rcx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  call   <fread@plt>
  test   %rax,%rax
  je     L85
  mov    (%rsp),%eax
  mov    $0xffffffff,%r12d
  cmp    $0xff,%eax
  je     L102
  cmp    $0x49,%eax
  jne    L91
  cmpl   $0x49,0x4(%rsp)
  je     L73
L103:
  mov    D5(%rip),%rax
  xor    %esi,%esi
  mov    %rbp,%rdi
  mov    (%rax),%edx
  call   <fseek@plt>
L85:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L70
  add    $0x28,%rsp
  mov    %r12d,%eax
  pop    %rbp
  pop    %r12
  ret
L91:
  cmp    $0x4d,%eax
  jne    L103
  cmpl   $0x4d,0x4(%rsp)
  jne    L103
  mov    0x8(%rsp),%eax
  test   %eax,%eax
  jne    L103
  xor    %r12d,%r12d
  cmpl   $0x2a,0xc(%rsp)
  setne  %r12b
  neg    %r12d
  jmp    L103
  nopl   (%rax)
L102:
  cmpl   $0xd8,0x4(%rsp)
  jne    L103
  cmpl   $0xff,0x8(%rsp)
  jne    L103
  cmpl   $0xe1,0xc(%rsp)
  mov    $0xc,%r12d
  je     L103
  cmpl   $0xe0,0xc(%rsp)
  mov    $0xffffffff,%r12d
  mov    $0x1e,%eax
  cmove  %eax,%r12d
  jmp    L103
  nopl   0x0(%rax,%rax,1)
L73:
  cmpl   $0x2a,0x8(%rsp)
  jne    L103
  mov    0xc(%rsp),%eax
  neg    %eax
  sbb    %r12d,%r12d
  jmp    L103
L70:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int file_tiff_offset(FILE *fp) {
  uint8_t magic[4];
  int offset;
  size_t bytes_read;
  bytes_read = fread(magic, 4, 1, fp);
  if (bytes_read == 0) {
    return 7;
  }
  if (magic[0] == 0xFF && magic[1] == 0xD8 && magic[2] == 0xFF && magic[3] == 0xE1) {
    offset = 12;
  } else if (magic[0] == 0xFF && magic[1] == 0xD8 && magic[2] == 0xFF && magic[3] == 0xE0) {
    offset = 30;
  } else if (magic[0] == 0x49 && magic[1] == 0x49 && magic[2] == 0x2A && magic[3] == 0x00) {
    offset = 0;
  } else if (magic[0] == 0x4D && magic[1] == 0x4D && magic[2] == 0x00 && magic[3] == 0x2A) {
    offset = 0;
  } else {
    offset = -1;
  }
  fseek(fp, 0, SEEK_SET);
  return offset;
}
```
user: What is the c source code of the assembly code below?

```asm
<memdup>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L14
  mov    $0x0,%eax
  jmp    L18
L14:
  mov    -0x1c(%rbp),%edx
  mov    -0x18(%rbp),%rcx
  mov    -0x8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x8(%rbp),%rax
L18:
  leave
  ret
```

assistant: ```c
void *memdup(const void *mem, int size) {
  void *out = malloc(size);
  if (!out)
    return 0;
  memcpy(out, mem, size);
  return out;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<memdup>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r12
  mov    %esi,%ebp
  mov    %esi,%edi
  call   <malloc@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L1
  mov    %ebp,%edx
  mov    %r12,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
L1:
  mov    %rbx,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
void *memdup(const void *mem, int size) {
  void *out = malloc(size);
  if (!out)
    return 0;
  memcpy(out, mem, size);
  return out;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<memdup>:
  endbr64
  push   %r13
  mov    %esi,%r13d
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  mov    %esi,%edi
  call   <malloc@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L5
  mov    %r13d,%edx
  mov    %rbp,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
L5:
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
void *memdup(const void *mem, int size) {
  void *out = malloc(size);
  if (!out)
    return 0;
  memcpy(out, mem, size);
  return out;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<memdup>:
  endbr64
  push   %r13
  mov    %esi,%r13d
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  mov    %esi,%edi
  call   <malloc@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L2
  mov    %r13d,%edx
  mov    %rbp,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
L2:
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
void *memdup(const void *mem, int size) {
  void *out = malloc(size);
  if (!out)
    return 0;
  memcpy(out, mem, size);
  return out;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<oligo2bin>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    $0xf,%eax
  jle    L32
  mov    $0x0,%eax
  call   <abort@plt>
L32:
  movl   $0x0,-0x4(%rbp)
  movl   $0x0,-0x8(%rbp)
  jmp    L36
L24:
  shll   $0x2,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x41,%eax
  cmp    $0x34,%eax
  ja     L41
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D4(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D4(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  orl    $0x1,-0x4(%rbp)
  jmp    L15
  orl    $0x1,-0x4(%rbp)
  jmp    L15
  orl    $0x2,-0x4(%rbp)
  jmp    L15
  orl    $0x3,-0x4(%rbp)
  jmp    L15
L41:
  mov    $0x0,%eax
  call   <abort@plt>
  jmp    L15
  nop
L15:
  addl   $0x1,-0x8(%rbp)
L36:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L24
  mov    -0x4(%rbp),%eax
  leave
  ret
```

assistant: ```c
int oligo2bin(char *oligo) {
  int i;
  int bin;
  if (strlen(oligo) > 15) {
    abort();
  }
  bin = 0;
  for (i = 0; oligo[i]; i++) {
    bin <<= 2;
    switch (oligo[i]) {
    case 'A':
    case 'a':
      bin |= 0;
      break;
    case 'N':
    case 'n':
      bin |= 0;
      break;
    case 'T':
    case 't':
      bin |= 1;
      break;
    case 'U':
    case 'u':
      bin |= 1;
      break;
    case 'C':
    case 'c':
      bin |= 2;
      break;
    case 'G':
    case 'g':
      bin |= 3;
      break;
    default:
      abort();
    }
  }
  return bin;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<oligo2bin>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  cmp    $0xf,%eax
  jg     L11
L40:
  movzbl (%rbx),%eax
  test   %al,%al
  je     L70
  add    $0x1,%rbx
  mov    $0x0,%ebp
  lea    D6(%rip),%r12
  jmp    L85
L11:
  mov    $0x0,%eax
  call   <abort@plt>
  jmp    L40
  or     $0x1,%ebp
L92:
  add    $0x1,%rbx
  movzbl -0x1(%rbx),%eax
  test   %al,%al
  je     L54
L85:
  shl    $0x2,%ebp
  sub    $0x41,%eax
  cmp    $0x34,%al
  ja     L80
  movzbl %al,%eax
  movslq (%r12,%rax,4),%rax
  add    %r12,%rax
  notrack jmp *%rax
  or     $0x1,%ebp
  jmp    L92
  or     $0x2,%ebp
  jmp    L92
  or     $0x3,%ebp
  jmp    L92
L80:
  mov    $0x0,%eax
  call   <abort@plt>
  jmp    L92
L70:
  mov    $0x0,%ebp
L54:
  mov    %ebp,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
int oligo2bin(char *oligo) {
  int i;
  int bin;
  if (strlen(oligo) > 15) {
    abort();
  }
  bin = 0;
  for (i = 0; oligo[i]; i++) {
    bin <<= 2;
    switch (oligo[i]) {
    case 'A':
    case 'a':
      bin |= 0;
      break;
    case 'N':
    case 'n':
      bin |= 0;
      break;
    case 'T':
    case 't':
      bin |= 1;
      break;
    case 'U':
    case 'u':
      bin |= 1;
      break;
    case 'C':
    case 'c':
      bin |= 2;
      break;
    case 'G':
    case 'g':
      bin |= 3;
      break;
    default:
      abort();
    }
  }
  return bin;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<oligo2bin>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  cmp    $0xf,%eax
  jg     L59
  movzbl (%rbx),%eax
  test   %al,%al
  je     L41
L31:
  add    $0x1,%rbx
  xor    %r12d,%r12d
  lea    D7(%rip),%rbp
  nopw   0x0(%rax,%rax,1)
L78:
  sub    $0x41,%eax
  shl    $0x2,%r12d
  cmp    $0x34,%al
  ja     L15
  movzbl %al,%eax
  movslq 0x0(%rbp,%rax,4),%rax
  add    %rbp,%rax
  notrack jmp *%rax
  nopl   0x0(%rax)
L15:
  xor    %eax,%eax
  call   <abort@plt>
  nop
L62:
  movzbl (%rbx),%eax
  add    $0x1,%rbx
  test   %al,%al
  jne    L78
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
  or     $0x1,%r12d
  jmp    L62
  xchg   %ax,%ax
  or     $0x2,%r12d
  jmp    L62
  cs nopw 0x0(%rax,%rax,1)
  or     $0x3,%r12d
  jmp    L62
  cs nopw 0x0(%rax,%rax,1)
L59:
  xor    %eax,%eax
  call   <abort@plt>
  movzbl (%rbx),%eax
  test   %al,%al
  jne    L31
L41:
  xor    %r12d,%r12d
  pop    %rbx
  pop    %rbp
  mov    %r12d,%eax
  pop    %r12
  ret
```

assistant: ```c
int oligo2bin(char *oligo) {
  int i;
  int bin;
  if (strlen(oligo) > 15) {
    abort();
  }
  bin = 0;
  for (i = 0; oligo[i]; i++) {
    bin <<= 2;
    switch (oligo[i]) {
    case 'A':
    case 'a':
      bin |= 0;
      break;
    case 'N':
    case 'n':
      bin |= 0;
      break;
    case 'T':
    case 't':
      bin |= 1;
      break;
    case 'U':
    case 'u':
      bin |= 1;
      break;
    case 'C':
    case 'c':
      bin |= 2;
      break;
    case 'G':
    case 'g':
      bin |= 3;
      break;
    default:
      abort();
    }
  }
  return bin;
}
```
user: Translate the below assembly code into C programming language:

```asm
<oligo2bin>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  cmp    $0xf,%eax
  jg     L44
  movzbl (%rbx),%eax
  test   %al,%al
  je     L61
L78:
  add    $0x1,%rbx
  xor    %r12d,%r12d
  lea    D4(%rip),%rbp
  nopw   0x0(%rax,%rax,1)
L7:
  sub    $0x41,%eax
  shl    $0x2,%r12d
  cmp    $0x34,%al
  ja     L35
  movzbl %al,%eax
  movslq 0x0(%rbp,%rax,4),%rax
  add    %rbp,%rax
  notrack jmp *%rax
  nopl   0x0(%rax)
L35:
  xor    %eax,%eax
  call   <abort@plt>
  nop
L0:
  movzbl (%rbx),%eax
  add    $0x1,%rbx
  test   %al,%al
  jne    L7
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
  or     $0x1,%r12d
  jmp    L0
  xchg   %ax,%ax
  or     $0x2,%r12d
  jmp    L0
  cs nopw 0x0(%rax,%rax,1)
  or     $0x3,%r12d
  jmp    L0
  cs nopw 0x0(%rax,%rax,1)
L44:
  xor    %eax,%eax
  call   <abort@plt>
  movzbl (%rbx),%eax
  test   %al,%al
  jne    L78
L61:
  xor    %r12d,%r12d
  pop    %rbx
  pop    %rbp
  mov    %r12d,%eax
  pop    %r12
  ret
```

assistant: ```c
int oligo2bin(char *oligo) {
  int i;
  int bin;
  if (strlen(oligo) > 15) {
    abort();
  }
  bin = 0;
  for (i = 0; oligo[i]; i++) {
    bin <<= 2;
    switch (oligo[i]) {
    case 'A':
    case 'a':
      bin |= 0;
      break;
    case 'N':
    case 'n':
      bin |= 0;
      break;
    case 'T':
    case 't':
      bin |= 1;
      break;
    case 'U':
    case 'u':
      bin |= 1;
      break;
    case 'C':
    case 'c':
      bin |= 2;
      break;
    case 'G':
    case 'g':
      bin |= 3;
      break;
    default:
      abort();
    }
  }
  return bin;
}
```