 -                    chainingAllowed,
 -                    vta->addProfInc,
 -                    max_ga );
--
++   // COMMENTED OUT FOR PYVEX_STATIC: /* No guest has its IP field at offset zero.  If this fails it
++   // COMMENTED OUT FOR PYVEX_STATIC:    means some transformation pass somewhere failed to update/copy
++   // COMMENTED OUT FOR PYVEX_STATIC:    irsb->offsIP properly. */
++   // COMMENTED OUT FOR PYVEX_STATIC: vassert(irsb->offsIP >= 16);
++
++   // COMMENTED OUT FOR PYVEX_STATIC: vcode = iselSB ( irsb, vta->arch_host,
++   // COMMENTED OUT FOR PYVEX_STATIC:                  &vta->archinfo_host, 
++   // COMMENTED OUT FOR PYVEX_STATIC:                  &vta->abiinfo_both,
++   // COMMENTED OUT FOR PYVEX_STATIC:                  offB_HOST_EvC_COUNTER,
++   // COMMENTED OUT FOR PYVEX_STATIC:                  offB_HOST_EvC_FAILADDR,
++   // COMMENTED OUT FOR PYVEX_STATIC:                  chainingAllowed,
++   // COMMENTED OUT FOR PYVEX_STATIC:                  vta->addProfInc,
++   // COMMENTED OUT FOR PYVEX_STATIC:                  max_ga );
++
++   // COMMENTED OUT FOR PYVEX_STATIC: vexAllocSanityCheck();
++
++   // COMMENTED OUT FOR PYVEX_STATIC: if (vex_traceflags & VEX_TRACE_VCODE)
++   // COMMENTED OUT FOR PYVEX_STATIC:    vex_printf("\n");
++
++   // COMMENTED OUT FOR PYVEX_STATIC: if (vex_traceflags & VEX_TRACE_VCODE) {
++   // COMMENTED OUT FOR PYVEX_STATIC:    for (i = 0; i < vcode->arr_used; i++) {
++   // COMMENTED OUT FOR PYVEX_STATIC:       vex_printf("%3d   ", i);
++   // COMMENTED OUT FOR PYVEX_STATIC:       ppInstr(vcode->arr[i], mode64);
++   // COMMENTED OUT FOR PYVEX_STATIC:       vex_printf("\n");
++   // COMMENTED OUT FOR PYVEX_STATIC:    }
++   // COMMENTED OUT FOR PYVEX_STATIC:    vex_printf("\n");
++   // COMMENTED OUT FOR PYVEX_STATIC: }
++
++   // COMMENTED OUT FOR PYVEX_STATIC: /* Register allocate. */
++   // COMMENTED OUT FOR PYVEX_STATIC: rcode = doRegisterAllocation ( vcode, available_real_regs,
++   // COMMENTED OUT FOR PYVEX_STATIC:                                n_available_real_regs,
++   // COMMENTED OUT FOR PYVEX_STATIC:                                isMove, getRegUsage, mapRegs, 
++   // COMMENTED OUT FOR PYVEX_STATIC:                                genSpill, genReload, directReload, 
++   // COMMENTED OUT FOR PYVEX_STATIC:                                guest_sizeB,
++   // COMMENTED OUT FOR PYVEX_STATIC:                                ppInstr, ppReg, mode64 );
++
++   // COMMENTED OUT FOR PYVEX_STATIC: vexAllocSanityCheck();
++
++   // COMMENTED OUT FOR PYVEX_STATIC: if (vex_traceflags & VEX_TRACE_RCODE) {
++   // COMMENTED OUT FOR PYVEX_STATIC:    vex_printf("\n------------------------" 
++   // COMMENTED OUT FOR PYVEX_STATIC:                 " Register-allocated code "
++   // COMMENTED OUT FOR PYVEX_STATIC:                 "------------------------\n\n");
++   // COMMENTED OUT FOR PYVEX_STATIC:    for (i = 0; i < rcode->arr_used; i++) {
++   // COMMENTED OUT FOR PYVEX_STATIC:       vex_printf("%3d   ", i);
++   // COMMENTED OUT FOR PYVEX_STATIC:       ppInstr(rcode->arr[i], mode64);
++   // COMMENTED OUT FOR PYVEX_STATIC:       vex_printf("\n");
++   // COMMENTED OUT FOR PYVEX_STATIC:    }
++   // COMMENTED OUT FOR PYVEX_STATIC:    vex_printf("\n");
++   // COMMENTED OUT FOR PYVEX_STATIC: }
++
++   // COMMENTED OUT FOR PYVEX_STATIC: /* HACK */
++   // COMMENTED OUT FOR PYVEX_STATIC: if (0) { 
++   // COMMENTED OUT FOR PYVEX_STATIC:    *(vta->host_bytes_used) = 0;
++   // COMMENTED OUT FOR PYVEX_STATIC:    res.status = VexTransOK; return res;
++   // COMMENTED OUT FOR PYVEX_STATIC: }
++   // COMMENTED OUT FOR PYVEX_STATIC: /* end HACK */
++
++   // COMMENTED OUT FOR PYVEX_STATIC: /* Assemble */
++   // COMMENTED OUT FOR PYVEX_STATIC: if (vex_traceflags & VEX_TRACE_ASM) {
++   // COMMENTED OUT FOR PYVEX_STATIC:    vex_printf("\n------------------------" 
++   // COMMENTED OUT FOR PYVEX_STATIC:                 " Assembly "
++   // COMMENTED OUT FOR PYVEX_STATIC:                 "------------------------\n\n");
++   // COMMENTED OUT FOR PYVEX_STATIC: }
++
++   // COMMENTED OUT FOR PYVEX_STATIC: out_used = 0; /* tracks along the host_bytes array */
++   // COMMENTED OUT FOR PYVEX_STATIC: for (i = 0; i < rcode->arr_used; i++) {
++   // COMMENTED OUT FOR PYVEX_STATIC:    HInstr* hi           = rcode->arr[i];
++   // COMMENTED OUT FOR PYVEX_STATIC:    Bool    hi_isProfInc = False;
++   // COMMENTED OUT FOR PYVEX_STATIC:    if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) {
++   // COMMENTED OUT FOR PYVEX_STATIC:       ppInstr(hi, mode64);
++   // COMMENTED OUT FOR PYVEX_STATIC:       vex_printf("\n");
++   // COMMENTED OUT FOR PYVEX_STATIC:    }
++   // COMMENTED OUT FOR PYVEX_STATIC:    j = emit( &hi_isProfInc,
++   // COMMENTED OUT FOR PYVEX_STATIC:              insn_bytes, sizeof insn_bytes, hi, mode64,
++   // COMMENTED OUT FOR PYVEX_STATIC:              vta->disp_cp_chain_me_to_slowEP,
++   // COMMENTED OUT FOR PYVEX_STATIC:              vta->disp_cp_chain_me_to_fastEP,
++   // COMMENTED OUT FOR PYVEX_STATIC:              vta->disp_cp_xindir,
++   // COMMENTED OUT FOR PYVEX_STATIC:              vta->disp_cp_xassisted );
++   // COMMENTED OUT FOR PYVEX_STATIC:    if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) {
++   // COMMENTED OUT FOR PYVEX_STATIC:       for (k = 0; k < j; k++)
++   // COMMENTED OUT FOR PYVEX_STATIC:          if (insn_bytes[k] < 16)
++   // COMMENTED OUT FOR PYVEX_STATIC:             vex_printf("0%x ",  (UInt)insn_bytes[k]);
++   // COMMENTED OUT FOR PYVEX_STATIC:          else
++   // COMMENTED OUT FOR PYVEX_STATIC:             vex_printf("%x ", (UInt)insn_bytes[k]);
++   // COMMENTED OUT FOR PYVEX_STATIC:       vex_printf("\n\n");
++   // COMMENTED OUT FOR PYVEX_STATIC:    }
++   // COMMENTED OUT FOR PYVEX_STATIC:    if (UNLIKELY(out_used + j > vta->host_bytes_size)) {
++   // COMMENTED OUT FOR PYVEX_STATIC:       vexSetAllocModeTEMP_and_clear();
++   // COMMENTED OUT FOR PYVEX_STATIC:       vex_traceflags = 0;
++   // COMMENTED OUT FOR PYVEX_STATIC:       res.status = VexTransOutputFull;
++   // COMMENTED OUT FOR PYVEX_STATIC:       return res;
++   // COMMENTED OUT FOR PYVEX_STATIC:    }
++   // COMMENTED OUT FOR PYVEX_STATIC:    if (UNLIKELY(hi_isProfInc)) {
++   // COMMENTED OUT FOR PYVEX_STATIC:       vassert(vta->addProfInc); /* else where did it come from? */
++   // COMMENTED OUT FOR PYVEX_STATIC:       vassert(res.offs_profInc == -1); /* there can be only one (tm) */
++   // COMMENTED OUT FOR PYVEX_STATIC:       vassert(out_used >= 0);
++   // COMMENTED OUT FOR PYVEX_STATIC:       res.offs_profInc = out_used;
++   // COMMENTED OUT FOR PYVEX_STATIC:    }
++   // COMMENTED OUT FOR PYVEX_STATIC:    { UChar* dst = &vta->host_bytes[out_used];
++   // COMMENTED OUT FOR PYVEX_STATIC:      for (k = 0; k < j; k++) {
++   // COMMENTED OUT FOR PYVEX_STATIC:         dst[k] = insn_bytes[k];
++   // COMMENTED OUT FOR PYVEX_STATIC:      }
++   // COMMENTED OUT FOR PYVEX_STATIC:      out_used += j;
++   // COMMENTED OUT FOR PYVEX_STATIC:    }
++   // COMMENTED OUT FOR PYVEX_STATIC:    vassert(out_used <= vta->host_bytes_size);
++   // COMMENTED OUT FOR PYVEX_STATIC: }
++   // COMMENTED OUT FOR PYVEX_STATIC: *(vta->host_bytes_used) = out_used;
+ 
 -   vexAllocSanityCheck();
 -
 -   if (vex_traceflags & VEX_TRACE_VCODE)

