user: Please show me the C implementation that matches the assembly code listed below:

```asm
<draw>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x38,%rsp
  mov    %esi,-0x54(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  lea    (%rdi,%rdi,1),%ebx
  lea    0x1(%rbx),%r9d
  movslq %r9d,%rax
  mov    %rax,%rsi
  mov    %rax,-0x48(%rbp)
  movslq %ebx,%rax
  imul   %rsi,%rax
  add    $0xf,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L166:
  cmp    %rdx,%rsp
  je     L235
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L166
L235:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L333
  orq    $0x0,-0x8(%rsp,%rax,1)
L333:
  mov    %rsp,%r15
  mov    $0x0,%esi
  mov    $0x0,%ecx
  mov    $0x0,%r8d
  mov    -0x48(%rbp),%r10
  test   %ebx,%ebx
  jle    L98
L32:
  mov    $0x0,%edx
  mov    %r8d,%eax
  movslq %ecx,%rcx
  imul   %r10,%rcx
L185:
  cltq
  add    %r15,%rax
  movb   $0x20,(%rax,%rcx,1)
  add    $0x1,%edx
  movsbl %dl,%eax
  cmp    %eax,%ebx
  jge    L185
  add    $0x1,%esi
  movsbl %sil,%ecx
  cmp    %ecx,%ebx
  jg     L32
  mov    %r9d,%eax
  shr    $0x1f,%eax
  add    %r9d,%eax
  sar    %eax
  mov    %eax,%r14d
  mov    $0x0,%r8d
  mov    $0x0,%esi
  movslq %ebx,%rax
  add    %r15,%rax
  mov    %rax,-0x50(%rbp)
  lea    -0x1(%rbx),%r12d
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%r13
  mov    %edi,-0x58(%rbp)
  jmp    L241
L188:
  test   $0x1,%dl
  jne    L212
  cmp    %eax,%ebx
  jne    L132
L212:
  cltq
  add    %r15,%rax
  movb   $0x2a,(%rax,%rcx,1)
L46:
  add    $0x1,%edx
  movsbl %dl,%eax
  cmp    %eax,%ebx
  jl     L50
L41:
  movb   $0x2a,(%r15,%rcx,1)
  movb   $0x2a,(%rdi)
  test   %r8b,%r8b
  je     L188
  cmp    %esi,%r12d
  je     L188
  cmp    %esi,%r14d
  jle    L311
  lea    0x1(%rsi),%eax
  cltq
  add    %r15,%rax
  movb   $0x2a,(%rax,%rcx,1)
  movb   $0x2a,(%r9)
  jmp    L46
L132:
  cltq
  add    %r15,%rax
  movb   $0x20,(%rax,%rcx,1)
  jmp    L46
L311:
  movb   $0x2a,(%r15,%r10,1)
  movslq %r11d,%rax
  add    %r15,%rax
  movb   $0x2a,(%rax,%rcx,1)
  jmp    L46
L50:
  add    $0x1,%r8d
  movsbl %r8b,%esi
  cmp    %esi,%ebx
  jle    L16
L241:
  mov    $0x0,%edx
  mov    $0x0,%eax
  movslq %esi,%r10
  mov    -0x48(%rbp),%rcx
  imul   %r10,%rcx
  mov    -0x50(%rbp),%rdi
  add    %rcx,%rdi
  imul   %r13,%r10
  mov    %ebx,%r11d
  sub    %esi,%r11d
  mov    %r12d,%r9d
  sub    %esi,%r9d
  movslq %r9d,%r9
  add    %r15,%r9
  add    %rcx,%r9
  jmp    L41
L182:
  add    $0x1,%r12d
L341:
  add    $0x1,%eax
  movsbl %al,%edx
  cmp    %edx,%ebx
  jl     L195
L136:
  test   %sil,%sil
  je     L341
  cmp    %ecx,%edi
  je     L341
  cmp    %ecx,%r9d
  je     L341
  cmp    %ecx,%r11d
  je     L341
  cmp    %ecx,%edi
  jle    L348
  cmp    %ecx,-0x54(%rbp)
  jl     L123
L348:
  cmp    %ecx,%r14d
  jg     L341
L123:
  movslq %edx,%r10
  add    -0x50(%rbp),%r10
  movzbl (%r10,%r8,1),%r10d
  cmp    $0x2a,%r10b
  je     L182
  cmp    $0x20,%r10b
  jne    L341
  cmp    $0x2,%r12d
  jne    L341
  movslq %edx,%rdx
  add    -0x50(%rbp),%rdx
  movb   $0x2e,(%rdx,%r8,1)
  jmp    L341
L195:
  add    $0x1,%esi
  movsbl %sil,%ecx
  cmp    %ecx,%ebx
  jle    L111
L242:
  mov    $0x0,%r12d
  mov    $0x0,%eax
  mov    %r13d,%edx
  movslq %ecx,%r8
  imul   %r15,%r8
  jmp    L136
L16:
  mov    -0x58(%rbp),%edi
  mov    $0x0,%esi
  mov    $0x0,%ecx
  mov    $0x0,%r13d
  lea    -0x1(%rbx),%r9d
  lea    -0x1(%rdi),%r11d
  mov    %r9d,%r14d
  sub    -0x54(%rbp),%r14d
  mov    %r15,-0x50(%rbp)
  mov    -0x48(%rbp),%r15
  jmp    L242
L111:
  mov    -0x50(%rbp),%r15
  mov    $0x0,%r14d
  mov    $0x0,%r13d
L238:
  mov    $0x0,%r12d
  mov    $0x0,%eax
  movslq %r13d,%r13
  imul   -0x48(%rbp),%r13
L231:
  cltq
  add    %r15,%rax
  movsbl (%rax,%r13,1),%edi
  call   <putchar@plt>
  add    $0x1,%r12d
  movsbl %r12b,%eax
  cmp    %eax,%ebx
  jge    L231
  mov    $0xa,%edi
  call   <putchar@plt>
  add    $0x1,%r14d
  movsbl %r14b,%r13d
  cmp    %r13d,%ebx
  jg     L238
L98:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L75
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L75:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void draw(int size, int sand) {
  char a[(size * 2)][((size * 2) + 1)], i, j;
  int flag = 0;
  for (i = 0; i < (size * 2); i++) {
    for (j = 0; j < ((size * 2) + 1); j++) {
      a[i][j] = ' ';
    }
  }
  for (i = 0; i < (size * 2); i++) {
    for (j = 0; j < ((size * 2) + 1); j++) {
      a[i][0] = '*';
      a[i][((size * 2) + 1) - 1] = '*';
      if ((i == 0) || (i == (size * 2) - 1)) {
        if (((j % 2) == 0) && (j != ((size * 2) + 1) - 1)) {
          a[i][j] = ' ';
        } else {
          a[i][j] = '*';
        }
      } else {
        if (i < ((size * 2) + 1) / 2) {
          a[i][i + 1] = '*';
          a[i][(((size * 2) + 1) - 2) - i] = '*';
        } else {
          a[i][i] = '*';
          a[i][(((size * 2) + 1) - 2) - (i - 1)] = '*';
        }
      }
    }
  }
  for (i = 0; i < (size * 2); i++) {
    flag = 0;
    for (j = 0; j < ((size * 2) + 1); j++) {
      if ((i != 0) && (i != ((size * 2) - 1)) && (i != ((size * 2) / 2)) && (i != ((size * 2) / 2) - 1)) {
        if (((!(i <= sand)) && (i < (size * 2) / 2)) || (i >= ((size * 2) - 1) - sand)) {
          if (a[i][j] == '*') {
            flag++;
          }
          if ((flag == 2) && (a[i][j] != '*') && (a[i][j] == ' ')) {
            a[i][j] = '.';
          }
        }
      }
    }
  }
  for (i = 0; i < (size * 2); i++) {
    for (j = 0; j < ((size * 2) + 1); j++) {
      printf("%c", a[i][j]);
    }
    printf("\n");
  }
}
```