// File: /workspace/github_c_makefile_star2_O0/yancanchen[P]mc-bloom-filter/mc_bloom_filter.c
// Function: complete_nread
void complete_nread(conn *c) {
    char *msg;
    int len;

    len = c->rlbytes - 2;
    msg = c->rcurr;

    if (strncmp(msg + len, "\r\n", 2) != 0) {
        out_string(c, "CLIENT_ERROR bad data chunk");
    } else {
        msg[len] = 0;
        if (c->item_comm == NREAD_SET){
            //set a bloom filter with key
            if (len && (len <= MAX_SUBKEY_LEN) && !strchr(msg,' ') && blooms_set(c->key,msg) == 0 ){
                out_string(c, "STORED");
            } else {
                out_string(c, "NOT_STORED");
            }
        }else if(c->item_comm == NREAD_ADD){
            unsigned long long n;
            double e;
            if ((2 != sscanf(msg,"%llu|%lf",&n,&e)) || !n || e<=0 || e>=1) {
                out_string(c, "NOT_STORED");
                return;
            }

            if(!strchr(c->key,'|') && blooms_add(c->key,n,e) == 0){    
                out_string(c, "STORED");
            } else {
                out_string(c, "NOT_STORED");
            }

        }else{
            out_string(c, "CLIENT_ERROR unsuport type");
        }
    }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movl 0xa8(%rax), %eax
subl $0x2, %eax
movl %eax, 0x14(%rsp)
movq 0x20(%rsp), %rax
movq 0x98(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movslq 0x14(%rsp), %rax
addq %rax, %rdi
leaq 0x277e(%rip), %rsi      # 0x719e
movl $0x2, %edx
callq 0x2060
cmpl $0x0, %eax
je 0x4a45
movq 0x20(%rsp), %rdi
leaq 0x2d62(%rip), %rsi      # 0x779d
callq 0x3b60
jmp 0x4bb8
movq 0x18(%rsp), %rax
movslq 0x14(%rsp), %rcx
movb $0x0, (%rax,%rcx)
movq 0x20(%rsp), %rax
movsbl 0xcd(%rax), %eax
cmpl $0x2, %eax
jne 0x4ace
cmpl $0x0, 0x14(%rsp)
je 0x4ab8
cmpl $0xd9, 0x14(%rsp)
jg 0x4ab8
movq 0x18(%rsp), %rdi
movl $0x20, %esi
callq 0x2160
cmpq $0x0, %rax
jne 0x4ab8
movq 0x20(%rsp), %rdi
addq $0xd0, %rdi
movq 0x18(%rsp), %rsi
callq 0x2d20
cmpl $0x0, %eax
jne 0x4ab8
movq 0x20(%rsp), %rdi
leaq 0x2d0c(%rip), %rsi      # 0x77bd
callq 0x3b60
jmp 0x4ac9
movq 0x20(%rsp), %rdi
leaq 0x2cf5(%rip), %rsi      # 0x77b9
callq 0x3b60
jmp 0x4bb6
movq 0x20(%rsp), %rax
movsbl 0xcd(%rax), %eax
cmpl $0x1, %eax
jne 0x4ba3
movq 0x18(%rsp), %rdi
leaq 0x28dd(%rip), %rsi      # 0x73cc
leaq 0x8(%rsp), %rdx
movq %rsp, %rcx
movb $0x0, %al
callq 0x22b0
movl %eax, %ecx
movl $0x2, %eax
cmpl %ecx, %eax
jne 0x4b2e
cmpq $0x0, 0x8(%rsp)
je 0x4b2e
xorps %xmm0, %xmm0
ucomisd (%rsp), %xmm0
jae 0x4b2e
movsd (%rsp), %xmm0
movsd 0x24e0(%rip), %xmm1     # 0x7008
ucomisd %xmm1, %xmm0
jb 0x4b41
movq 0x20(%rsp), %rdi
leaq 0x2c7f(%rip), %rsi      # 0x77b9
callq 0x3b60
jmp 0x4bb8
movq 0x20(%rsp), %rdi
addq $0xd0, %rdi
movl $0x7c, %esi
callq 0x2160
cmpq $0x0, %rax
jne 0x4b90
movq 0x20(%rsp), %rdi
addq $0xd0, %rdi
movq 0x8(%rsp), %rsi
movsd (%rsp), %xmm0
callq 0x2ba0
cmpl $0x0, %eax
jne 0x4b90
movq 0x20(%rsp), %rdi
leaq 0x2c34(%rip), %rsi      # 0x77bd
callq 0x3b60
jmp 0x4ba1
movq 0x20(%rsp), %rdi
leaq 0x2c1d(%rip), %rsi      # 0x77b9
callq 0x3b60
jmp 0x4bb4
movq 0x20(%rsp), %rdi
leaq 0x2c15(%rip), %rsi      # 0x77c4
callq 0x3b60
jmp 0x4bb6
jmp 0x4bb8
addq $0x28, %rsp
retq
nopl (%rax)