// File: /workspace/github_c_makefile_star2_O1/zuocheng-liu[P]ae-memcached/src/ae.c
// Function: aeCreateEventLoop
aeEventLoop *aeCreateEventLoop(int setsize) {
    aeEventLoop *eventLoop;
    int i;

    if ((eventLoop = malloc(sizeof(*eventLoop))) == NULL) goto err;
    eventLoop->events = malloc(sizeof(aeFileEvent)*setsize);
    eventLoop->fired = malloc(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) {
        free(eventLoop->events);
        free(eventLoop->fired);
        free(eventLoop);
    }
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %r14d
movl $0x48, %edi
callq 0x22c0
testq %rax, %rax
je 0x2cb7
movq %rax, %rbx
movslq %r14d, %r15
movq %r15, %rdi
shlq $0x5, %rdi
callq 0x22c0
movq %rax, %r12
movq %rax, 0x18(%rbx)
shlq $0x3, %r15
movq %r15, %rdi
callq 0x22c0
movq %rax, 0x20(%rbx)
testq %r12, %r12
sete %cl
testq %rax, %rax
sete %al
orb %cl, %al
jne 0x2c9d
movl %r14d, 0x4(%rbx)
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x22b0
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 0x22c0
testq %rax, %rax
je 0x2c9d
movq %rax, %r15
movslq 0x4(%rbx), %rax
shlq $0x2, %rax
leaq (%rax,%rax,2), %rdi
callq 0x22c0
movq %rax, 0x8(%r15)
testq %rax, %rax
je 0x2c95
movl $0x400, %edi            # imm = 0x400
callq 0x23f0
movl %eax, (%r15)
cmpl $-0x1, %eax
je 0x2c8c
movq %r15, 0x38(%rbx)
testl %r14d, %r14d
jle 0x2cb9
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 0x545f(%rip), %xmm1     # 0x8010
movdqa 0x5467(%rip), %xmm2     # 0x8020
xorl %ecx, %ecx
movdqa 0x546d(%rip), %xmm3     # 0x8030
pxor %xmm3, %xmm0
pcmpeqd %xmm4, %xmm4
movdqa 0x546d(%rip), %xmm5     # 0x8040
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 0x2c0e
movl $0x0, (%rax,%rcx)
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %edx
testb $0x1, %dl
je 0x2c24
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 0x2c63
movl $0x0, 0x40(%rax,%rcx)
pextrw $0x4, %xmm6, %edx
testb $0x1, %dl
je 0x2c75
movl $0x0, 0x60(%rax,%rcx)
paddq %xmm5, %xmm2
paddq %xmm5, %xmm1
subq $-0x80, %rcx
cmpq %rcx, %r14
jne 0x2bd3
jmp 0x2cb9
movq 0x8(%r15), %rdi
callq 0x2030
movq %r15, %rdi
callq 0x2030
movq 0x18(%rbx), %rdi
callq 0x2030
movq 0x20(%rbx), %rdi
callq 0x2030
movq %rbx, %rdi
callq 0x2030
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq