// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/third-party/SipHash/siphash.c
// Function: siphash
uint64_t siphash(const uint8_t *in, const size_t inlen, const uint8_t *k)
{
    uint64_t v0 = 0x736f6d6570736575ULL;
    uint64_t v1 = 0x646f72616e646f6dULL;
    uint64_t v2 = 0x6c7967656e657261ULL;
    uint64_t v3 = 0x7465646279746573ULL;
    uint64_t k0 = U8TO64_LE(k);
    uint64_t k1 = U8TO64_LE(k + 8);
    uint64_t m;
    int i;
    const uint8_t *end = in + inlen - (inlen % sizeof(uint64_t));
    const int left = inlen & 7;
    uint64_t b = ((uint64_t)inlen) << 56;
    uint64_t hash;
    uint8_t *out = (uint8_t *)&hash;
    v3 ^= k1;
    v2 ^= k0;
    v1 ^= k1;
    v0 ^= k0;

    for (; in != end; in += 8) {
        m = U8TO64_LE(in);
        v3 ^= m;

        for (i = 0; i < cROUNDS; ++i)
            SIPROUND;

        v0 ^= m;
    }

    switch (left) {
    case 7:
        b |= ((uint64_t)in[6]) << 48;
        attribute_fallthrough
    case 6:
        b |= ((uint64_t)in[5]) << 40;
        attribute_fallthrough
    case 5:
        b |= ((uint64_t)in[4]) << 32;
        attribute_fallthrough
    case 4:
        b |= ((uint64_t)in[3]) << 24;
        attribute_fallthrough
    case 3:
        b |= ((uint64_t)in[2]) << 16;
        attribute_fallthrough
    case 2:
        b |= ((uint64_t)in[1]) << 8;
        attribute_fallthrough
    case 1:
        b |= ((uint64_t)in[0]);
        break;
    case 0:
        break;
    }

    v3 ^= b;

    for (i = 0; i < cROUNDS; ++i)
        SIPROUND;

    v0 ^= b;

    v2 ^= 0xff;

    for (i = 0; i < dROUNDS; ++i)
        SIPROUND;

    b = v0 ^ v1 ^ v2 ^ v3;
    U64TO8_LE(out, b);

    return hash;
}

// Assembly:
movq (%rdx), %r11
movq 0x8(%rdx), %r8
leaq (%rdi,%rsi), %r10
movl %esi, %r9d
andl $0x7, %r9d
subq %r9, %r10
movabsq $0x7465646279746573, %rdx # imm = 0x7465646279746573
xorq %r8, %rdx
movabsq $0x6c7967656e657261, %rcx # imm = 0x6C7967656E657261
xorq %r11, %rcx
movabsq $0x646f72616e646f6d, %rax # imm = 0x646F72616E646F6D
xorq %r8, %rax
movabsq $0x736f6d6570736575, %r8 # imm = 0x736F6D6570736575
xorq %r11, %r8
cmpq %rdi, %r10
je 0xd8a8
addq %rax, %r8
rolq $0xd, %rax
movq (%rdi), %r11
xorq %r8, %rax
rolq $0x20, %r8
xorq %r11, %rdx
addq %rdx, %rcx
rolq $0x10, %rdx
xorq %rcx, %rdx
addq %rdx, %r8
rolq $0x15, %rdx
addq %rax, %rcx
rolq $0x11, %rax
xorq %rcx, %rax
rolq $0x20, %rcx
xorq %r8, %rdx
xorq %r11, %r8
addq $0x8, %rdi
cmpq %r10, %rdi
jne 0xd866
shlq $0x38, %rsi
movl %r9d, %r9d
leaq 0x17ea(%rip), %r10      # 0xf0a0
movslq (%r10,%r9,4), %r9
addq %r10, %r9
jmpq *%r9
movzbl 0x6(%rdi), %r9d
shlq $0x30, %r9
orq %r9, %rsi
movzbl 0x5(%rdi), %r9d
shlq $0x28, %r9
orq %r9, %rsi
movzbl 0x4(%rdi), %r9d
shlq $0x20, %r9
orq %r9, %rsi
movzbl 0x3(%rdi), %r9d
shll $0x18, %r9d
orq %r9, %rsi
movzbl 0x2(%rdi), %r9d
shll $0x10, %r9d
orq %r9, %rsi
movzbl 0x1(%rdi), %r9d
shll $0x8, %r9d
orq %r9, %rsi
movzbl (%rdi), %edi
orq %rdi, %rsi
addq %rax, %r8
rolq $0xd, %rax
xorq %r8, %rax
rolq $0x20, %r8
xorq %rsi, %rdx
addq %rdx, %rcx
rolq $0x10, %rdx
xorq %rcx, %rdx
addq %rdx, %r8
rolq $0x15, %rdx
addq %rax, %rcx
rolq $0x11, %rax
xorq %rcx, %rax
rolq $0x20, %rcx
xorq %r8, %rdx
xorq %rsi, %r8
xorq $0xff, %rcx
movl $0x3, %esi
addq %rax, %r8
rolq $0xd, %rax
xorq %r8, %rax
rolq $0x20, %r8
addq %rdx, %rcx
rolq $0x10, %rdx
xorq %rcx, %rdx
addq %rdx, %r8
rolq $0x15, %rdx
xorq %r8, %rdx
addq %rax, %rcx
rolq $0x11, %rax
xorq %rcx, %rax
rolq $0x20, %rcx
decl %esi
jne 0xd950
xorq %rdx, %rcx
xorq %r8, %rax
xorq %rcx, %rax
retq
nop