// File: /workspace/github_c_makefile_star2_O0/erikdubbelboer[P]discnt/src/networking.c
// Function: checkClientOutputBufferLimits
int checkClientOutputBufferLimits(client *c) {
    int soft = 0, hard = 0, class;
    unsigned long used_mem = getClientOutputBufferMemoryUsage(c);

    class = getClientType(c);
    if (server.client_obuf_limits[class].hard_limit_bytes &&
        used_mem >= server.client_obuf_limits[class].hard_limit_bytes)
        hard = 1;
    if (server.client_obuf_limits[class].soft_limit_bytes &&
        used_mem >= server.client_obuf_limits[class].soft_limit_bytes)
        soft = 1;

    /* We need to check if the soft limit is reached continuously for the
     * specified amount of seconds. */
    if (soft) {
        if (c->obuf_soft_limit_reached_time == 0) {
            c->obuf_soft_limit_reached_time = server.unixtime;
            soft = 0; /* First time we see the soft limit reached */
        } else {
            time_t elapsed = server.unixtime - c->obuf_soft_limit_reached_time;

            if (elapsed <=
                server.client_obuf_limits[class].soft_limit_seconds) {
                soft = 0; /* The client still did not reached the max number of
                             seconds for the soft limit to be considered
                             reached. */
            }
        }
    } else {
        c->obuf_soft_limit_reached_time = 0;
    }
    return soft || hard;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x26c60
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x275b0
movl %eax, -0x14(%rbp)
movslq -0x14(%rbp), %rcx
leaq 0x9768a(%rip), %rax     # 0xbf0e8
addq $0x5c0, %rax            # imm = 0x5C0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
je 0x27a9a
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rdx
leaq 0x97668(%rip), %rcx     # 0xbf0e8
addq $0x5c0, %rcx            # imm = 0x5C0
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpq (%rcx), %rax
jb 0x27a9a
movl $0x1, -0x10(%rbp)
movslq -0x14(%rbp), %rcx
leaq 0x97643(%rip), %rax     # 0xbf0e8
addq $0x5c0, %rax            # imm = 0x5C0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x8(%rax)
je 0x27ae3
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rdx
leaq 0x97620(%rip), %rcx     # 0xbf0e8
addq $0x5c0, %rcx            # imm = 0x5C0
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpq 0x8(%rcx), %rax
jb 0x27ae3
movl $0x1, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x27b64
movq -0x8(%rbp), %rax
cmpq $0x0, 0x80(%rax)
jne 0x27b19
leaq 0x975ea(%rip), %rax     # 0xbf0e8
movq 0x648(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x80(%rax)
movl $0x0, -0xc(%rbp)
jmp 0x27b62
leaq 0x975c8(%rip), %rax     # 0xbf0e8
movq 0x648(%rax), %rax
movq -0x8(%rbp), %rcx
subq 0x80(%rcx), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movslq -0x14(%rbp), %rdx
leaq 0x975a3(%rip), %rcx     # 0xbf0e8
addq $0x5c0, %rcx            # imm = 0x5C0
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpq 0x10(%rcx), %rax
jg 0x27b60
movl $0x0, -0xc(%rbp)
jmp 0x27b62
jmp 0x27b73
movq -0x8(%rbp), %rax
movq $0x0, 0x80(%rax)
movb $0x1, %al
cmpl $0x0, -0xc(%rbp)
movb %al, -0x29(%rbp)
jne 0x27b88
cmpl $0x0, -0x10(%rbp)
setne %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)