ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<ldradiusfromintensity>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x28,%rsp
  movsd  %xmm0,(%rsp)
  pxor   %xmm0,%xmm0
  call   <ldintensity@plt>
  mov    D1(%rip),%rax
  mov    %rbp,%rdi
  movsd  %xmm0,0x8(%rsp)
  movq   %rax,%xmm0
  call   <ldintensity@plt>
  movsd  (%rsp),%xmm5
  comisd 0x8(%rsp),%xmm5
  movsd  D4(%rip),%xmm1
  ja     L9
  comisd %xmm5,%xmm0
  ja     L9
  mov    D1(%rip),%rax
  mov    $0x5f5e101,%ebx
  movq   $0x0,0x10(%rsp)
  mov    %rax,0x18(%rsp)
  jmp    L45
  nopl   0x0(%rax)
L18:
  movapd %xmm0,%xmm2
  movsd  %xmm1,0x10(%rsp)
  subsd  %xmm3,%xmm2
  sub    $0x1,%ebx
  je     L9
L38:
  comisd D46(%rip),%xmm2
  jbe    L9
L45:
  movsd  0x10(%rsp),%xmm1
  addsd  0x18(%rsp),%xmm1
  mov    %rbp,%rdi
  mulsd  D35(%rip),%xmm1
  movapd %xmm1,%xmm0
  movsd  %xmm1,0x8(%rsp)
  call   <ldintensity@plt>
  movsd  (%rsp),%xmm3
  movsd  0x8(%rsp),%xmm1
  comisd %xmm3,%xmm0
  ja     L18
  movsd  (%rsp),%xmm2
  movsd  %xmm1,0x18(%rsp)
  subsd  %xmm0,%xmm2
  sub    $0x1,%ebx
  jne    L38
L9:
  add    $0x28,%rsp
  movapd %xmm1,%xmm0
  pop    %rbx
  pop    %rbp
  ret
```

tool_calls: name: unpack_data
arguments: label: D1
data_type: f64
name: unpack_data
arguments: label: D4
data_type: f32[2]
name: unpack_data
arguments: label: D46
data_type: f64
name: unpack_data
arguments: label: D35
data_type: f32[2]

tool: D1: 1

tool: {"D4": [0.0,-1.875]}

tool: D46: 0.0001

tool: {"D35": [0.0,1.75]}

assistant: ```c
double ldradiusfromintensity(double intensity, double lda[5]) {
  int count = 0;
  double minr = 0.0, maxr = 1.0, iatmin, iatmax;
  double midr, iatmid, di;
  double rfitollerance = 0.0001;
  iatmin = ldintensity(minr, lda);
  iatmax = ldintensity(maxr, lda);
  di = 100;
  if (iatmin < intensity || iatmax > intensity)
    return -1.0;
  while (di > rfitollerance) {
    count++;
    midr = (minr + maxr) / 2.0;
    iatmid = ldintensity(midr, lda);
    if (iatmid > intensity) {
      minr = midr;
      di = iatmid - intensity;
    } else {
      maxr = midr;
      di = intensity - iatmid;
    }
    if (count > 100000000)
      di = 0;
  }
  return midr;
}
```
user: What is the c source code of the assembly code below:

```asm
<ldradiusfromintensity>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x28,%rsp
  movsd  %xmm0,(%rsp)
  pxor   %xmm0,%xmm0
  call   <ldintensity@plt>
  mov    D34(%rip),%rax
  mov    %rbp,%rdi
  movsd  %xmm0,0x8(%rsp)
  movq   %rax,%xmm0
  call   <ldintensity@plt>
  movsd  (%rsp),%xmm5
  comisd 0x8(%rsp),%xmm5
  movsd  D4(%rip),%xmm1
  ja     L28
  comisd %xmm5,%xmm0
  ja     L28
  mov    D34(%rip),%rax
  mov    $0x5f5e101,%ebx
  movq   $0x0,0x10(%rsp)
  mov    %rax,0x18(%rsp)
  jmp    L10
  nopl   0x0(%rax)
L41:
  movapd %xmm0,%xmm2
  movsd  %xmm1,0x10(%rsp)
  subsd  %xmm3,%xmm2
  sub    $0x1,%ebx
  je     L28
L4:
  comisd D35(%rip),%xmm2
  jbe    L28
L10:
  movsd  0x10(%rsp),%xmm1
  addsd  0x18(%rsp),%xmm1
  mov    %rbp,%rdi
  mulsd  D37(%rip),%xmm1
  movapd %xmm1,%xmm0
  movsd  %xmm1,0x8(%rsp)
  call   <ldintensity@plt>
  movsd  (%rsp),%xmm3
  movsd  0x8(%rsp),%xmm1
  comisd %xmm3,%xmm0
  ja     L41
  movapd %xmm3,%xmm2
  movsd  %xmm1,0x18(%rsp)
  subsd  %xmm0,%xmm2
  sub    $0x1,%ebx
  jne    L4
L28:
  add    $0x28,%rsp
  movapd %xmm1,%xmm0
  pop    %rbx
  pop    %rbp
  ret
```

tool_calls: name: unpack_data
arguments: tag: D34
type_guessed: f64
name: unpack_data
arguments: tag: D4
type_guessed: f32[2]
name: unpack_data
arguments: tag: D35
type_guessed: f64
name: unpack_data
arguments: tag: D37
type_guessed: f32[2]

tool: D34: 1

tool: {"D4": [0.0,-1.875]}

tool: D35: 0.0001

tool: {"D37": [0.0,1.75]}

assistant: ```c
double ldradiusfromintensity(double intensity, double lda[5]) {
  int count = 0;
  double minr = 0.0, maxr = 1.0, iatmin, iatmax;
  double midr, iatmid, di;
  double rfitollerance = 0.0001;
  iatmin = ldintensity(minr, lda);
  iatmax = ldintensity(maxr, lda);
  di = 100;
  if (iatmin < intensity || iatmax > intensity)
    return -1.0;
  while (di > rfitollerance) {
    count++;
    midr = (minr + maxr) / 2.0;
    iatmid = ldintensity(midr, lda);
    if (iatmid > intensity) {
      minr = midr;
      di = iatmid - intensity;
    } else {
      maxr = midr;
      di = intensity - iatmid;
    }
    if (count > 100000000)
      di = 0;
  }
  return midr;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<uint8_char>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L9
L12:
  mov    $0x7,%eax
  sub    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    -0x18(%rbp),%rdx
  mov    %dl,(%rax)
  shrq   $0x8,-0x18(%rbp)
  addl   $0x1,-0x4(%rbp)
L9:
  cmpl   $0x7,-0x4(%rbp)
  jle    L12
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void uint8_char(unsigned long int i, unsigned char *p) {
  int j;
  for (j = 0; j < 8; j++) {
    p[7 - j] = i & 255;
    i = i >> 8;
  }
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<uint8_char>:
  endbr64
  lea    0x7(%rsi),%rax
L2:
  mov    %dil,(%rax)
  shr    $0x8,%rdi
  mov    %rax,%rdx
  sub    $0x1,%rax
  cmp    %rsi,%rdx
  jne    L2
  ret
```

assistant: ```c
void uint8_char(unsigned long int i, unsigned char *p) {
  int j;
  for (j = 0; j < 8; j++) {
    p[7 - j] = i & 255;
    i = i >> 8;
  }
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<uint8_char>:
  endbr64
  lea    0x7(%rsi),%rax
  nopl   0x0(%rax,%rax,1)
L2:
  mov    %rax,%rdx
  mov    %dil,(%rax)
  shr    $0x8,%rdi
  sub    $0x1,%rax
  cmp    %rsi,%rdx
  jne    L2
  ret
```

assistant: ```c
void uint8_char(unsigned long int i, unsigned char *p) {
  int j;
  for (j = 0; j < 8; j++) {
    p[7 - j] = i & 255;
    i = i >> 8;
  }
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<uint8_char>:
  endbr64
  bswap  %rdi
  mov    %rdi,(%rsi)
  ret
```

assistant: ```c
void uint8_char(unsigned long int i, unsigned char *p) {
  int j;
  for (j = 0; j < 8; j++) {
    p[7 - j] = i & 255;
    i = i >> 8;
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<RandomFunc>:
  endbr64
  sub    $0x18,%rsp
  mov    %rsi,%r8
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    (%rdi),%rax
  shr    $0x3,%rax
  or     $0x61bab5,%rax
  mov    %rax,(%rsp)
  mov    0x8(%rdi),%rcx
  test   %rcx,%rcx
  je     L28
  mov    %rsp,%rax
  mov    $0x0,%edx
  jmp    L72
L73:
  movzbl 0x2(%rax),%esi
  movzbl 0x5(%rax),%edi
  mov    %dil,0x2(%rax)
  mov    %sil,0x5(%rax)
  movzbl 0x3(%rax),%esi
  movzbl 0x7(%rax),%edi
  mov    %dil,0x3(%rax)
  mov    %sil,0x7(%rax)
  jmp    L26
L0:
  movzbl 0x4(%rsp),%esi
  movzbl 0x3(%rsp),%edi
  mov    %dil,0x4(%rsp)
  mov    %sil,0x3(%rsp)
L29:
  add    $0x2,%rdx
  add    $0x10,%rax
  cmp    %rcx,%rdx
  jae    L28
L72:
  cmp    %rdx,(%rsp)
  jbe    L73
  movzbl 0x4(%rax),%esi
  movzbl 0x7(%rax),%edi
  mov    %dil,0x4(%rax)
  movzbl (%rax),%edi
  mov    %dil,0x7(%rax)
  mov    %sil,(%rax)
L26:
  cmp    %rdx,(%rsp)
  jbe    L0
  movzwl (%rax),%esi
  movzwl 0x6(%rax),%edi
  mov    %di,(%rax)
  mov    %si,0x6(%rax)
  jmp    L29
L28:
  mov    (%rsp),%rax
  shr    $0x3,%rax
  xor    $0x1d64e56,%rax
  mov    %rax,(%r8)
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L16
  add    $0x18,%rsp
  ret
L16:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local1;
  char copy11;
  char copy12;
  unsigned short copy13;
  char copy14;
  {
    state[0UL] = (input[0UL] | 51238316UL) >> 3UL;
    local1 = 0UL;
    while (local1 < input[1UL]) {
      if (state[0UL] > local1) {
        copy11 = *((char *)(&state[local1]) + 4);
        *((char *)(&state[local1]) + 4) = *((char *)(&state[local1]) + 7);
        *((char *)(&state[local1]) + 7) = copy11;
        copy11 = *((char *)(&state[local1]) + 7);
        *((char *)(&state[local1]) + 7) = *((char *)(&state[local1]) + 0);
        *((char *)(&state[local1]) + 0) = copy11;
      } else {
        copy12 = *((char *)(&state[local1]) + 2);
        *((char *)(&state[local1]) + 2) = *((char *)(&state[local1]) + 5);
        *((char *)(&state[local1]) + 5) = copy12;
        copy12 = *((char *)(&state[local1]) + 3);
        *((char *)(&state[local1]) + 3) = *((char *)(&state[local1]) + 7);
        *((char *)(&state[local1]) + 7) = copy12;
      }
      if (state[0UL] > local1) {
        copy13 = *((unsigned short *)(&state[local1]) + 0);
        *((unsigned short *)(&state[local1]) + 0) = *((unsigned short *)(&state[local1]) + 3);
        *((unsigned short *)(&state[local1]) + 3) = copy13;
      } else {
        copy14 = *((char *)(&state[0UL]) + 4);
        *((char *)(&state[0UL]) + 4) = *((char *)(&state[0UL]) + 3);
        *((char *)(&state[0UL]) + 3) = copy14;
      }
      local1 += 2UL;
    }
    output[0UL] = (state[0UL] ^ 246575798UL) >> 3UL;
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<RandomFunc>:
  endbr64
  sub    $0x18,%rsp
  mov    (%rdi),%rcx
  mov    0x8(%rdi),%rdi
  mov    %rsi,%r9
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  shr    $0x3,%rcx
  or     $0x61bab5,%rcx
  mov    %rcx,(%rsp)
  test   %rdi,%rdi
  je     L56
  mov    %rsp,%rax
  xor    %edx,%edx
  jmp    L77
  nopl   0x0(%rax)
L0:
  movzbl 0x4(%rax),%ecx
  mov    %sil,0x4(%rax)
  movzbl (%rax),%esi
  mov    %cl,(%rax)
  mov    %sil,0x7(%rax)
  mov    (%rsp),%rcx
  cmp    %rdx,%rcx
  jbe    L76
L55:
  movzwl (%rax),%esi
  movzwl 0x6(%rax),%r8d
  add    $0x2,%rdx
  add    $0x10,%rax
  mov    %r8w,-0x10(%rax)
  mov    %si,-0xa(%rax)
  cmp    %rdi,%rdx
  jae    L56
L77:
  movzbl 0x7(%rax),%esi
  cmp    %rcx,%rdx
  jb     L0
  movzbl 0x2(%rax),%ecx
  movzbl 0x5(%rax),%r8d
  mov    %cl,0x5(%rax)
  movzbl 0x3(%rax),%ecx
  mov    %r8b,0x2(%rax)
  mov    %sil,0x3(%rax)
  mov    %cl,0x7(%rax)
  mov    (%rsp),%rcx
  cmp    %rdx,%rcx
  ja     L55
L76:
  add    $0x2,%rdx
  rolw   $0x8,0x3(%rsp)
  add    $0x10,%rax
  mov    (%rsp),%rcx
  cmp    %rdi,%rdx
  jb     L77
L56:
  shr    $0x3,%rcx
  xor    $0x1d64e56,%rcx
  mov    %rcx,(%r9)
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L40
  add    $0x18,%rsp
  ret
L40:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local1;
  char copy11;
  char copy12;
  unsigned short copy13;
  char copy14;
  {
    state[0UL] = (input[0UL] | 51238316UL) >> 3UL;
    local1 = 0UL;
    while (local1 < input[1UL]) {
      if (state[0UL] > local1) {
        copy11 = *((char *)(&state[local1]) + 4);
        *((char *)(&state[local1]) + 4) = *((char *)(&state[local1]) + 7);
        *((char *)(&state[local1]) + 7) = copy11;
        copy11 = *((char *)(&state[local1]) + 7);
        *((char *)(&state[local1]) + 7) = *((char *)(&state[local1]) + 0);
        *((char *)(&state[local1]) + 0) = copy11;
      } else {
        copy12 = *((char *)(&state[local1]) + 2);
        *((char *)(&state[local1]) + 2) = *((char *)(&state[local1]) + 5);
        *((char *)(&state[local1]) + 5) = copy12;
        copy12 = *((char *)(&state[local1]) + 3);
        *((char *)(&state[local1]) + 3) = *((char *)(&state[local1]) + 7);
        *((char *)(&state[local1]) + 7) = copy12;
      }
      if (state[0UL] > local1) {
        copy13 = *((unsigned short *)(&state[local1]) + 0);
        *((unsigned short *)(&state[local1]) + 0) = *((unsigned short *)(&state[local1]) + 3);
        *((unsigned short *)(&state[local1]) + 3) = copy13;
      } else {
        copy14 = *((char *)(&state[0UL]) + 4);
        *((char *)(&state[0UL]) + 4) = *((char *)(&state[0UL]) + 3);
        *((char *)(&state[0UL]) + 3) = copy14;
      }
      local1 += 2UL;
    }
    output[0UL] = (state[0UL] ^ 246575798UL) >> 3UL;
  }
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<RandomFunc>:
  endbr64
  push   %rbx
  mov    %rsi,%r9
  sub    $0x10,%rsp
  mov    (%rdi),%rcx
  mov    0x8(%rdi),%rsi
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  shr    $0x3,%rcx
  or     $0x61bab5,%rcx
  mov    %rcx,(%rsp)
  test   %rsi,%rsi
  je     L20
  mov    %rsp,%rax
  xor    %edx,%edx
  jmp    L64
  nopw   0x0(%rax,%rax,1)
L9:
  movzbl 0x4(%rax),%ecx
  movzbl (%rax),%edi
  mov    %bl,0x4(%rax)
  mov    %dil,0x7(%rax)
  mov    %cl,(%rax)
  mov    (%rsp),%rcx
  cmp    %rdx,%rcx
  jbe    L61
L76:
  movzwl (%rax),%edi
  movzwl 0x6(%rax),%r8d
  add    $0x2,%rdx
  add    $0x10,%rax
  mov    %r8w,-0x10(%rax)
  mov    %di,-0xa(%rax)
  cmp    %rsi,%rdx
  jae    L20
L64:
  movzbl 0x7(%rax),%ebx
  cmp    %rcx,%rdx
  jb     L9
  movzbl 0x2(%rax),%edi
  xor    %ecx,%ecx
  mov    0x5(%rax),%cl
  mov    %dil,0x5(%rax)
  movzbl 0x3(%rax),%edi
  mov    %bl,%ch
  mov    %cx,0x2(%rax)
  mov    %dil,0x7(%rax)
  mov    (%rsp),%rcx
  cmp    %rdx,%rcx
  ja     L76
L61:
  add    $0x2,%rdx
  rolw   $0x8,0x3(%rsp)
  add    $0x10,%rax
  mov    (%rsp),%rcx
  cmp    %rsi,%rdx
  jb     L64
L20:
  shr    $0x3,%rcx
  xor    $0x1d64e56,%rcx
  mov    %rcx,(%r9)
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L54
  add    $0x10,%rsp
  pop    %rbx
  ret
L54:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local1;
  char copy11;
  char copy12;
  unsigned short copy13;
  char copy14;
  {
    state[0UL] = (input[0UL] | 51238316UL) >> 3UL;
    local1 = 0UL;
    while (local1 < input[1UL]) {
      if (state[0UL] > local1) {
        copy11 = *((char *)(&state[local1]) + 4);
        *((char *)(&state[local1]) + 4) = *((char *)(&state[local1]) + 7);
        *((char *)(&state[local1]) + 7) = copy11;
        copy11 = *((char *)(&state[local1]) + 7);
        *((char *)(&state[local1]) + 7) = *((char *)(&state[local1]) + 0);
        *((char *)(&state[local1]) + 0) = copy11;
      } else {
        copy12 = *((char *)(&state[local1]) + 2);
        *((char *)(&state[local1]) + 2) = *((char *)(&state[local1]) + 5);
        *((char *)(&state[local1]) + 5) = copy12;
        copy12 = *((char *)(&state[local1]) + 3);
        *((char *)(&state[local1]) + 3) = *((char *)(&state[local1]) + 7);
        *((char *)(&state[local1]) + 7) = copy12;
      }
      if (state[0UL] > local1) {
        copy13 = *((unsigned short *)(&state[local1]) + 0);
        *((unsigned short *)(&state[local1]) + 0) = *((unsigned short *)(&state[local1]) + 3);
        *((unsigned short *)(&state[local1]) + 3) = copy13;
      } else {
        copy14 = *((char *)(&state[0UL]) + 4);
        *((char *)(&state[0UL]) + 4) = *((char *)(&state[0UL]) + 3);
        *((char *)(&state[0UL]) + 3) = copy14;
      }
      local1 += 2UL;
    }
    output[0UL] = (state[0UL] ^ 246575798UL) >> 3UL;
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<graph_line>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %esi,-0x28(%rbp)
  mov    %edx,-0x2c(%rbp)
  mov    %ecx,-0x30(%rbp)
  mov    %r8d,%edx
  mov    %r9d,%ecx
  mov    0x10(%rbp),%eax
  mov    %dl,-0x34(%rbp)
  mov    %ecx,%edx
  mov    %dl,-0x38(%rbp)
  mov    %al,-0x3c(%rbp)
  mov    -0x2c(%rbp),%eax
  sub    -0x24(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x30(%rbp),%eax
  sub    -0x28(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x18(%rbp),%eax
  imul   %eax,%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  imul   %eax,%eax
  add    %edx,%eax
  mov    %eax,%edi
  call   <sqrt@plt>
  mov    %eax,-0x10(%rbp)
  movl   $0x0,-0x1c(%rbp)
  jmp    L69
L4:
  mov    -0x18(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  cltd
  idivl  -0x10(%rbp)
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  js     L40
  mov    -0xc(%rbp),%eax
  cmp    %eax,0x20(%rbp)
  jbe    L40
  mov    -0x14(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  cltd
  idivl  -0x10(%rbp)
  mov    %eax,%edx
  mov    -0x28(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x8(%rbp)
  cmpl   $0x0,-0x8(%rbp)
  js     L8
  mov    -0x8(%rbp),%eax
  cmp    %eax,0x28(%rbp)
  jbe    L8
  mov    -0x8(%rbp),%eax
  imul   0x20(%rbp),%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    0x18(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x34(%rbp),%eax
  mov    %al,(%rdx)
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    0x18(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x38(%rbp),%eax
  mov    %al,(%rdx)
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x2(%rax),%rdx
  mov    0x18(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x3c(%rbp),%eax
  mov    %al,(%rdx)
  jmp    L75
L40:
  nop
  jmp    L75
L8:
  nop
L75:
  addl   $0x1,-0x1c(%rbp)
L69:
  mov    -0x1c(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jl     L4
  nop
  nop
  leave
  ret
```

assistant: ```c
void graph_line(int start_x, int start_y, int end_x, int end_y, unsigned char r, unsigned char g, unsigned char b, unsigned char *img, unsigned int img_width, unsigned int img_height) {
  int dx = end_x - start_x;
  int dy = end_y - start_y;
  int length = (int)sqrt(dx * dx + dy * dy);
  int i, x, y, n;
  for (i = 0; i < length; i++) {
    x = start_x + (dx * i / length);
    if ((x < 0) || (x >= img_width))
      continue;
    y = start_y + (dy * i / length);
    if ((y < 0) || (y >= img_height))
      continue;
    n = ((y * img_width) + x) * 3;
    img[n] = r;
    img[n + 1] = g;
    img[n + 2] = b;
  }
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<graph_line>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %edi,0x4(%rsp)
  mov    %esi,0x8(%rsp)
  mov    0x58(%rsp),%r12
  mov    0x60(%rsp),%r13d
  mov    %r8b,0xf(%rsp)
  mov    %r9d,%r14d
  movzbl 0x50(%rsp),%r15d
  mov    %edx,%ebx
  sub    %edi,%ebx
  sub    %esi,%ecx
  mov    %ecx,%ebp
  mov    %ebx,%edi
  imul   %ebx,%edi
  mov    %ecx,%eax
  imul   %ecx,%eax
  add    %eax,%edi
  call   <sqrt@plt>
  test   %eax,%eax
  jle    L64
  mov    %eax,%ecx
  mov    $0x0,%edi
  mov    $0x0,%esi
  mov    $0x0,%r8d
  movzbl 0xf(%rsp),%r11d
  mov    0x68(%rsp),%r10d
  jmp    L78
L73:
  add    $0x1,%r8d
  add    %ebx,%esi
  add    %ebp,%edi
  cmp    %r8d,%ecx
  je     L64
L78:
  mov    %esi,%eax
  cltd
  idiv   %ecx
  add    0x4(%rsp),%eax
  mov    %eax,%r9d
  js     L73
  cmp    %r13d,%eax
  jae    L73
  mov    %edi,%eax
  cltd
  idiv   %ecx
  add    0x8(%rsp),%eax
  js     L73
  cmp    %r10d,%eax
  jae    L73
  imul   %r13d,%eax
  add    %r9d,%eax
  lea    (%rax,%rax,2),%eax
  cltq
  mov    %r11b,(%r12,%rax,1)
  mov    %r14b,0x1(%r12,%rax,1)
  mov    %r15b,0x2(%r12,%rax,1)
  jmp    L73
L64:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void graph_line(int start_x, int start_y, int end_x, int end_y, unsigned char r, unsigned char g, unsigned char b, unsigned char *img, unsigned int img_width, unsigned int img_height) {
  int dx = end_x - start_x;
  int dy = end_y - start_y;
  int length = (int)sqrt(dx * dx + dy * dy);
  int i, x, y, n;
  for (i = 0; i < length; i++) {
    x = start_x + (dx * i / length);
    if ((x < 0) || (x >= img_width))
      continue;
    y = start_y + (dy * i / length);
    if ((y < 0) || (y >= img_height))
      continue;
    n = ((y * img_width) + x) * 3;
    img[n] = r;
    img[n + 1] = g;
    img[n + 2] = b;
  }
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<graph_line>:
  endbr64
  push   %r15
  sub    %edi,%edx
  sub    %esi,%ecx
  push   %r14
  mov    %ecx,%eax
  push   %r13
  imul   %ecx,%eax
  mov    %ecx,%r13d
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %edi,%ebx
  mov    %edx,%edi
  imul   %edx,%edi
  sub    $0x18,%rsp
  movzbl 0x50(%rsp),%r10d
  add    %eax,%edi
  mov    %r8b,0xd(%rsp)
  mov    0x58(%rsp),%r14
  mov    0x60(%rsp),%r15d
  mov    %r9b,0xf(%rsp)
  mov    %r10b,0xe(%rsp)
  call   <sqrt@plt>
  test   %eax,%eax
  jle    L47
  movzbl 0xf(%rsp),%r9d
  movzbl 0xe(%rsp),%r10d
  mov    %eax,%esi
  xor    %edi,%edi
  xor    %r8d,%r8d
  xor    %r11d,%r11d
  nopw   0x0(%rax,%rax,1)
L36:
  mov    %edi,%eax
  cltd
  idiv   %esi
  add    %ebx,%eax
  mov    %eax,%ecx
  js     L51
  cmp    %r15d,%eax
  jae    L51
  mov    %r8d,%eax
  cltd
  idiv   %esi
  add    %ebp,%eax
  js     L51
  cmp    0x68(%rsp),%eax
  jae    L51
  imul   %r15d,%eax
  movzbl 0xd(%rsp),%edx
  add    %ecx,%eax
  lea    (%rax,%rax,2),%eax
  cltq
  mov    %dl,(%r14,%rax,1)
  mov    %r9b,0x1(%r14,%rax,1)
  mov    %r10b,0x2(%r14,%rax,1)
L51:
  add    $0x1,%r11d
  add    %r12d,%edi
  add    %r13d,%r8d
  cmp    %r11d,%esi
  jne    L36
L47:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void graph_line(int start_x, int start_y, int end_x, int end_y, unsigned char r, unsigned char g, unsigned char b, unsigned char *img, unsigned int img_width, unsigned int img_height) {
  int dx = end_x - start_x;
  int dy = end_y - start_y;
  int length = (int)sqrt(dx * dx + dy * dy);
  int i, x, y, n;
  for (i = 0; i < length; i++) {
    x = start_x + (dx * i / length);
    if ((x < 0) || (x >= img_width))
      continue;
    y = start_y + (dy * i / length);
    if ((y < 0) || (y >= img_height))
      continue;
    n = ((y * img_width) + x) * 3;
    img[n] = r;
    img[n + 1] = g;
    img[n + 2] = b;
  }
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<graph_line>:
  endbr64
  push   %r15
  sub    %edi,%edx
  sub    %esi,%ecx
  mov    %r8d,%r15d
  push   %r14
  mov    %ecx,%eax
  mov    %esi,%r14d
  push   %r13
  imul   %ecx,%eax
  push   %r12
  mov    %ecx,%r12d
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  mov    %edi,%ebx
  mov    %edx,%edi
  imul   %edx,%edi
  sub    $0x18,%rsp
  movzbl 0x50(%rsp),%r10d
  add    %eax,%edi
  mov    %r9b,0xf(%rsp)
  mov    0x58(%rsp),%r13
  mov    %r10b,0xe(%rsp)
  call   <sqrt@plt>
  test   %eax,%eax
  jle    L20
  cmpl   $0x1,0x60(%rsp)
  movzbl 0xe(%rsp),%r10d
  mov    %eax,%ecx
  movzbl 0xf(%rsp),%r9d
  jne    L100
  mov    0x68(%rsp),%r11d
  xor    %edi,%edi
  xor    %esi,%esi
  xor    %r8d,%r8d
  xchg   %ax,%ax
L19:
  mov    %esi,%eax
  cltd
  idiv   %ecx
  add    %ebx,%eax
  jne    L103
  mov    %edi,%eax
  cltd
  idiv   %ecx
  add    %r14d,%eax
  cmp    %eax,%r11d
  jbe    L103
  test   %eax,%eax
  js     L103
  lea    (%rax,%rax,2),%eax
  cltq
  mov    %r15b,0x0(%r13,%rax,1)
  mov    %r9b,0x1(%r13,%rax,1)
  mov    %r10b,0x2(%r13,%rax,1)
L103:
  add    $0x1,%r8d
  add    %ebp,%esi
  add    %r12d,%edi
  cmp    %r8d,%ecx
  jne    L19
L20:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L100:
  mov    %r15b,0xe(%rsp)
  mov    0x60(%rsp),%r15d
  xor    %r8d,%r8d
  xor    %edi,%edi
  xor    %r11d,%r11d
  nopw   0x0(%rax,%rax,1)
L12:
  mov    %edi,%eax
  cltd
  idiv   %ecx
  add    %ebx,%eax
  mov    %eax,%esi
  js     L46
  cmp    %r15d,%eax
  jae    L46
  mov    %r8d,%eax
  cltd
  idiv   %ecx
  add    %r14d,%eax
  js     L46
  cmp    0x68(%rsp),%eax
  jae    L46
  imul   %r15d,%eax
  movzbl 0xe(%rsp),%edx
  add    %esi,%eax
  lea    (%rax,%rax,2),%eax
  cltq
  mov    %dl,0x0(%r13,%rax,1)
  mov    %r9b,0x1(%r13,%rax,1)
  mov    %r10b,0x2(%r13,%rax,1)
L46:
  add    $0x1,%r11d
  add    %ebp,%edi
  add    %r12d,%r8d
  cmp    %r11d,%ecx
  jne    L12
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void graph_line(int start_x, int start_y, int end_x, int end_y, unsigned char r, unsigned char g, unsigned char b, unsigned char *img, unsigned int img_width, unsigned int img_height) {
  int dx = end_x - start_x;
  int dy = end_y - start_y;
  int length = (int)sqrt(dx * dx + dy * dy);
  int i, x, y, n;
  for (i = 0; i < length; i++) {
    x = start_x + (dx * i / length);
    if ((x < 0) || (x >= img_width))
      continue;
    y = start_y + (dy * i / length);
    if ((y < 0) || (y >= img_height))
      continue;
    n = ((y * img_width) + x) * 3;
    img[n] = r;
    img[n + 1] = g;
    img[n + 2] = b;
  }
}
```