ylfeng/ReF-Decompile-dataset huggingface dataset:
user: What would the C source look like for the assembly code provided here?

```asm
<xrop3_203_1_1>:
  endbr64
  movzbl %sil,%edx
  movzbl %dil,%edi
  mov    %edx,%esi
  mov    %edi,%eax
  shl    $0x8,%esi
  shl    $0x8,%eax
  or     %edx,%esi
  or     %edi,%eax
  mov    %esi,%edx
  or     %eax,%edx
  mov    %edx,%eax
  movzbl %dl,%edx
  not    %eax
  or     %edx,%eax
  ret
```

assistant: ```c
unsigned xrop3_203_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D & S;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<RandomFunc>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  sub    $0x96a,%ax
  mov    %ax,-0xa(%rbp)
  movw   $0x0,-0xc(%rbp)
  jmp    L1
L24:
  movw   $0x0,-0xe(%rbp)
  jmp    L21
L46:
  movzwl -0xa(%rbp),%eax
  movzwl %ax,%eax
  movzwl -0xe(%rbp),%edx
  movzwl -0xc(%rbp),%ecx
  sub    %ecx,%edx
  cmp    %edx,%eax
  jne    L33
  movzwl -0xe(%rbp),%eax
  cltq
  movzwl -0xa(%rbp,%rax,2),%edx
  movzwl -0xc(%rbp),%eax
  add    %edx,%edx
  cltq
  mov    %dx,-0xa(%rbp,%rax,2)
L33:
  movzwl -0xe(%rbp),%eax
  add    $0x1,%eax
  mov    %ax,-0xe(%rbp)
L21:
  cmpw   $0x0,-0xe(%rbp)
  je     L46
  addw   $0x2,-0xc(%rbp)
L1:
  cmpw   $0x0,-0xc(%rbp)
  je     L24
  movzwl -0xa(%rbp),%eax
  lea    -0x362c(%rax),%edx
  mov    -0x20(%rbp),%rax
  mov    %dx,(%rax)
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L36
  call   <__stack_chk_fail@plt>
L36:
  leave
  ret
```

assistant: ```c
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  unsigned short local2;
  unsigned short local1;
  {
    state[0UL] = (input[0UL] + 51238316UL) + (unsigned short)8426;
    local1 = 0UL;
    while (local1 < 1UL) {
      local2 = 0UL;
      while (local2 < 1UL) {
        if (!(state[0UL] != local2 - local1)) {
          state[local1] = state[local2] + state[local2];
        }
        local2++;
      }
      local1 += 2UL;
    }
    output[0UL] = state[0UL] - (unsigned short)13868;
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<RandomFunc>:
  endbr64
  movzwl (%rdi),%eax
  sub    $0x3f96,%ax
  mov    %ax,(%rsi)
  ret
```

assistant: ```c
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  unsigned short local2;
  unsigned short local1;
  {
    state[0UL] = (input[0UL] + 51238316UL) + (unsigned short)8426;
    local1 = 0UL;
    while (local1 < 1UL) {
      local2 = 0UL;
      while (local2 < 1UL) {
        if (!(state[0UL] != local2 - local1)) {
          state[local1] = state[local2] + state[local2];
        }
        local2++;
      }
      local1 += 2UL;
    }
    output[0UL] = state[0UL] - (unsigned short)13868;
  }
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<RandomFunc>:
  endbr64
  movzwl (%rdi),%eax
  sub    $0x3f96,%ax
  mov    %ax,(%rsi)
  ret
```

assistant: ```c
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  unsigned short local2;
  unsigned short local1;
  {
    state[0UL] = (input[0UL] + 51238316UL) + (unsigned short)8426;
    local1 = 0UL;
    while (local1 < 1UL) {
      local2 = 0UL;
      while (local2 < 1UL) {
        if (!(state[0UL] != local2 - local1)) {
          state[local1] = state[local2] + state[local2];
        }
        local2++;
      }
      local1 += 2UL;
    }
    output[0UL] = state[0UL] - (unsigned short)13868;
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<RandomFunc>:
  endbr64
  movzwl (%rdi),%eax
  sub    $0x3f96,%ax
  mov    %ax,(%rsi)
  ret
```

