A typical modified specimen, an often resource procedure, that would qualify for a rank and file pirate.
The lock is a patilha ( miquelete ) one, potentialy Spanish, end XVIII century, later converted to percussion. The stock of Cataluņa fashion, maybe not the original one, but certainly old stuff. The barrel is British proofed, Brown Bess type of an early version, i wonder if from the trade circuit, or eventualy captured or left back in battle.
Both barrel and stock were shortened, the barrel flared, to convert this piece for close action, as used also aboard ships.
... A form of Bacamarte, or Trabuco, or Blunderbuss.
Maybe it never belonged to a seaman ... but who knows ?