//+build !noasm !appengine
// AUTO-GENERATED BY C2GOASM -- DO NOT EDIT

TEXT ·_sum_int64_sse4(SB), $0-24

	MOVQ buf+0(FP), DI
	MOVQ len+8(FP), SI
	MOVQ res+16(FP), DX

	WORD $0x8548; BYTE $0xf6 // test    rsi, rsi
	JE   LBB0_1
	LONG $0x03fe8348         // cmp    rsi, 3
	JBE  LBB0_3
	WORD $0x8949; BYTE $0xf1 // mov    r9, rsi
	LONG $0xfce18349         // and    r9, -4
	JE   LBB0_3
	LONG $0xfc418d4d         // lea    r8, [r9 - 4]
	WORD $0x8944; BYTE $0xc0 // mov    eax, r8d
	WORD $0xe8c1; BYTE $0x02 // shr    eax, 2
	WORD $0xc0ff             // inc    eax
	LONG $0x03e08348         // and    rax, 3
	JE   LBB0_8
	WORD $0xf748; BYTE $0xd8 // neg    rax
	LONG $0xc0ef0f66         // pxor    xmm0, xmm0
	WORD $0xc931             // xor    ecx, ecx
	LONG $0xc9ef0f66         // pxor    xmm1, xmm1

LBB0_10:
	LONG $0x146f0ff3; BYTE $0xcf   // movdqu    xmm2, oword [rdi + 8*rcx]
	LONG $0x5c6f0ff3; WORD $0x10cf // movdqu    xmm3, oword [rdi + 8*rcx + 16]
	LONG $0xc2d40f66               // paddq    xmm0, xmm2
	LONG $0xcbd40f66               // paddq    xmm1, xmm3
	LONG $0x04c18348               // add    rcx, 4
	WORD $0xff48; BYTE $0xc0       // inc    rax
	JNE  LBB0_10
	JMP  LBB0_11

LBB0_3:
	WORD $0x3145; BYTE $0xc9 // xor    r9d, r9d
	WORD $0xc031             // xor    eax, eax

LBB0_4:
	LONG $0xcf0c8d4a         // lea    rcx, [rdi + 8*r9]
	WORD $0x294c; BYTE $0xce // sub    rsi, r9

LBB0_5:
	WORD $0x0348; BYTE $0x01 // add    rax, qword [rcx]
	LONG $0x08c18348         // add    rcx, 8
	WORD $0xff48; BYTE $0xce // dec    rsi
	JNE  LBB0_5
	JMP  LBB0_15

LBB0_1:
	WORD $0xc031 // xor    eax, eax

LBB0_15:
	WORD $0x8948; BYTE $0x02 // mov    qword [rdx], rax
	RET

LBB0_8:
	WORD $0xc931     // xor    ecx, ecx
	LONG $0xc0ef0f66 // pxor    xmm0, xmm0
	LONG $0xc9ef0f66 // pxor    xmm1, xmm1

LBB0_11:
	LONG $0x0cf88349             // cmp    r8, 12
	JB   LBB0_14
	WORD $0x894c; BYTE $0xc8     // mov    rax, r9
	WORD $0x2948; BYTE $0xc8     // sub    rax, rcx
	LONG $0xcf4c8d48; BYTE $0x70 // lea    rcx, [rdi + 8*rcx + 112]

LBB0_13:
	LONG $0x516f0ff3; BYTE $0x90 // movdqu    xmm2, oword [rcx - 112]
	LONG $0x596f0ff3; BYTE $0xa0 // movdqu    xmm3, oword [rcx - 96]
	LONG $0x616f0ff3; BYTE $0xb0 // movdqu    xmm4, oword [rcx - 80]
	LONG $0x696f0ff3; BYTE $0xc0 // movdqu    xmm5, oword [rcx - 64]
	LONG $0xd0d40f66             // paddq    xmm2, xmm0
	LONG $0xd9d40f66             // paddq    xmm3, xmm1
	LONG $0x716f0ff3; BYTE $0xd0 // movdqu    xmm6, oword [rcx - 48]
	LONG $0x796f0ff3; BYTE $0xe0 // movdqu    xmm7, oword [rcx - 32]
	LONG $0xf4d40f66             // paddq    xmm6, xmm4
	LONG $0xf2d40f66             // paddq    xmm6, xmm2
	LONG $0xfdd40f66             // paddq    xmm7, xmm5
	LONG $0xfbd40f66             // paddq    xmm7, xmm3
	LONG $0x416f0ff3; BYTE $0xf0 // movdqu    xmm0, oword [rcx - 16]
	LONG $0x096f0ff3             // movdqu    xmm1, oword [rcx]
	LONG $0xc6d40f66             // paddq    xmm0, xmm6
	LONG $0xcfd40f66             // paddq    xmm1, xmm7
	LONG $0x80e98348             // sub    rcx, -128
	LONG $0xf0c08348             // add    rax, -16
	JNE  LBB0_13

LBB0_14:
	LONG $0xc1d40f66             // paddq    xmm0, xmm1
	LONG $0xc8700f66; BYTE $0x4e // pshufd    xmm1, xmm0, 78
	LONG $0xc8d40f66             // paddq    xmm1, xmm0
	LONG $0x7e0f4866; BYTE $0xc8 // movq    rax, xmm1
	WORD $0x3949; BYTE $0xf1     // cmp    r9, rsi
	JNE  LBB0_4
	JMP  LBB0_15
