// File: /workspace/github_c_makefile_star2_O1/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 %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movb $0x0, (%rcx)
leaq 0x8d20c(%rip), %rsi     # 0x93020
movl $0x3, %edx
movq %r15, %rdi
callq 0x4210
testl %eax, %eax
je 0x5e4a
movzbl (%r15), %eax
cmpl $0x63, %eax
je 0x5e6f
cmpl $0x62, %eax
je 0x5e5d
cmpl $0x61, %eax
jne 0x5e8b
incq %r15
movq %r15, (%r14)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
jmp 0x5e7f
addq $0x3, %r15
movq %r15, (%r14)
movabsq $0x40ce5f8000000000, %rax # imm = 0x40CE5F8000000000
jmp 0x5e7f
incq %r15
movq %r15, (%r14)
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
jmp 0x5e7f
incq %r15
movq %r15, (%r14)
movabsq $0x4008000000000000, %rax # imm = 0x4008000000000000
movq %rax, 0x20(%rbx)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x8d64f(%rip), %rsi     # 0x934e1
movl $0x5, %edx
movq %r15, %rdi
callq 0x4210
testl %eax, %eax
je 0x5f5f
leaq 0x8d63b(%rip), %rsi     # 0x934e9
movl $0xe, %edx
movq %r15, %rdi
callq 0x4210
testl %eax, %eax
je 0x5fc9
leaq 0x8d160(%rip), %rsi     # 0x9302a
movl $0x5, %edx
movq %r15, %rdi
callq 0x4210
testl %eax, %eax
je 0x5fd7
leaq 0x8d665(%rip), %rsi     # 0x9354b
movl $0xd, %edx
movq %r15, %rdi
callq 0x4210
testl %eax, %eax
je 0x6024
leaq 0x8d32b(%rip), %rsi     # 0x9322d
movl $0xd, %edx
movq %r15, %rdi
callq 0x4210
testl %eax, %eax
je 0x603c
leaq 0x8d39e(%rip), %rsi     # 0x932bc
movl $0x4, %edx
movq %r15, %rdi
callq 0x4210
testl %eax, %eax
je 0x6052
leaq 0x8d0f6(%rip), %rsi     # 0x93030
movl $0x3, %edx
movq %r15, %rdi
callq 0x4210
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0x5e85
addq $0x3, %r15
jmp 0x6056
addq $0x5, %r15
movq %r15, (%r14)
movb $0x1, (%rbx)
movq $0x0, 0x8(%rbx)
cmpq $0x6, 0x10(%rbx)
ja 0x5f9b
movq 0x18(%rbx), %rdi
movl $0xa, %esi
callq 0x4850
testq %rax, %rax
je 0x5e83
movq %rax, 0x18(%rbx)
movq $0xa, 0x10(%rbx)
movq 0x8(%rbx), %rax
movq 0x18(%rbx), %rcx
movb $0x68, 0x4(%rcx,%rax)
movl $0x67756c70, (%rcx,%rax) # imm = 0x67756C70
movq 0x8(%rbx), %rax
movq 0x18(%rbx), %rcx
leaq 0x5(%rax), %rdx
movq %rdx, 0x8(%rbx)
movb $0x0, 0x5(%rcx,%rax)
jmp 0x5e83
addq $0xe, %r15
movq %r15, (%r14)
movw $0x101, (%rbx)          # imm = 0x101
jmp 0x5fe1
addq $0x5, %r15
movq %r15, (%r14)
movb $0x1, (%rbx)
movq $0x0, 0x8(%rbx)
cmpq $0x1, 0x10(%rbx)
ja 0x6013
movq 0x18(%rbx), %rdi
movl $0x3, %esi
callq 0x4850
testq %rax, %rax
je 0x5e83
movq %rax, 0x18(%rbx)
movq $0x3, 0x10(%rbx)
movq 0x8(%rbx), %rax
movq 0x18(%rbx), %rcx
movb $0x0, (%rcx,%rax)
jmp 0x5e83
addq $0xd, %r15
movq %r15, (%r14)
movq $0x0, 0x20(%rbx)
movb $0x1, 0x1(%rbx)
jmp 0x5e83
addq $0xd, %r15
movq %r15, (%r14)
movq $0x0, 0x8(%rbx)
movw $0x100, (%rbx)          # imm = 0x100
jmp 0x6066
addq $0x4, %r15
movq %r15, (%r14)
movq $0x0, 0x8(%rbx)
movw $0x0, (%rbx)
movabsq $0x7ff8000000000000, %rax # imm = 0x7FF8000000000000
jmp 0x5e7f