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

```asm
<generate_lehmer_tree>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %esi,-0x28(%rbp)
  mov    %edx,-0x2c(%rbp)
  mov    %ecx,-0x30(%rbp)
  mov    %r8d,-0x34(%rbp)
  mov    %r9d,-0x38(%rbp)
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x3,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  movl   $0x0,-0x20(%rbp)
  jmp    L55
L67:
  mov    -0x28(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    -0x20(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  mov    %rax,(%rdx)
  addl   $0x1,-0x20(%rbp)
L55:
  mov    -0x20(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L67
  movl   $0x0,-0x20(%rbp)
  jmp    L61
L73:
  cmpl   $0x0,-0x20(%rbp)
  jne    L50
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x2c(%rbp),%edx
  mov    %edx,(%rax)
  jmp    L45
L50:
  mov    -0x20(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    (%rax),%esi
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rbx
  mov    0x18(%rbp),%ecx
  mov    -0x34(%rbp),%edx
  mov    -0x30(%rbp),%eax
  mov    %eax,%edi
  call   <congruent_next@plt>
  mov    %eax,(%rbx)
L45:
  movl   $0x1,-0x1c(%rbp)
  jmp    L8
L46:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  sub    $0x4,%rax
  add    %rdx,%rax
  mov    (%rax),%esi
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    (%rdx,%rax,1),%rbx
  mov    0x18(%rbp),%edx
  mov    -0x38(%rbp),%eax
  mov    %edx,%ecx
  mov    0x10(%rbp),%edx
  mov    %eax,%edi
  call   <congruent_next@plt>
  mov    %eax,(%rbx)
  addl   $0x1,-0x1c(%rbp)
L8:
  mov    -0x1c(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L46
  addl   $0x1,-0x20(%rbp)
L61:
  mov    -0x20(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L73
  mov    -0x18(%rbp),%rax
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int **generate_lehmer_tree(int proc_num, int sequence_len, int seed, int al, int cl, int ar, int cr, int mod) {
  int **seed_array = (int **)malloc(proc_num * sizeof(int *));
  int i, j;
  for (i = 0; i < proc_num; i++) {
    seed_array[i] = (int *)malloc(sequence_len * sizeof(int));
  }
  for (i = 0; i < proc_num; i++) {
    if (i == 0) {
      seed_array[i][0] = seed;
    } else {
      seed_array[i][0] = congruent_next(al, seed_array[i - 1][0], cl, mod);
    }
    for (j = 1; j < sequence_len; j++) {
      seed_array[i][j] = congruent_next(ar, seed_array[i][j - 1], cr, mod);
    }
  }
  return seed_array;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<generate_lehmer_tree>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %edi,%ebx
  mov    %edi,0x20(%rsp)
  mov    %esi,%r15d
  mov    %esi,0x14(%rsp)
  mov    %edx,0x24(%rsp)
  mov    %ecx,0x28(%rsp)
  mov    %r8d,0x2c(%rsp)
  mov    %r9d,%r14d
  mov    0x78(%rsp),%r13d
  lea    0x0(,%rdi,8),%edi
  call   <malloc@plt>
  mov    %rax,0x18(%rsp)
  test   %ebx,%ebx
  jle    L3
  mov    %rax,%rcx
  lea    0x0(,%r15,4),%r12d
  mov    %rax,0x8(%rsp)
  mov    %ebx,%eax
  lea    (%rcx,%rax,8),%rbp
  mov    %rcx,%rbx
L79:
  mov    %r12d,%edi
  call   <malloc@plt>
  mov    %rax,(%rbx)
  add    $0x8,%rbx
  cmp    %rbp,%rbx
  jne    L79
  mov    0x14(%rsp),%eax
  lea    -0x2(%rax),%eax
  lea    0x4(,%rax,4),%r15
  movl   $0x0,0x10(%rsp)
  jmp    L59
L71:
  mov    0x18(%rsp),%rax
  mov    (%rax),%rax
  mov    0x24(%rsp),%ecx
  mov    %ecx,(%rax)
L43:
  mov    0x8(%rsp),%r12
  mov    $0x0,%ebx
  cmpl   $0x1,0x14(%rsp)
  jle    L54
L64:
  mov    (%r12),%rax
  mov    %rbx,%rdx
  add    $0x4,%rbx
  lea    (%rax,%rbx,1),%rbp
  mov    (%rax,%rdx,1),%esi
  mov    %r13d,%ecx
  mov    0x70(%rsp),%edx
  mov    %r14d,%edi
  call   <congruent_next@plt>
  mov    %eax,0x0(%rbp)
  cmp    %r15,%rbx
  jne    L64
L54:
  addl   $0x1,0x10(%rsp)
  mov    0x10(%rsp),%eax
  addq   $0x8,0x8(%rsp)
  cmp    %eax,0x20(%rsp)
  je     L3
L59:
  cmpl   $0x0,0x10(%rsp)
  je     L71
  mov    0x8(%rsp),%rax
  mov    (%rax),%rbx
  mov    -0x8(%rax),%rax
  mov    %r13d,%ecx
  mov    0x2c(%rsp),%edx
  mov    (%rax),%esi
  mov    0x28(%rsp),%edi
  call   <congruent_next@plt>
  mov    %eax,(%rbx)
  jmp    L43
L3:
  mov    0x18(%rsp),%rax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
int **generate_lehmer_tree(int proc_num, int sequence_len, int seed, int al, int cl, int ar, int cr, int mod) {
  int **seed_array = (int **)malloc(proc_num * sizeof(int *));
  int i, j;
  for (i = 0; i < proc_num; i++) {
    seed_array[i] = (int *)malloc(sequence_len * sizeof(int));
  }
  for (i = 0; i < proc_num; i++) {
    if (i == 0) {
      seed_array[i][0] = seed;
    } else {
      seed_array[i][0] = congruent_next(al, seed_array[i - 1][0], cl, mod);
    }
    for (j = 1; j < sequence_len; j++) {
      seed_array[i][j] = congruent_next(ar, seed_array[i][j - 1], cr, mod);
    }
  }
  return seed_array;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<generate_lehmer_tree>:
  endbr64
  push   %r15
  mov    %edi,%r15d
  push   %r14
  mov    %esi,%r14d
  push   %r13
  push   %r12
  push   %rbp
  mov    %r9d,%ebp
  push   %rbx
  sub    $0x38,%rsp
  mov    %edi,0x20(%rsp)
  shl    $0x3,%edi
  mov    0x70(%rsp),%r12d
  mov    %esi,0xc(%rsp)
  mov    0x78(%rsp),%ebx
  mov    %edx,0x24(%rsp)
  mov    %ecx,0x28(%rsp)
  mov    %r8d,0x2c(%rsp)
  call   <malloc@plt>
  mov    %rax,0x18(%rsp)
  test   %r15d,%r15d
  jle    L19
  mov    %r15d,%edi
  mov    %rax,%rcx
  mov    %rax,%r15
  mov    %ebx,0x78(%rsp)
  mov    %edi,%eax
  shl    $0x2,%r14d
  mov    %rcx,%rbx
  lea    (%rcx,%rax,8),%rax
  mov    %rax,%r13
  nopl   0x0(%rax)
L10:
  mov    %r14d,%edi
  add    $0x8,%rbx
  call   <malloc@plt>
  mov    %rax,-0x8(%rbx)
  cmp    %r13,%rbx
  jne    L10
  mov    0xc(%rsp),%eax
  mov    0x78(%rsp),%ebx
  movl   $0x0,0x8(%rsp)
  sub    $0x2,%eax
  lea    0x4(,%rax,4),%rax
  mov    %rax,(%rsp)
  nopl   0x0(%rax)
L22:
  mov    0x8(%rsp),%eax
  test   %eax,%eax
  jne    L44
  mov    0x18(%rsp),%rax
  mov    0x24(%rsp),%edi
  mov    (%rax),%rax
  mov    %edi,(%rax)
L50:
  xor    %r14d,%r14d
  cmpl   $0x1,0xc(%rsp)
  mov    %r15,%r13
  jle    L56
  nopl   0x0(%rax,%rax,1)
L33:
  mov    0x0(%r13),%rax
  mov    %r14,%rdx
  mov    %ebx,%ecx
  add    $0x4,%r14
  mov    %ebp,%edi
  mov    (%rax,%rdx,1),%esi
  mov    %r12d,%edx
  lea    (%rax,%r14,1),%r15
  call   <congruent_next@plt>
  mov    %eax,(%r15)
  cmp    %r14,(%rsp)
  jne    L33
  mov    %r13,%r15
L56:
  addl   $0x1,0x8(%rsp)
  add    $0x8,%r15
  mov    0x8(%rsp),%eax
  cmp    %eax,0x20(%rsp)
  jne    L22
L19:
  mov    0x18(%rsp),%rax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L44:
  mov    -0x8(%r15),%rax
  mov    (%r15),%r8
  mov    %ebx,%ecx
  mov    0x2c(%rsp),%edx
  mov    0x28(%rsp),%edi
  mov    (%rax),%esi
  mov    %r8,0x10(%rsp)
  call   <congruent_next@plt>
  mov    0x10(%rsp),%r8
  mov    %eax,(%r8)
  jmp    L50
```

