ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<getpwent_r>:
  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    $0x0,%eax
  call   <getpwent@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L7
  mov    D9(%rip),%rax
  mov    (%rax),%eax
  jmp    L13
L7:
  mov    -0x8(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    $0x4,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x30(%rbp),%rax
  mov    -0x18(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    $0x0,%eax
L13:
  leave
  ret
```

assistant: ```c
int getpwent_r(struct passwd *pwbuf, char *buf, size_t buflen, struct passwd **pwbufp) {
  struct passwd *pw;
  if ((pw = getpwent()) == NULL) {
    return ERANGE;
  }
  memcpy(pwbuf, pw, sizeof(*pw));
  *pwbufp = pwbuf;
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<getpwent_r>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %rcx,%rbp
  mov    $0x0,%eax
  call   <getpwent@plt>
  test   %rax,%rax
  je     L6
  mov    %rax,%rsi
  mov    $0x4,%edx
  mov    %rbx,%rdi
  call   <memcpy@plt>
  mov    %rbx,0x0(%rbp)
  mov    $0x0,%eax
L18:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L6:
  mov    D8(%rip),%rax
  mov    (%rax),%eax
  jmp    L18
```

assistant: ```c
int getpwent_r(struct passwd *pwbuf, char *buf, size_t buflen, struct passwd **pwbufp) {
  struct passwd *pw;
  if ((pw = getpwent()) == NULL) {
    return ERANGE;
  }
  memcpy(pwbuf, pw, sizeof(*pw));
  *pwbufp = pwbuf;
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<getpwent_r>:
  endbr64
  push   %rbp
  xor    %eax,%eax
  mov    %rcx,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  call   <getpwent@plt>
  test   %rax,%rax
  je     L0
  mov    %rbx,%rdi
  mov    %rax,%rsi
  mov    $0x4,%edx
  call   <memcpy@plt>
  mov    %rbx,0x0(%rbp)
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax)
L0:
  mov    D1(%rip),%rax
  mov    (%rax),%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
int getpwent_r(struct passwd *pwbuf, char *buf, size_t buflen, struct passwd **pwbufp) {
  struct passwd *pw;
  if ((pw = getpwent()) == NULL) {
    return ERANGE;
  }
  memcpy(pwbuf, pw, sizeof(*pw));
  *pwbufp = pwbuf;
  return 0;
}
```
user: What is the c source code of the assembly code below:

```asm
<getpwent_r>:
  endbr64
  push   %rbp
  xor    %eax,%eax
  mov    %rcx,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  call   <getpwent@plt>
  test   %rax,%rax
  je     L2
  mov    %rbx,%rdi
  mov    %rax,%rsi
  mov    $0x4,%edx
  call   <memcpy@plt>
  mov    %rbx,0x0(%rbp)
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax)
L2:
  mov    D9(%rip),%rax
  mov    (%rax),%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
int getpwent_r(struct passwd *pwbuf, char *buf, size_t buflen, struct passwd **pwbufp) {
  struct passwd *pw;
  if ((pw = getpwent()) == NULL) {
    return ERANGE;
  }
  memcpy(pwbuf, pw, sizeof(*pw));
  *pwbufp = pwbuf;
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<getpivot>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    -0x20(%rbp),%eax
  sub    -0x1c(%rbp),%eax
  cmp    $0x4,%eax
  jg     L18
  mov    -0x20(%rbp),%edx
  mov    -0x1c(%rbp),%ecx
  mov    -0x18(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <insertsort@plt>
  jmp    L35
L18:
  mov    -0x1c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  jmp    L14
L20:
  mov    -0x8(%rbp),%eax
  lea    0x4(%rax),%edx
  mov    -0x8(%rbp),%ecx
  mov    -0x18(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <insertsort@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  addl   $0x1,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <swap@plt>
  addl   $0x5,-0x8(%rbp)
L14:
  mov    -0x8(%rbp),%eax
  add    $0x3,%eax
  cmp    %eax,-0x20(%rbp)
  jg     L20
  mov    -0xc(%rbp),%eax
  sub    -0x1c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  lea    0x1(%rax),%ecx
  mov    -0xc(%rbp),%edx
  mov    -0x1c(%rbp),%esi
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <bfprt@plt>
L35:
  leave
  ret
```

assistant: ```c
int getpivot(int *arr, int left, int right) {
  if ((right - left) < 5)
    return insertsort(arr, left, right);
  int flag = left - 1;
  int index;
  for (int i = left; i + 4 <= right; i += 5) {
    index = insertsort(arr, i, i + 4);
    swap(&arr[++flag], &arr[index]);
  }
  return bfprt(arr, left, flag, ((flag - left + 1) / 2) + 1);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<getpivot>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r12
  mov    %esi,%r15d
  mov    %edx,%r14d
  mov    %edx,%eax
  sub    %esi,%eax
  cmp    $0x4,%eax
  jle    L4
  lea    -0x1(%rsi),%r13d
  lea    0x3(%rsi),%eax
  cmp    %eax,%edx
  jle    L8
  movslq %esi,%rax
  lea    (%rdi,%rax,4),%rbp
  mov    %esi,%ebx
L12:
  lea    0x4(%rbx),%edx
  mov    %ebx,%esi
  mov    %r12,%rdi
  call   <insertsort@plt>
  add    $0x1,%r13d
  cltq
  lea    (%r12,%rax,4),%rsi
  mov    %rbp,%rdi
  call   <swap@plt>
  mov    %ebx,%eax
  add    $0x5,%ebx
  add    $0x4,%rbp
  add    $0x8,%eax
  cmp    %eax,%r14d
  jg     L12
L8:
  mov    %r13d,%eax
  sub    %r15d,%eax
  add    $0x1,%eax
  mov    %eax,%ecx
  shr    $0x1f,%ecx
  add    %eax,%ecx
  sar    %ecx
  add    $0x1,%ecx
  mov    %r13d,%edx
  mov    %r15d,%esi
  mov    %r12,%rdi
  call   <bfprt@plt>
L37:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L4:
  call   <insertsort@plt>
  jmp    L37
```

assistant: ```c
int getpivot(int *arr, int left, int right) {
  if ((right - left) < 5)
    return insertsort(arr, left, right);
  int flag = left - 1;
  int index;
  for (int i = left; i + 4 <= right; i += 5) {
    index = insertsort(arr, i, i + 4);
    swap(&arr[++flag], &arr[index]);
  }
  return bfprt(arr, left, flag, ((flag - left + 1) / 2) + 1);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<getpivot>:
  endbr64
  push   %r15
  mov    %edx,%eax
  mov    %esi,%r15d
  push   %r14
  sub    %esi,%eax
  mov    %edx,%r14d
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  cmp    $0x4,%eax
  jle    L23
  lea    0x3(%rsi),%eax
  lea    -0x1(%rsi),%r13d
  cmp    %eax,%edx
  jle    L2
  movslq %esi,%rax
  mov    %esi,%ebx
  lea    (%rdi,%rax,4),%rbp
L24:
  lea    0x4(%rbx),%edx
  mov    %ebx,%esi
  mov    %r12,%rdi
  add    $0x1,%r13d
  call   <insertsort@plt>
  mov    %rbp,%rdi
  add    $0x4,%rbp
  cltq
  lea    (%r12,%rax,4),%rsi
  call   <swap@plt>
  mov    %ebx,%eax
  add    $0x5,%ebx
  add    $0x8,%eax
  cmp    %r14d,%eax
  jl     L24
  mov    %r13d,%eax
  sub    %r15d,%eax
  add    $0x1,%eax
  mov    %eax,%ecx
  shr    $0x1f,%ecx
  add    %eax,%ecx
  sar    %ecx
  add    $0x1,%ecx
L36:
  add    $0x8,%rsp
  mov    %r13d,%edx
  mov    %r15d,%esi
  mov    %r12,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1080 <bfprt@plt>
  nopl   0x0(%rax)
L23:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1090 <insertsort@plt>
  nopl   0x0(%rax,%rax,1)
L2:
  mov    $0x1,%ecx
  jmp    L36
```

assistant: ```c
int getpivot(int *arr, int left, int right) {
  if ((right - left) < 5)
    return insertsort(arr, left, right);
  int flag = left - 1;
  int index;
  for (int i = left; i + 4 <= right; i += 5) {
    index = insertsort(arr, i, i + 4);
    swap(&arr[++flag], &arr[index]);
  }
  return bfprt(arr, left, flag, ((flag - left + 1) / 2) + 1);
}
```
user: Translate the below assembly code into C programming language:

```asm
<getpivot>:
  endbr64
  push   %r15
  mov    %edx,%eax
  mov    %esi,%r15d
  push   %r14
  sub    %esi,%eax
  mov    %edx,%r14d
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  cmp    $0x4,%eax
  jle    L7
  lea    0x3(%rsi),%eax
  lea    -0x1(%rsi),%r13d
  cmp    %eax,%edx
  jle    L1
  movslq %esi,%rax
  mov    %esi,%ebx
  lea    (%rdi,%rax,4),%rbp
L31:
  lea    0x4(%rbx),%edx
  mov    %ebx,%esi
  mov    %r12,%rdi
  add    $0x1,%r13d
  call   <insertsort@plt>
  mov    %rbp,%rdi
  add    $0x4,%rbp
  cltq
  lea    (%r12,%rax,4),%rsi
  call   <swap@plt>
  mov    %ebx,%eax
  add    $0x5,%ebx
  add    $0x8,%eax
  cmp    %r14d,%eax
  jl     L31
  mov    %r13d,%eax
  sub    %r15d,%eax
  add    $0x1,%eax
  mov    %eax,%ecx
  shr    $0x1f,%ecx
  add    %eax,%ecx
  sar    %ecx
  add    $0x1,%ecx
L21:
  add    $0x8,%rsp
  mov    %r13d,%edx
  mov    %r15d,%esi
  mov    %r12,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1080 <bfprt@plt>
  nopl   0x0(%rax)
L7:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1090 <insertsort@plt>
  nopl   0x0(%rax,%rax,1)
L1:
  mov    $0x1,%ecx
  jmp    L21
```

assistant: ```c
int getpivot(int *arr, int left, int right) {
  if ((right - left) < 5)
    return insertsort(arr, left, right);
  int flag = left - 1;
  int index;
  for (int i = left; i + 4 <= right; i += 5) {
    index = insertsort(arr, i, i + 4);
    swap(&arr[++flag], &arr[index]);
  }
  return bfprt(arr, left, flag, ((flag - left + 1) / 2) + 1);
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    $0x0,%eax
  call   <__VERIFIER_nondet_int@plt>
  mov    %eax,-0xc(%rbp)
  mov    $0x0,%eax
  call   <__VERIFIER_nondet_int@plt>
  mov    %eax,-0x8(%rbp)
L8:
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  neg    %eax
  mov    %eax,-0xc(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  jmp    L8
```

assistant: ```c
int main() {
  int x = __VERIFIER_nondet_int();
  int y = __VERIFIER_nondet_int();
  while (1) {
    int old_x = x;
    x = -y;
    y = old_x;
  }
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%eax
  call   <__VERIFIER_nondet_int@plt>
  mov    $0x0,%eax
  call   <__VERIFIER_nondet_int@plt>
L6:
  jmp    L6
```

assistant: ```c
int main() {
  int x = __VERIFIER_nondet_int();
  int y = __VERIFIER_nondet_int();
  while (1) {
    int old_x = x;
    x = -y;
    y = old_x;
  }
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <__VERIFIER_nondet_int@plt>
  xor    %eax,%eax
  call   <__VERIFIER_nondet_int@plt>
L2:
  jmp    L2
```

assistant: ```c
int main() {
  int x = __VERIFIER_nondet_int();
  int y = __VERIFIER_nondet_int();
  while (1) {
    int old_x = x;
    x = -y;
    y = old_x;
  }
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <__VERIFIER_nondet_int@plt>
  xor    %eax,%eax
  call   <__VERIFIER_nondet_int@plt>
L3:
  jmp    L3
```

assistant: ```c
int main() {
  int x = __VERIFIER_nondet_int();
  int y = __VERIFIER_nondet_int();
  while (1) {
    int old_x = x;
    x = -y;
    y = old_x;
  }
  return 0;
}
```
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
  movq   $0x0,-0x8(%rbp)
  movl   $0x2,-0xc(%rbp)
  jmp    L5
L8:
  mov    -0xc(%rbp),%eax
  mov    %eax,%edi
  call   <isPrime@plt>
  test   %rax,%rax
  je     L10
  mov    -0xc(%rbp),%eax
  cltq
  add    %rax,-0x8(%rbp)
L10:
  addl   $0x1,-0xc(%rbp)
L5:
  cmpl   $0x1e847f,-0xc(%rbp)
  jle    L8
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_label: D8
type_guessed: string

tool: D8: %ld


assistant: ```c
int main(void) {
  long total = 0;
  for (int i = 2; i < 2000000; i++) {
    if (isPrime(i)) {
      total += i;
    }
  }
  printf("%ld\n", total);
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    $0x2,%ebx
  mov    $0x0,%ebp
L2:
  mov    %ebx,%edi
  call   <isPrime@plt>
  mov    %rax,%rdx
  lea    0x0(%rbp,%rbx,1),%rax
  test   %rdx,%rdx
  cmovne %rax,%rbp
  add    $0x1,%rbx
  cmp    $0x1e8480,%rbx
  jne    L2
  mov    %rbp,%rsi
  lea    D4(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D4
type_guessed: string

tool: D4: %ld


assistant: ```c
int main(void) {
  long total = 0;
  for (int i = 2; i < 2000000; i++) {
    if (isPrime(i)) {
      total += i;
    }
  }
  printf("%ld\n", total);
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<main>:
  endbr64
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  mov    $0x2,%ebx
  sub    $0x8,%rsp
  nopl   0x0(%rax)
L8:
  mov    %ebx,%edi
  call   <isPrime@plt>
  mov    %rax,%r8
  lea    0x0(%rbp,%rbx,1),%rax
  test   %r8,%r8
  cmovne %rax,%rbp
  add    $0x1,%rbx
  cmp    $0x1e8480,%rbx
  jne    L8
  mov    %rbp,%rsi
  lea    D4(%rip),%rdi
  call   <printf@plt>
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
```

tool_calls: name: unpack_data
arguments: label: D4
type: string

tool: D4: %ld


assistant: ```c
int main(void) {
  long total = 0;
  for (int i = 2; i < 2000000; i++) {
    if (isPrime(i)) {
      total += i;
    }
  }
  printf("%ld\n", total);
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  mov    $0x2,%ebx
  sub    $0x8,%rsp
  nopl   0x0(%rax)
L9:
  mov    %ebx,%edi
  call   <isPrime@plt>
  mov    %rax,%r8
  lea    0x0(%rbp,%rbx,1),%rax
  test   %r8,%r8
  cmovne %rax,%rbp
  add    $0x1,%rbx
  cmp    $0x1e8480,%rbx
  jne    L9
  mov    %rbp,%rsi
  lea    D8(%rip),%rdi
  call   <printf@plt>
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
```

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

tool: D8: %ld


assistant: ```c
int main(void) {
  long total = 0;
  for (int i = 2; i < 2000000; i++) {
    if (isPrime(i)) {
      total += i;
    }
  }
  printf("%ld\n", total);
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<getMaxRange>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  cmpq   $0x1,-0x38(%rbp)
  jne    L10
  mov    $0x1,%eax
  jmp    L57
L10:
  movq   $0x0,-0x8(%rbp)
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x11(%rbp)
  movq   $0x1,-0x10(%rbp)
  jmp    L50
L51:
  mov    -0x10(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    %al,-0x11(%rbp)
  jne    L49
  addq   $0x1,-0x30(%rbp)
  mov    -0x8(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <maxOf@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L8
L49:
  movq   $0x0,-0x30(%rbp)
L8:
  mov    -0x10(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x11(%rbp)
  addq   $0x1,-0x10(%rbp)
L50:
  mov    -0x10(%rbp),%rax
  cmp    -0x38(%rbp),%rax
  jl     L51
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
L57:
  leave
  ret
```

assistant: ```c
long getMaxRange(char *str, long currentInt, long length) {
  if (length == 1) {
    return 1;
  }
  long i;
  long minRange = 0;
  char str0 = str[0];
  for (i = 1; i < length; i++) {
    if (str[i] == str0) {
      currentInt++;
      minRange = maxOf(currentInt, minRange);
    } else {
      currentInt = 0;
    }
    str0 = str[i];
  }
  return minRange + 2;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<getMaxRange>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdx,%rax
  cmp    $0x1,%rdx
  je     L28
  mov    %rsi,%r13
  movzbl (%rdi),%ecx
  jle    L1
  lea    0x1(%rdi),%rbx
  lea    (%rdi,%rdx,1),%r12
  mov    $0x0,%esi
  jmp    L43
L47:
  add    $0x1,%r13
  mov    %r13,%rdi
  call   <maxOf@plt>
  mov    %rax,%rsi
L20:
  movzbl 0x0(%rbp),%ecx
  add    $0x1,%rbx
  cmp    %r12,%rbx
  je     L39
L43:
  mov    %rbx,%rbp
  cmp    %cl,(%rbx)
  je     L47
  mov    $0x0,%r13d
  jmp    L20
L1:
  mov    $0x0,%esi
L39:
  lea    0x2(%rsi),%rax
L28:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
long getMaxRange(char *str, long currentInt, long length) {
  if (length == 1) {
    return 1;
  }
  long i;
  long minRange = 0;
  char str0 = str[0];
  for (i = 1; i < length; i++) {
    if (str[i] == str0) {
      currentInt++;
      minRange = maxOf(currentInt, minRange);
    } else {
      currentInt = 0;
    }
    str0 = str[i];
  }
  return minRange + 2;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<getMaxRange>:
  endbr64
  mov    $0x1,%eax
  cmp    $0x1,%rdx
  je     L2
  movzbl (%rdi),%ecx
  jle    L49
  push   %r12
  mov    %rsi,%r12
  xor    %esi,%esi
  push   %rbp
  lea    (%rdi,%rdx,1),%rbp
  push   %rbx
  lea    0x1(%rdi),%rbx
  jmp    L40
  nopw   0x0(%rax,%rax,1)
L25:
  add    $0x1,%rbx
  mov    %edx,%ecx
  xor    %r12d,%r12d
  cmp    %rbp,%rbx
  je     L42
L40:
  movzbl (%rbx),%edx
  cmp    %cl,%dl
  jne    L25
  add    $0x1,%r12
  add    $0x1,%rbx
  mov    %r12,%rdi
  call   <maxOf@plt>
  movzbl -0x1(%rbx),%ecx
  mov    %rax,%rsi
  cmp    %rbp,%rbx
  jne    L40
L42:
  pop    %rbx
  lea    0x2(%rsi),%rax
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L2:
  ret
  nopl   0x0(%rax)
L49:
  mov    $0x2,%eax
  ret
```

assistant: ```c
long getMaxRange(char *str, long currentInt, long length) {
  if (length == 1) {
    return 1;
  }
  long i;
  long minRange = 0;
  char str0 = str[0];
  for (i = 1; i < length; i++) {
    if (str[i] == str0) {
      currentInt++;
      minRange = maxOf(currentInt, minRange);
    } else {
      currentInt = 0;
    }
    str0 = str[i];
  }
  return minRange + 2;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<getMaxRange>:
  endbr64
  mov    $0x1,%eax
  cmp    $0x1,%rdx
  je     L22
  movzbl (%rdi),%ecx
  jle    L42
  push   %r12
  mov    %rsi,%r12
  xor    %esi,%esi
  push   %rbp
  lea    (%rdi,%rdx,1),%rbp
  push   %rbx
  movzbl 0x1(%rdi),%edx
  lea    0x1(%rdi),%rbx
  cmp    %cl,%dl
  je     L8
  nopl   (%rax)
L36:
  add    $0x1,%rbx
  cmp    %rbp,%rbx
  je     L21
  xor    %r12d,%r12d
L32:
  mov    %edx,%ecx
  movzbl (%rbx),%edx
  cmp    %cl,%dl
  jne    L36
L8:
  add    $0x1,%r12
  add    $0x1,%rbx
  mov    %r12,%rdi
  call   <maxOf@plt>
  movzbl -0x1(%rbx),%edx
  mov    %rax,%rsi
  cmp    %rbp,%rbx
  jne    L32
L21:
  pop    %rbx
  lea    0x2(%rsi),%rax
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L22:
  ret
  nopl   0x0(%rax)
L42:
  mov    $0x2,%eax
  ret
```

assistant: ```c
long getMaxRange(char *str, long currentInt, long length) {
  if (length == 1) {
    return 1;
  }
  long i;
  long minRange = 0;
  char str0 = str[0];
  for (i = 1; i < length; i++) {
    if (str[i] == str0) {
      currentInt++;
      minRange = maxOf(currentInt, minRange);
    } else {
      currentInt = 0;
    }
    str0 = str[i];
  }
  return minRange + 2;
}
```
user: Translate the below assembly code into C programming language:

```asm
<si_camera_demux_gen>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,-0x18(%rsp)
  mov    %edx,-0x1c(%rsp)
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  sar    %eax
  test   %r8d,%r8d
  jle    L48
  mov    %rdi,%rbp
  mov    %ecx,%r13d
  mov    %r8d,%r12d
  lea    (%rdx,%rdx,1),%r8d
  lea    -0x1(%r12,%rax,1),%r10d
  imul   %edx,%r10d
  lea    -0x1(%rcx),%ecx
  lea    0x0(,%rcx,4),%r15d
  mov    $0x0,%r11d
  mov    $0x0,%ebx
  movslq %r13d,%rdx
  cltq
  add    %rdx,%rax
  mov    %rax,-0x10(%rsp)
  mov    %ecx,%eax
  mov    %rax,-0x8(%rsp)
  lea    0x2(%rdi),%r14
  jmp    L6
L29:
  movslq %ebx,%rax
  mov    -0x18(%rsp),%rdi
  lea    (%rdi,%rax,2),%rax
  movslq %r8d,%r9
  lea    0x0(%rbp,%r9,2),%rdx
  mov    -0x10(%rsp),%rdi
  lea    (%rdi,%r9,1),%rcx
  lea    0x0(%rbp,%rcx,2),%rcx
  mov    -0x8(%rsp),%rdi
  lea    (%rdi,%r9,1),%rsi
  lea    (%r14,%rsi,2),%rdi
  movslq %r10d,%rsi
  sub    %r9,%rsi
L59:
  movzwl (%rax),%r9d
  mov    %r9w,0x2(%rdx)
  movzwl 0x2(%rax),%r9d
  mov    %r9w,-0x2(%rcx)
  movzwl 0x4(%rax),%r9d
  mov    %r9w,0x2(%rdx,%rsi,2)
  movzwl 0x6(%rax),%r9d
  mov    %r9w,-0x2(%rcx,%rsi,2)
  add    $0x8,%rax
  add    $0x2,%rdx
  sub    $0x2,%rcx
  cmp    %rdi,%rdx
  jne    L59
  lea    0x4(%r15,%rbx,1),%ebx
L47:
  add    $0x1,%r11d
  mov    -0x1c(%rsp),%eax
  add    %eax,%r8d
  sub    %eax,%r10d
  cmp    %r11d,%r12d
  je     L48
L6:
  test   %r13d,%r13d
  jg     L29
  jmp    L47
L48:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void si_camera_demux_gen(unsigned short *out, unsigned short *in, int size, int serlen, int parlen) {
  int so2, tot, row, col, irow, icol;
  so2 = size / 2;
  tot = size * size;
  row = 0;
  col = 0;
  tot = 0;
  for (row = 0; row < parlen; row++) {
    for (col = 0; col < serlen; col++) {
      out[(row + 2) * size + (col + 1)] = in[tot];
      icol = (serlen - (col + 1)) + so2;
      irow = (parlen - (row + 1)) + so2;
      out[(row + 2) * size + icol] = in[tot + 1];
      out[irow * size + col + 1] = in[tot + 2];
      out[irow * size + icol] = in[tot + 3];
      tot += 4;
    }
  }
}
```