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

```asm
<place_macromodule>:
  endbr64
  lea    (%rsi,%rsi,2),%eax
  mov    %edx,%r10d
  mov    %ecx,%edx
  lea    0x1(%rax,%rax,1),%ecx
  lea    (%r10,%r10,2),%eax
  add    %eax,%eax
  lea    0x1(%rax),%esi
  test   $0x40,%r8b
  je     L24
  mov    %esi,%r10d
  imul   %r9d,%r10d
  add    %ecx,%r10d
  movslq %r10d,%r10
  movb   $0x31,0x2(%rdi,%r10,1)
L24:
  test   $0x20,%r8b
  je     L8
  imul   %r9d,%esi
  add    %ecx,%esi
  movslq %esi,%rsi
  movb   $0x31,0x3(%rdi,%rsi,1)
L8:
  test   $0x10,%r8b
  je     L71
  lea    0x2(%rax),%esi
  imul   %r9d,%esi
  add    %ecx,%esi
  movslq %esi,%rsi
  movb   $0x31,(%rdi,%rsi,1)
L71:
  test   $0x8,%r8b
  je     L95
  lea    0x2(%rax),%esi
  imul   %r9d,%esi
  add    %ecx,%esi
  movslq %esi,%rsi
  movb   $0x31,0x1(%rdi,%rsi,1)
L95:
  test   $0x4,%r8b
  je     L128
  lea    0x2(%rax),%esi
  imul   %r9d,%esi
  add    %ecx,%esi
  movslq %esi,%rsi
  movb   $0x31,0x2(%rdi,%rsi,1)
L128:
  test   $0x2,%r8b
  je     L49
  lea    0x2(%rax),%esi
  imul   %r9d,%esi
  add    %ecx,%esi
  movslq %esi,%rsi
  movb   $0x31,0x3(%rdi,%rsi,1)
L49:
  and    $0x1,%r8d
  je     L72
  lea    0x3(%rax),%esi
  imul   %r9d,%esi
  add    %ecx,%esi
  movslq %esi,%rsi
  movb   $0x31,(%rdi,%rsi,1)
L72:
  test   $0x40,%dl
  je     L11
  lea    0x3(%rax),%esi
  imul   %r9d,%esi
  add    %ecx,%esi
  movslq %esi,%rsi
  movb   $0x31,0x1(%rdi,%rsi,1)
L11:
  test   $0x20,%dl
  je     L111
  lea    0x3(%rax),%esi
  imul   %r9d,%esi
  add    %ecx,%esi
  movslq %esi,%rsi
  movb   $0x31,0x2(%rdi,%rsi,1)
L111:
  test   $0x10,%dl
  je     L129
  lea    0x3(%rax),%esi
  imul   %r9d,%esi
  add    %ecx,%esi
  movslq %esi,%rsi
  movb   $0x31,0x3(%rdi,%rsi,1)
L129:
  test   $0x8,%dl
  je     L33
  lea    0x4(%rax),%esi
  imul   %r9d,%esi
  add    %ecx,%esi
  movslq %esi,%rsi
  movb   $0x31,(%rdi,%rsi,1)
L33:
  test   $0x4,%dl
  je     L48
  lea    0x4(%rax),%esi
  imul   %r9d,%esi
  add    %ecx,%esi
  movslq %esi,%rsi
  movb   $0x31,0x1(%rdi,%rsi,1)
L48:
  test   $0x2,%dl
  je     L30
  lea    0x4(%rax),%esi
  imul   %r9d,%esi
  add    %ecx,%esi
  movslq %esi,%rsi
  movb   $0x31,0x2(%rdi,%rsi,1)
L30:
  and    $0x1,%edx
  je     L105
  add    $0x4,%eax
  imul   %r9d,%eax
  add    %ecx,%eax
  cltq
  movb   $0x31,0x3(%rdi,%rax,1)
L105:
  ret
```

assistant: ```c
void place_macromodule(char grid[], int x, int y, int word1, int word2, int size) {
  int i, j;
  i = (x * 6) + 1;
  j = (y * 6) + 1;
  if (word2 & 0x40) {
    grid[(j * size) + i + 2] = '1';
  }
  if (word2 & 0x20) {
    grid[(j * size) + i + 3] = '1';
  }
  if (word2 & 0x10) {
    grid[((j + 1) * size) + i] = '1';
  }
  if (word2 & 0x08) {
    grid[((j + 1) * size) + i + 1] = '1';
  }
  if (word2 & 0x04) {
    grid[((j + 1) * size) + i + 2] = '1';
  }
  if (word2 & 0x02) {
    grid[((j + 1) * size) + i + 3] = '1';
  }
  if (word2 & 0x01) {
    grid[((j + 2) * size) + i] = '1';
  }
  if (word1 & 0x40) {
    grid[((j + 2) * size) + i + 1] = '1';
  }
  if (word1 & 0x20) {
    grid[((j + 2) * size) + i + 2] = '1';
  }
  if (word1 & 0x10) {
    grid[((j + 2) * size) + i + 3] = '1';
  }
  if (word1 & 0x08) {
    grid[((j + 3) * size) + i] = '1';
  }
  if (word1 & 0x04) {
    grid[((j + 3) * size) + i + 1] = '1';
  }
  if (word1 & 0x02) {
    grid[((j + 3) * size) + i + 2] = '1';
  }
  if (word1 & 0x01) {
    grid[((j + 3) * size) + i + 3] = '1';
  }
}
```