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

```asm
<main>:
  endbr64
  push   %r12
  lea    D27(%rip),%rdi
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rsi
  call   <scanf@plt>
  mov    0x4(%rsp),%r11d
  test   %r11d,%r11d
  jle    L92
  movdqa D15(%rip),%xmm6
  lea    0x1(%r11),%ebx
  xor    %r10d,%r10d
  mov    $0x1,%r9d
  mov    $0x1,%ebp
  nopl   (%rax)
L127:
  movd   %r9d,%xmm7
  lea    (%r9,%r9,1),%edi
  mov    %r9d,%edx
  pshufd $0x0,%xmm7,%xmm5
  nopl   0x0(%rax)
L35:
  cmp    %edx,%r11d
  jl     L48
  cmp    %edx,%edi
  jle    L48
  cmp    %edi,%ebx
  mov    %edi,%esi
  mov    %ebp,%r12d
  cmovle %ebx,%esi
  mov    %esi,%eax
  sub    %edx,%eax
  cmp    %esi,%edx
  cmovl  %eax,%r12d
  sub    $0x1,%eax
  cmp    $0x2,%eax
  jbe    L64
  cmp    %esi,%edx
  jge    L64
  lea    0x2(%rdx),%eax
  lea    0x1(%rdx),%r8d
  movd   %edx,%xmm3
  mov    %r12d,%ecx
  movd   %eax,%xmm0
  lea    0x3(%rdx),%eax
  shr    $0x2,%ecx
  pxor   %xmm2,%xmm2
  movd   %eax,%xmm7
  xor    %eax,%eax
  punpckldq %xmm7,%xmm0
  movd   %r8d,%xmm7
  punpckldq %xmm7,%xmm3
  movd   %edx,%xmm7
  punpcklqdq %xmm0,%xmm3
  pshufd $0x0,%xmm7,%xmm4
  nopl   (%rax)
L122:
  movdqa %xmm3,%xmm0
  add    $0x1,%eax
  paddd  %xmm6,%xmm3
  movdqa %xmm0,%xmm1
  paddd  %xmm5,%xmm0
  paddd  %xmm4,%xmm1
  pcmpgtd %xmm4,%xmm0
  pcmpgtd %xmm5,%xmm1
  pand   %xmm1,%xmm0
  psubd  %xmm0,%xmm2
  cmp    %ecx,%eax
  jne    L122
  movdqa %xmm2,%xmm0
  psrldq $0x8,%xmm0
  paddd  %xmm0,%xmm2
  movdqa %xmm2,%xmm0
  psrldq $0x4,%xmm0
  paddd  %xmm0,%xmm2
  movd   %xmm2,%eax
  add    %eax,%r10d
  mov    %r12d,%eax
  and    $0xfffffffc,%eax
  lea    (%rax,%rdx,1),%ecx
  cmp    %eax,%r12d
  je     L108
L37:
  lea    (%rdx,%rcx,1),%eax
  cmp    %eax,%r9d
  jge    L97
  lea    (%r9,%rcx,1),%eax
  cmp    %edx,%eax
  setg   %al
  movzbl %al,%eax
  add    %eax,%r10d
L97:
  lea    0x1(%rcx),%eax
  cmp    %esi,%eax
  jge    L108
  lea    (%rax,%rdx,1),%r12d
  cmp    %r12d,%r9d
  jge    L135
  add    %r9d,%eax
  cmp    %edx,%eax
  setg   %al
  movzbl %al,%eax
  add    %eax,%r10d
L135:
  lea    0x2(%rcx),%eax
  cmp    %eax,%esi
  jle    L108
  lea    (%rdx,%rax,1),%ecx
  cmp    %ecx,%r9d
  jge    L108
  add    %r9d,%eax
  cmp    %eax,%edx
  setl   %al
  movzbl %al,%eax
  add    %eax,%r10d
  nopl   0x0(%rax)
L108:
  mov    %r8d,%edx
  add    $0x1,%edi
  cmp    %r11d,%r8d
  jle    L35
  add    $0x1,%r9d
  cmp    %r9d,%ebx
  jne    L127
L79:
  mov    %r10d,%esi
  lea    D2(%rip),%rdi
  call   <printf@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L34
  add    $0x10,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  xchg   %ax,%ax
L48:
  lea    0x1(%rdx),%r8d
  jmp    L108
L64:
  mov    %edx,%ecx
  lea    0x1(%rdx),%r8d
  jmp    L37
L92:
  xor    %r10d,%r10d
  jmp    L79
L34:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D27
datatype: string
name: parse_data
arguments: label: D15
datatype: byte[16]
name: parse_data
arguments: label: D2
datatype: string

tool: D27: %d

tool: {"D15": [0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00]}

tool: D2: Number of possible triangles is %d

assistant: ```c
int main() {
  int N;
  int i, j, k;
  int count = 0;
  scanf("%d", &N);
  for (i = 1; i <= N; i++) {
    for (j = i; j <= N; j = j + 1) {
      for (k = j; k <= N; k = k + 1) {
        if (i + j > k && j + k > i && i + k > j)
          count = count + 1;
      }
    }
  }
  printf("Number of possible triangles is %d", count);
  return 0;
}
```