// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/ae.c
// Function: aeCreateEventLoop
aeEventLoop *aeCreateEventLoop(int setsize) {
    aeEventLoop *eventLoop;
    int i;

    if ((eventLoop = zmalloc(sizeof(*eventLoop))) == NULL) goto err;
    eventLoop->events = zmalloc(sizeof(aeFileEvent)*setsize);
    eventLoop->fired = zmalloc(sizeof(aeFiredEvent)*setsize);
    if (eventLoop->events == NULL || eventLoop->fired == NULL) goto err;
    eventLoop->setsize = setsize;
    eventLoop->lastTime = time(NULL);
    eventLoop->timeEventHead = NULL;
    eventLoop->timeEventNextId = 0;
    eventLoop->stop = 0;
    eventLoop->maxfd = -1;
    eventLoop->beforesleep = NULL;
    if (aeApiCreate(eventLoop) == -1) goto err;
    /* Events with mask == AE_NONE are not set. So let's initialize the
     * vector with it. */
    for (i = 0; i < setsize; i++)
        eventLoop->events[i].mask = AE_NONE;
    return eventLoop;

err:
    if (eventLoop) {
        zfree(eventLoop->events);
        zfree(eventLoop->fired);
        zfree(eventLoop);
    }
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edi, %r14d
movl $0x48, %edi
callq 0x1a735
testq %rax, %rax
je 0x1ad8b
movq %rax, %rbx
movslq %r14d, %r15
movq %r15, %rdi
shlq $0x5, %rdi
callq 0x1a735
movq %rax, 0x18(%rbx)
shlq $0x3, %r15
movq %r15, %rdi
callq 0x1a735
movq %rax, 0x20(%rbx)
cmpq $0x0, 0x18(%rbx)
sete %cl
testq %rax, %rax
sete %al
orb %cl, %al
jne 0x1ad71
movl %r14d, 0x4(%rbx)
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x10410
movq %rax, 0x10(%rbx)
movq %r15, 0x28(%rbx)
movq %r15, 0x8(%rbx)
movl $0x0, 0x30(%rbx)
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
movq %r15, 0x40(%rbx)
movl $0x10, %edi
callq 0x1a735
testq %rax, %rax
je 0x1ad71
movq %rax, %r15
movslq 0x4(%rbx), %rax
shlq $0x2, %rax
leaq (%rax,%rax,2), %rdi
callq 0x1a735
movq %rax, 0x8(%r15)
testq %rax, %rax
je 0x1ad69
movl $0x400, %edi            # imm = 0x400
callq 0x10610
movl %eax, (%r15)
cmpl $-0x1, %eax
je 0x1ad60
movq %r15, 0x38(%rbx)
testl %r14d, %r14d
jle 0x1ad8d
movq 0x18(%rbx), %rax
movl %r14d, %ecx
addl $0x3, %r14d
decq %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
shrl $0x2, %r14d
shlq $0x7, %r14
movdqa 0x2b37b(%rip), %xmm1    # 0x46000
movdqa 0x2b383(%rip), %xmm2    # 0x46010
xorl %ecx, %ecx
movdqa 0x2b389(%rip), %xmm3    # 0x46020
pxor %xmm3, %xmm0
pcmpeqd %xmm4, %xmm4
movdqa 0x2b389(%rip), %xmm5    # 0x46030
movdqa %xmm2, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %edx
notl %edx
testb $0x1, %dl
je 0x1ace2
movl $0x0, (%rax,%rcx)
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %edx
testb $0x1, %dl
je 0x1acf8
movl $0x0, 0x20(%rax,%rcx)
movdqa %xmm1, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
pxor %xmm4, %xmm6
pextrw $0x0, %xmm6, %edx
testb $0x1, %dl
je 0x1ad37
movl $0x0, 0x40(%rax,%rcx)
pextrw $0x4, %xmm6, %edx
testb $0x1, %dl
je 0x1ad49
movl $0x0, 0x60(%rax,%rcx)
paddq %xmm5, %xmm2
paddq %xmm5, %xmm1
subq $-0x80, %rcx
cmpq %rcx, %r14
jne 0x1aca7
jmp 0x1ad8d
movq 0x8(%r15), %rdi
callq 0x1a877
movq %r15, %rdi
callq 0x1a877
movq 0x18(%rbx), %rdi
callq 0x1a877
movq 0x20(%rbx), %rdi
callq 0x1a877
movq %rbx, %rdi
callq 0x1a877
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq