user: Converte this assembly snippet into its equivalent C code:

```asm
<draw_ellipse>:
  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    -0x2c(%rbp),%eax
  imul   %eax,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x30(%rbp),%eax
  imul   %eax,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x28(%rbp),%edx
  mov    -0x30(%rbp),%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0x34(%rbp),%edx
  mov    -0x24(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <draw_pixel@plt>
  mov    -0x28(%rbp),%eax
  sub    -0x30(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x34(%rbp),%edx
  mov    -0x24(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <draw_pixel@plt>
  movl   $0x0,-0x1c(%rbp)
  mov    -0x30(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  movl   $0x0,-0x10(%rbp)
  mov    -0x8(%rbp),%eax
  imul   -0x30(%rbp),%eax
  add    %eax,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x8(%rbp),%eax
  lea    0x3(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x2,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%eax
  imul   -0x30(%rbp),%eax
  mov    %eax,%edx
  mov    %ecx,%eax
  sub    %edx,%eax
  mov    %eax,-0x14(%rbp)
L26:
  mov    -0x10(%rbp),%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  add    %eax,-0x14(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  js     L54
  mov    -0x8(%rbp),%eax
  add    %eax,%eax
  sub    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  sub    %eax,-0x14(%rbp)
  subl   $0x1,-0x18(%rbp)
L54:
  mov    -0x4(%rbp),%eax
  add    %eax,%eax
  add    %eax,-0x10(%rbp)
  addl   $0x1,-0x1c(%rbp)
  mov    -0x10(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jge    L35
  mov    -0x28(%rbp),%eax
  sub    -0x18(%rbp),%eax
  mov    -0x24(%rbp),%ecx
  mov    -0x1c(%rbp),%edx
  add    %edx,%ecx
  mov    -0x34(%rbp),%edx
  mov    %eax,%esi
  mov    %ecx,%edi
  call   <draw_pixel@plt>
  mov    -0x28(%rbp),%eax
  sub    -0x18(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x24(%rbp),%eax
  sub    -0x1c(%rbp),%eax
  mov    -0x34(%rbp),%edx
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <draw_pixel@plt>
  mov    -0x28(%rbp),%edx
  mov    -0x18(%rbp),%eax
  lea    (%rdx,%rax,1),%esi
  mov    -0x24(%rbp),%edx
  mov    -0x1c(%rbp),%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0x34(%rbp),%eax
  mov    %eax,%edx
  mov    %ecx,%edi
  call   <draw_pixel@plt>
  mov    -0x28(%rbp),%edx
  mov    -0x18(%rbp),%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0x24(%rbp),%eax
  sub    -0x1c(%rbp),%eax
  mov    -0x34(%rbp),%edx
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <draw_pixel@plt>
  jmp    L26
L35:
  nop
  mov    -0x24(%rbp),%edx
  mov    -0x2c(%rbp),%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0x34(%rbp),%edx
  mov    -0x28(%rbp),%eax
  mov    %eax,%esi
  mov    %ecx,%edi
  call   <draw_pixel@plt>
  mov    -0x24(%rbp),%eax
  sub    -0x2c(%rbp),%eax
  mov    -0x34(%rbp),%edx
  mov    -0x28(%rbp),%ecx
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <draw_pixel@plt>
  mov    -0x2c(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
  movl   $0x0,-0x18(%rbp)
  mov    -0x4(%rbp),%eax
  imul   -0x2c(%rbp),%eax
  add    %eax,%eax
  mov    %eax,-0x10(%rbp)
  movl   $0x0,-0xc(%rbp)
  mov    -0x4(%rbp),%eax
  lea    0x3(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x2,%eax
  mov    %eax,%ecx
  mov    -0x4(%rbp),%eax
  imul   -0x2c(%rbp),%eax
  mov    %eax,%edx
  mov    %ecx,%eax
  sub    %edx,%eax
  mov    %eax,-0x14(%rbp)
L17:
  mov    -0xc(%rbp),%edx
  mov    -0x8(%rbp),%eax
  add    %edx,%eax
  add    %eax,-0x14(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  js     L15
  mov    -0x4(%rbp),%eax
  add    %eax,%eax
  sub    %eax,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  sub    %eax,-0x14(%rbp)
  subl   $0x1,-0x1c(%rbp)
L15:
  mov    -0x8(%rbp),%eax
  add    %eax,%eax
  add    %eax,-0xc(%rbp)
  addl   $0x1,-0x18(%rbp)
  mov    -0xc(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jg     L0
  mov    -0x28(%rbp),%eax
  sub    -0x18(%rbp),%eax
  mov    -0x24(%rbp),%ecx
  mov    -0x1c(%rbp),%edx
  add    %edx,%ecx
  mov    -0x34(%rbp),%edx
  mov    %eax,%esi
  mov    %ecx,%edi
  call   <draw_pixel@plt>
  mov    -0x28(%rbp),%eax
  sub    -0x18(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x24(%rbp),%eax
  sub    -0x1c(%rbp),%eax
  mov    -0x34(%rbp),%edx
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <draw_pixel@plt>
  mov    -0x28(%rbp),%edx
  mov    -0x18(%rbp),%eax
  lea    (%rdx,%rax,1),%esi
  mov    -0x24(%rbp),%edx
  mov    -0x1c(%rbp),%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0x34(%rbp),%eax
  mov    %eax,%edx
  mov    %ecx,%edi
  call   <draw_pixel@plt>
  mov    -0x28(%rbp),%edx
  mov    -0x18(%rbp),%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0x24(%rbp),%eax
  sub    -0x1c(%rbp),%eax
  mov    -0x34(%rbp),%edx
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <draw_pixel@plt>
  jmp    L17
L0:
  nop
  nop
  leave
  ret
```

assistant: ```c
void draw_ellipse(int x, int y, int a, int b, int color) {
  int wx, wy;
  int thresh;
  int asq = a * a;
  int bsq = b * b;
  int xa, ya;
  draw_pixel(x, y + b, color);
  draw_pixel(x, y - b, color);
  wx = 0;
  wy = b;
  xa = 0;
  ya = asq * 2 * b;
  thresh = asq / 4 - asq * b;
  for (;;) {
    thresh += xa + bsq;
    if (thresh >= 0) {
      ya -= asq * 2;
      thresh -= ya;
      wy--;
    }
    xa += bsq * 2;
    wx++;
    if (xa >= ya)
      break;
    draw_pixel(x + wx, y - wy, color);
    draw_pixel(x - wx, y - wy, color);
    draw_pixel(x + wx, y + wy, color);
    draw_pixel(x - wx, y + wy, color);
  }
  draw_pixel(x + a, y, color);
  draw_pixel(x - a, y, color);
  wx = a;
  wy = 0;
  xa = bsq * 2 * a;
  ya = 0;
  thresh = bsq / 4 - bsq * a;
  for (;;) {
    thresh += ya + asq;
    if (thresh >= 0) {
      xa -= bsq * 2;
      thresh = thresh - xa;
      wx--;
    }
    ya += asq * 2;
    wy++;
    if (ya > xa)
      break;
    draw_pixel(x + wx, y - wy, color);
    draw_pixel(x - wx, y - wy, color);
    draw_pixel(x + wx, y + wy, color);
    draw_pixel(x - wx, y + wy, color);
  }
}
```