ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Converte this assembly snippet into its equivalent C code:

```asm
<normalizeAbsFile>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  mov    %edx,%r13d
  push   %r12
  mov    %rsi,%r12
  mov    %edx,%esi
  push   %rbx
  mov    %r12,%rdi
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  movl   $0x1,-0x40(%rbp)
  movl   $0x1,-0x3c(%rbp)
  call   <slashCount@plt>
  mov    %rsp,%rcx
  add    $0x1,%eax
  cltq
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L46
L141:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L141
L46:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L7
L36:
  mov    -0x3c(%rbp),%edi
  mov    %rsp,%r15
  xor    %ebx,%ebx
  nopl   0x0(%rax)
L144:
  cmp    %edi,%r13d
  jle    L20
L76:
  movslq %edi,%rdi
  add    %r12,%rdi
  call   <identifyNamePart@plt>
  cmp    $0x2,%eax
  je     L30
  cmp    $0x3,%eax
  je     L3
  cmp    $0x1,%eax
  je     L84
  test   %ebx,%ebx
  je     L143
  movslq -0x40(%rbp),%rax
  lea    0x1(%rax),%edx
  movb   $0x2f,(%r14,%rax,1)
  mov    %edx,-0x40(%rbp)
L143:
  mov    %r12,%rdx
  lea    -0x3c(%rbp),%rcx
  lea    -0x40(%rbp),%rsi
  mov    %r14,%rdi
  call   <copyPart@plt>
  mov    -0x40(%rbp),%edx
  mov    -0x3c(%rbp),%edi
  movslq %ebx,%rax
  add    $0x1,%ebx
  mov    %edx,(%r15,%rax,4)
  cmp    %edi,%r13d
  jg     L76
L20:
  movslq -0x40(%rbp),%rax
  movb   $0x2f,(%r14)
  movb   $0x0,(%r14,%rax,1)
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L99
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
  nopl   (%rax)
L84:
  mov    -0x3c(%rbp),%eax
  lea    0x2(%rax),%edi
  mov    %edi,-0x3c(%rbp)
  jmp    L144
  xchg   %ax,%ax
L30:
  test   %ebx,%ebx
  je     L89
  mov    %ebx,%edx
  mov    $0x1,%eax
  sub    $0x1,%edx
  je     L48
  sub    $0x2,%ebx
  movslq %ebx,%rbx
  mov    (%r15,%rbx,4),%eax
L48:
  mov    %eax,-0x40(%rbp)
  mov    %edx,%ebx
L89:
  mov    -0x3c(%rbp),%eax
  lea    0x3(%rax),%edi
  mov    %edi,-0x3c(%rbp)
  jmp    L144
  nopl   (%rax)
L3:
  mov    -0x3c(%rbp),%eax
  lea    0x1(%rax),%edi
  mov    %edi,-0x3c(%rbp)
  jmp    L144
  xchg   %ax,%ax
L7:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L36
L99:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void normalizeAbsFile(char *destination, const char *filename, int filenameLen) {
  int di = 1;
  int si = 1;
  int slashes = 0;
  int slash[slashCount(filename, filenameLen) + 1];
  while (si < filenameLen) {
    switch (identifyNamePart(filename + si)) {
    case 1:
      si += 2;
      break;
    case 2:
      if (slashes > 0) {
        --slashes;
        di = slashes > 0 ? slash[slashes - 1] : 1;
      }
      si += 3;
      break;
    case 3:
      ++si;
      break;
    default:
      if (slashes > 0) {
        destination[di++] = '/';
      }
      copyPart(destination, &di, filename, &si);
      slash[slashes++] = di;
    }
  }
  destination[0] = '/';
  destination[di] = 0;
}
```
user: What is the c source code of the assembly code below:

```asm
<foo>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  movl   $0x0,-0x8(%rbp)
  movl   $0x1,-0x4(%rbp)
  mov    -0x4(%rbp),%edx
  mov    -0x8(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x4(%rbp),%edx
  mov    -0x8(%rbp),%eax
  imul   %edx,%eax
  mov    %eax,-0x8(%rbp)
  jmp    L6
L7:
  mov    $0x0,%eax
  call   <foo>
L6:
  mov    -0x8(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  test   %eax,%eax
  jne    L7
  mov    -0x4(%rbp),%eax
  leave
  ret
```

