def check_negative_sp_offsets(self):
    "\n        :return void: Increases gadget's score if its cumulative register offsets are negative.\n        "
    sp_offset = 0
    for i in range(len(self.instructions)):
        cur_instr = self.instructions[i]
        if (cur_instr.opcode == 'push'):
            sp_offset -= 8
        elif ((cur_instr.opcode == 'pop') and (cur_instr.op1 not in Instruction.register_families[7])):
            sp_offset += 8
        elif ((cur_instr.opcode in ['add', 'adc']) and (cur_instr.op1 in Instruction.register_families[7]) and Instruction.is_constant(cur_instr.op2)):
            sp_offset += Instruction.get_operand_as_constant(cur_instr.op2)
        elif ((cur_instr.opcode in ['sub', 'sbb']) and (cur_instr.op1 in Instruction.register_families[7]) and Instruction.is_constant(cur_instr.op2)):
            sp_offset -= Instruction.get_operand_as_constant(cur_instr.op2)
        elif ((cur_instr.opcode == 'inc') and (cur_instr.op1 in Instruction.register_families[7])):
            sp_offset += 1
        elif ((cur_instr.opcode == 'dec') and (cur_instr.op1 in Instruction.register_families[7])):
            sp_offset -= 1
        elif (cur_instr.opcode.startswith('ret') and (cur_instr.op1 is not None)):
            sp_offset += Instruction.get_operand_as_constant(cur_instr.op1)
    if (sp_offset < 0):
        self.score += 2.0
:return void: Increases gadget's score if its cumulative register offsets are negative.
def check_negative_sp_offsets(self):
    "\n        \n        "
    sp_offset = 0
    for i in range(len(self.instructions)):
        cur_instr = self.instructions[i]
        if (cur_instr.opcode == 'push'):
            sp_offset -= 8
        elif ((cur_instr.opcode == 'pop') and (cur_instr.op1 not in Instruction.register_families[7])):
            sp_offset += 8
        elif ((cur_instr.opcode in ['add', 'adc']) and (cur_instr.op1 in Instruction.register_families[7]) and Instruction.is_constant(cur_instr.op2)):
            sp_offset += Instruction.get_operand_as_constant(cur_instr.op2)
        elif ((cur_instr.opcode in ['sub', 'sbb']) and (cur_instr.op1 in Instruction.register_families[7]) and Instruction.is_constant(cur_instr.op2)):
            sp_offset -= Instruction.get_operand_as_constant(cur_instr.op2)
        elif ((cur_instr.opcode == 'inc') and (cur_instr.op1 in Instruction.register_families[7])):
            sp_offset += 1
        elif ((cur_instr.opcode == 'dec') and (cur_instr.op1 in Instruction.register_families[7])):
            sp_offset -= 1
        elif (cur_instr.opcode.startswith('ret') and (cur_instr.op1 is not None)):
            sp_offset += Instruction.get_operand_as_constant(cur_instr.op1)
    if (sp_offset < 0):
        self.score += 2.0