// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/test/test_expr.c
// Function: lookup
int lookup(void *data, char *str, char **end, hts_expr_val_t *res) {
    int foo = 15551; // my favourite palindromic prime
    int a = 1;
    int b = 2;
    int c = 3;
    res->is_str = 0;
    if (strncmp(str, "foo", 3) == 0) {
        *end = str+3;
        res->d = foo;
    } else if (*str == 'a') {
        *end = str+1;
        res->d = a;
    } else if (*str == 'b') {
        *end = str+1;
        res->d = b;
    } else if (*str == 'c') {
        *end = str+1;
        res->d = c;
    } else if (strncmp(str, "magic", 5) == 0) {
        // non-empty string
        *end = str+5;
        res->is_str = 1;
        kputs("plugh", ks_clear(&res->s));
    } else if (strncmp(str, "empty-but-true", 14) == 0) {
        // empty string
        *end = str+14;
        res->is_true = 1;
        res->is_str = 1;
        kputs("", ks_clear(&res->s));
    } else if (strncmp(str, "empty", 5) == 0) {
        // empty string
        *end = str+5;
        res->is_str = 1;
        kputs("", ks_clear(&res->s));
    } else if (strncmp(str, "zero-but-true", 13) == 0) {
        *end = str+13;
        res->d = 0;
        res->is_true = 1;
    } else if (strncmp(str, "null-but-true", 13) == 0) {
        *end = str+13;
        hts_expr_val_undef(res);
        res->is_true = 1;
    } else if (strncmp(str, "null", 4) == 0) {
        // null string (eg aux:Z tag is absent)
        *end = str+4;
        hts_expr_val_undef(res);
    } else if (strncmp(str, "nan", 3) == 0) {
        // sqrt(-1), 0/0 and similar
        // Semantically the same operations as null.
        *end = str+3;
        hts_expr_val_undef(res);

    } else {
        return -1;
    }

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movb $0x0, (%rcx)
movzbl (%rsi), %r12d
leal -0x61(%r12), %eax
cmpl $0x5, %eax
ja 0x5b4c
leaq 0x6d51f(%rip), %rcx     # 0x73004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
incq %r15
movq %r15, (%r14)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
jmp 0x5b22
incq %r15
movq %r15, (%r14)
movabsq $0x4008000000000000, %rax # imm = 0x4008000000000000
jmp 0x5b22
incq %r15
movq %r15, (%r14)
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
movq %rax, 0x20(%rbx)
jmp 0x5c54
cmpb $0x6f, 0x1(%r15)
jne 0x5b4c
cmpb $0x6f, 0x2(%r15)
jne 0x5b4c
addq $0x3, %r15
movq %r15, (%r14)
movabsq $0x40ce5f8000000000, %rax # imm = 0x40CE5F8000000000
jmp 0x5b22
leaq 0x6d982(%rip), %rsi     # 0x734d5
pushq $0x5
popq %rdx
movq %r15, %rdi
callq 0x4210
testl %eax, %eax
je 0x5c08
leaq 0x6d970(%rip), %rsi     # 0x734dd
pushq $0xe
popq %rdx
movq %r15, %rdi
callq 0x4210
testl %eax, %eax
je 0x5c24
leaq 0x6d49b(%rip), %rsi     # 0x73022
pushq $0x5
popq %rdx
movq %r15, %rdi
callq 0x4210
testl %eax, %eax
je 0x5c32
leaq 0x6d99e(%rip), %rsi     # 0x7353f
pushq $0xd
popq %rdx
movq %r15, %rdi
callq 0x4210
testl %eax, %eax
je 0x5c62
leaq 0x6d666(%rip), %rsi     # 0x73221
pushq $0xd
popq %rdx
movq %r15, %rdi
callq 0x4210
testl %eax, %eax
je 0x5c74
leaq 0x6d6db(%rip), %rsi     # 0x732b0
pushq $0x4
popq %rdx
movq %r15, %rdi
callq 0x4210
testl %eax, %eax
je 0x5c87
pushq $-0x1
popq %rax
cmpb $0x6e, %r12b
jne 0x5c56
cmpb $0x61, 0x1(%r15)
jne 0x5c56
cmpb $0x6e, 0x2(%r15)
jne 0x5c56
addq $0x3, %r15
jmp 0x5c8b
addq $0x5, %r15
movq %r15, (%r14)
movb $0x1, (%rbx)
andq $0x0, 0x8(%rbx)
addq $0x8, %rbx
leaq 0x6d3fa(%rip), %rdi     # 0x7301c
jmp 0x5c4c
addq $0xe, %r15
movq %r15, (%r14)
movw $0x101, (%rbx)          # imm = 0x101
jmp 0x5c3c
addq $0x5, %r15
movq %r15, (%r14)
movb $0x1, (%rbx)
andq $0x0, 0x8(%rbx)
addq $0x8, %rbx
leaq 0x6e33a(%rip), %rdi     # 0x73f86
movq %rbx, %rsi
callq 0x5ca6
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
addq $0xd, %r15
movq %r15, (%r14)
andq $0x0, 0x20(%rbx)
movb $0x1, 0x1(%rbx)
jmp 0x5c54
addq $0xd, %r15
movq %r15, (%r14)
andq $0x0, 0x8(%rbx)
movw $0x100, (%rbx)          # imm = 0x100
jmp 0x5c97
addq $0x4, %r15
movq %r15, (%r14)
andq $0x0, 0x8(%rbx)
andw $0x0, (%rbx)
movabsq $0x7ff8000000000000, %rax # imm = 0x7FF8000000000000
jmp 0x5b22