print_with_operands (const struct cris_opcode *opcodep,

		     unsigned int insn,

		     unsigned char *buffer,

		     bfd_vma addr,

		     disassemble_info *info,

		     /* If a prefix insn was before this insn (and is supposed

			to be output as an address), here is a description of

			it.  */

		     const struct cris_opcode *prefix_opcodep,

		     unsigned int prefix_insn,

		     unsigned char *prefix_buffer,

		     bfd_boolean with_reg_prefix)

{

  /* Get a buffer of somewhat reasonable size where we store

     intermediate parts of the insn.  */

  char temp[sizeof (".d [$r13=$r12-2147483648],$r10") * 2];

  char *tp = temp;

  static const char mode_char[] = "bwd?";

  const char *s;

  const char *cs;

  struct cris_disasm_data *disdata

    = (struct cris_disasm_data *) info->private_data;



  /* Print out the name first thing we do.  */

  (*info->fprintf_func) (info->stream, "%s", opcodep->name);



  cs = opcodep->args;

  s = cs;



  /* Ignore any prefix indicator.  */

  if (*s == 'p')

    s++;



  if (*s == 'm' || *s == 'M' || *s == 'z')

    {

      *tp++ = '.';



      /* Get the size-letter.  */

      *tp++ = *s == 'M'

	? (insn & 0x8000 ? 'd'

	   : insn & 0x4000 ? 'w' : 'b')

	: mode_char[(insn >> 4) & (*s == 'z' ? 1 : 3)];



      /* Ignore the size and the space character that follows.  */

      s += 2;

    }



  /* Add a space if this isn't a long-branch, because for those will add

     the condition part of the name later.  */

  if (opcodep->match != (BRANCH_PC_LOW + BRANCH_INCR_HIGH * 256))

    *tp++ = ' ';



  /* Fill in the insn-type if deducible from the name (and there's no

     better way).  */

  if (opcodep->name[0] == 'j')

    {

      if (CONST_STRNEQ (opcodep->name, "jsr"))

	/* It's "jsr" or "jsrc".  */

	info->insn_type = dis_jsr;

      else

	/* Any other jump-type insn is considered a branch.  */

	info->insn_type = dis_branch;

    }



  /* We might know some more fields right now.  */

  info->branch_delay_insns = opcodep->delayed;



  /* Handle operands.  */

  for (; *s; s++)

    {

    switch (*s)

      {

      case 'T':

	tp = format_sup_reg ((insn >> 12) & 15, tp, with_reg_prefix);

	break;



      case 'A':

	if (with_reg_prefix)

	  *tp++ = REGISTER_PREFIX_CHAR;

	*tp++ = 'a';

	*tp++ = 'c';

	*tp++ = 'r';

	break;



      case '[':

      case ']':

      case ',':

	*tp++ = *s;

	break;



      case '!':

	/* Ignore at this point; used at earlier stages to avoid

	   recognition if there's a prefix at something that in other

	   ways looks like a "pop".  */

	break;



      case 'd':

	/* Ignore.  This is an optional ".d " on the large one of

	   relaxable insns.  */

	break;



      case 'B':

	/* This was the prefix that made this a "push".  We've already

	   handled it by recognizing it, so signal that the prefix is

	   handled by setting it to NULL.  */

	prefix_opcodep = NULL;

	break;



      case 'D':

      case 'r':

	tp = format_reg (disdata, insn & 15, tp, with_reg_prefix);

	break;



      case 'R':

	tp = format_reg (disdata, (insn >> 12) & 15, tp, with_reg_prefix);

	break;



      case 'n':

	{

	  /* Like N but pc-relative to the start of the insn.  */

	  unsigned long number

	    = (buffer[2] + buffer[3] * 256 + buffer[4] * 65536

	       + buffer[5] * 0x1000000 + addr);



	  /* Finish off and output previous formatted bytes.  */

	  *tp = 0;

	  if (temp[0])

	    (*info->fprintf_func) (info->stream, "%s", temp);

	  tp = temp;



	  (*info->print_address_func) ((bfd_vma) number, info);

	}

	break;



      case 'u':

	{

	  /* Like n but the offset is bits <3:0> in the instruction.  */

	  unsigned long number = (buffer[0] & 0xf) * 2 + addr;



	  /* Finish off and output previous formatted bytes.  */

	  *tp = 0;

	  if (temp[0])

	    (*info->fprintf_func) (info->stream, "%s", temp);

	  tp = temp;



	  (*info->print_address_func) ((bfd_vma) number, info);

	}

	break;



      case 'N':

      case 'y':

      case 'Y':

      case 'S':

      case 's':

	/* Any "normal" memory operand.  */

	if ((insn & 0x400) && (insn & 15) == 15 && prefix_opcodep == NULL)

	  {

	    /* We're looking at [pc+], i.e. we need to output an immediate

	       number, where the size can depend on different things.  */

	    long number;

	    int signedp

	      = ((*cs == 'z' && (insn & 0x20))

		 || opcodep->match == BDAP_QUICK_OPCODE);

	    int nbytes;



	    if (opcodep->imm_oprnd_size == SIZE_FIX_32)

	      nbytes = 4;

	    else if (opcodep->imm_oprnd_size == SIZE_SPEC_REG)

	      {

		const struct cris_spec_reg *sregp

		  = spec_reg_info ((insn >> 12) & 15, disdata->distype);



		/* A NULL return should have been as a non-match earlier,

		   so catch it as an internal error in the error-case

		   below.  */

		if (sregp == NULL)

		  /* Whatever non-valid size.  */

		  nbytes = 42;

		else

		  /* PC is always incremented by a multiple of two.

		     For CRISv32, immediates are always 4 bytes for

		     special registers.  */

		  nbytes = disdata->distype == cris_dis_v32

		    ? 4 : (sregp->reg_size + 1) & ~1;

	      }

	    else

	      {

		int mode_size = 1 << ((insn >> 4) & (*cs == 'z' ? 1 : 3));



		if (mode_size == 1)

		  nbytes = 2;

		else

		  nbytes = mode_size;

	      }



	    switch (nbytes)

	      {

	      case 1:

		number = buffer[2];

		if (signedp && number > 127)

		  number -= 256;

		break;



	      case 2:

		number = buffer[2] + buffer[3] * 256;

		if (signedp && number > 32767)

		  number -= 65536;

		break;



	      case 4:

		number

		  = buffer[2] + buffer[3] * 256 + buffer[4] * 65536

		  + buffer[5] * 0x1000000;

		break;



	      default:

		strcpy (tp, "bug");

		tp += 3;

		number = 42;

	      }



	    if ((*cs == 'z' && (insn & 0x20))

		|| (opcodep->match == BDAP_QUICK_OPCODE

		    && (nbytes <= 2 || buffer[1 + nbytes] == 0)))

	      tp = format_dec (number, tp, signedp);

	    else

	      {

		unsigned int highbyte = (number >> 24) & 0xff;



		/* Either output this as an address or as a number.  If it's

		   a dword with the same high-byte as the address of the

		   insn, assume it's an address, and also if it's a non-zero

		   non-0xff high-byte.  If this is a jsr or a jump, then

		   it's definitely an address.  */

		if (nbytes == 4

		    && (highbyte == ((addr >> 24) & 0xff)

			|| (highbyte != 0 && highbyte != 0xff)

			|| info->insn_type == dis_branch

			|| info->insn_type == dis_jsr))

		  {

		    /* Finish off and output previous formatted bytes.  */

		    *tp = 0;

		    tp = temp;

		    if (temp[0])

		      (*info->fprintf_func) (info->stream, "%s", temp);



		    (*info->print_address_func) ((bfd_vma) number, info);



		    info->target = number;

		  }

		else

		  tp = format_hex (number, tp, disdata);

	      }

	  }

	else

	  {

	    /* Not an immediate number.  Then this is a (possibly

	       prefixed) memory operand.  */

	    if (info->insn_type != dis_nonbranch)

	      {

		int mode_size

		  = 1 << ((insn >> 4)

			  & (opcodep->args[0] == 'z' ? 1 : 3));

		int size;

		info->insn_type = dis_dref;

		info->flags |= CRIS_DIS_FLAG_MEMREF;



		if (opcodep->imm_oprnd_size == SIZE_FIX_32)

		  size = 4;

		else if (opcodep->imm_oprnd_size == SIZE_SPEC_REG)

		  {

		    const struct cris_spec_reg *sregp

		      = spec_reg_info ((insn >> 12) & 15, disdata->distype);



		    /* FIXME: Improve error handling; should have been caught

		       earlier.  */

		    if (sregp == NULL)

		      size = 4;

		    else

		      size = sregp->reg_size;

		  }

		else

		  size = mode_size;



		info->data_size = size;

	      }



	    *tp++ = '[';



	    if (prefix_opcodep

		/* We don't match dip with a postincremented field

		   as a side-effect address mode.  */

		&& ((insn & 0x400) == 0

		    || prefix_opcodep->match != DIP_OPCODE))

	      {

		if (insn & 0x400)

		  {

		    tp = format_reg (disdata, insn & 15, tp, with_reg_prefix);

		    *tp++ = '=';

		  }





		/* We mainly ignore the prefix format string when the

		   address-mode syntax is output.  */

		switch (prefix_opcodep->match)

		  {

		  case DIP_OPCODE:

		    /* It's [r], [r+] or [pc+].  */

		    if ((prefix_insn & 0x400) && (prefix_insn & 15) == 15)

		      {

			/* It's [pc+].  This cannot possibly be anything

			   but an address.  */

			unsigned long number

			  = prefix_buffer[2] + prefix_buffer[3] * 256

			  + prefix_buffer[4] * 65536

			  + prefix_buffer[5] * 0x1000000;



			info->target = (bfd_vma) number;



			/* Finish off and output previous formatted

			   data.  */

			*tp = 0;

			tp = temp;

			if (temp[0])

			  (*info->fprintf_func) (info->stream, "%s", temp);



			(*info->print_address_func) ((bfd_vma) number, info);

		      }

		    else

		      {

			/* For a memref in an address, we use target2.

			   In this case, target is zero.  */

			info->flags

			  |= (CRIS_DIS_FLAG_MEM_TARGET2_IS_REG

			      | CRIS_DIS_FLAG_MEM_TARGET2_MEM);



			info->target2 = prefix_insn & 15;



			*tp++ = '[';

			tp = format_reg (disdata, prefix_insn & 15, tp,

					 with_reg_prefix);

			if (prefix_insn & 0x400)

			  *tp++ = '+';

			*tp++ = ']';

		      }

		    break;



		  case BDAP_QUICK_OPCODE:

		    {

		      int number;



		      number = prefix_buffer[0];

		      if (number > 127)

			number -= 256;



		      /* Output "reg+num" or, if num < 0, "reg-num".  */

		      tp = format_reg (disdata, (prefix_insn >> 12) & 15, tp,

				       with_reg_prefix);

		      if (number >= 0)

			*tp++ = '+';

		      tp = format_dec (number, tp, 1);



		      info->flags |= CRIS_DIS_FLAG_MEM_TARGET_IS_REG;

		      info->target = (prefix_insn >> 12) & 15;

		      info->target2 = (bfd_vma) number;

		      break;

		    }



		  case BIAP_OPCODE:

		    /* Output "r+R.m".  */

		    tp = format_reg (disdata, prefix_insn & 15, tp,

				     with_reg_prefix);

		    *tp++ = '+';

		    tp = format_reg (disdata, (prefix_insn >> 12) & 15, tp,

				     with_reg_prefix);

		    *tp++ = '.';

		    *tp++ = mode_char[(prefix_insn >> 4) & 3];



		    info->flags

		      |= (CRIS_DIS_FLAG_MEM_TARGET2_IS_REG

			  | CRIS_DIS_FLAG_MEM_TARGET_IS_REG



			  | ((prefix_insn & 0x8000)

			     ? CRIS_DIS_FLAG_MEM_TARGET2_MULT4

			     : ((prefix_insn & 0x8000)

				? CRIS_DIS_FLAG_MEM_TARGET2_MULT2 : 0)));



		    /* Is it the casejump?  It's a "adds.w [pc+r%d.w],pc".  */

		    if (insn == 0xf83f && (prefix_insn & ~0xf000) == 0x55f)

		      /* Then start interpreting data as offsets.  */

		      case_offset_counter = no_of_case_offsets;

		    break;



		  case BDAP_INDIR_OPCODE:

		    /* Output "r+s.m", or, if "s" is [pc+], "r+s" or

		       "r-s".  */

		    tp = format_reg (disdata, (prefix_insn >> 12) & 15, tp,

				     with_reg_prefix);



		    if ((prefix_insn & 0x400) && (prefix_insn & 15) == 15)

		      {

			long number;

			unsigned int nbytes;



			/* It's a value.  Get its size.  */

			int mode_size = 1 << ((prefix_insn >> 4) & 3);



			if (mode_size == 1)

			  nbytes = 2;

			else

			  nbytes = mode_size;



			switch (nbytes)

			  {

			  case 1:

			    number = prefix_buffer[2];

			    if (number > 127)

			      number -= 256;

			    break;



			  case 2:

			    number = prefix_buffer[2] + prefix_buffer[3] * 256;

			    if (number > 32767)

			      number -= 65536;

			    break;



			  case 4:

			    number

			      = prefix_buffer[2] + prefix_buffer[3] * 256

			      + prefix_buffer[4] * 65536

			      + prefix_buffer[5] * 0x1000000;

			    break;



			  default:

			    strcpy (tp, "bug");

			    tp += 3;

			    number = 42;

			  }



			info->flags |= CRIS_DIS_FLAG_MEM_TARGET_IS_REG;

			info->target2 = (bfd_vma) number;



			/* If the size is dword, then assume it's an

			   address.  */

			if (nbytes == 4)

			  {

			    /* Finish off and output previous formatted

			       bytes.  */

			    *tp++ = '+';

			    *tp = 0;

			    tp = temp;

			    (*info->fprintf_func) (info->stream, "%s", temp);



			    (*info->print_address_func) ((bfd_vma) number, info);

			  }

			else

			  {

			    if (number >= 0)

			      *tp++ = '+';

			    tp = format_dec (number, tp, 1);

			  }

		      }

		    else

		      {

			/* Output "r+[R].m" or "r+[R+].m".  */

			*tp++ = '+';

			*tp++ = '[';

			tp = format_reg (disdata, prefix_insn & 15, tp,

					 with_reg_prefix);

			if (prefix_insn & 0x400)

			  *tp++ = '+';

			*tp++ = ']';

			*tp++ = '.';

			*tp++ = mode_char[(prefix_insn >> 4) & 3];



			info->flags

			  |= (CRIS_DIS_FLAG_MEM_TARGET2_IS_REG

			      | CRIS_DIS_FLAG_MEM_TARGET2_MEM

			      | CRIS_DIS_FLAG_MEM_TARGET_IS_REG



			      | (((prefix_insn >> 4) == 2)

				 ? 0

				 : (((prefix_insn >> 4) & 3) == 1

				    ? CRIS_DIS_FLAG_MEM_TARGET2_MEM_WORD

				    : CRIS_DIS_FLAG_MEM_TARGET2_MEM_BYTE)));

		      }

		    break;



		  default:

		    (*info->fprintf_func) (info->stream, "?prefix-bug");

		  }



		/* To mark that the prefix is used, reset it.  */

		prefix_opcodep = NULL;

	      }

	    else

	      {

		tp = format_reg (disdata, insn & 15, tp, with_reg_prefix);



		info->flags |= CRIS_DIS_FLAG_MEM_TARGET_IS_REG;

		info->target = insn & 15;



		if (insn & 0x400)

		  *tp++ = '+';

	      }

	    *tp++ = ']';

	  }

	break;



      case 'x':

	tp = format_reg (disdata, (insn >> 12) & 15, tp, with_reg_prefix);

	*tp++ = '.';

	*tp++ = mode_char[(insn >> 4) & 3];

	break;



      case 'I':

	tp = format_dec (insn & 63, tp, 0);

	break;



      case 'b':

	{

	  int where = buffer[2] + buffer[3] * 256;



	  if (where > 32767)

	    where -= 65536;



	  where += addr + ((disdata->distype == cris_dis_v32) ? 0 : 4);



	  if (insn == BA_PC_INCR_OPCODE)

	    info->insn_type = dis_branch;

	  else

	    info->insn_type = dis_condbranch;



	  info->target = (bfd_vma) where;



	  *tp = 0;

	  tp = temp;

	  (*info->fprintf_func) (info->stream, "%s%s ",

				 temp, cris_cc_strings[insn >> 12]);



	  (*info->print_address_func) ((bfd_vma) where, info);

	}

      break;



    case 'c':

      tp = format_dec (insn & 31, tp, 0);

      break;



    case 'C':

      tp = format_dec (insn & 15, tp, 0);

      break;



    case 'o':

      {

	long offset = insn & 0xfe;

	bfd_vma target;



	if (insn & 1)

	  offset |= ~0xff;



	if (opcodep->match == BA_QUICK_OPCODE)

	  info->insn_type = dis_branch;

	else

	  info->insn_type = dis_condbranch;



	target = addr + ((disdata->distype == cris_dis_v32) ? 0 : 2) + offset;

	info->target = target;

	*tp = 0;

	tp = temp;

	(*info->fprintf_func) (info->stream, "%s", temp);

	(*info->print_address_func) (target, info);

      }

      break;



    case 'Q':

    case 'O':

      {

	long number = buffer[0];



	if (number > 127)

	  number = number - 256;



	tp = format_dec (number, tp, 1);

	*tp++ = ',';

	tp = format_reg (disdata, (insn >> 12) & 15, tp, with_reg_prefix);

      }

      break;



    case 'f':

      tp = print_flags (disdata, insn, tp);

      break;



    case 'i':

      tp = format_dec ((insn & 32) ? (insn & 31) | ~31L : insn & 31, tp, 1);

      break;



    case 'P':

      {

	const struct cris_spec_reg *sregp

	  = spec_reg_info ((insn >> 12) & 15, disdata->distype);



	if (sregp->name == NULL)

	  /* Should have been caught as a non-match earlier.  */

	  *tp++ = '?';

	else

	  {

	    if (with_reg_prefix)

	      *tp++ = REGISTER_PREFIX_CHAR;

	    strcpy (tp, sregp->name);

	    tp += strlen (tp);

	  }

      }

      break;



    default:

      strcpy (tp, "???");

      tp += 3;

    }

  }



  *tp = 0;



  if (prefix_opcodep)

    (*info->fprintf_func) (info->stream, " (OOPS unused prefix \"%s: %s\")",

			   prefix_opcodep->name, prefix_opcodep->args);



  (*info->fprintf_func) (info->stream, "%s", temp);



  /* Get info for matching case-tables, if we don't have any active.

     We assume that the last constant seen is used; either in the insn

     itself or in a "move.d const,rN, sub.d rN,rM"-like sequence.  */

  if (TRACE_CASE && case_offset_counter == 0)

    {

      if (CONST_STRNEQ (opcodep->name, "sub"))

	case_offset = last_immediate;



      /* It could also be an "add", if there are negative case-values.  */

      else if (CONST_STRNEQ (opcodep->name, "add"))

	/* The first case is the negated operand to the add.  */

	case_offset = -last_immediate;



      /* A bound insn will tell us the number of cases.  */

      else if (CONST_STRNEQ (opcodep->name, "bound"))

	no_of_case_offsets = last_immediate + 1;



      /* A jump or jsr or branch breaks the chain of insns for a

	 case-table, so assume default first-case again.  */

      else if (info->insn_type == dis_jsr

	       || info->insn_type == dis_branch

	       || info->insn_type == dis_condbranch)

	case_offset = 0;

    }

}

print_with_operands (const struct cris_opcode *opcodep,

		     unsigned int insn,

		     unsigned char *buffer,

		     bfd_vma addr,

		     disassemble_info *info,

		     





		     const struct cris_opcode *prefix_opcodep,

		     unsigned int prefix_insn,

		     unsigned char *prefix_buffer,

		     bfd_boolean with_reg_prefix)

{

  



  char temp[sizeof (".d [$r13=$r12-2147483648],$r10") * 2];

  char *tp = temp;

  static const char mode_char[] = "bwd?";

  const char *s;

  const char *cs;

  struct cris_disasm_data *disdata

    = (struct cris_disasm_data *) info->private_data;



  

  (*info->fprintf_func) (info->stream, "%s", opcodep->name);



  cs = opcodep->args;

  s = cs;



  

  if (*s == 'p')

    s++;



  if (*s == 'm' || *s == 'M' || *s == 'z')

    {

      *tp++ = '.';



      

      *tp++ = *s == 'M'

	? (insn & 0x8000 ? 'd'

	   : insn & 0x4000 ? 'w' : 'b')

	: mode_char[(insn >> 4) & (*s == 'z' ? 1 : 3)];



      

      s += 2;

    }



  



  if (opcodep->match != (BRANCH_PC_LOW + BRANCH_INCR_HIGH * 256))

    *tp++ = ' ';



  



  if (opcodep->name[0] == 'j')

    {

      if (CONST_STRNEQ (opcodep->name, "jsr"))

	

	info->insn_type = dis_jsr;

      else

	

	info->insn_type = dis_branch;

    }



  

  info->branch_delay_insns = opcodep->delayed;



  

  for (; *s; s++)

    {

    switch (*s)

      {

      case 'T':

	tp = format_sup_reg ((insn >> 12) & 15, tp, with_reg_prefix);

	break;



      case 'A':

	if (with_reg_prefix)

	  *tp++ = REGISTER_PREFIX_CHAR;

	*tp++ = 'a';

	*tp++ = 'c';

	*tp++ = 'r';

	break;



      case '[':

      case ']':

      case ',':

	*tp++ = *s;

	break;



      case '!':

	





	break;



      case 'd':

	



	break;



      case 'B':

	





	prefix_opcodep = NULL;

	break;



      case 'D':

      case 'r':

	tp = format_reg (disdata, insn & 15, tp, with_reg_prefix);

	break;



      case 'R':

	tp = format_reg (disdata, (insn >> 12) & 15, tp, with_reg_prefix);

	break;



      case 'n':

	{

	  

	  unsigned long number

	    = (buffer[2] + buffer[3] * 256 + buffer[4] * 65536

	       + buffer[5] * 0x1000000 + addr);



	  

	  *tp = 0;

	  if (temp[0])

	    (*info->fprintf_func) (info->stream, "%s", temp);

	  tp = temp;



	  (*info->print_address_func) ((bfd_vma) number, info);

	}

	break;



      case 'u':

	{

	  

	  unsigned long number = (buffer[0] & 0xf) * 2 + addr;



	  

	  *tp = 0;

	  if (temp[0])

	    (*info->fprintf_func) (info->stream, "%s", temp);

	  tp = temp;



	  (*info->print_address_func) ((bfd_vma) number, info);

	}

	break;



      case 'N':

      case 'y':

      case 'Y':

      case 'S':

      case 's':

	

	if ((insn & 0x400) && (insn & 15) == 15 && prefix_opcodep == NULL)

	  {

	    



	    long number;

	    int signedp

	      = ((*cs == 'z' && (insn & 0x20))

		 || opcodep->match == BDAP_QUICK_OPCODE);

	    int nbytes;



	    if (opcodep->imm_oprnd_size == SIZE_FIX_32)

	      nbytes = 4;

	    else if (opcodep->imm_oprnd_size == SIZE_SPEC_REG)

	      {

		const struct cris_spec_reg *sregp

		  = spec_reg_info ((insn >> 12) & 15, disdata->distype);



		





		if (sregp == NULL)

		  

		  nbytes = 42;

		else

		  





		  nbytes = disdata->distype == cris_dis_v32

		    ? 4 : (sregp->reg_size + 1) & ~1;

	      }

	    else

	      {

		int mode_size = 1 << ((insn >> 4) & (*cs == 'z' ? 1 : 3));



		if (mode_size == 1)

		  nbytes = 2;

		else

		  nbytes = mode_size;

	      }



	    switch (nbytes)

	      {

	      case 1:

		number = buffer[2];

		if (signedp && number > 127)

		  number -= 256;

		break;



	      case 2:

		number = buffer[2] + buffer[3] * 256;

		if (signedp && number > 32767)

		  number -= 65536;

		break;



	      case 4:

		number

		  = buffer[2] + buffer[3] * 256 + buffer[4] * 65536

		  + buffer[5] * 0x1000000;

		break;



	      default:

		strcpy (tp, "bug");

		tp += 3;

		number = 42;

	      }



	    if ((*cs == 'z' && (insn & 0x20))

		|| (opcodep->match == BDAP_QUICK_OPCODE

		    && (nbytes <= 2 || buffer[1 + nbytes] == 0)))

	      tp = format_dec (number, tp, signedp);

	    else

	      {

		unsigned int highbyte = (number >> 24) & 0xff;



		









		if (nbytes == 4

		    && (highbyte == ((addr >> 24) & 0xff)

			|| (highbyte != 0 && highbyte != 0xff)

			|| info->insn_type == dis_branch

			|| info->insn_type == dis_jsr))

		  {

		    

		    *tp = 0;

		    tp = temp;

		    if (temp[0])

		      (*info->fprintf_func) (info->stream, "%s", temp);



		    (*info->print_address_func) ((bfd_vma) number, info);



		    info->target = number;

		  }

		else

		  tp = format_hex (number, tp, disdata);

	      }

	  }

	else

	  {

	    



	    if (info->insn_type != dis_nonbranch)

	      {

		int mode_size

		  = 1 << ((insn >> 4)

			  & (opcodep->args[0] == 'z' ? 1 : 3));

		int size;

		info->insn_type = dis_dref;

		info->flags |= CRIS_DIS_FLAG_MEMREF;



		if (opcodep->imm_oprnd_size == SIZE_FIX_32)

		  size = 4;

		else if (opcodep->imm_oprnd_size == SIZE_SPEC_REG)

		  {

		    const struct cris_spec_reg *sregp

		      = spec_reg_info ((insn >> 12) & 15, disdata->distype);



		    



		    if (sregp == NULL)

		      size = 4;

		    else

		      size = sregp->reg_size;

		  }

		else

		  size = mode_size;



		info->data_size = size;

	      }



	    *tp++ = '[';



	    if (prefix_opcodep

		



		&& ((insn & 0x400) == 0

		    || prefix_opcodep->match != DIP_OPCODE))

	      {

		if (insn & 0x400)

		  {

		    tp = format_reg (disdata, insn & 15, tp, with_reg_prefix);

		    *tp++ = '=';

		  }





		



		switch (prefix_opcodep->match)

		  {

		  case DIP_OPCODE:

		    

		    if ((prefix_insn & 0x400) && (prefix_insn & 15) == 15)

		      {

			



			unsigned long number

			  = prefix_buffer[2] + prefix_buffer[3] * 256

			  + prefix_buffer[4] * 65536

			  + prefix_buffer[5] * 0x1000000;



			info->target = (bfd_vma) number;



			



			*tp = 0;

			tp = temp;

			if (temp[0])

			  (*info->fprintf_func) (info->stream, "%s", temp);



			(*info->print_address_func) ((bfd_vma) number, info);

		      }

		    else

		      {

			



			info->flags

			  |= (CRIS_DIS_FLAG_MEM_TARGET2_IS_REG

			      | CRIS_DIS_FLAG_MEM_TARGET2_MEM);



			info->target2 = prefix_insn & 15;



			*tp++ = '[';

			tp = format_reg (disdata, prefix_insn & 15, tp,

					 with_reg_prefix);

			if (prefix_insn & 0x400)

			  *tp++ = '+';

			*tp++ = ']';

		      }

		    break;



		  case BDAP_QUICK_OPCODE:

		    {

		      int number;



		      number = prefix_buffer[0];

		      if (number > 127)

			number -= 256;



		      

		      tp = format_reg (disdata, (prefix_insn >> 12) & 15, tp,

				       with_reg_prefix);

		      if (number >= 0)

			*tp++ = '+';

		      tp = format_dec (number, tp, 1);



		      info->flags |= CRIS_DIS_FLAG_MEM_TARGET_IS_REG;

		      info->target = (prefix_insn >> 12) & 15;

		      info->target2 = (bfd_vma) number;

		      break;

		    }



		  case BIAP_OPCODE:

		    

		    tp = format_reg (disdata, prefix_insn & 15, tp,

				     with_reg_prefix);

		    *tp++ = '+';

		    tp = format_reg (disdata, (prefix_insn >> 12) & 15, tp,

				     with_reg_prefix);

		    *tp++ = '.';

		    *tp++ = mode_char[(prefix_insn >> 4) & 3];



		    info->flags

		      |= (CRIS_DIS_FLAG_MEM_TARGET2_IS_REG

			  | CRIS_DIS_FLAG_MEM_TARGET_IS_REG



			  | ((prefix_insn & 0x8000)

			     ? CRIS_DIS_FLAG_MEM_TARGET2_MULT4

			     : ((prefix_insn & 0x8000)

				? CRIS_DIS_FLAG_MEM_TARGET2_MULT2 : 0)));



		    

		    if (insn == 0xf83f && (prefix_insn & ~0xf000) == 0x55f)

		      

		      case_offset_counter = no_of_case_offsets;

		    break;



		  case BDAP_INDIR_OPCODE:

		    



		    tp = format_reg (disdata, (prefix_insn >> 12) & 15, tp,

				     with_reg_prefix);



		    if ((prefix_insn & 0x400) && (prefix_insn & 15) == 15)

		      {

			long number;

			unsigned int nbytes;



			

			int mode_size = 1 << ((prefix_insn >> 4) & 3);



			if (mode_size == 1)

			  nbytes = 2;

			else

			  nbytes = mode_size;



			switch (nbytes)

			  {

			  case 1:

			    number = prefix_buffer[2];

			    if (number > 127)

			      number -= 256;

			    break;



			  case 2:

			    number = prefix_buffer[2] + prefix_buffer[3] * 256;

			    if (number > 32767)

			      number -= 65536;

			    break;



			  case 4:

			    number

			      = prefix_buffer[2] + prefix_buffer[3] * 256

			      + prefix_buffer[4] * 65536

			      + prefix_buffer[5] * 0x1000000;

			    break;



			  default:

			    strcpy (tp, "bug");

			    tp += 3;

			    number = 42;

			  }



			info->flags |= CRIS_DIS_FLAG_MEM_TARGET_IS_REG;

			info->target2 = (bfd_vma) number;



			



			if (nbytes == 4)

			  {

			    



			    *tp++ = '+';

			    *tp = 0;

			    tp = temp;

			    (*info->fprintf_func) (info->stream, "%s", temp);



			    (*info->print_address_func) ((bfd_vma) number, info);

			  }

			else

			  {

			    if (number >= 0)

			      *tp++ = '+';

			    tp = format_dec (number, tp, 1);

			  }

		      }

		    else

		      {

			

			*tp++ = '+';

			*tp++ = '[';

			tp = format_reg (disdata, prefix_insn & 15, tp,

					 with_reg_prefix);

			if (prefix_insn & 0x400)

			  *tp++ = '+';

			*tp++ = ']';

			*tp++ = '.';

			*tp++ = mode_char[(prefix_insn >> 4) & 3];



			info->flags

			  |= (CRIS_DIS_FLAG_MEM_TARGET2_IS_REG

			      | CRIS_DIS_FLAG_MEM_TARGET2_MEM

			      | CRIS_DIS_FLAG_MEM_TARGET_IS_REG



			      | (((prefix_insn >> 4) == 2)

				 ? 0

				 : (((prefix_insn >> 4) & 3) == 1

				    ? CRIS_DIS_FLAG_MEM_TARGET2_MEM_WORD

				    : CRIS_DIS_FLAG_MEM_TARGET2_MEM_BYTE)));

		      }

		    break;



		  default:

		    (*info->fprintf_func) (info->stream, "?prefix-bug");

		  }



		

		prefix_opcodep = NULL;

	      }

	    else

	      {

		tp = format_reg (disdata, insn & 15, tp, with_reg_prefix);



		info->flags |= CRIS_DIS_FLAG_MEM_TARGET_IS_REG;

		info->target = insn & 15;



		if (insn & 0x400)

		  *tp++ = '+';

	      }

	    *tp++ = ']';

	  }

	break;



      case 'x':

	tp = format_reg (disdata, (insn >> 12) & 15, tp, with_reg_prefix);

	*tp++ = '.';

	*tp++ = mode_char[(insn >> 4) & 3];

	break;



      case 'I':

	tp = format_dec (insn & 63, tp, 0);

	break;



      case 'b':

	{

	  int where = buffer[2] + buffer[3] * 256;



	  if (where > 32767)

	    where -= 65536;



	  where += addr + ((disdata->distype == cris_dis_v32) ? 0 : 4);



	  if (insn == BA_PC_INCR_OPCODE)

	    info->insn_type = dis_branch;

	  else

	    info->insn_type = dis_condbranch;



	  info->target = (bfd_vma) where;



	  *tp = 0;

	  tp = temp;

	  (*info->fprintf_func) (info->stream, "%s%s ",

				 temp, cris_cc_strings[insn >> 12]);



	  (*info->print_address_func) ((bfd_vma) where, info);

	}

      break;



    case 'c':

      tp = format_dec (insn & 31, tp, 0);

      break;



    case 'C':

      tp = format_dec (insn & 15, tp, 0);

      break;



    case 'o':

      {

	long offset = insn & 0xfe;

	bfd_vma target;



	if (insn & 1)

	  offset |= ~0xff;



	if (opcodep->match == BA_QUICK_OPCODE)

	  info->insn_type = dis_branch;

	else

	  info->insn_type = dis_condbranch;



	target = addr + ((disdata->distype == cris_dis_v32) ? 0 : 2) + offset;

	info->target = target;

	*tp = 0;

	tp = temp;

	(*info->fprintf_func) (info->stream, "%s", temp);

	(*info->print_address_func) (target, info);

      }

      break;



    case 'Q':

    case 'O':

      {

	long number = buffer[0];



	if (number > 127)

	  number = number - 256;



	tp = format_dec (number, tp, 1);

	*tp++ = ',';

	tp = format_reg (disdata, (insn >> 12) & 15, tp, with_reg_prefix);

      }

      break;



    case 'f':

      tp = print_flags (disdata, insn, tp);

      break;



    case 'i':

      tp = format_dec ((insn & 32) ? (insn & 31) | ~31L : insn & 31, tp, 1);

      break;



    case 'P':

      {

	const struct cris_spec_reg *sregp

	  = spec_reg_info ((insn >> 12) & 15, disdata->distype);



	if (sregp->name == NULL)

	  

	  *tp++ = '?';

	else

	  {

	    if (with_reg_prefix)

	      *tp++ = REGISTER_PREFIX_CHAR;

	    strcpy (tp, sregp->name);

	    tp += strlen (tp);

	  }

      }

      break;



    default:

      strcpy (tp, "???");

      tp += 3;

    }

  }



  *tp = 0;



  if (prefix_opcodep)

    (*info->fprintf_func) (info->stream, " (OOPS unused prefix \"%s: %s\")",

			   prefix_opcodep->name, prefix_opcodep->args);



  (*info->fprintf_func) (info->stream, "%s", temp);



  





  if (TRACE_CASE && case_offset_counter == 0)

    {

      if (CONST_STRNEQ (opcodep->name, "sub"))

	case_offset = last_immediate;



      

      else if (CONST_STRNEQ (opcodep->name, "add"))

	

	case_offset = -last_immediate;



      

      else if (CONST_STRNEQ (opcodep->name, "bound"))

	no_of_case_offsets = last_immediate + 1;



      



      else if (info->insn_type == dis_jsr

	       || info->insn_type == dis_branch

	       || info->insn_type == dis_condbranch)

	case_offset = 0;

    }

}

FUNC_0 (const struct cris_opcode *VAR_0,

		     unsigned int VAR_1,

		     unsigned char *VAR_2,

		     bfd_vma VAR_3,

		     disassemble_info *VAR_4,

		     





		     const struct cris_opcode *VAR_5,

		     unsigned int VAR_6,

		     unsigned char *VAR_7,

		     bfd_boolean VAR_8)

{

  



  char VAR_9[sizeof (".d [$r13=$r12-2147483648],$r10") * 2];

  char *VAR_10 = VAR_9;

  static const char VAR_11[] = "bwd?";

  const char *VAR_12;

  const char *VAR_13;

  struct cris_disasm_data *VAR_14

    = (struct cris_disasm_data *) VAR_4->private_data;



  

  (*VAR_4->fprintf_func) (VAR_4->stream, "%VAR_12", VAR_0->name);



  VAR_13 = VAR_0->args;

  VAR_12 = VAR_13;



  

  if (*VAR_12 == 'p')

    VAR_12++;



  if (*VAR_12 == 'm' || *VAR_12 == 'M' || *VAR_12 == 'z')

    {

      *VAR_10++ = '.';



      

      *VAR_10++ = *VAR_12 == 'M'

	? (VAR_1 & 0x8000 ? 'd'

	   : VAR_1 & 0x4000 ? 'w' : 'b')

	: VAR_11[(VAR_1 >> 4) & (*VAR_12 == 'z' ? 1 : 3)];



      

      VAR_12 += 2;

    }



  



  if (VAR_0->match != (BRANCH_PC_LOW + BRANCH_INCR_HIGH * 256))

    *VAR_10++ = ' ';



  



  if (VAR_0->name[0] == 'j')

    {

      if (CONST_STRNEQ (VAR_0->name, "jsr"))

	

	VAR_4->insn_type = dis_jsr;

      else

	

	VAR_4->insn_type = dis_branch;

    }



  

  VAR_4->branch_delay_insns = VAR_0->delayed;



  

  for (; *VAR_12; VAR_12++)

    {

    switch (*VAR_12)

      {

      case 'T':

	VAR_10 = format_sup_reg ((VAR_1 >> 12) & 15, VAR_10, VAR_8);

	break;



      case 'A':

	if (VAR_8)

	  *VAR_10++ = REGISTER_PREFIX_CHAR;

	*VAR_10++ = 'a';

	*VAR_10++ = 'c';

	*VAR_10++ = 'r';

	break;



      case '[':

      case ']':

      case ',':

	*VAR_10++ = *VAR_12;

	break;



      case '!':

	





	break;



      case 'd':

	



	break;



      case 'B':

	





	VAR_5 = NULL;

	break;



      case 'D':

      case 'r':

	VAR_10 = format_reg (VAR_14, VAR_1 & 15, VAR_10, VAR_8);

	break;



      case 'R':

	VAR_10 = format_reg (VAR_14, (VAR_1 >> 12) & 15, VAR_10, VAR_8);

	break;



      case 'n':

	{

	  

	  unsigned long VAR_24

	    = (VAR_2[2] + VAR_2[3] * 256 + VAR_2[4] * 65536

	       + VAR_2[5] * 0x1000000 + VAR_3);



	  

	  *VAR_10 = 0;

	  if (VAR_9[0])

	    (*VAR_4->fprintf_func) (VAR_4->stream, "%VAR_12", VAR_9);

	  VAR_10 = VAR_9;



	  (*VAR_4->print_address_func) ((bfd_vma) VAR_24, VAR_4);

	}

	break;



      case 'u':

	{

	  

	  unsigned long VAR_24 = (VAR_2[0] & 0xf) * 2 + VAR_3;



	  

	  *VAR_10 = 0;

	  if (VAR_9[0])

	    (*VAR_4->fprintf_func) (VAR_4->stream, "%VAR_12", VAR_9);

	  VAR_10 = VAR_9;



	  (*VAR_4->print_address_func) ((bfd_vma) VAR_24, VAR_4);

	}

	break;



      case 'N':

      case 'y':

      case 'Y':

      case 'S':

      case 'VAR_12':

	

	if ((VAR_1 & 0x400) && (VAR_1 & 15) == 15 && VAR_5 == NULL)

	  {

	    



	    long VAR_24;

	    int VAR_16

	      = ((*VAR_13 == 'z' && (VAR_1 & 0x20))

		 || VAR_0->match == BDAP_QUICK_OPCODE);

	    int VAR_22;



	    if (VAR_0->imm_oprnd_size == SIZE_FIX_32)

	      VAR_22 = 4;

	    else if (VAR_0->imm_oprnd_size == SIZE_SPEC_REG)

	      {

		const struct cris_spec_reg *VAR_24

		  = spec_reg_info ((VAR_1 >> 12) & 15, VAR_14->distype);



		





		if (VAR_24 == NULL)

		  

		  VAR_22 = 42;

		else

		  





		  VAR_22 = VAR_14->distype == cris_dis_v32

		    ? 4 : (VAR_24->reg_size + 1) & ~1;

	      }

	    else

	      {

		int VAR_22 = 1 << ((VAR_1 >> 4) & (*VAR_13 == 'z' ? 1 : 3));



		if (VAR_22 == 1)

		  VAR_22 = 2;

		else

		  VAR_22 = VAR_22;

	      }



	    switch (VAR_22)

	      {

	      case 1:

		VAR_24 = VAR_2[2];

		if (VAR_16 && VAR_24 > 127)

		  VAR_24 -= 256;

		break;



	      case 2:

		VAR_24 = VAR_2[2] + VAR_2[3] * 256;

		if (VAR_16 && VAR_24 > 32767)

		  VAR_24 -= 65536;

		break;



	      case 4:

		VAR_24

		  = VAR_2[2] + VAR_2[3] * 256 + VAR_2[4] * 65536

		  + VAR_2[5] * 0x1000000;

		break;



	      default:

		strcpy (VAR_10, "bug");

		VAR_10 += 3;

		VAR_24 = 42;

	      }



	    if ((*VAR_13 == 'z' && (VAR_1 & 0x20))

		|| (VAR_0->match == BDAP_QUICK_OPCODE

		    && (VAR_22 <= 2 || VAR_2[1 + VAR_22] == 0)))

	      VAR_10 = format_dec (VAR_24, VAR_10, VAR_16);

	    else

	      {

		unsigned int VAR_20 = (VAR_24 >> 24) & 0xff;



		









		if (VAR_22 == 4

		    && (VAR_20 == ((VAR_3 >> 24) & 0xff)

			|| (VAR_20 != 0 && VAR_20 != 0xff)

			|| VAR_4->insn_type == dis_branch

			|| VAR_4->insn_type == dis_jsr))

		  {

		    

		    *VAR_10 = 0;

		    VAR_10 = VAR_9;

		    if (VAR_9[0])

		      (*VAR_4->fprintf_func) (VAR_4->stream, "%VAR_12", VAR_9);



		    (*VAR_4->print_address_func) ((bfd_vma) VAR_24, VAR_4);



		    VAR_4->target = VAR_24;

		  }

		else

		  VAR_10 = format_hex (VAR_24, VAR_10, VAR_14);

	      }

	  }

	else

	  {

	    



	    if (VAR_4->insn_type != dis_nonbranch)

	      {

		int VAR_22

		  = 1 << ((VAR_1 >> 4)

			  & (VAR_0->args[0] == 'z' ? 1 : 3));

		int VAR_21;

		VAR_4->insn_type = dis_dref;

		VAR_4->flags |= CRIS_DIS_FLAG_MEMREF;



		if (VAR_0->imm_oprnd_size == SIZE_FIX_32)

		  VAR_21 = 4;

		else if (VAR_0->imm_oprnd_size == SIZE_SPEC_REG)

		  {

		    const struct cris_spec_reg *VAR_24

		      = spec_reg_info ((VAR_1 >> 12) & 15, VAR_14->distype);



		    



		    if (VAR_24 == NULL)

		      VAR_21 = 4;

		    else

		      VAR_21 = VAR_24->reg_size;

		  }

		else

		  VAR_21 = VAR_22;



		VAR_4->data_size = VAR_21;

	      }



	    *VAR_10++ = '[';



	    if (VAR_5

		



		&& ((VAR_1 & 0x400) == 0

		    || VAR_5->match != DIP_OPCODE))

	      {

		if (VAR_1 & 0x400)

		  {

		    VAR_10 = format_reg (VAR_14, VAR_1 & 15, VAR_10, VAR_8);

		    *VAR_10++ = '=';

		  }





		



		switch (VAR_5->match)

		  {

		  case DIP_OPCODE:

		    

		    if ((VAR_6 & 0x400) && (VAR_6 & 15) == 15)

		      {

			



			unsigned long VAR_24

			  = VAR_7[2] + VAR_7[3] * 256

			  + VAR_7[4] * 65536

			  + VAR_7[5] * 0x1000000;



			VAR_4->target = (bfd_vma) VAR_24;



			



			*VAR_10 = 0;

			VAR_10 = VAR_9;

			if (VAR_9[0])

			  (*VAR_4->fprintf_func) (VAR_4->stream, "%VAR_12", VAR_9);



			(*VAR_4->print_address_func) ((bfd_vma) VAR_24, VAR_4);

		      }

		    else

		      {

			



			VAR_4->flags

			  |= (CRIS_DIS_FLAG_MEM_TARGET2_IS_REG

			      | CRIS_DIS_FLAG_MEM_TARGET2_MEM);



			VAR_4->target2 = VAR_6 & 15;



			*VAR_10++ = '[';

			VAR_10 = format_reg (VAR_14, VAR_6 & 15, VAR_10,

					 VAR_8);

			if (VAR_6 & 0x400)

			  *VAR_10++ = '+';

			*VAR_10++ = ']';

		      }

		    break;



		  case BDAP_QUICK_OPCODE:

		    {

		      int VAR_24;



		      VAR_24 = VAR_7[0];

		      if (VAR_24 > 127)

			VAR_24 -= 256;



		      

		      VAR_10 = format_reg (VAR_14, (VAR_6 >> 12) & 15, VAR_10,

				       VAR_8);

		      if (VAR_24 >= 0)

			*VAR_10++ = '+';

		      VAR_10 = format_dec (VAR_24, VAR_10, 1);



		      VAR_4->flags |= CRIS_DIS_FLAG_MEM_TARGET_IS_REG;

		      VAR_4->target = (VAR_6 >> 12) & 15;

		      VAR_4->target2 = (bfd_vma) VAR_24;

		      break;

		    }



		  case BIAP_OPCODE:

		    

		    VAR_10 = format_reg (VAR_14, VAR_6 & 15, VAR_10,

				     VAR_8);

		    *VAR_10++ = '+';

		    VAR_10 = format_reg (VAR_14, (VAR_6 >> 12) & 15, VAR_10,

				     VAR_8);

		    *VAR_10++ = '.';

		    *VAR_10++ = VAR_11[(VAR_6 >> 4) & 3];



		    VAR_4->flags

		      |= (CRIS_DIS_FLAG_MEM_TARGET2_IS_REG

			  | CRIS_DIS_FLAG_MEM_TARGET_IS_REG



			  | ((VAR_6 & 0x8000)

			     ? CRIS_DIS_FLAG_MEM_TARGET2_MULT4

			     : ((VAR_6 & 0x8000)

				? CRIS_DIS_FLAG_MEM_TARGET2_MULT2 : 0)));



		    

		    if (VAR_1 == 0xf83f && (VAR_6 & ~0xf000) == 0x55f)

		      

		      case_offset_counter = no_of_case_offsets;

		    break;



		  case BDAP_INDIR_OPCODE:

		    



		    VAR_10 = format_reg (VAR_14, (VAR_6 >> 12) & 15, VAR_10,

				     VAR_8);



		    if ((VAR_6 & 0x400) && (VAR_6 & 15) == 15)

		      {

			long VAR_24;

			unsigned int VAR_22;



			

			int VAR_22 = 1 << ((VAR_6 >> 4) & 3);



			if (VAR_22 == 1)

			  VAR_22 = 2;

			else

			  VAR_22 = VAR_22;



			switch (VAR_22)

			  {

			  case 1:

			    VAR_24 = VAR_7[2];

			    if (VAR_24 > 127)

			      VAR_24 -= 256;

			    break;



			  case 2:

			    VAR_24 = VAR_7[2] + VAR_7[3] * 256;

			    if (VAR_24 > 32767)

			      VAR_24 -= 65536;

			    break;



			  case 4:

			    VAR_24

			      = VAR_7[2] + VAR_7[3] * 256

			      + VAR_7[4] * 65536

			      + VAR_7[5] * 0x1000000;

			    break;



			  default:

			    strcpy (VAR_10, "bug");

			    VAR_10 += 3;

			    VAR_24 = 42;

			  }



			VAR_4->flags |= CRIS_DIS_FLAG_MEM_TARGET_IS_REG;

			VAR_4->target2 = (bfd_vma) VAR_24;



			



			if (VAR_22 == 4)

			  {

			    



			    *VAR_10++ = '+';

			    *VAR_10 = 0;

			    VAR_10 = VAR_9;

			    (*VAR_4->fprintf_func) (VAR_4->stream, "%VAR_12", VAR_9);



			    (*VAR_4->print_address_func) ((bfd_vma) VAR_24, VAR_4);

			  }

			else

			  {

			    if (VAR_24 >= 0)

			      *VAR_10++ = '+';

			    VAR_10 = format_dec (VAR_24, VAR_10, 1);

			  }

		      }

		    else

		      {

			

			*VAR_10++ = '+';

			*VAR_10++ = '[';

			VAR_10 = format_reg (VAR_14, VAR_6 & 15, VAR_10,

					 VAR_8);

			if (VAR_6 & 0x400)

			  *VAR_10++ = '+';

			*VAR_10++ = ']';

			*VAR_10++ = '.';

			*VAR_10++ = VAR_11[(VAR_6 >> 4) & 3];



			VAR_4->flags

			  |= (CRIS_DIS_FLAG_MEM_TARGET2_IS_REG

			      | CRIS_DIS_FLAG_MEM_TARGET2_MEM

			      | CRIS_DIS_FLAG_MEM_TARGET_IS_REG



			      | (((VAR_6 >> 4) == 2)

				 ? 0

				 : (((VAR_6 >> 4) & 3) == 1

				    ? CRIS_DIS_FLAG_MEM_TARGET2_MEM_WORD

				    : CRIS_DIS_FLAG_MEM_TARGET2_MEM_BYTE)));

		      }

		    break;



		  default:

		    (*VAR_4->fprintf_func) (VAR_4->stream, "?prefix-bug");

		  }



		

		VAR_5 = NULL;

	      }

	    else

	      {

		VAR_10 = format_reg (VAR_14, VAR_1 & 15, VAR_10, VAR_8);



		VAR_4->flags |= CRIS_DIS_FLAG_MEM_TARGET_IS_REG;

		VAR_4->target = VAR_1 & 15;



		if (VAR_1 & 0x400)

		  *VAR_10++ = '+';

	      }

	    *VAR_10++ = ']';

	  }

	break;



      case 'x':

	VAR_10 = format_reg (VAR_14, (VAR_1 >> 12) & 15, VAR_10, VAR_8);

	*VAR_10++ = '.';

	*VAR_10++ = VAR_11[(VAR_1 >> 4) & 3];

	break;



      case 'I':

	VAR_10 = format_dec (VAR_1 & 63, VAR_10, 0);

	break;



      case 'b':

	{

	  int VAR_22 = VAR_2[2] + VAR_2[3] * 256;



	  if (VAR_22 > 32767)

	    VAR_22 -= 65536;



	  VAR_22 += VAR_3 + ((VAR_14->distype == cris_dis_v32) ? 0 : 4);



	  if (VAR_1 == BA_PC_INCR_OPCODE)

	    VAR_4->insn_type = dis_branch;

	  else

	    VAR_4->insn_type = dis_condbranch;



	  VAR_4->target = (bfd_vma) VAR_22;



	  *VAR_10 = 0;

	  VAR_10 = VAR_9;

	  (*VAR_4->fprintf_func) (VAR_4->stream, "%VAR_12%VAR_12 ",

				 VAR_9, cris_cc_strings[VAR_1 >> 12]);



	  (*VAR_4->print_address_func) ((bfd_vma) VAR_22, VAR_4);

	}

      break;



    case 'c':

      VAR_10 = format_dec (VAR_1 & 31, VAR_10, 0);

      break;



    case 'C':

      VAR_10 = format_dec (VAR_1 & 15, VAR_10, 0);

      break;



    case 'o':

      {

	long VAR_23 = VAR_1 & 0xfe;

	bfd_vma target;



	if (VAR_1 & 1)

	  VAR_23 |= ~0xff;



	if (VAR_0->match == BA_QUICK_OPCODE)

	  VAR_4->insn_type = dis_branch;

	else

	  VAR_4->insn_type = dis_condbranch;



	target = VAR_3 + ((VAR_14->distype == cris_dis_v32) ? 0 : 2) + VAR_23;

	VAR_4->target = target;

	*VAR_10 = 0;

	VAR_10 = VAR_9;

	(*VAR_4->fprintf_func) (VAR_4->stream, "%VAR_12", VAR_9);

	(*VAR_4->print_address_func) (target, VAR_4);

      }

      break;



    case 'Q':

    case 'O':

      {

	long VAR_24 = VAR_2[0];



	if (VAR_24 > 127)

	  VAR_24 = VAR_24 - 256;



	VAR_10 = format_dec (VAR_24, VAR_10, 1);

	*VAR_10++ = ',';

	VAR_10 = format_reg (VAR_14, (VAR_1 >> 12) & 15, VAR_10, VAR_8);

      }

      break;



    case 'f':

      VAR_10 = print_flags (VAR_14, VAR_1, VAR_10);

      break;



    case 'i':

      VAR_10 = format_dec ((VAR_1 & 32) ? (VAR_1 & 31) | ~31L : VAR_1 & 31, VAR_10, 1);

      break;



    case 'P':

      {

	const struct cris_spec_reg *VAR_24

	  = spec_reg_info ((VAR_1 >> 12) & 15, VAR_14->distype);



	if (VAR_24->name == NULL)

	  

	  *VAR_10++ = '?';

	else

	  {

	    if (VAR_8)

	      *VAR_10++ = REGISTER_PREFIX_CHAR;

	    strcpy (VAR_10, VAR_24->name);

	    VAR_10 += strlen (VAR_10);

	  }

      }

      break;



    default:

      strcpy (VAR_10, "???");

      VAR_10 += 3;

    }

  }



  *VAR_10 = 0;



  if (VAR_5)

    (*VAR_4->fprintf_func) (VAR_4->stream, " (OOPS unused prefix \"%VAR_12: %VAR_12\")",

			   VAR_5->name, VAR_5->args);



  (*VAR_4->fprintf_func) (VAR_4->stream, "%VAR_12", VAR_9);



  





  if (TRACE_CASE && case_offset_counter == 0)

    {

      if (CONST_STRNEQ (VAR_0->name, "sub"))

	case_offset = last_immediate;



      

      else if (CONST_STRNEQ (VAR_0->name, "add"))

	

	case_offset = -last_immediate;



      

      else if (CONST_STRNEQ (VAR_0->name, "bound"))

	no_of_case_offsets = last_immediate + 1;



      



      else if (VAR_4->insn_type == dis_jsr

	       || VAR_4->insn_type == dis_branch

	       || VAR_4->insn_type == dis_condbranch)

	case_offset = 0;

    }

}

FUNC_0 (const struct cris_opcode *VAR_0,
unsigned int VAR_1,
unsigned char *VAR_2,
bfd_vma VAR_3,
disassemble_info *VAR_4,
const struct cris_opcode *VAR_5,
unsigned int VAR_6,
unsigned char *VAR_7,
bfd_boolean VAR_8)
{ char VAR_9[sizeof (".d [$r13=$r12-2147483648],$r10") * 2]; char *VAR_10 = VAR_9; static const char VAR_11[] = "bwd?"; const char *VAR_12; const char *VAR_13; struct cris_disasm_data *VAR_14
= (struct cris_disasm_data *) VAR_4->private_data; (*VAR_4->fprintf_func) (VAR_4->stream, "%VAR_12", VAR_0->name); VAR_13 = VAR_0->args; VAR_12 = VAR_13; if (*VAR_12 == 'p')
VAR_12++; if (*VAR_12 == 'm' || *VAR_12 == 'M' || *VAR_12 == 'z')
{ *VAR_10++ = '.'; *VAR_10++ = *VAR_12 == 'M'
? (VAR_1 & 0x8000 ? 'd'
: VAR_1 & 0x4000 ? 'w' : 'b')
: VAR_11[(VAR_1 >> 4) & (*VAR_12 == 'z' ? 1 : 3)]; VAR_12 += 2; } if (VAR_0->match != (BRANCH_PC_LOW + BRANCH_INCR_HIGH * 256))
*VAR_10++ = ' '; if (VAR_0->name[0] == 'j')
{ if (CONST_STRNEQ (VAR_0->name, "jsr"))
VAR_4->insn_type = dis_jsr; else
VAR_4->insn_type = dis_branch; } VAR_4->branch_delay_insns = VAR_0->delayed; for (; *VAR_12; VAR_12++) { switch (*VAR_12)
{ case 'T':
VAR_10 = format_sup_reg ((VAR_1 >> 12) & 15, VAR_10, VAR_8); break; case 'A':
if (VAR_8)
*VAR_10++ = REGISTER_PREFIX_CHAR; *VAR_10++ = 'a'; *VAR_10++ = 'c'; *VAR_10++ = 'r'; break; case '[':
case ']':
case ',':
*VAR_10++ = *VAR_12; break; case '!':
break; case 'd':
break; case 'B':
VAR_5 = NULL; break; case 'D':
case 'r':
VAR_10 = format_reg (VAR_14, VAR_1 & 15, VAR_10, VAR_8); break; case 'R':
VAR_10 = format_reg (VAR_14, (VAR_1 >> 12) & 15, VAR_10, VAR_8); break; case 'n':
{ unsigned long VAR_24
= (VAR_2[2] + VAR_2[3] * 256 + VAR_2[4] * 65536
+ VAR_2[5] * 0x1000000 + VAR_3); *VAR_10 = 0; if (VAR_9[0])
(*VAR_4->fprintf_func) (VAR_4->stream, "%VAR_12", VAR_9); VAR_10 = VAR_9; (*VAR_4->print_address_func) ((bfd_vma) VAR_24, VAR_4); } break; case 'u':
{ unsigned long VAR_24 = (VAR_2[0] & 0xf) * 2 + VAR_3; *VAR_10 = 0; if (VAR_9[0])
(*VAR_4->fprintf_func) (VAR_4->stream, "%VAR_12", VAR_9); VAR_10 = VAR_9; (*VAR_4->print_address_func) ((bfd_vma) VAR_24, VAR_4); } break; case 'N':
case 'y':
case 'Y':
case 'S':
case 'VAR_12':
if ((VAR_1 & 0x400) && (VAR_1 & 15) == 15 && VAR_5 == NULL)
{ long VAR_24; int VAR_16
= ((*VAR_13 == 'z' && (VAR_1 & 0x20))
|| VAR_0->match == BDAP_QUICK_OPCODE); int VAR_22; if (VAR_0->imm_oprnd_size == SIZE_FIX_32)
VAR_22 = 4; else if (VAR_0->imm_oprnd_size == SIZE_SPEC_REG)
{ const struct cris_spec_reg *VAR_24
= spec_reg_info ((VAR_1 >> 12) & 15, VAR_14->distype); if (VAR_24 == NULL)
VAR_22 = 42; else
VAR_22 = VAR_14->distype == cris_dis_v32
? 4 : (VAR_24->reg_size + 1) & ~1; } else
{ int VAR_22 = 1 << ((VAR_1 >> 4) & (*VAR_13 == 'z' ? 1 : 3)); if (VAR_22 == 1)
VAR_22 = 2; else
VAR_22 = VAR_22; } switch (VAR_22)
{ case 1:
VAR_24 = VAR_2[2]; if (VAR_16 && VAR_24 > 127)
VAR_24 -= 256; break; case 2:
VAR_24 = VAR_2[2] + VAR_2[3] * 256; if (VAR_16 && VAR_24 > 32767)
VAR_24 -= 65536; break; case 4:
VAR_24
= VAR_2[2] + VAR_2[3] * 256 + VAR_2[4] * 65536
+ VAR_2[5] * 0x1000000; break; default:
strcpy (VAR_10, "bug"); VAR_10 += 3; VAR_24 = 42; } if ((*VAR_13 == 'z' && (VAR_1 & 0x20))
|| (VAR_0->match == BDAP_QUICK_OPCODE
&& (VAR_22 <= 2 || VAR_2[1 + VAR_22] == 0)))
VAR_10 = format_dec (VAR_24, VAR_10, VAR_16); else
{ unsigned int VAR_20 = (VAR_24 >> 24) & 0xff; if (VAR_22 == 4
&& (VAR_20 == ((VAR_3 >> 24) & 0xff)
|| (VAR_20 != 0 && VAR_20 != 0xff)
|| VAR_4->insn_type == dis_branch
|| VAR_4->insn_type == dis_jsr))
{ *VAR_10 = 0; VAR_10 = VAR_9; if (VAR_9[0])
(*VAR_4->fprintf_func) (VAR_4->stream, "%VAR_12", VAR_9); (*VAR_4->print_address_func) ((bfd_vma) VAR_24, VAR_4); VAR_4->target = VAR_24; } else
VAR_10 = format_hex (VAR_24, VAR_10, VAR_14); } } else
{ if (VAR_4->insn_type != dis_nonbranch)
{ int VAR_22
= 1 << ((VAR_1 >> 4)
& (VAR_0->args[0] == 'z' ? 1 : 3)); int VAR_21; VAR_4->insn_type = dis_dref; VAR_4->flags |= CRIS_DIS_FLAG_MEMREF; if (VAR_0->imm_oprnd_size == SIZE_FIX_32)
VAR_21 = 4; else if (VAR_0->imm_oprnd_size == SIZE_SPEC_REG)
{ const struct cris_spec_reg *VAR_24
= spec_reg_info ((VAR_1 >> 12) & 15, VAR_14->distype); if (VAR_24 == NULL)
VAR_21 = 4; else
VAR_21 = VAR_24->reg_size; } else
VAR_21 = VAR_22; VAR_4->data_size = VAR_21; } *VAR_10++ = '['; if (VAR_5
&& ((VAR_1 & 0x400) == 0
|| VAR_5->match != DIP_OPCODE))
{ if (VAR_1 & 0x400)
{ VAR_10 = format_reg (VAR_14, VAR_1 & 15, VAR_10, VAR_8); *VAR_10++ = '='; } switch (VAR_5->match)
{ case DIP_OPCODE:
if ((VAR_6 & 0x400) && (VAR_6 & 15) == 15)
{ unsigned long VAR_24
= VAR_7[2] + VAR_7[3] * 256
+ VAR_7[4] * 65536
+ VAR_7[5] * 0x1000000; VAR_4->target = (bfd_vma) VAR_24; *VAR_10 = 0; VAR_10 = VAR_9; if (VAR_9[0])
(*VAR_4->fprintf_func) (VAR_4->stream, "%VAR_12", VAR_9); (*VAR_4->print_address_func) ((bfd_vma) VAR_24, VAR_4); } else
{ VAR_4->flags
|= (CRIS_DIS_FLAG_MEM_TARGET2_IS_REG
| CRIS_DIS_FLAG_MEM_TARGET2_MEM); VAR_4->target2 = VAR_6 & 15; *VAR_10++ = '['; VAR_10 = format_reg (VAR_14, VAR_6 & 15, VAR_10,
VAR_8); if (VAR_6 & 0x400)
*VAR_10++ = '+'; *VAR_10++ = ']'; } break; case BDAP_QUICK_OPCODE:
{ int VAR_24; VAR_24 = VAR_7[0]; if (VAR_24 > 127)
VAR_24 -= 256; VAR_10 = format_reg (VAR_14, (VAR_6 >> 12) & 15, VAR_10,
VAR_8); if (VAR_24 >= 0)
*VAR_10++ = '+'; VAR_10 = format_dec (VAR_24, VAR_10, 1); VAR_4->flags |= CRIS_DIS_FLAG_MEM_TARGET_IS_REG; VAR_4->target = (VAR_6 >> 12) & 15; VAR_4->target2 = (bfd_vma) VAR_24; break; } case BIAP_OPCODE:
VAR_10 = format_reg (VAR_14, VAR_6 & 15, VAR_10,
VAR_8); *VAR_10++ = '+'; VAR_10 = format_reg (VAR_14, (VAR_6 >> 12) & 15, VAR_10,
VAR_8); *VAR_10++ = '.'; *VAR_10++ = VAR_11[(VAR_6 >> 4) & 3]; VAR_4->flags
|= (CRIS_DIS_FLAG_MEM_TARGET2_IS_REG
| CRIS_DIS_FLAG_MEM_TARGET_IS_REG
| ((VAR_6 & 0x8000)
? CRIS_DIS_FLAG_MEM_TARGET2_MULT4
: ((VAR_6 & 0x8000)
? CRIS_DIS_FLAG_MEM_TARGET2_MULT2 : 0))); if (VAR_1 == 0xf83f && (VAR_6 & ~0xf000) == 0x55f)
case_offset_counter = no_of_case_offsets; break; case BDAP_INDIR_OPCODE:
VAR_10 = format_reg (VAR_14, (VAR_6 >> 12) & 15, VAR_10,
VAR_8); if ((VAR_6 & 0x400) && (VAR_6 & 15) == 15)
{ long VAR_24; unsigned int VAR_22; int VAR_22 = 1 << ((VAR_6 >> 4) & 3); if (VAR_22 == 1)
VAR_22 = 2; else
VAR_22 = VAR_22; switch (VAR_22)
{ case 1:
VAR_24 = VAR_7[2]; if (VAR_24 > 127)
VAR_24 -= 256; break; case 2:
VAR_24 = VAR_7[2] + VAR_7[3] * 256; if (VAR_24 > 32767)
VAR_24 -= 65536; break; case 4:
VAR_24
= VAR_7[2] + VAR_7[3] * 256
+ VAR_7[4] * 65536
+ VAR_7[5] * 0x1000000; break; default:
strcpy (VAR_10, "bug"); VAR_10 += 3; VAR_24 = 42; } VAR_4->flags |= CRIS_DIS_FLAG_MEM_TARGET_IS_REG; VAR_4->target2 = (bfd_vma) VAR_24; if (VAR_22 == 4)
{ *VAR_10++ = '+'; *VAR_10 = 0; VAR_10 = VAR_9; (*VAR_4->fprintf_func) (VAR_4->stream, "%VAR_12", VAR_9); (*VAR_4->print_address_func) ((bfd_vma) VAR_24, VAR_4); } else
{ if (VAR_24 >= 0)
*VAR_10++ = '+'; VAR_10 = format_dec (VAR_24, VAR_10, 1); } } else
{ *VAR_10++ = '+'; *VAR_10++ = '['; VAR_10 = format_reg (VAR_14, VAR_6 & 15, VAR_10,
VAR_8); if (VAR_6 & 0x400)
*VAR_10++ = '+'; *VAR_10++ = ']'; *VAR_10++ = '.'; *VAR_10++ = VAR_11[(VAR_6 >> 4) & 3]; VAR_4->flags
|= (CRIS_DIS_FLAG_MEM_TARGET2_IS_REG
| CRIS_DIS_FLAG_MEM_TARGET2_MEM
| CRIS_DIS_FLAG_MEM_TARGET_IS_REG
| (((VAR_6 >> 4) == 2)
? 0
: (((VAR_6 >> 4) & 3) == 1
? CRIS_DIS_FLAG_MEM_TARGET2_MEM_WORD
: CRIS_DIS_FLAG_MEM_TARGET2_MEM_BYTE))); } break; default:
(*VAR_4->fprintf_func) (VAR_4->stream, "?prefix-bug"); } VAR_5 = NULL; } else
{ VAR_10 = format_reg (VAR_14, VAR_1 & 15, VAR_10, VAR_8); VAR_4->flags |= CRIS_DIS_FLAG_MEM_TARGET_IS_REG; VAR_4->target = VAR_1 & 15; if (VAR_1 & 0x400)
*VAR_10++ = '+'; } *VAR_10++ = ']'; } break; case 'x':
VAR_10 = format_reg (VAR_14, (VAR_1 >> 12) & 15, VAR_10, VAR_8); *VAR_10++ = '.'; *VAR_10++ = VAR_11[(VAR_1 >> 4) & 3]; break; case 'I':
VAR_10 = format_dec (VAR_1 & 63, VAR_10, 0); break; case 'b':
{ int VAR_22 = VAR_2[2] + VAR_2[3] * 256; if (VAR_22 > 32767)
VAR_22 -= 65536; VAR_22 += VAR_3 + ((VAR_14->distype == cris_dis_v32) ? 0 : 4); if (VAR_1 == BA_PC_INCR_OPCODE)
VAR_4->insn_type = dis_branch; else
VAR_4->insn_type = dis_condbranch; VAR_4->target = (bfd_vma) VAR_22; *VAR_10 = 0; VAR_10 = VAR_9; (*VAR_4->fprintf_func) (VAR_4->stream, "%VAR_12%VAR_12 ",
VAR_9, cris_cc_strings[VAR_1 >> 12]); (*VAR_4->print_address_func) ((bfd_vma) VAR_22, VAR_4); } break; case 'c':
VAR_10 = format_dec (VAR_1 & 31, VAR_10, 0); break; case 'C':
VAR_10 = format_dec (VAR_1 & 15, VAR_10, 0); break; case 'o':
{ long VAR_23 = VAR_1 & 0xfe; bfd_vma target; if (VAR_1 & 1)
VAR_23 |= ~0xff; if (VAR_0->match == BA_QUICK_OPCODE)
VAR_4->insn_type = dis_branch; else
VAR_4->insn_type = dis_condbranch; target = VAR_3 + ((VAR_14->distype == cris_dis_v32) ? 0 : 2) + VAR_23; VAR_4->target = target; *VAR_10 = 0; VAR_10 = VAR_9; (*VAR_4->fprintf_func) (VAR_4->stream, "%VAR_12", VAR_9); (*VAR_4->print_address_func) (target, VAR_4); } break; case 'Q':
case 'O':
{ long VAR_24 = VAR_2[0]; if (VAR_24 > 127)
VAR_24 = VAR_24 - 256; VAR_10 = format_dec (VAR_24, VAR_10, 1); *VAR_10++ = ','; VAR_10 = format_reg (VAR_14, (VAR_1 >> 12) & 15, VAR_10, VAR_8); } break; case 'f':
VAR_10 = print_flags (VAR_14, VAR_1, VAR_10); break; case 'i':
VAR_10 = format_dec ((VAR_1 & 32) ? (VAR_1 & 31) | ~31L : VAR_1 & 31, VAR_10, 1); break; case 'P':
{ const struct cris_spec_reg *VAR_24
= spec_reg_info ((VAR_1 >> 12) & 15, VAR_14->distype); if (VAR_24->name == NULL)
*VAR_10++ = '?'; else
{ if (VAR_8)
*VAR_10++ = REGISTER_PREFIX_CHAR; strcpy (VAR_10, VAR_24->name); VAR_10 += strlen (VAR_10); } } break; default:
strcpy (VAR_10, "???"); VAR_10 += 3; } } *VAR_10 = 0; if (VAR_5)
(*VAR_4->fprintf_func) (VAR_4->stream, " (OOPS unused prefix \"%VAR_12: %VAR_12\")",
VAR_5->name, VAR_5->args); (*VAR_4->fprintf_func) (VAR_4->stream, "%VAR_12", VAR_9); if (TRACE_CASE && case_offset_counter == 0)
{ if (CONST_STRNEQ (VAR_0->name, "sub"))
case_offset = last_immediate; else if (CONST_STRNEQ (VAR_0->name, "add"))
case_offset = -last_immediate; else if (CONST_STRNEQ (VAR_0->name, "bound"))
no_of_case_offsets = last_immediate + 1; else if (VAR_4->insn_type == dis_jsr
|| VAR_4->insn_type == dis_branch
|| VAR_4->insn_type == dis_condbranch)
case_offset = 0; } }