IRrelay code problem

My IR relay circuit was working perfectly until I decided to modify it with a push button. I want one of the three relays to be toggled by a pushbutton so that "relay3 (r3)" can be toggled by both i.e. pushbutton as well as IRremote. I made a code for that and "relay3" now can be toggled successfully with pushbutton. But the problem is that that relay is no more toggling with IRremote. Although remaining two relays can be toggled with remote. I am sure that the problem is in the code only and I tried many times but cant find the problem with the code.

Here is the code:-

#include <IRremote.h>

const int RECV_PIN = 11;
const int r3 = 9;
const int r2 = 12;
const int r1 = 10;
const int buttonPin = 2;    // the number of the pushbutton pin
   
// Variables will change:
int r3State = HIGH;         // the current state of the output pin
int buttonState;             // the current reading from the input pin
int lastButtonState = LOW;   // the previous reading from the input pin
long lastDebounceTime = 0;  // the last time the output pin was toggled
long debounceDelay = 50;    // the debounce time; increase if the output flickers

    
IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
  pinMode(r3,OUTPUT);//Pin For relay3
  pinMode(r2,OUTPUT);//Pin For relay2
  pinMode(r1,OUTPUT);//Pin For relay1
  pinMode(buttonPin, INPUT);
  digitalWrite(r3, r3State);
}

void loop() 
{
  int reading = digitalRead(buttonPin);
  if (reading != lastButtonState) {
  lastDebounceTime = millis();
  }

  if ((millis() - lastDebounceTime) > debounceDelay) 
  {
   if (reading != buttonState) 
   {
      buttonState = reading;

      
      if (buttonState == HIGH) 
      {
        r3State = !r3State;
      }
    }
  }

  
  digitalWrite(r3, r3State);
  lastButtonState = reading;


 if (irrecv.decode(&results))                
  {
    
    if(results.value==1930688319)//<--Relay3
  {
      if(digitalRead(r3)==LOW)
      {
        digitalWrite(r3,HIGH);
       
        
      }
      else{
    digitalWrite(r3,LOW);
    
    }
  }
    if(results.value==1440415647)//<--Relay2
    {
      if(digitalRead(r2)==LOW)
      {
        digitalWrite(r2,HIGH);
       
      }
      else{
    digitalWrite(r2,LOW);
 
    }
    }
    if(results.value==130972539)//<--Relay1
    {
      if(digitalRead(r1)==LOW)
      {
        digitalWrite(r1,HIGH);
     
      }
      else{
    digitalWrite(r1,LOW);
 
    }
    }
    if(results.value==3173222979)//<--power button
    {
       if(digitalRead(r1)==HIGH)
      {
        digitalWrite(r1,LOW);
        
      }
       if(digitalRead(r2)==HIGH)
      {
        digitalWrite(r2,LOW);
       
      }
     
     if(digitalRead(r3)==HIGH)
      {
        digitalWrite(r3,LOW);
        
      }
    }
     irrecv.resume();
  }                             
        
}

I'm assuming you've double checked the ir decoded value you're looking for, for r3? Just grasping straws. I have a limited knowledge, and am learning this myself. I'll keep looking.
Eric

How many variables does it take to determine whether the current reading is, or is not, the same as the previous reading? Why do you have 3 variables to determine that?

I'll change that. But is that responsible for the problem?

But is that responsible for the problem?

No.

But, then, I don't understand why you have code for reading the output pins in the case for the power button. Most people would have variables to remember the state that they had set the pins to.

I don't understand why your indenting looks like shit. Most people would have use Tools + Auto Format before posting code.

I don't understand why sometimes the open curly brace is on a new line (where it belongs) and sometimes it is jammed up against the else statement.

I don't understand why there is no serial output to tell you what is happening.