// File: /workspace/github_cpp_makefile_star2_O3/msu-starx[P]starx/exosuit.cpp
// Function: ExoSuit::initialize()
void ExoSuit::initialize(void){
    //Filter
    u.clear();
    y.clear();
    lasty.clear();
    u.resize(4);
    y.resize(4);
    lasty.resize(4);
    // Sensor States
    adcValues.clear();
    pressureStates.clear();
    forceStates.clear();
    emgStates.clear();
    adcValues.resize(board.ADCPinCount);
    pressureStates.resize(pressurePins.size());
    forceStates.resize(forcePins.size());
    emgStates.resize(emgPins.size());
    // Pressure Controller States
    pressurePID.clear();
    outputStates.clear();
    setpointStates.clear();
    dutyCycleStates.clear();
    dutyCycles.clear();
    pressurePID.resize(pressurePins.size());
    outputStates.resize(pressurePins.size());
    setpointStates.resize(pressurePins.size());
    dutyCycleStates.resize(pressurePins.size());
    dutyCycles.resize(pressurePins.size());
    for(int i = 0; i < pressurePID.size(); i++) {
        pressurePID[i].setMode(pressurePID[i].AUTOMATIC);
        pressurePID[i].setOutputLimits(outputMin, outputMax);
        pressurePID[i].setTunings(Kp, Ki, Kd);
    }
    // Serial Port
    board.setupSerial(portName, baudRate);
    sleep(1); // Pause for 1 second
}

// 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 0x3855
movq %rax, 0x8(%rbx)
movq 0x18(%rbx), %rax
cmpq %rax, 0x20(%rbx)
je 0x3863
movq %rax, 0x20(%rbx)
leaq 0x18(%rbx), %r15
leaq 0x30(%rbx), %r14
movq 0x30(%rbx), %rax
cmpq %rax, 0x38(%rbx)
je 0x3879
movq %rax, 0x38(%rbx)
movl $0x4, %esi
movq %rbx, %rdi
callq 0x3c44
movl $0x4, %esi
movq %r15, %rdi
callq 0x3c44
movl $0x4, %esi
movq %r14, %rdi
callq 0x3c44
movq 0x318(%rbx), %rax
cmpq %rax, 0x320(%rbx)
je 0x38b7
movq %rax, 0x320(%rbx)
movq 0x378(%rbx), %rax
cmpq %rax, 0x380(%rbx)
je 0x38ce
movq %rax, 0x380(%rbx)
movq 0x390(%rbx), %rax
cmpq %rax, 0x398(%rbx)
je 0x38e5
movq %rax, 0x398(%rbx)
leaq 0x318(%rbx), %rdi
leaq 0x378(%rbx), %r12
leaq 0x390(%rbx), %r15
leaq 0x3a8(%rbx), %r14
movq 0x3a8(%rbx), %rax
cmpq %rax, 0x3b0(%rbx)
je 0x3918
movq %rax, 0x3b0(%rbx)
movslq 0x1e0(%rbx), %rsi
callq 0x3c7c
movq 0x338(%rbx), %rsi
subq 0x330(%rbx), %rsi
sarq $0x2, %rsi
movq %r12, %rdi
callq 0x3c44
movq 0x350(%rbx), %rsi
subq 0x348(%rbx), %rsi
sarq $0x2, %rsi
movq %r15, %rdi
callq 0x3c44
movq 0x368(%rbx), %rsi
subq 0x360(%rbx), %rsi
sarq $0x2, %rsi
movq %r14, %rdi
callq 0x3c44
movq 0x470(%rbx), %rax
cmpq %rax, 0x478(%rbx)
je 0x3989
movq %rax, 0x478(%rbx)
movq 0x410(%rbx), %rax
cmpq %rax, 0x418(%rbx)
je 0x39a0
movq %rax, 0x418(%rbx)
movq 0x428(%rbx), %rax
cmpq %rax, 0x430(%rbx)
je 0x39b7
movq %rax, 0x430(%rbx)
leaq 0x470(%rbx), %r12
leaq 0x410(%rbx), %r14
leaq 0x428(%rbx), %r13
leaq 0x440(%rbx), %rax
movq %rax, -0x30(%rbp)
movq 0x440(%rbx), %rax
cmpq %rax, 0x448(%rbx)
je 0x39ee
movq %rax, 0x448(%rbx)
leaq 0x50(%rbx), %rax
movq %rax, -0x38(%rbp)
leaq 0x458(%rbx), %r15
movq 0x458(%rbx), %rsi
movq %r15, %rdi
callq 0x4106
movq 0x338(%rbx), %rsi
subq 0x330(%rbx), %rsi
sarq $0x2, %rsi
movq %r12, %rdi
callq 0x3cb4
movq 0x338(%rbx), %rsi
subq 0x330(%rbx), %rsi
sarq $0x2, %rsi
movq %r14, %rdi
callq 0x3c44
movq 0x338(%rbx), %rsi
subq 0x330(%rbx), %rsi
sarq $0x2, %rsi
movq %r13, %rdi
callq 0x3c44
movq 0x338(%rbx), %rsi
subq 0x330(%rbx), %rsi
sarq $0x2, %rsi
movq -0x30(%rbp), %rdi
callq 0x3d04
movq 0x338(%rbx), %rsi
subq 0x330(%rbx), %rsi
sarq $0x2, %rsi
movq %r15, %rdi
callq 0x3d3c
movq 0x470(%rbx), %rdi
cmpq %rdi, 0x478(%rbx)
je 0x3b2e
xorl %r14d, %r14d
movabsq $-0xf0f0f0f0f0f0f0f, %r15 # imm = 0xF0F0F0F0F0F0F0F1
xorl %r12d, %r12d
movl 0x4(%rdi,%r14), %esi
addq %r14, %rdi
callq 0x5ab0
movq 0x470(%rbx), %rdi
addq %r14, %rdi
movsd 0x3f8(%rbx), %xmm0
movsd 0x400(%rbx), %xmm1
callq 0x5a58
movq 0x470(%rbx), %rdi
addq %r14, %rdi
movsd 0x3e0(%rbx), %xmm0
movsd 0x3e8(%rbx), %xmm1
movsd 0x3f0(%rbx), %xmm2
callq 0x5994
incq %r12
movq 0x470(%rbx), %rdi
movq 0x478(%rbx), %rax
subq %rdi, %rax
sarq $0x3, %rax
imulq %r15, %rax
addq $0x88, %r14
cmpq %r12, %rax
ja 0x3ab3
leaq -0x48(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x258b(%rip), %rsi      # 0x60c8
leaq 0x2590(%rip), %rdx      # 0x60d4
leaq -0x58(%rbp), %rbx
movq %rbx, %rdi
callq 0x2f16
movq -0x38(%rbp), %rdi
movq %rbx, %rsi
movl $0xf4240, %edx          # imm = 0xF4240
callq 0x521a
movq -0x58(%rbp), %rdi
cmpq %r14, %rdi
je 0x3b76
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x21e0
movl $0x1, %edi
callq 0x2160
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x58(%rbp), %rdi
cmpq %r14, %rdi
je 0x3ba7
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x21e0
movq %rbx, %rdi
callq 0x2360
nop