ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 这段汇编代码用C语言表示是什么样的:

```asm
<sigsetmask>:
  endbr64
  push   %rbp
  push   %rbx
  mov    %edi,%ebx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  mov    %rbp,%rdi
  call   <__sigemptyset@plt>
  test   %rax,%rax
  js     L29
  mov    D8(%rip),%rax
  lea    0x4(%rsp),%rdx
  mov    %rbp,%rsi
  mov    %ebx,(%rsp)
  mov    (%rax),%edi
  call   <sigprocmask@plt>
  test   %rax,%rax
  js     L29
  mov    0x4(%rsp),%eax
L11:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L39
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   (%rax)
L29:
  mov    $0xffffffff,%eax
  jmp    L11
L39:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int sigsetmask(int mask) {
  register unsigned int sig;
  sigset_t set, oset;
  if (__sigemptyset(&set) < 0)
    return -1;
  if (sizeof(mask) == sizeof(set))
    *(int *)&set = mask;
  else if (sizeof(unsigned long int) == sizeof(set))
    *(unsigned long int *)&set = (unsigned int)mask;
  else
    for (sig = 1; sig < NSIG && sig <= sizeof(mask) * 8; ++sig)
      if ((mask & sigmask(sig)) && __sigaddset(&set, sig) < 0)
        return -1;
  if (sigprocmask(SIG_SETMASK, &set, &oset) < 0)
    return -1;
  if (sizeof(mask) == sizeof(oset))
    mask = *(int *)&oset;
  else if (sizeof(unsigned long int) == sizeof(oset))
    mask = *(unsigned long int *)&oset;
  else
    for (sig = 1, mask = 0; sig < NSIG && sig <= sizeof(mask) * 8; ++sig)
      if (__sigismember(&oset, sig))
        mask |= sigmask(sig);
  return mask;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<reverse_array>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  movq   $0x0,-0x8(%rbp)
  jmp    L6
L0:
  mov    -0x20(%rbp),%rax
  sub    -0x8(%rbp),%rax
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x8(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x20(%rbp),%rax
  sub    -0x8(%rbp),%rax
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    (%rcx),%eax
  mov    %eax,(%rdx)
  mov    -0x8(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0xc(%rbp),%eax
  mov    %eax,(%rdx)
  addq   $0x1,-0x8(%rbp)
L6:
  mov    -0x20(%rbp),%rax
  shr    %rax
  cmp    %rax,-0x8(%rbp)
  jb     L0
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void reverse_array(Window *array, size_t n) {
  size_t i;
  for (i = 0; i < n / 2; i++) {
    Window tmp = array[n - i - 1];
    array[n - i - 1] = array[i];
    array[i] = tmp;
  }
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<reverse_array>:
  endbr64
  mov    %rsi,%r8
  shr    %r8
  cmp    $0x1,%rsi
  jbe    L19
  lea    -0x4(%rdi,%rsi,4),%rdx
  mov    $0x0,%eax
L17:
  mov    (%rdx),%ecx
  mov    (%rdi,%rax,4),%esi
  mov    %esi,(%rdx)
  mov    %ecx,(%rdi,%rax,4)
  add    $0x1,%rax
  sub    $0x4,%rdx
  cmp    %r8,%rax
  jb     L17
L19:
  ret
```

assistant: ```c
void reverse_array(Window *array, size_t n) {
  size_t i;
  for (i = 0; i < n / 2; i++) {
    Window tmp = array[n - i - 1];
    array[n - i - 1] = array[i];
    array[i] = tmp;
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<reverse_array>:
  endbr64
  mov    %rsi,%rdx
  shr    %rdx
  je     L6
  lea    -0x4(%rdi,%rsi,4),%rax
  lea    (%rdi,%rdx,4),%rsi
  nopl   (%rax)
L2:
  mov    (%rax),%edx
  mov    (%rdi),%ecx
  add    $0x4,%rdi
  sub    $0x4,%rax
  mov    %ecx,0x4(%rax)
  mov    %edx,-0x4(%rdi)
  cmp    %rsi,%rdi
  jne    L2
L6:
  ret
```

assistant: ```c
void reverse_array(Window *array, size_t n) {
  size_t i;
  for (i = 0; i < n / 2; i++) {
    Window tmp = array[n - i - 1];
    array[n - i - 1] = array[i];
    array[i] = tmp;
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<reverse_array>:
  endbr64
  mov    %rdi,%rax
  mov    %rsi,%rdi
  mov    %rsi,%rcx
  shr    %rdi
  je     L70
  lea    0x0(,%rsi,4),%r9
  lea    0x0(,%rdi,4),%rsi
  mov    %r9,%rdx
  sub    %rsi,%rdx
  cmp    %rsi,%rdx
  setge  %dl
  test   %r9,%r9
  setle  %r8b
  or     %r8b,%dl
  je     L93
  cmp    $0x1,%rdi
  je     L93
  lea    -0x1(%rdi),%rdx
  cmp    $0x2,%rdx
  jbe    L30
  mov    %rcx,%r10
  lea    -0x10(%rax,%r9,1),%rdx
  mov    %rax,%rsi
  shr    $0x3,%r10
  mov    %rdx,%r8
  mov    %r10,%r11
  shl    $0x4,%r11
  sub    %r11,%r8
  cs nopw 0x0(%rax,%rax,1)
L31:
  movdqu (%rsi),%xmm2
  movdqu (%rdx),%xmm0
  sub    $0x10,%rdx
  add    $0x10,%rsi
  pshufd $0x1b,%xmm2,%xmm1
  pshufd $0x1b,%xmm0,%xmm0
  movups %xmm1,0x10(%rdx)
  movups %xmm0,-0x10(%rsi)
  cmp    %rdx,%r8
  jne    L31
  lea    0x0(,%r10,4),%rdx
  cmp    %rdx,%rdi
  je     L70
  sub    %rdx,%rdi
  cmp    $0x1,%rdi
  je     L42
L2:
  mov    %rdx,%r8
  neg    %r8
  shl    $0x2,%r8
  lea    -0x8(%r9,%r8,1),%rsi
  mov    %rax,%r9
  sub    %r8,%r9
  add    %rax,%rsi
  movq   (%r9),%xmm1
  movq   (%rsi),%xmm0
  pshufd $0xe1,%xmm1,%xmm1
  pshufd $0xe1,%xmm0,%xmm0
  movq   %xmm1,(%rsi)
  mov    %rdi,%rsi
  and    $0xfffffffffffffffe,%rsi
  movq   %xmm0,(%r9)
  add    %rsi,%rdx
  cmp    %rdi,%rsi
  je     L70
L42:
  sub    %rdx,%rcx
  lea    -0x4(%rax,%rcx,4),%rcx
  lea    (%rax,%rdx,4),%rax
  mov    (%rcx),%esi
  mov    (%rax),%edx
  mov    %edx,(%rcx)
  mov    %esi,(%rax)
  ret
  nopl   0x0(%rax)
L93:
  lea    -0x4(%rax,%r9,1),%rdx
  add    %rax,%rsi
  nopl   0x0(%rax,%rax,1)
L23:
  mov    (%rdx),%ecx
  mov    (%rax),%edi
  add    $0x4,%rax
  sub    $0x4,%rdx
  mov    %edi,0x4(%rdx)
  mov    %ecx,-0x4(%rax)
  cmp    %rsi,%rax
  jne    L23
L70:
  ret
L30:
  xor    %edx,%edx
  jmp    L2
```

assistant: ```c
void reverse_array(Window *array, size_t n) {
  size_t i;
  for (i = 0; i < n / 2; i++) {
    Window tmp = array[n - i - 1];
    array[n - i - 1] = array[i];
    array[i] = tmp;
  }
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<get_name>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x64697547,-0xe(%rbp)
  movw   $0x6f,-0xa(%rbp)
  mov    -0x1c(%rbp),%edx
  lea    -0xe(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L2
  call   <__stack_chk_fail@plt>
L2:
  leave
  ret
```

assistant: ```c
void get_name(char *s, int l) {
  const char name[] = "Guido";
  strncpy(s, name, l);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<get_name>:
  endbr64
  sub    $0x18,%rsp
  mov    %esi,%edx
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  movl   $0x64697547,0x2(%rsp)
  movw   $0x6f,0x6(%rsp)
  lea    0x2(%rsp),%rsi
  call   <strncpy@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L3
  add    $0x18,%rsp
  ret
L3:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void get_name(char *s, int l) {
  const char name[] = "Guido";
  strncpy(s, name, l);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<get_name>:
  endbr64
  sub    $0x18,%rsp
  mov    %esi,%edx
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x2(%rsp),%rsi
  mov    $0x6f,%eax
  movl   $0x64697547,0x2(%rsp)
  mov    %ax,0x6(%rsp)
  call   <strncpy@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L2
  add    $0x18,%rsp
  ret
L2:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void get_name(char *s, int l) {
  const char name[] = "Guido";
  strncpy(s, name, l);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<BitGetSum>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L3
L9:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x1c(%rbp),%eax
  sub    $0x1,%eax
  and    %eax,-0x1c(%rbp)
L3:
  cmpl   $0x0,-0x1c(%rbp)
  jg     L9
  mov    -0x4(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int BitGetSum(const unsigned *bit_array, int i) {
  int sum;
  sum = 0;
  while (i > 0) {
    sum += bit_array[i];
    i -= i & -i;
  }
  return sum;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<BitGetSum>:
  endbr64
  test   %esi,%esi
  jle    L18
  mov    $0x0,%edx
L7:
  movslq %esi,%rax
  add    (%rdi,%rax,4),%edx
  lea    -0x1(%rsi),%eax
  and    %eax,%esi
  jg     L7
L6:
  mov    %edx,%eax
  ret
L18:
  mov    $0x0,%edx
  jmp    L6
```

assistant: ```c
int BitGetSum(const unsigned *bit_array, int i) {
  int sum;
  sum = 0;
  while (i > 0) {
    sum += bit_array[i];
    i -= i & -i;
  }
  return sum;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<BitGetSum>:
  endbr64
  xor    %r8d,%r8d
  test   %esi,%esi
  jle    L17
  nopl   0x0(%rax,%rax,1)
L5:
  movslq %esi,%rax
  add    (%rdi,%rax,4),%r8d
  lea    -0x1(%rsi),%eax
  and    %eax,%esi
  jne    L5
L17:
  mov    %r8d,%eax
  ret
```

assistant: ```c
int BitGetSum(const unsigned *bit_array, int i) {
  int sum;
  sum = 0;
  while (i > 0) {
    sum += bit_array[i];
    i -= i & -i;
  }
  return sum;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<BitGetSum>:
  endbr64
  xor    %r8d,%r8d
  test   %esi,%esi
  jle    L1
  nopl   0x0(%rax,%rax,1)
L6:
  movslq %esi,%rax
  add    (%rdi,%rax,4),%r8d
  lea    -0x1(%rsi),%eax
  and    %eax,%esi
  jne    L6
L1:
  mov    %r8d,%eax
  ret
```

assistant: ```c
int BitGetSum(const unsigned *bit_array, int i) {
  int sum;
  sum = 0;
  while (i > 0) {
    sum += bit_array[i];
    i -= i & -i;
  }
  return sum;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<get_tile>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x20(%rbp)
  movl   $0x0,-0x1c(%rbp)
  movl   $0x0,-0x18(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L11
L26:
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x3a,%al
  jne    L4
  addl   $0x1,-0x20(%rbp)
  mov    -0x1c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x24(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
L4:
  addl   $0x1,-0x24(%rbp)
L11:
  cmpl   $0x4,-0x20(%rbp)
  jle    L26
  mov    -0x1c(%rbp),%eax
  sub    -0x18(%rbp),%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x38(%rbp),%rax
  add    %rax,%rcx
  lea    -0x12(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x1c(%rbp),%eax
  sub    -0x18(%rbp),%eax
  cltq
  movb   $0x0,-0x12(%rbp,%rax,1)
  lea    -0x12(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L28
  call   <__stack_chk_fail@plt>
L28:
  leave
  ret
```