assistant: ```c
int **generate_lehmer_tree(int proc_num, int sequence_len, int seed, int al, int cl, int ar, int cr, int mod) {
  int **seed_array = (int **)malloc(proc_num * sizeof(int *));
  int i, j;
  for (i = 0; i < proc_num; i++) {
    seed_array[i] = (int *)malloc(sequence_len * sizeof(int));
  }
  for (i = 0; i < proc_num; i++) {
    if (i == 0) {
      seed_array[i][0] = seed;
    } else {
      seed_array[i][0] = congruent_next(al, seed_array[i - 1][0], cl, mod);
    }
    for (j = 1; j < sequence_len; j++) {
      seed_array[i][j] = congruent_next(ar, seed_array[i][j - 1], cr, mod);
    }
  }
  return seed_array;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<generate_lehmer_tree>:
  endbr64
  push   %r15
  mov    %edi,%r15d
  push   %r14
  mov    %esi,%r14d
  push   %r13
  push   %r12
  push   %rbp
  mov    %r9d,%ebp
  push   %rbx
  sub    $0x38,%rsp
  mov    %edi,0x20(%rsp)
  shl    $0x3,%edi
  mov    0x70(%rsp),%r12d
  mov    %esi,0xc(%rsp)
  mov    0x78(%rsp),%ebx
  mov    %edx,0x24(%rsp)
  mov    %ecx,0x28(%rsp)
  mov    %r8d,0x2c(%rsp)
  call   <malloc@plt>
  mov    %rax,0x18(%rsp)
  test   %r15d,%r15d
  jle    L2
  mov    %r15d,%edi
  mov    %rax,%rcx
  mov    %rax,%r15
  mov    %ebx,0x78(%rsp)
  mov    %edi,%eax
  shl    $0x2,%r14d
  mov    %rcx,%rbx
  lea    (%rcx,%rax,8),%rax
  mov    %rax,%r13
  nopl   0x0(%rax)
L3:
  mov    %r14d,%edi
  add    $0x8,%rbx
  call   <malloc@plt>
  mov    %rax,-0x8(%rbx)
  cmp    %r13,%rbx
  jne    L3
  mov    0xc(%rsp),%eax
  mov    0x78(%rsp),%ebx
  movl   $0x0,0x8(%rsp)
  sub    $0x2,%eax
  lea    0x4(,%rax,4),%rax
  mov    %rax,(%rsp)
  nopl   0x0(%rax)
L64:
  mov    0x8(%rsp),%eax
  test   %eax,%eax
  jne    L29
  mov    0x18(%rsp),%rax
  mov    0x24(%rsp),%edi
  mov    (%rax),%rax
  mov    %edi,(%rax)
L58:
  xor    %r14d,%r14d
  cmpl   $0x1,0xc(%rsp)
  mov    %r15,%r13
  jle    L18
  nopl   0x0(%rax,%rax,1)
L4:
  mov    0x0(%r13),%rax
  mov    %r14,%rdx
  mov    %ebx,%ecx
  add    $0x4,%r14
  mov    %ebp,%edi
  mov    (%rax,%rdx,1),%esi
  mov    %r12d,%edx
  lea    (%rax,%r14,1),%r15
  call   <congruent_next@plt>
  mov    %eax,(%r15)
  cmp    %r14,(%rsp)
  jne    L4
  mov    %r13,%r15
L18:
  addl   $0x1,0x8(%rsp)
  add    $0x8,%r15
  mov    0x8(%rsp),%eax
  cmp    %eax,0x20(%rsp)
  jne    L64
L2:
  mov    0x18(%rsp),%rax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L29:
  mov    -0x8(%r15),%rax
  mov    (%r15),%r8
  mov    %ebx,%ecx
  mov    0x2c(%rsp),%edx
  mov    0x28(%rsp),%edi
  mov    (%rax),%esi
  mov    %r8,0x10(%rsp)
  call   <congruent_next@plt>
  mov    0x10(%rsp),%r8
  mov    %eax,(%r8)
  jmp    L58
```

