// File: /workspace/github_c_makefile_star2_O3/skeeto[P]hash-prospector/hp16.c
// Function: hf_print
static void
hf_print(const struct hf_op *ops, int n, FILE *f)
{
    fprintf(f, "uint16_t hash(uint16_t x)\n");
    fprintf(f, "{\n");
    for (int i = 0; i < n; i++) {
        fputs("    ", f);
        switch (ops[i].type) {
        case HF16_XOR:
            fprintf(f, "x ^= 0x%04x;\n", ops[i].imm);
            break;
        case HF16_MUL:
            fprintf(f, "x *= 0x%04xU;\n", ops[i].imm);
            break;
        case HF16_ADD:
            fprintf(f, "x += 0x%04xU;\n", ops[i].imm);
            break;
        case HF16_ROT:
            fprintf(f, "x  = (unsigned)x<<%d | x >>%d;\n",
                    ops[i].imm, 16-ops[i].imm);
            break;
        case HF16_NOT:
            fprintf(f, "x  = ~x;\n");
            break;
        case HF16_XORL:
            fprintf(f, "x ^= (unsigned)x << %d;\n", ops[i].imm);
            break;
        case HF16_XORR:
            fprintf(f, "x ^= x >> %d;\n", ops[i].imm);
            break;
        case HF16_ADDL:
            fprintf(f, "x += (unsigned)x << %d;\n", ops[i].imm);
            break;
        case HF16_SUBL:
            fprintf(f, "x -= (unsigned)x << %d;\n", ops[i].imm);
            break;
        case HF16_SBOX:
            fprintf(f, "x  = sbox[x];\n");
            break;
        }
    }
    fprintf(f, "    return x;\n");
    fprintf(f, "}\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
leaq 0x12ea(%rip), %rdi      # 0x32db
movl $0x1a, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x10e0
leaq 0x12ec(%rip), %rdi      # 0x32f6
movl $0x2, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x10e0
testl %ebp, %ebp
jle 0x2136
movl %ebp, %r13d
leaq 0x12cb(%rip), %r15      # 0x32f9
leaq 0x104f(%rip), %rbp      # 0x3084
xorl %r12d, %r12d
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1060
movl (%r14,%r12,8), %eax
cmpq $0x9, %rax
ja 0x212a
movslq (%rbp,%rax,4), %rax
addq %rbp, %rax
jmpq *%rax
movl 0x4(%r14,%r12,8), %edx
movq %rbx, %rdi
leaq 0x1294(%rip), %rsi      # 0x32fe
jmp 0x2123
movl $0x9, %esi
movl $0x1, %edx
leaq 0x12ca(%rip), %rdi      # 0x334a
jmp 0x2093
movl $0xe, %esi
movl $0x1, %edx
leaq 0x131b(%rip), %rdi      # 0x33ae
movq %rbx, %rcx
callq 0x10e0
jmp 0x212a
movl 0x4(%r14,%r12,8), %edx
movq %rbx, %rdi
leaq 0x126c(%rip), %rsi      # 0x331b
jmp 0x2123
movl 0x4(%r14,%r12,8), %edx
movl $0x10, %ecx
subl %edx, %ecx
movq %rbx, %rdi
leaq 0x1263(%rip), %rsi      # 0x332a
xorl %eax, %eax
callq 0x10a0
jmp 0x212a
movl 0x4(%r14,%r12,8), %edx
movq %rbx, %rdi
leaq 0x129d(%rip), %rsi      # 0x337c
jmp 0x2123
movl 0x4(%r14,%r12,8), %edx
movq %rbx, %rdi
leaq 0x121c(%rip), %rsi      # 0x330c
jmp 0x2123
movl 0x4(%r14,%r12,8), %edx
movq %rbx, %rdi
leaq 0x1253(%rip), %rsi      # 0x3354
jmp 0x2123
movl 0x4(%r14,%r12,8), %edx
movq %rbx, %rdi
leaq 0x125b(%rip), %rsi      # 0x336d
jmp 0x2123
movl 0x4(%r14,%r12,8), %edx
movq %rbx, %rdi
leaq 0x1272(%rip), %rsi      # 0x3395
xorl %eax, %eax
callq 0x10a0
incq %r12
cmpq %r12, %r13
jne 0x2038
leaq 0x1280(%rip), %rdi      # 0x33bd
movl $0xe, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x10e0
leaq 0x1276(%rip), %rdi      # 0x33cc
movl $0x2, %esi
movl $0x1, %edx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10e0