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

```asm
<myfunc>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L8
L11:
  addl   $0x1,-0x4(%rbp)
L8:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  movzbl (%rax),%eax
  test   %al,%al
  jne    L11
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void myfunc(char to[], char from[]) {
  int i;
  i = 0;
  while ((to[i] = from[i]) != '\0')
    ++i;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<myfunc>:
  endbr64
  movzbl (%rsi),%eax
  mov    %al,(%rdi)
  test   %al,%al
  je     L10
  mov    $0x1,%eax
L4:
  movzbl (%rsi,%rax,1),%edx
  mov    %dl,(%rdi,%rax,1)
  add    $0x1,%rax
  test   %dl,%dl
  jne    L4
L10:
  ret
```

assistant: ```c
void myfunc(char to[], char from[]) {
  int i;
  i = 0;
  while ((to[i] = from[i]) != '\0')
    ++i;
}
```
user: What is the c source code of the assembly code below?

```asm
<myfunc>:
  endbr64
  movzbl (%rsi),%eax
  mov    %al,(%rdi)
  test   %al,%al
  je     L0
  mov    $0x1,%eax
  nopw   0x0(%rax,%rax,1)
L13:
  movzbl (%rsi,%rax,1),%edx
  mov    %dl,(%rdi,%rax,1)
  add    $0x1,%rax
  test   %dl,%dl
  jne    L13
L0:
  ret
```

assistant: ```c
void myfunc(char to[], char from[]) {
  int i;
  i = 0;
  while ((to[i] = from[i]) != '\0')
    ++i;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<myfunc>:
  endbr64
  movzbl (%rsi),%eax
  mov    %al,(%rdi)
  test   %al,%al
  je     L8
  mov    $0x1,%eax
  nopw   0x0(%rax,%rax,1)
L1:
  movzbl (%rsi,%rax,1),%edx
  mov    %dl,(%rdi,%rax,1)
  add    $0x1,%rax
  test   %dl,%dl
  jne    L1
L8:
  ret
```

assistant: ```c
void myfunc(char to[], char from[]) {
  int i;
  i = 0;
  while ((to[i] = from[i]) != '\0')
    ++i;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<i2c_smbus_add_pec>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    0x8(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  shl    $0x2,%rax
  lea    (%rdx,%rax,1),%rbx
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <i2c_smbus_msg_pec@plt>
  mov    %eax,(%rbx)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,(%rax)
  nop
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
void i2c_smbus_add_pec(struct i2c_msg *msg) {
  msg->buf[msg->len] = i2c_smbus_msg_pec(0, msg);
  msg->len++;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<i2c_smbus_add_pec>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    (%rdi),%rdx
  mov    0x8(%rdi),%rax
  lea    (%rax,%rdx,4),%rbp
  mov    %rdi,%rsi
  mov    $0x0,%edi
  call   <i2c_smbus_msg_pec@plt>
  mov    %eax,0x0(%rbp)
  addq   $0x1,(%rbx)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void i2c_smbus_add_pec(struct i2c_msg *msg) {
  msg->buf[msg->len] = i2c_smbus_msg_pec(0, msg);
  msg->len++;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<i2c_smbus_add_pec>:
  endbr64
  push   %rbp
  mov    %rdi,%rsi
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  mov    (%rdi),%rdx
  mov    0x8(%rdi),%rax
  xor    %edi,%edi
  lea    (%rax,%rdx,4),%rbp
  call   <i2c_smbus_msg_pec@plt>
  mov    %eax,0x0(%rbp)
  addq   $0x1,(%rbx)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void i2c_smbus_add_pec(struct i2c_msg *msg) {
  msg->buf[msg->len] = i2c_smbus_msg_pec(0, msg);
  msg->len++;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<i2c_smbus_add_pec>:
  endbr64
  push   %rbp
  mov    %rdi,%rsi
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  mov    (%rdi),%rdx
  mov    0x8(%rdi),%rax
  xor    %edi,%edi
  lea    (%rax,%rdx,4),%rbp
  call   <i2c_smbus_msg_pec@plt>
  mov    %eax,0x0(%rbp)
  addq   $0x1,(%rbx)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void i2c_smbus_add_pec(struct i2c_msg *msg) {
  msg->buf[msg->len] = i2c_smbus_msg_pec(0, msg);
  msg->len++;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<fork>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  movl   $0x0,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  int    $0x80
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int fork() {
  int int_num = 0;
  int tmp;
  __asm__("int $0x80" : "=a"(tmp) : "a"(int_num));
  return tmp;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<fork>:
  endbr64
  mov    $0x0,%eax
  int    $0x80
  ret
```

assistant: ```c
int fork() {
  int int_num = 0;
  int tmp;
  __asm__("int $0x80" : "=a"(tmp) : "a"(int_num));
  return tmp;
}
```
user: Translate the below assembly code into C programming language:

```asm
<fork>:
  endbr64
  xor    %eax,%eax
  int    $0x80
  ret
```

assistant: ```c
int fork() {
  int int_num = 0;
  int tmp;
  __asm__("int $0x80" : "=a"(tmp) : "a"(int_num));
  return tmp;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<fork>:
  endbr64
  xor    %eax,%eax
  int    $0x80
  ret
```

assistant: ```c
int fork() {
  int int_num = 0;
  int tmp;
  __asm__("int $0x80" : "=a"(tmp) : "a"(int_num));
  return tmp;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<common_depth>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  movl   $0x0,-0x14(%rbp)
L87:
  mov    -0x28(%rbp),%rax
  mov    $0x2f,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L128
  mov    -0x8(%rbp),%rax
  sub    -0x28(%rbp),%rax
  mov    %eax,-0x10(%rbp)
  jmp    L72
L128:
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x10(%rbp)
L72:
  mov    -0x30(%rbp),%rax
  mov    $0x2f,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L109
  mov    -0x8(%rbp),%rax
  sub    -0x30(%rbp),%rax
  mov    %eax,-0xc(%rbp)
  jmp    L45
L109:
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0xc(%rbp)
L45:
  cmpl   $0x0,-0x10(%rbp)
  je     L29
  mov    -0x10(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jne    L29
  mov    -0x10(%rbp),%edx
  mov    -0x30(%rbp),%rcx
  mov    -0x28(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L40
L29:
  mov    -0x14(%rbp),%eax
  jmp    L80
L40:
  mov    -0x10(%rbp),%eax
  cltq
  add    %rax,-0x28(%rbp)
  jmp    L55
L27:
  addq   $0x1,-0x28(%rbp)
L55:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  je     L27
  mov    -0xc(%rbp),%eax
  cltq
  add    %rax,-0x30(%rbp)
  jmp    L113
L89:
  addq   $0x1,-0x30(%rbp)
L113:
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  je     L89
  addl   $0x1,-0x14(%rbp)
  jmp    L87
L80:
  leave
  ret
```

