// File: /workspace/github_cpp_makefile_star2_O1/msu-starx[P]starx/exosuit.cpp
// Function: ExoSuit::updateSensors()
void ExoSuit::updateSensors(void){
    u.clear();
    y.clear();
    lasty.clear();
    pressureStates.clear();
    forceStates.clear();
    emgStates.clear();
    for(int i = 0; i < SensorMax; i++) {
        // Pressure Sensors
        /*if(i < pressurePins.size())
           pressureStates.push_back(cvt.convertToPressure(cvt.convertToVoltage(adcValues[pressurePins[i]], board.ADCVoltageMultiplier)));*/
        if(i < pressurePins.size()) {
            u.push_back(cvt.convertToPressure(cvt.convertToVoltage(adcValues[pressurePins[i]], board.ADCVoltageMultiplier)));
            y.push_back(0.945 * lasty[i] + 0.0549 * u[i]);
            lasty.push_back(y[i]);
            pressureStates.push_back(y[i]);
        }
        // Force Sensors
        if(i < forcePins.size())
            forceStates.push_back(cvt.convertToForce(cvt.convertToVoltage(adcValues[forcePins[i]], board.ADCVoltageMultiplier)));
        // EMG Sensors
        if(i < emgPins.size())
            emgStates.push_back(cvt.convertToVoltage(adcValues[emgPins[i]], board.ADCVoltageMultiplier));
    }
    for(int i = 0; i < pressureStates.size(); i++) {
        std::cout << pressureStates[i] << " ";
    }
    for(int i = 0; i < emgStates.size(); i++) {
        std::cout << emgStates[i] << " ";
    }
    std::cout << std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq (%rdi), %rax
cmpq %rax, 0x8(%rdi)
je 0x322d
movq %rax, 0x8(%rbx)
movq 0x18(%rbx), %rax
cmpq %rax, 0x20(%rbx)
je 0x323b
movq %rax, 0x20(%rbx)
movq 0x30(%rbx), %rax
cmpq %rax, 0x38(%rbx)
je 0x3249
movq %rax, 0x38(%rbx)
movq 0x378(%rbx), %rax
cmpq %rax, 0x380(%rbx)
je 0x3260
movq %rax, 0x380(%rbx)
movq 0x390(%rbx), %rax
cmpq %rax, 0x398(%rbx)
je 0x3277
movq %rax, 0x398(%rbx)
movq 0x3a8(%rbx), %rax
cmpq %rax, 0x3b0(%rbx)
je 0x328e
movq %rax, 0x3b0(%rbx)
cmpl $0x0, 0x310(%rbx)
je 0x34e9
leaq 0x18(%rbx), %rax
movq %rax, -0x58(%rbp)
leaq 0x30(%rbx), %rax
movq %rax, -0x50(%rbp)
leaq 0x378(%rbx), %rax
movq %rax, -0x48(%rbp)
leaq 0x390(%rbx), %rax
movq %rax, -0x40(%rbp)
leaq 0x3a8(%rbx), %rax
movq %rax, -0x38(%rbp)
leaq 0x48(%rbx), %r15
xorl %r13d, %r13d
leaq -0x30(%rbp), %r12
xorl %r14d, %r14d
movq 0x330(%rbx), %rax
movq 0x338(%rbx), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r14, %rcx
jbe 0x33f7
movslq (%rax,%r14,4), %rax
movq 0x318(%rbx), %rcx
movl (%rcx,%rax,4), %esi
movsd 0x1e8(%rbx), %xmm0
movq %r15, %rdi
callq 0x528c
movq %r15, %rdi
callq 0x529a
movsd %xmm0, -0x30(%rbp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x333b
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x3346
movq %rbx, %rdi
movq %r12, %rdx
callq 0x3f08
movq (%rbx), %rax
movq 0x30(%rbx), %rcx
movsd (%rax,%r14,8), %xmm1
mulsd 0x2d5d(%rip), %xmm1     # 0x60b8
movsd (%rcx,%r14,8), %xmm0
mulsd 0x2d57(%rip), %xmm0     # 0x60c0
addsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movq 0x20(%rbx), %rsi
cmpq 0x28(%rbx), %rsi
je 0x338a
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x20(%rbx)
jmp 0x3396
movq -0x58(%rbp), %rdi
movq %r12, %rdx
callq 0x3f08
movq 0x18(%rbx), %rdx
addq %r13, %rdx
movq 0x38(%rbx), %rsi
cmpq 0x40(%rbx), %rsi
je 0x33b9
movsd (%rdx), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x38(%rbx)
jmp 0x33c2
movq -0x50(%rbp), %rdi
callq 0x404c
movq 0x18(%rbx), %rdx
addq %r13, %rdx
movq 0x380(%rbx), %rsi
cmpq 0x388(%rbx), %rsi
je 0x33ee
movsd (%rdx), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x380(%rbx)
jmp 0x33f7
movq -0x48(%rbp), %rdi
callq 0x404c
movq 0x348(%rbx), %rax
movq 0x350(%rbx), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r14, %rcx
jbe 0x3469
movslq (%rax,%r14,4), %rax
movq 0x318(%rbx), %rcx
movl (%rcx,%rax,4), %esi
movsd 0x1e8(%rbx), %xmm0
movq %r15, %rdi
callq 0x528c
movq %r15, %rdi
callq 0x52b8
movsd %xmm0, -0x30(%rbp)
movq 0x398(%rbx), %rsi
cmpq 0x3a0(%rbx), %rsi
je 0x345d
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x398(%rbx)
jmp 0x3469
movq -0x40(%rbp), %rdi
movq %r12, %rdx
callq 0x3f08
movq 0x360(%rbx), %rax
movq 0x368(%rbx), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r14, %rcx
jbe 0x34d3
movslq (%rax,%r14,4), %rax
movq 0x318(%rbx), %rcx
movl (%rcx,%rax,4), %esi
movsd 0x1e8(%rbx), %xmm0
movq %r15, %rdi
callq 0x528c
movsd %xmm0, -0x30(%rbp)
movq 0x3b0(%rbx), %rsi
cmpq 0x3b8(%rbx), %rsi
je 0x34c7
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x3b0(%rbx)
jmp 0x34d3
movq -0x38(%rbp), %rdi
movq %r12, %rdx
callq 0x3f08
incq %r14
movl 0x310(%rbx), %eax
addq $0x8, %r13
cmpq %rax, %r14
jb 0x32da
movq 0x378(%rbx), %rax
cmpq %rax, 0x380(%rbx)
je 0x3545
xorl %r12d, %r12d
movq 0x5acd(%rip), %r14      # 0x8fd0
leaq 0x2d9e(%rip), %r15      # 0x62a8
movsd (%rax,%r12,8), %xmm0
movq %r14, %rdi
callq 0x2320
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2220
incq %r12
movq 0x378(%rbx), %rax
movq 0x380(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r12, %rcx
ja 0x350a
movq 0x3a8(%rbx), %rax
cmpq %rax, 0x3b0(%rbx)
je 0x35a1
xorl %r12d, %r12d
movq 0x5a71(%rip), %r14      # 0x8fd0
leaq 0x2d42(%rip), %r15      # 0x62a8
movsd (%rax,%r12,8), %xmm0
movq %r14, %rdi
callq 0x2320
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2220
incq %r12
movq 0x3a8(%rbx), %rax
movq 0x3b0(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r12, %rcx
ja 0x3566
movq 0x5a28(%rip), %rbx      # 0x8fd0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2120
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq