// File: /workspace/github_cpp_makefile_star2_O3/kiudee[P]VAHD-Projekt/./Subjects1-6.h
// Function: Relay::Relay(Identity*&)
Relay::Relay(Identity* &d)
{
    _home = _activeSubject;
    _setup();
    if (_home != NULL) {    // relay generated within subject?
        if (d == NULL) {
            if (WARNING) {
                std::cout << "-- Warning! Cannot establish connection from " << ID << " to NULL.\n";
            }
        } else {
            if (d->_source == NULL) {
                if (WARNING) {
                    std::cout << "-- Warning! Cannot establish connection from " << ID << " to NULL.\n";
                }
            } else {
                if (d->_base == NULL) {
                    if (WARNING) {
                        std::cout << "-- Warning! Private identity not correctly defined or already used.\n";
                    }
                } else {
                    if (d->_sink != NULL && d->_sink->_home != _home) {
                        if (WARNING) {
                            std::cout << "-- Warning! Identity of " << d->_source->ID << " not meant for " << ID << ".\n";
                        }
                    } else {
                        _oLink = d->_source;        // connect to relay point
                        _oLink->_iLinks->add(this);
                        if (d->_sink == NULL) {
                            _private = 0;
                        }
                        _base = d->_base;        // base = d-base
                        delete d;                // destroy identity
                        d = NULL;
                        if (DEBUG) {
                            std::cout << "-- Creating relay point " << ID << " to " << _oLink->ID << " with base " << _base->ID << ".\n";
                        }
                        if (!(_oLink->_awake)) {
                            _oLink = NULL;
                        }
                    }
                }
            }
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xce4a(%rip), %rax      # 0x10c58
movq %rax, (%rdi)
leaq 0xd388(%rip), %rax      # 0x111a0
movq (%rax), %rax
movq %rax, 0x18(%rdi)
callq 0x4856
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x3f5c
movq (%r14), %rdx
testq %rdx, %rdx
je 0x3f5c
movq 0x10(%rdx), %rcx
testq %rcx, %rcx
je 0x3f5c
cmpq $0x0, 0x20(%rdx)
je 0x3f5c
movq 0x18(%rdx), %rdx
testq %rdx, %rdx
je 0x3e68
cmpq %rax, 0x18(%rdx)
jne 0x3f5c
movq %rcx, 0x28(%rbx)
movq 0x20(%rcx), %r15
movq (%r15), %rcx
testq %rcx, %rcx
je 0x3e95
xorl %eax, %eax
movl $0x1, %edx
cmpq %rbx, (%rcx)
movq 0x8(%rcx), %rsi
cmovel %edx, %eax
movq %rsi, %rcx
testq %rsi, %rsi
jne 0x3e7f
testl %eax, %eax
jne 0x3ec2
movl $0x10, %edi
callq 0x2160
movq %rbx, (%rax)
movq $0x0, 0x8(%rax)
movq 0x8(%r15), %rcx
xorl %edx, %edx
testq %rcx, %rcx
setne %dl
cmoveq %r15, %rcx
movq %rax, 0x8(%rcx)
movq %rax, (%r15,%rdx,8)
movq (%r14), %rax
cmpq $0x0, 0x18(%rax)
jne 0x3ed3
movl $0x0, 0x14(%rbx)
movq 0x20(%rax), %rax
movq %rax, 0x30(%rbx)
movq (%r14), %r15
testq %r15, %r15
je 0x3f36
movq 0x10(%r15), %rax
testq %rax, %rax
je 0x3f36
movq 0x40(%rax), %rdi
movq %rdi, %rax
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x3f1e
cmpq %r15, 0x10(%rdi)
jne 0x3ef0
movq 0x8(%rdi), %rcx
testq %rcx, %rcx
je 0x3f0e
movq %rax, (%rcx)
movq %rcx, 0x8(%rax)
movl $0x18, %esi
callq 0x2170
jmp 0x3f36
movq 0xd0ab(%rip), %rdi      # 0x10fd0
leaq 0x830c(%rip), %rsi      # 0xc238
movl $0x21, %edx
callq 0x21a0
movl $0x28, %esi
movq %r15, %rdi
callq 0x2170
movq $0x0, (%r14)
movq 0x28(%rbx), %rax
cmpl $0x0, 0x10(%rax)
jne 0x3f5c
movq $0x0, 0x28(%rbx)
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rdi
callq 0x4071