// File: /workspace/github_c_makefile_star2_O1/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 0x1290(%rip), %rdi      # 0x32b6
movl $0x1a, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x10f0
leaq 0x1292(%rip), %rdi      # 0x32d1
movl $0x2, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x10f0
testl %ebp, %ebp
jle 0x216b
movl %ebp, %r13d
leaq 0x1271(%rip), %r15      # 0x32d4
leaq 0xff2(%rip), %rbp       # 0x305c
xorl %r12d, %r12d
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1060
movl (%r14,%r12,8), %eax
cmpq $0x9, %rax
ja 0x215f
movslq (%rbp,%rax,4), %rax
addq %rbp, %rax
jmpq *%rax
movl 0x4(%r14,%r12,8), %edx
movq %rbx, %rdi
leaq 0x123a(%rip), %rsi      # 0x32d9
jmp 0x2158
movl $0x9, %esi
movl $0x1, %edx
leaq 0x1270(%rip), %rdi      # 0x3325
jmp 0x20c8
movl $0xe, %esi
movl $0x1, %edx
leaq 0x12c1(%rip), %rdi      # 0x3389
movq %rbx, %rcx
callq 0x10f0
jmp 0x215f
movl 0x4(%r14,%r12,8), %edx
movq %rbx, %rdi
leaq 0x1212(%rip), %rsi      # 0x32f6
jmp 0x2158
movl 0x4(%r14,%r12,8), %edx
movl $0x10, %ecx
subl %edx, %ecx
movq %rbx, %rdi
leaq 0x1209(%rip), %rsi      # 0x3305
xorl %eax, %eax
callq 0x10b0
jmp 0x215f
movl 0x4(%r14,%r12,8), %edx
movq %rbx, %rdi
leaq 0x1243(%rip), %rsi      # 0x3357
jmp 0x2158
movl 0x4(%r14,%r12,8), %edx
movq %rbx, %rdi
leaq 0x11c2(%rip), %rsi      # 0x32e7
jmp 0x2158
movl 0x4(%r14,%r12,8), %edx
movq %rbx, %rdi
leaq 0x11f9(%rip), %rsi      # 0x332f
jmp 0x2158
movl 0x4(%r14,%r12,8), %edx
movq %rbx, %rdi
leaq 0x1201(%rip), %rsi      # 0x3348
jmp 0x2158
movl 0x4(%r14,%r12,8), %edx
movq %rbx, %rdi
leaq 0x1218(%rip), %rsi      # 0x3370
xorl %eax, %eax
callq 0x10b0
incq %r12
cmpq %r12, %r13
jne 0x206d
leaq 0x1226(%rip), %rdi      # 0x3398
movl $0xe, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x10f0
leaq 0x121c(%rip), %rdi      # 0x33a7
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 0x10f0