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

```asm
<rtrim>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  sub    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L13
L16:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  subl   $0x1,-0x4(%rbp)
L13:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L16
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L16
  mov    -0x18(%rbp),%rax
  leave
  ret
```

assistant: ```c
char *rtrim(char a[1024]) {
  int i = strlen(a) - 1;
  for (i; a[i] == ' ' || a[i] == '\t'; i--) {
    a[i] = '\0';
  }
  return a;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<rtrim>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  sub    $0x1,%eax
  cltq
  lea    (%rbx,%rax,1),%rcx
  movzbl (%rcx),%edx
  cmp    $0x20,%dl
  je     L5
  cmp    $0x9,%dl
  jne    L15
L5:
  lea    -0x1(%rbx,%rax,1),%rax
L8:
  movb   $0x0,(%rcx)
  mov    %rax,%rcx
  movzbl (%rax),%edx
  sub    $0x1,%rax
  cmp    $0x20,%dl
  je     L8
  cmp    $0x9,%dl
  je     L8
L15:
  mov    %rbx,%rax
  pop    %rbx
  ret
```

assistant: ```c
char *rtrim(char a[1024]) {
  int i = strlen(a) - 1;
  for (i; a[i] == ' ' || a[i] == '\t'; i--) {
    a[i] = '\0';
  }
  return a;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<rtrim>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  call   <strlen@plt>
  sub    $0x1,%eax
  cltq
  lea    (%r12,%rax,1),%rcx
  movzbl (%rcx),%edx
  cmp    $0x20,%dl
  je     L22
  cmp    $0x9,%dl
  jne    L13
L22:
  lea    -0x1(%r12,%rax,1),%rax
  nopl   0x0(%rax)
L32:
  movb   $0x0,(%rcx)
  movzbl (%rax),%edx
  mov    %rax,%rcx
  sub    $0x1,%rax
  cmp    $0x20,%dl
  je     L32
  cmp    $0x9,%dl
  je     L32
L13:
  mov    %r12,%rax
  pop    %r12
  ret
```

assistant: ```c
char *rtrim(char a[1024]) {
  int i = strlen(a) - 1;
  for (i; a[i] == ' ' || a[i] == '\t'; i--) {
    a[i] = '\0';
  }
  return a;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<rtrim>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  call   <strlen@plt>
  sub    $0x1,%eax
  cltq
  lea    (%r12,%rax,1),%rcx
  movzbl (%rcx),%edx
  cmp    $0x20,%dl
  je     L31
  cmp    $0x9,%dl
  jne    L6
L31:
  lea    -0x1(%r12,%rax,1),%rax
  nopl   0x0(%rax)
L39:
  movb   $0x0,(%rcx)
  movzbl (%rax),%edx
  mov    %rax,%rcx
  sub    $0x1,%rax
  cmp    $0x20,%dl
  je     L39
  cmp    $0x9,%dl
  je     L39
L6:
  mov    %r12,%rax
  pop    %r12
  ret
```

