0x046adc0: mov %rcx,0x8(%rsp) 0x046adc5: mov %rsp,%rax 0x046adc8: sub $0xb8,%rsp 0x046adcf: mov 0x372702(%rip),%r9 # 0x7dd4d8 material token 0x046add6: mov %rbx,0x20(%rax) 0x046adda: mov %rbp,-0x8(%rax) 0x046adde: mov %rsi,-0x10(%rax) 0x046ade2: mov %rdi,-0x18(%rax) 0x046ade6: mov %r12,-0x20(%rax) 0x046adea: mov %r13,-0x28(%rax) 0x046adee: mov %r14,-0x30(%rax) 0x046adf2: mov %r15,-0x38(%rax) 0x046adf6: mov %rcx,%r15 store DYN pointer 0x046adf9: mov 0x38a449(%rip),%ecx # 0x7f5248 hash mask 0x046adff: mov %r9,%rax 0x046ae02: sar $0x8,%rax mat token, get bits 63-8 0x046ae06: lea -0x6ae0d(%rip),%r11 # 0x400000 0x046ae0d: and $0x3ffff,%eax mask to bits 25-8 0x046ae12: movswl 0x3f6260(%r11,%rax,2),%r10d lookup in imbalance table 0x046ae1b: movzbl %r9b,%eax bits 7-0 (for 1,3,5,10) 0x046ae1f: add $0xffffffffffffff80,%eax 0x046ae22: imul $0xd47,%eax,%eax multiply by 3399 -> raw 0x046ae28: add %eax,%r10d raw + imbalance adj 0x046ae2b: and 0x372696(%rip),%rcx # 0x7dd4c8 hash AND with mask 0x046ae32: mov 0x38a407(%rip),%rax # 0x7f5240 hash pointer 0x046ae39: mov %r10d,0x30(%rsp) 0x046ae3e: prefetchnta (%rax,%rcx,8) prefetch hash 0x046ae42: mov $0x1ff800000000,%rax check if K+P ending via whether 0x046ae4c: test %r9,%rax hi bits of mat token are zero 0x046ae4f: jne 0x46b169 if not, jump ---------------------------------------------------------------- 0x046ae55: callq 0x471030 call pawneval 0x046ae5a: mov 0x37261f(%rip),%rbp # 0x7dd480 load WK 0x046ae61: mov 0x372620(%rip),%r12 # 0x7dd488 load BK 0x046ae68: mov 0x18(%rax),%ecx load pawninfo->score 0x046ae6b: movzbl 0x1c(%rax),%r11d load white passers 0x046ae70: mov 0x3725c1(%rip),%rbx # 0x7dd438 black pawns 0x046ae77: add 0x372643(%rip),%ecx # 0x7dd4c0 add score 0x046ae7d: mov 0x3725ac(%rip),%rsi # 0x7dd430 white pawns 0x046ae84: xor %edi,%edi 0x046ae86: movzwl %cx,%r9d 0x046ae8a: bsf %r12,%rcx 0x046ae8e: bsf %rbp,%rdx 0x046ae92: sub $0x8000,%r9d 0x046ae99: test %r11d,%r11d 0x046ae9c: movslq %ecx,%r13 0x046ae9f: mov %rax,0x40(%rsp) 0x046aea4: mov %edi,0x28(%rsp) 0x046aea8: mov %edi,%r10d 0x046aeab: mov %edi,0x20(%rsp) 0x046aeaf: movslq %edx,%r14 0x046aeb2: je 0x46afba 0x046aeb8: mov 0x372561(%rip),%r15 # 0x7dd420 0x046aebf: mov 0xc0(%rsp),%r10 0x046aed0: lea -0x6aed7(%rip),%rcx # 0x400000 0x046aed7: movzbl 0x34a3a0(%r11,%rcx,1),%eax 0x046aee0: mov 0x335c30(%rcx,%rax,8),%rax 0x046aee8: and %rsi,%rax 0x046aeeb: bsr %rax,%rdx 0x046aeef: mov %edx,%r8d 0x046aef2: test %rbx,0x335830(%rcx,%rdx,8) 0x046aefa: je 0x46af06 0x046aefc: test %rbx,0x335a30(%rcx,%rdx,8) 0x046af04: jne 0x46af0d 0x046af06: add $0x8c0,%r9d 0x046af0d: test %rbp,0x354700(%rcx,%rdx,8) 0x046af15: jne 0x46af3a 0x046af17: test %r15,0x18ca80(%rcx,%rdx,8) 0x046af1f: jne 0x46af48 0x046af21: movslq 0x28(%r10),%rax 0x046af25: lea (%rax,%rdx,2),%rcx 0x046af29: lea -0x6af30(%rip),%rax # 0x400000 0x046af30: test %r12,0x353f00(%rax,%rcx,8) 0x046af38: je 0x46af48 0x046af3a: mov %edx,%eax 0x046af3c: shr $0x3,%eax 0x046af3f: sub 0x28(%r10),%eax 0x046af43: cmp %eax,%edi 0x046af45: cmovbe %eax,%edi 0x046af48: lea 0x8(%rdx),%ecx 0x046af4b: shr $0x3,%r8 0x046af4f: lea -0x6af56(%rip),%rdx # 0x400000 0x046af56: shl $0x6,%rcx 0x046af5a: lea 0x0(%r13,%rcx,1),%rax 0x046af5f: movzbl 0x352f00(%rax,%rdx,1),%edx 0x046af67: lea -0x6af6e(%rip),%rax # 0x400000 0x046af6e: imul 0x34a580(%rax,%r8,4),%edx 0x046af77: lea (%r14,%rcx,1),%rax 0x046af7b: lea -0x6af82(%rip),%rcx # 0x400000 0x046af82: movzbl 0x352f00(%rax,%rcx,1),%ecx 0x046af8a: lea -0x6af91(%rip),%rax # 0x400000 0x046af91: imul 0x34a560(%rax,%r8,4),%ecx 0x046af9a: lea -0x1(%r11),%eax 0x046af9e: sub %ecx,%edx 0x046afa0: add %edx,%r9d 0x046afa3: and %eax,%r11d 0x046afa6: jne 0x46aed0 0x046afac: mov 0x20(%rsp),%r10d 0x046afb1: mov 0x40(%rsp),%rax 0x046afb6: mov %edi,0x28(%rsp) 0x046afba: movzbl 0x1d(%rax),%r11d load black passers 0x046afbf: test %r11d,%r11d 0x046afc2: je 0x46b0c6 0x046afc8: mov 0x372459(%rip),%r15 # 0x7dd428 0x046afcf: mov 0xc0(%rsp),%rdi 0x046afe0: lea -0x6afe7(%rip),%r8 # 0x400000 0x046afe7: movzbl 0x34a3a0(%r11,%r8,1),%eax 0x046aff0: mov 0x335c30(%r8,%rax,8),%rax 0x046aff8: and %rbx,%rax 0x046affb: bsf %rax,%rdx 0x046afff: test %rsi,0x335830(%r8,%rdx,8) 0x046b007: je 0x46b013 0x046b009: test %rsi,0x335a30(%r8,%rdx,8) 0x046b011: jne 0x46b01a 0x046b013: sub $0x8c0,%r9d 0x046b01a: test %r12,0x354900(%r8,%rdx,8) 0x046b022: jne 0x46b040 0x046b024: test %r15,0x18cc80(%r8,%rdx,8) 0x046b02c: jne 0x46b054 0x046b02e: movslq 0x28(%rdi),%rax 0x046b032: lea (%rax,%rdx,2),%rcx 0x046b036: test %rbp,0x354300(%r8,%rcx,8) 0x046b03e: je 0x46b054 0x046b040: mov 0x28(%rdi),%eax 0x046b043: mov %edx,%ecx 0x046b045: shr $0x3,%ecx 0x046b048: sub %ecx,%eax 0x046b04a: add $0x6,%eax 0x046b04d: cmp %eax,%r10d 0x046b050: cmovbe %eax,%r10d 0x046b054: mov %edx,%ecx 0x046b056: mov $0x7,%r8d 0x046b05c: shr $0x3,%ecx 0x046b05f: sub %ecx,%r8d 0x046b062: lea -0x8(%rdx),%ecx 0x046b065: lea -0x6b06c(%rip),%rdx # 0x400000 0x046b06c: shl $0x6,%rcx 0x046b070: lea (%r14,%rcx,1),%rax 0x046b074: movzbl 0x352f00(%rax,%rdx,1),%edx 0x046b07c: lea -0x6b083(%rip),%rax # 0x400000 0x046b083: imul 0x34a580(%rax,%r8,4),%edx 0x046b08c: lea 0x0(%r13,%rcx,1),%rax 0x046b091: lea -0x6b098(%rip),%rcx # 0x400000 0x046b098: movzbl 0x352f00(%rax,%rcx,1),%ecx 0x046b0a0: lea -0x6b0a7(%rip),%rax # 0x400000 0x046b0a7: imul 0x34a560(%rax,%r8,4),%ecx 0x046b0b0: lea -0x1(%r11),%eax 0x046b0b4: sub %edx,%ecx 0x046b0b6: add %ecx,%r9d 0x046b0b9: and %eax,%r11d 0x046b0bc: jne 0x46afe0 0x046b0c2: mov 0x28(%rsp),%edi 0x046b0c6: mov 0x30(%rsp),%ecx 0x046b0ca: sub %r10d,%edi 0x046b0cd: mov $0xffff7f7f7f7f7f7f,%r8 0x046b0d7: imul $0x2bc0,%edi,%edi 0x046b0dd: add %r9d,%edi 0x046b0e0: lea -0x6b0e7(%rip),%r9 # 0x400000 0x046b0e7: add %ecx,%edi 0x046b0e9: mov %rsi,%rcx 0x046b0ec: and %r8,%rcx 0x046b0ef: lea (%rdi,%rdi,2),%eax 0x046b0f2: mov $0xfefefefefefefe,%r8 0x046b0fc: shl $0x2,%rcx 0x046b100: cltd 0x046b101: and %r8,%rsi 0x046b104: or %rsi,%rcx 0x046b107: sub %edx,%eax 0x046b109: mov 0xc0(%rsp),%rdx 0x046b111: shl $0x7,%rcx 0x046b115: sar %eax 0x046b117: mov $0x3fbfbfbfbfbfbf80,%r8 0x046b121: sar $0x5,%eax 0x046b124: mov %eax,0x20(%rdx) 0x046b127: bsf %rbp,%rax 0x046b12b: or 0x18c480(%r9,%rax,8),%rcx 0x046b133: bsf %r12,%rax 0x046b137: mov %rcx,(%rdx) 0x046b13a: mov %rbx,%rcx 0x046b13d: shr $0x2,%rcx 0x046b141: and %r8,%rcx 0x046b144: mov $0x7f7f7f7f7f7f7f00,%r8 0x046b14e: and %r8,%rbx 0x046b151: or %rbx,%rcx 0x046b154: shr $0x7,%rcx 0x046b158: or 0x18c480(%r9,%rax,8),%rcx 0x046b160: mov %rcx,0x8(%rdx) 0x046b164: jmpq 0x46bf6c end of K+P ending ---------------------------------------------------------------- 0x046b169: mov -0x1c(%r15),%ecx : get "poseval" from last DYN (0x46adf6) 0x046b16d: mov %r10d,%eax reload material eval (0x46ae28) 0x046b170: sar $0x5,%eax transfer from 3399 to centipawns 0x046b173: mov %eax,0x20(%rsp) 0x046b177: add %ecx,%eax 0x046b179: cmp %edx,%eax compare to input lazy bound (edx) 0x046b17b: jl 0x46bf5c if so, return 0x046b181: cmp %r8d,%eax compare to input lazy bound (r8d) 0x046b184: jg 0x46bf5c if so, return 0x046b18a: mov 0x37229f(%rip),%rdx # 0x7dd430 white pawns 0x046b191: mov 0x3722f0(%rip),%r14 # 0x7dd488 black king 0x046b198: mov 0x3722f1(%rip),%rcx # 0x7dd490 occupied 0x046b19f: mov 0x37231b(%rip),%ebx # 0x7dd4c0 0x046b1a5: mov 0x372274(%rip),%r12 # 0x7dd420 white occupied 0x046b1ac: bsf %r14,%rax get BK square 0x046b1b0: mov 0x18c480(%r11,%rax,8),%r13 king attacks array 0x046b1b8: mov %rax,0x68(%rsp) 0x046b1bd: mov %rax,0x40(%rsp) 0x046b1c2: mov %rdx,%rbp 0x046b1c5: mov %rdx,%rax 0x046b1c8: xor %edi,%edi 0x046b1ca: mov $0xffff7f7f7f7f7f7f,%r8 determine if a white 0x046b1d4: mov %edi,%esi pawn attacks a square 0x046b1d6: mov %r13,0x58(%rsp) around the black king 0x046b1db: and %r8,%rbp 0x046b1de: mov $0xfefefefefefefe,%r8 0x046b1e8: not %r12 0x046b1eb: and %r8,%rax 0x046b1ee: shl $0x2,%rbp 0x046b1f2: or %rax,%rbp 0x046b1f5: mov $0x10000,%eax (1,0) for pawn attack K 0x046b1fa: shl $0x7,%rbp %rbp will hold squares White attacks 0x046b1fe: test %rbp,%r13 test BK attacks array 0x046b201: cmovne %eax,%esi if whitepawns attack 0x046b204: shr $0x8,%rcx 0x046b208: and %rdx,%rcx 0x046b20b: mov $0x5555555555555555,%rdx POPCNT... 0x046b215: mov %rcx,%rax 0x046b218: shr %rax 0x046b21b: and %rdx,%rax 0x046b21e: mov $0x3333333333333333,%rdx counting how many pawns... 0x046b228: sub %rax,%rcx 0x046b22b: mov %rcx,%rax 0x046b22e: and %rdx,%rcx 0x046b231: shr $0x2,%rax 0x046b235: and %rdx,%rax 0x046b238: mov 0x372201(%rip),%rdx # 0x7dd440 load white knights 0x046b23f: add %rcx,%rax 0x046b242: mov $0x1111111111111111,%rcx ...have no mobility 0x046b24c: imul %rcx,%rax 0x046b250: shr $0x3c,%rax 0x046b254: imul $0xffd5fead,%eax,%eax (-42, -339) for each 0x046b25a: add %eax,%ebx pawn anti-mobility 0x046b25c: test %rdx,%rdx 0x046b25f: je 0x46b284 if no white knights, skip next ---------------------------------------------------------------- 0x046b261: bsf %rdx,%rax WN loop 0x046b265: mov 0x18c280(%r11,%rax,8),%rax white N attacks array 0x046b26d: or %rax,%rbp %rbp will hold squares White attacks 0x046b270: test %rax,%r13 test if att black K sq 0x046b273: je 0x46b27b 0x046b275: add $0x103ad,%esi if so add (1,941) 0x046b27b: lea -0x1(%rdx),%rax remove this knight 0x046b27f: and %rax,%rdx ... the bit array 0x046b282: jne 0x46b261 ... and loop ---------------------------------------------------------------- 0x046b284: mov 0x3721c5(%rip),%r9 # 0x7dd450 load white bishops 0x046b28b: mov 0x37220e(%rip),%r11 # 0x7dd4a0 rotated bitboard, 45 deg 0x046b292: test %r9,%r9 if no WB, skip 0x046b295: je 0x46b38b 0x046b29b: lea -0x6b2a2(%rip),%r14 # 0x400000 0x046b2a2: mov $0x5555555555555555,%rdi get ready for POPCNT... 0x046b2ac: mov $0x3333333333333333,%r15 0x046b2c0: mov 0x3721e1(%rip),%rdx # 0x7dd4a8 rotated bitboard, -45 deg 0x046b2c7: bsf %r9,%rax WB loop start 0x046b2cb: movzbl 0x16bf80(%r14,%rax,4),%ecx these are the imple- 0x046b2d4: mov %eax,%r8d 0x046b2d7: mov %eax,%r10d 0x046b2da: shr %cl,%rdx 0x046b2dd: movzbl 0x16be80(%r14,%rax,4),%ecx -mentation of rotated 0x046b2e6: shl $0x6,%r8 0x046b2ea: and $0x3f,%edx 0x046b2ed: mov %r11,%rax 0x046b2f0: shr %cl,%rax 0x046b2f3: add %r8,%rdx 0x046b2f6: mov 0x174280(%r14,%rdx,8),%rcx bitboards to determine 0x046b2fe: and $0x3f,%eax 0x046b301: add %r8,%rax 0x046b304: or 0x16c280(%r14,%rax,8),%rcx the squares attacked 0x046b30c: or %rcx,%rbp %rbp will hold squares White attacks 0x046b30f: test %rcx,%r13 if attacks black K sq 0x046b312: je 0x46b31a 0x046b314: add $0x101a2,%esi then add (1,418) 0x046b31a: and %r12,%rcx [AND attacked squares with NOT(WhOcc) 0x46b1e8] 0x046b31d: mov %rcx,%rax 0x046b320: shr %rax 0x046b323: and %rdi,%rax 0x046b326: sub %rax,%rcx 0x046b329: mov %rcx,%rax 0x046b32c: and %r15,%rcx 0x046b32f: shr $0x2,%rax 0x046b333: and %r15,%rax 0x046b336: add %rcx,%rax 0x046b339: mov $0x1111111111111111,%rcx 0x046b343: imul %rcx,%rax 0x046b347: shr $0x3c,%rax POPCNT the mobility 0x046b34b: imul $0x790079,%eax,%eax (121,121) for each 0x046b351: add %eax,%ebx 0x046b353: movzbl 0x3353f0(%r10,%r14,1),%eax look at traps 0x046b35c: cmpl $0x3,0x3dd320(%r14,%rax,4) 3 is black pawn 0x046b365: jne 0x46b36d if trapped 0x046b367: add $0xfa40fa41,%ebx subtract (1471,1471) 0x046b36d: lea -0x1(%r9),%rax 0x046b371: and %rax,%r9 0x046b374: jne 0x46b2c0 end of loop ---------------------------------------------------------------- 0x046b37a: mov 0xc0(%rsp),%r15 0x046b382: mov 0x3720ff(%rip),%r14 # 0x7dd488 black king bitboard 0x046b389: xor %edi,%edi 0x046b38b: mov 0x3720ce(%rip),%r10 # 0x7dd460 white rook bitboard 0x046b392: mov 0x3720ff(%rip),%rax # 0x7dd498 rotate by 90 occupied 0x046b399: mov 0x372098(%rip),%r13 # 0x7dd438 black pawns 0x046b3a0: test %r10,%r10 0x046b3a3: je 0x46b4d4 0x046b3a9: mov 0x58(%rsp),%r15 re-copy squares the BK att (0x46b1d6) 0x046b3ae: lea -0x6b3b5(%rip),%rdi # 0x400000 0x046b3c0: mov %rax,%rdx 0x046b3c3: mov 0x3720c6(%rip),%rax # 0x7dd490 occupied bitboard 0x046b3ca: bsf %r10,%r9 begin white rook loop 0x046b3ce: movzbl 0x16c180(%rdi,%r9,4),%ecx Again these 4 calls... 0x046b3d7: mov %r9d,%r8d 0x046b3da: shr %cl,%rdx 0x046b3dd: movzbl 0x16c080(%rdi,%r9,4),%ecx are to compute the... 0x046b3e6: shl $0x6,%r8 0x046b3ea: shr %cl,%rax 0x046b3ed: and $0x3f,%edx 0x046b3f0: add %r8,%rdx 0x046b3f3: and $0x3f,%eax 0x046b3f6: mov 0x184280(%rdi,%rdx,8),%rcx squares that a rook... 0x046b3fe: add %r8,%rax 0x046b401: or 0x17c280(%rdi,%rax,8),%rcx attacks currently 0x046b409: or %rcx,%rbp %rbp will hold squares White attacks 0x046b40c: test %rcx,%r15 if attacks near BK 0x046b40f: je 0x46b417 0x046b411: add $0x1029a,%esi add (1,666) 0x046b417: and %r12,%rcx [AND attacked squares with NOT(WhOcc) 0x46b1e8] 0x046b41a: mov $0x3333333333333333,%r8 0x046b424: mov $0x5555555555555555,%rdx and do POPCNT of mob 0x046b42e: mov %rcx,%rax 0x046b431: shr %rax 0x046b434: and %rdx,%rax 0x046b437: sub %rax,%rcx 0x046b43a: mov %rcx,%rax 0x046b43d: and %r8,%rcx 0x046b440: shr $0x2,%rax 0x046b444: and %r8,%rax 0x046b447: add %rcx,%rax 0x046b44a: mov $0x1111111111111111,%rcx 0x046b454: imul %rcx,%rax 0x046b458: shr $0x3c,%rax rook mobility: 0x046b45c: imul $0x440052,%eax,%eax (68, 82) for each 0x046b462: add %eax,%ebx 0x046b464: mov 0x18ca80(%rdi,%r9,8),%rax open file mask 0x046b46c: test %rax,0x371fbd(%rip) # 0x7dd430 test against white pawns 0x046b473: jne 0x46b491 0x046b475: add $0x68010c,%ebx bonus (104, 268) 0x046b47b: test %r13,%rax test BP/r13 (0x046b399) 0x046b47e: jne 0x46b486 0x046b480: add $0x27300b4,%ebx bonus (627, 180) 0x046b486: test %r14,%rax r14 is BK 0x046b489: je 0x46b491 if open file to BK 0x046b48b: add $0x31b0000,%ebx bonus (795, 0) 0x046b491: and $0x38,%r9d (r9 is sq of WR) 0x046b495: cmp $0x30,%r9b check if 7th rank 0x046b499: jne 0x46b4b6 0x046b49b: mov %r13,%rax copy BP (0x46b382) 0x046b49e: mov $0xffff000000000000,%rcx [7th/8th rank mask] 0x046b4a8: or %r14,%rax OR with BK (0x046b399) 0x046b4ab: test %rax,%rcx 0x046b4ae: je 0x46b4b6 if BP/BK on 7th/8th 0x046b4b0: add $0xc80430,%ebx bonus (200, 1072) 0x046b4b6: lea -0x1(%r10),%rax 0x046b4ba: and %rax,%r10 0x046b4bd: mov 0x371fd4(%rip),%rax # 0x7dd498 0x046b4c4: jne 0x46b3c0 end WR loop ---------------------------------------------------------------- 0x046b4ca: mov 0xc0(%rsp),%r15 0x046b4d2: xor %edi,%edi 0x046b4d4: mov 0x371f95(%rip),%r11 # 0x7dd470 load white queens 0x046b4db: test %r11,%r11 0x046b4de: je 0x46b64b 0x046b4e4: mov 0x58(%rsp),%rdi 0x046b4e9: mov %r12,%r15 transfer NOT(white occ) to r15 (0x46b1e8) 0x046b4ec: lea -0x6b4f3(%rip),%rdx # 0x400000 0x046b4f3: bsf %r11,%r12 begin loop 0x046b4f7: lea -0x6b4fe(%rip),%r10 # 0x400000 0x046b4fe: lea 0x0(,%r12,4),%r8 0x046b506: mov %r12d,%r9d 0x046b509: movzbl 0x16c180(%r8,%rdx,1),%ecx 0x046b512: mov %rax,%rdx 0x046b515: mov 0x371f8c(%rip),%rax # 0x7dd4a8 rotated bitboard 0x046b51c: shr %cl,%rdx 0x046b51f: movzbl 0x16bf80(%r8,%r10,1),%ecx Again these are all... 0x046b528: shl $0x6,%r9 0x046b52c: shr %cl,%rax 0x046b52f: and $0x3f,%edx 0x046b532: and $0x3f,%eax 0x046b535: add %r9,%rdx 0x046b538: mov 0x184280(%r10,%rdx,8),%r10 to compute the queen mob 0x046b540: add %r9,%rax 0x046b543: lea -0x6b54a(%rip),%rdx # 0x400000 0x046b54a: or 0x174280(%rdx,%rax,8),%r10 0x046b552: movzbl 0x16c080(%r8,%rdx,1),%ecx 0x046b55b: mov 0x371f2e(%rip),%rax # 0x7dd490 0x046b562: shr %cl,%rax 0x046b565: movzbl 0x16be80(%r8,%rdx,1),%ecx 0x046b56e: and $0x3f,%eax 0x046b571: add %r9,%rax 0x046b574: or 0x17c280(%rdx,%rax,8),%r10 0x046b57c: mov 0x371f1d(%rip),%rax # 0x7dd4a0 0x046b583: shr %cl,%rax 0x046b586: and $0x3f,%eax 0x046b589: add %r9,%rax 0x046b58c: or 0x16c280(%rdx,%rax,8),%r10 ...and here it is 0x046b594: or %r10,%rbp store ATTACKS in %rbp 0x046b597: test %r10,%rdi see if WQ attacks BK sq 0x046b59a: je 0x46b5a2 0x046b59c: add $0x10214,%esi if so, bonus (1, 532) 0x046b5a2: and %r15,%r10 [and with NOT(WhOcc)] 0x046b5a5: mov $0x5555555555555555,%rcx POPCNT the mobility 0x046b5af: and $0x38,%r12d [AND for 7th rank] 0x046b5b3: mov %r10,%rax 0x046b5b6: shr %rax 0x046b5b9: and %rcx,%rax 0x046b5bc: mov $0x3333333333333333,%rcx 0x046b5c6: sub %rax,%r10 0x046b5c9: mov %r10,%rax 0x046b5cc: and %rcx,%r10 0x046b5cf: shr $0x2,%rax 0x046b5d3: and %rcx,%rax 0x046b5d6: add %r10,%rax 0x046b5d9: mov %rax,%rcx 0x046b5dc: shr $0x4,%rcx 0x046b5e0: add %rax,%rcx 0x046b5e3: mov $0xf0f0f0f0f0f0f0f,%rax 0x046b5ed: and %rax,%rcx 0x046b5f0: mov $0x101010101010101,%rax [hmm: used a different SWAR] 0x046b5fa: imul %rax,%rcx 0x046b5fe: shr $0x38,%rcx 0x046b602: imul $0x2c0026,%ecx,%ecx bonus of (44, 38) for each 0x046b608: add %ecx,%ebx 0x046b60a: cmp $0x30,%r12b check if 7th rank 0x046b60e: jne 0x46b62b 0x046b610: mov %r13,%rax 0x046b613: mov $0xffff000000000000,%rcx check if BK/BP on 8th.8th 0x046b61d: or %r14,%rax 0x046b620: test %rax,%rcx 0x046b623: je 0x46b62b 0x046b625: add $0x5ce,%ebx if so, bonus (0, 1486) 0x046b62b: lea -0x1(%r11),%rax 0x046b62f: and %rax,%r11 0x046b632: mov 0x371e5f(%rip),%rax # 0x7dd498 [prepare rot bitboard] 0x046b639: jne 0x46b4f3 end WQ loop 0x046b63f: mov 0xc0(%rsp),%r15 0x046b647: xor %edi,%edi 0x046b649: jmp 0x46b652 [I hate compilers....] 0x046b64b: lea -0x6b652(%rip),%rdx # 0x400000 ---------------------------------------------------------------- 0x046b652: bsf 0x371e26(%rip),%rax # 0x7dd480 white king 0x046b65a: mov %rax,0x70(%rsp) 0x046b65f: mov %rax,0x48(%rsp) 0x046b664: mov 0x18c480(%rdx,%rax,8),%r13 get sq white king attacks 0x046b66c: or %r13,%rbp OR with %rbp as per the usual 0x046b66f: mov %rbp,0x28(%rsp) 0x046b674: callq 0x471030 call pawn eval 0x046b679: add 0x18(%rax),%ebx add pawninfo->score 0x046b67c: mov %rax,%r9 0x046b67f: mov %rax,0x38(%rsp) [save pawninfo ptr] 0x046b684: mov $0x180000000000,%rax mask for king safety 0x046b68e: test %rax,0x371e43(%rip) # 0x7dd4d8 test against mat token 0x046b695: je 0x46b6d8 if not, skip this 0x046b697: mov 0x40(%rsp),%rax 0x046b69c: lea -0x6b6a3(%rip),%r10 # 0x400000 0x046b6a3: movzwl %si,%ecx 0x046b6a6: movzbl 0x34a360(%rax,%r10,1),%eax 0x046b6af: movslq %esi,%rdx 0x046b6b2: sar $0x10,%rdx 0x046b6b6: mov 0x34a7b0(%r10,%rdx,4),%r8d 0x046b6be: imul %ecx,%r8d 0x046b6c2: movswl 0x10(%r9,%rax,2),%ecx 0x046b6c8: sar $0x5,%r8d 0x046b6cc: add %ecx,%r8d 0x046b6cf: shl $0x10,%r8d 0x046b6d3: add %r8d,%ebx add king shelter/storm 0x046b6d6: jmp 0x46b6df [I hate compilers....] 0x046b6d8: lea -0x6b6df(%rip),%r10 # 0x400000 ---------------------------------------------------------------- 0x046b6df: mov 0x371d52(%rip),%rdx # 0x7dd438 black pawns 0x046b6e6: mov 0x371da3(%rip),%rcx # 0x7dd490 occupied black/white 0x046b6ed: mov 0x371d34(%rip),%rsi # 0x7dd428 black occupied 0x046b6f4: mov %rdx,%r11 0x046b6f7: mov %rdx,%rax 0x046b6fa: mov $0x3fbfbfbfbfbfbf80,%r8 imitate above with reversed colours 0x046b704: shr $0x2,%r11 0x046b708: mov $0x5555555555555555,%r14 0x046b712: not %rsi 0x046b715: and %r8,%r11 0x046b718: mov $0x7f7f7f7f7f7f7f00,%r8 0x046b722: mov %rsi,0x60(%rsp) 0x046b727: and %r8,%rax 0x046b72a: or %rax,%r11 0x046b72d: mov $0x10000,%eax if BP attack WK sq, (1, 0) 0x046b732: shr $0x7,%r11 0x046b736: test %r11,%r13 0x046b739: cmovne %eax,%edi 0x046b73c: shl $0x8,%rcx 0x046b740: and %rdx,%rcx 0x046b743: mov $0x3333333333333333,%rdx 0x046b74d: mov %rcx,%rax 0x046b750: shr %rax 0x046b753: and %r14,%rax 0x046b756: sub %rax,%rcx 0x046b759: mov %rcx,%rax 0x046b75c: and %rdx,%rcx 0x046b75f: shr $0x2,%rax 0x046b763: and %rdx,%rax 0x046b766: mov 0x371cdb(%rip),%rdx # 0x7dd448 [preload black knights] 0x046b76d: add %rcx,%rax 0x046b770: mov $0x1111111111111111,%rcx POPCNT anti-mobility 0x046b77a: imul %rcx,%rax 0x046b77e: shr $0x3c,%rax 0x046b782: imul $0x2a0153,%eax,%eax (42, 339) for each 0x046b788: add %eax,%ebx 0x046b78a: test %rdx,%rdx 0x046b78d: je 0x46b7b3 0x046b78f: nop ---------------------------------------------------------------- 0x046b790: bsf %rdx,%rax BN loop 0x046b794: mov 0x18c280(%r10,%rax,8),%rax 0x046b79c: or %rax,%r11 0x046b79f: test %rax,%r13 0x046b7a2: je 0x46b7aa 0x046b7a4: add $0x103ad,%edi bonus for attacking WK sq 0x046b7aa: lea -0x1(%rdx),%rax 0x046b7ae: and %rax,%rdx 0x046b7b1: jne 0x46b790 ---------------------------------------------------------------- 0x046b7b3: mov 0x371c9e(%rip),%r9 # 0x7dd458 black bishops 0x046b7ba: mov 0x371cdf(%rip),%r12 # 0x7dd4a0 rotated bitboard 0x046b7c1: test %r9,%r9 0x046b7c4: je 0x46b8a7 0x046b7ca: lea -0x6b7d1(%rip),%r15 # 0x400000 0x046b7d1: mov $0x3333333333333333,%rbp 0x046b7db: xchg %ax,%ax 0x046b7dd: xchg %ax,%ax 0x046b7e0: mov 0x371cc1(%rip),%rdx # 0x7dd4a8 another 0x046b7e7: bsf %r9,%rax 0x046b7eb: movzbl 0x16bf80(%r15,%rax,4),%ecx 0x046b7f4: mov %eax,%r8d 0x046b7f7: mov %eax,%r10d 0x046b7fa: shr %cl,%rdx 0x046b7fd: movzbl 0x16be80(%r15,%rax,4),%ecx 0x046b806: shl $0x6,%r8 0x046b80a: and $0x3f,%edx 0x046b80d: mov %r12,%rax 0x046b810: shr %cl,%rax 0x046b813: add %r8,%rdx 0x046b816: mov 0x174280(%r15,%rdx,8),%rcx 0x046b81e: and $0x3f,%eax 0x046b821: add %r8,%rax 0x046b824: or 0x16c280(%r15,%rax,8),%rcx 0x046b82c: or %rcx,%r11 0x046b82f: test %rcx,%r13 0x046b832: je 0x46b83a 0x046b834: add $0x101a2,%edi 0x046b83a: and %rsi,%rcx 0x046b83d: mov %rcx,%rax 0x046b840: shr %rax 0x046b843: and %r14,%rax 0x046b846: sub %rax,%rcx 0x046b849: mov %rcx,%rax 0x046b84c: and %rbp,%rcx 0x046b84f: shr $0x2,%rax 0x046b853: and %rbp,%rax 0x046b856: add %rcx,%rax 0x046b859: mov $0x1111111111111111,%rcx 0x046b863: imul %rcx,%rax 0x046b867: shr $0x3c,%rax 0x046b86b: imul $0xff86ff87,%eax,%eax Black bishop mobility 0x046b871: add %eax,%ebx 0x046b873: movzbl 0x3353f0(%r10,%r15,1),%eax 0x046b87c: cmpl $0x2,0x3dd320(%r15,%rax,4) trapped (white pawn = 2) 0x046b885: jne 0x46b88d 0x046b887: add $0x5bf05bf,%ebx 0x046b88d: lea -0x1(%r9),%rax 0x046b891: and %rax,%r9 0x046b894: jne 0x46b7e0 ---------------------------------------------------------------- 0x046b89a: mov 0x28(%rsp),%rbp 0x046b89f: mov 0xc0(%rsp),%r15 0x046b8a7: mov 0x371bba(%rip),%r10 # 0x7dd468 black rooks 0x046b8ae: mov 0x371be3(%rip),%rax # 0x7dd498 rotated bitboard 0x046b8b5: mov 0x371bc4(%rip),%r14 # 0x7dd480 white king 0x046b8bc: test %r10,%r10 0x046b8bf: mov 0x371b6a(%rip),%r12 # 0x7dd430 white pawns 0x046b8c6: je 0x46ba03 0x046b8cc: mov 0x371b65(%rip),%rbp # 0x7dd438 black pawns 0x046b8d3: mov %rsi,%r15 0x046b8d6: lea -0x6b8dd(%rip),%rdx # 0x400000 0x046b8dd: xchg %ax,%ax 0x046b8e0: bsf %r10,%r9 start BR loop 0x046b8e4: mov %r9d,%r8d 0x046b8e7: movzbl 0x16c180(%rdx,%r9,4),%ecx 0x046b8f0: mov %rax,%rdx 0x046b8f3: shl $0x6,%r8 0x046b8f7: shr %cl,%rdx 0x046b8fa: lea -0x6b901(%rip),%rax # 0x400000 0x046b901: movzbl 0x16c080(%rax,%r9,4),%ecx 0x046b90a: mov 0x371b7f(%rip),%rax # 0x7dd490 0x046b911: and $0x3f,%edx 0x046b914: shr %cl,%rax 0x046b917: add %r8,%rdx 0x046b91a: lea -0x6b921(%rip),%rcx # 0x400000 0x046b921: mov 0x184280(%rcx,%rdx,8),%rcx 0x046b929: and $0x3f,%eax 0x046b92c: lea -0x6b933(%rip),%rdx # 0x400000 0x046b933: add %r8,%rax 0x046b936: or 0x17c280(%rdx,%rax,8),%rcx 0x046b93e: or %rcx,%r11 0x046b941: test %rcx,%r13 0x046b944: je 0x46b94c 0x046b946: add $0x1029a,%edi attacks WK sq bonus 0x046b94c: and %r15,%rcx 0x046b94f: mov $0x5555555555555555,%r8 0x046b959: mov %rcx,%rax 0x046b95c: shr %rax 0x046b95f: and %r8,%rax 0x046b962: mov $0x3333333333333333,%r8 0x046b96c: sub %rax,%rcx 0x046b96f: mov %rcx,%rax 0x046b972: and %r8,%rcx 0x046b975: shr $0x2,%rax 0x046b979: and %r8,%rax 0x046b97c: add %rcx,%rax 0x046b97f: mov $0x1111111111111111,%rcx 0x046b989: imul %rcx,%rax 0x046b98d: shr $0x3c,%rax 0x046b991: imul $0xffbbffae,%eax,%eax mobility bonus 0x046b997: add %eax,%ebx 0x046b999: mov 0x18cc80(%rdx,%r9,8),%rax 0x046b9a1: test %rax,%rbp 0x046b9a4: jne 0x46b9c2 0x046b9a6: add $0xff97fef4,%ebx bonus 0x046b9ac: test %rax,%r12 0x046b9af: jne 0x46b9b7 0x046b9b1: add $0xfd8cff4c,%ebx bonus 0x046b9b7: test %rax,%r14 0x046b9ba: je 0x46b9c2 0x046b9bc: add $0xfce50000,%ebx bonus 0x046b9c2: and $0x38,%r9b 0x046b9c6: cmp $0x8,%r9b 7th rank 0x046b9ca: jne 0x46b9e0 0x046b9cc: mov %r12,%rax 0x046b9cf: or %r14,%rax 0x046b9d2: movzwl %ax,%eax 0x046b9d5: test %rax,%rax 0x046b9d8: je 0x46b9e0 0x046b9da: add $0xff37fbd0,%ebx bonus 0x046b9e0: lea -0x1(%r10),%rax 0x046b9e4: and %rax,%r10 0x046b9e7: mov 0x371aaa(%rip),%rax # 0x7dd498 0x046b9ee: jne 0x46b8e0 ---------------------------------------------------------------- 0x046b9f4: mov 0x28(%rsp),%rbp 0x046b9f9: mov 0xc0(%rsp),%r15 0x046ba01: jmp 0x46ba0a [I hate compilers....] 0x046ba03: lea -0x6ba0a(%rip),%rdx # 0x400000 0x046ba0a: mov 0x371a67(%rip),%rsi # 0x7dd478 black queen 0x046ba11: test %rsi,%rsi 0x046ba14: je 0x46bb74 0x046ba1a: mov 0x60(%rsp),%rbp 0x046ba1f: mov %r13,%r15 0x046ba22: bsf %rsi,%r13 0x046ba26: lea -0x6ba2d(%rip),%r10 # 0x400000 0x046ba2d: lea 0x0(,%r13,4),%r8 0x046ba35: mov %r13d,%r9d 0x046ba38: movzbl 0x16c180(%r8,%rdx,1),%ecx 0x046ba41: mov %rax,%rdx 0x046ba44: mov 0x371a5d(%rip),%rax # 0x7dd4a8 0x046ba4b: shr %cl,%rdx 0x046ba4e: movzbl 0x16bf80(%r8,%r10,1),%ecx 0x046ba57: shl $0x6,%r9 0x046ba5b: shr %cl,%rax 0x046ba5e: and $0x3f,%edx 0x046ba61: and $0x3f,%eax 0x046ba64: add %r9,%rdx 0x046ba67: mov 0x184280(%r10,%rdx,8),%r10 0x046ba6f: add %r9,%rax 0x046ba72: lea -0x6ba79(%rip),%rdx # 0x400000 0x046ba79: or 0x174280(%rdx,%rax,8),%r10 0x046ba81: movzbl 0x16c080(%r8,%rdx,1),%ecx 0x046ba8a: mov 0x3719ff(%rip),%rax # 0x7dd490 0x046ba91: shr %cl,%rax 0x046ba94: movzbl 0x16be80(%r8,%rdx,1),%ecx 0x046ba9d: and $0x3f,%eax 0x046baa0: add %r9,%rax 0x046baa3: or 0x17c280(%rdx,%rax,8),%r10 0x046baab: mov 0x3719ee(%rip),%rax # 0x7dd4a0 0x046bab2: shr %cl,%rax 0x046bab5: and $0x3f,%eax 0x046bab8: add %r9,%rax 0x046babb: or 0x16c280(%rdx,%rax,8),%r10 0x046bac3: or %r10,%r11 0x046bac6: test %r10,%r15 0x046bac9: je 0x46bad1 0x046bacb: add $0x10214,%edi bonus for att WK sq 0x046bad1: and %rbp,%r10 0x046bad4: mov $0x5555555555555555,%rcx 0x046bade: and $0xfffffffffffffff8,%r13d 0x046bae2: mov %r10,%rax 0x046bae5: shr %rax 0x046bae8: and %rcx,%rax 0x046baeb: mov $0x3333333333333333,%rcx 0x046baf5: sub %rax,%r10 0x046baf8: mov %r10,%rax 0x046bafb: and %rcx,%r10 0x046bafe: shr $0x2,%rax 0x046bb02: and %rcx,%rax 0x046bb05: add %r10,%rax 0x046bb08: mov %rax,%rcx 0x046bb0b: shr $0x4,%rcx 0x046bb0f: add %rax,%rcx 0x046bb12: mov $0xf0f0f0f0f0f0f0f,%rax 0x046bb1c: and %rax,%rcx 0x046bb1f: mov $0x101010101010101,%rax 0x046bb29: imul %rax,%rcx 0x046bb2d: shr $0x38,%rcx 0x046bb31: imul $0xffd3ffda,%ecx,%ecx mobility bonus 0x046bb37: add %ecx,%ebx 0x046bb39: cmp $0x8,%r13d 0x046bb3d: jne 0x46bb53 0x046bb3f: mov %r12,%rax 0x046bb42: or %r14,%rax 0x046bb45: movzwl %ax,%eax 0x046bb48: test %rax,%rax 0x046bb4b: je 0x46bb53 0x046bb4d: add $0xfffffa32,%ebx 0x046bb53: lea -0x1(%rsi),%rax 0x046bb57: and %rax,%rsi 0x046bb5a: mov 0x371937(%rip),%rax # 0x7dd498 0x046bb61: jne 0x46ba22 ---------------------------------------------------------------- 0x046bb67: mov 0x28(%rsp),%rbp 0x046bb6c: mov 0xc0(%rsp),%r15 0x046bb74: or 0x58(%rsp),%r11 0x046bb79: mov 0x371958(%rip),%r14 # 0x7dd4d8 0x046bb80: mov $0xc000000000,%rax see if BK safety 0x046bb8a: test %r14,%rax is applicable 0x046bb8d: mov %r11,0x50(%rsp) 0x046bb92: je 0x46bbd6 0x046bb94: mov 0x38(%rsp),%r8 0x046bb99: movzwl %di,%eax 0x046bb9c: movslq %edi,%rcx 0x046bb9f: sar $0x10,%rcx 0x046bba3: mov 0x34a7b0(%rdx,%rcx,4),%edx 0x046bbaa: lea -0x6bbb1(%rip),%rcx # 0x400000 0x046bbb1: imul %eax,%edx 0x046bbb4: mov 0x48(%rsp),%rax 0x046bbb9: sar $0x5,%edx 0x046bbbc: movzbl 0x34a360(%rax,%rcx,1),%eax 0x046bbc4: movswl 0x8(%r8,%rax,2),%ecx 0x046bbca: add %ecx,%edx 0x046bbcc: imul $0xffff0000,%edx,%edx 0x046bbd2: add %edx,%ebx 0x046bbd4: jmp 0x46bbdb [I hate compilers] ---------------------------------------------------------------- 0x046bbd6: mov 0x38(%rsp),%r8 load pawninfo pointer 0x046bbdb: movzbl 0x1c(%r8),%r9d load white passer files 0x046bbe0: movslq 0x68(%rsp),%rsi 0x046bbe5: movslq 0x70(%rsp),%r13 0x046bbea: test %r9d,%r9d if none, skip this 0x046bbed: mov 0x37182c(%rip),%rdi # 0x7dd420 white occupied 0x046bbf4: je 0x46bcca 0x046bbfa: mov %rbp,%r10 0x046bbfd: mov 0x371824(%rip),%rbp # 0x7dd428 black occupied 0x046bc04: lea -0x6bc0b(%rip),%r15 # 0x400000 0x046bc0b: not %r10 0x046bc0e: xchg %ax,%ax 0x046bc10: movzbl 0x34a3a0(%r9,%r15,1),%eax get file arrays for passer file 0x046bc19: mov 0x335c30(%r15,%rax,8),%rax 0x046bc21: and %r12,%rax AND with a rotated 90 bitboard 0x046bc24: bsr %rax,%rdx loop over the passed pawns 0x046bc28: mov %edx,%r8d 0x046bc2b: mov 0x18ca80(%r15,%rdx,8),%rcx 0x046bc33: test %rcx,%rdi 0x046bc36: jne 0x46bc47 0x046bc38: mov %r8,%rax 0x046bc3b: shr $0x3,%rax 0x046bc3f: add 0x34a500(%r15,%rax,4),%ebx bonus if not self-blocked 0x046bc47: test %rcx,%rbp 0x046bc4a: jne 0x46bc5b 0x046bc4c: mov %r8,%rax 0x046bc4f: shr $0x3,%rax 0x046bc53: add 0x34a520(%r15,%rax,4),%ebx bonus if not opposing blocked 0x046bc5b: mov %r10,%rax 0x046bc5e: and %rcx,%rax 0x046bc61: test %rax,%r11 0x046bc64: jne 0x46bc75 0x046bc66: mov %r8,%rax 0x046bc69: shr $0x3,%rax 0x046bc6d: add 0x34a540(%r15,%rax,4),%ebx bonus if nothing attacks path 0x046bc75: lea 0x8(%rdx),%ecx 0x046bc78: shr $0x3,%r8 0x046bc7c: shl $0x6,%rcx 0x046bc80: lea (%rcx,%rsi,1),%rax 0x046bc84: movzbl 0x352f00(%rax,%r15,1),%edx 0x046bc8d: lea (%rcx,%r13,1),%rax 0x046bc91: movzbl 0x352f00(%rax,%r15,1),%ecx 0x046bc9a: lea -0x1(%r9),%eax 0x046bc9e: imul 0x34a580(%r15,%r8,4),%edx distance from white king 0x046bca7: imul 0x34a560(%r15,%r8,4),%ecx distance from black king 0x046bcb0: sub %ecx,%edx 0x046bcb2: add %edx,%ebx add into score 0x046bcb4: and %eax,%r9d 0x046bcb7: jne 0x46bc10 END WHITE PASSER LOOP ---------------------------------------------------------------- 0x046bcbd: mov 0x28(%rsp),%rbp 0x046bcc2: mov 0xc0(%rsp),%r15 0x046bcca: mov 0x38(%rsp),%r12 0x046bccf: movzbl 0x1d(%r12),%r9d get black passers files 0x046bcd5: test %r9d,%r9d 0x046bcd8: je 0x46bdd5 0x046bcde: mov 0x371743(%rip),%r15 # 0x7dd428 0x046bce5: mov 0x37174c(%rip),%r12 # 0x7dd438 0x046bcec: mov %r11,%r10 0x046bcef: not %r10 0x046bcf2: lea -0x6bcf9(%rip),%r11 # 0x400000 0x046bd00: movzbl 0x34a3a0(%r9,%r11,1),%eax 0x046bd09: mov 0x335c30(%r11,%rax,8),%rax 0x046bd11: and %r12,%rax 0x046bd14: bsf %rax,%rdx 0x046bd18: mov 0x18cc80(%r11,%rdx,8),%r8 0x046bd20: test %r8,%r15 0x046bd23: jne 0x46bd39 0x046bd25: mov $0x7,%eax 0x046bd2a: mov %edx,%ecx 0x046bd2c: shr $0x3,%ecx 0x046bd2f: sub %ecx,%eax 0x046bd31: sub 0x34a500(%r11,%rax,4),%ebx 0x046bd39: test %r8,%rdi 0x046bd3c: jne 0x46bd52 0x046bd3e: mov $0x7,%eax 0x046bd43: mov %edx,%ecx 0x046bd45: shr $0x3,%ecx 0x046bd48: sub %ecx,%eax 0x046bd4a: sub 0x34a520(%r11,%rax,4),%ebx 0x046bd52: mov %r10,%rax 0x046bd55: and %r8,%rax 0x046bd58: test %rax,%rbp 0x046bd5b: jne 0x46bd71 0x046bd5d: mov $0x7,%eax 0x046bd62: mov %edx,%ecx 0x046bd64: shr $0x3,%ecx 0x046bd67: sub %ecx,%eax 0x046bd69: sub 0x34a540(%r11,%rax,4),%ebx 0x046bd71: mov %edx,%ecx 0x046bd73: mov $0x7,%r8d 0x046bd79: shr $0x3,%ecx 0x046bd7c: sub %ecx,%r8d 0x046bd7f: lea -0x8(%rdx),%ecx 0x046bd82: shl $0x6,%rcx 0x046bd86: lea (%rcx,%rsi,1),%rax 0x046bd8a: movzbl 0x352f00(%rax,%r11,1),%edx 0x046bd93: lea (%rcx,%r13,1),%rax 0x046bd97: movzbl 0x352f00(%rax,%r11,1),%ecx 0x046bda0: lea -0x1(%r9),%eax 0x046bda4: imul 0x34a560(%r11,%r8,4),%edx 0x046bdad: imul 0x34a580(%r11,%r8,4),%ecx 0x046bdb6: sub %ecx,%edx 0x046bdb8: add %edx,%ebx 0x046bdba: and %eax,%r9d 0x046bdbd: jne 0x46bd00 END BLACK PASSER LOOP ---------------------------------------------------------------- 0x046bdc3: mov 0x50(%rsp),%r11 0x046bdc8: mov 0xc0(%rsp),%r15 0x046bdd0: mov 0x38(%rsp),%r12 0x046bdd5: mov 0x48(%rsp),%rax 0x046bdda: lea -0x6bde1(%rip),%rdi # 0x400000 0x046bde1: mov 0x3351f0(%rdi,%rax,8),%rax 0x046bde9: test %rax,0x371670(%rip) # 0x7dd460 white rooks 0x046bdf0: je 0x46bdf8 0x046bdf2: add $0xf9e10000,%ebx bonus if rook is blocked 0x046bdf8: mov 0x40(%rsp),%rcx 0x046bdfd: mov 0x371664(%rip),%rax # 0x7dd468 black rooks 0x046be04: test %rax,0x3351f0(%rdi,%rcx,8) 0x046be0c: je 0x46be14 0x046be0e: add $0x61f0000,%ebx bonus if rook is blocked (1561,0) 0x046be14: mov 0x30(%rsp),%ecx 0x046be18: mov %ebx,%eax 0x046be1a: shr $0x10,%eax 0x046be1d: lea -0x8000(%rax,%rcx,1),%r9d 0x046be25: movzwl %bx,%eax 0x046be28: lea -0x8000(%rax,%rcx,1),%r8d undo the (16+16) format of scores 0x046be30: mov %r14,%rax [material token] (0x46bb79) 0x046be33: shr $0x1a,%rax 0x046be37: movzbl %al,%ecx 0x046be3a: mov $0x55555556,%eax 0x046be3f: imul %ecx 0x046be41: mov $0x3f000000000000,%rcx 0x046be4b: mov %edx,%eax 0x046be4d: shr $0x1f,%eax 0x046be50: add %eax,%edx interpolate op|eg to get score 0x046be52: mov $0x40,%eax 0x046be57: cmp %eax,%edx 0x046be59: cmovg %eax,%edx 0x046be5c: movslq %edx,%rax 0x046be5f: mov 0x34a5a4(%rdi,%rax,8),%r10d [nonlinear] 0x046be67: mov 0x34a5a0(%rdi,%rax,8),%eax 0x046be6e: imul %r9d,%eax 0x046be72: imul %r8d,%r10d 0x046be76: add %eax,%r10d 0x046be79: mov %r14,%rax 0x046be7c: sar $0xd,%r10d 0x046be80: and %rcx,%rax 0x046be83: mov $0x30000000000000,%rcx check if opposite B endgame 0x046be8d: cmp %rcx,%rax 0x046be90: jne 0x46bed7 0x046be92: shr $0x2d,%r14 0x046be96: and $0x7,%r14b 0x046be9a: cmp $0x4,%r14b 0x046be9e: jg 0x46bed7 0x046bea0: mov 0x3715b1(%rip),%rax # 0x7dd458 black bishops 0x046bea7: mov $0x55aa55aa55aa55aa,%rcx 0x046beb1: or 0x371598(%rip),%rax # 0x7dd450 white bishops 0x046beb8: test %rax,%rcx 0x046bebb: je 0x46bed7 0x046bebd: mov $0xaa55aa55aa55aa55,%rcx 0x046bec7: test %rax,%rcx 0x046beca: je 0x46bed7 0x046becc: mov %r10d,%eax 0x046becf: cltd 0x046bed0: sub %edx,%eax 0x046bed2: sar %eax # half the score if so 0x046bed4: mov %eax,%r10d ---------------------------------------------------------------- 0x046bed7: test %r10d,%r10d split based on who is winning 0x046beda: jle 0x46bf12 0x046bedc: movzbl 0x1e(%r12),%ecx # white drawishness from pawninfo 0x046bee2: mov $0x88888889,%eax 0x046bee7: imul $0x9c,%ecx,%ecx check if close enough to use... 0x046beed: imul %ecx 0x046beef: add %ecx,%edx 0x046bef1: sar $0x7,%edx 0x046bef4: mov %edx,%eax 0x046bef6: shr $0x1f,%eax 0x046bef9: add %eax,%edx 0x046befb: mov $0x64,%eax 0x046bf00: cmp %eax,%r10d 0x046bf03: cmovl %r10d,%eax 0x046bf07: imul %eax,%edx 0x046bf0a: sar $0x8,%edx 0x046bf0d: sub %edx,%r10d 0x046bf10: jmp 0x46bf46 0x046bf12: movzbl 0x1f(%r12),%ecx # black drawishness from pawninfo 0x046bf18: mov $0x88888889,%eax 0x046bf1d: imul $0x9c,%ecx,%ecx 0x046bf23: imul %ecx 0x046bf25: add %ecx,%edx 0x046bf27: sar $0x7,%edx 0x046bf2a: mov %edx,%eax 0x046bf2c: shr $0x1f,%eax 0x046bf2f: add %eax,%edx 0x046bf31: mov $0xffffff9c,%eax 0x046bf36: cmp %eax,%r10d 0x046bf39: cmovg %r10d,%eax 0x046bf3d: imul %eax,%edx 0x046bf40: sar $0x8,%edx 0x046bf43: sub %edx,%r10d ---------------------------------------------------------------- 0x046bf46: mov %r10d,0x20(%r15) # store score 0x046bf4a: sub 0x20(%rsp),%r10d 0x046bf4f: mov %rbp,(%r15) 0x046bf52: mov %r10d,0x24(%r15) # and positional eval 0x046bf56: mov %r11,0x8(%r15) 0x046bf5a: jmp 0x46bf6c 0x046bf5c: mov %ecx,0x24(%r15) 0x046bf60: mov %r15,%rcx 0x046bf63: mov %eax,0x20(%r15) 0x046bf67: callq 0x52f510 # Mobility, used when lazy 0x046bf6c: mov 0x80(%rsp),%r15 0x046bf74: mov 0x88(%rsp),%r14 0x046bf7c: mov 0x90(%rsp),%r13 0x046bf84: mov 0x98(%rsp),%r12 0x046bf8c: mov 0xa0(%rsp),%rdi 0x046bf94: mov 0xa8(%rsp),%rsi 0x046bf9c: mov 0xb0(%rsp),%rbp 0x046bfa4: mov 0xd8(%rsp),%rbx 0x046bfac: add $0xb8,%rsp 0x046bfb3: retq