ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 下面的汇编指令对应的C源代码是什么:

```asm
<parse_multi_set>:
  endbr64
  push   %r14
  push   %r13
  xor    %r13d,%r13d
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    $0x1,%ebx
  test   %rdi,%rdi
  jne    L17
  jmp    L68
  xchg   %ax,%ax
L52:
  lea    -0x1(%r14),%ecx
  mov    %ebx,%eax
  shl    %cl,%eax
  or     %eax,%r13d
L32:
  mov    %rbp,%rdi
  call   <skip_token@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L68
L17:
  cmpb   $0x0,0x0(%rbp)
  je     L68
  mov    %rbp,%rdi
  call   <get_token@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L32
  mov    %rax,%rdi
  call   <lookup_set_token@plt>
  mov    %r12,%rdi
  mov    %eax,%r14d
  call   <free@plt>
  cmp    $0xffffd8f1,%r14d
  je     L35
  test   %r14d,%r14d
  jne    L52
  mov    %rbp,%rdi
  xor    %r13d,%r13d
  call   <skip_token@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  jne    L17
L68:
  pop    %rbx
  mov    %r13d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L35:
  mov    $0xffffd8f1,%r13d
  pop    %rbx
  pop    %rbp
  mov    %r13d,%eax
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
int parse_multi_set(const char *p) {
  char *t;
  int s, val = 0;
  while (p && *p) {
    t = get_token(p);
    if (t) {
      s = lookup_set_token(t);
      free(t);
      if (s == -9999) {
        val = s;
        break;
      }
      if (s)
        val |= 1 << (s - 1);
      else
        val = 0;
    }
    p = skip_token(p);
  }
  return val;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<parse_multi_set>:
  endbr64
  push   %r14
  push   %r13
  xor    %r13d,%r13d
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    $0x1,%ebx
  test   %rdi,%rdi
  jne    L45
  jmp    L53
  xchg   %ax,%ax
L29:
  lea    -0x1(%r14),%ecx
  mov    %ebx,%eax
  shl    %cl,%eax
  or     %eax,%r13d
L76:
  mov    %rbp,%rdi
  call   <skip_token@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L53
L45:
  cmpb   $0x0,0x0(%rbp)
  je     L53
  mov    %rbp,%rdi
  call   <get_token@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L76
  mov    %rax,%rdi
  call   <lookup_set_token@plt>
  mov    %r12,%rdi
  mov    %eax,%r14d
  call   <free@plt>
  cmp    $0xffffd8f1,%r14d
  je     L18
  test   %r14d,%r14d
  jne    L29
  mov    %rbp,%rdi
  xor    %r13d,%r13d
  call   <skip_token@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  jne    L45
L53:
  pop    %rbx
  mov    %r13d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L18:
  mov    $0xffffd8f1,%r13d
  pop    %rbx
  pop    %rbp
  mov    %r13d,%eax
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
int parse_multi_set(const char *p) {
  char *t;
  int s, val = 0;
  while (p && *p) {
    t = get_token(p);
    if (t) {
      s = lookup_set_token(t);
      free(t);
      if (s == -9999) {
        val = s;
        break;
      }
      if (s)
        val |= 1 << (s - 1);
      else
        val = 0;
    }
    p = skip_token(p);
  }
  return val;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<condition>:
  endbr64
  cmp    $0x3,%esi
  jle    L13
  test   %edx,%edx
  js     L6
  movsd  0x8(%rdi),%xmm3
  movslq %esi,%rsi
  shl    $0x3,%rsi
  movsd  -0x10(%rdi,%rsi,1),%xmm2
  movsd  D4(%rip),%xmm0
  mulsd  -0x8(%rdi,%rsi,1),%xmm0
  movapd %xmm2,%xmm1
  mulsd  D89(%rip),%xmm1
  addsd  %xmm1,%xmm0
  movsd  D90(%rip),%xmm1
  mulsd  (%rdi),%xmm1
  movapd %xmm3,%xmm4
  mulsd  D112(%rip),%xmm4
  addsd  %xmm4,%xmm1
  movsd  %xmm1,(%rdi)
  mulsd  D13(%rip),%xmm3
  movsd  %xmm3,0x8(%rdi)
  mulsd  D100(%rip),%xmm2
  movsd  %xmm2,0x10(%rdi)
  movsd  %xmm0,0x18(%rdi)
  ret
L6:
  movsd  0x8(%rdi),%xmm3
  movslq %esi,%rsi
  shl    $0x3,%rsi
  lea    -0x10(%rdi,%rsi,1),%rcx
  movsd  (%rcx),%xmm2
  lea    -0x8(%rdi,%rsi,1),%rdx
  movsd  D29(%rip),%xmm0
  mulsd  (%rdx),%xmm0
  movapd %xmm2,%xmm1
  mulsd  D50(%rip),%xmm1
  addsd  %xmm1,%xmm0
  movsd  D76(%rip),%xmm1
  mulsd  (%rdi),%xmm1
  movapd %xmm3,%xmm4
  mulsd  D21(%rip),%xmm4
  subsd  %xmm4,%xmm1
  movsd  %xmm1,(%rdi)
  mulsd  D114(%rip),%xmm3
  movsd  %xmm3,0x8(%rdi)
  mulsd  D98(%rip),%xmm2
  movsd  %xmm2,(%rcx)
  movsd  %xmm0,(%rdx)
L13:
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D4
datatype: f64
name: disassemble_data
arguments: data_label: D89
datatype: byte[8]
name: disassemble_data
arguments: data_label: D90
datatype: f64
name: disassemble_data
arguments: data_label: D112
datatype: f64
name: disassemble_data
arguments: data_label: D13
datatype: f64
name: disassemble_data
arguments: data_label: D100
datatype: f64
name: disassemble_data
arguments: data_label: D29
datatype: f64
name: disassemble_data
arguments: data_label: D50
datatype: f64
name: disassemble_data
arguments: data_label: D76
datatype: f64
name: disassemble_data
arguments: data_label: D21
datatype: f64
name: disassemble_data
arguments: data_label: D114
datatype: f64
name: disassemble_data
arguments: data_label: D98
datatype: f64

tool: D4: 2.09629288435324

tool: {"D89": [0x9f,0x5b,0x69,0x13,0x43,0xa0,0xe9,0xbf]}

tool: D90: 0.324894048898962

tool: D112: 0.0371580151158803

tool: D13: 1.0014454049813

tool: D100: 1.08984305289504

tool: D29: 0.477032578540915

tool: D50: 0.350522032550918

tool: D76: 3.07792649138669

tool: D21: 0.114204567242137

tool: D114: 0.998556681198888

tool: D98: 0.917563310922261

assistant: ```c
void condition(double *a, const int n, const int isign) {
  double t0, t1, t2, t3;
  if (n < 4)
    return;
  if (isign >= 0) {
    t0 = 0.324894048898962 * a[0] + 0.0371580151158803 * a[1];
    t1 = 1.00144540498130 * a[1];
    t2 = 1.08984305289504 * a[n - 2];
    t3 = -0.800813234246437 * a[n - 2] + 2.09629288435324 * a[n - 1];
    a[0] = t0;
    a[1] = t1;
    a[2] = t2;
    a[3] = t3;
  } else {
    t0 = 3.07792649138669 * a[0] - 0.114204567242137 * a[1];
    t1 = 0.998556681198888 * a[1];
    t2 = 0.917563310922261 * a[n - 2];
    t3 = 0.350522032550918 * a[n - 2] + 0.477032578540915 * a[n - 1];
    a[0] = t0;
    a[1] = t1;
    a[n - 2] = t2;
    a[n - 1] = t3;
  }
  return;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<condition>:
  endbr64
  mov    %rdi,%rax
  cmp    $0x3,%esi
  jle    L1
  movslq %esi,%rsi
  movsd  (%rdi),%xmm1
  movsd  0x8(%rdi),%xmm2
  shl    $0x3,%rsi
  lea    -0x10(%rdi,%rsi,1),%rdi
  lea    -0x8(%rax,%rsi,1),%rcx
  movsd  (%rdi),%xmm0
  movsd  (%rcx),%xmm3
  test   %edx,%edx
  js     L13
  movsd  D108(%rip),%xmm4
  mulsd  D41(%rip),%xmm1
  mulsd  D68(%rip),%xmm3
  mulsd  %xmm2,%xmm4
  mulsd  D97(%rip),%xmm2
  addsd  %xmm4,%xmm1
  movsd  %xmm2,0x8(%rax)
  movsd  %xmm1,(%rax)
  movsd  D12(%rip),%xmm1
  mulsd  %xmm0,%xmm1
  mulsd  D114(%rip),%xmm0
  movsd  %xmm1,0x10(%rax)
  addsd  %xmm3,%xmm0
  movsd  %xmm0,0x18(%rax)
  ret
  nopw   0x0(%rax,%rax,1)
L13:
  movsd  D82(%rip),%xmm4
  mulsd  D18(%rip),%xmm1
  mulsd  D8(%rip),%xmm3
  mulsd  %xmm2,%xmm4
  mulsd  D117(%rip),%xmm2
  subsd  %xmm4,%xmm1
  movsd  %xmm2,0x8(%rax)
  movsd  %xmm1,(%rax)
  movsd  D25(%rip),%xmm1
  mulsd  %xmm0,%xmm1
  mulsd  D104(%rip),%xmm0
  movsd  %xmm1,(%rdi)
  addsd  %xmm3,%xmm0
  movsd  %xmm0,(%rcx)
L1:
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D108
type: f64
name: retrieve_data
arguments: tag: D41
type: f64
name: retrieve_data
arguments: tag: D68
type: f64
name: retrieve_data
arguments: tag: D97
type: f64
name: retrieve_data
arguments: tag: D12
type: f64
name: retrieve_data
arguments: tag: D114
type: byte[8]
name: retrieve_data
arguments: tag: D82
type: f64
name: retrieve_data
arguments: tag: D18
type: f64
name: retrieve_data
arguments: tag: D8
type: f64
name: retrieve_data
arguments: tag: D117
type: f64
name: retrieve_data
arguments: tag: D25
type: f64
name: retrieve_data
arguments: tag: D104
type: f64

tool: D108: 0.0371580151158803

tool: D41: 0.324894048898962

tool: D68: 2.09629288435324

tool: D97: 1.0014454049813

tool: D12: 1.08984305289504

tool: {"D114": [0x9f,0x5b,0x69,0x13,0x43,0xa0,0xe9,0xbf]}

tool: D82: 0.114204567242137

tool: D18: 3.07792649138669

tool: D8: 0.477032578540915

tool: D117: 0.998556681198888

tool: D25: 0.917563310922261

tool: D104: 0.350522032550918

assistant: ```c
void condition(double *a, const int n, const int isign) {
  double t0, t1, t2, t3;
  if (n < 4)
    return;
  if (isign >= 0) {
    t0 = 0.324894048898962 * a[0] + 0.0371580151158803 * a[1];
    t1 = 1.00144540498130 * a[1];
    t2 = 1.08984305289504 * a[n - 2];
    t3 = -0.800813234246437 * a[n - 2] + 2.09629288435324 * a[n - 1];
    a[0] = t0;
    a[1] = t1;
    a[2] = t2;
    a[3] = t3;
  } else {
    t0 = 3.07792649138669 * a[0] - 0.114204567242137 * a[1];
    t1 = 0.998556681198888 * a[1];
    t2 = 0.917563310922261 * a[n - 2];
    t3 = 0.350522032550918 * a[n - 2] + 0.477032578540915 * a[n - 1];
    a[0] = t0;
    a[1] = t1;
    a[n - 2] = t2;
    a[n - 1] = t3;
  }
  return;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<condition>:
  endbr64
  cmp    $0x3,%esi
  jle    L8
  movslq %esi,%rsi
  movsd  (%rdi),%xmm0
  movsd  0x8(%rdi),%xmm2
  shl    $0x3,%rsi
  lea    -0x10(%rdi,%rsi,1),%rcx
  movsd  -0x8(%rdi,%rsi,1),%xmm3
  movsd  (%rcx),%xmm1
  test   %edx,%edx
  js     L12
  movsd  D115(%rip),%xmm4
  mulsd  D85(%rip),%xmm0
  mulsd  D75(%rip),%xmm3
  mulsd  %xmm2,%xmm4
  mulsd  D60(%rip),%xmm2
  addsd  %xmm4,%xmm0
  unpcklpd %xmm2,%xmm0
  movups %xmm0,(%rdi)
  movsd  D23(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  D71(%rip),%xmm1
  addsd  %xmm3,%xmm1
  unpcklpd %xmm1,%xmm0
  movups %xmm0,0x10(%rdi)
  ret
L12:
  movsd  D79(%rip),%xmm4
  mulsd  D47(%rip),%xmm0
  mulsd  D100(%rip),%xmm3
  mulsd  %xmm2,%xmm4
  mulsd  D48(%rip),%xmm2
  subsd  %xmm4,%xmm0
  unpcklpd %xmm2,%xmm0
  movups %xmm0,(%rdi)
  movsd  D61(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  D84(%rip),%xmm1
  addsd  %xmm3,%xmm1
  unpcklpd %xmm1,%xmm0
  movups %xmm0,(%rcx)
L8:
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D115
type_infered: f64
name: retrieve_data
arguments: data_tag: D85
type_infered: f64
name: retrieve_data
arguments: data_tag: D75
type_infered: f64
name: retrieve_data
arguments: data_tag: D60
type_infered: f64
name: retrieve_data
arguments: data_tag: D23
type_infered: f64
name: retrieve_data
arguments: data_tag: D71
type_infered: byte[8]
name: retrieve_data
arguments: data_tag: D79
type_infered: f64
name: retrieve_data
arguments: data_tag: D47
type_infered: f64
name: retrieve_data
arguments: data_tag: D100
type_infered: f64
name: retrieve_data
arguments: data_tag: D48
type_infered: f64
name: retrieve_data
arguments: data_tag: D61
type_infered: f64
name: retrieve_data
arguments: data_tag: D84
type_infered: f64

tool: D115: 0.0371580151158803

tool: D85: 0.324894048898962

tool: D75: 2.09629288435324

tool: D60: 1.0014454049813

tool: D23: 1.08984305289504

tool: {"D71": [0x9f,0x5b,0x69,0x13,0x43,0xa0,0xe9,0xbf]}

tool: D79: 0.114204567242137

tool: D47: 3.07792649138669

tool: D100: 0.477032578540915

tool: D48: 0.998556681198888

tool: D61: 0.917563310922261

tool: D84: 0.350522032550918

assistant: ```c
void condition(double *a, const int n, const int isign) {
  double t0, t1, t2, t3;
  if (n < 4)
    return;
  if (isign >= 0) {
    t0 = 0.324894048898962 * a[0] + 0.0371580151158803 * a[1];
    t1 = 1.00144540498130 * a[1];
    t2 = 1.08984305289504 * a[n - 2];
    t3 = -0.800813234246437 * a[n - 2] + 2.09629288435324 * a[n - 1];
    a[0] = t0;
    a[1] = t1;
    a[2] = t2;
    a[3] = t3;
  } else {
    t0 = 3.07792649138669 * a[0] - 0.114204567242137 * a[1];
    t1 = 0.998556681198888 * a[1];
    t2 = 0.917563310922261 * a[n - 2];
    t3 = 0.350522032550918 * a[n - 2] + 0.477032578540915 * a[n - 1];
    a[0] = t0;
    a[1] = t1;
    a[n - 2] = t2;
    a[n - 1] = t3;
  }
  return;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<mexpdrv_num_passes>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  shr    $0x4,%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  and    $0xf,%eax
  test   %eax,%eax
  je     L18
  mov    $0x1,%eax
  jmp    L16
L18:
  mov    $0x0,%eax
L16:
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
unsigned mexpdrv_num_passes(const unsigned batch_size) {
  unsigned num_passes = batch_size / 16 + (batch_size % 16 ? 1 : 0);
  return num_passes;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<mexpdrv_num_passes>:
  endbr64
  test   $0xf,%dil
  setne  %al
  movzbl %al,%eax
  shr    $0x4,%edi
  add    %edi,%eax
  ret
```

assistant: ```c
unsigned mexpdrv_num_passes(const unsigned batch_size) {
  unsigned num_passes = batch_size / 16 + (batch_size % 16 ? 1 : 0);
  return num_passes;
}
```
user: What is the c source code of the assembly code below?

```asm
<mexpdrv_num_passes>:
  endbr64
  xor    %eax,%eax
  test   $0xf,%dil
  setne  %al
  shr    $0x4,%edi
  add    %edi,%eax
  ret
```

assistant: ```c
unsigned mexpdrv_num_passes(const unsigned batch_size) {
  unsigned num_passes = batch_size / 16 + (batch_size % 16 ? 1 : 0);
  return num_passes;
}
```
user: Translate the below assembly code into C programming language:

```asm
<mexpdrv_num_passes>:
  endbr64
  xor    %eax,%eax
  test   $0xf,%dil
  setne  %al
  shr    $0x4,%edi
  add    %edi,%eax
  ret
```

assistant: ```c
unsigned mexpdrv_num_passes(const unsigned batch_size) {
  unsigned num_passes = batch_size / 16 + (batch_size % 16 ? 1 : 0);
  return num_passes;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<draw_rectangle>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    %rdx,-0x18(%rbp)
  mov    %rcx,-0x20(%rbp)
  mov    %r8,-0x28(%rbp)
  mov    %r9,-0x30(%rbp)
  mov    -0x10(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  jne    L18
  mov    -0x18(%rbp),%rdx
  mov    -0x10(%rbp),%rcx
  mov    -0x8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <glVertex3f@plt>
  mov    -0x18(%rbp),%rdx
  mov    -0x10(%rbp),%rcx
  mov    -0x20(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <glVertex3f@plt>
  mov    -0x30(%rbp),%rdx
  mov    -0x28(%rbp),%rcx
  mov    -0x20(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <glVertex3f@plt>
  mov    -0x30(%rbp),%rdx
  mov    -0x28(%rbp),%rcx
  mov    -0x20(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <glVertex3f@plt>
  mov    -0x30(%rbp),%rdx
  mov    -0x28(%rbp),%rcx
  mov    -0x8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <glVertex3f@plt>
  mov    -0x18(%rbp),%rdx
  mov    -0x10(%rbp),%rcx
  mov    -0x8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <glVertex3f@plt>
  jmp    L13
L18:
  mov    -0x18(%rbp),%rdx
  mov    -0x10(%rbp),%rcx
  mov    -0x8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <glVertex3f@plt>
  mov    -0x30(%rbp),%rdx
  mov    -0x10(%rbp),%rcx
  mov    -0x20(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <glVertex3f@plt>
  mov    -0x30(%rbp),%rdx
  mov    -0x28(%rbp),%rcx
  mov    -0x20(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <glVertex3f@plt>
  mov    -0x30(%rbp),%rdx
  mov    -0x28(%rbp),%rcx
  mov    -0x20(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <glVertex3f@plt>
  mov    -0x18(%rbp),%rdx
  mov    -0x28(%rbp),%rcx
  mov    -0x8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <glVertex3f@plt>
  mov    -0x18(%rbp),%rdx
  mov    -0x10(%rbp),%rcx
  mov    -0x8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <glVertex3f@plt>
L13:
  nop
  leave
  ret
```

assistant: ```c
void draw_rectangle(GLfloat x1, GLfloat y1, GLfloat z1, GLfloat x2, GLfloat y2, GLfloat z2) {
  if (y1 == y2) {
    glVertex3f(x1, y1, z1);
    glVertex3f(x2, y1, z1);
    glVertex3f(x2, y2, z2);
    glVertex3f(x2, y2, z2);
    glVertex3f(x1, y2, z2);
    glVertex3f(x1, y1, z1);
  } else {
    glVertex3f(x1, y1, z1);
    glVertex3f(x2, y1, z2);
    glVertex3f(x2, y2, z2);
    glVertex3f(x2, y2, z2);
    glVertex3f(x1, y2, z1);
    glVertex3f(x1, y1, z1);
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<draw_rectangle>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r12
  mov    %rsi,%rbx
  mov    %rdx,%r13
  mov    %rcx,%r14
  mov    %r8,%rbp
  mov    %r9,%r15
  cmp    %r8,%rsi
  je     L12
  call   <glVertex3f@plt>
  mov    %r15,%rdx
  mov    %rbx,%rsi
  mov    %r14,%rdi
  call   <glVertex3f@plt>
  mov    %r15,%rdx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <glVertex3f@plt>
  mov    %r15,%rdx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <glVertex3f@plt>
  mov    %r13,%rdx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <glVertex3f@plt>
  mov    %r13,%rdx
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <glVertex3f@plt>
L6:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L12:
  call   <glVertex3f@plt>
  mov    %r13,%rdx
  mov    %rbx,%rsi
  mov    %r14,%rdi
  call   <glVertex3f@plt>
  mov    %r15,%rdx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <glVertex3f@plt>
  mov    %r15,%rdx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <glVertex3f@plt>
  mov    %r15,%rdx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <glVertex3f@plt>
  mov    %r13,%rdx
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <glVertex3f@plt>
  jmp    L6
```

assistant: ```c
void draw_rectangle(GLfloat x1, GLfloat y1, GLfloat z1, GLfloat x2, GLfloat y2, GLfloat z2) {
  if (y1 == y2) {
    glVertex3f(x1, y1, z1);
    glVertex3f(x2, y1, z1);
    glVertex3f(x2, y2, z2);
    glVertex3f(x2, y2, z2);
    glVertex3f(x1, y2, z2);
    glVertex3f(x1, y1, z1);
  } else {
    glVertex3f(x1, y1, z1);
    glVertex3f(x2, y1, z2);
    glVertex3f(x2, y2, z2);
    glVertex3f(x2, y2, z2);
    glVertex3f(x1, y2, z1);
    glVertex3f(x1, y1, z1);
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<draw_rectangle>:
  endbr64
  push   %r15
  mov    %r9,%r15
  push   %r14
  mov    %rcx,%r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  cmp    %r8,%rsi
  je     L17
  mov    %r8,%rbx
  call   <glVertex3f@plt>
  mov    %r15,%rdx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <glVertex3f@plt>
  mov    %r15,%rdx
  mov    %rbx,%rsi
  mov    %r14,%rdi
  call   <glVertex3f@plt>
  mov    %r15,%rdx
  mov    %rbx,%rsi
  mov    %r14,%rdi
  call   <glVertex3f@plt>
  mov    %r13,%rdx
  mov    %rbx,%rsi
L19:
  mov    %r12,%rdi
  call   <glVertex3f@plt>
  add    $0x8,%rsp
  mov    %r13,%rdx
  mov    %rbp,%rsi
  pop    %rbx
  mov    %r12,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1050 <glVertex3f@plt>
  nopw   0x0(%rax,%rax,1)
L17:
  call   <glVertex3f@plt>
  mov    %r13,%rdx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <glVertex3f@plt>
  mov    %r15,%rdx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <glVertex3f@plt>
  mov    %r15,%rdx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <glVertex3f@plt>
  mov    %r15,%rdx
  mov    %rbp,%rsi
  jmp    L19
```

assistant: ```c
void draw_rectangle(GLfloat x1, GLfloat y1, GLfloat z1, GLfloat x2, GLfloat y2, GLfloat z2) {
  if (y1 == y2) {
    glVertex3f(x1, y1, z1);
    glVertex3f(x2, y1, z1);
    glVertex3f(x2, y2, z2);
    glVertex3f(x2, y2, z2);
    glVertex3f(x1, y2, z2);
    glVertex3f(x1, y1, z1);
  } else {
    glVertex3f(x1, y1, z1);
    glVertex3f(x2, y1, z2);
    glVertex3f(x2, y2, z2);
    glVertex3f(x2, y2, z2);
    glVertex3f(x1, y2, z1);
    glVertex3f(x1, y1, z1);
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<draw_rectangle>:
  endbr64
  push   %r15
  mov    %r9,%r15
  push   %r14
  mov    %rcx,%r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  cmp    %r8,%rsi
  je     L3
  mov    %r8,%rbx
  call   <glVertex3f@plt>
  mov    %r15,%rdx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <glVertex3f@plt>
  mov    %r15,%rdx
  mov    %rbx,%rsi
  mov    %r14,%rdi
  call   <glVertex3f@plt>
  mov    %r15,%rdx
  mov    %rbx,%rsi
  mov    %r14,%rdi
  call   <glVertex3f@plt>
  mov    %r13,%rdx
  mov    %rbx,%rsi
L13:
  mov    %r12,%rdi
  call   <glVertex3f@plt>
  add    $0x8,%rsp
  mov    %r13,%rdx
  mov    %rbp,%rsi
  pop    %rbx
  mov    %r12,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1050 <glVertex3f@plt>
  nopw   0x0(%rax,%rax,1)
L3:
  call   <glVertex3f@plt>
  mov    %r13,%rdx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <glVertex3f@plt>
  mov    %r15,%rdx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <glVertex3f@plt>
  mov    %r15,%rdx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <glVertex3f@plt>
  mov    %r15,%rdx
  mov    %rbp,%rsi
  jmp    L13
```

assistant: ```c
void draw_rectangle(GLfloat x1, GLfloat y1, GLfloat z1, GLfloat x2, GLfloat y2, GLfloat z2) {
  if (y1 == y2) {
    glVertex3f(x1, y1, z1);
    glVertex3f(x2, y1, z1);
    glVertex3f(x2, y2, z2);
    glVertex3f(x2, y2, z2);
    glVertex3f(x1, y2, z2);
    glVertex3f(x1, y1, z1);
  } else {
    glVertex3f(x1, y1, z1);
    glVertex3f(x2, y1, z2);
    glVertex3f(x2, y2, z2);
    glVertex3f(x2, y2, z2);
    glVertex3f(x1, y2, z1);
    glVertex3f(x1, y1, z1);
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<gcd>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    -0x14(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jle    L21
  mov    -0x14(%rbp),%eax
  cltd
  idivl  -0x18(%rbp)
  mov    %edx,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  jne    L14
  mov    -0x18(%rbp),%eax
  jmp    L40
L14:
  mov    -0x18(%rbp),%edx
  mov    -0x4(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <gcd>
  jmp    L40
L21:
  mov    -0x18(%rbp),%eax
  cltd
  idivl  -0x14(%rbp)
  mov    %edx,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  jne    L7
  mov    -0x14(%rbp),%eax
  jmp    L40
L7:
  mov    -0x14(%rbp),%edx
  mov    -0x4(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <gcd>
L40:
  leave
  ret
```

assistant: ```c
int gcd(int a, int b) {
  int m;
  if (a > b) {
    m = a % b;
    if (m == 0)
      return b;
    return gcd(m, b);
  } else {
    m = b % a;
    if (m == 0)
      return a;
    return gcd(m, a);
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<gcd>:
  endbr64
  sub    $0x8,%rsp
  cmp    %esi,%edi
  jle    L19
  mov    %edi,%eax
  cltd
  idiv   %esi
  mov    %esi,%eax
  test   %edx,%edx
  jne    L4
L0:
  add    $0x8,%rsp
  ret
L4:
  mov    %edx,%edi
  call   <gcd>
  jmp    L0
L19:
  mov    %esi,%eax
  cltd
  idiv   %edi
  mov    %edi,%eax
  test   %edx,%edx
  je     L0
  mov    %edi,%esi
  mov    %edx,%edi
  call   <gcd>
  jmp    L0
```

assistant: ```c
int gcd(int a, int b) {
  int m;
  if (a > b) {
    m = a % b;
    if (m == 0)
      return b;
    return gcd(m, b);
  } else {
    m = b % a;
    if (m == 0)
      return a;
    return gcd(m, a);
  }
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<gcd>:
  endbr64
  mov    %esi,%r8d
  cmp    %r8d,%edi
  jle    L3
  nopl   0x0(%rax)
L30:
  mov    %edi,%eax
  cltd
  idiv   %r8d
  test   %edx,%edx
  je     L24
L26:
  mov    %edx,%edi
  cmp    %r8d,%edi
  jg     L30
L3:
  mov    %r8d,%eax
  mov    %edi,%r8d
  cltd
  idiv   %edi
  test   %edx,%edx
  jne    L26
L24:
  mov    %r8d,%eax
  ret
```

assistant: ```c
int gcd(int a, int b) {
  int m;
  if (a > b) {
    m = a % b;
    if (m == 0)
      return b;
    return gcd(m, b);
  } else {
    m = b % a;
    if (m == 0)
      return a;
    return gcd(m, a);
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<gcd>:
  endbr64
  mov    %esi,%r8d
  cmp    %r8d,%edi
  jle    L25
  nopl   0x0(%rax)
L28:
  mov    %edi,%eax
  cltd
  idiv   %r8d
  test   %edx,%edx
  je     L9
L15:
  mov    %edx,%edi
  cmp    %r8d,%edi
  jg     L28
L25:
  mov    %r8d,%eax
  mov    %edi,%r8d
  cltd
  idiv   %edi
  test   %edx,%edx
  jne    L15
L9:
  mov    %r8d,%eax
  ret
```

assistant: ```c
int gcd(int a, int b) {
  int m;
  if (a > b) {
    m = a % b;
    if (m == 0)
      return b;
    return gcd(m, b);
  } else {
    m = b % a;
    if (m == 0)
      return a;
    return gcd(m, a);
  }
}
```