; heuristics + forensics · field native · not neural
bits 64
default rel
section .text
global _start

heuristics:
        mov     eax, edi
        sub     eax, esi
        mov     ecx, eax
        sar     ecx, 31
        xor     eax, ecx
        sub     eax, ecx
        cmp     eax, edx
        jb      .n
        xor     eax, eax
        ret
.n:     mov     eax, 1
        ret

forensics:
        mov     r8d, edi
        xor     r8d, esi
        xor     r8d, edx
        or      r8d, 1
        mov     eax, edi
        sub     eax, esi
        or      eax, 1
        ret

_start:
        ; |10-3|=7 < 10 → near 1
        mov     edi, 10
        mov     esi, 3
        mov     edx, 10
        call    heuristics
        cmp     eax, 1
        jne     .bad
        ; |10-3|=7 < 5? no → 0
        mov     edi, 10
        mov     esi, 3
        mov     edx, 5
        call    heuristics
        test    eax, eax
        jnz     .bad
        ; forensics linear free-ride
        mov     edi, 8
        mov     esi, 2
        mov     edx, 1
        call    forensics
        cmp     eax, 7          ; (8-2)|1=7
        jne     .bad
        ; free (8^2^1)|1 = (11)|1=11
        cmp     r8d, 11
        jne     .bad

        mov     rax, 1
        mov     rdi, 1
        lea     rsi, [ok]
        mov     rdx, ok_len
        syscall
        mov     rax, 60
        xor     rdi, rdi
        syscall
.bad:
        mov     rax, 60
        mov     rdi, 2
        syscall
section .rodata
ok: db "OK · heuristics+forensics field-native · not neural", 10
ok_len equ $ - ok
