// Code generated by command: go run asm.go -out metro_amd64.s -stubs metro_stub.go -pkg metro. DO NOT EDIT.

//go:build amd64 && gc && !purego && !noasm

#include "textflag.h"

// func Hash64(buffer []byte, seed uint64) uint64
TEXT ·Hash64(SB), NOSPLIT, $0-40
	MOVQ  seed+24(FP), AX
	MOVQ  buffer_base+0(FP), CX
	MOVQ  buffer_len+8(FP), DX
	MOVQ  $0xd6d018f5, BX
	IMULQ BX, AX
	MOVQ  $0x52bc33fedbe4cbb5, BX
	ADDQ  BX, AX
	CMPQ  DX, $0x20
	JLT   after32
	MOVQ  AX, BX
	MOVQ  AX, SI
	MOVQ  AX, DI
	MOVQ  AX, R8

loop:
	MOVQ  (CX), R9
	MOVQ  $0xd6d018f5, R10
	IMULQ R10, R9
	ADDQ  R9, BX
	RORQ  $0x1d, BX
	ADDQ  DI, BX
	MOVQ  8(CX), R9
	MOVQ  $0xa2aa033b, R10
	IMULQ R10, R9
	ADDQ  R9, SI
	RORQ  $0x1d, SI
	ADDQ  R8, SI
	MOVQ  16(CX), R9
	MOVQ  $0x62992fc1, R10
	IMULQ R10, R9
	ADDQ  R9, DI
	RORQ  $0x1d, DI
	ADDQ  BX, DI
	MOVQ  24(CX), R9
	MOVQ  $0x30bc5b29, R10
	IMULQ R10, R9
	ADDQ  R9, R8
	RORQ  $0x1d, R8
	ADDQ  SI, R8
	ADDQ  $0x20, CX
	SUBQ  $0x20, DX
	CMPQ  DX, $0x20
	JGE   loop
	MOVQ  BX, R9
	ADDQ  R8, R9
	MOVQ  $0xd6d018f5, R10
	IMULQ R10, R9
	ADDQ  SI, R9
	RORQ  $0x25, R9
	MOVQ  $0xa2aa033b, R10
	IMULQ R10, R9
	XORQ  R9, DI
	MOVQ  SI, R9
	ADDQ  DI, R9
	MOVQ  $0xa2aa033b, R10
	IMULQ R10, R9
	ADDQ  BX, R9
	RORQ  $0x25, R9
	MOVQ  $0xd6d018f5, R10
	IMULQ R10, R9
	XORQ  R9, R8
	MOVQ  BX, R9
	ADDQ  DI, R9
	MOVQ  $0xd6d018f5, R10
	IMULQ R10, R9
	ADDQ  R8, R9
	RORQ  $0x25, R9
	MOVQ  $0xa2aa033b, R10
	IMULQ R10, R9
	XORQ  R9, BX
	MOVQ  SI, R9
	ADDQ  R8, R9
	MOVQ  $0xa2aa033b, R8
	IMULQ R8, R9
	ADDQ  DI, R9
	RORQ  $0x25, R9
	MOVQ  $0xd6d018f5, DI
	IMULQ DI, R9
	XORQ  R9, SI
	XORQ  SI, BX
	ADDQ  BX, AX

after32:
	CMPQ  DX, $0x10
	JLT   after16
	MOVQ  (CX), BX
	MOVQ  $0x62992fc1, SI
	IMULQ SI, BX
	ADDQ  AX, BX
	ADDQ  $0x08, CX
	SUBQ  $0x08, DX
	RORQ  $0x1d, BX
	MOVQ  $0x30bc5b29, SI
	IMULQ SI, BX
	MOVQ  (CX), SI
	MOVQ  $0x62992fc1, DI
	IMULQ DI, SI
	ADDQ  AX, SI
	ADDQ  $0x08, CX
	SUBQ  $0x08, DX
	RORQ  $0x1d, SI
	MOVQ  $0x30bc5b29, DI
	IMULQ DI, SI
	MOVQ  BX, DI
	MOVQ  $0xd6d018f5, R8
	IMULQ R8, DI
	RORQ  $0x15, DI
	ADDQ  SI, DI
	XORQ  DI, BX
	MOVQ  SI, DI
	MOVQ  $0x30bc5b29, R8
	IMULQ R8, DI
	RORQ  $0x15, DI
	ADDQ  BX, DI
	XORQ  DI, SI
	ADDQ  SI, AX

after16:
	CMPQ  DX, $0x08
	JLT   after8
	MOVQ  (CX), BX
	MOVQ  $0x30bc5b29, SI
	IMULQ SI, BX
	ADDQ  BX, AX
	ADDQ  $0x08, CX
	SUBQ  $0x08, DX
	MOVQ  AX, BX
	RORQ  $0x37, BX
	MOVQ  $0xa2aa033b, SI
	IMULQ SI, BX
	XORQ  BX, AX

after8:
	CMPQ  DX, $0x04
	JLT   after4
	XORQ  BX, BX
	MOVL  (CX), BX
	MOVQ  $0x30bc5b29, SI
	IMULQ SI, BX
	ADDQ  BX, AX
	ADDQ  $0x04, CX
	SUBQ  $0x04, DX
	MOVQ  AX, BX
	RORQ  $0x1a, BX
	MOVQ  $0xa2aa033b, SI
	IMULQ SI, BX
	XORQ  BX, AX

after4:
	CMPQ  DX, $0x02
	JLT   after2
	XORQ  BX, BX
	MOVW  (CX), BX
	MOVQ  $0x30bc5b29, SI
	IMULQ SI, BX
	ADDQ  BX, AX
	ADDQ  $0x02, CX
	SUBQ  $0x02, DX
	MOVQ  AX, BX
	RORQ  $0x30, BX
	MOVQ  $0xa2aa033b, SI
	IMULQ SI, BX
	XORQ  BX, AX

after2:
	CMPQ    DX, $0x01
	JLT     after1
	MOVBQZX (CX), CX
	MOVQ    $0x30bc5b29, DX
	IMULQ   DX, CX
	ADDQ    CX, AX
	MOVQ    AX, CX
	RORQ    $0x25, CX
	MOVQ    $0xa2aa033b, DX
	IMULQ   DX, CX
	XORQ    CX, AX

after1:
	MOVQ  AX, CX
	RORQ  $0x1c, CX
	XORQ  CX, AX
	MOVQ  $0xd6d018f5, CX
	IMULQ CX, AX
	MOVQ  AX, CX
	RORQ  $0x1d, CX
	XORQ  CX, AX
	MOVQ  AX, ret+32(FP)
	RET

// func Hash64Str(buffer string, seed uint64) uint64
TEXT ·Hash64Str(SB), NOSPLIT, $0-32
	MOVQ  seed+16(FP), AX
	MOVQ  buffer_base+0(FP), CX
	MOVQ  buffer_len+8(FP), DX
	MOVQ  $0xd6d018f5, BX
	IMULQ BX, AX
	MOVQ  $0x52bc33fedbe4cbb5, BX
	ADDQ  BX, AX
	CMPQ  DX, $0x20
	JLT   after32
	MOVQ  AX, BX
	MOVQ  AX, SI
	MOVQ  AX, DI
	MOVQ  AX, R8

loop:
	MOVQ  (CX), R9
	MOVQ  $0xd6d018f5, R10
	IMULQ R10, R9
	ADDQ  R9, BX
	RORQ  $0x1d, BX
	ADDQ  DI, BX
	MOVQ  8(CX), R9
	MOVQ  $0xa2aa033b, R10
	IMULQ R10, R9
	ADDQ  R9, SI
	RORQ  $0x1d, SI
	ADDQ  R8, SI
	MOVQ  16(CX), R9
	MOVQ  $0x62992fc1, R10
	IMULQ R10, R9
	ADDQ  R9, DI
	RORQ  $0x1d, DI
	ADDQ  BX, DI
	MOVQ  24(CX), R9
	MOVQ  $0x30bc5b29, R10
	IMULQ R10, R9
	ADDQ  R9, R8
	RORQ  $0x1d, R8
	ADDQ  SI, R8
	ADDQ  $0x20, CX
	SUBQ  $0x20, DX
	CMPQ  DX, $0x20
	JGE   loop
	MOVQ  BX, R9
	ADDQ  R8, R9
	MOVQ  $0xd6d018f5, R10
	IMULQ R10, R9
	ADDQ  SI, R9
	RORQ  $0x25, R9
	MOVQ  $0xa2aa033b, R10
	IMULQ R10, R9
	XORQ  R9, DI
	MOVQ  SI, R9
	ADDQ  DI, R9
	MOVQ  $0xa2aa033b, R10
	IMULQ R10, R9
	ADDQ  BX, R9
	RORQ  $0x25, R9
	MOVQ  $0xd6d018f5, R10
	IMULQ R10, R9
	XORQ  R9, R8
	MOVQ  BX, R9
	ADDQ  DI, R9
	MOVQ  $0xd6d018f5, R10
	IMULQ R10, R9
	ADDQ  R8, R9
	RORQ  $0x25, R9
	MOVQ  $0xa2aa033b, R10
	IMULQ R10, R9
	XORQ  R9, BX
	MOVQ  SI, R9
	ADDQ  R8, R9
	MOVQ  $0xa2aa033b, R8
	IMULQ R8, R9
	ADDQ  DI, R9
	RORQ  $0x25, R9
	MOVQ  $0xd6d018f5, DI
	IMULQ DI, R9
	XORQ  R9, SI
	XORQ  SI, BX
	ADDQ  BX, AX

after32:
	CMPQ  DX, $0x10
	JLT   after16
	MOVQ  (CX), BX
	MOVQ  $0x62992fc1, SI
	IMULQ SI, BX
	ADDQ  AX, BX
	ADDQ  $0x08, CX
	SUBQ  $0x08, DX
	RORQ  $0x1d, BX
	MOVQ  $0x30bc5b29, SI
	IMULQ SI, BX
	MOVQ  (CX), SI
	MOVQ  $0x62992fc1, DI
	IMULQ DI, SI
	ADDQ  AX, SI
	ADDQ  $0x08, CX
	SUBQ  $0x08, DX
	RORQ  $0x1d, SI
	MOVQ  $0x30bc5b29, DI
	IMULQ DI, SI
	MOVQ  BX, DI
	MOVQ  $0xd6d018f5, R8
	IMULQ R8, DI
	RORQ  $0x15, DI
	ADDQ  SI, DI
	XORQ  DI, BX
	MOVQ  SI, DI
	MOVQ  $0x30bc5b29, R8
	IMULQ R8, DI
	RORQ  $0x15, DI
	ADDQ  BX, DI
	XORQ  DI, SI
	ADDQ  SI, AX

after16:
	CMPQ  DX, $0x08
	JLT   after8
	MOVQ  (CX), BX
	MOVQ  $0x30bc5b29, SI
	IMULQ SI, BX
	ADDQ  BX, AX
	ADDQ  $0x08, CX
	SUBQ  $0x08, DX
	MOVQ  AX, BX
	RORQ  $0x37, BX
	MOVQ  $0xa2aa033b, SI
	IMULQ SI, BX
	XORQ  BX, AX

after8:
	CMPQ  DX, $0x04
	JLT   after4
	XORQ  BX, BX
	MOVL  (CX), BX
	MOVQ  $0x30bc5b29, SI
	IMULQ SI, BX
	ADDQ  BX, AX
	ADDQ  $0x04, CX
	SUBQ  $0x04, DX
	MOVQ  AX, BX
	RORQ  $0x1a, BX
	MOVQ  $0xa2aa033b, SI
	IMULQ SI, BX
	XORQ  BX, AX

after4:
	CMPQ  DX, $0x02
	JLT   after2
	XORQ  BX, BX
	MOVW  (CX), BX
	MOVQ  $0x30bc5b29, SI
	IMULQ SI, BX
	ADDQ  BX, AX
	ADDQ  $0x02, CX
	SUBQ  $0x02, DX
	MOVQ  AX, BX
	RORQ  $0x30, BX
	MOVQ  $0xa2aa033b, SI
	IMULQ SI, BX
	XORQ  BX, AX

after2:
	CMPQ    DX, $0x01
	JLT     after1
	MOVBQZX (CX), CX
	MOVQ    $0x30bc5b29, DX
	IMULQ   DX, CX
	ADDQ    CX, AX
	MOVQ    AX, CX
	RORQ    $0x25, CX
	MOVQ    $0xa2aa033b, DX
	IMULQ   DX, CX
	XORQ    CX, AX

after1:
	MOVQ  AX, CX
	RORQ  $0x1c, CX
	XORQ  CX, AX
	MOVQ  $0xd6d018f5, CX
	IMULQ CX, AX
	MOVQ  AX, CX
	RORQ  $0x1d, CX
	XORQ  CX, AX
	MOVQ  AX, ret+24(FP)
	RET