assistant: ```c
int common_depth(char *a, char *b) {
  int depth = 0;
  while (1) {
    char *c;
    int al, bl;
    c = strchr(a, '/');
    if (c)
      al = c - a;
    else
      al = strlen(a);
    c = strchr(b, '/');
    if (c)
      bl = c - b;
    else
      bl = strlen(b);
    if (al == 0 || al != bl || strncmp(a, b, al) != 0)
      return depth;
    a += al;
    while (*a == '/')
      a++;
    b += bl;
    while (*b == '/')
      b++;
    depth++;
  }
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<common_depth>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbp
  mov    %rsi,%rbx
  mov    $0x0,%r14d
  jmp    L92
L45:
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %eax,%r12d
  jmp    L2
L117:
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %eax,%r13d
  jmp    L11
L111:
  add    $0x1,%r14d
L92:
  mov    $0x2f,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L45
  sub    %ebp,%r12d
L2:
  mov    $0x2f,%esi
  mov    %rbx,%rdi
  call   <strchr@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L117
  sub    %ebx,%r13d
L11:
  test   %r12d,%r12d
  je     L8
  cmp    %r13d,%r12d
  jne    L8
  mov    %r12d,%edx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L8
  movslq %r12d,%r12
  add    %r12,%rbp
  cmpb   $0x2f,0x0(%rbp)
  jne    L108
L89:
  add    $0x1,%rbp
  cmpb   $0x2f,0x0(%rbp)
  je     L89
L108:
  movslq %r13d,%r13
  add    %r13,%rbx
  cmpb   $0x2f,(%rbx)
  jne    L111
L48:
  add    $0x1,%rbx
  cmpb   $0x2f,(%rbx)
  je     L48
  jmp    L111
L8:
  mov    %r14d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
int common_depth(char *a, char *b) {
  int depth = 0;
  while (1) {
    char *c;
    int al, bl;
    c = strchr(a, '/');
    if (c)
      al = c - a;
    else
      al = strlen(a);
    c = strchr(b, '/');
    if (c)
      bl = c - b;
    else
      bl = strlen(b);
    if (al == 0 || al != bl || strncmp(a, b, al) != 0)
      return depth;
    a += al;
    while (*a == '/')
      a++;
    b += bl;
    while (*b == '/')
      b++;
    depth++;
  }
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<common_depth>:
  endbr64
  push   %r14
  push   %r13
  xor    %r13d,%r13d
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rsi,%rbx
  nopl   (%rax)
L26:
  mov    $0x2f,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L28
  sub    %ebp,%r12d
L88:
  mov    $0x2f,%esi
  mov    %rbx,%rdi
  call   <strchr@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L117
  sub    %ebx,%r14d
  test   %r12d,%r12d
  je     L3
L69:
  cmp    %r14d,%r12d
  jne    L3
  mov    %r12d,%edx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L3
  movslq %r12d,%r12
  add    %r12,%rbp
  cmpb   $0x2f,0x0(%rbp)
  jne    L82
  nopl   (%rax)
L116:
  add    $0x1,%rbp
  cmpb   $0x2f,0x0(%rbp)
  je     L116
L82:
  movslq %r14d,%r14
  add    %r14,%rbx
  cmpb   $0x2f,(%rbx)
  jne    L97
  nopl   (%rax)
L59:
  add    $0x1,%rbx
  cmpb   $0x2f,(%rbx)
  je     L59
L97:
  add    $0x1,%r13d
  jmp    L26
  nopw   0x0(%rax,%rax,1)
L117:
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %eax,%r14d
  test   %r12d,%r12d
  jne    L69
L3:
  pop    %rbx
  mov    %r13d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L28:
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %eax,%r12d
  jmp    L88
```

assistant: ```c
int common_depth(char *a, char *b) {
  int depth = 0;
  while (1) {
    char *c;
    int al, bl;
    c = strchr(a, '/');
    if (c)
      al = c - a;
    else
      al = strlen(a);
    c = strchr(b, '/');
    if (c)
      bl = c - b;
    else
      bl = strlen(b);
    if (al == 0 || al != bl || strncmp(a, b, al) != 0)
      return depth;
    a += al;
    while (*a == '/')
      a++;
    b += bl;
    while (*b == '/')
      b++;
    depth++;
  }
}
```
user: What is the c source code of the assembly code below:

```asm
<common_depth>:
  endbr64
  push   %r14
  push   %r13
  xor    %r13d,%r13d
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rsi,%rbx
  nopl   (%rax)
L52:
  mov    $0x2f,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L49
  sub    %ebp,%r12d
L75:
  mov    $0x2f,%esi
  mov    %rbx,%rdi
  call   <strchr@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L19
  sub    %ebx,%r14d
  test   %r12d,%r12d
  je     L97
L41:
  cmp    %r14d,%r12d
  jne    L97
  mov    %r12d,%edx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L97
  movslq %r12d,%r12
  add    %r12,%rbp
  cmpb   $0x2f,0x0(%rbp)
  jne    L12
  nopl   (%rax)
L60:
  add    $0x1,%rbp
  cmpb   $0x2f,0x0(%rbp)
  je     L60
L12:
  movslq %r14d,%r14
  add    %r14,%rbx
  cmpb   $0x2f,(%rbx)
  jne    L58
  nopl   (%rax)
L59:
  add    $0x1,%rbx
  cmpb   $0x2f,(%rbx)
  je     L59
L58:
  add    $0x1,%r13d
  jmp    L52
  nopw   0x0(%rax,%rax,1)
L19:
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %eax,%r14d
  test   %r12d,%r12d
  jne    L41
L97:
  pop    %rbx
  mov    %r13d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L49:
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %eax,%r12d
  jmp    L75
```

assistant: ```c
int common_depth(char *a, char *b) {
  int depth = 0;
  while (1) {
    char *c;
    int al, bl;
    c = strchr(a, '/');
    if (c)
      al = c - a;
    else
      al = strlen(a);
    c = strchr(b, '/');
    if (c)
      bl = c - b;
    else
      bl = strlen(b);
    if (al == 0 || al != bl || strncmp(a, b, al) != 0)
      return depth;
    a += al;
    while (*a == '/')
      a++;
    b += bl;
    while (*b == '/')
      b++;
    depth++;
  }
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<BMindex>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x420,%rsp
  mov    %rdi,-0x438(%rbp)
  mov    %esi,-0x43c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  mov    $0x404,%edi
  call   <malloc@plt>
  mov    %rax,%r13
  mov    $0x0,%ebx
  jmp    L77
L41:
  movslq %ebx,%rax
  shl    $0x2,%rax
  add    %r13,%rax
  movl   $0x0,(%rax)
  movslq %ebx,%rax
  mov    -0x43c(%rbp),%edx
  mov    %edx,-0x430(%rbp,%rax,4)
  add    $0x1,%ebx
L77:
  cmp    $0xff,%ebx
  jle    L41
  mov    $0x0,%ebx
  mov    -0x438(%rbp),%r12
  mov    -0x43c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x438(%rbp),%rax
  lea    (%rdx,%rax,1),%r14
  jmp    L83
L67:
  movzbl (%r12),%eax
  movzbl %al,%eax
  shl    $0x2,%rax
  add    %r13,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L51
  add    $0x1,%ebx
  movzbl (%r12),%eax
  movzbl %al,%eax
  shl    $0x2,%rax
  add    %r13,%rax
  mov    %ebx,(%rax)
L51:
  add    $0x1,%r12
L83:
  cmp    %r14,%r12
  jb     L67
  mov    -0x438(%rbp),%r12
  jmp    L39
L42:
  mov    -0x43c(%rbp),%eax
  mov    %r12,%rdx
  sub    -0x438(%rbp),%rdx
  sub    %edx,%eax
  lea    -0x1(%rax),%edx
  movzbl (%r12),%eax
  movzbl %al,%eax
  shl    $0x2,%rax
  add    %r13,%rax
  mov    (%rax),%eax
  cltq
  mov    %edx,-0x430(%rbp,%rax,4)
  add    $0x1,%r12
L39:
  cmp    %r14,%r12
  jb     L42
  mov    $0x0,%ebx
  jmp    L11
L74:
  movslq %ebx,%rax
  shl    $0x2,%rax
  add    %r13,%rax
  mov    (%rax),%eax
  movslq %ebx,%rdx
  shl    $0x2,%rdx
  add    %r13,%rdx
  cltq
  mov    -0x430(%rbp,%rax,4),%eax
  mov    %eax,(%rdx)
  add    $0x1,%ebx
L11:
  cmp    $0xff,%ebx
  jle    L74
  lea    0x400(%r13),%rax
  mov    -0x43c(%rbp),%edx
  mov    %edx,(%rax)
  mov    %r13,%rax
  mov    -0x28(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L79
  call   <__stack_chk_fail@plt>
L79:
  add    $0x420,%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %rbp
  ret
```