assistant: ```c
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  unsigned short local2;
  unsigned short local1;
  {
    state[0UL] = (input[0UL] + 51238316UL) + (unsigned short)8426;
    local1 = 0UL;
    while (local1 < 1UL) {
      local2 = 0UL;
      while (local2 < 1UL) {
        if (!(state[0UL] != local2 - local1)) {
          state[local1] = state[local2] + state[local2];
        }
        local2++;
      }
      local1 += 2UL;
    }
    output[0UL] = state[0UL] - (unsigned short)13868;
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<eliminaNeg>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  mov    -0x1c(%rbp),%edx
  mov    %edx,(%rax)
  movl   $0x0,-0x4(%rbp)
  jmp    L0
L15:
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jns    L4
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  neg    %edx
  mov    %edx,(%rax)
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  add    $0x1,%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <realloc@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    (%rcx),%eax
  mov    %eax,(%rdx)
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%edx
  mov    -0x28(%rbp),%rax
  mov    %edx,(%rax)
L4:
  addl   $0x1,-0x4(%rbp)
L0:
  mov    -0x4(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L15
  mov    -0x18(%rbp),%rax
  leave
  ret
```

assistant: ```c
int *eliminaNeg(int *vect, int dim, int *new_dim) {
  *new_dim = dim;
  int i;
  for (i = 0; i < dim; i++) {
    if (vect[i] < 0) {
      vect[i] = -vect[i];
      vect = realloc(vect, sizeof(int) * (*new_dim + 1));
      vect[*new_dim] = vect[i];
      (*new_dim)++;
    }
  }
  return vect;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<eliminaNeg>:
  endbr64
  mov    %esi,(%rdx)
  test   %esi,%esi
  jle    L13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdx,%r12
  mov    %esi,%esi
  lea    0x0(,%rsi,4),%rbp
  mov    $0x0,%ebx
  jmp    L0
L10:
  add    $0x4,%rbx
  cmp    %rbp,%rbx
  je     L16
L0:
  lea    (%rdi,%rbx,1),%rdx
  mov    (%rdx),%eax
  test   %eax,%eax
  jns    L10
  neg    %eax
  mov    %eax,(%rdx)
  mov    (%r12),%eax
  lea    0x4(,%rax,4),%esi
  call   <realloc@plt>
  mov    %rax,%rdi
  mov    (%rax,%rbx,1),%edx
  movslq (%r12),%rax
  mov    %edx,(%rdi,%rax,4)
  addl   $0x1,(%r12)
  jmp    L10
L16:
  mov    %rdi,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L13:
  mov    %rdi,%rax
  ret
```

assistant: ```c
int *eliminaNeg(int *vect, int dim, int *new_dim) {
  *new_dim = dim;
  int i;
  for (i = 0; i < dim; i++) {
    if (vect[i] < 0) {
      vect[i] = -vect[i];
      vect = realloc(vect, sizeof(int) * (*new_dim + 1));
      vect[*new_dim] = vect[i];
      (*new_dim)++;
    }
  }
  return vect;
}
```
user: Translate the below assembly code into C programming language:

```asm
<eliminaNeg>:
  endbr64
  mov    %esi,(%rdx)
  test   %esi,%esi
  jle    L48
  movslq %esi,%rsi
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  lea    0x0(,%rsi,4),%rbp
  push   %rbx
  xor    %ebx,%ebx
  jmp    L21
L8:
  add    $0x4,%rbx
  cmp    %rbp,%rbx
  je     L6
L21:
  lea    (%rdi,%rbx,1),%rdx
  mov    (%rdx),%eax
  test   %eax,%eax
  jns    L8
  neg    %eax
  mov    %eax,(%rdx)
  mov    (%r12),%eax
  lea    0x4(,%rax,4),%esi
  call   <realloc@plt>
  mov    (%rax,%rbx,1),%edx
  mov    %rax,%rdi
  movslq (%r12),%rax
  add    $0x4,%rbx
  mov    %edx,(%rdi,%rax,4)
  addl   $0x1,(%r12)
  cmp    %rbp,%rbx
  jne    L21
L6:
  pop    %rbx
  mov    %rdi,%rax
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L48:
  mov    %rdi,%rax
  ret
```

assistant: ```c
int *eliminaNeg(int *vect, int dim, int *new_dim) {
  *new_dim = dim;
  int i;
  for (i = 0; i < dim; i++) {
    if (vect[i] < 0) {
      vect[i] = -vect[i];
      vect = realloc(vect, sizeof(int) * (*new_dim + 1));
      vect[*new_dim] = vect[i];
      (*new_dim)++;
    }
  }
  return vect;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<eliminaNeg>:
  endbr64
  mov    %esi,(%rdx)
  test   %esi,%esi
  jle    L32
  movslq %esi,%rsi
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  lea    0x0(,%rsi,4),%rbp
  push   %rbx
  xor    %ebx,%ebx
  jmp    L40
L41:
  add    $0x4,%rbx
  cmp    %rbp,%rbx
  je     L21
L40:
  lea    (%rdi,%rbx,1),%rdx
  mov    (%rdx),%eax
  test   %eax,%eax
  jns    L41
  neg    %eax
  mov    %eax,(%rdx)
  mov    (%r12),%eax
  lea    0x4(,%rax,4),%esi
  call   <realloc@plt>
  mov    (%rax,%rbx,1),%edx
  mov    %rax,%rdi
  movslq (%r12),%rax
  add    $0x4,%rbx
  mov    %edx,(%rdi,%rax,4)
  addl   $0x1,(%r12)
  cmp    %rbp,%rbx
  jne    L40
L21:
  pop    %rbx
  mov    %rdi,%rax
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L32:
  mov    %rdi,%rax
  ret
```

assistant: ```c
int *eliminaNeg(int *vect, int dim, int *new_dim) {
  *new_dim = dim;
  int i;
  for (i = 0; i < dim; i++) {
    if (vect[i] < 0) {
      vect[i] = -vect[i];
      vect = realloc(vect, sizeof(int) * (*new_dim + 1));
      vect[*new_dim] = vect[i];
      (*new_dim)++;
    }
  }
  return vect;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<rangeisect>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    %r8,-0x38(%rbp)
  mov    %r9,-0x40(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <assert@plt>
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <assert@plt>
  cmpq   $0x0,-0x20(%rbp)
  je     L89
  cmpq   $0x0,-0x30(%rbp)
  jne    L156
L89:
  mov    $0x0,%eax
  jmp    L97
L156:
  mov    -0x18(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  jae    L151
  mov    -0x18(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  cmp    %rax,-0x28(%rbp)
  jae    L151
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x28(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  mov    -0x18(%rbp),%rcx
  mov    -0x20(%rbp),%rax
  add    %rcx,%rax
  cmp    %rax,%rdx
  jae    L153
  mov    -0x28(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  sub    $0x1,%rax
  jmp    L134
L153:
  mov    -0x18(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  sub    $0x1,%rax
L134:
  mov    %rax,-0x8(%rbp)
  jmp    L18
L151:
  mov    -0x28(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  jae    L107
  mov    -0x28(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  cmp    %rax,-0x18(%rbp)
  jae    L107
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x18(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  mov    -0x28(%rbp),%rcx
  mov    -0x30(%rbp),%rax
  add    %rcx,%rax
  cmp    %rax,%rdx
  jae    L45
  mov    -0x18(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  sub    $0x1,%rax
  jmp    L46
L45:
  mov    -0x28(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  sub    $0x1,%rax
L46:
  mov    %rax,-0x8(%rbp)
  jmp    L18
L107:
  mov    -0x18(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  jne    L117
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x30(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <llmin@plt>
  mov    -0x18(%rbp),%rdx
  add    %rdx,%rax
  sub    $0x1,%rax
  mov    %rax,-0x8(%rbp)
  jmp    L18
L117:
  mov    $0x0,%eax
  jmp    L97
L18:
  mov    -0x8(%rbp),%rax
  sub    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    -0x40(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x38(%rbp),%rax
  mov    -0x10(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    $0x1,%eax
L97:
  leave
  ret
```

assistant: ```c
int rangeisect(off_t off0, size_t siz0, off_t off1, size_t siz1, off_t *off, size_t *siz) {
  off_t ioff, iend;
  assert(off);
  assert(siz);
  if (!siz0 || !siz1) {
    return 0;
  }
  if ((off0 < off1) && ((off_t)(off0 + siz0) > off1)) {
    ioff = off1;
    iend = off1 + siz1 < off0 + siz0 ? off1 + siz1 - 1 : off0 + siz0 - 1;
  } else if ((off1 < off0) && ((off_t)(off1 + siz1) > off0)) {
    ioff = off0;
    iend = off0 + siz0 < off1 + siz1 ? off0 + siz0 - 1 : off1 + siz1 - 1;
  } else if (off0 == off1) {
    ioff = off0;
    iend = off0 + llmin(siz0, siz1) - 1;
  } else {
    return 0;
  }
  *siz = iend - ioff + 1;
  *off = ioff;
  return 1;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<rangeisect>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%r13
  mov    %rdx,%r12
  mov    %rcx,%rbp
  mov    %r8,%r14
  mov    %r9,%r15
  mov    %r8,%rdi
  call   <assert@plt>
  mov    %r15,%rdi
  call   <assert@plt>
  test   %r13,%r13
  je     L8
  test   %rbp,%rbp
  je     L8
  cmp    %r12,%rbx
  jae    L88
  lea    0x0(%r13,%rbx,1),%rax
  cmp    %r12,%rax
  jbe    L136
  add    %r12,%rbp
  cmp    %rbp,%rax
  jbe    L36
  lea    -0x1(%rbp),%rax
  mov    %r12,%rbx
  jmp    L92
L36:
  sub    $0x1,%rax
  mov    %r12,%rbx
  jmp    L92
L88:
  jbe    L130
L98:
  add    %r12,%rbp
  mov    $0x0,%eax
  cmp    %rbx,%rbp
  jbe    L38
  add    %rbx,%r13
  lea    -0x1(%r13),%rdx
  lea    -0x1(%rbp),%rax
  cmp    %r13,%rbp
  cmova  %rdx,%rax
L92:
  add    $0x1,%rax
  sub    %rbx,%rax
  mov    %rax,(%r15)
  mov    %rbx,(%r14)
  mov    $0x1,%eax
L38:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L130:
  mov    $0x0,%eax
  jne    L38
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <llmin@plt>
  lea    -0x1(%rbx,%rax,1),%rax
  jmp    L92
L8:
  mov    $0x0,%eax
  jmp    L38
L136:
  cmp    %r12,%rbx
  ja     L98
  mov    $0x0,%eax
  jmp    L38
```

assistant: ```c
int rangeisect(off_t off0, size_t siz0, off_t off1, size_t siz1, off_t *off, size_t *siz) {
  off_t ioff, iend;
  assert(off);
  assert(siz);
  if (!siz0 || !siz1) {
    return 0;
  }
  if ((off0 < off1) && ((off_t)(off0 + siz0) > off1)) {
    ioff = off1;
    iend = off1 + siz1 < off0 + siz0 ? off1 + siz1 - 1 : off0 + siz0 - 1;
  } else if ((off1 < off0) && ((off_t)(off1 + siz1) > off0)) {
    ioff = off0;
    iend = off0 + siz0 < off1 + siz1 ? off0 + siz0 - 1 : off1 + siz1 - 1;
  } else if (off0 == off1) {
    ioff = off0;
    iend = off0 + llmin(siz0, siz1) - 1;
  } else {
    return 0;
  }
  *siz = iend - ioff + 1;
  *off = ioff;
  return 1;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<rangeisect>:
  endbr64
  push   %r15
  mov    %r8,%r15
  push   %r14
  mov    %rdx,%r14
  push   %r13
  mov    %rdi,%r13
  mov    %r8,%rdi
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  mov    %r9,%rbx
  sub    $0x8,%rsp
  call   <assert@plt>
  mov    %rbx,%rdi
  call   <assert@plt>
  test   %r12,%r12
  je     L27
  test   %rbp,%rbp
  je     L27
  cmp    %r14,%r13
  jae    L52
  add    %r13,%r12
  xor    %eax,%eax
  cmp    %r14,%r12
  jbe    L28
  lea    0x0(%rbp,%r14,1),%rax
  mov    %r12,%rdx
  mov    %r14,%r13
  sub    %r14,%rdx
  cmp    %rax,%r12
  cmovbe %rdx,%rbp
L13:
  mov    %rbp,(%rbx)
  mov    $0x1,%eax
  mov    %r13,(%r15)
L28:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L52:
  ja     L37
  mov    $0x0,%eax
  jne    L28
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <llmin@plt>
  mov    %rax,%rbp
  jmp    L13
  nopl   0x0(%rax)
L37:
  add    %r14,%rbp
  xor    %eax,%eax
  cmp    %r13,%rbp
  jbe    L28
  mov    %rbp,%rax
  lea    (%r12,%r13,1),%rdx
  sub    %r13,%rax
  cmp    %rdx,%rbp
  mov    %r12,%rbp
  cmovbe %rax,%rbp
  jmp    L13
L27:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
int rangeisect(off_t off0, size_t siz0, off_t off1, size_t siz1, off_t *off, size_t *siz) {
  off_t ioff, iend;
  assert(off);
  assert(siz);
  if (!siz0 || !siz1) {
    return 0;
  }
  if ((off0 < off1) && ((off_t)(off0 + siz0) > off1)) {
    ioff = off1;
    iend = off1 + siz1 < off0 + siz0 ? off1 + siz1 - 1 : off0 + siz0 - 1;
  } else if ((off1 < off0) && ((off_t)(off1 + siz1) > off0)) {
    ioff = off0;
    iend = off0 + siz0 < off1 + siz1 ? off0 + siz0 - 1 : off1 + siz1 - 1;
  } else if (off0 == off1) {
    ioff = off0;
    iend = off0 + llmin(siz0, siz1) - 1;
  } else {
    return 0;
  }
  *siz = iend - ioff + 1;
  *off = ioff;
  return 1;
}
```
user: What is the c source code of the assembly code below:

```asm
<rangeisect>:
  endbr64
  push   %r15
  mov    %r8,%r15
  push   %r14
  mov    %rdx,%r14
  push   %r13
  mov    %rdi,%r13
  mov    %r8,%rdi
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  mov    %r9,%rbx
  sub    $0x8,%rsp
  call   <assert@plt>
  mov    %rbx,%rdi
  call   <assert@plt>
  test   %r12,%r12
  je     L87
  test   %rbp,%rbp
  je     L87
  cmp    %r14,%r13
  jae    L6
  add    %r13,%r12
  xor    %eax,%eax
  cmp    %r14,%r12
  jbe    L20
  lea    0x0(%rbp,%r14,1),%rax
  mov    %r12,%rdx
  mov    %r14,%r13
  sub    %r14,%rdx
  cmp    %rax,%r12
  cmovbe %rdx,%rbp
L81:
  mov    %rbp,(%rbx)
  mov    $0x1,%eax
  mov    %r13,(%r15)
L20:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L6:
  ja     L42
  mov    $0x0,%eax
  jne    L20
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <llmin@plt>
  mov    %rax,%rbp
  jmp    L81
  nopl   0x0(%rax)
L42:
  add    %r14,%rbp
  xor    %eax,%eax
  cmp    %r13,%rbp
  jbe    L20
  mov    %rbp,%rax
  lea    (%r12,%r13,1),%rdx
  sub    %r13,%rax
  cmp    %rdx,%rbp
  mov    %r12,%rbp
  cmovbe %rax,%rbp
  jmp    L81
L87:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
int rangeisect(off_t off0, size_t siz0, off_t off1, size_t siz1, off_t *off, size_t *siz) {
  off_t ioff, iend;
  assert(off);
  assert(siz);
  if (!siz0 || !siz1) {
    return 0;
  }
  if ((off0 < off1) && ((off_t)(off0 + siz0) > off1)) {
    ioff = off1;
    iend = off1 + siz1 < off0 + siz0 ? off1 + siz1 - 1 : off0 + siz0 - 1;
  } else if ((off1 < off0) && ((off_t)(off1 + siz1) > off0)) {
    ioff = off0;
    iend = off0 + siz0 < off1 + siz1 ? off0 + siz0 - 1 : off1 + siz1 - 1;
  } else if (off0 == off1) {
    ioff = off0;
    iend = off0 + llmin(siz0, siz1) - 1;
  } else {
    return 0;
  }
  *siz = iend - ioff + 1;
  *off = ioff;
  return 1;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<vFrustum>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %esi,%r12d
  mov    %edx,%esi
  mov    %ecx,%ebx
  mov    0x28(%rsp),%ecx
  mov    %edx,%r13d
  sub    %r12d,%r13d
  mov    %r8d,%ebp
  sub    %ebx,%ebp
  mov    %ecx,%r10d
  sub    %r9d,%r10d
  lea    (%r9,%r9,1),%r11d
  mov    %r11d,%eax
  cltd
  idiv   %r13d
  mov    %eax,(%rdi)
  movl   $0x0,0x10(%rdi)
  lea    (%rsi,%r12,1),%eax
  cltd
  idiv   %r13d
  mov    %eax,0x20(%rdi)
  movl   $0x0,0x30(%rdi)
  movl   $0x0,0x4(%rdi)
  mov    %r11d,%eax
  cltd
  idiv   %ebp
  mov    %eax,0x14(%rdi)
  lea    (%r8,%rbx,1),%eax
  cltd
  idiv   %ebp
  mov    %eax,0x24(%rdi)
  movl   $0x0,0x34(%rdi)
  movl   $0x0,0x8(%rdi)
  movl   $0x0,0x18(%rdi)
  lea    (%rcx,%r9,1),%eax
  neg    %eax
  cltd
  idiv   %r10d
  mov    %eax,0x28(%rdi)
  imul   %r9d,%ecx
  neg    %ecx
  lea    (%rcx,%rcx,1),%eax
  cltd
  idiv   %r10d
  mov    %eax,0x38(%rdi)
  movl   $0x0,0xc(%rdi)
  movl   $0x0,0x1c(%rdi)
  movl   $0xffffffff,0x2c(%rdi)
  movl   $0x0,0x3c(%rdi)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
void vFrustum(GLfloat mMatrix[16], GLfloat nLeft, GLfloat nRight, GLfloat nBottom, GLfloat nTop, GLfloat nNear, GLfloat nFar) {
  GLfloat nA = (nRight + nLeft) / (nRight - nLeft);
  GLfloat nB = (nTop + nBottom) / (nTop - nBottom);
  GLfloat nC = -(nFar + nNear) / (nFar - nNear);
  GLfloat nD = -(2 * nFar * nNear) / (nFar - nNear);
  mMatrix[0] = (2 * nNear) / (nRight - nLeft);
  mMatrix[4] = 0;
  mMatrix[8] = nA;
  mMatrix[12] = 0;
  mMatrix[1] = 0;
  mMatrix[5] = (2 * nNear) / (nTop - nBottom);
  mMatrix[9] = nB;
  mMatrix[13] = 0;
  mMatrix[2] = 0;
  mMatrix[6] = 0;
  mMatrix[10] = nC;
  mMatrix[14] = nD;
  mMatrix[3] = 0;
  mMatrix[7] = 0;
  mMatrix[11] = -1;
  mMatrix[15] = 0;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<vFrustum>:
  endbr64
  lea    (%r9,%r9,1),%r11d
  push   %r13
  mov    %edx,%r13d
  push   %r12
  mov    %r11d,%eax
  mov    %esi,%r12d
  mov    %edx,%esi
  sub    %r12d,%r13d
  cltd
  push   %rbp
  mov    %r8d,%ebp
  idiv   %r13d
  push   %rbx
  movq   $0x0,0x4(%rdi)
  movq   $0x0,0xc(%rdi)
  movq   $0x0,0x18(%rdi)
  movl   $0x0,0x34(%rdi)
  movl   $0x0,0x3c(%rdi)
  mov    %ecx,%ebx
  mov    0x28(%rsp),%ecx
  sub    %ebx,%ebp
  mov    %ecx,%r10d
  sub    %r9d,%r10d
  mov    %eax,(%rdi)
  lea    (%rsi,%r12,1),%eax
  cltd
  idiv   %r13d
  mov    %eax,0x20(%rdi)
  mov    %r11d,%eax
  cltd
  idiv   %ebp
  mov    %eax,0x14(%rdi)
  lea    (%r8,%rbx,1),%eax
  pop    %rbx
  cltd
  idiv   %ebp
  pop    %rbp
  pop    %r12
  pop    %r13
  mov    %eax,0x24(%rdi)
  lea    (%rcx,%r9,1),%eax
  neg    %eax
  imul   %r9d,%ecx
  cltd
  idiv   %r10d
  neg    %ecx
  mov    %eax,0x28(%rdi)
  lea    (%rcx,%rcx,1),%eax
  cltd
  idiv   %r10d
  mov    %eax,0x38(%rdi)
  mov    $0xffffffff,%eax
  mov    %rax,0x2c(%rdi)
  ret
```

assistant: ```c
void vFrustum(GLfloat mMatrix[16], GLfloat nLeft, GLfloat nRight, GLfloat nBottom, GLfloat nTop, GLfloat nNear, GLfloat nFar) {
  GLfloat nA = (nRight + nLeft) / (nRight - nLeft);
  GLfloat nB = (nTop + nBottom) / (nTop - nBottom);
  GLfloat nC = -(nFar + nNear) / (nFar - nNear);
  GLfloat nD = -(2 * nFar * nNear) / (nFar - nNear);
  mMatrix[0] = (2 * nNear) / (nRight - nLeft);
  mMatrix[4] = 0;
  mMatrix[8] = nA;
  mMatrix[12] = 0;
  mMatrix[1] = 0;
  mMatrix[5] = (2 * nNear) / (nTop - nBottom);
  mMatrix[9] = nB;
  mMatrix[13] = 0;
  mMatrix[2] = 0;
  mMatrix[6] = 0;
  mMatrix[10] = nC;
  mMatrix[14] = nD;
  mMatrix[3] = 0;
  mMatrix[7] = 0;
  mMatrix[11] = -1;
  mMatrix[15] = 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<vFrustum>:
  endbr64
  lea    (%r9,%r9,1),%r11d
  push   %r13
  mov    %edx,%r13d
  push   %r12
  mov    %r11d,%eax
  mov    %esi,%r12d
  mov    %edx,%esi
  sub    %r12d,%r13d
  cltd
  push   %rbp
  mov    %r8d,%ebp
  idiv   %r13d
  push   %rbx
  movq   $0x0,0x4(%rdi)
  movq   $0x0,0xc(%rdi)
  movq   $0x0,0x18(%rdi)
  movl   $0x0,0x34(%rdi)
  movl   $0x0,0x3c(%rdi)
  mov    %ecx,%ebx
  mov    0x28(%rsp),%ecx
  sub    %ebx,%ebp
  mov    %ecx,%r10d
  sub    %r9d,%r10d
  mov    %eax,(%rdi)
  lea    (%rsi,%r12,1),%eax
  cltd
  idiv   %r13d
  mov    %eax,0x20(%rdi)
  mov    %r11d,%eax
  cltd
  idiv   %ebp
  mov    %eax,0x14(%rdi)
  lea    (%r8,%rbx,1),%eax
  pop    %rbx
  cltd
  idiv   %ebp
  pop    %rbp
  pop    %r12
  pop    %r13
  mov    %eax,0x24(%rdi)
  lea    (%rcx,%r9,1),%eax
  neg    %eax
  imul   %r9d,%ecx
  cltd
  idiv   %r10d
  neg    %ecx
  mov    %eax,0x28(%rdi)
  lea    (%rcx,%rcx,1),%eax
  cltd
  idiv   %r10d
  mov    %eax,0x38(%rdi)
  mov    $0xffffffff,%eax
  mov    %rax,0x2c(%rdi)
  ret
```

assistant: ```c
void vFrustum(GLfloat mMatrix[16], GLfloat nLeft, GLfloat nRight, GLfloat nBottom, GLfloat nTop, GLfloat nNear, GLfloat nFar) {
  GLfloat nA = (nRight + nLeft) / (nRight - nLeft);
  GLfloat nB = (nTop + nBottom) / (nTop - nBottom);
  GLfloat nC = -(nFar + nNear) / (nFar - nNear);
  GLfloat nD = -(2 * nFar * nNear) / (nFar - nNear);
  mMatrix[0] = (2 * nNear) / (nRight - nLeft);
  mMatrix[4] = 0;
  mMatrix[8] = nA;
  mMatrix[12] = 0;
  mMatrix[1] = 0;
  mMatrix[5] = (2 * nNear) / (nTop - nBottom);
  mMatrix[9] = nB;
  mMatrix[13] = 0;
  mMatrix[2] = 0;
  mMatrix[6] = 0;
  mMatrix[10] = nC;
  mMatrix[14] = nD;
  mMatrix[3] = 0;
  mMatrix[7] = 0;
  mMatrix[11] = -1;
  mMatrix[15] = 0;
}
```