assistant: ```c
char *rtrim(char a[1024]) {
  int i = strlen(a) - 1;
  for (i; a[i] == ' ' || a[i] == '\t'; i--) {
    a[i] = '\0';
  }
  return a;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<my_stristr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  jmp    L51
L37:
  addq   $0x1,-0x18(%rbp)
L3:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L13
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %rax,%rbx
  mov    -0x40(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <toupper@plt>
  cmp    %rax,%rbx
  jne    L37
L13:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L98
  mov    $0x0,%eax
  jmp    L21
L98:
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  jmp    L89
L59:
  addq   $0x1,-0x20(%rbp)
  addq   $0x1,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L89
  mov    -0x18(%rbp),%rax
  jmp    L21
L89:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %rax,%rbx
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <toupper@plt>
  cmp    %rax,%rbx
  je     L59
  addq   $0x1,-0x18(%rbp)
L51:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L3
  mov    $0x0,%eax
L21:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
char *my_stristr(const char *string, const char *pattern) {
  const char *pptr, *sptr;
  char *start;
  for (start = (char *)string; *start != 0; start++) {
    for (; ((*start != 0) && (toupper((unsigned char)*start) != toupper((unsigned char)*pattern))); start++)
      ;
    if (*start == 0)
      return NULL;
    pptr = (const char *)pattern;
    sptr = (const char *)start;
    while (toupper((unsigned char)*sptr) == toupper((unsigned char)*pptr)) {
      sptr++;
      pptr++;
      if (*pptr == 0)
        return (start);
    }
  }
  return NULL;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<my_stristr>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%r12
  movzbl (%rdi),%edi
  add    $0x1,%rbp
  mov    $0x0,%r13d
  test   %dil,%dil
  jne    L56
  jmp    L80
L100:
  mov    %rbp,%r15
  cmpb   $0x0,-0x1(%rbp)
  je     L40
  mov    $0x0,%ebx
L106:
  movzbl 0x0(%r13,%rbx,1),%edi
  call   <toupper@plt>
  mov    %rax,%r14
  movzbl (%r12,%rbx,1),%edi
  call   <toupper@plt>
  cmp    %rax,%r14
  jne    L67
  add    $0x1,%rbx
  cmpb   $0x0,(%r12,%rbx,1)
  jne    L106
L80:
  mov    %r13,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L67:
  movzbl (%r15),%edi
  test   %dil,%dil
  je     L15
L99:
  add    $0x1,%rbp
L56:
  lea    -0x1(%rbp),%r13
  movzbl %dil,%edi
  call   <toupper@plt>
  mov    %rax,%rbx
  movzbl (%r12),%edi
  call   <toupper@plt>
  cmp    %rax,%rbx
  je     L100
  movzbl 0x0(%rbp),%edi
  test   %dil,%dil
  jne    L99
  mov    $0x0,%r13d
  jmp    L80
L15:
  mov    $0x0,%r13d
  jmp    L80
L40:
  mov    $0x0,%r13d
  jmp    L80
```