assistant: ```c
int *BMindex(unsigned char *pat, int len) {
  register int i;
  register unsigned char *a, *z;
  register int *index = (int *)malloc(sizeof(int) * ((1 << 8) + 1));
  int skip[(1 << 8)];
  for (i = 0; i < (1 << 8); i++) {
    index[i] = '\0';
    skip[i] = len;
  }
  for (i = 0, a = pat, z = pat + len; a < z; a++)
    if (!index[*a])
      index[*a] = ++i;
  for (a = pat; a < z; a++)
    skip[index[*a]] = len - (a - pat) - 1;
  for (i = 0; i < (1 << 8); i++)
    index[i] = skip[index[i]];
  index[(1 << 8)] = len;
  return index;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<BMindex>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x418,%rsp
  mov    %rdi,%rbp
  mov    %esi,%ebx
  mov    %fs:0x28,%rax
  mov    %rax,0x408(%rsp)
  xor    %eax,%eax
  mov    $0x404,%edi
  call   <malloc@plt>
  mov    %rax,%rdi
  lea    0x400(%rax),%rcx
  mov    %rax,%rdx
  mov    %rsp,%rsi
  sub    %rax,%rsi
L1:
  movl   $0x0,(%rdx)
  mov    %ebx,(%rsi,%rdx,1)
  add    $0x4,%rdx
  cmp    %rcx,%rdx
  jne    L1
  movslq %ebx,%rsi
  add    %rbp,%rsi
  cmp    %rsi,%rbp
  jae    L59
  mov    %rbp,%rdx
  mov    $0x0,%r9d
  jmp    L3
L65:
  add    $0x1,%rdx
  cmp    %rdx,%rsi
  je     L21
L3:
  movzbl (%rdx),%r8d
  lea    (%rdi,%r8,4),%r8
  cmpl   $0x0,(%r8)
  jne    L65
  add    $0x1,%r9d
  mov    %r9d,(%r8)
  jmp    L65
L21:
  mov    %rbp,%rdx
  lea    -0x1(%rbx),%r11d
L66:
  movzbl (%rdx),%r8d
  movslq (%rdi,%r8,4),%r8
  mov    %rdx,%r10
  sub    %rbp,%r10
  mov    %r11d,%r9d
  sub    %r10d,%r9d
  mov    %r9d,(%rsp,%r8,4)
  add    $0x1,%rdx
  cmp    %rdx,%rsi
  jne    L66
L59:
  movslq (%rax),%rdx
  mov    (%rsp,%rdx,4),%edx
  mov    %edx,(%rax)
  add    $0x4,%rax
  cmp    %rax,%rcx
  jne    L59
  mov    %ebx,0x400(%rdi)
  mov    0x408(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L2
  mov    %rdi,%rax
  add    $0x418,%rsp
  pop    %rbx
  pop    %rbp
  ret
L2:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int *BMindex(unsigned char *pat, int len) {
  register int i;
  register unsigned char *a, *z;
  register int *index = (int *)malloc(sizeof(int) * ((1 << 8) + 1));
  int skip[(1 << 8)];
  for (i = 0; i < (1 << 8); i++) {
    index[i] = '\0';
    skip[i] = len;
  }
  for (i = 0, a = pat, z = pat + len; a < z; a++)
    if (!index[*a])
      index[*a] = ++i;
  for (a = pat; a < z; a++)
    skip[index[*a]] = len - (a - pat) - 1;
  for (i = 0; i < (1 << 8); i++)
    index[i] = skip[index[i]];
  index[(1 << 8)] = len;
  return index;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<BMindex>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  mov    $0x404,%edi
  push   %rbx
  mov    %esi,%ebx
  sub    $0x418,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x408(%rsp)
  xor    %eax,%eax
  call   <malloc@plt>
  mov    %rsp,%rsi
  mov    %rax,%r8
  lea    0x400(%rax),%rcx
  mov    %rax,%rdx
  sub    %rax,%rsi
  nopw   0x0(%rax,%rax,1)
L48:
  movl   $0x0,(%rdx)
  mov    %ebx,(%rsi,%rdx,1)
  add    $0x4,%rdx
  cmp    %rdx,%rcx
  jne    L48
  movslq %ebx,%rsi
  mov    %rbp,%rdx
  xor    %r9d,%r9d
  add    %rbp,%rsi
  cmp    %rsi,%rbp
  jae    L3
  nopl   0x0(%rax,%rax,1)
L10:
  movzbl (%rdx),%edi
  lea    (%r8,%rdi,4),%rdi
  mov    (%rdi),%r10d
  test   %r10d,%r10d
  jne    L50
  add    $0x1,%r9d
  mov    %r9d,(%rdi)
L50:
  add    $0x1,%rdx
  cmp    %rdx,%rsi
  jne    L10
  lea    -0x1(%rbx),%r11d
  mov    %rbp,%rdx
  cs nopw 0x0(%rax,%rax,1)
L1:
  movzbl (%rdx),%edi
  mov    %rdx,%r10
  mov    %r11d,%r9d
  add    $0x1,%rdx
  sub    %rbp,%r10
  movslq (%r8,%rdi,4),%rdi
  sub    %r10d,%r9d
  mov    %r9d,(%rsp,%rdi,4)
  cmp    %rdx,%rsi
  jne    L1
L3:
  movslq (%rax),%rdx
  add    $0x4,%rax
  mov    (%rsp,%rdx,4),%edx
  mov    %edx,-0x4(%rax)
  cmp    %rax,%rcx
  jne    L3
  mov    %ebx,0x400(%r8)
  mov    0x408(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L39
  add    $0x418,%rsp
  mov    %r8,%rax
  pop    %rbx
  pop    %rbp
  ret
L39:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int *BMindex(unsigned char *pat, int len) {
  register int i;
  register unsigned char *a, *z;
  register int *index = (int *)malloc(sizeof(int) * ((1 << 8) + 1));
  int skip[(1 << 8)];
  for (i = 0; i < (1 << 8); i++) {
    index[i] = '\0';
    skip[i] = len;
  }
  for (i = 0, a = pat, z = pat + len; a < z; a++)
    if (!index[*a])
      index[*a] = ++i;
  for (a = pat; a < z; a++)
    skip[index[*a]] = len - (a - pat) - 1;
  for (i = 0; i < (1 << 8); i++)
    index[i] = skip[index[i]];
  index[(1 << 8)] = len;
  return index;
}
```
user: What is the c source code of the assembly code below:

```asm
<BMindex>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  mov    $0x404,%edi
  push   %rbx
  mov    %esi,%ebx
  sub    $0x418,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x408(%rsp)
  xor    %eax,%eax
  call   <malloc@plt>
  mov    %rsp,%rsi
  lea    0x4(%rax),%rcx
  mov    %rsi,%rdx
  mov    %rax,%r8
  sub    %rcx,%rdx
  cmp    $0x8,%rdx
  jbe    L25
  movd   %ebx,%xmm2
  mov    %rax,%rdx
  pxor   %xmm0,%xmm0
  sub    %rax,%rsi
  pshufd $0x0,%xmm2,%xmm1
  lea    0x400(%rax),%rcx
  nopl   0x0(%rax,%rax,1)
L27:
  movups %xmm0,(%rdx)
  movaps %xmm1,(%rsi,%rdx,1)
  add    $0x10,%rdx
  cmp    %rdx,%rcx
  jne    L27
L37:
  movslq %ebx,%rsi
  mov    %rbp,%rdx
  xor    %r9d,%r9d
  add    %rbp,%rsi
  cmp    %rsi,%rbp
  jae    L12
  nopl   0x0(%rax)
L58:
  movzbl (%rdx),%edi
  lea    (%r8,%rdi,4),%rdi
  mov    (%rdi),%r10d
  test   %r10d,%r10d
  jne    L78
  add    $0x1,%r9d
  mov    %r9d,(%rdi)
L78:
  add    $0x1,%rdx
  cmp    %rdx,%rsi
  jne    L58
  lea    -0x1(%rbx),%r11d
  mov    %rbp,%rdx
  cs nopw 0x0(%rax,%rax,1)
L93:
  movzbl (%rdx),%edi
  mov    %rdx,%r10
  mov    %r11d,%r9d
  add    $0x1,%rdx
  sub    %rbp,%r10
  movslq (%r8,%rdi,4),%rdi
  sub    %r10d,%r9d
  mov    %r9d,(%rsp,%rdi,4)
  cmp    %rdx,%rsi
  jne    L93
L12:
  movslq (%rax),%rdx
  add    $0x4,%rax
  mov    (%rsp,%rdx,4),%edx
  mov    %edx,-0x4(%rax)
  cmp    %rax,%rcx
  jne    L12
  mov    %ebx,0x400(%r8)
  mov    0x408(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L91
  add    $0x418,%rsp
  mov    %r8,%rax
  pop    %rbx
  pop    %rbp
  ret
L25:
  lea    0x400(%rax),%rcx
  mov    %rax,%rdx
  sub    %rax,%rsi
  cs nopw 0x0(%rax,%rax,1)
L92:
  movl   $0x0,(%rdx)
  mov    %ebx,(%rsi,%rdx,1)
  add    $0x4,%rdx
  cmp    %rdx,%rcx
  jne    L92
  jmp    L37
L91:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int *BMindex(unsigned char *pat, int len) {
  register int i;
  register unsigned char *a, *z;
  register int *index = (int *)malloc(sizeof(int) * ((1 << 8) + 1));
  int skip[(1 << 8)];
  for (i = 0; i < (1 << 8); i++) {
    index[i] = '\0';
    skip[i] = len;
  }
  for (i = 0, a = pat, z = pat + len; a < z; a++)
    if (!index[*a])
      index[*a] = ++i;
  for (a = pat; a < z; a++)
    skip[index[*a]] = len - (a - pat) - 1;
  for (i = 0; i < (1 << 8); i++)
    index[i] = skip[index[i]];
  index[(1 << 8)] = len;
  return index;
}
```
user: Translate the below assembly code into C programming language:

