Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public function drop(imgPtr:int, x:int, y:int, stride:int):void
  2.         {
  3.             var tst:FernsTest;
  4.             var ntf:int = numTestsPerFern;
  5.             var img:int = __cint(imgPtr + x + stride * y);
  6.             var index:int = 0;
  7.             var idx_ptr:int = leaves_index;
  8.            
  9.             tst = tests;
  10.            
  11.             __cint(__asm(__as3(ntf-6)));
  12.             __asm(LookupSwitch("default", "6", "7", "8", "9", "10", "11", "12"));
  13.             __asm("default:"); // here default will take the min op
  14.             __asm("6:");
  15.                 while(tst != null) {
  16.                  index = 0;
  17.                  __beginRepeat(5);
  18.                  {
  19.                     index = __cint( index + int(Memory.readUnsignedByte(img + tst.ind1) < Memory.readUnsignedByte(img + tst.ind2)) );
  20.                     index <<= 1;
  21.                     tst = tst.next;
  22.                  }
  23.                  __endRepeat();
  24.                  index = __cint( index + int(Memory.readUnsignedByte(img + tst.ind1) < Memory.readUnsignedByte(img + tst.ind2)) );
  25.                  tst = tst.next;
  26.                  Memory.writeInt(index, idx_ptr);
  27.                idx_ptr = __cint(idx_ptr + 4);
  28.                 }
  29.          __asm(Jump("break"));
  30.        
  31.          __asm("7:");
  32.                 while(tst != null) {
  33.                  index = 0;
  34.                  __beginRepeat(6);
  35.                  {
  36.                     index = __cint( index + int(Memory.readUnsignedByte(img + tst.ind1) < Memory.readUnsignedByte(img + tst.ind2)) );
  37.                     index <<= 1;
  38.                     tst = tst.next;
  39.                  }
  40.                  __endRepeat();
  41.                  index = __cint( index + int(Memory.readUnsignedByte(img + tst.ind1) < Memory.readUnsignedByte(img + tst.ind2)) );
  42.                  tst = tst.next;
  43.                  Memory.writeInt(index, idx_ptr);
  44.                idx_ptr = __cint(idx_ptr + 4);
  45.                 }
  46.          __asm(Jump("break"));
  47.        
  48.          __asm("8:");
  49.                 while(tst != null) {
  50.                  index = 0;
  51.                  __beginRepeat(7);
  52.                  {
  53.                     index = __cint( index + int(Memory.readUnsignedByte(img + tst.ind1) < Memory.readUnsignedByte(img + tst.ind2)) );
  54.                     index <<= 1;
  55.                     tst = tst.next;
  56.                  }
  57.                  __endRepeat();
  58.                  index = __cint( index + int(Memory.readUnsignedByte(img + tst.ind1) < Memory.readUnsignedByte(img + tst.ind2)) );
  59.                  tst = tst.next;
  60.                  Memory.writeInt(index, idx_ptr);
  61.                idx_ptr = __cint(idx_ptr + 4);
  62.                 }
  63.          __asm(Jump("break"));
  64.        
  65.          __asm("9:");
  66.                 while(tst != null) {
  67.                  index = 0;
  68.                  __beginRepeat(8);
  69.                  {
  70.                     index = __cint( index + int(Memory.readUnsignedByte(img + tst.ind1) < Memory.readUnsignedByte(img + tst.ind2)) );
  71.                     index <<= 1;
  72.                     tst = tst.next;
  73.                  }
  74.                  __endRepeat();
  75.                  index = __cint( index + int(Memory.readUnsignedByte(img + tst.ind1) < Memory.readUnsignedByte(img + tst.ind2)) );
  76.                  tst = tst.next;
  77.                  Memory.writeInt(index, idx_ptr);
  78.                idx_ptr = __cint(idx_ptr + 4);
  79.                 }
  80.          __asm(Jump("break"));
  81.        
  82.          __asm("10:");
  83.                 while(tst != null) {
  84.                  index = 0;
  85.                  __beginRepeat(9);
  86.                  {
  87.                     index = __cint( index + int(Memory.readUnsignedByte(img + tst.ind1) < Memory.readUnsignedByte(img + tst.ind2)) );
  88.                     index <<= 1;
  89.                     tst = tst.next;
  90.                  }
  91.                  __endRepeat();
  92.                  index = __cint( index + int(Memory.readUnsignedByte(img + tst.ind1) < Memory.readUnsignedByte(img + tst.ind2)) );
  93.                  tst = tst.next;
  94.                  Memory.writeInt(index, idx_ptr);
  95.                idx_ptr = __cint(idx_ptr + 4);
  96.                 }
  97.          __asm(Jump("break"));
  98.        
  99.          __asm("11:");
  100.                 while(tst != null) {
  101.                  index = 0;
  102.                  __beginRepeat(10);
  103.                  {
  104.                     index = __cint( index + int(Memory.readUnsignedByte(img + tst.ind1) < Memory.readUnsignedByte(img + tst.ind2)) );
  105.                     index <<= 1;
  106.                     tst = tst.next;
  107.                  }
  108.                  __endRepeat();
  109.                  index = __cint( index + int(Memory.readUnsignedByte(img + tst.ind1) < Memory.readUnsignedByte(img + tst.ind2)) );
  110.                  tst = tst.next;
  111.                  Memory.writeInt(index, idx_ptr);
  112.                idx_ptr = __cint(idx_ptr + 4);
  113.                 }
  114.          __asm(Jump("break"));
  115.        
  116.          __asm("12:");
  117.                 while(tst != null) {
  118.                  index = 0;
  119.                  __beginRepeat(11);
  120.                  {
  121.                     index = __cint( index + int(Memory.readUnsignedByte(img + tst.ind1) < Memory.readUnsignedByte(img + tst.ind2)) );
  122.                     index <<= 1;
  123.                     tst = tst.next;
  124.                  }
  125.                  __endRepeat();
  126.                  index = __cint( index + int(Memory.readUnsignedByte(img + tst.ind1) < Memory.readUnsignedByte(img + tst.ind2)) );
  127.                  tst = tst.next;
  128.                  Memory.writeInt(index, idx_ptr);
  129.                idx_ptr = __cint(idx_ptr + 4);
  130.                 }
  131.        
  132.          __asm("break:");
  133.           __asm(Nop);
  134.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement