// File: /workspace/github_cpp_makefile_star2_O3/Pyboon[P]sage/isi_sage.cpp
// Function: IsiSage::ParamsIterationUpdate()
void IsiSage::ParamsIterationUpdate(){
    Util::log("SAGE iteration step for updating params");
    int n_step = 1;
    SageResult last_update_result; 
    while(n_step <= max_iter_num){
        Util::log("====== Starting the " + to_string(n_step) + "th iteration step ======");
        // save init result of all path
        last_update_result = result;
        complex_mat y;
        for(int i_path = 0; i_path < max_path_num; ++i_path){
            y = CIR;
            //========== Expectation Step ==================
            for(int j = 0; j<max_path_num; ++j){
                if(j!=i_path){
                    y.row(result.tau(j)-1) -= SignalConstruct(j);
                }
            }
            //========== Maximization Step =================
            // update tau 
            RowVectorXcd tau_data = UpdateTau(y, i_path);
            // update AoA
            UpdateAoA(tau_data, i_path);
            // update AoD
            UpdateAoD(tau_data, i_path);
            // update doppler
            UpdateDoppler(tau_data, i_path);
            // update alpha 
            UpdateAlpha(tau_data, i_path);

        }
        // judge coverage
        if(IterConvergence(last_update_result, result)){
            Util::log("Iteration has coveraged !");
            break;
        }

        ++n_step;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x278, %rsp            # imm = 0x278
movq %rdi, %rbx
leaq 0x160(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x12159(%rip), %rsi     # 0x1d836
leaq 0x12179(%rip), %rdx     # 0x1d85d
leaq 0x150(%rsp), %r14
movq %r14, %rdi
callq 0x43cc
movq %r14, %rdi
callq 0x60be
movq 0x150(%rsp), %rdi
cmpq %r15, %rdi
je 0xb719
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x32a0
xorpd %xmm0, %xmm0
movapd %xmm0, 0x130(%rsp)
movapd %xmm0, 0x120(%rsp)
movapd %xmm0, 0x110(%rsp)
movapd %xmm0, 0x100(%rsp)
movapd %xmm0, 0xf0(%rsp)
movapd %xmm0, 0xe0(%rsp)
movapd %xmm0, 0xd0(%rsp)
movq $0x0, 0x140(%rsp)
cmpl $0x0, 0x158(%rbx)
jle 0xbcbf
leaq 0x1c0(%rbx), %r14
leaq 0x138(%rbx), %rax
movq %rax, 0x68(%rsp)
movl $0x1, %edx
leaq 0x20(%rsp), %r12
movq %rsp, %rbp
movl $0xd1b71759, %esi       # imm = 0xD1B71759
movl $0x1, %r15d
cmpl $0xa, %edx
jb 0xb7e6
movl $0x4, %r15d
movl %edx, %eax
cmpl $0x63, %eax
jbe 0xb7dd
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0xb7e3
cmpl $0x2710, %eax           # imm = 0x2710
jb 0xb7e6
movl %eax, %ecx
imulq %rsi, %rcx
shrq $0x2d, %rcx
addl $0x4, %r15d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0xb7ad
addl $-0x3, %r15d
jmp 0xb7e6
addl $-0x2, %r15d
jmp 0xb7e6
decl %r15d
movq %rdx, 0x40(%rsp)
movl %r15d, %esi
leaq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
movq %r12, %rdi
movl $0x2d, %edx
callq 0x32f0
movq 0x20(%rsp), %rdi
movl %r15d, %esi
movq 0x40(%rsp), %rdx
callq 0xf9e9
movl $0x14, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x12033(%rip), %rcx     # 0x1d85e
callq 0x32b0
leaq 0x10(%rsp), %rsi
movq %rsi, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xb856
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0xb85e
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbp, %rdi
leaq 0x11ff3(%rip), %rsi     # 0x1d873
callq 0x34a0
leaq 0x58(%rsp), %rsi
movq %rsi, 0x48(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xb8ad
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0xb8b5
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x50(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x48(%rsp), %rdi
callq 0x60be
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xb8f3
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x32a0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xb90e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x32a0
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0xb92a
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32a0
leaq 0xd0(%rsp), %rdi
movq %r14, %rsi
callq 0xf4f0
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
cmpl $0x0, 0x15c(%rbx)
jle 0xbb42
xorl %r15d, %r15d
movq %rbp, %rdi
movq 0x68(%rsp), %rsi
movq %r12, %rdx
callq 0x1a385
movl 0x15c(%rbx), %eax
testl %eax, %eax
jle 0xba3d
xorl %r13d, %r13d
cmpq %r15, %r13
je 0xba2e
movq %r12, %rdi
movq %rbx, %rsi
movl %r13d, %edx
callq 0xb246
cmpq %r13, 0x1c8(%rbx)
jle 0xbd6a
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
testq %rax, %rax
sete %dl
testq %rcx, %rcx
setns %sil
orb %dl, %sil
je 0xbd2c
movq (%r14), %rdx
movl (%rdx,%r13,4), %edx
testl %edx, %edx
jle 0xbd89
decl %edx
movslq %edx, %rsi
movq 0x8(%rsp), %rdx
cmpq %rsi, %rdx
jle 0xbd89
cmpq 0x28(%rsp), %rcx
jne 0xbd4b
movq 0x20(%rsp), %rdi
testq %rcx, %rcx
jle 0xba23
shlq $0x4, %rsi
addq %rsi, %rax
shlq $0x4, %rdx
movupd (%rdi), %xmm0
movupd (%rax), %xmm1
subpd %xmm0, %xmm1
movupd %xmm1, (%rax)
addq $0x10, %rdi
addq %rdx, %rax
decq %rcx
jne 0xba02
movq 0x20(%rsp), %rdi
callq 0x3310
movl 0x15c(%rbx), %eax
incq %r13
movslq %eax, %rcx
cmpq %rcx, %r13
jl 0xb97d
leaq 0x170(%rsp), %r13
movq %r13, %rdi
movq %rbp, %rsi
callq 0xfbc6
movq %r12, %rdi
movq %rbx, %rsi
movq %r13, %rdx
movl %r15d, %ecx
callq 0xbf5c
movq 0x170(%rsp), %rdi
callq 0x3310
leaq 0xa0(%rsp), %rdi
movq %r12, %rsi
callq 0xfc92
movq %rbx, %rdi
leaq 0xa0(%rsp), %rsi
movl %r15d, %edx
callq 0xc648
movq 0xa0(%rsp), %rdi
callq 0x3310
leaq 0x90(%rsp), %rdi
movq %r12, %rsi
callq 0xfc92
movq %rbx, %rdi
leaq 0x90(%rsp), %rsi
movl %r15d, %edx
callq 0xce60
movq 0x90(%rsp), %rdi
callq 0x3310
leaq 0x80(%rsp), %rdi
movq %r12, %rsi
callq 0xfc92
movq %rbx, %rdi
leaq 0x80(%rsp), %rsi
movl %r15d, %edx
callq 0xd678
movq 0x80(%rsp), %rdi
callq 0x3310
leaq 0x70(%rsp), %rdi
movq %r12, %rsi
callq 0xfc92
movq %rbx, %rdi
leaq 0x70(%rsp), %rsi
movl %r15d, %edx
callq 0xa21e
movq 0x70(%rsp), %rdi
callq 0x3310
movq 0x20(%rsp), %rdi
callq 0x3310
incq %r15
movslq 0x15c(%rbx), %rax
cmpq %rax, %r15
jl 0xb95c
leaq 0x188(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0xf87e
leaq 0x200(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0xf87e
movq (%rbx), %rax
movq %rbx, %rdi
leaq 0x188(%rsp), %rsi
movq %r15, %rdx
callq *0x28(%rax)
movl %eax, %r15d
movq 0x260(%rsp), %rdi
callq 0x3310
movq 0x250(%rsp), %rdi
callq 0x3310
movq 0x240(%rsp), %rdi
callq 0x3310
movq 0x230(%rsp), %rdi
callq 0x3310
movq 0x220(%rsp), %rdi
callq 0x3310
movq 0x210(%rsp), %rdi
callq 0x3310
movq 0x200(%rsp), %rdi
callq 0x3310
movq 0x1e8(%rsp), %rdi
callq 0x3310
movq 0x1d8(%rsp), %rdi
callq 0x3310
movq 0x1c8(%rsp), %rdi
callq 0x3310
movq 0x1b8(%rsp), %rdi
callq 0x3310
movq 0x1a8(%rsp), %rdi
callq 0x3310
movq 0x198(%rsp), %rdi
callq 0x3310
movq 0x188(%rsp), %rdi
callq 0x3310
testb %r15b, %r15b
jne 0xbc65
movq 0x40(%rsp), %r13
leal 0x1(%r13), %r15d
movq (%rsp), %rdi
callq 0x3310
cmpl 0x158(%rbx), %r13d
movl %r15d, %edx
movl $0xd1b71759, %esi       # imm = 0xD1B71759
jl 0xb79a
jmp 0xbcbf
leaq 0xc0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x11c14(%rip), %rsi     # 0x1d88c
leaq 0x11c26(%rip), %rdx     # 0x1d8a5
leaq 0xb0(%rsp), %rdi
callq 0x43cc
leaq 0xb0(%rsp), %rdi
callq 0x60be
movq 0xb0(%rsp), %rdi
cmpq %r14, %rdi
je 0xbcb6
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x32a0
movq (%rsp), %rdi
callq 0x3310
movq 0x130(%rsp), %rdi
callq 0x3310
movq 0x120(%rsp), %rdi
callq 0x3310
movq 0x110(%rsp), %rdi
callq 0x3310
movq 0x100(%rsp), %rdi
callq 0x3310
movq 0xf0(%rsp), %rdi
callq 0x3310
movq 0xe0(%rsp), %rdi
callq 0x3310
movq 0xd0(%rsp), %rdi
callq 0x3310
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x123df(%rip), %rdi     # 0x1e112
leaq 0x12482(%rip), %rsi     # 0x1e1bc
leaq 0x12496(%rip), %rcx     # 0x1e1d7
movl $0xaf, %edx
callq 0x31b0
leaq 0x1254d(%rip), %rdi     # 0x1e29f
leaq 0x107ca(%rip), %rsi     # 0x1c523
leaq 0x12574(%rip), %rcx     # 0x1e2d4
movl $0x2c6, %edx            # imm = 0x2C6
callq 0x31b0
leaq 0x11545(%rip), %rdi     # 0x1d2b6
leaq 0x10cc4(%rip), %rsi     # 0x1ca3c
leaq 0x11554(%rip), %rcx     # 0x1d2d3
movl $0x1a9, %edx            # imm = 0x1A9
callq 0x31b0
leaq 0x12201(%rip), %rdi     # 0x1df91
leaq 0x122a1(%rip), %rsi     # 0x1e038
leaq 0x122b3(%rip), %rcx     # 0x1e051
movl $0x7a, %edx
callq 0x31b0
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
cmpq %r14, %rdi
je 0xbef0
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0xbef0
jmp 0xbeed
movq %rax, %rbx
movq 0x150(%rsp), %rdi
cmpq %r15, %rdi
je 0xbf54
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0xbf54
movq %rax, %rbx
jmp 0xbe14
movq %rax, %rbx
leaq 0x200(%rsp), %rdi
callq 0x425a
leaq 0x188(%rsp), %rdi
callq 0x425a
jmp 0xbef0
jmp 0xbeed
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xbe5e
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0xbe5e
movq %rax, %rbx
jmp 0xbe79
jmp 0xbe53
movq %rax, %rbx
jmp 0xbef9
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xbe79
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x32a0
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0xbef9
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0xbef9
movq %rax, %rbx
movq 0x90(%rsp), %rdi
jmp 0xbed5
jmp 0xbeed
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
jmp 0xbed5
movq %rax, %rbx
movq 0x170(%rsp), %rdi
jmp 0xbee6
movq %rax, %rbx
movq 0x70(%rsp), %rdi
jmp 0xbed5
movq %rax, %rbx
movq 0x80(%rsp), %rdi
callq 0x3310
jmp 0xbee1
jmp 0xbeed
movq %rax, %rbx
movq 0x20(%rsp), %rdi
callq 0x3310
jmp 0xbef0
movq %rax, %rbx
movq (%rsp), %rdi
callq 0x3310
movq 0x130(%rsp), %rdi
callq 0x3310
movq 0x120(%rsp), %rdi
callq 0x3310
movq 0x110(%rsp), %rdi
callq 0x3310
movq 0x100(%rsp), %rdi
callq 0x3310
movq 0xf0(%rsp), %rdi
callq 0x3310
movq 0xe0(%rsp), %rdi
callq 0x3310
movq 0xd0(%rsp), %rdi
callq 0x3310
movq %rbx, %rdi
callq 0x3450