# Path: pyjvm/bytecode.py
# def bytecode(code):
#     def cl(func):
#         BYTECODE[hex(code)] = func
#         return func
# 
#     return cl
# 
# Path: pyjvm/jassert.py
# def jassert_int(value):
#     assert type(value) is int or type(value) is long
#     assert -2147483648 <= value <= 2147483647
# 
# Path: pyjvm/jassert.py
# def jassert_long(value):
#     assert type(value) is tuple and value[0] == "long"
#     assert -9223372036854775808 <= value[1] <= 9223372036854775807
# 
# Path: pyjvm/ops/ops_calc.py
# def cut_to_int(value):
#     if -2147483648 <= value <= 2147483647:
#         return int(value)
#     if value & FLAG32:
#         value &= 0xFFFFFFFF
#         value ^= 0xFFFFFFFF
#         value += 1
#         value *= -1
#     else:
#         value &= 0xFFFFFFFF
#     jassert_int(value)
#     return int(value)
# 
# Path: pyjvm/ops/ops_calc.py
# def cut_to_long(value):
#     if -9223372036854775808 <= value <= 9223372036854775807:
#         return long(value)
#     if value & FLAG64:
#         value &= 0xFFFFFFFFFFFFFFFF
#         value ^= 0xFFFFFFFFFFFFFFFF
#         value += 1
#         value *= -1
#     else:
#         value &= 0xFFFFFFFFFFFFFFFF
#     jassert_long(("long", value))
#     return long(value)


import struct
from pyjvm.bytecode import bytecode
from pyjvm.jassert import jassert_int
from pyjvm.jassert import jassert_long
from pyjvm.ops.ops_calc import cut_to_int
from pyjvm.ops.ops_calc import cut_to_long
    jassert_int(value2)
    jassert_int(value1)
    value2 &= 0b11111
    result = value1 << value2
    result = cut_to_int(result)
    jassert_int(result)
    frame.stack.append(result)


@bytecode(code=0x79)
def lshl(frame):
    value2 = frame.stack.pop()
    value1 = frame.stack.pop()
    jassert_int(value2)
    jassert_long(value1)
    value2 &= 0b111111
    result = value1[1] << value2
    result = ("long", cut_to_long(result))
    jassert_long(result)
    frame.stack.append(result)


@bytecode(code=0x7a)
def ishr(frame):
    value2 = frame.stack.pop()
    value1 = frame.stack.pop()
    jassert_int(value2)
    jassert_int(value1)
    value2 &= 0b11111
    result = value1 >> value2

# Path: pyjvm/bytecode.py
# def bytecode(code):
#     def cl(func):
#         BYTECODE[hex(code)] = func
#         return func
# 
#     return cl
# 
# Path: pyjvm/jassert.py
# def jassert_int(value):
#     assert type(value) is int or type(value) is long
#     assert -2147483648 <= value <= 2147483647
# 
# Path: pyjvm/jassert.py
# def jassert_long(value):
#     assert type(value) is tuple and value[0] == "long"
#     assert -9223372036854775808 <= value[1] <= 9223372036854775807
# 
# Path: pyjvm/ops/ops_calc.py
# def cut_to_int(value):
#     if -2147483648 <= value <= 2147483647:
#         return int(value)
#     if value & FLAG32:
#         value &= 0xFFFFFFFF
#         value ^= 0xFFFFFFFF
#         value += 1
#         value *= -1
#     else:
#         value &= 0xFFFFFFFF
#     jassert_int(value)
#     return int(value)
# 
# Path: pyjvm/ops/ops_calc.py
# def cut_to_long(value):
#     if -9223372036854775808 <= value <= 9223372036854775807:
#         return long(value)
#     if value & FLAG64:
#         value &= 0xFFFFFFFFFFFFFFFF
#         value ^= 0xFFFFFFFFFFFFFFFF
#         value += 1
#         value *= -1
#     else:
#         value &= 0xFFFFFFFFFFFFFFFF
#     jassert_long(("long", value))
#     return long(value)


# Path: pyjvm/ops/ops_shift.py
import struct
from pyjvm.bytecode import bytecode
from pyjvm.jassert import jassert_int
from pyjvm.jassert import jassert_long
from pyjvm.ops.ops_calc import cut_to_int
from pyjvm.ops.ops_calc import cut_to_long

    jassert_int(value2)
    jassert_int(value1)
    value2 &= 0b11111
    result = value1 << value2
    result = cut_to_int(result)
    jassert_int(result)
    frame.stack.append(result)


@bytecode(code=0x79)
def lshl(frame):
    value2 = frame.stack.pop()
    value1 = frame.stack.pop()
    jassert_int(value2)
    jassert_long(value1)
    value2 &= 0b111111
    result = value1[1] << value2
    result = ("long", cut_to_long(result))
    jassert_long(result)
    frame.stack.append(result)


@bytecode(code=0x7a)
def ishr(frame):
    value2 = frame.stack.pop()
    value1 = frame.stack.pop()
    jassert_int(value2)
    jassert_int(value1)
    value2 &= 0b11111
    result = value1 >> value2

    result = cut_to_int(result)