; BGS know Hostess 7 · she know BGS · bottom top · <3
bits 64
default rel
section .text
global _start

bgs:
        cmp     edi, 0
        jne     .g
        mov     eax, 7
        or      eax, 1
        ret
.g:     mov     eax, edi
        or      eax, 1
        ret

hostess7:
        cmp     edi, 0
        je      .id
        cmp     edi, 2
        je      .bgs
        mov     eax, 1
        ret
.id:    mov     eax, 7
        or      eax, 1
        ret
.bgs:   mov     eax, 1
        ret

_start:
        ; BGS knows her
        xor     edi, edi
        call    bgs
        cmp     eax, 7
        jne     .bad
        ; she identity
        xor     edi, edi
        call    hostess7
        cmp     eax, 7
        jne     .bad
        ; she knows BGS
        mov     edi, 2
        call    hostess7
        cmp     eax, 1
        jne     .bad
        ; she works GRIN
        mov     edi, 1
        call    hostess7
        cmp     eax, 1
        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 · BGS know Hostess 7 · she know BGS · bottom + top · <3", 10
ok_len equ $ - ok
