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

```asm
<Variance>:
  endbr64
  cmp    %esi,%edi
  jle    L6
  movslq %esi,%rsi
  movslq %edi,%rdi
  mov    (%rdx,%rsi,8),%rax
  movsd  (%rax,%rdi,8),%xmm0
  ret
L6:
  movslq %edi,%rdi
  movslq %esi,%rsi
  mov    (%rdx,%rdi,8),%rax
  movsd  (%rax,%rsi,8),%xmm0
  ret
```

assistant: ```c
double Variance(int i, int j, double **delta) {
  if (i > j)
    return (delta[j][i]);
  else
    return (delta[i][j]);
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<Variance>:
  endbr64
  movslq %edi,%rcx
  movslq %esi,%rax
  cmp    %esi,%edi
  jle    L7
  mov    (%rdx,%rax,8),%rax
  movsd  (%rax,%rcx,8),%xmm0
  ret
  nopl   0x0(%rax,%rax,1)
L7:
  mov    (%rdx,%rcx,8),%rdx
  movsd  (%rdx,%rax,8),%xmm0
  ret
```

assistant: ```c
double Variance(int i, int j, double **delta) {
  if (i > j)
    return (delta[j][i]);
  else
    return (delta[i][j]);
}
```
user: What is the c source code of the assembly code below?

```asm
<Variance>:
  endbr64
  movslq %edi,%rcx
  movslq %esi,%rax
  cmp    %esi,%edi
  jle    L9
  mov    (%rdx,%rax,8),%rax
  movsd  (%rax,%rcx,8),%xmm0
  ret
  nopl   0x0(%rax,%rax,1)
L9:
  mov    (%rdx,%rcx,8),%rdx
  movsd  (%rdx,%rax,8),%xmm0
  ret
```

assistant: ```c
double Variance(int i, int j, double **delta) {
  if (i > j)
    return (delta[j][i]);
  else
    return (delta[i][j]);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<link_name>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %esi,-0x4c(%rbp)
  mov    %edx,-0x50(%rbp)
  mov    %ecx,-0x54(%rbp)
  mov    %r8,-0x60(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x60(%rbp),%rcx
  mov    -0x54(%rbp),%edx
  lea    -0x30(%rbp),%rax
  lea    D2(%rip),%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  mov    -0x48(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  mov    $0x7f,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <readlink@plt>
  mov    %eax,-0x3c(%rbp)
  cmpl   $0xffffffff,-0x3c(%rbp)
  jne    L22
  mov    $0x0,%eax
  jmp    L19
L22:
  mov    -0x3c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  lea    -0x38(%rbp),%rdx
  mov    -0x48(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <stat@plt>
  test   %rax,%rax
  jns    L52
  mov    $0x0,%eax
  jmp    L19
L52:
  mov    -0x38(%rbp),%rax
  movzbl %al,%edx
  mov    -0x38(%rbp),%rax
  shr    $0xc,%eax
  and    $0xfff00,%eax
  or     %edx,%eax
  cmp    %eax,-0x50(%rbp)
  je     L39
  mov    $0x0,%eax
  jmp    L19
L39:
  mov    -0x38(%rbp),%rax
  shr    $0x8,%eax
  and    $0xfff,%eax
  cmp    %eax,-0x4c(%rbp)
  je     L0
  mov    $0x0,%eax
  jmp    L19
L0:
  mov    $0x1,%eax
L19:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L27
  call   <__stack_chk_fail@plt>
L27:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D2
datatype: string

tool: D2: /proc/%d/%s

assistant: ```c
int link_name(char *restrict const buf, unsigned maj, unsigned min, int pid, const char *restrict name) {
  struct stat sbuf;
  char path[32];
  int count;
  sprintf(path, "/proc/%d/%s", pid, name);
  count = readlink(path, buf, 128 - 1);
  if (count == -1)
    return 0;
  buf[count] = '\0';
  if (stat(buf, &sbuf) < 0)
    return 0;
  if (min != (((unsigned)(sbuf.st_rdev) & 0xffu) | (((unsigned)(sbuf.st_rdev) & 0xfff00000u) >> 12u)))
    return 0;
  if (maj != (((unsigned)(sbuf.st_rdev) >> 8u) & 0xfffu))
    return 0;
  return 1;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<link_name>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,%rbx
  mov    %esi,%r12d
  mov    %edx,%ebp
  mov    %ecx,%edx
  mov    %r8,%rcx
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%r13
  lea    D7(%rip),%rsi
  mov    %r13,%rdi
  call   <sprintf@plt>
  mov    $0x7f,%edx
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <readlink@plt>
  mov    $0x0,%edx
  cmp    $0xffffffff,%eax
  je     L19
  cltq
  movb   $0x0,(%rbx,%rax,1)
  lea    0x8(%rsp),%rsi
  mov    %rbx,%rdi
  call   <stat@plt>
  mov    $0x0,%edx
  test   %rax,%rax
  js     L19
  mov    0x8(%rsp),%rcx
  mov    %ecx,%eax
  shr    $0xc,%eax
  and    $0xfff00,%eax
  movzbl %cl,%edx
  or     %edx,%eax
  mov    $0x0,%edx
  cmp    %ebp,%eax
  jne    L19
  shr    $0x8,%ecx
  and    $0xfff,%ecx
  cmp    %r12d,%ecx
  sete   %dl
  movzbl %dl,%edx
L19:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L9
  mov    %edx,%eax
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L9:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D7
data_type: string

tool: D7: /proc/%d/%s

assistant: ```c
int link_name(char *restrict const buf, unsigned maj, unsigned min, int pid, const char *restrict name) {
  struct stat sbuf;
  char path[32];
  int count;
  sprintf(path, "/proc/%d/%s", pid, name);
  count = readlink(path, buf, 128 - 1);
  if (count == -1)
    return 0;
  buf[count] = '\0';
  if (stat(buf, &sbuf) < 0)
    return 0;
  if (min != (((unsigned)(sbuf.st_rdev) & 0xffu) | (((unsigned)(sbuf.st_rdev) & 0xfff00000u) >> 12u)))
    return 0;
  if (maj != (((unsigned)(sbuf.st_rdev) >> 8u) & 0xfffu))
    return 0;
  return 1;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<link_name>:
  endbr64
  push   %r13
  push   %r12
  mov    %esi,%r12d
  lea    D7(%rip),%rsi
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %edx,%ebx
  mov    %ecx,%edx
  mov    %r8,%rcx
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%r13
  mov    %r13,%rdi
  call   <sprintf@plt>
  mov    $0x7f,%edx
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <readlink@plt>
  cmp    $0xffffffff,%eax
  je     L25
  cltq
  lea    0x8(%rsp),%rsi
  mov    %rbp,%rdi
  movb   $0x0,0x0(%rbp,%rax,1)
  call   <stat@plt>
  test   %rax,%rax
  js     L25
  mov    0x8(%rsp),%rdx
  mov    %edx,%eax
  movzbl %dl,%ecx
  shr    $0xc,%eax
  and    $0xfff00,%eax
  or     %ecx,%eax
  cmp    %ebx,%eax
  jne    L25
  shr    $0x8,%edx
  xor    %eax,%eax
  and    $0xfff,%edx
  cmp    %r12d,%edx
  sete   %al
  jmp    L9
  nopl   0x0(%rax,%rax,1)
L25:
  xor    %eax,%eax
L9:
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L7
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L7:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D7
type: string

tool: D7: /proc/%d/%s

assistant: ```c
int link_name(char *restrict const buf, unsigned maj, unsigned min, int pid, const char *restrict name) {
  struct stat sbuf;
  char path[32];
  int count;
  sprintf(path, "/proc/%d/%s", pid, name);
  count = readlink(path, buf, 128 - 1);
  if (count == -1)
    return 0;
  buf[count] = '\0';
  if (stat(buf, &sbuf) < 0)
    return 0;
  if (min != (((unsigned)(sbuf.st_rdev) & 0xffu) | (((unsigned)(sbuf.st_rdev) & 0xfff00000u) >> 12u)))
    return 0;
  if (maj != (((unsigned)(sbuf.st_rdev) >> 8u) & 0xfffu))
    return 0;
  return 1;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<link_name>:
  endbr64
  push   %r13
  push   %r12
  mov    %esi,%r12d
  lea    D1(%rip),%rsi
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %edx,%ebx
  mov    %ecx,%edx
  mov    %r8,%rcx
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%r13
  mov    %r13,%rdi
  call   <sprintf@plt>
  mov    $0x7f,%edx
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <readlink@plt>
  cmp    $0xffffffff,%eax
  je     L21
  cltq
  lea    0x8(%rsp),%rsi
  mov    %rbp,%rdi
  movb   $0x0,0x0(%rbp,%rax,1)
  call   <stat@plt>
  test   %rax,%rax
  js     L21
  mov    0x8(%rsp),%rdx
  mov    %edx,%eax
  movzbl %dl,%ecx
  shr    $0xc,%eax
  and    $0xfff00,%eax
  or     %ecx,%eax
  cmp    %ebx,%eax
  jne    L21
  shr    $0x8,%edx
  xor    %eax,%eax
  and    $0xfff,%edx
  cmp    %r12d,%edx
  sete   %al
  jmp    L6
  nopl   0x0(%rax,%rax,1)
L21:
  xor    %eax,%eax
L6:
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L10
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L10:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D1
type: string

tool: D1: /proc/%d/%s

assistant: ```c
int link_name(char *restrict const buf, unsigned maj, unsigned min, int pid, const char *restrict name) {
  struct stat sbuf;
  char path[32];
  int count;
  sprintf(path, "/proc/%d/%s", pid, name);
  count = readlink(path, buf, 128 - 1);
  if (count == -1)
    return 0;
  buf[count] = '\0';
  if (stat(buf, &sbuf) < 0)
    return 0;
  if (min != (((unsigned)(sbuf.st_rdev) & 0xffu) | (((unsigned)(sbuf.st_rdev) & 0xfff00000u) >> 12u)))
    return 0;
  if (maj != (((unsigned)(sbuf.st_rdev) >> 8u) & 0xfffu))
    return 0;
  return 1;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<stdlib_strided_dnanrange>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  cmpq   $0x0,-0x38(%rbp)
  jg     L48
  pxor   %xmm0,%xmm0
  divsd  %xmm0,%xmm0
  jmp    L147
L48:
  cmpq   $0x1,-0x38(%rbp)
  je     L179
  cmpq   $0x0,-0x48(%rbp)
  jne    L49
L179:
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  movq   %rax,%xmm0
  call   <stdlib_base_is_nan@plt>
  test   %rax,%rax
  je     L21
  mov    -0x40(%rbp),%rax
  movsd  (%rax),%xmm0
  jmp    L147
L21:
  pxor   %xmm0,%xmm0
  jmp    L147
L49:
  cmpq   $0x0,-0x48(%rbp)
  jns    L54
  mov    $0x1,%eax
  sub    -0x38(%rbp),%rax
  mov    -0x48(%rbp),%rdx
  imul   %rdx,%rax
  mov    %rax,-0x18(%rbp)
  jmp    L44
L54:
  movq   $0x0,-0x18(%rbp)
L44:
  movq   $0x0,-0x10(%rbp)
  jmp    L9
L35:
  mov    -0x18(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x8(%rbp),%xmm0
  ucomisd -0x8(%rbp),%xmm0
  jnp    L118
  mov    -0x48(%rbp),%rax
  add    %rax,-0x18(%rbp)
  addq   $0x1,-0x10(%rbp)
L9:
  mov    -0x10(%rbp),%rax
  cmp    -0x38(%rbp),%rax
  jl     L35
  jmp    L36
L118:
  nop
L36:
  mov    -0x10(%rbp),%rax
  cmp    -0x38(%rbp),%rax
  jne    L107
  pxor   %xmm0,%xmm0
  divsd  %xmm0,%xmm0
  jmp    L147
L107:
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  -0x20(%rbp),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  addq   $0x1,-0x10(%rbp)
  jmp    L5
L38:
  mov    -0x48(%rbp),%rax
  add    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movq   %rax,%xmm0
  call   <stdlib_base_is_nan@plt>
  test   %rax,%rax
  jne    L133
  movsd  -0x20(%rbp),%xmm0
  comisd -0x8(%rbp),%xmm0
  jbe    L158
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  jmp    L170
L158:
  movsd  -0x8(%rbp),%xmm0
  comisd -0x28(%rbp),%xmm0
  jbe    L170
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  jmp    L170
L133:
  nop
L170:
  addq   $0x1,-0x10(%rbp)
L5:
  mov    -0x10(%rbp),%rax
  cmp    -0x38(%rbp),%rax
  jl     L38
  movsd  -0x28(%rbp),%xmm0
  subsd  -0x20(%rbp),%xmm0
L147:
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  leave
  ret
```

assistant: ```c
double stdlib_strided_dnanrange(const int64_t N, const double *X, const int64_t stride) {
  double max;
  double min;
  int64_t ix;
  int64_t i;
  double v;
  if (N <= 0) {
    return 0.0 / 0.0;
  }
  if (N == 1 || stride == 0) {
    if (stdlib_base_is_nan(X[0])) {
      return X[0];
    }
    return 0.0;
  }
  if (stride < 0) {
    ix = (1 - N) * stride;
  } else {
    ix = 0;
  }
  for (i = 0; i < N; i++) {
    v = X[ix];
    if (v == v) {
      break;
    }
    ix += stride;
  }
  if (i == N) {
    return 0.0 / 0.0;
  }
  min = v;
  max = min;
  i += 1;
  for (; i < N; i++) {
    ix += stride;
    v = X[ix];
    if (stdlib_base_is_nan(v)) {
      continue;
    }
    if (v < min) {
      min = v;
    } else if (v > max) {
      max = v;
    }
  }
  return max - min;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<stdlib_strided_dnanrange>:
  endbr64
  test   %rdi,%rdi
  jle    L162
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r12
  mov    %rsi,%r13
  cmp    $0x1,%rdi
  je     L111
  test   %rdx,%rdx
  je     L111
  mov    $0x0,%eax
  js     L80
L7:
  mov    $0x0,%ebx
L44:
  mov    0x0(%r13,%rax,8),%rbp
  movq   %rbp,%xmm1
  ucomisd %xmm1,%xmm1
  jnp    L82
  add    %rdx,%rax
  add    $0x1,%rbx
  cmp    %rbx,%r12
  jne    L44
L113:
  pxor   %xmm0,%xmm0
  divsd  %xmm0,%xmm0
  jmp    L88
L162:
  pxor   %xmm0,%xmm0
  divsd  %xmm0,%xmm0
  ret
L111:
  movsd  0x0(%r13),%xmm0
  call   <stdlib_base_is_nan@plt>
  pxor   %xmm0,%xmm0
  test   %rax,%rax
  je     L88
  movsd  0x0(%r13),%xmm0
  jmp    L88
L80:
  mov    $0x1,%eax
  sub    %rdi,%rax
  imul   %rdx,%rax
  jmp    L7
L82:
  cmp    %rbx,%r12
  je     L113
  add    $0x1,%rbx
  cmp    %rbx,%r12
  jle    L26
  lea    0x0(,%rdx,8),%r15
  add    %rax,%rdx
  lea    0x0(%r13,%rdx,8),%r14
  mov    %rbp,0x8(%rsp)
  jmp    L53
L145:
  mov    %r13,0x8(%rsp)
L153:
  add    $0x1,%rbx
  add    %r15,%r14
  cmp    %rbx,%r12
  je     L107
L53:
  mov    (%r14),%r13
  movq   %r13,%xmm0
  call   <stdlib_base_is_nan@plt>
  test   %rax,%rax
  jne    L153
  movsd  0x8(%rsp),%xmm2
  movq   %r13,%xmm3
  comisd %xmm3,%xmm2
  ja     L145
  movq   %r13,%xmm4
  movq   %rbp,%xmm5
  maxsd  %xmm5,%xmm4
  movq   %xmm4,%rbp
  jmp    L153
L26:
  mov    %rbp,0x8(%rsp)
L107:
  movq   %rbp,%xmm0
  subsd  0x8(%rsp),%xmm0
L88:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
double stdlib_strided_dnanrange(const int64_t N, const double *X, const int64_t stride) {
  double max;
  double min;
  int64_t ix;
  int64_t i;
  double v;
  if (N <= 0) {
    return 0.0 / 0.0;
  }
  if (N == 1 || stride == 0) {
    if (stdlib_base_is_nan(X[0])) {
      return X[0];
    }
    return 0.0;
  }
  if (stride < 0) {
    ix = (1 - N) * stride;
  } else {
    ix = 0;
  }
  for (i = 0; i < N; i++) {
    v = X[ix];
    if (v == v) {
      break;
    }
    ix += stride;
  }
  if (i == N) {
    return 0.0 / 0.0;
  }
  min = v;
  max = min;
  i += 1;
  for (; i < N; i++) {
    ix += stride;
    v = X[ix];
    if (stdlib_base_is_nan(v)) {
      continue;
    }
    if (v < min) {
      min = v;
    } else if (v > max) {
      max = v;
    }
  }
  return max - min;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<stdlib_strided_dnanrange>:
  endbr64
  test   %rdi,%rdi
  jle    L135
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x28,%rsp
  cmp    $0x1,%rdi
  je     L69
  test   %rdx,%rdx
  je     L69
  mov    $0x0,%ecx
  js     L24
L86:
  xor    %eax,%eax
  nopl   0x0(%rax)
L129:
  movsd  (%r12,%rcx,8),%xmm1
  ucomisd %xmm1,%xmm1
  jnp    L58
  add    $0x1,%rax
  add    %rdx,%rcx
  cmp    %rax,%rbp
  jne    L129
L33:
  pxor   %xmm1,%xmm1
  divsd  %xmm1,%xmm1
  movapd %xmm1,%xmm0
L48:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopw   0x0(%rax,%rax,1)
L24:
  mov    $0x1,%ecx
  sub    %rdi,%rcx
  imul   %rdx,%rcx
  jmp    L86
  xchg   %ax,%ax
L69:
  movsd  (%r12),%xmm0
  call   <stdlib_base_is_nan@plt>
  pxor   %xmm0,%xmm0
  test   %rax,%rax
  je     L48
  movsd  (%r12),%xmm0
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   (%rax)
L58:
  cmp    %rax,%rbp
  je     L33
  lea    0x1(%rax),%rbx
  cmp    %rbx,%rbp
  jle    L116
  lea    0x0(,%rdx,8),%r13
  add    %rcx,%rdx
  movsd  %xmm1,0x18(%rsp)
  lea    (%r12,%rdx,8),%r12
  jmp    L13
  nopl   0x0(%rax)
L144:
  maxsd  %xmm1,%xmm0
  movapd %xmm0,%xmm1
L132:
  add    $0x1,%rbx
  add    %r13,%r12
  cmp    %rbx,%rbp
  je     L63
L13:
  movsd  (%r12),%xmm0
  movsd  %xmm1,0x8(%rsp)
  movsd  %xmm0,0x10(%rsp)
  call   <stdlib_base_is_nan@plt>
  movsd  0x8(%rsp),%xmm1
  test   %rax,%rax
  jne    L132
  movsd  0x18(%rsp),%xmm2
  movsd  0x10(%rsp),%xmm0
  comisd %xmm0,%xmm2
  jbe    L144
  add    $0x1,%rbx
  movsd  %xmm0,0x18(%rsp)
  add    %r13,%r12
  cmp    %rbx,%rbp
  jne    L13
L63:
  subsd  0x18(%rsp),%xmm1
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  movapd %xmm1,%xmm0
  ret
  nopw   0x0(%rax,%rax,1)
L135:
  pxor   %xmm1,%xmm1
  divsd  %xmm1,%xmm1
  movapd %xmm1,%xmm0
  ret
L116:
  movsd  %xmm1,0x18(%rsp)
  jmp    L63
```

assistant: ```c
double stdlib_strided_dnanrange(const int64_t N, const double *X, const int64_t stride) {
  double max;
  double min;
  int64_t ix;
  int64_t i;
  double v;
  if (N <= 0) {
    return 0.0 / 0.0;
  }
  if (N == 1 || stride == 0) {
    if (stdlib_base_is_nan(X[0])) {
      return X[0];
    }
    return 0.0;
  }
  if (stride < 0) {
    ix = (1 - N) * stride;
  } else {
    ix = 0;
  }
  for (i = 0; i < N; i++) {
    v = X[ix];
    if (v == v) {
      break;
    }
    ix += stride;
  }
  if (i == N) {
    return 0.0 / 0.0;
  }
  min = v;
  max = min;
  i += 1;
  for (; i < N; i++) {
    ix += stride;
    v = X[ix];
    if (stdlib_base_is_nan(v)) {
      continue;
    }
    if (v < min) {
      min = v;
    } else if (v > max) {
      max = v;
    }
  }
  return max - min;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<stdlib_strided_dnanrange>:
  endbr64
  test   %rdi,%rdi
  jle    L44
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x28,%rsp
  cmp    $0x1,%rdi
  je     L84
  test   %rdx,%rdx
  je     L84
  js     L159
  cmp    $0x1,%rdx
  jne    L194
  xor    %eax,%eax
  xor    %ecx,%ecx
  nopl   0x0(%rax)
L188:
  movsd  (%r12,%rcx,8),%xmm1
  ucomisd %xmm1,%xmm1
  jnp    L30
  add    $0x1,%rax
  add    $0x1,%rcx
  cmp    %rax,%rbp
  jne    L188
L31:
  pxor   %xmm1,%xmm1
  divsd  %xmm1,%xmm1
  movapd %xmm1,%xmm0
L99:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L84:
  movsd  (%r12),%xmm0
  call   <stdlib_base_is_nan@plt>
  pxor   %xmm0,%xmm0
  test   %rax,%rax
  je     L99
  movsd  (%r12),%xmm0
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   (%rax)
L30:
  cmp    %rax,%rbp
  je     L31
  lea    0x1(%rax),%rbx
  cmp    %rbx,%rbp
  jle    L102
  lea    0x0(,%rdx,8),%r13
  add    %rcx,%rdx
  movsd  %xmm1,0x18(%rsp)
  lea    (%r12,%rdx,8),%r12
  jmp    L175
  nopl   0x0(%rax)
L190:
  maxsd  %xmm1,%xmm0
  movapd %xmm0,%xmm1
L129:
  add    $0x1,%rbx
  add    %r13,%r12
  cmp    %rbx,%rbp
  je     L74
L175:
  movsd  (%r12),%xmm0
  movsd  %xmm1,0x8(%rsp)
  movsd  %xmm0,0x10(%rsp)
  call   <stdlib_base_is_nan@plt>
  movsd  0x8(%rsp),%xmm1
  test   %rax,%rax
  jne    L129
  movsd  0x18(%rsp),%xmm2
  movsd  0x10(%rsp),%xmm0
  comisd %xmm0,%xmm2
  jbe    L190
  add    $0x1,%rbx
  movsd  %xmm0,0x18(%rsp)
  add    %r13,%r12
  cmp    %rbx,%rbp
  jne    L175
L74:
  subsd  0x18(%rsp),%xmm1
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  movapd %xmm1,%xmm0
  ret
  nopw   0x0(%rax,%rax,1)
L159:
  mov    $0x1,%ecx
  sub    %rdi,%rcx
  imul   %rdx,%rcx
L184:
  xor    %eax,%eax
  xchg   %ax,%ax
L189:
  movsd  (%r12,%rcx,8),%xmm1
  ucomisd %xmm1,%xmm1
  jnp    L30
  add    $0x1,%rax
  add    %rdx,%rcx
  cmp    %rax,%rbp
  jne    L189
  jmp    L31
  nopl   0x0(%rax)
L44:
  pxor   %xmm1,%xmm1
  divsd  %xmm1,%xmm1
  movapd %xmm1,%xmm0
  ret
L102:
  movsd  %xmm1,0x18(%rsp)
  jmp    L74
L194:
  xor    %ecx,%ecx
  jmp    L184
```

assistant: ```c
double stdlib_strided_dnanrange(const int64_t N, const double *X, const int64_t stride) {
  double max;
  double min;
  int64_t ix;
  int64_t i;
  double v;
  if (N <= 0) {
    return 0.0 / 0.0;
  }
  if (N == 1 || stride == 0) {
    if (stdlib_base_is_nan(X[0])) {
      return X[0];
    }
    return 0.0;
  }
  if (stride < 0) {
    ix = (1 - N) * stride;
  } else {
    ix = 0;
  }
  for (i = 0; i < N; i++) {
    v = X[ix];
    if (v == v) {
      break;
    }
    ix += stride;
  }
  if (i == N) {
    return 0.0 / 0.0;
  }
  min = v;
  max = min;
  i += 1;
  for (; i < N; i++) {
    ix += stride;
    v = X[ix];
    if (stdlib_base_is_nan(v)) {
      continue;
    }
    if (v < min) {
      min = v;
    } else if (v > max) {
      max = v;
    }
  }
  return max - min;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<extractaddr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5b,%al
  je     L99
  mov    D5(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L98
L40:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %eax,%eax
  jne    L67
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L86
L67:
  addq   $0x1,-0x18(%rbp)
L98:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L40
  jmp    L34
L99:
  mov    D12(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  addq   $0x1,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L19
L152:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isxdigit@plt>
  test   %eax,%eax
  jne    L2
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x3a,%al
  jne    L158
L2:
  addq   $0x1,-0x18(%rbp)
L19:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L152
  jmp    L21
L158:
  nop
L21:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5d,%al
  je     L34
  mov    $0xffffffff,%eax
  jmp    L159
L86:
  nop
L34:
  mov    -0x8(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  jne    L121
  mov    $0xffffffff,%eax
  jmp    L159
L121:
  mov    D12(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0xc(%rbp)
  jne    L146
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,(%rax)
  jmp    L132
L146:
  mov    -0x28(%rbp),%rax
  mov    -0x18(%rbp),%rdx
  mov    %rdx,(%rax)
L132:
  mov    -0x30(%rbp),%rax
  mov    -0xc(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x20(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    -0x18(%rbp),%rax
  sub    -0x8(%rbp),%rax
L159:
  leave
  ret
```

assistant: ```c
int extractaddr(const char *str, char **begin, char **end, int *pf) {
  const char *t;
  int tpf;
  if (*str != '[') {
    tpf = AF_INET;
    for (t = str; *str != '\0'; str++) {
      if (!isdigit(*str) && *str != '.')
        break;
    }
  } else {
    tpf = AF_INET6;
    str++;
    for (t = str; *str != '\0'; str++) {
      if (!isxdigit(*str) && *str != ':')
        break;
    }
    if (*str != ']')
      return (-1);
  }
  if (t == str)
    return (-1);
  if (tpf == AF_INET6)
    *end = (char *)(str + 1);
  else
    *end = (char *)str;
  *pf = tpf;
  *begin = (char *)t;
  return (str - t);
}
```