assistant: ```c
int **generate_lehmer_tree(int proc_num, int sequence_len, int seed, int al, int cl, int ar, int cr, int mod) {
  int **seed_array = (int **)malloc(proc_num * sizeof(int *));
  int i, j;
  for (i = 0; i < proc_num; i++) {
    seed_array[i] = (int *)malloc(sequence_len * sizeof(int));
  }
  for (i = 0; i < proc_num; i++) {
    if (i == 0) {
      seed_array[i][0] = seed;
    } else {
      seed_array[i][0] = congruent_next(al, seed_array[i - 1][0], cl, mod);
    }
    for (j = 1; j < sequence_len; j++) {
      seed_array[i][j] = congruent_next(ar, seed_array[i][j - 1], cr, mod);
    }
  }
  return seed_array;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  cmpl   $0x1,-0x4(%rbp)
  jg     L18
  mov    $0x0,%eax
  jmp    L8
L18:
  mov    -0x10(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <check@plt>
  mov    $0x0,%eax
L8:
  leave
  ret
```

assistant: ```c
int main(int ac, char **av) {
  if (ac < 2)
    return 0;
  check(av[1]);
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<main>:
  endbr64
  cmp    $0x1,%edi
  jle    L2
  sub    $0x8,%rsp
  mov    0x8(%rsi),%rdi
  call   <check@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
L2:
  mov    $0x0,%eax
  ret
```

assistant: ```c
int main(int ac, char **av) {
  if (ac < 2)
    return 0;
  check(av[1]);
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  cmp    $0x1,%edi
  jle    L5
  push   %rax
  mov    0x8(%rsi),%rdi
  call   <check@plt>
  xor    %eax,%eax
  pop    %rdx
  ret
L5:
  xor    %eax,%eax
  ret
```

assistant: ```c
int main(int ac, char **av) {
  if (ac < 2)
    return 0;
  check(av[1]);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  cmp    $0x1,%edi
  jle    L3
  push   %rax
  mov    0x8(%rsi),%rdi
  call   <check@plt>
  xor    %eax,%eax
  pop    %rdx
  ret
L3:
  xor    %eax,%eax
  ret
```

assistant: ```c
int main(int ac, char **av) {
  if (ac < 2)
    return 0;
  check(av[1]);
}
```
user: What is the c source code of the assembly code below:

```asm
<find_subarray_len>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x8(%rbp)
  mov    -0x1c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L23
L2:
  mov    -0xc(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0xc(%rbp)
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  add    %eax,-0x8(%rbp)
L23:
  mov    -0x8(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jl     L2
  mov    -0xc(%rbp),%eax
  sub    -0x10(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  jmp    L44
L57:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  sub    %eax,-0x8(%rbp)
  addl   $0x1,-0x10(%rbp)
L51:
  mov    -0x8(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jg     L57
  jmp    L29
L33:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  add    %eax,-0x8(%rbp)
  addl   $0x1,-0xc(%rbp)
L29:
  mov    -0x8(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jle    L33
  mov    -0xc(%rbp),%eax
  sub    -0x10(%rbp),%eax
  cmp    %eax,-0x4(%rbp)
  jl     L44
  mov    -0xc(%rbp),%eax
  sub    -0x10(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x4(%rbp)
L44:
  mov    -0x1c(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0xc(%rbp)
  jge    L26
  mov    -0x1c(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x10(%rbp)
  jl     L51
L26:
  mov    -0x4(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int find_subarray_len(int a[], int len, int sum) {
  int left = 0;
  int right = 0;
  int cur_sum = 0;
  int min_len = len - 1;
  while (cur_sum < sum) {
    cur_sum += a[right++];
  }
  min_len = right - left;
  while (right < len - 1 && left < len - 1) {
    while (cur_sum > sum) {
      cur_sum -= a[left];
      left++;
    }
    while (cur_sum <= sum) {
      cur_sum += a[right];
      right++;
    }
    if (min_len > (right - left - 1))
      min_len = right - left - 1;
  }
  return min_len;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<find_subarray_len>:
  endbr64
  mov    %esi,%r11d
  mov    %edx,%esi
  sub    $0x1,%r11d
  test   %edx,%edx
  jle    L68
  mov    $0x1,%edx
  mov    $0x0,%eax
L14:
  mov    %edx,%r8d
  add    -0x4(%rdi,%rdx,4),%eax
  add    $0x1,%rdx
  cmp    %eax,%esi
  jg     L14
L15:
  test   %r8d,%r8d
  mov    $0x0,%edx
  cmovns %r8d,%edx
  mov    %r8d,%r10d
  mov    $0x0,%r9d
  cmp    %edx,%r11d
  jg     L55
L9:
  mov    %r10d,%eax
  ret
L68:
  mov    $0x0,%eax
  mov    $0x0,%r8d
  jmp    L15
L74:
  add    -0x4(%rdi,%rdx,4),%eax
  mov    %edx,%r8d
  add    $0x1,%rdx
  cmp    %eax,%esi
  jge    L74
  mov    %r8d,%edx
  sub    %r9d,%edx
  lea    -0x1(%rdx),%ecx
  cmp    %r10d,%edx
  cmovle %ecx,%r10d
  cmp    %r9d,%r8d
  mov    %r9d,%edx
  cmovge %r8d,%edx
  cmp    %edx,%r11d
  jle    L9
L55:
  lea    0x1(%r9),%edx
  movslq %edx,%rdx
  cmp    %eax,%esi
  jge    L57
L46:
  sub    -0x4(%rdi,%rdx,4),%eax
  mov    %edx,%r9d
  add    $0x1,%rdx
  cmp    %eax,%esi
  jl     L46
L57:
  lea    0x1(%r8),%edx
  movslq %edx,%rdx
  jmp    L74
```

assistant: ```c
int find_subarray_len(int a[], int len, int sum) {
  int left = 0;
  int right = 0;
  int cur_sum = 0;
  int min_len = len - 1;
  while (cur_sum < sum) {
    cur_sum += a[right++];
  }
  min_len = right - left;
  while (right < len - 1 && left < len - 1) {
    while (cur_sum > sum) {
      cur_sum -= a[left];
      left++;
    }
    while (cur_sum <= sum) {
      cur_sum += a[right];
      right++;
    }
    if (min_len > (right - left - 1))
      min_len = right - left - 1;
  }
  return min_len;
}
```
user: Translate the below assembly code into C programming language:

```asm
<find_subarray_len>:
  endbr64
  mov    %edx,%ecx
  lea    -0x1(%rsi),%r11d
  test   %edx,%edx
  jle    L22
  mov    $0x1,%edx
  xor    %eax,%eax
  nopl   0x0(%rax)
L69:
  add    -0x4(%rdi,%rdx,4),%eax
  mov    %edx,%esi
  add    $0x1,%rdx
  cmp    %eax,%ecx
  jg     L69
  mov    %esi,%edx
L1:
  mov    %esi,%r9d
  xor    %r8d,%r8d
  cmp    %edx,%r11d
  jle    L30
  nopl   0x0(%rax,%rax,1)
L10:
  lea    0x1(%r8),%edx
  movslq %edx,%rdx
  cmp    %eax,%ecx
  jge    L26
  nopl   0x0(%rax,%rax,1)
L40:
  sub    -0x4(%rdi,%rdx,4),%eax
  mov    %edx,%r8d
  add    $0x1,%rdx
  cmp    %eax,%ecx
  jl     L40
L26:
  add    $0x1,%esi
  movslq %esi,%rdx
  nopl   (%rax)
L6:
  add    -0x4(%rdi,%rdx,4),%eax
  mov    %edx,%esi
  add    $0x1,%rdx
  cmp    %eax,%ecx
  jge    L6
  mov    %esi,%edx
  sub    %r8d,%edx
  cmp    %r9d,%edx
  lea    -0x1(%rdx),%r10d
  mov    %r8d,%edx
  cmovle %r10d,%r9d
  cmp    %r8d,%esi
  cmovge %esi,%edx
  cmp    %edx,%r11d
  jg     L10
L30:
  mov    %r9d,%eax
  ret
L22:
  xor    %edx,%edx
  xor    %eax,%eax
  xor    %esi,%esi
  jmp    L1
```

assistant: ```c
int find_subarray_len(int a[], int len, int sum) {
  int left = 0;
  int right = 0;
  int cur_sum = 0;
  int min_len = len - 1;
  while (cur_sum < sum) {
    cur_sum += a[right++];
  }
  min_len = right - left;
  while (right < len - 1 && left < len - 1) {
    while (cur_sum > sum) {
      cur_sum -= a[left];
      left++;
    }
    while (cur_sum <= sum) {
      cur_sum += a[right];
      right++;
    }
    if (min_len > (right - left - 1))
      min_len = right - left - 1;
  }
  return min_len;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<find_subarray_len>:
  endbr64
  mov    %edx,%ecx
  lea    -0x1(%rsi),%r11d
  test   %edx,%edx
  jle    L38
  mov    $0x1,%edx
  xor    %eax,%eax
  nopl   0x0(%rax)
L73:
  add    -0x4(%rdi,%rdx,4),%eax
  mov    %edx,%esi
  add    $0x1,%rdx
  cmp    %eax,%ecx
  jg     L73
  mov    %esi,%edx
L30:
  mov    %esi,%r9d
  xor    %r8d,%r8d
  cmp    %edx,%r11d
  jle    L76
  nopl   0x0(%rax,%rax,1)
L46:
  lea    0x1(%r8),%edx
  movslq %edx,%rdx
  cmp    %eax,%ecx
  jge    L17
  nopl   0x0(%rax,%rax,1)
L12:
  sub    -0x4(%rdi,%rdx,4),%eax
  mov    %edx,%r8d
  add    $0x1,%rdx
  cmp    %eax,%ecx
  jl     L12
L17:
  add    $0x1,%esi
  movslq %esi,%rdx
  nopl   (%rax)
L62:
  add    -0x4(%rdi,%rdx,4),%eax
  mov    %edx,%esi
  add    $0x1,%rdx
  cmp    %eax,%ecx
  jge    L62
  mov    %esi,%edx
  sub    %r8d,%edx
  cmp    %r9d,%edx
  lea    -0x1(%rdx),%r10d
  mov    %r8d,%edx
  cmovle %r10d,%r9d
  cmp    %r8d,%esi
  cmovge %esi,%edx
  cmp    %edx,%r11d
  jg     L46
L76:
  mov    %r9d,%eax
  ret
L38:
  xor    %edx,%edx
  xor    %eax,%eax
  xor    %esi,%esi
  jmp    L30
```

assistant: ```c
int find_subarray_len(int a[], int len, int sum) {
  int left = 0;
  int right = 0;
  int cur_sum = 0;
  int min_len = len - 1;
  while (cur_sum < sum) {
    cur_sum += a[right++];
  }
  min_len = right - left;
  while (right < len - 1 && left < len - 1) {
    while (cur_sum > sum) {
      cur_sum -= a[left];
      left++;
    }
    while (cur_sum <= sum) {
      cur_sum += a[right];
      right++;
    }
    if (min_len > (right - left - 1))
      min_len = right - left - 1;
  }
  return min_len;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<tpd2>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdx,%rbx
  lea    0x3(%rdi),%edx
  movslq %edx,%rdx
  cmpl   $0x7,(%rsi,%rdx,4)
  jne    L43
  mov    %rsi,%rax
  mov    %r9,%rbp
  cmp    $0x2,%ecx
  jle    L7
L43:
  mov    $0x1,%edx
L2:
  mov    %edx,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L7:
  movsd  (%r8),%xmm0
  movsd  0x8(%r8),%xmm2
  cmpl   $0x0,0x14(%rsi)
  je     L82
  movapd %xmm0,%xmm1
  mulsd  0x8(%rbx),%xmm1
  addsd  (%rbx),%xmm1
  movapd %xmm2,%xmm3
  mulsd  0x10(%rbx),%xmm3
  mulsd  0x28(%rbx),%xmm2
  mulsd  0x20(%rbx),%xmm0
  addsd  0x18(%rbx),%xmm0
  addsd  %xmm0,%xmm2
  add    $0x30,%rbx
  movapd %xmm1,%xmm0
  addsd  %xmm3,%xmm0
L82:
  test   %edi,%edi
  je     L59
  movslq 0xc(%rax),%rdx
  lea    (%rbx,%rdx,8),%rbx
L59:
  movapd %xmm0,%xmm1
  mulsd  0x20(%rbx),%xmm1
  addsd  0x8(%rbx),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  (%rbx),%xmm1
  movsd  %xmm1,0x0(%rbp)
  mov    $0x0,%edx
  cmp    $0x1,%ecx
  je     L2
  movapd %xmm2,%xmm3
  mulsd  0x30(%rbx),%xmm3
  addsd  0x10(%rbx),%xmm3
  mulsd  %xmm2,%xmm3
  movapd %xmm0,%xmm4
  mulsd  0x28(%rbx),%xmm4
  mulsd  %xmm2,%xmm4
  addsd  %xmm4,%xmm3
  addsd  %xmm1,%xmm3
  movq   %xmm3,%r12
  movsd  %xmm3,0x0(%rbp)
  mov    0x18(%rax),%edx
  test   %edx,%edx
  je     L2
  mulsd  %xmm0,%xmm0
  mulsd  %xmm2,%xmm2
  addsd  %xmm2,%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L78
  sqrtsd %xmm0,%xmm0
L38:
  mulsd  0x18(%rbx),%xmm0
  movq   %r12,%xmm5
  addsd  %xmm5,%xmm0
  movsd  %xmm0,0x0(%rbp)
  mov    $0x0,%edx
  jmp    L2
L78:
  call   <sqrt@plt>
  jmp    L38
```

assistant: ```c
int tpd2(int inverse, const int i[], const double p[], int Nhat, const double rawcrd[], double *discrd) {
  double r, s, u, v;
  if (i[3 + inverse] != 7 || 2 < Nhat) {
    return 1;
  }
  u = rawcrd[0];
  v = rawcrd[1];
  if (i[5]) {
    r = p[0] + p[1] * u + p[2] * v;
    v = p[3] + p[4] * u + p[5] * v;
    u = r;
    p += 6;
  }
  if (inverse)
    p += i[3];
  *discrd = p[0] + u * (p[1] + u * (p[4]));
  if (Nhat == 1)
    return 0;
  *discrd += v * (p[2] + v * (p[6])) + u * (p[5]) * v;
  if (i[6]) {
    s = u * u + v * v;
    r = sqrt(s);
    *discrd += r * p[3];
  }
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<tpd2>:
  endbr64
  push   %rbx
  mov    %rdx,%rbx
  lea    0x3(%rdi),%edx
  movslq %edx,%rdx
  sub    $0x10,%rsp
  cmpl   $0x7,(%rsi,%rdx,4)
  jne    L30
  cmp    $0x2,%ecx
  jle    L24
L30:
  add    $0x10,%rsp
  mov    $0x1,%eax
  pop    %rbx
  ret
  nopl   0x0(%rax,%rax,1)
L24:
  mov    0x14(%rsi),%edx
  movsd  (%r8),%xmm0
  mov    %rsi,%rax
  movsd  0x8(%r8),%xmm4
  test   %edx,%edx
  je     L14
  movsd  0x10(%rbx),%xmm3
  movsd  0x8(%rbx),%xmm1
  add    $0x30,%rbx
  mulsd  %xmm4,%xmm3
  mulsd  -0x8(%rbx),%xmm4
  mulsd  %xmm0,%xmm1
  mulsd  -0x10(%rbx),%xmm0
  addsd  -0x30(%rbx),%xmm1
  addsd  -0x18(%rbx),%xmm0
  movapd %xmm4,%xmm2
  movapd %xmm0,%xmm4
  movapd %xmm1,%xmm0
  addsd  %xmm2,%xmm4
  addsd  %xmm3,%xmm0
L14:
  test   %edi,%edi
  jne    L95
L74:
  movsd  0x20(%rbx),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  0x8(%rbx),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  (%rbx),%xmm1
  movsd  %xmm1,(%r9)
  cmp    $0x1,%ecx
  je     L57
  movsd  0x28(%rbx),%xmm3
  movsd  0x30(%rbx),%xmm2
  mov    0x18(%rax),%eax
  mulsd  %xmm0,%xmm3
  mulsd  %xmm4,%xmm2
  addsd  0x10(%rbx),%xmm2
  mulsd  %xmm4,%xmm3
  mulsd  %xmm4,%xmm2
  addsd  %xmm3,%xmm2
  addsd  %xmm2,%xmm1
  movsd  %xmm1,(%r9)
  test   %eax,%eax
  jne    L64
L57:
  xor    %eax,%eax
L12:
  add    $0x10,%rsp
  pop    %rbx
  ret
  nopw   0x0(%rax,%rax,1)
L95:
  movslq 0xc(%rax),%rdx
  lea    (%rbx,%rdx,8),%rbx
  jmp    L74
  nopw   0x0(%rax,%rax,1)
L64:
  mulsd  %xmm0,%xmm0
  pxor   %xmm2,%xmm2
  mulsd  %xmm4,%xmm4
  addsd  %xmm4,%xmm0
  ucomisd %xmm0,%xmm2
  ja     L81
  sqrtsd %xmm0,%xmm0
L92:
  mulsd  0x18(%rbx),%xmm0
  xor    %eax,%eax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%r9)
  jmp    L12
L81:
  mov    %r9,0x8(%rsp)
  movsd  %xmm1,(%rsp)
  call   <sqrt@plt>
  mov    0x8(%rsp),%r9
  movsd  (%rsp),%xmm1
  jmp    L92
```

assistant: ```c
int tpd2(int inverse, const int i[], const double p[], int Nhat, const double rawcrd[], double *discrd) {
  double r, s, u, v;
  if (i[3 + inverse] != 7 || 2 < Nhat) {
    return 1;
  }
  u = rawcrd[0];
  v = rawcrd[1];
  if (i[5]) {
    r = p[0] + p[1] * u + p[2] * v;
    v = p[3] + p[4] * u + p[5] * v;
    u = r;
    p += 6;
  }
  if (inverse)
    p += i[3];
  *discrd = p[0] + u * (p[1] + u * (p[4]));
  if (Nhat == 1)
    return 0;
  *discrd += v * (p[2] + v * (p[6])) + u * (p[5]) * v;
  if (i[6]) {
    s = u * u + v * v;
    r = sqrt(s);
    *discrd += r * p[3];
  }
  return 0;
}
```