Nested "if" statements error expected ')' before'!'

Hi, Just learning Arduino and I am trying to verify a code to read an input, then format it and output it via serial. This is not my code but is a code that is written to work with the instrument I have and has been shared online. When I try to verify it, it gets to a line of nested if statements and comes up with the error: expected ')' before '!' I think it is to do with the nested if's but for the life of me can't see where they are wrong or what else could cause it. Any help will be greatly appreciated.
Here is the code part that flags the error. It wont let me post the whole code as over 9000 characters.Thanks in advance:

  // We only consider data good, when the "DEPTH" symbol appears on the LCD
       if ((data [5] & depth_mask [0] & 0xFF) == (0x01))
       {
         FLAG_DEPTH = HIGH;
       }
       else
       {
         FLAG_DEPTH = LOW;
       }
      
      
       // DIGIT 2 
       digit_tmp0 = data [5] & digit2_mask [0];
       for (i = 0; i <10; i ++)
       {
         if ((digit2 [i] [0] & 0xFF) == (digit_tmp0 & 0xFF))
         {        
           dig2 = '0' + i;
           break;
         }
       }
       // DIGIT 1
       digit_tmp0 = data [9] & digit1_mask [4];
       digit_tmp1 = data [10] & digit1_mask [5];
       for (i = 0; i <10; i ++)
       {
         if (((digit1 [i] [4] & 0xFF) == (digit_tmp0 & 0xFF)) &
         ((digit1 [i] [5] & 0xFF) == (digit_tmp1 & 0xFF)))
         {
           dig1 = '0' + i;
           break;
         }
       }
      
       i = 0;
       // Do we have good data?  (FLAG_DEPTH and at least one digit)
       if ((((dig1! = 'N') | (dig2! = 'N')) | (dig3! = 'N')) & (FLAG_DEPTH == HIGH))) *where it flags error*
         {
           ind_dptstr = 0;
           if (dig1! = 'N')
           {
             dptstr [ind_dptstr] = dig1;
             ind_dptstr ++;
           }
           if (dig2! = 'N')
           {
             dptstr [ind_dptstr] = dig2;
             ind_dptstr ++;
           }
           if (dec_point! = 'N')
           {
             dptstr [ind_dptstr] = dec_point;
             ind_dptstr ++;
           }
           if (dig3! = 'N')
           {
             dptstr [ind_dptstr] = dig3;
             ind_dptstr ++;
           }
           dptstr [ind_dptstr] = '\ 0';
           strcpy (NMEADPTstr, "$ IIDPT,"); 
           strcat (NMEADPTstr, dptstr);
           strcat (NMEADPTstr, "* 0.0");
           // Calculate checksum
           checksum = 0;
           i = 0;
       if ((((dig1! = 'N') | (dig2! = 'N')) | (dig3! = 'N')) & (FLAG_DEPTH == HIGH))) *where it flags error*

Well, that line definitely has some parenthesis problems.
And this line looks pretty weird as well:

         if ((digit2 [i] [0] & 0xFF) == (digit_tmp0 & 0xFF)

And the formatting is rather evil. Did you by some chance cut&paste this code from a web page, instead of downloading source? Sometimes formatted-for-the-web code has non-ascii characters that don't paste well into actual programs...

has been shared online.

Got a pointer/link? I found De:NASA Clipper Range – OpenSeaMap-dev, and it looks pretty different (no evil operator formatting, for example!)

Yes I did copy paste and couldn't find a download link for the code. That is the site. Should have checked it against the site code. Oh well have to do a bit of typing in the ide if can't find a link, then check it. Thanks for that.

Thank you all for the help. A bit of checking the original and re - typing and it has compiled.