void setup() {
  asm volatile (
        ".equ DDRB,0x04                     \n"
        ".equ PINB, 0x03                    \n" // set as input
        ".equ PORTD, 0x0B                   \n" // set as output 
        ".equ DDRD, 0x0A                    \n" 
        "cbi DDRB, 0                        \n"
        "sbi DDRD, 0                        \n"
        "sbi DDRD, 1                        \n"
        "sbi PORTD, 1                       \n"
        "ldi r18, 0x00                      \n" // btn count
        "ldi r19, 0                         \n" // current state
        "ldi r20, 0                         \n" // last state
        "ldi r21, 0x00                      \n" // temp register for r18


        "mainprog:                          \n"
        "           mov r20, r19            \n"
        "           in  r19, PINB           \n"
        "           cp r19,r20              \n"
        "           breq mainprog           \n"
        "           sbrc r19, 0             \n"
        "           jmp increment           \n"
        "           jmp mainprog            \n"

        "increment:                         \n"
        "           inc r18                 \n"
        "           call mod_3_or_not       \n" // call it as subroutine
        "           jmp mainprog            \n"

        "mod_3_or_not:                     \n"
        "           mov r21, r18           \n" // coppy the btn count num to r21
        "           cpi r21, 0x03          \n" // edge case check 0 or 3
        "           breq led_one           \n" // branch if 3
        "           cpi r21, 0x00          \n"
        "           breq led_two           \n" // branch if 0
        "loop:                             \n" // begening of while loop
        "           cpi r21, 0x03          \n" // compare it with 3
        "           brlo endloop           \n" // Branch if Lower
        "           subi r21, 0x03         \n" // Subtract 3 from r21
        "           rjmp loop              \n" // edge cases checked before so brlo works
        "endloop:                          \n" // end of while loop
        "           cpi r21, 0x00          \n" // if number r21 is 0 btncount%3 = 0 
        "           breq led_one           \n" // light up the led 1
        "led_two:                          \n"
        "           cbi PORTD, 0           \n"  // off pin 0
        "           sbi PORTD, 1           \n"  // on pin 1
        "           ret                    \n"  // return to call
        "led_one:                          \n" // if btncount%3 != 0 then lightup led 2
        "           sbi PORTD, 0           \n" // on pin 0
        "           cbi PORTD, 1           \n" // off pin 1
        "           ret                    \n" // return to call 
        
  );
}

void loop() {
  // Your main code here
}
$abcdeabcde151015202530fghijfghij
led1
led2