What I do for things like this is I make it so that
When left button is pressed value A is set to 1
When right button is pressed value A is set to 2
When the player presses fire1 and value A is set to 1 it fires left
When the player presses fire1 and value A is set to 2 it fires right
It's not much different, but if you have the A value change because of the button the player press to move left or right, it workes better. I used this in my (Now old) game (well demo) Paul the Penguin and it worked fine. You could use something different from value's like flags if you want.