// File: /workspace/github_c_makefile_star2_O0/yancanchen[P]mc-bloom-filter/mc_bloom_filter.c
// Function: try_read_network
int try_read_network(conn *c) {
    int gotdata = 0;
    int res;

    if (c->rcurr != c->rbuf) {
        if (c->rbytes != 0) /* otherwise there's nothing to copy */
            memmove(c->rbuf, c->rcurr, c->rbytes);
        c->rcurr = c->rbuf;
    }

    while (1) {
        if (c->rbytes >= c->rsize) {
            char *new_rbuf = realloc(c->rbuf, c->rsize*2);
            if (!new_rbuf) {
                if (my_srv.verbose > 0)
                    fprintf(stderr, "Couldn't realloc input buffer\n");
                c->rbytes = 0; /* ignore what we read */
                out_string(c, "SERVER_ERROR out of memory");
                c->write_and_go = conn_closing;
                return 1;
            }
            c->rcurr  = c->rbuf = new_rbuf;
            c->rsize *= 2;
        }
        res = read(c->sfd, c->rbuf + c->rbytes, c->rsize - c->rbytes);
        if (res > 0) {
            stats.bytes_read += res;
            gotdata = 1;
            c->rbytes += res;
            continue;
        }
        if (res == 0) {
            /* connection closed */
            c->state = conn_closing;
            return 1;
        }
        if (res == -1) {
            if (errno == EAGAIN || errno == EWOULDBLOCK) break;
            else return 0;
        }
    }
    return gotdata;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movl $0x0, 0x14(%rsp)
movq 0x18(%rsp), %rax
movq 0x98(%rax), %rax
movq 0x18(%rsp), %rcx
cmpq 0x90(%rcx), %rax
je 0x534a
movq 0x18(%rsp), %rax
cmpl $0x0, 0xa4(%rax)
je 0x5332
movq 0x18(%rsp), %rax
movq 0x90(%rax), %rdi
movq 0x18(%rsp), %rax
movq 0x98(%rax), %rsi
movq 0x18(%rsp), %rax
movslq 0xa4(%rax), %rdx
callq 0x2310
movq 0x18(%rsp), %rax
movq 0x90(%rax), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x98(%rax)
jmp 0x534c
movq 0x18(%rsp), %rax
movl 0xa4(%rax), %eax
movq 0x18(%rsp), %rcx
cmpl 0xa0(%rcx), %eax
jl 0x5423
movq 0x18(%rsp), %rax
movq 0x90(%rax), %rdi
movq 0x18(%rsp), %rax
movl 0xa0(%rax), %eax
shll %eax
movslq %eax, %rsi
callq 0x22e0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x53f3
cmpl $0x0, 0x4f07(%rip)      # 0xa2a4
jle 0x53b7
movq 0x4c52(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x2259(%rip), %rsi      # 0x7609
movb $0x0, %al
callq 0x2250
movq 0x18(%rsp), %rax
movl $0x0, 0xa4(%rax)
movq 0x18(%rsp), %rdi
leaq 0x2256(%rip), %rsi      # 0x7628
callq 0x3b60
movq 0x18(%rsp), %rax
movl $0x5, 0xc8(%rax)
movl $0x1, 0x24(%rsp)
jmp 0x54f4
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x90(%rax)
movq 0x18(%rsp), %rax
movq %rcx, 0x98(%rax)
movq 0x18(%rsp), %rax
movl 0xa0(%rax), %ecx
shll %ecx
movl %ecx, 0xa0(%rax)
movq 0x18(%rsp), %rax
movl (%rax), %edi
movq 0x18(%rsp), %rax
movq 0x90(%rax), %rsi
movq 0x18(%rsp), %rax
movslq 0xa4(%rax), %rax
addq %rax, %rsi
movq 0x18(%rsp), %rax
movl 0xa0(%rax), %eax
movq 0x18(%rsp), %rcx
subl 0xa4(%rcx), %eax
movslq %eax, %rdx
callq 0x2210
movl %eax, 0x10(%rsp)
cmpl $0x0, 0x10(%rsp)
jle 0x54a3
movslq 0x10(%rsp), %rax
addq 0x4e0e(%rip), %rax      # 0xa288
movq %rax, 0x4e07(%rip)      # 0xa288
movl $0x1, 0x14(%rsp)
movl 0x10(%rsp), %ecx
movq 0x18(%rsp), %rax
addl 0xa4(%rax), %ecx
movl %ecx, 0xa4(%rax)
jmp 0x534c
cmpl $0x0, 0x10(%rsp)
jne 0x54c0
movq 0x18(%rsp), %rax
movl $0x5, 0x4(%rax)
movl $0x1, 0x24(%rsp)
jmp 0x54f4
cmpl $-0x1, 0x10(%rsp)
jne 0x54e7
callq 0x2040
cmpl $0xb, (%rax)
je 0x54db
callq 0x2040
cmpl $0xb, (%rax)
jne 0x54dd
jmp 0x54ec
movl $0x0, 0x24(%rsp)
jmp 0x54f4
jmp 0x534c
movl 0x14(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopl (%rax)