# Path: pyjvm/bytecode.py
# def bytecode(code):
#     def cl(func):
#         BYTECODE[hex(code)] = func
#         return func
# 
#     return cl
# 
# Path: pyjvm/jassert.py
# def jassert_float(value):
#     assert type(value) is tuple and value[0] == "float"
# 
# Path: pyjvm/jassert.py
# def jassert_double(value):
#     assert type(value) is tuple and value[0] == "double"
# 
# 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


import math
import struct
from pyjvm.bytecode import bytecode
from pyjvm.jassert import jassert_float
from pyjvm.jassert import jassert_double
from pyjvm.jassert import jassert_int
from pyjvm.jassert import jassert_long
    value = frame.stack.pop()
    jassert_double(value)
    frame.stack.append(("float", value[1]))


@bytecode(code=0x91)
def i2b(frame):
    value = frame.stack.pop()
    jassert_int(value)
    data = struct.pack(">i", value)
    data = data[3]
    result = struct.unpack(">b", data)[0]
    frame.stack.append(result)


@bytecode(code=0x92)
def i2c(frame):
    value = frame.stack.pop()
    jassert_int(value)
    data = struct.pack(">i", value)
    data = data[2:]
    result = struct.unpack(">H", data)[0]
    assert type(result) is int
    assert 0 <= result <= int(math.pow(2, 16))
    frame.stack.append(result)


@bytecode(code=0x93)
def i2s(frame):
    value = frame.stack.pop()

# Path: pyjvm/bytecode.py
# def bytecode(code):
#     def cl(func):
#         BYTECODE[hex(code)] = func
#         return func
# 
#     return cl
# 
# Path: pyjvm/jassert.py
# def jassert_float(value):
#     assert type(value) is tuple and value[0] == "float"
# 
# Path: pyjvm/jassert.py
# def jassert_double(value):
#     assert type(value) is tuple and value[0] == "double"
# 
# 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_convert.py
import math
import struct
from pyjvm.bytecode import bytecode
from pyjvm.jassert import jassert_float
from pyjvm.jassert import jassert_double
from pyjvm.jassert import jassert_int
from pyjvm.jassert import jassert_long

    value = frame.stack.pop()
    jassert_double(value)
    frame.stack.append(("float", value[1]))


@bytecode(code=0x91)
def i2b(frame):
    value = frame.stack.pop()
    jassert_int(value)
    data = struct.pack(">i", value)
    data = data[3]
    result = struct.unpack(">b", data)[0]
    frame.stack.append(result)


@bytecode(code=0x92)
def i2c(frame):
    value = frame.stack.pop()
    jassert_int(value)
    data = struct.pack(">i", value)
    data = data[2:]
    result = struct.unpack(">H", data)[0]
    assert type(result) is int
    assert 0 <= result <= int(math.pow(2, 16))
    frame.stack.append(result)


@bytecode(code=0x93)
def i2s(frame):
    value = frame.stack.pop()

    jassert_int(value)