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

```asm
<main>:
  endbr64
  push   %r15
  mov    $0x32,%ecx
  push   %r14
  push   %r13
  push   %r12
  lea    D1(%rip),%r12
  push   %rbp
  push   %rbx
  sub    $0x358,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x348(%rsp)
  xor    %eax,%eax
  lea    0x20(%rsp),%rbp
  lea    0x1c(%rsp),%r14
  mov    %rbp,%rdi
  lea    0x1b0(%rsp),%rbx
  lea    0x18(%rsp),%r13
  rep stos %rax,%es:(%rdi)
  mov    $0x32,%ecx
  mov    %rbx,%rdi
  rep stos %rax,%es:(%rdi)
  nopl   0x0(%rax)
L222:
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x18(%rsp),%ecx
  test   %ecx,%ecx
  jle    L222
  mov    0x1c(%rsp),%eax
  cmp    $0x8,%eax
  jg     L222
  movl   $0x0,0x8(%rsp)
  xor    %r14d,%r14d
  lea    D3(%rip),%r12
  test   %eax,%eax
  jle    L161
  nopw   0x0(%rax,%rax,1)
L151:
  lea    0x0(%rbp,%r14,4),%r13
  xor    %r15d,%r15d
  nopl   0x0(%rax,%rax,1)
L208:
  mov    %r13,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  add    $0x1,%r15d
  call   <scanf@plt>
  mov    0x1c(%rsp),%eax
  add    $0x4,%r13
  cmp    %r15d,%eax
  jg     L208
  addl   $0x1,0x8(%rsp)
  mov    0x18(%rsp),%ecx
  mov    0x8(%rsp),%edx
  cmp    %edx,%ecx
  jle    L175
  add    $0xa,%r14
  test   %eax,%eax
  jg     L151
L161:
  mov    %eax,%r11d
  mov    %eax,%r9d
  movdqa D18(%rip),%xmm2
  xor    %edi,%edi
  mov    %rbp,%r8
  lea    -0x1(%rax),%r10d
  shr    $0x2,%r11d
  and    $0xfffffffc,%r9d
  xor    %r12d,%r12d
  pxor   %xmm3,%xmm3
  nopl   0x0(%rax)
L69:
  test   %eax,%eax
  jle    L61
  cmp    $0x2,%r10d
  jbe    L146
  movdqu (%r8),%xmm0
  pand   %xmm2,%xmm0
  pcmpeqd %xmm3,%xmm0
  pand   %xmm2,%xmm0
  cmp    $0x1,%r11d
  jbe    L206
  movdqu 0x10(%r8),%xmm1
  pand   %xmm2,%xmm1
  pcmpeqd %xmm3,%xmm1
  psubd  %xmm1,%xmm0
L206:
  movdqa %xmm0,%xmm1
  psrldq $0x8,%xmm1
  paddd  %xmm1,%xmm0
  movdqa %xmm0,%xmm1
  psrldq $0x4,%xmm1
  paddd  %xmm1,%xmm0
  movd   %xmm0,%edx
  add    %edx,%r12d
  mov    %r9d,%edx
  cmp    %eax,%r9d
  je     L61
L167:
  movslq %edi,%rsi
  movslq %edx,%r13
  lea    (%rsi,%rsi,4),%rsi
  add    %rsi,%rsi
  add    %rsi,%r13
  mov    0x20(%rsp,%r13,4),%r13d
  and    $0x1,%r13d
  cmp    $0x1,%r13d
  lea    0x1(%rdx),%r13d
  adc    $0x0,%r12d
  cmp    %r13d,%eax
  jle    L61
  movslq %r13d,%r13
  add    %rsi,%r13
  mov    0x20(%rsp,%r13,4),%r13d
  and    $0x1,%r13d
  cmp    $0x1,%r13d
  adc    $0x0,%r12d
  add    $0x2,%edx
  cmp    %edx,%eax
  jle    L61
  movslq %edx,%rdx
  add    %rdx,%rsi
  mov    0x20(%rsp,%rsi,4),%edx
  and    $0x1,%edx
  cmp    $0x1,%edx
  adc    $0x0,%r12d
L61:
  add    $0x1,%edi
  add    $0x28,%r8
  cmp    %edi,%ecx
  jne    L69
  movq   $0x0,0x8(%rsp)
  xor    %r13d,%r13d
  test   %eax,%eax
  jle    L112
  nopw   0x0(%rax,%rax,1)
L41:
  mov    0x8(%rsp),%r15
  xor    %r14d,%r14d
  nopl   0x0(%rax,%rax,1)
L164:
  mov    0x0(%rbp,%r15,1),%edi
  add    $0x1,%r14d
  call   <pretvorba@plt>
  mov    %eax,(%rbx,%r15,1)
  mov    0x1c(%rsp),%eax
  add    $0x4,%r15
  cmp    %r14d,%eax
  jg     L164
  mov    0x18(%rsp),%ecx
  add    $0x1,%r13d
  cmp    %r13d,%ecx
  jle    L32
  addq   $0x28,0x8(%rsp)
  test   %eax,%eax
  jg     L41
L112:
  mov    %rbx,%rbp
  xor    %r14d,%r14d
  lea    D3(%rip),%r13
  nopw   0x0(%rax,%rax,1)
L89:
  xor    %ebx,%ebx
  test   %eax,%eax
  jle    L3
  cs nopw 0x0(%rax,%rax,1)
L239:
  mov    0x0(%rbp,%rbx,4),%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  add    $0x1,%rbx
  call   <printf@plt>
  cmp    %ebx,0x1c(%rsp)
  jg     L239
L3:
  mov    $0xa,%edi
  add    $0x1,%r14d
  add    $0x28,%rbp
  call   <putchar@plt>
  cmp    %r14d,0x18(%rsp)
  jle    L194
  mov    0x1c(%rsp),%eax
  jmp    L89
L175:
  xor    %r12d,%r12d
  test   %ecx,%ecx
  jg     L161
  nopw   0x0(%rax,%rax,1)
L194:
  xor    %eax,%eax
  mov    %r12d,%esi
  lea    D27(%rip),%rdi
  call   <printf@plt>
  mov    0x348(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L170
  add    $0x358,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L32:
  test   %ecx,%ecx
  jg     L112
  jmp    L194
  nopw   0x0(%rax,%rax,1)
L146:
  xor    %edx,%edx
  jmp    L167
L170:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D1
type: string
name: unpack_data
arguments: data_label: D3
type: string
name: unpack_data
arguments: data_label: D18
type: byte[16]
name: unpack_data
arguments: data_label: D27
type: string

tool: D1: %d %d

tool: D3: %d 

tool: {"D18": [0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00]}

tool: D27: S 0 zavrsava %d brojeva.

assistant: ```c
int main() {
  int i, j, n, m, broj, br_nep = 0, tablica_prir[10][10] = {{0}}, tablica_bin[10][10] = {{0}};
  do {
    scanf("%d %d", &n, &m);
  } while (n < 1 || m > 8);
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      scanf("%d ", &tablica_prir[i][j]);
    }
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      if (tablica_prir[i][j] % 2 == 0) {
        br_nep++;
      }
    }
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      broj = tablica_prir[i][j];
      tablica_bin[i][j] = pretvorba(broj);
    }
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      printf("%d ", tablica_bin[i][j]);
    }
    printf("\n");
  }
  printf("S 0 zavrsava %d brojeva.", br_nep);
  return 0;
}
```