 +static int imm_size (unsigned int n);
 +
 +static void
-+insert_add_sp_sandbox_code (offsetT insn_start_off)
++insert_sp_adjust_sandbox_code (offsetT insn_start_off)
 +{
-+  char *p;
-+  if (i.reg_operands == 2)
-+    {
-+      if (i.rex & REX_B)
-+	{
-+	  p = frag_more (3);
-+	  p[0] = 0x44;
-+	  p[1] = 0x01;
-+	  p[2] = 0xc4 + (i.rm.regmem << 3); // ADD %eXX, %esp
-+	  i.rex &= ~REX_B;
-+	  i.prefix[REX_PREFIX] &= ~REX_B;
-+	}
-+      else
-+	{
-+	  p = frag_more (2);
-+	  p[0] = 0x01;
-+	  p[1] = 0xc4 + (i.rm.regmem << 3); // ADD %eXX, %esp
-+	}
-+    }
-+  else
-+    {
-+      p = frag_more(2);
-+      if (imm_size (0) == 1)
-+	p[0] = 0x83; // ADD imm8, %esp
-+      else
-+	p[0] = 0x81; // ADD imm32, %esp
-+      p[1] = 0xc4;
-+      output_imm (frag_now, insn_start_off);
-+      // Immediate was already used
-+      i.imm_operands = 0;
-+    }
-+  // Second operand is SP
-+  i.rm.regmem = 4;
-+}
-+
-+static void
-+insert_sub_sp_sandbox_code (offsetT insn_start_off)
-+{
-+  char *p;
-+  if (i.reg_operands == 2)
-+    {
-+      if (i.rex & REX_B)
-+	{
-+	  p = frag_more (3);
-+	  p[0] = 0x44;
-+	  p[1] = 0x29;
-+	  p[2] = 0xc4 + (i.rm.regmem << 3); // SUB %eXX, %esp
-+	  i.rex &= ~REX_B;
-+	  i.prefix[REX_PREFIX] &= ~REX_B;
-+	}
-+      else
-+	{
-+	  p = frag_more (2);
-+	  p[0] = 0x29;
-+	  p[1] = 0xc4 + (i.rm.regmem << 3); // SUB %eXX, %esp
-+	}
-+    }
-+  else
-+    {
-+      p = frag_more(2);
-+      if (imm_size (0) == 1)
-+	p[0] = 0x83; // SUB imm8, %esp
-+      else
-+	p[0] = 0x81; // SUB imm32, %esp
-+      p[1] = 0xec;
-+      output_imm (frag_now, insn_start_off);
-+      // Immediate was already used
-+      i.imm_operands = 0;
-+    }
-+  // Second operand is SP
-+  i.rm.regmem = 4;
-+}
-+
-+static void
-+insert_sp_adjust_sandbox_code(offsetT insn_start_off)
-+{
-+  char *p = frag_more(2);
++  char *p = frag_more (2);
 +  p[0] = 0x8d; // LEA off(%rbp), %esp
 +  if (imm_size(0) == 1)
 +    p[1] = 0x65; // Off8
 +  else
 +    p[1] = 0xa5; // Off32
-+  output_imm(frag_now, insn_start_off);
++  output_imm (frag_now, insn_start_off);
 +  // Immediate was already used.
 +  i.imm_operands = 0;
 +  // Second operand is SP

     }
   else if (*op_string == IMMEDIATE_PREFIX)
     {
@@ -7725,6 +8226,8 @@
 #define OPTION_MOLD_GCC (OPTION_MD_BASE + 9)
 #define OPTION_MSSE2AVX (OPTION_MD_BASE + 10)
 #define OPTION_MSSE_CHECK (OPTION_MD_BASE + 11)

+nacljmp, 1, 0xff, 0x4, 1, CpuNo64, Modrm|DefaultSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { Reg32 }
+naclcall, 2, 0xff, 0x2, 1, Cpu64, Modrm|DefaultSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { Reg32, Reg64 }
+nacljmp, 2, 0xff, 0x4, 1, Cpu64, Modrm|DefaultSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { Reg32, Reg64 }
+naclasp, 2, 0x01, None, 1, Cpu64, W|Modrm|No_sSuf|No_ldSuf, { Imm8S, Reg64 }
+naclasp, 2, 0x01, None, 1, Cpu64, W|Modrm|No_sSuf|No_ldSuf, { Imm32S, Reg64 }
+naclasp, 2, 0x01, None, 1, Cpu64, W|Modrm|No_sSuf|No_ldSuf, { Unspecified|BaseIndex|Disp8|Disp32S|Reg32, Reg64 }
+naclssp, 2, 0x01, None, 1, Cpu64, W|Modrm|No_sSuf|No_ldSuf, { Imm8S, Reg64 }
+naclssp, 2, 0x01, None, 1, Cpu64, W|Modrm|No_sSuf|No_ldSuf, { Imm32S, Reg64 }
+naclssp, 2, 0x01, None, 1, Cpu64, W|Modrm|No_sSuf|No_ldSuf, { Unspecified|BaseIndex|Disp8|Disp32S|Reg32, Reg64 }
+naclspadj, 2, 0x01, None, 1, Cpu64, W|Modrm|No_sSuf|No_ldSuf, { Imm8S, Reg64 }
+naclspadj, 2, 0x01, None, 1, Cpu64, W|Modrm|No_sSuf|No_ldSuf, { Imm32S, Reg64 }
+naclrestbp, 2, 0x01, None, 1, Cpu64, W|Modrm|No_sSuf|No_ldSuf, { Unspecified|BaseIndex|Disp8|Disp32S|Reg32, Reg64 }