assistant: ```c
int get_tile(char *line1) {
  int i, Dp = 0, i2 = 0, i1 = 0;
  char tile[10];
  for (i = 0; Dp < 5; i++) {
    if (line1[i] == ':') {
      Dp++;
      i1 = i2 + 1;
      i2 = i;
    }
  }
  memcpy(tile, line1 + i1, i2 - i1);
  tile[i2 - i1] = '\0';
  return (atoi(tile));
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<get_tile>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    $0x0,%esi
  mov    $0x0,%ecx
  mov    $0x0,%edx
  jmp    L40
L41:
  add    $0x1,%rax
  cmp    $0x4,%edx
  jg     L16
L40:
  cmpb   $0x3a,(%rdi,%rax,1)
  jne    L41
  add    $0x1,%edx
  lea    0x1(%rcx),%esi
  mov    %eax,%ecx
  jmp    L41
L16:
  mov    %ecx,%ebx
  sub    %esi,%ebx
  movslq %esi,%rsi
  add    %rdi,%rsi
  lea    0xe(%rsp),%rbp
  mov    %ebx,%edx
  mov    %rbp,%rdi
  call   <memcpy@plt>
  movslq %ebx,%rcx
  movb   $0x0,0xe(%rsp,%rcx,1)
  mov    %rbp,%rdi
  call   <atoi@plt>
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L6
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  ret
L6:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int get_tile(char *line1) {
  int i, Dp = 0, i2 = 0, i1 = 0;
  char tile[10];
  for (i = 0; Dp < 5; i++) {
    if (line1[i] == ':') {
      Dp++;
      i1 = i2 + 1;
      i2 = i;
    }
  }
  memcpy(tile, line1 + i1, i2 - i1);
  tile[i2 - i1] = '\0';
  return (atoi(tile));
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<get_tile>:
  endbr64
  push   %rbp
  xor    %esi,%esi
  xor    %ecx,%ecx
  xor    %edx,%edx
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
L12:
  cmpb   $0x3a,(%rdi,%rax,1)
  jne    L6
  lea    0x1(%rcx),%esi
  add    $0x1,%edx
  mov    %eax,%ecx
L6:
  add    $0x1,%rax
  cmp    $0x5,%edx
  jne    L12
  mov    %ecx,%ebx
  lea    0xe(%rsp),%rbp
  sub    %esi,%ebx
  movslq %esi,%rsi
  add    %rdi,%rsi
  mov    %ebx,%edx
  mov    %rbp,%rdi
  call   <memcpy@plt>
  movslq %ebx,%rcx
  mov    %rbp,%rdi
  movb   $0x0,0xe(%rsp,%rcx,1)
  call   <atoi@plt>
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L9
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  ret
L9:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int get_tile(char *line1) {
  int i, Dp = 0, i2 = 0, i1 = 0;
  char tile[10];
  for (i = 0; Dp < 5; i++) {
    if (line1[i] == ':') {
      Dp++;
      i1 = i2 + 1;
      i2 = i;
    }
  }
  memcpy(tile, line1 + i1, i2 - i1);
  tile[i2 - i1] = '\0';
  return (atoi(tile));
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<get_tile>:
  endbr64
  push   %rbp
  xor    %r8d,%r8d
  xor    %ecx,%ecx
  xor    %edx,%edx
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  nopl   0x0(%rax)
L38:
  cmpb   $0x3a,(%rdi,%rax,1)
  mov    %eax,%esi
  je     L30
  add    $0x1,%rax
  cmp    $0x5,%edx
  jne    L38
L1:
  mov    %ecx,%ebx
  lea    0xe(%rsp),%rbp
  sub    %r8d,%ebx
  movslq %r8d,%r8
  lea    (%rdi,%r8,1),%rsi
  mov    %ebx,%edx
  mov    %rbp,%rdi
  call   <memcpy@plt>
  movslq %ebx,%rcx
  mov    %rbp,%rdi
  movb   $0x0,0xe(%rsp,%rcx,1)
  call   <atoi@plt>
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L20
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L30:
  add    $0x1,%edx
  lea    0x1(%rcx),%r8d
  add    $0x1,%rax
  mov    %esi,%ecx
  cmp    $0x5,%edx
  jne    L38
  jmp    L1
L20:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int get_tile(char *line1) {
  int i, Dp = 0, i2 = 0, i1 = 0;
  char tile[10];
  for (i = 0; Dp < 5; i++) {
    if (line1[i] == ':') {
      Dp++;
      i1 = i2 + 1;
      i2 = i;
    }
  }
  memcpy(tile, line1 + i1, i2 - i1);
  tile[i2 - i1] = '\0';
  return (atoi(tile));
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<OS_DI>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    $0x0,%eax
  call   <_getCC_@plt>
  mov    %al,-0x1(%rbp)
  mov    $0x0,%eax
  call   <_sim_@plt>
  movzbl -0x1(%rbp),%eax
  leave
  ret
```

assistant: ```c
char OS_DI(void) {
  char temp;
  temp = _getCC_();
  _sim_();
  return temp;
}
```
user: Translate the below assembly code into C programming language:

```asm
<OS_DI>:
  endbr64
  push   %rbx
  mov    $0x0,%eax
  call   <_getCC_@plt>
  mov    %eax,%ebx
  mov    $0x0,%eax
  call   <_sim_@plt>
  mov    %ebx,%eax
  pop    %rbx
  ret
```

assistant: ```c
char OS_DI(void) {
  char temp;
  temp = _getCC_();
  _sim_();
  return temp;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<OS_DI>:
  endbr64
  push   %r12
  xor    %eax,%eax
  call   <_getCC_@plt>
  mov    %eax,%r12d
  xor    %eax,%eax
  call   <_sim_@plt>
  mov    %r12d,%eax
  pop    %r12
  ret
```

assistant: ```c
char OS_DI(void) {
  char temp;
  temp = _getCC_();
  _sim_();
  return temp;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<OS_DI>:
  endbr64
  push   %r12
  xor    %eax,%eax
  call   <_getCC_@plt>
  mov    %eax,%r12d
  xor    %eax,%eax
  call   <_sim_@plt>
  mov    %r12d,%eax
  pop    %r12
  ret
```

assistant: ```c
char OS_DI(void) {
  char temp;
  temp = _getCC_();
  _sim_();
  return temp;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<mkdir_>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,%rsi
  mov    $0x1,%edi
  call   <calloc@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L49
  movl   $0x0,-0x18(%rbp)
  mov    -0x18(%rbp),%eax
  mov    %eax,%edi
  call   <umask@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x18(%rbp),%eax
  mov    %eax,%edi
  call   <umask@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x30(%rbp),%rdx
  mov    -0x28(%rbp),%rcx
  mov    -0x8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x30(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
  jmp    L36
L2:
  subq   $0x1,-0x10(%rbp)
L36:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L2
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L2
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L2
  addq   $0x1,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x18(%rbp),%edx
  mov    -0x8(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <mkdir@plt>
  mov    %eax,-0x1c(%rbp)
  jmp    L3
L49:
  movl   $0xffffffff,-0x1c(%rbp)
L3:
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edi
  call   <f77_return@plt>
  leave
  ret
```

assistant: ```c
int mkdir_(char *directory, long int dir_len) {
  char *dir;
  char *cp;
  mode_t old_mode;
  mode_t new_mode;
  int stat;
  dir = (char *)calloc(1, dir_len + 1);
  if (dir != (char *)NULL) {
    new_mode = 0000000;
    old_mode = umask(new_mode);
    new_mode = old_mode;
    old_mode = umask(new_mode);
    (void)memcpy((void *)dir, (void *)directory, dir_len);
    cp = (char *)&dir[dir_len];
    while ((*cp == ' ') || (*cp == '\t') || (*cp == '\0')) {
      --cp;
    }
    ++cp;
    *cp = '\0';
    stat = mkdir(dir, new_mode);
  } else {
    stat = -1;
  }
  (void)free((void *)dir);
  return f77_return(stat);
}
```
user: Translate the below assembly code into C programming language:

```asm
<mkdir_>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r12
  mov    %rsi,%rbx
  lea    0x1(%rsi),%rsi
  mov    $0x1,%edi
  call   <calloc@plt>
  mov    %rax,%rbp
  mov    $0xffffffff,%r13d
  test   %rax,%rax
  jne    L17
L4:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r13d,%edi
  call   <f77_return@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L17:
  mov    $0x0,%edi
  call   <umask@plt>
  mov    %eax,%r13d
  mov    %eax,%edi
  call   <umask@plt>
  mov    %rbx,%rdx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <memcpy@plt>
  lea    0x0(%rbp,%rbx,1),%rax
  movzbl (%rax),%edx
  test   $0xdf,%dl
  je     L2
  cmp    $0x9,%dl
  jne    L56
L2:
  sub    $0x1,%rax
  movzbl (%rax),%edx
  test   $0xdf,%dl
  je     L2
  cmp    $0x9,%dl
  je     L2
L56:
  movb   $0x0,0x1(%rax)
  mov    %r13d,%esi
  mov    %rbp,%rdi
  call   <mkdir@plt>
  mov    %eax,%r13d
  jmp    L4
```

assistant: ```c
int mkdir_(char *directory, long int dir_len) {
  char *dir;
  char *cp;
  mode_t old_mode;
  mode_t new_mode;
  int stat;
  dir = (char *)calloc(1, dir_len + 1);
  if (dir != (char *)NULL) {
    new_mode = 0000000;
    old_mode = umask(new_mode);
    new_mode = old_mode;
    old_mode = umask(new_mode);
    (void)memcpy((void *)dir, (void *)directory, dir_len);
    cp = (char *)&dir[dir_len];
    while ((*cp == ' ') || (*cp == '\t') || (*cp == '\0')) {
      --cp;
    }
    ++cp;
    *cp = '\0';
    stat = mkdir(dir, new_mode);
  } else {
    stat = -1;
  }
  (void)free((void *)dir);
  return f77_return(stat);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<mkdir_>:
  endbr64
  push   %r13
  mov    $0xffffffff,%r13d
  push   %r12
  mov    %rdi,%r12
  mov    $0x1,%edi
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  add    $0x1,%rsi
  sub    $0x8,%rsp
  call   <calloc@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  jne    L50
L10:
  mov    %rbp,%rdi
  call   <free@plt>
  add    $0x8,%rsp
  mov    %r13d,%edi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    10c0 <f77_return@plt>
  nopw   0x0(%rax,%rax,1)
L50:
  xor    %edi,%edi
  call   <umask@plt>
  mov    %eax,%edi
  mov    %eax,%r13d
  call   <umask@plt>
  mov    %rbx,%rdx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <memcpy@plt>
  lea    0x0(%rbp,%rbx,1),%rdx
  movzbl (%rdx),%eax
  test   $0xdf,%al
  je     L53
  cmp    $0x9,%al
  jne    L30
  nop
L53:
  movzbl -0x1(%rdx),%ecx
  sub    $0x1,%rdx
  test   $0xdf,%cl
  je     L53
  cmp    $0x9,%cl
  je     L53
L30:
  movb   $0x0,0x1(%rdx)
  mov    %r13d,%esi
  mov    %rbp,%rdi
  call   <mkdir@plt>
  mov    %eax,%r13d
  jmp    L10
```

assistant: ```c
int mkdir_(char *directory, long int dir_len) {
  char *dir;
  char *cp;
  mode_t old_mode;
  mode_t new_mode;
  int stat;
  dir = (char *)calloc(1, dir_len + 1);
  if (dir != (char *)NULL) {
    new_mode = 0000000;
    old_mode = umask(new_mode);
    new_mode = old_mode;
    old_mode = umask(new_mode);
    (void)memcpy((void *)dir, (void *)directory, dir_len);
    cp = (char *)&dir[dir_len];
    while ((*cp == ' ') || (*cp == '\t') || (*cp == '\0')) {
      --cp;
    }
    ++cp;
    *cp = '\0';
    stat = mkdir(dir, new_mode);
  } else {
    stat = -1;
  }
  (void)free((void *)dir);
  return f77_return(stat);
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<mkdir_>:
  endbr64
  push   %r13
  mov    $0xffffffff,%r13d
  push   %r12
  mov    %rdi,%r12
  mov    $0x1,%edi
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  add    $0x1,%rsi
  sub    $0x8,%rsp
  call   <calloc@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  jne    L49
L10:
  mov    %rbp,%rdi
  call   <free@plt>
  add    $0x8,%rsp
  mov    %r13d,%edi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    10c0 <f77_return@plt>
  nopw   0x0(%rax,%rax,1)
L49:
  xor    %edi,%edi
  call   <umask@plt>
  mov    %eax,%edi
  mov    %eax,%r13d
  call   <umask@plt>
  mov    %rbx,%rdx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <memcpy@plt>
  lea    0x0(%rbp,%rbx,1),%rdx
  movzbl (%rdx),%eax
  test   $0xdf,%al
  je     L47
  cmp    $0x9,%al
  jne    L5
  nop
L47:
  movzbl -0x1(%rdx),%ecx
  sub    $0x1,%rdx
  test   $0xdf,%cl
  je     L47
  cmp    $0x9,%cl
  je     L47
L5:
  movb   $0x0,0x1(%rdx)
  mov    %r13d,%esi
  mov    %rbp,%rdi
  call   <mkdir@plt>
  mov    %eax,%r13d
  jmp    L10
```

assistant: ```c
int mkdir_(char *directory, long int dir_len) {
  char *dir;
  char *cp;
  mode_t old_mode;
  mode_t new_mode;
  int stat;
  dir = (char *)calloc(1, dir_len + 1);
  if (dir != (char *)NULL) {
    new_mode = 0000000;
    old_mode = umask(new_mode);
    new_mode = old_mode;
    old_mode = umask(new_mode);
    (void)memcpy((void *)dir, (void *)directory, dir_len);
    cp = (char *)&dir[dir_len];
    while ((*cp == ' ') || (*cp == '\t') || (*cp == '\0')) {
      --cp;
    }
    ++cp;
    *cp = '\0';
    stat = mkdir(dir, new_mode);
  } else {
    stat = -1;
  }
  (void)free((void *)dir);
  return f77_return(stat);
}
```