user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<gln_linegraphics_draw_line_if>:
  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,-0x34(%rbp)
  mov    %r9d,-0x38(%rbp)
  mov    -0x34(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  je     L34
  mov    -0x2c(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L56
  mov    -0x2c(%rbp),%eax
  sub    -0x24(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  movl   $0x1,-0xc(%rbp)
  jmp    L95
L56:
  mov    -0x24(%rbp),%eax
  sub    -0x2c(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  movl   $0xffffffff,-0xc(%rbp)
L95:
  mov    -0x30(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L72
  mov    -0x30(%rbp),%eax
  sub    -0x28(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  movl   $0x1,-0x8(%rbp)
  jmp    L70
L72:
  mov    -0x28(%rbp),%eax
  sub    -0x30(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  movl   $0xffffffff,-0x8(%rbp)
L70:
  mov    -0x24(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x28(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x14(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jl     L67
  shll   -0x10(%rbp)
  mov    -0x10(%rbp),%eax
  sub    -0x14(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  shll   -0x14(%rbp)
  jmp    L19
L83:
  mov    -0x38(%rbp),%ecx
  mov    -0x34(%rbp),%edx
  mov    -0x18(%rbp),%esi
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edi
  call   <gln_linegraphics_plot_clip@plt>
  cmpl   $0x0,-0x4(%rbp)
  js     L42
  mov    -0x8(%rbp),%eax
  add    %eax,-0x18(%rbp)
  mov    -0x14(%rbp),%eax
  sub    %eax,-0x4(%rbp)
L42:
  mov    -0x10(%rbp),%eax
  add    %eax,-0x4(%rbp)
  mov    -0xc(%rbp),%eax
  add    %eax,-0x1c(%rbp)
L19:
  mov    -0x1c(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jne    L83
  mov    -0x38(%rbp),%ecx
  mov    -0x34(%rbp),%edx
  mov    -0x18(%rbp),%esi
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edi
  call   <gln_linegraphics_plot_clip@plt>
  jmp    L7
L67:
  shll   -0x14(%rbp)
  mov    -0x14(%rbp),%eax
  sub    -0x10(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  shll   -0x10(%rbp)
  jmp    L110
L91:
  mov    -0x38(%rbp),%ecx
  mov    -0x34(%rbp),%edx
  mov    -0x18(%rbp),%esi
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edi
  call   <gln_linegraphics_plot_clip@plt>
  cmpl   $0x0,-0x4(%rbp)
  js     L11
  mov    -0xc(%rbp),%eax
  add    %eax,-0x1c(%rbp)
  mov    -0x10(%rbp),%eax
  sub    %eax,-0x4(%rbp)
L11:
  mov    -0x14(%rbp),%eax
  add    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  add    %eax,-0x18(%rbp)
L110:
  mov    -0x18(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jne    L91
  mov    -0x38(%rbp),%ecx
  mov    -0x34(%rbp),%edx
  mov    -0x18(%rbp),%esi
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edi
  call   <gln_linegraphics_plot_clip@plt>
  jmp    L7
L34:
  nop
L7:
  leave
  ret
```

assistant: ```c
void gln_linegraphics_draw_line_if(int x1, int y1, int x2, int y2, int colour1, int colour2) {
  int x, y, dx, dy, incx, incy, balance;
  if (colour1 == colour2)
    return;
  if (x2 >= x1) {
    dx = x2 - x1;
    incx = 1;
  } else {
    dx = x1 - x2;
    incx = -1;
  }
  if (y2 >= y1) {
    dy = y2 - y1;
    incy = 1;
  } else {
    dy = y1 - y2;
    incy = -1;
  }
  x = x1;
  y = y1;
  if (dx >= dy) {
    dy <<= 1;
    balance = dy - dx;
    dx <<= 1;
    while (x != x2) {
      gln_linegraphics_plot_clip(x, y, colour1, colour2);
      if (balance >= 0) {
        y += incy;
        balance -= dx;
      }
      balance += dy;
      x += incx;
    }
    gln_linegraphics_plot_clip(x, y, colour1, colour2);
  } else {
    dx <<= 1;
    balance = dx - dy;
    dy <<= 1;
    while (y != y2) {
      gln_linegraphics_plot_clip(x, y, colour1, colour2);
      if (balance >= 0) {
        x += incx;
        balance -= dy;
      }
      balance += dx;
      y += incy;
    }
    gln_linegraphics_plot_clip(x, y, colour1, colour2);
  }
}
```