(self, function)
return prologue_mnems == [wasm.opcodes.OP_GET_GLOBAL,  # global frame pointer
                                  wasm.opcodes.OP_SET_LOCAL,
                                  wasm.opcodes.OP_I32_CONST,   # function frame size
                                  wasm.opcodes.OP_SET_LOCAL,
                                  wasm.opcodes.OP_GET_LOCAL,
                                  wasm.opcodes.OP_GET_LOCAL,
                                  wasm.opcodes.OP_I32_SUB,
                                  wasm.opcodes.OP_SET_LOCAL]
does the given function appear to have an LLVM-style function prologue?

        args:
          function (Dict[str, any]): function instance.

        returns:
          bool: if the function seems to have an LLVM-style function prologue.
does the given function appear to have an LLVM-style function prologue?
does the given function appear to have an LLVM - style function prologue?
def has_llvm_prologue(self, function):
        '''
        does the given function appear to have an LLVM-style function prologue?

        args:
          function (Dict[str, any]): function instance.

        returns:
          bool: if the function seems to have an LLVM-style function prologue.
        '''
        if function['imported']:
            return False

        if function['size'] <= self.PROLOGUE_SIZE:
            return False

        prologue = ida_bytes.get_many_bytes(function['offset'], self.PROLOGUE_SIZE)
        prologue_bc = list(itertools.islice(wasm.decode.decode_bytecode(prologue), 8))
        prologue_mnems = list(map(lambda bc: bc.op.id, prologue_bc))

        # pattern match on the LLVM function prologue.
        # obviously brittle.
        return prologue_mnems == [wasm.opcodes.OP_GET_GLOBAL,  # global frame pointer
                                  wasm.opcodes.OP_SET_LOCAL,
                                  wasm.opcodes.OP_I32_CONST,   # function frame size
                                  wasm.opcodes.OP_SET_LOCAL,
                                  wasm.opcodes.OP_GET_LOCAL,
                                  wasm.opcodes.OP_GET_LOCAL,
                                  wasm.opcodes.OP_I32_SUB,
                                  wasm.opcodes.OP_SET_LOCAL]
def has_llvm_prologue ( self , function ) : if function [ 'imported' ] : return False if function [ 'size' ] <= self . PROLOGUE_SIZE : return False prologue = ida_bytes . get_many_bytes ( function [ 'offset' ] , self . PROLOGUE_SIZE ) prologue_bc = list ( itertools . islice ( wasm . decode . decode_bytecode ( prologue ) , 8 ) ) prologue_mnems = list ( map ( lambda bc : bc . op . id , prologue_bc ) ) # pattern match on the LLVM function prologue. # obviously brittle. return prologue_mnems == [ wasm . opcodes . OP_GET_GLOBAL , # global frame pointer wasm . opcodes . OP_SET_LOCAL , wasm . opcodes . OP_I32_CONST , # function frame size wasm . opcodes . OP_SET_LOCAL , wasm . opcodes . OP_GET_LOCAL , wasm . opcodes . OP_GET_LOCAL , wasm . opcodes . OP_I32_SUB , wasm . opcodes . OP_SET_LOCAL ]