user: Translate the below assembly code into C programming language:

```asm
<fun>:
  endbr64
  push   %r12
  mov    %edi,%esi
  sub    $0x40,%rsp
  cmp    $0xffffffff,%edi
  je     L40
  lea    0x1(%rdi),%ecx
  cmp    $0x2,%edi
  jbe    L169
  movd   %edi,%xmm7
  mov    %ecx,%edx
  xor    %eax,%eax
  movdqa D26(%rip),%xmm10
  pshufd $0x0,%xmm7,%xmm13
  pxor   %xmm7,%xmm7
  shr    $0x2,%edx
  movdqa D20(%rip),%xmm9
  movdqa %xmm7,%xmm5
  movdqa %xmm7,%xmm15
  movdqa D40(%rip),%xmm8
  paddd  D30(%rip),%xmm13
  pcmpgtd %xmm10,%xmm5
  movaps %xmm5,0x20(%rsp)
  movdqa %xmm7,%xmm5
  pcmpgtd %xmm9,%xmm5
  movaps %xmm5,(%rsp)
  movdqa %xmm7,%xmm5
  pcmpgtd %xmm8,%xmm5
  movaps %xmm5,0x30(%rsp)
  nopl   0x0(%rax,%rax,1)
L12:
  movdqa %xmm13,%xmm1
  movdqa %xmm15,%xmm5
  movdqa 0x20(%rsp),%xmm11
  add    $0x1,%eax
  movdqa %xmm1,%xmm0
  movdqa %xmm1,%xmm14
  paddd  D45(%rip),%xmm13
  punpckldq %xmm1,%xmm0
  movdqa %xmm11,%xmm4
  movdqa %xmm11,%xmm12
  pcmpgtd %xmm0,%xmm5
  pmuludq %xmm0,%xmm4
  movdqa %xmm0,%xmm3
  pmuludq %xmm10,%xmm3
  psrad  $0x1f,%xmm14
  movdqa %xmm5,%xmm2
  pmuludq %xmm10,%xmm2
  paddq  %xmm4,%xmm2
  movdqa %xmm15,%xmm4
  psllq  $0x20,%xmm2
  paddq  %xmm2,%xmm3
  movdqa %xmm1,%xmm2
  punpckhdq %xmm1,%xmm2
  pcmpgtd %xmm2,%xmm4
  pmuludq %xmm2,%xmm12
  movdqa %xmm2,%xmm11
  pmuludq %xmm10,%xmm11
  movdqa %xmm4,%xmm6
  pmuludq %xmm10,%xmm6
  paddq  %xmm12,%xmm6
  movdqa (%rsp),%xmm12
  psllq  $0x20,%xmm6
  paddq  %xmm11,%xmm6
  pmuludq %xmm0,%xmm12
  movdqa %xmm1,%xmm11
  shufps $0xdd,%xmm6,%xmm3
  psrad  $0x1,%xmm3
  psubd  %xmm14,%xmm3
  movdqa %xmm3,%xmm6
  pslld  $0x2,%xmm6
  paddd  %xmm6,%xmm3
  movdqa %xmm5,%xmm6
  pmuludq %xmm9,%xmm6
  pmuludq %xmm8,%xmm5
  psubd  %xmm3,%xmm11
  pcmpeqd D0(%rip),%xmm11
  movdqa %xmm0,%xmm3
  pmuludq %xmm9,%xmm3
  paddq  %xmm12,%xmm6
  movdqa (%rsp),%xmm12
  psllq  $0x20,%xmm6
  pmuludq %xmm2,%xmm12
  paddq  %xmm6,%xmm3
  movdqa %xmm4,%xmm6
  pmuludq %xmm9,%xmm6
  pmuludq %xmm8,%xmm4
  movaps %xmm12,0x10(%rsp)
  movdqa %xmm2,%xmm12
  paddq  0x10(%rsp),%xmm6
  pmuludq %xmm9,%xmm12
  psllq  $0x20,%xmm6
  paddq  %xmm12,%xmm6
  shufps $0xdd,%xmm6,%xmm3
  psubd  %xmm14,%xmm3
  movdqa %xmm3,%xmm6
  pslld  $0x1,%xmm6
  paddd  %xmm6,%xmm3
  movdqa %xmm1,%xmm6
  psubd  %xmm3,%xmm6
  pcmpeqd D16(%rip),%xmm6
  pand   %xmm11,%xmm6
  movdqa 0x30(%rsp),%xmm11
  movdqa %xmm11,%xmm3
  pmuludq %xmm0,%xmm3
  pmuludq %xmm8,%xmm0
  paddq  %xmm3,%xmm5
  movdqa %xmm11,%xmm3
  pmuludq %xmm2,%xmm3
  pmuludq %xmm8,%xmm2
  psllq  $0x20,%xmm5
  paddq  %xmm5,%xmm0
  paddq  %xmm3,%xmm4
  psllq  $0x20,%xmm4
  paddq  %xmm4,%xmm2
  shufps $0xdd,%xmm2,%xmm0
  paddd  %xmm1,%xmm0
  psrad  $0x2,%xmm0
  psubd  %xmm14,%xmm0
  movdqa %xmm0,%xmm2
  pslld  $0x3,%xmm2
  psubd  %xmm0,%xmm2
  psubd  %xmm2,%xmm1
  pcmpeqd D16(%rip),%xmm1
  pand   %xmm1,%xmm6
  psubd  %xmm6,%xmm7
  cmp    %eax,%edx
  jne    L12
  movdqa %xmm7,%xmm0
  mov    %ecx,%edx
  mov    %esi,%eax
  psrldq $0x8,%xmm0
  and    $0xfffffffc,%edx
  paddd  %xmm0,%xmm7
  sub    %edx,%eax
  movdqa %xmm7,%xmm0
  psrldq $0x4,%xmm0
  paddd  %xmm0,%xmm7
  movd   %xmm7,%r12d
  cmp    %edx,%ecx
  je     L69
L123:
  movslq %eax,%rcx
  mov    %eax,%edi
  imul   $0x55555556,%rcx,%rdx
  sar    $0x1f,%edi
  shr    $0x20,%rdx
  sub    %edi,%edx
  lea    (%rdx,%rdx,2),%r8d
  mov    %eax,%edx
  sub    %r8d,%edx
  cmp    $0x2,%edx
  je     L74
L148:
  lea    -0x1(%rax),%ecx
  test   %eax,%eax
  je     L69
  movslq %ecx,%rdi
  mov    %ecx,%r8d
  imul   $0x55555556,%rdi,%rdx
  sar    $0x1f,%r8d
  shr    $0x20,%rdx
  sub    %r8d,%edx
  lea    (%rdx,%rdx,2),%r9d
  mov    %ecx,%edx
  sub    %r9d,%edx
  cmp    $0x2,%edx
  je     L160
L57:
  sub    $0x2,%eax
  test   %ecx,%ecx
  je     L69
  movslq %eax,%rcx
  mov    %eax,%edi
  imul   $0x55555556,%rcx,%rdx
  sar    $0x1f,%edi
  shr    $0x20,%rdx
  sub    %edi,%edx
  lea    (%rdx,%rdx,2),%r8d
  mov    %eax,%edx
  sub    %r8d,%edx
  cmp    $0x2,%edx
  je     L101
L69:
  mov    %r12d,%edx
  lea    D42(%rip),%rdi
  call   <printf@plt>
  add    $0x40,%rsp
  mov    %r12d,%eax
  pop    %r12
  ret
  xchg   %ax,%ax
L74:
  imul   $0x66666667,%rcx,%rdx
  sar    $0x21,%rdx
  sub    %edi,%edx
  lea    (%rdx,%rdx,4),%r8d
  mov    %eax,%edx
  sub    %r8d,%edx
  cmp    $0x3,%edx
  jne    L148
  imul   $0xffffffff92492493,%rcx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x2,%edx
  sub    %edi,%edx
  lea    0x0(,%rdx,8),%ecx
  sub    %edx,%ecx
  mov    %eax,%edx
  sub    %ecx,%edx
  cmp    $0x2,%edx
  sete   %dl
  movzbl %dl,%edx
  add    %edx,%r12d
  jmp    L148
  nop
L160:
  imul   $0x66666667,%rdi,%rdx
  sar    $0x21,%rdx
  sub    %r8d,%edx
  lea    (%rdx,%rdx,4),%r9d
  mov    %ecx,%edx
  sub    %r9d,%edx
  cmp    $0x3,%edx
  jne    L57
  imul   $0xffffffff92492493,%rdi,%rdx
  shr    $0x20,%rdx
  add    %ecx,%edx
  sar    $0x2,%edx
  sub    %r8d,%edx
  lea    0x0(,%rdx,8),%edi
  sub    %edx,%edi
  mov    %ecx,%edx
  sub    %edi,%edx
  cmp    $0x2,%edx
  sete   %dl
  movzbl %dl,%edx
  add    %edx,%r12d
  jmp    L57
  nopl   0x0(%rax)
L101:
  imul   $0x66666667,%rcx,%rdx
  sar    $0x21,%rdx
  sub    %edi,%edx
  lea    (%rdx,%rdx,4),%r8d
  mov    %eax,%edx
  sub    %r8d,%edx
  cmp    $0x3,%edx
  jne    L69
  imul   $0xffffffff92492493,%rcx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x2,%edx
  sub    %edi,%edx
  lea    0x0(,%rdx,8),%ecx
  sub    %edx,%ecx
  sub    %ecx,%eax
  cmp    $0x2,%eax
  sete   %al
  movzbl %al,%eax
  add    %eax,%r12d
  jmp    L69
  nopl   (%rax)
L40:
  xor    %r12d,%r12d
  jmp    L69
L169:
  mov    %edi,%eax
  xor    %r12d,%r12d
  jmp    L123
```

tool_calls: name: unpack_data
arguments: data_label: D26
type: byte[16]
name: unpack_data
arguments: data_label: D20
type: byte[16]
name: unpack_data
arguments: data_label: D40
type: byte[16]
name: unpack_data
arguments: data_label: D30
type: byte[16]
name: unpack_data
arguments: data_label: D45
type: byte[16]
name: unpack_data
arguments: data_label: D0
type: byte[16]
name: unpack_data
arguments: data_label: D16
type: byte[16]
name: unpack_data
arguments: data_label: D42
type: string

tool: {"D26": [0x67,0x66,0x66,0x66,0x67,0x66,0x66,0x66,0x67,0x66,0x66,0x66,0x67,0x66,0x66,0x66]}

tool: {"D20": [0x56,0x55,0x55,0x55,0x56,0x55,0x55,0x55,0x56,0x55,0x55,0x55,0x56,0x55,0x55,0x55]}

tool: {"D40": [0x93,0x24,0x49,0x92,0x93,0x24,0x49,0x92,0x93,0x24,0x49,0x92,0x93,0x24,0x49,0x92]}

tool: {"D30": [0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xfd,0xff,0xff,0xff]}

tool: {"D45": [0xfc,0xff,0xff,0xff,0xfc,0xff,0xff,0xff,0xfc,0xff,0xff,0xff,0xfc,0xff,0xff,0xff]}

tool: {"D0": [0x03,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x03,0x00,0x00,0x00]}

tool: {"D16": [0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x00]}

tool: D42: [%i, %i]


assistant: ```c
int fun(int n) {
  int j = 0, i = n + 1;
  while (i--) {
    if (i % 3 == 2 && i % 5 == 3 && i % 7 == 2)
      ++j;
  }
  printf("[%i, %i]\n", n, j);
  return j;
}
```