// File: /workspace/github_cpp_makefile_star2_O2/Saevon[P]node-diskfree/build/../src/disk-gyp.cpp
// Function: diskfree::AfterDiskSpaceWorker(uv_work_s*, int)
void AfterDiskSpaceWorker(uv_work_t *request, int status) {
        reqData_t *requestData = reinterpret_cast<reqData_t *>(request->data);
        Isolate *isolate = Isolate::GetCurrent();
        HandleScope handleScope(isolate);

        const unsigned argc = 2;
        Local<Value> argv[argc];

        // Format the Error
        if (requestData->error != 0) {
            argv[0] = Number::New(isolate, static_cast<double>(requestData->error));
            argv[1] = Undefined(isolate);
        } else {
            // Format the disk info
            Local<Object> diskInfo = Object::New(isolate);

            // Check for Overflows
            assignOverflowableUInt64(isolate, *diskInfo, "available", requestData->available);
            assignOverflowableUInt64(isolate, *diskInfo, "free", requestData->free);
            assignOverflowableUInt64(isolate, *diskInfo, "total", requestData->total);
            assignOverflowableUInt64(isolate, *diskInfo, "used", (requestData->total - requestData->free));
            assignOverflowableUInt64(isolate, *diskInfo, "locked", (requestData->free - requestData->available));

            // Setup return values
            argv[0] = Undefined(isolate);
            argv[1] = diskInfo;
        }

        ignore_return Local<Function>::New(isolate, requestData->callback)->Call(
            isolate->GetCurrentContext(),
            Null(isolate),
            argc,
            argv
        );

        // Cleanup
        requestData->callback.Reset();
        free((void *) requestData->diskPath);
        delete requestData;
        delete request;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
movq (%rdi), %r14
callq 0x20e0
movq %rax, %r15
leaq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x2250
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x24b7
movq %rax, %xmm1
punpckldq 0xb6e(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0xb76(%rip), %xmm1      # 0x3010
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq %r15, %rdi
callq 0x2200
leaq 0x58(%r15), %r12
jmp 0x253c
movq %r15, %rdi
callq 0x2270
movq %rax, %r12
movq 0x18(%r14), %rcx
leaq 0xb63(%rip), %rdx       # 0x3030
movq %r15, %rdi
movq %rax, %rsi
callq 0x2280
movq 0x20(%r14), %rcx
leaq 0xc30(%rip), %rdx       # 0x3113
movq %r15, %rdi
movq %r12, %rsi
callq 0x2280
movq 0x28(%r14), %rcx
leaq 0xb41(%rip), %rdx       # 0x303a
movq %r15, %rdi
movq %r12, %rsi
callq 0x2280
movq 0x28(%r14), %rcx
subq 0x20(%r14), %rcx
leaq 0xb2d(%rip), %rdx       # 0x3040
movq %r15, %rdi
movq %r12, %rsi
callq 0x2280
movq 0x20(%r14), %rcx
subq 0x18(%r14), %rcx
leaq 0xb18(%rip), %rdx       # 0x3045
movq %r15, %rdi
movq %r12, %rsi
callq 0x2280
leaq 0x58(%r15), %rax
movq %rax, -0x30(%rbp)
movq %r12, -0x28(%rbp)
movq (%r14), %rax
testq %rax, %rax
je 0x255c
movq (%rax), %rsi
movq %r15, %rdi
callq 0x2190
movq %rax, %r12
jmp 0x255f
xorl %r12d, %r12d
movq %r15, %rdi
callq 0x2130
addq $0x68, %r15
pushq $0x2
popq %rcx
leaq -0x30(%rbp), %r8
movq %r12, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x2140
movq (%r14), %rdi
testq %rdi, %rdi
je 0x2591
callq 0x20a0
andq $0x0, (%r14)
movq 0x8(%r14), %rdi
callq 0x2090
pushq $0x30
popq %rsi
movq %r14, %rdi
callq 0x2060
movl $0x80, %esi
movq %rbx, %rdi
callq 0x2060
leaq -0x48(%rbp), %rdi
callq 0x20c0
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq