// File: /workspace/github_cpp_makefile_star2_O1/bobverity[P]MavericK/Hungarian.cpp
// Function: hungarian(std::vector<std::vector<double, std::allocator<double>>, std::allocator<std::vector<double, std::allocator<double>>>>&, std::vector<int, std::allocator<int>>&, std::vector<int, std::allocator<int>>&, std::vector<int, std::allocator<int>>&, std::vector<int, std::allocator<int>>&, bool, std::basic_ofstream<char, std::char_traits<char>>&)
vector<int> hungarian(vector< vector<double> > &M, vector<int> &edgesLeft, vector<int> &edgesRight, vector<int> &blockedLeft, vector<int> &blockedRight, bool outputLog_on, ofstream &outputLog_fileStream) {
    int n = int(M.size());
    
    // define maximum number of reps in Hungarian algorithm before aborting
    int maxReps= int(1e6);
    
    // initialise assignment objects
    int numberAssigned;
    
    // search for solution until maxReps reached
    for (int rep=0; rep<maxReps; rep++) {
        
        // zero assignment objects
        for (int i=0; i<n; i++) {
            edgesLeft[i] = -1;
            edgesRight[i] = -1;
        }
        numberAssigned = 0;
        
        // subtract smallest element from all rows and columns
        double minRow;
		vector<double> minCol = M[0];
        for (int i=0; i<int(M.size()); i++) {
            minRow = *min_element(begin(M[i]),end(M[i]));
            for (int j=0; j<int(M[i].size()); j++) {
                M[i][j] -= minRow;
                if (M[i][j]<minCol[j])
                    minCol[j] = M[i][j];
            }
        }
        for (int i=0; i<int(M.size()); i++) {
            for (int j=0; j<int(M[i].size()); j++) {
                M[i][j] -= minCol[j];
            }
        }
        
        // generate an initial matching
        for (int i=0; i<n; i++) {
            for (int j=0; j<n; j++) {
                if (M[i][j]==0 && edgesRight[j]<0) {
                    edgesLeft[i] = j;
                    edgesRight[j] = i;
                    numberAssigned++;
                    break;
                }
            }
        }
        
        // if this matching is perfect then we are done
        if (numberAssigned==n)
            return(edgesLeft);
        
        // continue augmenting paths until no more possible
        //vector<int> blockedLeft(n);
        //vector<int> blockedRight(n);
        bool continueAugmenting = true;
        while (continueAugmenting) {
            continueAugmenting = false;
            
            // search all unmatched nodes
            for (int i=0; i<n; i++) {
                if (edgesLeft[i]<0) {
                    
                    // attempt to find augmented path
                    blockedLeft = vector<int>(n);
                    blockedRight = vector<int>(n);
                    vector<int> path = augmentLeft(i, M, edgesRight, blockedLeft, blockedRight);
                    
                    // if successful then augment
                    if (path[0]>=0) {
                        continueAugmenting = true;
                        numberAssigned ++;
                        for (int j=0; j<int(path.size()/2); j++) {
                            edgesLeft[path[j*2+1]] = path[j*2];
                            edgesRight[path[j*2]] = path[j*2+1];
                        }
                        
                        // if best matching found then finish
                        if (numberAssigned==n) {
                            return(edgesLeft);
                        }
                    }
                }
            }
        }
        
        // find minimum value in cost matrix, looking at all elements in which neither the row or the column is part of the minimum vertex cover
        double minVal = -log(double(0));
        for (int i=0; i<n; i++) {
            for (int j=0; j<n; j++) {
                if (blockedLeft[i]==1 && blockedRight[j]==0 && M[i][j]<minVal) {
                    minVal = M[i][j];
                }
            }
        }
        
        // add or subtract this value from cost matrix as required
        for (int i=0; i<n; i++) {
            for (int j=0; j<n; j++) {
                if (blockedLeft[i]==1 && blockedRight[j]==0) {
                    M[i][j] -= minVal;
                }
                if (blockedLeft[i]==0 && blockedRight[j]==1) {
                    M[i][j] += minVal;
                }
            }
        }
        
        // at this point we have a new cost matrix and can repeat the process from the top
        
    } // rep loop
    
    cerrAndLog("\nError: failed to solve label switching problem. Hungarian algorithm failed to find best assignment within " + to_string((long long)maxReps) + string(" iterations given the following cost matrix:\n"), outputLog_on, outputLog_fileStream);
    for (int i=0; i<n; i++) {
        for (int j=0; j<n; j++) {
            cerrAndLog(to_string((long long)M[i][j])+string(" "), outputLog_on, outputLog_fileStream);
        }
        cerrAndLog("\n", outputLog_on, outputLog_fileStream);
    }
    
    exit(1);
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %r9, %r13
movq %r8, %rbp
movq %rcx, 0x40(%rsp)
movq %rdx, %r14
movq %rdi, 0x78(%rsp)
movq 0x8(%rsi), %rax
movq %rsi, 0x50(%rsp)
subq (%rsi), %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
testl %eax, %eax
setg 0x6(%rsp)
movq %rax, 0x8(%rsp)
movslq %eax, %rsi
movl %esi, %r15d
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
xorl %ecx, %ecx
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movq $0x0, 0x80(%rsp)
movq %rdx, 0xb0(%rsp)
movq %rsi, 0x48(%rsp)
movq %rcx, 0xa8(%rsp)
cmpl $0x0, 0x8(%rsp)
jle 0x61c4
movq (%r14), %rax
movq 0x40(%rsp), %rcx
movq (%rcx), %rcx
xorl %edx, %edx
movl %edi, (%rax,%rdx,4)
movl %edi, (%rcx,%rdx,4)
incq %rdx
cmpq %rdx, %r15
jne 0x61b6
movq 0x50(%rsp), %rbx
movq (%rbx), %rsi
leaq 0x58(%rsp), %rdi
callq 0x5da0
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdx, %rcx
testl %ecx, %ecx
jle 0x62a0
movq 0x58(%rsp), %rdx
movl %ecx, %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
xorl %edi, %edi
leaq (%rdi,%rdi,2), %r9
movq (%rax,%r9,8), %r8
movq 0x8(%rax,%r9,8), %r9
cmpq %r9, %r8
sete %r11b
leaq 0x8(%r8), %r10
cmpq %r9, %r10
sete %bl
orb %r11b, %bl
movq %r8, %r11
jne 0x624f
movq %r8, %rbx
movsd (%rbx), %xmm0
ucomisd (%r10), %xmm0
movq %r10, %r11
ja 0x6243
movq %rbx, %r11
addq $0x8, %r10
movq %r11, %rbx
cmpq %r9, %r10
jne 0x6232
subq %r8, %r9
shrq $0x3, %r9
testl %r9d, %r9d
jle 0x6294
movsd (%r11), %xmm0
andl $0x7fffffff, %r9d       # imm = 0x7FFFFFFF
xorl %r10d, %r10d
movsd (%r8,%r10,8), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, (%r8,%r10,8)
movsd (%rdx,%r10,8), %xmm2
ucomisd %xmm1, %xmm2
jbe 0x628c
movsd %xmm1, (%rdx,%r10,8)
incq %r10
cmpq %r10, %r9
jne 0x626a
incq %rdi
cmpq %rsi, %rdi
jne 0x6209
testl %ecx, %ecx
jle 0x62f6
movq 0x58(%rsp), %rdx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %esi, %esi
leaq (%rsi,%rsi,2), %r8
movq (%rax,%r8,8), %rdi
movq 0x8(%rax,%r8,8), %r8
subq %rdi, %r8
shrq $0x3, %r8
testl %r8d, %r8d
jle 0x62ee
andl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
xorl %r9d, %r9d
movsd (%rdi,%r9,8), %xmm0
subsd (%rdx,%r9,8), %xmm0
movsd %xmm0, (%rdi,%r9,8)
incq %r9
cmpq %r9, %r8
jne 0x62d4
incq %rsi
cmpq %rcx, %rsi
jne 0x62b1
cmpl $0x0, 0x8(%rsp)
jle 0x6352
movq (%r14), %rcx
xorl %edx, %edx
movl $0x0, 0x30(%rsp)
leaq (%rdx,%rdx,2), %rsi
movq (%rax,%rsi,8), %r8
movq 0x40(%rsp), %rsi
movq (%rsi), %rsi
xorl %edi, %edi
movsd (%r8,%rdi,8), %xmm0
ucomisd 0x30d7e(%rip), %xmm0    # 0x370a8
jne 0x6334
jp 0x6334
cmpl $0x0, (%rsi,%rdi,4)
js 0x633e
incq %rdi
cmpq %rdi, %r15
jne 0x631c
jmp 0x6348
movl %edi, (%rcx,%rdx,4)
movl %edx, (%rsi,%rdi,4)
incl 0x30(%rsp)
incq %rdx
cmpq %r15, %rdx
jne 0x630a
jmp 0x635a
movl $0x0, 0x30(%rsp)
movl 0x30(%rsp), %eax
cmpl 0x8(%rsp), %eax
je 0x69d9
movb $0x1, %al
movq 0x48(%rsp), %rsi
testb $0x1, %al
movb %al, 0x7(%rsp)
je 0x655b
cmpl $0x0, 0x8(%rsp)
jle 0x653b
xorl %ebx, %ebx
movb 0x6(%rsp), %r12b
movl $0x0, 0x3c(%rsp)
movq (%r14), %rax
cmpl $0x0, (%rax,%rbx,4)
jns 0x6526
leaq 0x10(%rsp), %rdi
leaq 0xb8(%rsp), %rdx
callq 0x6b04
movq (%rbp), %rdi
movaps 0x10(%rsp), %xmm0
movq 0x20(%rsp), %rax
movq %rdi, 0x10(%rsp)
movups 0x8(%rbp), %xmm1
movups %xmm0, (%rbp)
movq %rax, 0x10(%rbp)
movups %xmm1, 0x18(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
testq %rdi, %rdi
je 0x63f3
callq 0x3310
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x6402
callq 0x3310
leaq 0x10(%rsp), %rdi
movq 0x48(%rsp), %rsi
leaq 0xb8(%rsp), %rdx
callq 0x6b04
movq (%r13), %rdi
movapd 0x10(%rsp), %xmm0
movq 0x20(%rsp), %rax
movq %rdi, 0x10(%rsp)
movupd 0x8(%r13), %xmm1
movupd %xmm0, (%r13)
movq %rax, 0x10(%r13)
movupd %xmm1, 0x18(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
testq %rdi, %rdi
je 0x6460
callq 0x3310
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x646f
callq 0x3310
leaq 0x10(%rsp), %rdi
movl %ebx, %esi
movq 0x50(%rsp), %rdx
movq 0x40(%rsp), %rcx
movq %rbp, %r8
movq %r13, %r9
callq 0x5e48
movq 0x10(%rsp), %rax
cmpl $0x0, (%rax)
js 0x6502
movq 0x18(%rsp), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
testl %ecx, %ecx
jle 0x64da
movq (%r14), %rdx
movq 0x40(%rsp), %rsi
movq (%rsi), %rsi
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %edi, %edi
movl (%rax,%rdi,8), %r8d
movslq 0x4(%rax,%rdi,8), %r9
movl %r8d, (%rdx,%r9,4)
movl 0x4(%rax,%rdi,8), %r8d
movslq (%rax,%rdi,8), %r9
movl %r8d, (%rsi,%r9,4)
incq %rdi
cmpq %rdi, %rcx
jne 0x64b8
movl 0x30(%rsp), %eax
incl %eax
movb $0x1, %cl
movl %ecx, 0x3c(%rsp)
movl %eax, 0x30(%rsp)
cmpl 0x8(%rsp), %eax
jne 0x6502
movq 0x78(%rsp), %rdi
movq %r14, %rsi
callq 0x6b8e
xorl %r14d, %r14d
jmp 0x6505
movb $0x1, %r14b
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x6514
callq 0x3310
testb %r14b, %r14b
movq 0xb0(%rsp), %r14
movq 0x48(%rsp), %rsi
je 0x6548
incq %rbx
cmpq %rsi, %rbx
setl %r12b
cmpq %r15, %rbx
jne 0x6395
jmp 0x6548
movl $0x0, 0x3c(%rsp)
movb 0x6(%rsp), %r12b
testb $0x1, %r12b
movl 0x3c(%rsp), %eax
je 0x636f
jmp 0x663a
xorpd %xmm0, %xmm0
callq 0x3290
xorpd 0x30ad4(%rip), %xmm0    # 0x37040
cmpl $0x0, 0x8(%rsp)
jle 0x65c2
movq (%rbp), %rax
movq (%r13), %rcx
movq 0x50(%rsp), %rdx
movq (%rdx), %rdx
xorl %esi, %esi
movl (%rax,%rsi,4), %edi
leaq (%rsi,%rsi,2), %r8
leaq (%rdx,%r8,8), %r8
xorl %r9d, %r9d
cmpl $0x1, %edi
jne 0x65b2
cmpl $0x0, (%rcx,%r9,4)
jne 0x65b2
movq (%r8), %r10
movsd (%r10,%r9,8), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x65b2
movapd %xmm1, %xmm0
incq %r9
cmpq %r9, %r15
jne 0x6593
incq %rsi
cmpq %r15, %rsi
jne 0x6585
cmpl $0x0, 0x8(%rsp)
jle 0x663a
movq (%rbp), %rax
xorl %ecx, %ecx
movl (%rax,%rcx,4), %edx
movq (%r13), %rsi
leaq (%rcx,%rcx,2), %rdi
shlq $0x3, %rdi
movq 0x50(%rsp), %r8
addq (%r8), %rdi
xorl %r8d, %r8d
testl %edx, %edx
je 0x6610
cmpl $0x1, %edx
jne 0x662a
cmpl $0x0, (%rsi,%r8,4)
jne 0x660c
movq (%rdi), %r9
movsd (%r9,%r8,8), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, (%r9,%r8,8)
testl %edx, %edx
jne 0x662a
cmpl $0x1, (%rsi,%r8,4)
jne 0x662a
movq (%rdi), %r9
movsd (%r9,%r8,8), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%r9,%r8,8)
incq %r8
cmpq %r8, %r15
jne 0x65e9
incq %rcx
cmpq %r15, %rcx
jne 0x65cf
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x6649
callq 0x3310
testb $0x1, 0x7(%rsp)
jne 0x69f5
movq 0x80(%rsp), %rax
cmpl $0xf423f, %eax          # imm = 0xF423F
leal 0x1(%rax), %eax
setae %cl
movl %eax, %edx
movq %rdx, 0x80(%rsp)
cmpl $0xf4240, %eax          # imm = 0xF4240
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
jne 0x619a
leaq 0x10(%rsp), %rbx
movl $0xf4240, %esi          # imm = 0xF4240
movq %rbx, %rdi
callq 0x6d26
leaq 0x30a16(%rip), %rsi     # 0x370b0
leaq 0x58(%rsp), %rdi
movq %rbx, %rdx
callq 0x6cb6
leaq 0xc8(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x30a62(%rip), %rsi     # 0x3711c
leaq 0x30a88(%rip), %rdx     # 0x37149
leaq 0xb8(%rsp), %rdi
callq 0x6e56
leaq 0xf8(%rsp), %rdi
leaq 0x58(%rsp), %rsi
leaq 0xb8(%rsp), %rdx
callq 0x6c0e
movzbl 0x150(%rsp), %esi
leaq 0xf8(%rsp), %rdi
movl %esi, 0x48(%rsp)
movq 0x158(%rsp), %rdx
callq 0x1db5c
leaq 0x108(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x671f
callq 0x3310
movq 0xb8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x6731
callq 0x3310
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6744
callq 0x3310
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6757
callq 0x3310
cmpl $0x0, 0x8(%rsp)
jle 0x69cf
leaq 0x98(%rsp), %r12
movq 0x8(%rsp), %rax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, 0x8(%rsp)
xorl %eax, %eax
movq %rax, 0x30(%rsp)
leaq (%rax,%rax,2), %rax
movq %rax, 0x40(%rsp)
xorl %r14d, %r14d
movq %r12, %rbx
movq 0x50(%rsp), %rax
movq (%rax), %rax
movq 0x40(%rsp), %rcx
movq (%rax,%rcx,8), %rax
cvttsd2si (%rax,%r14,8), %r15
movq %r15, %r12
negq %r12
cmovsq %r15, %r12
movl $0x1, %ebp
cmpq $0xa, %r12
jb 0x680a
movl $0x4, %ebp
movq %r12, %rcx
movabsq $0x346dc5d63886594b, %rsi # imm = 0x346DC5D63886594B
cmpq $0x63, %rcx
jbe 0x6803
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0x6808
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0x680a
movq %rcx, %rax
mulq %rsi
shrq $0xb, %rdx
addl $0x4, %ebp
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0x67cd
addl $-0x3, %ebp
jmp 0x680a
addl $-0x2, %ebp
jmp 0x680a
decl %ebp
shrq $0x3f, %r15
leal (%r15,%rbp), %esi
leaq 0x68(%rsp), %r13
movq %r13, 0x58(%rsp)
leaq 0x58(%rsp), %rdi
movl $0x2d, %edx
callq 0x33a0
addq 0x58(%rsp), %r15
movq %r15, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0x6dda
leaq 0x20(%rsp), %r15
movq %r15, 0x10(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0x33230(%rip), %rsi     # 0x39a83
leaq 0x3322a(%rip), %rdx     # 0x39a84
callq 0x6e56
movq 0x58(%rsp), %rcx
movl $0xf, %esi
cmpq %r13, %rcx
movq %rbx, %r12
je 0x6876
movq 0x68(%rsp), %rsi
movq 0x60(%rsp), %r8
movq 0x18(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rsi, %rax
jbe 0x689f
movl $0xf, %esi
cmpq %r15, 0x10(%rsp)
je 0x689a
movq 0x20(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x68b0
movq 0x10(%rsp), %rsi
leaq 0x58(%rsp), %rdi
callq 0x30e0
jmp 0x68be
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3370
movq %r12, 0x88(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x68e7
movq %rdx, 0x88(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x98(%rsp)
jmp 0x68f1
movupd (%rcx), %xmm0
movupd %xmm0, (%r12)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x90(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x88(%rsp), %rdi
movl 0x48(%rsp), %esi
movq 0x158(%rsp), %rdx
callq 0x1db5c
movq 0x88(%rsp), %rdi
cmpq %r12, %rdi
je 0x693c
callq 0x3310
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x694b
callq 0x3310
movq 0x58(%rsp), %rdi
cmpq %r13, %rdi
je 0x695a
callq 0x3310
incq %r14
cmpq 0x8(%rsp), %r14
jne 0x678c
leaq 0xe8(%rsp), %rbx
movq %rbx, 0xd8(%rsp)
leaq 0xd8(%rsp), %r14
movq %r14, %rdi
leaq 0x30f98(%rip), %rsi     # 0x37922
leaq 0x30f92(%rip), %rdx     # 0x37923
callq 0x6e56
movq %r14, %rdi
movl 0x48(%rsp), %esi
movq 0x158(%rsp), %rdx
callq 0x1db5c
movq 0xd8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x69bc
callq 0x3310
movq 0x30(%rsp), %rax
incq %rax
cmpq 0x8(%rsp), %rax
jne 0x677b
movl $0x1, %edi
callq 0x33d0
movq 0x78(%rsp), %rdi
movq %r14, %rsi
callq 0x6b8e
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x69f5
callq 0x3310
testb $0x1, 0xa8(%rsp)
jne 0x6681
movq 0x78(%rsp), %rax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
movq 0xd8(%rsp), %rdi
cmpq %rbx, %rdi
jne 0x6af6
jmp 0x6afb
movq %rax, %r15
movq 0x88(%rsp), %rdi
cmpq %r12, %rdi
je 0x6a4d
callq 0x3310
jmp 0x6a4d
movq %rax, %r15
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x6a66
callq 0x3310
jmp 0x6a66
movq %rax, %r15
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
jmp 0x6aca
jmp 0x6ae9
movq %rax, %r15
leaq 0x108(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6a92
callq 0x3310
jmp 0x6a92
movq %rax, %r15
movq 0xb8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x6aa9
callq 0x3310
jmp 0x6aa9
movq %rax, %r15
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6ac1
callq 0x3310
jmp 0x6ac1
movq %rax, %r15
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x6af6
jmp 0x6afb
movq %rax, %r15
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x6aec
callq 0x3310
jmp 0x6aec
jmp 0x6ae9
jmp 0x6ae9
movq %rax, %r15
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x6afb
callq 0x3310
movq %r15, %rdi
callq 0x3580
nop