diff -rupN valgrind-3.8.1/VEX/priv/guest_mips_toIR.c valgrind-3.8.1-static/VEX/priv/guest_mips_toIR.c
--- valgrind-3.8.1/VEX/priv/guest_mips_toIR.c	2012-08-17 00:00:00.000000000 -0700
+++ valgrind-3.8.1-static/VEX/priv/guest_mips_toIR.c	2013-11-08 20:36:54.789667536 -0800
@@ -249,17 +249,10 @@ static UInt floatGuestRegOffset(UInt fre
 static inline UInt getUInt(UChar * p)
 {
    UInt w = 0;
-#if defined (_MIPSEL)
-   w = (w << 8) | p[3];
-   w = (w << 8) | p[2];
-   w = (w << 8) | p[1];
-   w = (w << 8) | p[0];
-#elif defined (_MIPSEB)
    w = (w << 8) | p[0];
    w = (w << 8) | p[1];
    w = (w << 8) | p[2];
    w = (w << 8) | p[3];
-#endif
    return w;
 }
 
diff -rupN valgrind-3.8.1/VEX/priv/main_main.c valgrind-3.8.1-static/VEX/priv/main_main.c
--- valgrind-3.8.1/VEX/priv/main_main.c	2012-08-17 00:00:00.000000000 -0700
+++ valgrind-3.8.1-static/VEX/priv/main_main.c	2013-11-08 20:36:14.841666530 -0800
@@ -749,115 +749,115 @@ VexTranslateResult LibVEX_Translate ( Ve
                    " Instruction selection "
                    "------------------------\n");
 

-      vassert(out_used <= vta->host_bytes_size);
-   }
-   *(vta->host_bytes_used) = out_used;
-
-   vexAllocSanityCheck();
+   // COMMENTED OUT FOR PYVEX_STATIC: vexAllocSanityCheck();
 
