// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl $0x3cbf, -0x2c(%rbp)    # imm = 0x3CBF
movl $0x1, -0x30(%rbp)
movl $0x2, -0x34(%rbp)
movl $0x3, -0x38(%rbp)
movq -0x28(%rbp), %rax
movb $0x0, (%rax)
movq -0x18(%rbp), %rdi
leaq 0xe2562(%rip), %rsi     # 0xe8068
movl $0x3, %edx
callq 0x4200
cmpl $0x0, %eax
jne 0x5b37
movq -0x18(%rbp), %rcx
addq $0x3, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
cvtsi2sdl -0x2c(%rbp), %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, 0x20(%rax)
jmp 0x5dbf
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x61, %eax
jne 0x5b65
movq -0x18(%rbp), %rcx
addq $0x1, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
cvtsi2sdl -0x30(%rbp), %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, 0x20(%rax)
jmp 0x5dbd
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x62, %eax
jne 0x5b93
movq -0x18(%rbp), %rcx
addq $0x1, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
cvtsi2sdl -0x34(%rbp), %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, 0x20(%rax)
jmp 0x5dbb
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x63, %eax
jne 0x5bc1
movq -0x18(%rbp), %rcx
addq $0x1, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
cvtsi2sdl -0x38(%rbp), %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, 0x20(%rax)
jmp 0x5db9
movq -0x18(%rbp), %rdi
leaq 0xe295d(%rip), %rsi     # 0xe8529
movl $0x5, %edx
callq 0x4200
cmpl $0x0, %eax
jne 0x5c12
movq -0x18(%rbp), %rcx
addq $0x5, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movb $0x1, (%rax)
movq -0x28(%rbp), %rdi
addq $0x8, %rdi
callq 0x5e30
movq %rax, %rsi
leaq 0xe2464(%rip), %rdi     # 0xe806c
callq 0x5dd0
jmp 0x5db7
movq -0x18(%rbp), %rdi
leaq 0xe2914(%rip), %rsi     # 0xe8531
movl $0xe, %edx
callq 0x4200
cmpl $0x0, %eax
jne 0x5c6b
movq -0x18(%rbp), %rcx
addq $0xe, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movb $0x1, 0x1(%rax)
movq -0x28(%rbp), %rax
movb $0x1, (%rax)
movq -0x28(%rbp), %rdi
addq $0x8, %rdi
callq 0x5e30
movq %rax, %rsi
leaq 0xe32d9(%rip), %rdi     # 0xe8f3a
callq 0x5dd0
jmp 0x5db5
movq -0x18(%rbp), %rdi
leaq 0xe23fc(%rip), %rsi     # 0xe8072
movl $0x5, %edx
callq 0x4200
cmpl $0x0, %eax
jne 0x5cbc
movq -0x18(%rbp), %rcx
addq $0x5, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movb $0x1, (%rax)
movq -0x28(%rbp), %rdi
addq $0x8, %rdi
callq 0x5e30
movq %rax, %rsi
leaq 0xe3288(%rip), %rdi     # 0xe8f3a
callq 0x5dd0
jmp 0x5db3
movq -0x18(%rbp), %rdi
leaq 0xe28cc(%rip), %rsi     # 0xe8593
movl $0xd, %edx
callq 0x4200
cmpl $0x0, %eax
jne 0x5cfe
movq -0x18(%rbp), %rcx
addq $0xd, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x20(%rax)
movq -0x28(%rbp), %rax
movb $0x1, 0x1(%rax)
jmp 0x5db1
movq -0x18(%rbp), %rdi
leaq 0xe256c(%rip), %rsi     # 0xe8275
movl $0xd, %edx
callq 0x4200
cmpl $0x0, %eax
jne 0x5d3a
movq -0x18(%rbp), %rcx
addq $0xd, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rdi
callq 0x5e50
movq -0x28(%rbp), %rax
movb $0x1, 0x1(%rax)
jmp 0x5daf
movq -0x18(%rbp), %rdi
leaq 0xe25bf(%rip), %rsi     # 0xe8304
movl $0x4, %edx
callq 0x4200
cmpl $0x0, %eax
jne 0x5d6e
movq -0x18(%rbp), %rcx
addq $0x4, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rdi
callq 0x5e50
jmp 0x5dad
movq -0x18(%rbp), %rdi
leaq 0xe22ff(%rip), %rsi     # 0xe8078
movl $0x3, %edx
callq 0x4200
cmpl $0x0, %eax
jne 0x5da2
movq -0x18(%rbp), %rcx
addq $0x3, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rdi
callq 0x5e50
jmp 0x5dab
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5dc6
jmp 0x5dad
jmp 0x5daf
jmp 0x5db1
jmp 0x5db3
jmp 0x5db5
jmp 0x5db7
jmp 0x5db9
jmp 0x5dbb
jmp 0x5dbd
jmp 0x5dbf
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop