// File: /workspace/github_cpp_makefile_star2_O1/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 0xcdd2(%rip), %rax      # 0x11c20
movq %rax, (%rdi)
leaq 0xd348(%rip), %rax      # 0x121a0
movq (%rax), %rax
movq %rax, 0x18(%rdi)
callq 0x58ce
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x4f9c
movq (%r14), %rdx
testq %rdx, %rdx
je 0x4f9c
movq 0x10(%rdx), %rcx
testq %rcx, %rcx
je 0x4f9c
cmpq $0x0, 0x20(%rdx)
je 0x4f9c
movq 0x18(%rdx), %rdx
testq %rdx, %rdx
je 0x4ea8
cmpq %rax, 0x18(%rdx)
jne 0x4f9c
movq %rcx, 0x28(%rbx)
movq 0x20(%rcx), %r15
movq (%r15), %rcx
testq %rcx, %rcx
je 0x4ed5
xorl %eax, %eax
movl $0x1, %edx
cmpq %rbx, (%rcx)
movq 0x8(%rcx), %rsi
cmovel %edx, %eax
movq %rsi, %rcx
testq %rsi, %rsi
jne 0x4ebf
testl %eax, %eax
jne 0x4f02
movl $0x10, %edi
callq 0x3160
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 0x4f13
movl $0x0, 0x14(%rbx)
movq 0x20(%rax), %rax
movq %rax, 0x30(%rbx)
movq (%r14), %r15
testq %r15, %r15
je 0x4f83
movq 0x10(%r15), %rax
testq %rax, %rax
je 0x4f76
movq 0x40(%rax), %rdi
movq %rdi, %rax
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x4f5e
cmpq %r15, 0x10(%rdi)
jne 0x4f30
movq 0x8(%rdi), %rcx
testq %rcx, %rcx
je 0x4f4e
movq %rax, (%rcx)
movq %rcx, 0x8(%rax)
movl $0x18, %esi
callq 0x3170
jmp 0x4f76
movq 0xd06b(%rip), %rdi      # 0x11fd0
leaq 0x82cc(%rip), %rsi      # 0xd238
movl $0x21, %edx
callq 0x31a0
movl $0x28, %esi
movq %r15, %rdi
callq 0x3170
movq $0x0, (%r14)
movq 0x28(%rbx), %rax
cmpl $0x0, 0x10(%rax)
jne 0x4f9c
movq $0x0, 0x28(%rbx)
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rdi
callq 0x50a9