assistant: ```c
char *my_stristr(const char *string, const char *pattern) {
  const char *pptr, *sptr;
  char *start;
  for (start = (char *)string; *start != 0; start++) {
    for (; ((*start != 0) && (toupper((unsigned char)*start) != toupper((unsigned char)*pattern))); start++)
      ;
    if (*start == 0)
      return NULL;
    pptr = (const char *)pattern;
    sptr = (const char *)start;
    while (toupper((unsigned char)*sptr) == toupper((unsigned char)*pptr)) {
      sptr++;
      pptr++;
      if (*pptr == 0)
        return (start);
    }
  }
  return NULL;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<my_stristr>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  movzbl (%rdi),%edi
  test   %dil,%dil
  je     L48
  mov    %rsi,%r12
  add    $0x1,%rbp
  jmp    L21
L42:
  movzbl 0x0(%rbp),%edi
  test   %dil,%dil
  je     L48
  add    $0x1,%rbp
L21:
  call   <toupper@plt>
  movzbl (%r12),%edi
  lea    -0x1(%rbp),%r13
  mov    %rax,%rbx
  call   <toupper@plt>
  cmp    %rax,%rbx
  jne    L42
  movzbl -0x1(%rbp),%edi
  test   %dil,%dil
  je     L48
  xor    %ebx,%ebx
  jmp    L75
  nopl   (%rax)
L13:
  movzbl 0x0(%r13,%rbx,1),%edi
L75:
  call   <toupper@plt>
  movzbl (%r12,%rbx,1),%edi
  mov    %rax,%r14
  call   <toupper@plt>
  cmp    %rax,%r14
  jne    L42
  add    $0x1,%rbx
  cmpb   $0x0,(%r12,%rbx,1)
  jne    L13
  pop    %rbx
  mov    %r13,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L48:
  xor    %r13d,%r13d
  pop    %rbx
  pop    %rbp
  mov    %r13,%rax
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
char *my_stristr(const char *string, const char *pattern) {
  const char *pptr, *sptr;
  char *start;
  for (start = (char *)string; *start != 0; start++) {
    for (; ((*start != 0) && (toupper((unsigned char)*start) != toupper((unsigned char)*pattern))); start++)
      ;
    if (*start == 0)
      return NULL;
    pptr = (const char *)pattern;
    sptr = (const char *)start;
    while (toupper((unsigned char)*sptr) == toupper((unsigned char)*pptr)) {
      sptr++;
      pptr++;
      if (*pptr == 0)
        return (start);
    }
  }
  return NULL;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<my_stristr>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  movzbl (%rdi),%edi
  test   %dil,%dil
  je     L26
  mov    %rsi,%r12
  add    $0x1,%rbp
  jmp    L24
L41:
  movzbl 0x0(%rbp),%edi
  test   %dil,%dil
  je     L26
  add    $0x1,%rbp
L24:
  call   <toupper@plt>
  movzbl (%r12),%edi
  lea    -0x1(%rbp),%r13
  mov    %rax,%rbx
  call   <toupper@plt>
  cmp    %rax,%rbx
  jne    L41
  cmpb   $0x0,-0x1(%rbp)
  je     L26
  xor    %ebx,%ebx
L31:
  movzbl 0x0(%r13,%rbx,1),%edi
  call   <toupper@plt>
  movzbl (%r12,%rbx,1),%edi
  mov    %rax,%r14
  call   <toupper@plt>
  cmp    %rax,%r14
  jne    L41
  add    $0x1,%rbx
  cmpb   $0x0,(%r12,%rbx,1)
  jne    L31
  pop    %rbx
  mov    %r13,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L26:
  xor    %r13d,%r13d
  pop    %rbx
  pop    %rbp
  mov    %r13,%rax
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
char *my_stristr(const char *string, const char *pattern) {
  const char *pptr, *sptr;
  char *start;
  for (start = (char *)string; *start != 0; start++) {
    for (; ((*start != 0) && (toupper((unsigned char)*start) != toupper((unsigned char)*pattern))); start++)
      ;
    if (*start == 0)
      return NULL;
    pptr = (const char *)pattern;
    sptr = (const char *)start;
    while (toupper((unsigned char)*sptr) == toupper((unsigned char)*pptr)) {
      sptr++;
      pptr++;
      if (*pptr == 0)
        return (start);
    }
  }
  return NULL;
}
```
user: What is the c source code of the assembly code below?

```asm
<isfile>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  lea    D9(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L15
  mov    $0x0,%eax
  jmp    L13
L15:
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    $0x1,%eax
L13:
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D9
type_infered: string

tool: D9: r

assistant: ```c
int isfile(const char *filename) {
  FILE *stream;
  stream = fopen(filename, "r");
  if (stream == NULL) {
    return (0);
  }
  fclose(stream);
  return (1);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<isfile>:
  endbr64
  sub    $0x8,%rsp
  lea    D5(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,%rdi
  mov    $0x0,%eax
  test   %rdi,%rdi
  je     L4
  call   <fclose@plt>
  mov    $0x1,%eax
L4:
  add    $0x8,%rsp
  ret
```

tool_calls: name: read_data
arguments: data_label: D5
type_infered: string

tool: D5: r

assistant: ```c
int isfile(const char *filename) {
  FILE *stream;
  stream = fopen(filename, "r");
  if (stream == NULL) {
    return (0);
  }
  fclose(stream);
  return (1);
}
```
user: Translate the below assembly code into C programming language:

```asm
<isfile>:
  endbr64
  sub    $0x8,%rsp
  lea    D5(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,%rdi
  xor    %eax,%eax
  test   %rdi,%rdi
  je     L5
  call   <fclose@plt>
  mov    $0x1,%eax
L5:
  add    $0x8,%rsp
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D5
type: string

tool: D5: r

assistant: ```c
int isfile(const char *filename) {
  FILE *stream;
  stream = fopen(filename, "r");
  if (stream == NULL) {
    return (0);
  }
  fclose(stream);
  return (1);
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<isfile>:
  endbr64
  sub    $0x8,%rsp
  lea    D0(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,%rdi
  xor    %eax,%eax
  test   %rdi,%rdi
  je     L9
  call   <fclose@plt>
  mov    $0x1,%eax
L9:
  add    $0x8,%rsp
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D0
datatype: string

tool: D0: r

assistant: ```c
int isfile(const char *filename) {
  FILE *stream;
  stream = fopen(filename, "r");
  if (stream == NULL) {
    return (0);
  }
  fclose(stream);
  return (1);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<gauss_eliminate>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %esi,%ebp
  mov    $0x8,%esi
  mov    %ebp,%edi
  call   <calloc@plt>
  mov    %rax,%r10
  test   %ebp,%ebp
  jle    L47
  mov    %rbx,%r12
  mov    %ebp,%r11d
  lea    0x1(%rbp),%r8d
  shl    $0x3,%r8
  mov    $0x0,%r9d
  jmp    L23
L93:
  add    $0x1,%rdx
  cmp    %r11,%rdx
  je     L130
L32:
  cmp    %r9d,%edx
  jle    L93
  mov    %r12,%rdi
  mov    (%rbx,%rdx,8),%rcx
  mov    (%r12),%rax
  movsd  (%rcx,%r13,1),%xmm2
  divsd  (%rax,%r13,1),%xmm2
  mov    $0x0,%eax
L25:
  mov    %rax,%rcx
  add    (%rbx,%rdx,8),%rcx
  mov    (%rdi),%rsi
  movapd %xmm2,%xmm1
  mulsd  (%rsi,%rax,1),%xmm1
  movsd  (%rcx),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rcx)
  add    $0x8,%rax
  cmp    %r8,%rax
  jne    L25
  jmp    L93
L130:
  add    $0x1,%r9
  add    $0x8,%r12
  cmp    %r11,%r9
  je     L47
L23:
  lea    0x0(,%r9,8),%r13
  mov    $0x0,%edx
  jmp    L32
L47:
  movslq %ebp,%rdx
  lea    0x0(,%rdx,8),%rsi
  mov    -0x8(%rbx,%rsi,1),%rax
  movsd  (%rax,%rdx,8),%xmm0
  divsd  -0x8(%rax,%rsi,1),%xmm0
  movsd  %xmm0,-0x8(%r10,%rsi,1)
  mov    %ebp,%edx
  sub    $0x2,%edx
  js     L78
  movslq %edx,%rdx
  jmp    L62
L136:
  mov    (%rbx,%rdx,8),%rcx
  mov    %rdx,%rax
  pxor   %xmm1,%xmm1
L112:
  movsd  (%rcx,%rax,8),%xmm0
  mulsd  (%r10,%rax,8),%xmm0
  addsd  %xmm0,%xmm1
  add    $0x1,%rax
  cmp    %eax,%ebp
  jg     L112
L37:
  mov    (%rbx,%rdx,8),%rax
  movsd  (%rax,%rsi,1),%xmm0
  subsd  %xmm1,%xmm0
  divsd  (%rax,%rdx,8),%xmm0
  movsd  %xmm0,(%r10,%rdx,8)
  sub    $0x1,%rdx
  test   %edx,%edx
  js     L78
L62:
  pxor   %xmm1,%xmm1
  cmp    %edx,%ebp
  jg     L136
  jmp    L37
L78:
  mov    %r10,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
double *gauss_eliminate(double **aug, int n) {
  int i, j, k;
  double c, sum = 0.0;
  double *res = calloc(n, sizeof(double));
  for (j = 0; j < n; j++) {
    for (i = 0; i < n; i++) {
      if (i > j) {
        c = aug[i][j] / aug[j][j];
        for (k = 0; k < n + 1; k++)
          aug[i][k] = aug[i][k] - c * aug[j][k];
      }
    }
  }
  res[n - 1] = aug[n - 1][n] / aug[n - 1][n - 1];
  for (i = n - 2; i >= 0; i--) {
    sum = 0;
    for (j = i; j < n; j++)
      sum = sum + aug[i][j] * res[j];
    res[i] = (aug[i][n] - sum) / aug[i][i];
  }
  return res;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<gauss_eliminate>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %esi,%ebx
  mov    $0x8,%esi
  mov    %ebx,%edi
  sub    $0x8,%rsp
  call   <calloc@plt>
  movslq %ebx,%r10
  xor    %r8d,%r8d
  mov    %rax,%r9
  lea    0x8(,%r10,8),%rdi
  test   %ebx,%ebx
  jle    L107
L4:
  lea    0x0(,%r8,8),%r11
  mov    $0x1,%ecx
  jmp    L104
  nop
L68:
  add    $0x1,%rcx
L104:
  cmp    %rcx,%r10
  je     L33
  cmp    %ecx,%r8d
  jge    L68
  mov    0x0(%rbp,%rcx,8),%rdx
  mov    0x0(%rbp,%r8,8),%rsi
  xor    %eax,%eax
  movsd  (%rdx,%r11,1),%xmm2
  divsd  (%rsi,%r11,1),%xmm2
  cs nopw 0x0(%rax,%rax,1)
L31:
  movsd  (%rsi,%rax,1),%xmm1
  movsd  (%rdx,%rax,1),%xmm0
  mulsd  %xmm2,%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rdx,%rax,1)
  add    $0x8,%rax
  cmp    %rax,%rdi
  jne    L31
  jmp    L68
  nopw   0x0(%rax,%rax,1)
L33:
  add    $0x1,%r8
  cmp    %r10,%r8
  jne    L4
L107:
  lea    0x0(,%r10,8),%rdi
  mov    %ebx,%ecx
  mov    -0x8(%rbp,%rdi,1),%rax
  movsd  (%rax,%r10,8),%xmm0
  divsd  -0x8(%rax,%rdi,1),%xmm0
  movsd  %xmm0,-0x8(%r9,%rdi,1)
  sub    $0x2,%ecx
  js     L0
  movslq %ecx,%rcx
  pxor   %xmm2,%xmm2
  nop
L84:
  mov    0x0(%rbp,%rcx,8),%rdx
  lea    0x0(,%rcx,8),%rsi
  mov    %rcx,%rax
  movapd %xmm2,%xmm1
  cmp    %ecx,%ebx
  jle    L5
  nopl   0x0(%rax,%rax,1)
L69:
  movsd  (%rdx,%rax,8),%xmm0
  mulsd  (%r9,%rax,8),%xmm0
  add    $0x1,%rax
  addsd  %xmm0,%xmm1
  cmp    %eax,%ebx
  jg     L69
L5:
  movsd  (%rdx,%rdi,1),%xmm0
  subsd  %xmm1,%xmm0
  divsd  (%rdx,%rsi,1),%xmm0
  movsd  %xmm0,(%r9,%rcx,8)
  sub    $0x1,%rcx
  test   %ecx,%ecx
  jns    L84
L0:
  add    $0x8,%rsp
  mov    %r9,%rax
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
double *gauss_eliminate(double **aug, int n) {
  int i, j, k;
  double c, sum = 0.0;
  double *res = calloc(n, sizeof(double));
  for (j = 0; j < n; j++) {
    for (i = 0; i < n; i++) {
      if (i > j) {
        c = aug[i][j] / aug[j][j];
        for (k = 0; k < n + 1; k++)
          aug[i][k] = aug[i][k] - c * aug[j][k];
      }
    }
  }
  res[n - 1] = aug[n - 1][n] / aug[n - 1][n - 1];
  for (i = n - 2; i >= 0; i--) {
    sum = 0;
    for (j = i; j < n; j++)
      sum = sum + aug[i][j] * res[j];
    res[i] = (aug[i][n] - sum) / aug[i][i];
  }
  return res;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<deflate_put_pixel>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%ebx
  mov    %esi,%edi
  mov    %rdx,%r9
  mov    %rcx,%r10
  movzwl %r8w,%eax
  shr    $0x10,%r8
  movzwl %r8w,%ecx
  movzbl %sil,%esi
  add    %rax,%rsi
  add    %rsi,%rcx
  movabs $0xf00e10d2fc5cd,%r8
  mov    %rcx,%rax
  mul    %r8
  mov    %rcx,%rax
  sub    %rdx,%rax
  shr    %rax
  add    %rax,%rdx
  shr    $0xf,%rdx
  imul   $0xfff1,%rdx,%rdx
  sub    %rdx,%rcx
  shl    $0x10,%rcx
  mov    %rsi,%rax
  mul    %r8
  mov    %rsi,%rax
  sub    %rdx,%rax
  shr    %rax
  add    %rax,%rdx
  shr    $0xf,%rdx
  imul   $0xfff1,%rdx,%rdx
  sub    %rdx,%rsi
  or     %rsi,%rcx
  test   %ebx,%ebx
  jne    L39
  mov    %rcx,%rbp
  movzbl %dil,%r12d
  cmp    D8(%rip),%r12d
  je     L79
L50:
  mov    D54(%rip),%edi
  cmp    $0x2,%edi
  ja     L47
  test   %edi,%edi
  je     L75
L63:
  mov    D8(%rip),%edi
  call   <deflate_put_literal@plt>
  add    $0x1,%ebx
  cmp    %ebx,D15(%rip)
  ja     L63
L75:
  mov    %r12d,D15(%rip)
  mov    %r12d,%edi
  call   <deflate_put_literal@plt>
  mov    $0x0,%eax
L73:
  mov    %eax,D15(%rip)
  mov    %rbp,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L39:
  movzbl %dil,%edi
  call   <deflate_put_literal@plt>
  movl   $0x100,D15(%rip)
  mov    $0x0,%eax
  mov    $0x1,%ebp
  jmp    L73
L79:
  mov    D15(%rip),%eax
  cmp    $0x100,%eax
  ja     L50
  sub    $0x1,%r10
  add    $0x1,%eax
  cmp    %r9,%r10
  jne    L73
  jmp    L50
L47:
  call   <deflate_put_length@plt>
  mov    $0x0,%esi
  mov    $0x5,%edi
  call   <deflate_put_bits@plt>
  jmp    L75
```

assistant: ```c
unsigned long deflate_put_pixel(int flush, unsigned char lit, unsigned long x, unsigned long w, unsigned long adler_crc) {
  int i;
  unsigned long s1;
  unsigned long s2;
  static unsigned int color;
  static unsigned int length;
  s1 = adler_crc & 0xffff;
  s2 = (adler_crc >> 16) & 0xffff;
  s1 += lit;
  s2 += s1;
  s1 %= 65521L;
  s2 %= 65521L;
  adler_crc = (s2 << 16) | s1;
  if (flush) {
    deflate_put_literal(lit);
    color = 256;
    length = 0;
    return 1;
  }
  if (lit != color || length > 256 || x == (w - 1)) {
    if (length > 2) {
      deflate_put_length(length);
      deflate_put_bits(5, 0);
    } else {
      for (i = 0; i < length; i++)
        deflate_put_literal(color);
    }
    color = lit;
    deflate_put_literal(color);
    length = 0;
  } else {
    length++;
  }
  return adler_crc;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<deflate_put_pixel>:
  endbr64
  movzwl %r8w,%eax
  push   %r12
  shr    $0x10,%r8
  mov    %rcx,%r10
  push   %rbp
  movzwl %r8w,%ecx
  mov    %rdx,%r9
  movabs $0xf00e10d2fc5cd,%r8
  push   %rbx
  mov    %edi,%ebx
  mov    %esi,%edi
  movzbl %sil,%esi
  add    %rax,%rsi
  movzbl %dil,%ebp
  add    %rsi,%rcx
  mov    %rcx,%rax
  mul    %r8
  mov    %rcx,%rax
  sub    %rdx,%rax
  shr    %rax
  add    %rax,%rdx
  mov    %rsi,%rax
  shr    $0xf,%rdx
  imul   $0xfff1,%rdx,%rdx
  sub    %rdx,%rcx
  mul    %r8
  mov    %rsi,%rax
  shl    $0x10,%rcx
  sub    %rdx,%rax
  shr    %rax
  add    %rax,%rdx
  shr    $0xf,%rdx
  imul   $0xfff1,%rdx,%rdx
  sub    %rdx,%rsi
  or     %rsi,%rcx
  test   %ebx,%ebx
  jne    L9
  mov    D48(%rip),%edi
  mov    D38(%rip),%r8d
  mov    %rcx,%r12
  cmp    %ebp,%edi
  je     L97
L13:
  cmp    $0x2,%r8d
  ja     L86
  test   %r8d,%r8d
  jne    L4
  jmp    L28
  nopw   0x0(%rax,%rax,1)
L69:
  mov    D48(%rip),%edi
L4:
  call   <deflate_put_literal@plt>
  add    $0x1,%ebx
  cmp    %ebx,D47(%rip)
  ja     L69
L28:
  mov    %ebp,%edi
  mov    %ebp,D47(%rip)
  call   <deflate_put_literal@plt>
  xor    %eax,%eax
L32:
  pop    %rbx
  pop    %rbp
  mov    %eax,D47(%rip)
  mov    %r12,%rax
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L97:
  cmp    $0x100,%r8d
  jbe    L53
L86:
  mov    %r8d,%edi
  call   <deflate_put_length@plt>
  xor    %esi,%esi
  mov    $0x5,%edi
  call   <deflate_put_bits@plt>
  jmp    L28
  nop
L9:
  mov    %ebp,%edi
  mov    $0x1,%r12d
  call   <deflate_put_literal@plt>
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  mov    %eax,D47(%rip)
  mov    %r12,%rax
  pop    %r12
  movl   $0x100,D47(%rip)
  ret
  nopw   0x0(%rax,%rax,1)
L53:
  sub    $0x1,%r10
  lea    0x1(%r8),%eax
  cmp    %r9,%r10
  jne    L32
  jmp    L13
```

assistant: ```c
unsigned long deflate_put_pixel(int flush, unsigned char lit, unsigned long x, unsigned long w, unsigned long adler_crc) {
  int i;
  unsigned long s1;
  unsigned long s2;
  static unsigned int color;
  static unsigned int length;
  s1 = adler_crc & 0xffff;
  s2 = (adler_crc >> 16) & 0xffff;
  s1 += lit;
  s2 += s1;
  s1 %= 65521L;
  s2 %= 65521L;
  adler_crc = (s2 << 16) | s1;
  if (flush) {
    deflate_put_literal(lit);
    color = 256;
    length = 0;
    return 1;
  }
  if (lit != color || length > 256 || x == (w - 1)) {
    if (length > 2) {
      deflate_put_length(length);
      deflate_put_bits(5, 0);
    } else {
      for (i = 0; i < length; i++)
        deflate_put_literal(color);
    }
    color = lit;
    deflate_put_literal(color);
    length = 0;
  } else {
    length++;
  }
  return adler_crc;
}
```