```asm
<get_DSC_name>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %esi,-0x28(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x10(%rbp)
  lea    -0x10(%rbp),%rdx
  mov    -0x24(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <dwarf_get_DSC_name@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x10(%rbp),%rdx
  mov    -0x28(%rbp),%ecx
  mov    -0x24(%rbp),%esi
  mov    -0x14(%rbp),%eax
  mov    %ecx,%r8d
  lea    D8(%rip),%rcx
  mov    %eax,%edi
  call   <ellipname@plt>
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L9
  call   <__stack_chk_fail@plt>
L9:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D8
type_guessed: string

tool: D8: DSC

assistant: ```c
const char *get_DSC_name(unsigned int val_in, int printonerr) {
  const char *v = 0;
  int res = dwarf_get_DSC_name(val_in, &v);
  return ellipname(res, val_in, v, "DSC", printonerr);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<get_DSC_name>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %edi,%ebx
  mov    %esi,%ebp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  movq   $0x0,(%rsp)
  mov    %rsp,%rsi
  call   <dwarf_get_DSC_name@plt>
  mov    %eax,%edi
  mov    %ebp,%r8d
  lea    D6(%rip),%rcx
  mov    (%rsp),%rdx
  mov    %ebx,%esi
  call   <ellipname@plt>
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L0
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
L0:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D6
type: string

tool: D6: DSC

assistant: ```c
const char *get_DSC_name(unsigned int val_in, int printonerr) {
  const char *v = 0;
  int res = dwarf_get_DSC_name(val_in, &v);
  return ellipname(res, val_in, v, "DSC", printonerr);
}
```