Has this "generalized semidirect product" been studied? If $G$ is a finite group with subgroups $H$ and $K$ such that $HK = G$ and $H\cap K = \{1\}$ we get that every element of $G$ can be written uniquely as $hk$ with $h\in H$ and $k\in K$. This then gives a map from $H\times K$ to itself sending $(h,k)$ to the unique $(h',k')$ such that $kh = h'k'$.
Conversely, given a map $\varphi$ from $H\times K$ to itself with suitable properties, one can define a group structure $G$ on $H\times K$ such that $H$ and $K$ are subgroups with $HK = G$ and $H\cap K = \{1\}$ and such that the multiplication is given via the map as $(h,k)(h',k') = (h\varphi_1(h',k),\varphi_2(h',k)k')$ where $\varphi_1$ and $\varphi_2$ are the projections on the first and second coordinate.
Has this construction been studied before? It seems like it would be a natural generalization of a semidirect product, but I have never seen it mentioned anywhere.
 A: Yes, it has. It is called the Zappa-Szep product, the general product, or the knit product. That is, if $H, K\leq G$ with $H\cap K=1$ and $HK=G$ we write $G=H\bowtie K$ and then $G$ is the Zappa-Szep product, the general product, or the knit product, of $H$ and $K$.
The great Phillip Hall showed that a soluble group is a Zappa-Szep product of a Sylow $p$-subgroup and a Hall $p^{\prime}$-subgroup. This is what his Sylow system and Sylow basis stuff is doing.
Jesse Douglas, one of the first Fields Medalists, studied these groups (on his "downswing", according to my supervisor!), classifying all Zappa-Szep products of finite cyclic groups. The references are,
On finite groups with two independent generators I-IV (so, four different papers), Proc. Nat, Acad. Sci. USA 37, 1951.
However, $H$ and $K$ (and so $G$) need not be finite! There is also a classification of what a Zappa-Szep product $\mathbb{Z}\bowtie\mathbb{Z}$ looks like, I believe, which can be found in the papers,
P. M. Cohn, A Remark on the General Product of two Infinite Cyclic Groups, Arch Maths, 7: 94-99, 1956.
N. Ito, Uber das Produkt von zwei abelschen Gruppen, Math. Z 62: 400- 4001, 1955.
However, I cannot find the German paper so am not completely certain if they do actually classify them. I'm pretty sure they do thought - the German paper classifies all but one case, while the other proves this case cannot happen (at least, that is the impression I got from Cohn's paper, which I do have to hand!).
Mark Lawson and and some others have thought about Zappa-Szep products of semigroups and monoids with groups. These are nice for some reason - something to do with being Reese monoids, and about Automata. See this chaps slides (although I'm sure much better references exist!).
As an afterthought, if you are interested in products of groups in general, there is an interesting section at the end of Magnus, Karrass and Solitar's book "Combinatorial Group Theory" which talks about whether the direct product and the free product of groups are special cases of a wider class of products. It is a most interesting read!
A: These are also called matched pairs of groups. I just did a google search on this term and it gave over 11,400 results, often related to Hopf algebras. The n-fold case is discussed in arXiv:1201.0059 . But I was not aware of the older references given above, which are nice to see. 
