// File: /workspace/github_cpp_makefile_star2_O3/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 0x24b9
movq %rax, %xmm1
punpckldq 0xb6c(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0xb74(%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 0x253e
movq %r15, %rdi
callq 0x2270
movq %rax, %r12
movq 0x18(%r14), %rcx
leaq 0xb61(%rip), %rdx       # 0x3030
movq %r15, %rdi
movq %rax, %rsi
callq 0x2280
movq 0x20(%r14), %rcx
leaq 0xc2e(%rip), %rdx       # 0x3113
movq %r15, %rdi
movq %r12, %rsi
callq 0x2280
movq 0x28(%r14), %rcx
leaq 0xb3f(%rip), %rdx       # 0x303a
movq %r15, %rdi
movq %r12, %rsi
callq 0x2280
movq 0x28(%r14), %rcx
subq 0x20(%r14), %rcx
leaq 0xb2b(%rip), %rdx       # 0x3040
movq %r15, %rdi
movq %r12, %rsi
callq 0x2280
movq 0x20(%r14), %rcx
subq 0x18(%r14), %rcx
leaq 0xb16(%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 0x255e
movq (%rax), %rsi
movq %r15, %rdi
callq 0x2190
movq %rax, %r12
jmp 0x2561
xorl %r12d, %r12d
movq %r15, %rdi
callq 0x2130
addq $0x68, %r15
leaq -0x30(%rbp), %r8
movq %r12, %rdi
movq %rax, %rsi
movq %r15, %rdx
movl $0x2, %ecx
callq 0x2140
movq (%r14), %rdi
testq %rdi, %rdi
je 0x2598
callq 0x20a0
movq $0x0, (%r14)
movq 0x8(%r14), %rdi
callq 0x2090
movl $0x30, %esi
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