assistant: ```c
__attribute__((never_patch_for_instrumentation)) int foo() {
  volatile unsigned x = 0;
  volatile unsigned y = 1;
  x += y;
  x *= y;
  while (++x)
    foo();
  return y;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<foo>:
  endbr64
  sub    $0x18,%rsp
  movl   $0x0,0x8(%rsp)
  movl   $0x1,0xc(%rsp)
  mov    0xc(%rsp),%edx
  mov    0x8(%rsp),%eax
  add    %edx,%eax
  mov    %eax,0x8(%rsp)
  mov    0xc(%rsp),%edx
  mov    0x8(%rsp),%eax
  imul   %edx,%eax
  mov    %eax,0x8(%rsp)
  mov    0x8(%rsp),%eax
  add    $0x1,%eax
  mov    %eax,0x8(%rsp)
  je     L7
L19:
  mov    $0x0,%eax
  call   <foo>
  mov    0x8(%rsp),%eax
  add    $0x1,%eax
  mov    %eax,0x8(%rsp)
  jne    L19
L7:
  mov    0xc(%rsp),%eax
  add    $0x18,%rsp
  ret
```

assistant: ```c
__attribute__((never_patch_for_instrumentation)) int foo() {
  volatile unsigned x = 0;
  volatile unsigned y = 1;
  x += y;
  x *= y;
  while (++x)
    foo();
  return y;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<foo>:
  endbr64
  sub    $0x18,%rsp
  movl   $0x0,0x8(%rsp)
  movl   $0x1,0xc(%rsp)
  mov    0xc(%rsp),%edx
  mov    0x8(%rsp),%eax
  add    %edx,%eax
  mov    %eax,0x8(%rsp)
  mov    0xc(%rsp),%edx
  mov    0x8(%rsp),%eax
  imul   %edx,%eax
  mov    %eax,0x8(%rsp)
  addl   $0x1,0x8(%rsp)
  je     L0
L14:
  xor    %eax,%eax
  call   <foo>
  addl   $0x1,0x8(%rsp)
  jne    L14
L0:
  mov    0xc(%rsp),%eax
  add    $0x18,%rsp
  ret
```

assistant: ```c
__attribute__((never_patch_for_instrumentation)) int foo() {
  volatile unsigned x = 0;
  volatile unsigned y = 1;
  x += y;
  x *= y;
  while (++x)
    foo();
  return y;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<translate>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x18(%rbp),%rax
  lea    D4(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L0
  mov    -0x8(%rbp),%rax
  lea    D20(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  jmp    L5
L0:
  mov    -0x18(%rbp),%rax
  lea    D21(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L5
  mov    -0x8(%rbp),%rax
  lea    D22(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
L5:
  mov    -0x8(%rbp),%rax
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D4
type_infered: string
name: disassemble_data
arguments: data_label: D20
type_infered: string
name: disassemble_data
arguments: data_label: D21
type_infered: string
name: disassemble_data
arguments: data_label: D22
type_infered: string

tool: D4: string

tool: D20: char *

tool: D21: bool

tool: D22: int

assistant: ```c
char *translate(char *val) {
  char *s;
  s = val;
  if (!strcmp(val, "string")) {
    strcpy(s, "char *");
  } else if (!strcmp(val, "bool")) {
    strcpy(s, "int");
  }
  return s;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<translate>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  lea    D18(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L18
  lea    D10(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L32
L16:
  mov    %rbx,%rax
  pop    %rbx
  ret
L18:
  lea    D33(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  jmp    L16
L32:
  lea    D15(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  jmp    L16
```

tool_calls: name: retrieve_data
arguments: data_tag: D18
type_infered: string
name: retrieve_data
arguments: data_tag: D10
type_infered: string
name: retrieve_data
arguments: data_tag: D33
type_infered: string
name: retrieve_data
arguments: data_tag: D15
type_infered: string

tool: D18: string

tool: D10: bool

tool: D33: char *

tool: D15: int

assistant: ```c
char *translate(char *val) {
  char *s;
  s = val;
  if (!strcmp(val, "string")) {
    strcpy(s, "char *");
  } else if (!strcmp(val, "bool")) {
    strcpy(s, "int");
  }
  return s;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<translate>:
  endbr64
  push   %r12
  lea    D4(%rip),%rsi
  mov    %rdi,%r12
  call   <strcmp@plt>
  test   %eax,%eax
  je     L15
  lea    D21(%rip),%rsi
  mov    %r12,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L11
  mov    %r12,%rax
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L11:
  mov    %r12,%rdi
  lea    D18(%rip),%rsi
  call   <strcpy@plt>
  mov    %r12,%rax
  pop    %r12
  ret
  nopl   (%rax)
L15:
  mov    %r12,%rdi
  lea    D15(%rip),%rsi
  call   <strcpy@plt>
  mov    %r12,%rax
  pop    %r12
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D4
type_infered: string
name: unpack_data
arguments: data_tag: D21
type_infered: string
name: unpack_data
arguments: data_tag: D18
type_infered: string
name: unpack_data
arguments: data_tag: D15
type_infered: string

tool: D4: string

tool: D21: bool

tool: D18: int

tool: D15: char *

assistant: ```c
char *translate(char *val) {
  char *s;
  s = val;
  if (!strcmp(val, "string")) {
    strcpy(s, "char *");
  } else if (!strcmp(val, "bool")) {
    strcpy(s, "int");
  }
  return s;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<translate>:
  endbr64
  push   %r12
  lea    D9(%rip),%rsi
  mov    %rdi,%r12
  call   <strcmp@plt>
  test   %eax,%eax
  je     L12
  lea    D36(%rip),%rsi
  mov    %r12,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L15
  mov    %r12,%rax
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L15:
  mov    %r12,%rdi
  lea    D25(%rip),%rsi
  call   <strcpy@plt>
  mov    %r12,%rax
  pop    %r12
  ret
  nopl   (%rax)
L12:
  mov    %r12,%rdi
  lea    D27(%rip),%rsi
  call   <strcpy@plt>
  mov    %r12,%rax
  pop    %r12
  ret
```

tool_calls: name: read_data
arguments: tag: D9
datatype: string
name: read_data
arguments: tag: D36
datatype: string
name: read_data
arguments: tag: D25
datatype: string
name: read_data
arguments: tag: D27
datatype: string

tool: D9: string

tool: D36: bool

tool: D25: int

tool: D27: char *

assistant: ```c
char *translate(char *val) {
  char *s;
  s = val;
  if (!strcmp(val, "string")) {
    strcpy(s, "char *");
  } else if (!strcmp(val, "bool")) {
    strcpy(s, "int");
  }
  return s;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<udelay>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x24(%rbp),%eax
  mov    %eax,%eax
  imul   $0x431bde83,%rax,%rax
  shr    $0x20,%rax
  shr    $0x12,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x24(%rbp),%edx
  mov    %edx,%eax
  imul   $0x431bde83,%rax,%rax
  shr    $0x20,%rax
  shr    $0x12,%eax
  imul   $0xf4240,%eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  imul   $0x3e8,%eax,%eax
  mov    %eax,-0xc(%rbp)
  jmp    L16
L3:
  mov    D2(%rip),%rax
  mov    (%rax),%rdx
  mov    D4(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jne    L8
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x10(%rbp)
L16:
  lea    -0x18(%rbp),%rdx
  lea    -0x10(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <nanosleep@plt>
  test   %rax,%rax
  jne    L3
  jmp    L38
L8:
  nop
L38:
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L22
  call   <__stack_chk_fail@plt>
L22:
  leave
  ret
```

assistant: ```c
void udelay(unsigned us) {
  struct timespec rem, req = {
                           .tv_sec = us / 1000000,
                           .tv_nsec = (us % 1000000) * 1000,
                       };
  while (nanosleep(&req, &rem)) {
    if (errno != EINTR)
      break;
    req = rem;
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<udelay>:
  endbr64
  push   %rbx
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %edi,%eax
  imul   $0x431bde83,%rax,%rax
  shr    $0x32,%rax
  mov    %eax,0x10(%rsp)
  imul   $0xf4240,%eax,%eax
  sub    %eax,%edi
  imul   $0x3e8,%edi,%edi
  mov    %edi,0x14(%rsp)
  lea    0x8(%rsp),%rbx
  jmp    L29
L37:
  mov    0x8(%rsp),%rax
  mov    %rax,0x10(%rsp)
L29:
  lea    0x10(%rsp),%rdi
  mov    %rbx,%rsi
  call   <nanosleep@plt>
  test   %rax,%rax
  je     L31
  mov    D14(%rip),%rdx
  mov    D18(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,(%rdx)
  je     L37
L31:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  add    $0x20,%rsp
  pop    %rbx
  ret
L5:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void udelay(unsigned us) {
  struct timespec rem, req = {
                           .tv_sec = us / 1000000,
                           .tv_nsec = (us % 1000000) * 1000,
                       };
  while (nanosleep(&req, &rem)) {
    if (errno != EINTR)
      break;
    req = rem;
  }
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<udelay>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %edi,%eax
  lea    0x8(%rsp),%rbp
  lea    0x10(%rsp),%rbx
  imul   $0x431bde83,%rax,%rax
  shr    $0x32,%rax
  mov    %eax,0x10(%rsp)
  imul   $0xf4240,%eax,%eax
  sub    %eax,%edi
  imul   $0x3e8,%edi,%edi
  mov    %edi,0x14(%rsp)
  jmp    L36
  nopl   0x0(%rax)
L4:
  mov    D7(%rip),%rax
  mov    D6(%rip),%rdx
  mov    (%rax),%rax
  cmp    %rax,(%rdx)
  jne    L3
  mov    0x8(%rsp),%rax
  mov    %rax,0x10(%rsp)
L36:
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <nanosleep@plt>
  test   %rax,%rax
  jne    L4
L3:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L32
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  ret
L32:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void udelay(unsigned us) {
  struct timespec rem, req = {
                           .tv_sec = us / 1000000,
                           .tv_nsec = (us % 1000000) * 1000,
                       };
  while (nanosleep(&req, &rem)) {
    if (errno != EINTR)
      break;
    req = rem;
  }
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<udelay>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %edi,%eax
  lea    0x10(%rsp),%rbp
  lea    0x8(%rsp),%rbx
  imul   $0x431bde83,%rax,%rax
  shr    $0x32,%rax
  imul   $0xf4240,%eax,%edx
  movd   %eax,%xmm0
  sub    %edx,%edi
  imul   $0x3e8,%edi,%edi
  movd   %edi,%xmm1
  punpckldq %xmm1,%xmm0
  movq   %xmm0,0x8(%rsp)
  jmp    L36
  nopl   0x0(%rax,%rax,1)
L8:
  mov    D19(%rip),%rax
  mov    D9(%rip),%rdx
  mov    (%rax),%rax
  cmp    %rax,(%rdx)
  jne    L19
  mov    0x10(%rsp),%rax
  mov    %rax,0x8(%rsp)
L36:
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <nanosleep@plt>
  test   %rax,%rax
  jne    L8
L19:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L7
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  ret
L7:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void udelay(unsigned us) {
  struct timespec rem, req = {
                           .tv_sec = us / 1000000,
                           .tv_nsec = (us % 1000000) * 1000,
                       };
  while (nanosleep(&req, &rem)) {
    if (errno != EINTR)
      break;
    req = rem;
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<sg_scsi_sense_desc_find>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %edx,-0x30(%rbp)
  cmpl   $0x7,-0x2c(%rbp)
  jle    L39
  mov    -0x28(%rbp),%rax
  add    $0x7,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x10(%rbp)
  cmpl   $0x0,-0x10(%rbp)
  jne    L72
L39:
  mov    $0x0,%eax
  jmp    L137
L72:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x71,%al
  jbe    L41
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x73,%al
  jbe    L105
L41:
  mov    $0x0,%eax
  jmp    L137
L105:
  mov    -0x2c(%rbp),%eax
  lea    -0x8(%rax),%edx
  mov    -0x10(%rbp),%eax
  cmp    %edx,%eax
  cmovg  %edx,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x18(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L69
L67:
  mov    -0x18(%rbp),%eax
  cltq
  add    %rax,-0x8(%rbp)
  mov    -0x10(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x14(%rbp)
  jge    L101
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  jmp    L118
L101:
  mov    $0xffffffff,%eax
L118:
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  add    $0x2,%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  cmp    %eax,-0x30(%rbp)
  jne    L18
  mov    -0x8(%rbp),%rax
  jmp    L137
L18:
  cmpl   $0x0,-0xc(%rbp)
  js     L60
  mov    -0x18(%rbp),%eax
  add    %eax,-0x14(%rbp)
L69:
  mov    -0x14(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jl     L67
  jmp    L138
L60:
  nop
L138:
  mov    $0x0,%eax
L137:
  pop    %rbp
  ret
```

assistant: ```c
const unsigned char *sg_scsi_sense_desc_find(const unsigned char *sensep, int sense_len, int desc_type) {
  int add_sen_len, add_len, desc_len, k;
  const unsigned char *descp;
  if ((sense_len < 8) || (0 == (add_sen_len = sensep[7])))
    return NULL;
  if ((sensep[0] < 0x72) || (sensep[0] > 0x73))
    return NULL;
  add_sen_len = (add_sen_len < (sense_len - 8)) ? add_sen_len : (sense_len - 8);
  descp = &sensep[8];
  for (desc_len = 0, k = 0; k < add_sen_len; k += desc_len) {
    descp += desc_len;
    add_len = (k < (add_sen_len - 1)) ? descp[1] : -1;
    desc_len = add_len + 2;
    if (descp[0] == desc_type)
      return descp;
    if (add_len < 0)
      break;
  }
  return NULL;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<sg_scsi_sense_desc_find>:
  endbr64
  cmp    $0x7,%esi
  jle    L14
  movzbl 0x7(%rdi),%r8d
  test   %r8d,%r8d
  je     L47
  movzbl (%rdi),%eax
  sub    $0x72,%eax
  mov    $0x0,%ecx
  cmp    $0x1,%al
  ja     L29
  sub    $0x8,%esi
  cmp    %r8d,%esi
  cmovle %esi,%r8d
  lea    0x8(%rdi),%rcx
  test   %r8d,%r8d
  jle    L23
  mov    $0x0,%esi
  mov    $0x0,%eax
  lea    -0x1(%r8),%edi
  jmp    L105
L35:
  movzbl (%rcx),%eax
  cmp    %edx,%eax
  mov    $0x0,%eax
  cmovne %rax,%rcx
L29:
  mov    %rcx,%rax
  ret
L122:
  add    %eax,%esi
  cmp    %esi,%r8d
  jle    L27
L105:
  cltq
  add    %rax,%rcx
  cmp    %esi,%edi
  jle    L35
  movzbl 0x1(%rcx),%eax
  add    $0x2,%eax
  movzbl (%rcx),%r9d
  cmp    %r9d,%edx
  jne    L122
  jmp    L29
L27:
  mov    $0x0,%ecx
  jmp    L29
L14:
  mov    $0x0,%ecx
  jmp    L29
L47:
  mov    $0x0,%ecx
  jmp    L29
L23:
  mov    $0x0,%ecx
  jmp    L29
```

assistant: ```c
const unsigned char *sg_scsi_sense_desc_find(const unsigned char *sensep, int sense_len, int desc_type) {
  int add_sen_len, add_len, desc_len, k;
  const unsigned char *descp;
  if ((sense_len < 8) || (0 == (add_sen_len = sensep[7])))
    return NULL;
  if ((sensep[0] < 0x72) || (sensep[0] > 0x73))
    return NULL;
  add_sen_len = (add_sen_len < (sense_len - 8)) ? add_sen_len : (sense_len - 8);
  descp = &sensep[8];
  for (desc_len = 0, k = 0; k < add_sen_len; k += desc_len) {
    descp += desc_len;
    add_len = (k < (add_sen_len - 1)) ? descp[1] : -1;
    desc_len = add_len + 2;
    if (descp[0] == desc_type)
      return descp;
    if (add_len < 0)
      break;
  }
  return NULL;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<sg_scsi_sense_desc_find>:
  endbr64
  cmp    $0x7,%esi
  jle    L0
  movzbl 0x7(%rdi),%ecx
  test   %ecx,%ecx
  je     L0
  movzbl (%rdi),%eax
  xor    %r8d,%r8d
  sub    $0x72,%eax
  cmp    $0x1,%al
  ja     L18
  sub    $0x8,%esi
  lea    0x8(%rdi),%r8
  cmp    %ecx,%esi
  cmovg  %ecx,%esi
  test   %esi,%esi
  je     L0
  mov    %esi,%edi
  sub    $0x1,%edi
  je     L56
  xor    %ecx,%ecx
  nopw   0x0(%rax,%rax,1)
L68:
  movzbl 0x1(%r8),%eax
  movzbl (%r8),%r9d
  add    $0x2,%eax
  cmp    %edx,%r9d
  je     L18
  add    %eax,%ecx
  cmp    %ecx,%esi
  jle    L0
  cltq
  add    %rax,%r8
  cmp    %edi,%ecx
  jl     L68
L56:
  movzbl (%r8),%eax
  cmp    %eax,%edx
  mov    $0x0,%eax
  cmovne %rax,%r8
L18:
  mov    %r8,%rax
  ret
  nopl   0x0(%rax,%rax,1)
L0:
  xor    %r8d,%r8d
  mov    %r8,%rax
  ret
```

assistant: ```c
const unsigned char *sg_scsi_sense_desc_find(const unsigned char *sensep, int sense_len, int desc_type) {
  int add_sen_len, add_len, desc_len, k;
  const unsigned char *descp;
  if ((sense_len < 8) || (0 == (add_sen_len = sensep[7])))
    return NULL;
  if ((sensep[0] < 0x72) || (sensep[0] > 0x73))
    return NULL;
  add_sen_len = (add_sen_len < (sense_len - 8)) ? add_sen_len : (sense_len - 8);
  descp = &sensep[8];
  for (desc_len = 0, k = 0; k < add_sen_len; k += desc_len) {
    descp += desc_len;
    add_len = (k < (add_sen_len - 1)) ? descp[1] : -1;
    desc_len = add_len + 2;
    if (descp[0] == desc_type)
      return descp;
    if (add_len < 0)
      break;
  }
  return NULL;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<sg_scsi_sense_desc_find>:
  endbr64
  cmp    $0x7,%esi
  jle    L75
  movzbl 0x7(%rdi),%ecx
  test   %ecx,%ecx
  je     L75
  movzbl (%rdi),%eax
  xor    %r8d,%r8d
  sub    $0x72,%eax
  cmp    $0x1,%al
  ja     L49
  sub    $0x8,%esi
  lea    0x8(%rdi),%r8
  cmp    %ecx,%esi
  cmovg  %ecx,%esi
  test   %esi,%esi
  je     L75
  mov    %esi,%edi
  sub    $0x1,%edi
  je     L73
  xor    %ecx,%ecx
  nopw   0x0(%rax,%rax,1)
L66:
  movzbl 0x1(%r8),%eax
  movzbl (%r8),%r9d
  add    $0x2,%eax
  cmp    %edx,%r9d
  je     L49
  add    %eax,%ecx
  cmp    %ecx,%esi
  jle    L75
  cltq
  add    %rax,%r8
  cmp    %edi,%ecx
  jl     L66
L73:
  movzbl (%r8),%eax
  cmp    %eax,%edx
  mov    $0x0,%eax
  cmovne %rax,%r8
L49:
  mov    %r8,%rax
  ret
  nopl   0x0(%rax,%rax,1)
L75:
  xor    %r8d,%r8d
  mov    %r8,%rax
  ret
```

assistant: ```c
const unsigned char *sg_scsi_sense_desc_find(const unsigned char *sensep, int sense_len, int desc_type) {
  int add_sen_len, add_len, desc_len, k;
  const unsigned char *descp;
  if ((sense_len < 8) || (0 == (add_sen_len = sensep[7])))
    return NULL;
  if ((sensep[0] < 0x72) || (sensep[0] > 0x73))
    return NULL;
  add_sen_len = (add_sen_len < (sense_len - 8)) ? add_sen_len : (sense_len - 8);
  descp = &sensep[8];
  for (desc_len = 0, k = 0; k < add_sen_len; k += desc_len) {
    descp += desc_len;
    add_len = (k < (add_sen_len - 1)) ? descp[1] : -1;
    desc_len = add_len + 2;
    if (descp[0] == desc_type)
      return descp;
    if (add_len < 0)
      break;
  }
  return NULL;
}
```