// File: /workspace/github_cpp_makefile_star2_O3/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 $0x28, %rsp
movq %rdi, %rbx
movq (%rdi), %rax
cmpq %rax, 0x8(%rdi)
je 0x3209
movq %rax, 0x8(%rbx)
movq 0x18(%rbx), %rax
cmpq %rax, 0x20(%rbx)
je 0x3217
movq %rax, 0x20(%rbx)
movq 0x30(%rbx), %rax
cmpq %rax, 0x38(%rbx)
je 0x3225
movq %rax, 0x38(%rbx)
movq 0x378(%rbx), %rax
cmpq %rax, 0x380(%rbx)
je 0x323c
movq %rax, 0x380(%rbx)
movq 0x390(%rbx), %rax
cmpq %rax, 0x398(%rbx)
je 0x3253
movq %rax, 0x398(%rbx)
movq 0x3a8(%rbx), %rax
cmpq %rax, 0x3b0(%rbx)
je 0x326a
movq %rax, 0x3b0(%rbx)
cmpl $0x0, 0x310(%rbx)
je 0x351f
leaq 0x18(%rbx), %r14
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), %r12
xorl %r15d, %r15d
xorl %r13d, %r13d
movq 0x330(%rbx), %rax
movq 0x338(%rbx), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r13, %rcx
jbe 0x33cf
movslq (%rax,%r13,4), %rax
movq 0x318(%rbx), %rcx
movl (%rcx,%rax,4), %esi
movsd 0x1e8(%rbx), %xmm0
movq %r12, %rdi
callq 0x5244
movq %r12, %rdi
callq 0x5252
movsd %xmm0, -0x30(%rbp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x330f
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x331b
movq %rbx, %rdi
leaq -0x30(%rbp), %rdx
callq 0x3ee2
movq (%rbx), %rax
movq 0x30(%rbx), %rcx
movsd (%rax,%r13,8), %xmm1
mulsd 0x2d88(%rip), %xmm1     # 0x60b8
movsd (%rcx,%r13,8), %xmm0
mulsd 0x2d82(%rip), %xmm0     # 0x60c0
addsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movq 0x20(%rbx), %rsi
cmpq 0x28(%rbx), %rsi
je 0x335f
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x20(%rbx)
jmp 0x336b
movq %r14, %rdi
leaq -0x30(%rbp), %rdx
callq 0x3ee2
movq 0x18(%rbx), %rdx
movq 0x38(%rbx), %rsi
leaq (%rdx,%r15), %rax
cmpq 0x40(%rbx), %rsi
je 0x338f
movsd (%rax), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x38(%rbx)
jmp 0x339e
movq -0x50(%rbp), %rdi
movq %rax, %rdx
callq 0x4026
movq (%r14), %rdx
addq %r15, %rdx
movq 0x380(%rbx), %rsi
cmpq 0x388(%rbx), %rsi
je 0x33c6
movsd (%rdx), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x380(%rbx)
jmp 0x33cf
movq -0x48(%rbp), %rdi
callq 0x4026
movq 0x348(%rbx), %rax
movq 0x350(%rbx), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r13, %rcx
jbe 0x3442
movslq (%rax,%r13,4), %rax
movq 0x318(%rbx), %rcx
movl (%rcx,%rax,4), %esi
movsd 0x1e8(%rbx), %xmm0
movq %r12, %rdi
callq 0x5244
movq %r12, %rdi
callq 0x5270
movsd %xmm0, -0x30(%rbp)
movq 0x398(%rbx), %rsi
cmpq 0x3a0(%rbx), %rsi
je 0x3435
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x398(%rbx)
jmp 0x3442
movq -0x40(%rbp), %rdi
leaq -0x30(%rbp), %rdx
callq 0x3ee2
movq 0x360(%rbx), %rax
movq 0x368(%rbx), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r13, %rcx
jbe 0x34ad
movslq (%rax,%r13,4), %rax
movq 0x318(%rbx), %rcx
movl (%rcx,%rax,4), %esi
movsd 0x1e8(%rbx), %xmm0
movq %r12, %rdi
callq 0x5244
movsd %xmm0, -0x30(%rbp)
movq 0x3b0(%rbx), %rsi
cmpq 0x3b8(%rbx), %rsi
je 0x34a0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x3b0(%rbx)
jmp 0x34ad
movq -0x38(%rbp), %rdi
leaq -0x30(%rbp), %rdx
callq 0x3ee2
incq %r13
movl 0x310(%rbx), %eax
addq $0x8, %r15
cmpq %rax, %r13
jb 0x32ae
movq 0x378(%rbx), %rax
cmpq %rax, 0x380(%rbx)
je 0x351f
xorl %r12d, %r12d
movq 0x5af3(%rip), %r14      # 0x8fd0
leaq 0x2dc4(%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 0x34e4
movq 0x3a8(%rbx), %rax
cmpq %rax, 0x3b0(%rbx)
je 0x357b
xorl %r12d, %r12d
movq 0x5a97(%rip), %r14      # 0x8fd0
leaq 0x2d68(%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 0x3540
movq 0x5a4e(%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 $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq