ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<Varint_To_Num_32>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  lea    D1(%rip),%rdx
  mov    $0x3c,%esi
  mov    %rax,%rdi
  call   <uvarint_decode32@plt>
  lea    D1(%rip),%rax
  leave
  ret
```

assistant: ```c
uint32_t *Varint_To_Num_32(uint8_t TON32INPUT[60]) {
  static uint32_t varintdecode_032 = 0;
  uvarint_decode32(TON32INPUT, 60, &varintdecode_032);
  return &varintdecode_032;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<Varint_To_Num_32>:
  endbr64
  push   %rbx
  lea    D1(%rip),%rbx
  mov    %rbx,%rdx
  mov    $0x3c,%esi
  call   <uvarint_decode32@plt>
  mov    %rbx,%rax
  pop    %rbx
  ret
```

assistant: ```c
uint32_t *Varint_To_Num_32(uint8_t TON32INPUT[60]) {
  static uint32_t varintdecode_032 = 0;
  uvarint_decode32(TON32INPUT, 60, &varintdecode_032);
  return &varintdecode_032;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<Varint_To_Num_32>:
  endbr64
  push   %r12
  lea    D4(%rip),%r12
  mov    $0x3c,%esi
  mov    %r12,%rdx
  call   <uvarint_decode32@plt>
  mov    %r12,%rax
  pop    %r12
  ret
```

assistant: ```c
uint32_t *Varint_To_Num_32(uint8_t TON32INPUT[60]) {
  static uint32_t varintdecode_032 = 0;
  uvarint_decode32(TON32INPUT, 60, &varintdecode_032);
  return &varintdecode_032;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<Varint_To_Num_32>:
  endbr64
  push   %r12
  lea    D4(%rip),%r12
  mov    $0x3c,%esi
  mov    %r12,%rdx
  call   <uvarint_decode32@plt>
  mov    %r12,%rax
  pop    %r12
  ret
```

assistant: ```c
uint32_t *Varint_To_Num_32(uint8_t TON32INPUT[60]) {
  static uint32_t varintdecode_032 = 0;
  uvarint_decode32(TON32INPUT, 60, &varintdecode_032);
  return &varintdecode_032;
}
```
user: What is the c source code of the assembly code below:

```asm
<ls_copy_block_matrix>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %rcx,-0x50(%rbp)
  mov    -0x50(%rbp),%rdx
  mov    -0x48(%rbp),%rcx
  mov    -0x40(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <ls_allocate_blockmatrix@plt>
  mov    %rax,-0x10(%rbp)
  movq   $0x0,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x50(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  movq   $0x0,-0x30(%rbp)
  jmp    L3
L33:
  mov    -0x30(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  jb     L30
  addq   $0x1,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  add    %rax,-0x18(%rbp)
L30:
  mov    -0x20(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x8(%rbp)
  movq   $0x0,-0x28(%rbp)
  jmp    L37
L18:
  mov    -0x30(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x28(%rbp),%rax
  shl    $0x3,%rax
  add    %rax,%rdx
  mov    -0x30(%rbp),%rax
  lea    0x0(,%rax,8),%rcx
  mov    -0x10(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rcx
  mov    -0x28(%rbp),%rax
  shl    $0x3,%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  addq   $0x1,-0x28(%rbp)
L37:
  mov    -0x28(%rbp),%rax
  cmp    -0x8(%rbp),%rax
  jb     L18
  addq   $0x1,-0x30(%rbp)
L3:
  mov    -0x30(%rbp),%rax
  cmp    -0x40(%rbp),%rax
  jb     L33
  mov    -0x10(%rbp),%rax
  leave
  ret
```

assistant: ```c
double **ls_copy_block_matrix(const double *const *B, const size_t dimension, const size_t *block_sizes, const size_t nb_blocks) {
  double **dest;
  size_t i, j, idx_blocksize, current_blocksize, next_bs_change;
  dest = ls_allocate_blockmatrix(dimension, block_sizes, nb_blocks);
  idx_blocksize = 0;
  current_blocksize = block_sizes[idx_blocksize];
  next_bs_change = block_sizes[idx_blocksize];
  assert(nb_blocks != 0);
  for (i = 0; i < dimension; i++) {
    if (i >= next_bs_change) {
      idx_blocksize++;
      next_bs_change += block_sizes[idx_blocksize];
    }
    current_blocksize = block_sizes[idx_blocksize];
    for (j = 0; j < current_blocksize; j++) {
      dest[i][j] = B[i][j];
    }
  }
  return dest;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<ls_copy_block_matrix>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r14
  mov    %rsi,%r12
  mov    %rdx,%rbp
  mov    %rcx,%r15
  mov    %rcx,%rdx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <ls_allocate_blockmatrix@plt>
  mov    %rax,%r13
  mov    0x0(%rbp),%rbx
  test   %r15,%r15
  setne  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  test   %r12,%r12
  je     L0
  mov    %r14,%rcx
  mov    %r13,%rsi
  mov    $0x0,%r9d
  mov    $0x0,%r8d
  jmp    L43
L4:
  mov    0x0(%rbp,%r9,8),%rdi
  test   %rdi,%rdi
  je     L1
  mov    $0x0,%eax
L64:
  mov    (%rcx),%rdx
  movsd  (%rdx,%rax,8),%xmm0
  mov    (%rsi),%rdx
  movsd  %xmm0,(%rdx,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%rdi
  jne    L64
L1:
  add    $0x1,%r8
  add    $0x8,%rcx
  add    $0x8,%rsi
  cmp    %r8,%r12
  je     L0
L43:
  cmp    %rbx,%r8
  jb     L4
  add    $0x1,%r9
  add    0x0(%rbp,%r9,8),%rbx
  jmp    L4
L0:
  mov    %r13,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
double **ls_copy_block_matrix(const double *const *B, const size_t dimension, const size_t *block_sizes, const size_t nb_blocks) {
  double **dest;
  size_t i, j, idx_blocksize, current_blocksize, next_bs_change;
  dest = ls_allocate_blockmatrix(dimension, block_sizes, nb_blocks);
  idx_blocksize = 0;
  current_blocksize = block_sizes[idx_blocksize];
  next_bs_change = block_sizes[idx_blocksize];
  assert(nb_blocks != 0);
  for (i = 0; i < dimension; i++) {
    if (i >= next_bs_change) {
      idx_blocksize++;
      next_bs_change += block_sizes[idx_blocksize];
    }
    current_blocksize = block_sizes[idx_blocksize];
    for (j = 0; j < current_blocksize; j++) {
      dest[i][j] = B[i][j];
    }
  }
  return dest;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<ls_copy_block_matrix>:
  endbr64
  push   %r15
  mov    %rcx,%r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rdx,%r12
  mov    %rcx,%rdx
  push   %rbp
  mov    %rsi,%rbp
  mov    %r12,%rsi
  push   %rbx
  mov    %rbp,%rdi
  sub    $0x8,%rsp
  call   <ls_allocate_blockmatrix@plt>
  xor    %edi,%edi
  test   %r15,%r15
  mov    (%r12),%rbx
  setne  %dil
  mov    %rax,%r14
  call   <assert@plt>
  test   %rbp,%rbp
  je     L46
  xor    %r8d,%r8d
  xor    %edi,%edi
  nopl   0x0(%rax,%rax,1)
L30:
  cmp    %rbx,%rdi
  jae    L10
  mov    (%r12,%r8,8),%rdx
L51:
  test   %rdx,%rdx
  je     L27
  mov    0x0(%r13,%rdi,8),%rsi
  mov    (%r14,%rdi,8),%rcx
  xor    %eax,%eax
  nopl   0x0(%rax)
L24:
  movsd  (%rsi,%rax,8),%xmm0
  movsd  %xmm0,(%rcx,%rax,8)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L24
L27:
  add    $0x1,%rdi
  cmp    %rdi,%rbp
  jne    L30
L46:
  add    $0x8,%rsp
  mov    %r14,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L10:
  add    $0x1,%r8
  mov    (%r12,%r8,8),%rdx
  add    %rdx,%rbx
  jmp    L51
```

assistant: ```c
double **ls_copy_block_matrix(const double *const *B, const size_t dimension, const size_t *block_sizes, const size_t nb_blocks) {
  double **dest;
  size_t i, j, idx_blocksize, current_blocksize, next_bs_change;
  dest = ls_allocate_blockmatrix(dimension, block_sizes, nb_blocks);
  idx_blocksize = 0;
  current_blocksize = block_sizes[idx_blocksize];
  next_bs_change = block_sizes[idx_blocksize];
  assert(nb_blocks != 0);
  for (i = 0; i < dimension; i++) {
    if (i >= next_bs_change) {
      idx_blocksize++;
      next_bs_change += block_sizes[idx_blocksize];
    }
    current_blocksize = block_sizes[idx_blocksize];
    for (j = 0; j < current_blocksize; j++) {
      dest[i][j] = B[i][j];
    }
  }
  return dest;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<ls_copy_block_matrix>:
  endbr64
  push   %r15
  mov    %rcx,%r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdx,%r12
  mov    %rcx,%rdx
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rsi,%rbx
  mov    %r12,%rsi
  mov    %rbx,%rdi
  sub    $0x8,%rsp
  call   <ls_allocate_blockmatrix@plt>
  xor    %edi,%edi
  test   %r15,%r15
  mov    (%r12),%r13
  setne  %dil
  mov    %rax,%r14
  call   <assert@plt>
  test   %rbx,%rbx
  je     L80
  xor    %r9d,%r9d
  xor    %r8d,%r8d
  nopl   0x0(%rax)
L95:
  cmp    %r13,%r8
  jae    L5
  mov    (%r12,%r9,8),%rsi
L2:
  test   %rsi,%rsi
  je     L8
  lea    -0x1(%rsi),%rax
  mov    0x0(%rbp,%r8,8),%rdx
  mov    (%r14,%r8,8),%rcx
  cmp    $0x2,%rax
  jbe    L12
  lea    0x8(%rdx),%rax
  cmp    %rax,%rcx
  je     L12
  mov    %rsi,%rdi
  xor    %eax,%eax
  shr    %rdi
  shl    $0x4,%rdi
  nopw   0x0(%rax,%rax,1)
L3:
  movupd (%rdx,%rax,1),%xmm1
  movups %xmm1,(%rcx,%rax,1)
  add    $0x10,%rax
  cmp    %rdi,%rax
  jne    L3
  mov    %rsi,%rax
  and    $0xfffffffffffffffe,%rax
  and    $0x1,%esi
  je     L8
  movsd  (%rdx,%rax,8),%xmm0
  movsd  %xmm0,(%rcx,%rax,8)
L8:
  add    $0x1,%r8
  cmp    %r8,%rbx
  jne    L95
L80:
  add    $0x8,%rsp
  mov    %r14,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L5:
  add    $0x1,%r9
  mov    (%r12,%r9,8),%rsi
  add    %rsi,%r13
  jmp    L2
  nopl   0x0(%rax,%rax,1)
L12:
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L104:
  movsd  (%rdx,%rax,8),%xmm0
  movsd  %xmm0,(%rcx,%rax,8)
  add    $0x1,%rax
  cmp    %rsi,%rax
  jne    L104
  jmp    L8
```

assistant: ```c
double **ls_copy_block_matrix(const double *const *B, const size_t dimension, const size_t *block_sizes, const size_t nb_blocks) {
  double **dest;
  size_t i, j, idx_blocksize, current_blocksize, next_bs_change;
  dest = ls_allocate_blockmatrix(dimension, block_sizes, nb_blocks);
  idx_blocksize = 0;
  current_blocksize = block_sizes[idx_blocksize];
  next_bs_change = block_sizes[idx_blocksize];
  assert(nb_blocks != 0);
  for (i = 0; i < dimension; i++) {
    if (i >= next_bs_change) {
      idx_blocksize++;
      next_bs_change += block_sizes[idx_blocksize];
    }
    current_blocksize = block_sizes[idx_blocksize];
    for (j = 0; j < current_blocksize; j++) {
      dest[i][j] = B[i][j];
    }
  }
  return dest;
}
```
user: What is the c source code of the assembly code below?

```asm
<wait_xmitr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  nop
L3:
  mov    $0x0,%eax
  call   <sendingbyte@plt>
  test   %rax,%rax
  jne    L3
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void wait_xmitr(void) {
  while (sendingbyte()) {
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<wait_xmitr>:
  endbr64
  sub    $0x8,%rsp
L1:
  mov    $0x0,%eax
  call   <sendingbyte@plt>
  test   %rax,%rax
  jne    L1
  add    $0x8,%rsp
  ret
```

assistant: ```c
void wait_xmitr(void) {
  while (sendingbyte()) {
  }
}
```
user: What is the c source code of the assembly code below?

```asm
<wait_xmitr>:
  endbr64
  sub    $0x8,%rsp
  nopl   0x0(%rax,%rax,1)
L5:
  xor    %eax,%eax
  call   <sendingbyte@plt>
  test   %rax,%rax
  jne    L5
  add    $0x8,%rsp
  ret
```

assistant: ```c
void wait_xmitr(void) {
  while (sendingbyte()) {
  }
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<wait_xmitr>:
  endbr64
  sub    $0x8,%rsp
  nopl   0x0(%rax,%rax,1)
L9:
  xor    %eax,%eax
  call   <sendingbyte@plt>
  test   %rax,%rax
  jne    L9
  add    $0x8,%rsp
  ret
```

assistant: ```c
void wait_xmitr(void) {
  while (sendingbyte()) {
  }
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<read_le64>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    $0x4,%esi
  mov    %rax,%rdi
  call   <read_at_le32@plt>
  mov    %eax,-0x4(%rbp)
  mov    $0x20,%eax
  mov    %eax,%ecx
  shll   %cl,-0x4(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <read_le32@plt>
  or     %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  leave
  ret
```

assistant: ```c
uint64_t read_le64(const void *src) {
  uint64_t val;
  val = read_at_le32(src, sizeof(uint32_t));
  val <<= 32;
  val |= read_le32(src);
  return val;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<read_le64>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  mov    $0x4,%esi
  call   <read_at_le32@plt>
  mov    %rbx,%rdi
  call   <read_le32@plt>
  pop    %rbx
  ret
```

assistant: ```c
uint64_t read_le64(const void *src) {
  uint64_t val;
  val = read_at_le32(src, sizeof(uint32_t));
  val <<= 32;
  val |= read_le32(src);
  return val;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<read_le64>:
  endbr64
  push   %rbp
  mov    $0x4,%esi
  mov    %rdi,%rbp
  call   <read_at_le32@plt>
  mov    %rbp,%rdi
  pop    %rbp
  jmp    1070 <read_le32@plt>
```

assistant: ```c
uint64_t read_le64(const void *src) {
  uint64_t val;
  val = read_at_le32(src, sizeof(uint32_t));
  val <<= 32;
  val |= read_le32(src);
  return val;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<read_le64>:
  endbr64
  push   %rbp
  mov    $0x4,%esi
  mov    %rdi,%rbp
  call   <read_at_le32@plt>
  mov    %rbp,%rdi
  pop    %rbp
  jmp    1070 <read_le32@plt>
```

assistant: ```c
uint64_t read_le64(const void *src) {
  uint64_t val;
  val = read_at_le32(src, sizeof(uint32_t));
  val <<= 32;
  val |= read_le32(src);
  return val;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<configureBlePatch>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  movq   $0x21000398,-0x10(%rbp)
  movq   $0x21000434,-0x8(%rbp)
  mov    -0x10(%rbp),%rax
  add    $0x238,%rax
  movl   $0x0,(%rax)
  mov    -0x10(%rbp),%rax
  add    $0x108,%rax
  movl   $0x1,(%rax)
  mov    -0x10(%rbp),%rax
  add    $0x124,%rax
  movl   $0x2,(%rax)
  mov    -0x10(%rbp),%rax
  add    $0x1d4,%rax
  movl   $0x3,(%rax)
  mov    -0x10(%rbp),%rax
  add    $0x70,%rax
  movl   $0x4,(%rax)
  mov    -0x10(%rbp),%rax
  add    $0x1a4,%rax
  movl   $0x5,(%rax)
  mov    -0x10(%rbp),%rax
  add    $0x1a8,%rax
  movl   $0x6,(%rax)
  mov    -0x10(%rbp),%rax
  add    $0x118,%rax
  movl   $0x7,(%rax)
  mov    -0x8(%rbp),%rax
  add    $0x54,%rax
  movl   $0x210041bd,(%rax)
  nop
  pop    %rbp
  ret
```

assistant: ```c
void configureBlePatch(void) {
  uint8_t *pPatchTab = (uint8_t *)(0x21000000 + 0x0398);
  uint32_t *pIrqPatch = (uint32_t *)(0x21000000 + 0x0434);
  pPatchTab[142] = 0;
  pPatchTab[66] = 1;
  pPatchTab[73] = 2;
  pPatchTab[117] = 3;
  pPatchTab[28] = 4;
  pPatchTab[105] = 5;
  pPatchTab[106] = 6;
  pPatchTab[70] = 7;
  pIrqPatch[21] = 0x210041bd;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<configureBlePatch>:
  endbr64
  movl   $0x0,0x210005d0
  movl   $0x1,0x210004a0
  movl   $0x2,0x210004bc
  movl   $0x3,0x2100056c
  movl   $0x4,0x21000408
  movl   $0x5,0x2100053c
  movl   $0x6,0x21000540
  movl   $0x7,0x210004b0
  movl   $0x210041bd,0x21000488
  ret
```

assistant: ```c
void configureBlePatch(void) {
  uint8_t *pPatchTab = (uint8_t *)(0x21000000 + 0x0398);
  uint32_t *pIrqPatch = (uint32_t *)(0x21000000 + 0x0434);
  pPatchTab[142] = 0;
  pPatchTab[66] = 1;
  pPatchTab[73] = 2;
  pPatchTab[117] = 3;
  pPatchTab[28] = 4;
  pPatchTab[105] = 5;
  pPatchTab[106] = 6;
  pPatchTab[70] = 7;
  pIrqPatch[21] = 0x210041bd;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<configureBlePatch>:
  endbr64
  movl   $0x0,0x210005d0
  movl   $0x1,0x210004a0
  movl   $0x2,0x210004bc
  movl   $0x3,0x2100056c
  movl   $0x4,0x21000408
  movl   $0x5,0x2100053c
  movl   $0x6,0x21000540
  movl   $0x7,0x210004b0
  movl   $0x210041bd,0x21000488
  ret
```

assistant: ```c
void configureBlePatch(void) {
  uint8_t *pPatchTab = (uint8_t *)(0x21000000 + 0x0398);
  uint32_t *pIrqPatch = (uint32_t *)(0x21000000 + 0x0434);
  pPatchTab[142] = 0;
  pPatchTab[66] = 1;
  pPatchTab[73] = 2;
  pPatchTab[117] = 3;
  pPatchTab[28] = 4;
  pPatchTab[105] = 5;
  pPatchTab[106] = 6;
  pPatchTab[70] = 7;
  pIrqPatch[21] = 0x210041bd;
}
```
user: Translate the below assembly code into C programming language:

```asm
<configureBlePatch>:
  endbr64
  movl   $0x0,0x210005d0
  movl   $0x1,0x210004a0
  movl   $0x2,0x210004bc
  movl   $0x3,0x2100056c
  movl   $0x4,0x21000408
  movl   $0x5,0x2100053c
  movl   $0x6,0x21000540
  movl   $0x7,0x210004b0
  movl   $0x210041bd,0x21000488
  ret
```

assistant: ```c
void configureBlePatch(void) {
  uint8_t *pPatchTab = (uint8_t *)(0x21000000 + 0x0398);
  uint32_t *pIrqPatch = (uint32_t *)(0x21000000 + 0x0434);
  pPatchTab[142] = 0;
  pPatchTab[66] = 1;
  pPatchTab[73] = 2;
  pPatchTab[117] = 3;
  pPatchTab[28] = 4;
  pPatchTab[105] = 5;
  pPatchTab[106] = 6;
  pPatchTab[70] = 7;
  pIrqPatch[21] = 0x210041bd;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<mel_get_device_type>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  movl   $0x0,-0x4(%rbp)
  mov    -0x14(%rbp),%eax
  sub    $0x90,%eax
  cmp    $0x68,%eax
  ja     L95
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D15(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D15(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  movl   $0x1,-0x4(%rbp)
  jmp    L95
  movl   $0x2,-0x4(%rbp)
  jmp    L95
  movl   $0x4,-0x4(%rbp)
  jmp    L95
  movl   $0x8,-0x4(%rbp)
  jmp    L95
  movl   $0x10,-0x4(%rbp)
  jmp    L95
  movl   $0x20,-0x4(%rbp)
  jmp    L95
  movl   $0x40,-0x4(%rbp)
  jmp    L95
  movl   $0x100,-0x4(%rbp)
  jmp    L95
  movl   $0x80,-0x4(%rbp)
  jmp    L95
  movl   $0x4000000,-0x4(%rbp)
  jmp    L95
  movl   $0x200,-0x4(%rbp)
  jmp    L95
  movl   $0x2000,-0x4(%rbp)
  jmp    L95
  movl   $0x400,-0x4(%rbp)
  jmp    L95
  movl   $0x800,-0x4(%rbp)
  jmp    L95
  movl   $0x1000,-0x4(%rbp)
  jmp    L95
  movl   $0x4000,-0x4(%rbp)
  jmp    L95
  movl   $0x800000,-0x4(%rbp)
  jmp    L95
  movl   $0x1000000,-0x4(%rbp)
  jmp    L95
  movl   $0x8000,-0x4(%rbp)
  jmp    L95
  movl   $0x10000,-0x4(%rbp)
  jmp    L95
  movl   $0x20000,-0x4(%rbp)
  jmp    L95
  movl   $0x100000,-0x4(%rbp)
  jmp    L95
  movl   $0x200000,-0x4(%rbp)
  jmp    L95
  movl   $0x400000,-0x4(%rbp)
  jmp    L95
  movl   $0x40000,-0x4(%rbp)
  jmp    L95
  movl   $0x80000,-0x4(%rbp)
  jmp    L95
  movl   $0x2000000,-0x4(%rbp)
  nop
L95:
  mov    -0x4(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
unsigned int mel_get_device_type(unsigned int dev_code) {
  unsigned int dtype = (0);
  switch (dev_code) {
  case 0x90:
    dtype = (1 << 0);
    break;
  case 0x98:
    dtype = (1 << 1);
    break;
  case 0x9C:
    dtype = (1 << 2);
    break;
  case 0x9D:
    dtype = (1 << 3);
    break;
  case 0xC2:
    dtype = (1 << 4);
    break;
  case 0xC5:
    dtype = (1 << 5);
    break;
  case 0xA8:
    dtype = (1 << 6);
    break;
  case 0xAE:
    dtype = (1 << 8);
    break;
  case 0xAF:
    dtype = (1 << 7);
    break;
  case 0xD8:
    dtype = (1 << 26);
    break;
  case 0xF0:
    dtype = (1 << 9);
    break;
  case 0xCC:
    dtype = (1 << 13);
    break;
  case 0xF1:
    dtype = (1 << 10);
    break;
  case 0xF2:
    dtype = (1 << 11);
    break;
  case 0xF4:
    dtype = (1 << 12);
    break;
  case 0xCD:
    dtype = (1 << 14);
    break;
  case 0xF8:
    dtype = (1 << 23);
    break;
  case 0xAB:
    dtype = (1 << 24);
    break;
  case 0xE8:
    dtype = (1 << 15);
    break;
  case 0xE9:
    dtype = (1 << 16);
    break;
  case 0xEA:
    dtype = (1 << 17);
    break;
  case 0xD0:
    dtype = (1 << 20);
    break;
  case 0xD1:
    dtype = (1 << 21);
    break;
  case 0xD2:
    dtype = (1 << 22);
    break;
  case 0xEB:
    dtype = (1 << 18);
    break;
  case 0xEC:
    dtype = (1 << 19);
    break;
  case 0xEE:
    dtype = (1 << 25);
    break;
  }
  return (dtype);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<mel_get_device_type>:
  endbr64
  sub    $0x90,%edi
  cmp    $0x68,%edi
  ja     L4
  mov    %edi,%edi
  lea    D8(%rip),%rdx
  movslq (%rdx,%rdi,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  mov    $0x1,%eax
  ret
  mov    $0x2,%eax
  ret
  mov    $0x4,%eax
  ret
  mov    $0x8,%eax
  ret
  mov    $0x10,%eax
  ret
  mov    $0x20,%eax
  ret
  mov    $0x40,%eax
  ret
  mov    $0x100,%eax
  ret
  mov    $0x80,%eax
  ret
  mov    $0x4000000,%eax
  ret
  mov    $0x200,%eax
  ret
  mov    $0x2000,%eax
  ret
  mov    $0x400,%eax
  ret
  mov    $0x800,%eax
  ret
  mov    $0x1000,%eax
  ret
  mov    $0x4000,%eax
  ret
  mov    $0x800000,%eax
  ret
  mov    $0x1000000,%eax
  ret
  mov    $0x8000,%eax
  ret
  mov    $0x10000,%eax
  ret
  mov    $0x20000,%eax
  ret
  mov    $0x100000,%eax
  ret
  mov    $0x200000,%eax
  ret
  mov    $0x400000,%eax
  ret
  mov    $0x40000,%eax
  ret
  mov    $0x80000,%eax
  ret
  mov    $0x2000000,%eax
  ret
L4:
  mov    $0x0,%eax
  ret
```

assistant: ```c
unsigned int mel_get_device_type(unsigned int dev_code) {
  unsigned int dtype = (0);
  switch (dev_code) {
  case 0x90:
    dtype = (1 << 0);
    break;
  case 0x98:
    dtype = (1 << 1);
    break;
  case 0x9C:
    dtype = (1 << 2);
    break;
  case 0x9D:
    dtype = (1 << 3);
    break;
  case 0xC2:
    dtype = (1 << 4);
    break;
  case 0xC5:
    dtype = (1 << 5);
    break;
  case 0xA8:
    dtype = (1 << 6);
    break;
  case 0xAE:
    dtype = (1 << 8);
    break;
  case 0xAF:
    dtype = (1 << 7);
    break;
  case 0xD8:
    dtype = (1 << 26);
    break;
  case 0xF0:
    dtype = (1 << 9);
    break;
  case 0xCC:
    dtype = (1 << 13);
    break;
  case 0xF1:
    dtype = (1 << 10);
    break;
  case 0xF2:
    dtype = (1 << 11);
    break;
  case 0xF4:
    dtype = (1 << 12);
    break;
  case 0xCD:
    dtype = (1 << 14);
    break;
  case 0xF8:
    dtype = (1 << 23);
    break;
  case 0xAB:
    dtype = (1 << 24);
    break;
  case 0xE8:
    dtype = (1 << 15);
    break;
  case 0xE9:
    dtype = (1 << 16);
    break;
  case 0xEA:
    dtype = (1 << 17);
    break;
  case 0xD0:
    dtype = (1 << 20);
    break;
  case 0xD1:
    dtype = (1 << 21);
    break;
  case 0xD2:
    dtype = (1 << 22);
    break;
  case 0xEB:
    dtype = (1 << 18);
    break;
  case 0xEC:
    dtype = (1 << 19);
    break;
  case 0xEE:
    dtype = (1 << 25);
    break;
  }
  return (dtype);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<mel_get_device_type>:
  endbr64
  sub    $0x90,%edi
  xor    %eax,%eax
  cmp    $0x68,%edi
  ja     L5
  lea    D9(%rip),%rax
  mov    (%rax,%rdi,4),%eax
L5:
  ret
```

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

tool: D9: 

assistant: ```c
unsigned int mel_get_device_type(unsigned int dev_code) {
  unsigned int dtype = (0);
  switch (dev_code) {
  case 0x90:
    dtype = (1 << 0);
    break;
  case 0x98:
    dtype = (1 << 1);
    break;
  case 0x9C:
    dtype = (1 << 2);
    break;
  case 0x9D:
    dtype = (1 << 3);
    break;
  case 0xC2:
    dtype = (1 << 4);
    break;
  case 0xC5:
    dtype = (1 << 5);
    break;
  case 0xA8:
    dtype = (1 << 6);
    break;
  case 0xAE:
    dtype = (1 << 8);
    break;
  case 0xAF:
    dtype = (1 << 7);
    break;
  case 0xD8:
    dtype = (1 << 26);
    break;
  case 0xF0:
    dtype = (1 << 9);
    break;
  case 0xCC:
    dtype = (1 << 13);
    break;
  case 0xF1:
    dtype = (1 << 10);
    break;
  case 0xF2:
    dtype = (1 << 11);
    break;
  case 0xF4:
    dtype = (1 << 12);
    break;
  case 0xCD:
    dtype = (1 << 14);
    break;
  case 0xF8:
    dtype = (1 << 23);
    break;
  case 0xAB:
    dtype = (1 << 24);
    break;
  case 0xE8:
    dtype = (1 << 15);
    break;
  case 0xE9:
    dtype = (1 << 16);
    break;
  case 0xEA:
    dtype = (1 << 17);
    break;
  case 0xD0:
    dtype = (1 << 20);
    break;
  case 0xD1:
    dtype = (1 << 21);
    break;
  case 0xD2:
    dtype = (1 << 22);
    break;
  case 0xEB:
    dtype = (1 << 18);
    break;
  case 0xEC:
    dtype = (1 << 19);
    break;
  case 0xEE:
    dtype = (1 << 25);
    break;
  }
  return (dtype);
}
```