name
stringlengths
1
473k
code
stringlengths
7
647k
asm
stringlengths
4
3.39M
file
stringlengths
8
196
PF_FileHandle::GetPrevPage(int, PF_PageHandle&) const
RC PF_FileHandle::GetPrevPage(PageNum current, PF_PageHandle &pageHandle) const { int rc; // return code // File must be open if (!bFileOpen) return (PF_CLOSEDFILE); // Validate page number (note that hdr.numPages is acceptable here) if (current != hdr.numPages && !IsValidPageNum(current)) return (PF_INVALIDPAGE); // Scan the file until a valid used page is found for (current--; current >= 0; current--) { // If this is a valid (used) page, we're done if (!(rc = GetThisPage(current, pageHandle))) return (0); // If unexpected error, return it if (rc != PF_INVALIDPAGE) return (rc); } // No valid (used) page found return (PF_EOF); }
cmpl $0x0, 0x10(%rdi) je 0x602a pushq %rbp pushq %r14 pushq %rbx movq %rdx, %rbx movl %esi, %ebp movq %rdi, %r14 movl 0xc(%rdi), %eax cmpl %esi, %eax je 0x6010 testl %ebp, %ebp sets %cl cmpl %ebp, %eax setle %al orb %cl, %al movl $0x3, %eax jne 0x6035 testl %ebp, %ebp jle 0x6030 decl %ebp movq %r14, %rdi movl %ebp, %esi movq %rbx, %rdx callq 0x6054 cmpl $0x3, %eax je 0x6010 jmp 0x6035 movl $0x5, %eax retq movl $0x8, %eax popq %rbx popq %r14 popq %rbp retq
/lyang1024[P]redbase/src/pf_filehandle.cc
PF_FileHandle::FlushPages() const
RC PF_FileHandle::FlushPages() const { // File must be open if (!bFileOpen) return (PF_CLOSEDFILE); // If the file header has changed, write it back to the file if (bHdrChanged) { // First seek to the appropriate place if (lseek(unixfd, 0, L_SET) < 0) return (PF_UNIX); // Write header int numBytes = write(unixfd, (char *)&hdr, sizeof(PF_FileHdr)); if (numBytes < 0) return (PF_UNIX); if (numBytes != sizeof(PF_FileHdr)) return (PF_HDRWRITE); // This function is declared const, but we need to change the // bHdrChanged variable. Cast away the constness PF_FileHandle *dummy = (PF_FileHandle *)this; dummy->bHdrChanged = FALSE; } // Tell Buffer Manager to flush pages return (pBufferMgr->FlushPages(unixfd)); }
pushq %rbx cmpl $0x0, 0x10(%rdi) je 0x62bb movq %rdi, %rbx cmpl $0x0, 0x14(%rdi) je 0x62db movl 0x18(%rbx), %edi xorl %esi, %esi xorl %edx, %edx callq 0x4540 testq %rax, %rax js 0x62c2 movl 0x18(%rbx), %edi leaq 0x8(%rbx), %rsi movl $0x8, %edx callq 0x4120 testl %eax, %eax js 0x62c9 andl $0x7fffffff, %eax # imm = 0x7FFFFFFF cmpl $0x8, %eax jne 0x62d0 movl $0x0, 0x14(%rbx) movb $0x1, %cl jmp 0x62d7 movl $0x5, %eax jmp 0x62e7 movl $0xfffffff5, %eax # imm = 0xFFFFFFF5 jmp 0x62e7 movl $0xfffffff5, %eax # imm = 0xFFFFFFF5 jmp 0x62d5 movl $0xfffffffa, %eax # imm = 0xFFFFFFFA xorl %ecx, %ecx testb %cl, %cl je 0x62e7 movq (%rbx), %rdi movl 0x18(%rbx), %esi popq %rbx jmp 0x578a popq %rbx retq nop
/lyang1024[P]redbase/src/pf_filehandle.cc
PF_HashTable::PF_HashTable(int)
PF_HashTable::PF_HashTable(int _numBuckets) { // Initialize numBuckets local variable from parameter this->numBuckets = _numBuckets; // Allocate memory for hash table hashTable = new PF_HashEntry* [numBuckets]; // Initialize all buckets to empty for (int i = 0; i < numBuckets; i++) hashTable[i] = NULL; }
pushq %rbp pushq %r14 pushq %rbx movl %esi, %ebp movq %rdi, %rbx movl %esi, (%rdi) movslq %esi, %r14 leaq (,%r14,8), %rax testl %r14d, %r14d movq $-0x1, %rdi cmovnsq %rax, %rdi callq 0x4030 movq %rax, 0x8(%rbx) testl %r14d, %r14d jle 0x63c6 movl %ebp, %eax xorl %ecx, %ecx movq 0x8(%rbx), %rdx movq $0x0, (%rdx,%rcx,8) incq %rcx cmpq %rcx, %rax jne 0x63b2 popq %rbx popq %r14 popq %rbp retq nop
/lyang1024[P]redbase/src/pf_hashtable.cc
StatisticsMgr::Reset(char const*)
RC StatisticsMgr::Reset(const char *psKey) { int i, iCount; Statistic *pStat = NULL; if (psKey==NULL) return STAT_INVALID_ARGS; iCount = llStats.GetLength(); for (i=0; i < iCount; i++) { pStat = llStats[i]; if (*pStat == psKey) break; } // If we found the statistic then remove it from the list if (i!=iCount) llStats.Delete(i); else return STAT_UNKNOWN_KEY; return 0; }
testq %rsi, %rsi je 0x6bcc pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movq %rdi, %rbx movl (%rdi), %ebp testl %ebp, %ebp jle 0x6bd2 movq %rsi, %r15 leaq 0x8(%rbx), %r12 movl 0x20(%rbx), %ecx xorl %r14d, %r14d leal 0x1(%r14), %r13d cmpl $-0x1, %ecx je 0x6b64 movl %r13d, %eax subl %ecx, %eax movl %eax, %edx negl %edx cmovsl %eax, %edx movl $0x1, %eax movq %r12, %rsi cmpl %edx, %r13d jb 0x6b83 movl %ebp, %eax subl %r13d, %eax xorl %esi, %esi cmpl %eax, %edx setl %sil cmovgel %ebp, %ecx leaq (%rbx,%rsi,8), %rsi addq $0x10, %rsi movl %ecx, %eax jmp 0x6b83 movl %ebp, %eax subl %r13d, %eax xorl %ecx, %ecx cmpl %eax, %r13d setge %cl movl %ebp, %eax movl $0x1, %edx cmovll %edx, %eax leaq (%rbx,%rcx,8), %rsi addq $0x8, %rsi movq (%rsi), %rcx cmpl %r13d, %eax je 0x6ba1 xorl %edx, %edx cmpl %r14d, %eax setg %dl movq 0x10(%rcx,%rdx,8), %rcx negl %edx orl $0x1, %edx addl %edx, %eax jmp 0x6b86 movl %r13d, 0x20(%rbx) movq %rcx, 0x18(%rbx) movq (%rcx), %rsi movq %r15, %rdi callq 0x43c0 testl %eax, %eax je 0x6bd5 incl %r14d movl %r13d, %ecx cmpl %ebp, %r14d jne 0x6b26 movl %ebp, %r14d jmp 0x6bd5 movl $0x2329, %eax # imm = 0x2329 retq xorl %r14d, %r14d movl $0x232a, %eax # imm = 0x232A cmpl %ebp, %r14d je 0x6bec movq %rbx, %rdi movl %r14d, %esi callq 0x6c5e xorl %eax, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq nop
/lyang1024[P]redbase/src/statistics.cc
LinkList<Statistic>::Delete(int)
inline void LinkList<T>::Delete(int which) { if (which>iLength || which == 0) return; InternalNode *pnDeleteMe = pnHead; for (int i=1; i<which; i++) pnDeleteMe = pnDeleteMe->next; if (pnDeleteMe == pnHead) { if (pnDeleteMe->next == NULL) { delete pnDeleteMe; SetNull(); } else { pnHead = pnDeleteMe->next; pnHead->previous = NULL; delete pnDeleteMe; pnLastRef = pnHead; } } else { if (pnDeleteMe == pnTail) { if (pnDeleteMe->previous == NULL) { delete pnDeleteMe; SetNull(); } else { pnTail = pnDeleteMe->previous; pnTail->next = NULL; delete pnDeleteMe; pnLastRef = pnTail; } } else { pnLastRef = pnDeleteMe->next; pnDeleteMe->previous->next = pnDeleteMe->next; pnDeleteMe->next->previous = pnDeleteMe->previous; delete pnDeleteMe; } } if (iLength!=0) --iLength; }
testl %esi, %esi je 0x6d85 pushq %r15 pushq %r14 pushq %rbx movq %rdi, %rbx cmpl %esi, (%rdi) jl 0x6d80 leaq 0x8(%rbx), %r15 movq 0x8(%rbx), %r14 cmpl $0x2, %esi jl 0x6c8d decl %esi movq 0x10(%r14), %r14 decl %esi jne 0x6c85 cmpq (%r15), %r14 je 0x6cd3 cmpq 0x10(%rbx), %r14 je 0x6d07 movq 0x10(%r14), %rax movq %rax, 0x18(%rbx) movq 0x18(%r14), %rcx movq %rax, 0x10(%rcx) movq 0x10(%r14), %rax movq %rcx, 0x18(%rax) testq %r14, %r14 je 0x6d76 movq (%r14), %rdi testq %rdi, %rdi je 0x6cc6 callq 0x4390 movq %r14, %rdi callq 0x42b0 jmp 0x6d76 movq 0x10(%r14), %rax testq %rax, %rax je 0x6d40 movq %rax, (%r15) movq $0x0, 0x18(%rax) testq %r14, %r14 je 0x6d01 movq (%r14), %rdi testq %rdi, %rdi je 0x6cf9 callq 0x4390 movq %r14, %rdi callq 0x42b0 movq 0x8(%rbx), %rax jmp 0x6d3a movq 0x18(%r14), %rax testq %rax, %rax je 0x6d40 movq %rax, 0x10(%rbx) movq $0x0, 0x10(%rax) testq %r14, %r14 je 0x6d36 movq (%r14), %rdi testq %rdi, %rdi je 0x6d2e callq 0x4390 movq %r14, %rdi callq 0x42b0 movq 0x10(%rbx), %rax movq %rax, 0x18(%rbx) jmp 0x6d76 testq %r14, %r14 je 0x6d5a movq (%r14), %rdi testq %rdi, %rdi je 0x6d52 callq 0x4390 movq %r14, %rdi callq 0x42b0 movl $0x0, (%rbx) xorps %xmm0, %xmm0 movups %xmm0, (%r15) movq $0x0, 0x10(%r15) movl $0xffffffff, 0x20(%rbx) # imm = 0xFFFFFFFF movl (%rbx), %eax testl %eax, %eax je 0x6d80 decl %eax movl %eax, (%rbx) popq %rbx popq %r14 popq %r15 retq nop
/lyang1024[P]redbase/include/linkedlist.h
RM_Manager::OpenFile(char const*, RM_FileHandle&)
RC RM_Manager::OpenFile (const char *fileName, RM_FileHandle &fileHandle){ if(fileName == NULL) return (RM_BADFILENAME); // if the filehandle is associated with another open file. exit immediately if(fileHandle.openedFH == true) return (RM_INVALIDFILEHANDLE); RC rc; // Open the file PF_FileHandle fh; if((rc = pfm.OpenFile(fileName, fh))) return (rc); // Gets the first page, and uses it to set up the header in fileHandle PF_PageHandle ph; PageNum page; if((rc = fh.GetFirstPage(ph)) || (ph.GetPageNum(page))){ fh.UnpinPage(page); pfm.CloseFile(fh); return (rc); } char *pData; ph.GetData(pData); struct RM_FileHeader * header = (struct RM_FileHeader *) pData; // set up and validate the header of this file rc = SetUpFH(fileHandle, fh, header); // Unpin the header page RC rc2; if((rc2 = fh.UnpinPage(page))) return (rc2); // If any errors occured, close the file! if(rc != 0){ pfm.CloseFile(fh); } return (rc); }
pushq %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x40, %rsp testq %rsi, %rsi je 0x7032 movq %rdx, %r14 movl $0x6b, %ebp cmpb $0x0, (%rdx) jne 0x7037 movq %rsi, %r15 movq %rdi, %rbx leaq 0x18(%rsp), %r12 movq %r12, %rdi callq 0x5f18 movq (%rbx), %rdi movq %r15, %rsi movq %r12, %rdx callq 0x4e60 movl %eax, %ebp testl %eax, %eax jne 0x7026 leaq 0x8(%rsp), %rdi callq 0x1c784 leaq 0x18(%rsp), %rdi leaq 0x8(%rsp), %rsi callq 0x5f76 movl %eax, %ebp testl %eax, %eax jne 0x7001 leaq 0x8(%rsp), %rdi leaq 0x4(%rsp), %rsi callq 0x1c7d0 testl %eax, %eax je 0x7046 movl 0x4(%rsp), %esi leaq 0x18(%rsp), %rdi callq 0x60d2 movq (%rbx), %rdi leaq 0x18(%rsp), %rsi callq 0x4ee0 leaq 0x8(%rsp), %rdi callq 0x1c794 leaq 0x18(%rsp), %rdi callq 0x5f28 jmp 0x7037 movl $0x6f, %ebp movl %ebp, %eax addq $0x40, %rsp popq %rbx popq %r12 popq %r14 popq %r15 popq %rbp retq leaq 0x8(%rsp), %rdi leaq 0x38(%rsp), %rsi callq 0x1c7ba movq 0x38(%rsp), %rcx leaq 0x18(%rsp), %rdx movq %r14, %rsi callq 0x6f42 movl %eax, %r14d movl 0x4(%rsp), %esi leaq 0x18(%rsp), %rdi callq 0x60d2 movl %eax, %ebp testl %eax, %eax jne 0x701c testl %r14d, %r14d je 0x7095 movq (%rbx), %rdi leaq 0x18(%rsp), %rsi callq 0x4ee0 movl %r14d, %ebp jmp 0x701c movl %r14d, %ebp jmp 0x701c jmp 0x70a7 jmp 0x70a7 jmp 0x70a7 jmp 0x70a2 movq %rax, %rbx jmp 0x70b4 movq %rax, %rbx leaq 0x8(%rsp), %rdi callq 0x1c794 leaq 0x18(%rsp), %rdi callq 0x5f28 movq %rbx, %rdi callq 0x4500
/lyang1024[P]redbase/src/rm_manager.cc
RM_Manager::CloseFile(RM_FileHandle&)
RC RM_Manager::CloseFile (RM_FileHandle &fileHandle) { RC rc; PF_PageHandle ph; PageNum page; char *pData; // If header was modified, put the first page into buffer again, // and update its contents, marking the page as dirty if(fileHandle.header_modified == true){ if((rc = fileHandle.pfh.GetFirstPage(ph)) || ph.GetPageNum(page)) return (rc); if((rc = ph.GetData(pData))){ RC rc2; if((rc2 = fileHandle.pfh.UnpinPage(page))) return (rc2); return (rc); } memcpy(pData, &fileHandle.header, sizeof(struct RM_FileHeader)); if((rc = fileHandle.pfh.MarkDirty(page)) || (rc = fileHandle.pfh.UnpinPage(page))) return (rc); } // Close the file if((rc = pfm.CloseFile(fileHandle.pfh))) return (rc); // Disassociate the fileHandle from an open file if((rc = CleanUpFH(fileHandle))) return (rc); return (0); }
pushq %rbp pushq %r15 pushq %r14 pushq %rbx subq $0x28, %rsp movq %rsi, %rbx movq %rdi, %r14 leaq 0x10(%rsp), %rdi callq 0x1c784 cmpb $0x1, 0x40(%rbx) jne 0x718e leaq 0x20(%rbx), %r15 leaq 0x10(%rsp), %rsi movq %r15, %rdi callq 0x5f76 movl %eax, %ebp testl %eax, %eax jne 0x71b1 leaq 0x10(%rsp), %rdi leaq 0xc(%rsp), %rsi callq 0x1c7d0 testl %eax, %eax jne 0x71b1 leaq 0x10(%rsp), %rdi leaq 0x20(%rsp), %rsi callq 0x1c7ba movl %eax, %ebp testl %eax, %eax je 0x7156 movl 0xc(%rsp), %esi movq %r15, %rdi callq 0x60d2 testl %eax, %eax cmovnel %eax, %ebp jmp 0x71b1 movq 0x20(%rsp), %rax movq 0x14(%rbx), %rcx movq %rcx, 0x10(%rax) movups 0x4(%rbx), %xmm0 movups %xmm0, (%rax) movl 0xc(%rsp), %esi movq %r15, %rdi callq 0x61b8 movl %eax, %ebp testl %eax, %eax jne 0x71b1 movl 0xc(%rsp), %esi movq %r15, %rdi callq 0x60d2 movl %eax, %ebp testl %eax, %eax jne 0x71b1 movq (%r14), %rdi leaq 0x20(%rbx), %rsi callq 0x4ee0 movl %eax, %ebp testl %eax, %eax jne 0x71b1 cmpb $0x0, (%rbx) je 0x71ac movb $0x0, (%rbx) xorl %ebp, %ebp jmp 0x71b1 movl $0x6b, %ebp leaq 0x10(%rsp), %rdi callq 0x1c794 movl %ebp, %eax addq $0x28, %rsp popq %rbx popq %r14 popq %r15 popq %rbp retq jmp 0x71ca movq %rax, %rbx leaq 0x10(%rsp), %rdi callq 0x1c794 movq %rbx, %rdi callq 0x4500 nop
/lyang1024[P]redbase/src/rm_manager.cc
RM_FileHandle::AllocateNewPage(PF_PageHandle&, int&)
RC RM_FileHandle::AllocateNewPage(PF_PageHandle &ph, PageNum &page){ RC rc; // allocate the page if((rc = pfh.AllocatePage(ph))){ return (rc); } // get the page number of this allocated page if((rc = ph.GetPageNum(page))) return (rc); // create the page header char *bitmap; struct RM_PageHeader *pageheader; if((rc = GetPageDataAndBitmap(ph, bitmap, pageheader))) return (rc); pageheader->nextFreePage = header.firstFreePage; pageheader->numRecords = 0; if((rc = ResetBitmap(bitmap, header.numRecordsPerPage))) return (rc); header.numPages++; // update the file header to reflect addition of one // more page // update the free pages linked list header.firstFreePage = page; return (0); }
pushq %r15 pushq %r14 pushq %rbx subq $0x10, %rsp movq %rdx, %rbx movq %rsi, %r15 movq %rdi, %r14 addq $0x20, %rdi callq 0x60fc testl %eax, %eax jne 0x72d3 movq %r15, %rdi movq %rbx, %rsi callq 0x1c7d0 testl %eax, %eax jne 0x72d3 leaq 0x8(%rsp), %rsi movq %r15, %rdi callq 0x1c7ba testl %eax, %eax jne 0x72d3 movq 0x8(%rsp), %rdi movslq 0x14(%r14), %rax movl 0x10(%r14), %ecx movl %ecx, (%rdi) movl $0x0, 0x4(%rdi) movl 0x8(%r14), %edx leal 0x7(%rdx), %esi testl %edx, %edx cmovnsl %edx, %esi movl %esi, %r8d sarl $0x3, %r8d andl $-0x8, %esi xorl %ecx, %ecx cmpl %edx, %esi setl %cl addl %r8d, %ecx jle 0x72c7 addq %rax, %rdi movl %ecx, %edx xorl %esi, %esi callq 0x41d0 incl 0xc(%r14) movl (%rbx), %eax movl %eax, 0x10(%r14) xorl %eax, %eax addq $0x10, %rsp popq %rbx popq %r14 popq %r15 retq nop
/lyang1024[P]redbase/src/rm_filehandle.cc
RM_FileHandle::GetFirstZeroBit(char*, int, int&)
RC RM_FileHandle::GetFirstZeroBit(char *bitmap, int size, int &location){ for(int i = 0; i < size; i++){ int chunk = i /8; int offset = i - chunk*8; if ((bitmap[chunk] & (1 << offset)) == 0){ location = i; return (0); } } return RM_PAGEFULL; }
movl $0x69, %eax testl %edx, %edx jle 0x7720 xorl %edi, %edi movl %edi, %r8d shrl $0x3, %r8d movzbl (%rsi,%r8), %r8d movl %edi, %r9d andl $0x7, %r9d btl %r9d, %r8d jae 0x7721 incl %edi cmpl %edi, %edx jne 0x7701 retq movl %edi, (%rcx) xorl %eax, %eax retq
/lyang1024[P]redbase/src/rm_filehandle.cc
RM_FileHandle::UpdateRec(RM_Record const&)
RC RM_FileHandle::UpdateRec (const RM_Record &rec) { // only proceed if this filehandle is associated with an open file if (!isValidFH()) return (RM_INVALIDFILE); RC rc = 0; // retrieves the page and slot number of the record RID rid; if((rc = rec.GetRid(rid))) return (rc); PageNum page; SlotNum slot; if((rc = GetPageNumAndSlot(rid, page, slot))) return (rc); // gets the page, bitmap and pageheader for this page that holds the record PF_PageHandle ph; if((rc = pfh.GetThisPage(page, ph))) return (rc); char *bitmap; struct RM_PageHeader *pageheader; if((rc = GetPageDataAndBitmap(ph, bitmap, pageheader))) goto cleanup_and_exit; // Check if there really exists a record here according to the header bool recordExists; if ((rc = CheckBitSet(bitmap, header.numRecordsPerPage, slot, recordExists))) goto cleanup_and_exit; if(!recordExists){ rc = RM_INVALIDRECORD; goto cleanup_and_exit; } // updates its contents char * recData; if((rc = rec.GetData(recData))) goto cleanup_and_exit; memcpy(bitmap + (header.bitmapSize) + slot*(header.recordSize), recData, header.recordSize); // always unpin the page before returning cleanup_and_exit: RC rc2; if((rc2 = pfh.MarkDirty(page)) || (rc2 = pfh.UnpinPage(page))) return (rc2); return (rc); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x38, %rsp movl $0x6a, %ebp cmpb $0x1, (%rdi) jne 0x7a3b movq %rsi, %r14 movq %rdi, %rbx leaq 0x10(%rsp), %r15 movq %r15, %rdi callq 0x7e80 movq %r14, %rdi movq %r15, %rsi callq 0x7dd4 movl %eax, %ebp testl %eax, %eax jne 0x7a31 leaq 0x10(%rsp), %rsi leaq 0x8(%rsp), %rdx leaq 0xc(%rsp), %rcx callq 0x735a movl %eax, %ebp testl %eax, %eax jne 0x7a31 leaq 0x18(%rsp), %rdi callq 0x1c784 leaq 0x20(%rbx), %r15 movl 0x8(%rsp), %esi leaq 0x18(%rsp), %rdx movq %r15, %rdi callq 0x6054 movl %eax, %ebp testl %eax, %eax jne 0x7a27 leaq 0x18(%rsp), %rdi leaq 0x30(%rsp), %rsi callq 0x1c7ba movl %eax, %r12d testl %eax, %eax jne 0x7a00 movslq 0x14(%rbx), %r13 addq 0x30(%rsp), %r13 movl 0xc(%rsp), %eax cmpl 0x8(%rbx), %eax jle 0x799d movb $0x1, %al movl $0x68, %r12d jmp 0x79c4 leal 0x7(%rax), %ecx testl %eax, %eax cmovnsl %eax, %ecx movl %ecx, %edx sarl $0x3, %edx andl $-0x8, %ecx subl %ecx, %eax movslq %edx, %rcx movsbl (%r13,%rcx), %ecx btl %eax, %ecx setae %al movl $0x67, %r12d testb %al, %al jne 0x7a00 leaq 0x28(%rsp), %rsi movq %r14, %rdi callq 0x7dba movl %eax, %r12d testl %eax, %eax jne 0x7a00 movslq 0x18(%rbx), %rax addq %rax, %r13 movslq 0xc(%rsp), %rdi movslq 0x4(%rbx), %rdx imulq %rdx, %rdi addq %r13, %rdi movq 0x28(%rsp), %rsi callq 0x4260 xorl %r12d, %r12d movl 0x8(%rsp), %esi movq %r15, %rdi callq 0x61b8 movl %eax, %ebp testl %eax, %eax jne 0x7a27 movl 0x8(%rsp), %esi movq %r15, %rdi callq 0x60d2 testl %eax, %eax cmovnel %eax, %r12d movl %r12d, %ebp leaq 0x18(%rsp), %rdi callq 0x1c794 leaq 0x10(%rsp), %rdi callq 0x7e8e movl %ebp, %eax addq $0x38, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0x7a50 jmp 0x7a50 movq %rax, %rbx leaq 0x18(%rsp), %rdi callq 0x1c794 jmp 0x7a66 jmp 0x7a63 jmp 0x7a63 movq %rax, %rbx leaq 0x10(%rsp), %rdi callq 0x7e8e movq %rbx, %rdi callq 0x4500
/lyang1024[P]redbase/src/rm_filehandle.cc
RM_FileHandle::GetNextOneBit(char*, int, int, int&)
RC RM_FileHandle::GetNextOneBit(char *bitmap, int size, int start, int &location){ for(int i = start; i < size; i++){ int chunk = i /8; int offset = i - chunk*8; if (((bitmap[chunk] & (1 << offset)) != 0)){ location = i; return (0); } } return RM_ENDOFPAGE; }
movl $0x6d, %eax cmpl %edx, %ecx jge 0x7ca8 leal 0x7(%rcx), %edi testl %ecx, %ecx cmovnsl %ecx, %edi movl %edi, %r9d sarl $0x3, %r9d andl $-0x8, %edi movl %ecx, %r10d subl %edi, %r10d movslq %r9d, %rdi movsbl (%rsi,%rdi), %edi btl %r10d, %edi jb 0x7ca9 incl %ecx cmpl %ecx, %edx jne 0x7c7d retq movl %ecx, (%r8) xorl %eax, %eax retq nop
/lyang1024[P]redbase/src/rm_filehandle.cc
SM_Manager::CreateTable(char const*, int, AttrInfo*)
RC SM_Manager::CreateTable(const char *relName, int attrCount, AttrInfo *attributes) { cout << "CreateTable\n" << " relName =" << relName << "\n" << " attrCount =" << attrCount << "\n"; for (int i = 0; i < attrCount; i++) cout << " attributes[" << i << "].attrName=" << attributes[i].attrName << " attrType=" << (attributes[i].attrType == INT ? "INT" : attributes[i].attrType == MBR ? "MBR" : attributes[i].attrType == FLOAT ? "FLOAT" : "STRING") << " attrLength=" << attributes[i].attrLength << "\n"; RC rc = 0; set<string> relAttributes; // Check for appropraite # of attributes if(attrCount > MAXATTRS || attrCount < 1){ printf("reaches here\n"); return (SM_BADREL); } if(strlen(relName) > MAXNAME) // Check for valid relName size return (SM_BADRELNAME); // Check the attribute specifications int totalRecSize = 0; for(int i = 0; i < attrCount; i++){ if(strlen(attributes[i].attrName) > MAXNAME) // check name size return (SM_BADATTR); if(! isValidAttrType(attributes[i])) // check type return (SM_BADATTR); totalRecSize += attributes[i].attrLength; string attrString(attributes[i].attrName); // check attribute dups bool exists = (relAttributes.find(attrString) != relAttributes.end()); if(exists) return (SM_BADREL); else relAttributes.insert(attrString); } // Passed error check. Now information in relcat and attrcat // Create a file for this relation. This will check for duplicate tables // of the same name. if((rc = rmm.CreateFile(relName, totalRecSize))) return (SM_BADRELNAME); // For each attribute, insert into attrcat: RID rid; int currOffset = 0; for(int i = 0; i < attrCount; i++){ AttrInfo attr = attributes[i]; if((rc = InsertAttrCat(relName, attr, currOffset, i))) return (rc); currOffset += attr.attrLength; } // Insert into RelCat if((rc = InsertRelCat(relName, attrCount, totalRecSize))) return (rc); // Make sure changes to attrcat and relcat are reflected if((rc = attrcatFH.ForcePages()) || (rc = relcatFH.ForcePages())) return (rc); return (0); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x98, %rsp movq %rcx, %r12 movl %edx, %r15d movq %rsi, %r14 movq %rdi, 0x20(%rsp) movq 0x209fe(%rip), %rbx # 0x28fc8 leaq 0x14baf(%rip), %rsi # 0x1d180 movl $0xc, %edx movq %rbx, %rdi callq 0x4330 leaq 0x14ba8(%rip), %rsi # 0x1d18d movl $0x10, %edx movq %rbx, %rdi callq 0x4330 testq %r14, %r14 movq %r14, 0x28(%rsp) movq %r12, 0x38(%rsp) je 0x861d movq %r14, %rdi callq 0x4160 movq 0x209b8(%rip), %rdi # 0x28fc8 movq %r14, %rsi movq %rax, %rdx callq 0x4330 jmp 0x8634 movq (%rbx), %rax movq -0x18(%rax), %rax leaq (%rbx,%rax), %rdi movl 0x20(%rbx,%rax), %esi orl $0x1, %esi callq 0x44c0 movq 0x2098d(%rip), %rbx # 0x28fc8 leaq 0x14a43(%rip), %r14 # 0x1d085 movl $0x1, %edx movq %rbx, %rdi movq %r14, %rsi callq 0x4330 leaq 0x14b45(%rip), %rsi # 0x1d19e movl $0x10, %edx movq %rbx, %rdi callq 0x4330 movq %rbx, %rdi movl %r15d, %esi callq 0x44d0 movl $0x1, %edx movq %rax, %rdi movq %r14, %rsi callq 0x4330 movq %r15, 0x30(%rsp) testl %r15d, %r15d jle 0x87b4 movl 0x30(%rsp), %r12d movq 0x38(%rsp), %rax leaq 0xc(%rax), %rbp xorl %ebx, %ebx movq 0x20922(%rip), %r13 # 0x28fc8 movl $0xe, %edx movq %r13, %rdi leaq 0x14afa(%rip), %rsi # 0x1d1af callq 0x4330 movq %r13, %rdi movl %ebx, %esi callq 0x44d0 movq %rax, %r15 movl $0xb, %edx movq %rax, %rdi leaq 0x14ae8(%rip), %rsi # 0x1d1be callq 0x4330 movq -0xc(%rbp), %r14 testq %r14, %r14 je 0x86fc movq %r14, %rdi callq 0x4160 movq %r15, %rdi movq %r14, %rsi movq %rax, %rdx callq 0x4330 jmp 0x8716 movq (%r15), %rax movq -0x18(%rax), %rax movq %r15, %rdi addq %rax, %rdi movl 0x20(%r15,%rax), %esi orl $0x1, %esi callq 0x44c0 movl $0xc, %edx movq %r15, %rdi leaq 0x14aa5(%rip), %rsi # 0x1d1ca callq 0x4330 movl -0x4(%rbp), %eax leaq 0x14aa3(%rip), %r14 # 0x1d1d7 testl %eax, %eax je 0x875b cmpl $0x3, %eax jne 0x8746 leaq 0x14a97(%rip), %r14 # 0x1d1db jmp 0x875b cmpl $0x1, %eax leaq 0x14a95(%rip), %r14 # 0x1d1e5 leaq 0x14a88(%rip), %rax # 0x1d1df cmoveq %rax, %r14 movq %r14, %rdi callq 0x4160 movq %r15, %rdi movq %r14, %rsi movq %rax, %rdx callq 0x4330 movl $0xe, %edx movq %r15, %rdi leaq 0x14a6c(%rip), %rsi # 0x1d1ec callq 0x4330 movl (%rbp), %esi movq %r15, %rdi callq 0x44d0 movl $0x1, %edx movq %rax, %rdi leaq 0x148e6(%rip), %rsi # 0x1d085 callq 0x4330 incq %rbx addq $0x10, %rbp cmpq %rbx, %r12 jne 0x86a6 leaq 0x70(%rsp), %rcx movl $0x0, (%rcx) xorl %eax, %eax movq %rax, 0x8(%rcx) movq %rcx, 0x10(%rcx) movq %rcx, 0x18(%rcx) movq %rax, 0x20(%rcx) movq 0x30(%rsp), %r14 leal -0x29(%r14), %eax cmpl $-0x28, %eax jae 0x87f5 leaq 0x14d22(%rip), %rdi # 0x1d508 callq 0x4440 movl $0x12f, %ebp # imm = 0x12F jmp 0x8a59 movq 0x28(%rsp), %rdi callq 0x4160 movl $0x12e, %ebp # imm = 0x12E cmpq $0x18, %rax ja 0x8a59 movl $0x12f, %ebp # imm = 0x12F testl %r14d, %r14d setg %r13b jle 0x8923 movl %r14d, %ecx movq 0x38(%rsp), %rax leaq 0xc(%rax), %r12 movq %rcx, 0x10(%rsp) negq %rcx movq %rcx, 0x60(%rsp) movl $0x0, 0xc(%rsp) movl $0x1, %r14d leaq 0x40(%rsp), %r15 leaq 0x68(%rsp), %rbp movq -0xc(%r12), %rbx movq %rbx, %rdi callq 0x4160 cmpq $0x18, %rax ja 0x892d movq -0x4(%r12), %rcx movq %rcx, %rax shrq $0x20, %rax cmpq $0x4, %rax sete %dl cmpl $0x2, %ecx setb %sil movabsq $0x400000003, %rdi # imm = 0x400000003 cmpq %rdi, %rcx je 0x88ac andb %dl, %sil jne 0x88ac cmpl $0x2, %ecx jne 0x892d decl %eax cmpl $0xfd, %eax ja 0x892d movl 0xc(%rsp), %eax addl (%r12), %eax movl %eax, 0xc(%rsp) movq %r15, %rdi movq %rbx, %rsi leaq 0x1f(%rsp), %rdx callq 0x4140 movq %rbp, %rdi movq %r15, %rsi callq 0xccd6 leaq 0x70(%rsp), %rcx cmpq %rcx, %rax jne 0x8934 movq %rbp, %rdi movq %r15, %rsi callq 0xcd60 movq 0x40(%rsp), %rdi leaq 0x50(%rsp), %rax cmpq %rax, %rdi je 0x88fc callq 0x42b0 cmpq 0x10(%rsp), %r14 setb %r13b addq $0x10, %r12 movq 0x60(%rsp), %rax addq %r14, %rax incq %rax incq %r14 cmpq $0x1, %rax jne 0x8851 jmp 0x8948 movl $0x0, 0xc(%rsp) jmp 0x894d movl $0x130, %ebp # imm = 0x130 jmp 0x894d movq 0x40(%rsp), %rdi leaq 0x50(%rsp), %rax cmpq %rax, %rdi je 0x8948 callq 0x42b0 movl $0x12f, %ebp # imm = 0x12F testb $0x1, %r13b jne 0x8a59 movl %ebp, 0x10(%rsp) movq 0x20(%rsp), %rax movq 0x8(%rax), %rdi movq 0x28(%rsp), %rsi movl 0xc(%rsp), %ebx movl %ebx, %edx callq 0x6d8e testl %eax, %eax movl $0x12e, %ebp # imm = 0x12E jne 0x8a59 leaq 0x40(%rsp), %rdi callq 0x7e80 movl %ebx, 0xc(%rsp) movq 0x30(%rsp), %rax testl %eax, %eax setg %bpl jle 0x89fb movl %eax, %r13d movq 0x38(%rsp), %rax addq $0x8, %rax xorl %ebx, %ebx xorl %r14d, %r14d movq -0x8(%rax), %rdx movq %rax, %r12 movq (%rax), %r15 movq 0x20(%rsp), %rdi movq 0x28(%rsp), %rsi movq %r15, %rcx movl %r14d, %r8d movl %ebx, %r9d callq 0x8abc testl %eax, %eax movl 0x10(%rsp), %ecx cmovnel %eax, %ecx movl %ecx, 0x10(%rsp) jne 0x89fb shrq $0x20, %r15 addl %r15d, %r14d incq %rbx cmpq %r13, %rbx setb %bpl movq %r12, %rax addq $0x10, %rax cmpq %rbx, %r13 jne 0x89ad testb $0x1, %bpl jne 0x8a4b movq 0x20(%rsp), %rdi movq 0x28(%rsp), %rsi movq 0x30(%rsp), %rdx movl 0xc(%rsp), %ecx callq 0x8bac testl %eax, %eax jne 0x8a47 movq 0x20(%rsp), %rax leaq 0x58(%rax), %rdi movl $0xffffffff, %esi # imm = 0xFFFFFFFF callq 0x7a78 testl %eax, %eax jne 0x8a47 movq 0x20(%rsp), %rdi addq $0x10, %rdi movl $0xffffffff, %esi # imm = 0xFFFFFFFF callq 0x7a78 movl %eax, 0x10(%rsp) leaq 0x40(%rsp), %rdi callq 0x7e8e movl 0x10(%rsp), %ebp leaq 0x68(%rsp), %rdi callq 0xc94c movl %ebp, %eax addq $0x98, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0x8a7d jmp 0x8aa7 jmp 0x8aa7 movq %rax, %rbx leaq 0x40(%rsp), %rdi callq 0x7e8e jmp 0x8aaa jmp 0x8a8e movq %rax, %rbx movq 0x40(%rsp), %rdi leaq 0x50(%rsp), %rax cmpq %rax, %rdi je 0x8aaa callq 0x42b0 jmp 0x8aaa movq %rax, %rbx leaq 0x68(%rsp), %rdi callq 0xc94c movq %rbx, %rdi callq 0x4500
/lyang1024[P]redbase/src/sm_manager.cc
SM_Manager::InsertRelCat(char const*, int, int)
RC SM_Manager::InsertRelCat(const char *relName, int attrCount, int recSize){ RC rc = 0; RelCatEntry* rEntry = (RelCatEntry *) malloc(sizeof(RelCatEntry)); memset((void*)rEntry, 0, sizeof(*rEntry)); *rEntry = (RelCatEntry) {"\0", 0, 0, 0, 0}; memcpy(rEntry->relName, relName, MAXNAME + 1); // name rEntry->tupleLength = recSize; // record size rEntry->attrCount = attrCount; // # of attributes rEntry->indexCount = 0; // starting # of incides rEntry->indexCurrNum = 0; // starting enumeration of indices // FOR EX component rEntry->numTuples = 0; rEntry->statsInitialized = false; // Insert into relcat RID relRID; rc = relcatFH.InsertRec((char *)rEntry, relRID); free(rEntry); return rc; }
pushq %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x10, %rsp movl %ecx, %ebp movl %edx, %r14d movq %rsi, %r15 movq %rdi, %r12 movl $0x34, %edi callq 0x43a0 movq %rax, %rbx xorps %xmm0, %xmm0 movups %xmm0, 0x1c(%rax) xorl %eax, %eax movq %rax, 0x2c(%rbx) movups (%r15), %xmm0 movups 0x9(%r15), %xmm1 movups %xmm0, (%rbx) movups %xmm1, 0x9(%rbx) movl %ebp, 0x1c(%rbx) movl %r14d, 0x20(%rbx) movq %rax, 0x24(%rbx) movq %rax, 0x29(%rbx) leaq 0x8(%rsp), %r14 movq %r14, %rdi callq 0x7e80 addq $0x10, %r12 movq %r12, %rdi movq %rbx, %rsi movq %r14, %rdx callq 0x7512 movl %eax, %ebp movq %rbx, %rdi callq 0x4350 leaq 0x8(%rsp), %rdi callq 0x7e8e movl %ebp, %eax addq $0x10, %rsp popq %rbx popq %r12 popq %r14 popq %r15 popq %rbp retq movq %rax, %rbx leaq 0x8(%rsp), %rdi callq 0x7e8e movq %rbx, %rdi callq 0x4500 nop
/lyang1024[P]redbase/src/sm_manager.cc
SM_Manager::SetUpPrint(RelCatEntry*, DataAttrInfo*)
RC SM_Manager::SetUpPrint(RelCatEntry* rEntry, DataAttrInfo *attributes){ RC rc = 0; RID attrRID; RM_Record attrRec; AttrCatEntry *aEntry; // Iterate through attrcat for attributes related to this relation SM_AttrIterator attrIt; if((rc = attrIt.OpenIterator(attrcatFH, rEntry->relName))) return (rc); for(int i=0; i < rEntry->attrCount; i++){ if((rc = attrIt.GetNextAttr(attrRec, aEntry))){ return (rc); } int slot = aEntry->attrNum; // insert its info in the appropriate slot memcpy(attributes[slot].relName, aEntry->relName, MAXNAME + 1); memcpy(attributes[slot].attrName, aEntry->attrName, MAXNAME + 1); attributes[slot].offset = aEntry->offset; attributes[slot].attrType = aEntry->attrType; attributes[slot].attrLength = aEntry->attrLength; attributes[slot].indexNo = aEntry->indexNo; } if((rc = attrIt.CloseIterator())) return (rc); return (rc); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x98, %rsp movq %rdx, %rbx movq %rsi, %r14 movq %rdi, %r15 leaq 0x8(%rsp), %rdi callq 0x7e80 leaq 0x18(%rsp), %rdi callq 0x7d24 leaq 0x30(%rsp), %rdi callq 0xe1c0 addq $0x58, %r15 leaq 0x30(%rsp), %rdi movq %r15, %rsi movq %r14, %rdx callq 0xe1fc movl %eax, %ebp testl %eax, %eax jne 0xae3e cmpl $0x0, 0x20(%r14) setg %r12b jle 0xae2c xorl %r15d, %r15d leaq 0x10(%rsp), %r13 leaq 0x30(%rsp), %rdi leaq 0x18(%rsp), %rsi movq %r13, %rdx callq 0xe228 movl %eax, %ebp testl %eax, %eax jne 0xae2c movq 0x10(%rsp), %rax movslq 0x44(%rax), %rcx movq %rcx, %rdx shlq $0x6, %rdx leaq (%rdx,%rcx,4), %rcx movups (%rax), %xmm0 movups 0x9(%rax), %xmm1 movups %xmm1, 0x9(%rbx,%rcx) movups %xmm0, (%rbx,%rcx) movups 0x19(%rax), %xmm0 movups 0x22(%rax), %xmm1 movups %xmm0, 0x19(%rbx,%rcx) movups %xmm1, 0x22(%rbx,%rcx) movl 0x34(%rax), %edx movl %edx, 0x34(%rbx,%rcx) movl 0x38(%rax), %edx movl %edx, 0x38(%rbx,%rcx) movl 0x3c(%rax), %edx movl %edx, 0x3c(%rbx,%rcx) movl 0x40(%rax), %eax movl %eax, 0x40(%rbx,%rcx) incl %r15d cmpl 0x20(%r14), %r15d setl %r12b jl 0xadb3 jmp 0xae2c testb $0x1, %r12b jne 0xae3e leaq 0x30(%rsp), %rdi callq 0xe25a movl %eax, %ebp leaq 0x30(%rsp), %rdi callq 0xe1d2 leaq 0x18(%rsp), %rdi callq 0x7d3e leaq 0x8(%rsp), %rdi callq 0x7e8e movl %ebp, %eax addq $0x98, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rax, %rbx jmp 0xae89 movq %rax, %rbx jmp 0xae93 jmp 0xae7c movq %rax, %rbx leaq 0x30(%rsp), %rdi callq 0xe1d2 leaq 0x18(%rsp), %rdi callq 0x7d3e leaq 0x8(%rsp), %rdi callq 0x7e8e movq %rbx, %rdi callq 0x4500 nop
/lyang1024[P]redbase/src/sm_manager.cc
SM_Manager::PrintPageStats()
RC SM_Manager::PrintPageStats(){ int *piGP = pStatisticsMgr->Get(PF_GETPAGE); int *piPF = pStatisticsMgr->Get(PF_PAGEFOUND); int *piPNF = pStatisticsMgr->Get(PF_PAGENOTFOUND); cout << "PF Layer Statistics" << endl; cout << "-------------------" << endl; if(piGP) cout << "Total number of calls to GetPage Routine: " << *piGP << endl; else cout << "Total number of calls to GetPage Routine: None" << endl; if(piPF) cout << " Number found: " << *piPF << endl; else cout << " Number found: None" << endl; if(piPNF) cout << " Number not found: " << *piPNF << endl; else cout << " Number found: None" << endl; return (0); }
pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx leaq 0x1d6cc(%rip), %rbx # 0x294f8 movq (%rbx), %rdi leaq 0x1d4aa(%rip), %rax # 0x292e0 movq (%rax), %rsi callq 0x68be movq %rax, %r12 movq (%rbx), %rdi leaq 0x1d49d(%rip), %rax # 0x292e8 movq (%rax), %rsi callq 0x68be movq %rax, %r15 movq (%rbx), %rdi leaq 0x1d490(%rip), %rax # 0x292f0 movq (%rax), %rsi callq 0x68be movq %rax, %r14 movq 0x1d156(%rip), %rbx # 0x28fc8 leaq 0x11441(%rip), %rsi # 0x1d2ba movl $0x13, %edx movq %rbx, %rdi callq 0x4330 movq (%rbx), %rax movq -0x18(%rax), %rdi addq %rbx, %rdi movl $0xa, %esi callq 0x42c0 movsbl %al, %esi movq %rbx, %rdi callq 0x4040 movq %rax, %rdi callq 0x4210 leaq 0x1141a(%rip), %rsi # 0x1d2ce movl $0x13, %edx movq %rbx, %rdi callq 0x4330 movq (%rbx), %rax movq -0x18(%rax), %rdi addq %rbx, %rdi movl $0xa, %esi callq 0x42c0 movsbl %al, %esi movq %rbx, %rdi callq 0x4040 movq %rax, %rdi callq 0x4210 testq %r12, %r12 je 0xbf19 movq 0x1d0d4(%rip), %r13 # 0x28fc8 leaq 0x113e7(%rip), %rsi # 0x1d2e2 movl $0x2a, %edx movq %r13, %rdi callq 0x4330 movl (%r12), %esi movq %r13, %rdi callq 0x44d0 movq %rax, %r12 jmp 0xbf34 movq 0x1d0a8(%rip), %r12 # 0x28fc8 leaq 0x113e6(%rip), %rsi # 0x1d30d movl $0x2e, %edx movq %r12, %rdi callq 0x4330 movq (%r12), %rax movq -0x18(%rax), %rdi addq %r12, %rdi movl $0xa, %esi callq 0x42c0 movsbl %al, %esi movq %r12, %rdi callq 0x4040 movq %rax, %rdi callq 0x4210 testq %r15, %r15 je 0xbf8c movq 0x1d060(%rip), %r12 # 0x28fc8 leaq 0x113cd(%rip), %rsi # 0x1d33c movl $0x10, %edx movq %r12, %rdi callq 0x4330 movl (%r15), %esi movq %r12, %rdi callq 0x44d0 movq %rax, %r15 jmp 0xbfa7 movq 0x1d035(%rip), %r15 # 0x28fc8 leaq 0x113b3(%rip), %rsi # 0x1d34d movl $0x14, %edx movq %r15, %rdi callq 0x4330 movq (%r15), %rax movq -0x18(%rax), %rdi addq %r15, %rdi movl $0xa, %esi callq 0x42c0 movsbl %al, %esi movq %r15, %rdi callq 0x4040 movq %rax, %rdi callq 0x4210 testq %r14, %r14 je 0xbffe movq 0x1cfee(%rip), %rbx # 0x28fc8 leaq 0x11381(%rip), %rsi # 0x1d362 movl $0x14, %edx movq %rbx, %rdi callq 0x4330 movl (%r14), %esi movq %rbx, %rdi callq 0x44d0 movq %rax, %rbx jmp 0xc012 leaq 0x11348(%rip), %rsi # 0x1d34d movl $0x14, %edx movq %rbx, %rdi callq 0x4330 movq (%rbx), %rax movq -0x18(%rax), %rdi addq %rbx, %rdi movl $0xa, %esi callq 0x42c0 movsbl %al, %esi movq %rbx, %rdi callq 0x4040 movq %rax, %rdi callq 0x4210 xorl %eax, %eax popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq nop
/lyang1024[P]redbase/src/sm_manager.cc
SM_Manager::SetUpRelCatAttributes(DataAttrInfo*)
RC SM_Manager::SetUpRelCatAttributes(DataAttrInfo *attributes){ int numAttr = 4; for(int i= 0; i < numAttr; i++){ memcpy(attributes[i].relName, "relcat", strlen("relcat") + 1); attributes[i].indexNo = 0; } memcpy(attributes[0].attrName, "relName", MAXNAME + 1); memcpy(attributes[1].attrName, "tupleLength", MAXNAME + 1); memcpy(attributes[2].attrName, "attrCount", MAXNAME + 1); memcpy(attributes[3].attrName, "indexCount", MAXNAME + 1); attributes[0].offset = (int) offsetof(RelCatEntry,relName); attributes[1].offset = (int) offsetof(RelCatEntry,tupleLength); attributes[2].offset = (int) offsetof(RelCatEntry,attrCount); attributes[3].offset = (int) offsetof(RelCatEntry,indexCount); attributes[0].attrType = STRING; attributes[1].attrType = INT; attributes[2].attrType = INT; attributes[3].attrType = INT; attributes[0].attrLength = MAXNAME + 1; attributes[1].attrLength = 4; attributes[2].attrLength = 4; attributes[3].attrLength = 4; return (0); }
movl $0x40, %eax movl $0x746163, -0x3d(%rsi,%rax) # imm = 0x746163 movl $0x636c6572, -0x40(%rsi,%rax) # imm = 0x636C6572 movl $0x0, (%rsi,%rax) addq $0x44, %rax cmpq $0x150, %rax # imm = 0x150 jne 0xc1e7 movups 0x111b5(%rip), %xmm0 # 0x1d3c6 movups %xmm0, 0x22(%rsi) movups 0x111a1(%rip), %xmm0 # 0x1d3bd movups %xmm0, 0x19(%rsi) movups 0x1119e(%rip), %xmm0 # 0x1d3c5 movups %xmm0, 0x5d(%rsi) movups 0x1119c(%rip), %xmm0 # 0x1d3ce movups %xmm0, 0x66(%rsi) movups 0x11194(%rip), %xmm0 # 0x1d3d1 movups %xmm0, 0xa1(%rsi) movups 0x1118f(%rip), %xmm0 # 0x1d3da movups %xmm0, 0xaa(%rsi) movups 0x11182(%rip), %xmm0 # 0x1d3db movups %xmm0, 0xe5(%rsi) movups 0x1117d(%rip), %xmm0 # 0x1d3e4 movups %xmm0, 0xee(%rsi) movl $0x0, 0x34(%rsi) movl $0x1c, 0x78(%rsi) movl $0x20, 0xbc(%rsi) movl $0x24, 0x100(%rsi) movabsq $0x1900000002, %rax # imm = 0x1900000002 movq %rax, 0x38(%rsi) movabsq $0x400000000, %rax # imm = 0x400000000 movq %rax, 0x7c(%rsi) movq %rax, 0xc0(%rsi) movq %rax, 0x104(%rsi) xorl %eax, %eax retq nop
/lyang1024[P]redbase/src/sm_manager.cc
Printer::Printer(DataAttrInfo const*, int)
Printer::Printer(const DataAttrInfo *attributes_, const int attrCount_) { attrCount = attrCount_; attributes = new DataAttrInfo[attrCount]; for (int i=0; i < attrCount; i++) attributes[i] = attributes_[i]; // Number of tuples printed iCount = 0; // Figure out what the header information will look like. Normally, // we can just use the attribute name, but if that appears more than // once, then we should use "relation.attribute". // this line broke when using CC // changing to use malloc and free instead of new and delete // psHeader = (char **) new (char *)[attrCount]; psHeader = (char**)malloc(attrCount * sizeof(char*)); // Also figure out the number of spaces between each attribute spaces = new int[attrCount]; for (int i=0; i < attrCount; i++ ) { // Try to find the attribute in another column int bFound = 0; psHeader[i] = new char[MAXPRINTSTRING]; memset(psHeader[i],0,MAXPRINTSTRING); for (int j=0; j < attrCount; j++) if (j != i && strcmp(attributes[i].attrName, attributes[j].attrName) == 0) { bFound = 1; break; } if (bFound) sprintf(psHeader[i], "%s.%s", attributes[i].relName, attributes[i].attrName); else strcpy(psHeader[i], attributes[i].attrName); if (attributes[i].attrType==STRING) spaces[i] = min(attributes[i].attrLength, MAXPRINTSTRING); else spaces[i] = max(12, strlen(psHeader[i])); // We must subtract out those characters that will be for the // header. spaces[i] -= strlen(psHeader[i]); // If there are negative (or zero) spaces, then insert a single // space. if (spaces[i] < 1) { // The psHeader will give us the space we need spaces[i] = 0; strcat(psHeader[i]," "); } } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x18, %rsp movq %rsi, %r14 movq %rdi, %rbx movl %edx, 0x8(%rdi) movslq %edx, %r15 movl $0x44, %ecx movq %r15, %rax mulq %rcx movq $-0x1, %rdi cmovnoq %rax, %rdi callq 0x4030 testl %r15d, %r15d je 0xd6a0 movq %r15, %rcx shlq $0x6, %rcx leaq (%rcx,%r15,4), %rcx xorl %edx, %edx xorps %xmm0, %xmm0 movups %xmm0, 0x20(%rax,%rdx) movups %xmm0, 0x10(%rax,%rdx) movups %xmm0, (%rax,%rdx) movw $0x0, 0x30(%rax,%rdx) addq $0x44, %rdx cmpq %rdx, %rcx jne 0xd682 movq %rax, (%rbx) movl 0x8(%rbx), %eax testl %eax, %eax jle 0xd6cf xorl %r15d, %r15d xorl %r12d, %r12d leaq (%r14,%r15), %rsi movq (%rbx), %rdi addq %r15, %rdi callq 0xe172 incq %r12 movslq 0x8(%rbx), %rax addq $0x44, %r15 cmpq %rax, %r12 jl 0xd6b0 movl $0x0, 0x20(%rbx) movslq %eax, %r14 leaq (,%r14,8), %rdi callq 0x43a0 movq %rax, 0x10(%rbx) leaq (,%r14,4), %rax testl %r14d, %r14d movq $-0x1, %rdi cmovnsq %rax, %rdi callq 0x4030 movq %rax, 0x18(%rbx) cmpl $0x0, 0x8(%rbx) jle 0xd86c xorl %ebp, %ebp movl $0x35, %edi callq 0x4030 movq 0x10(%rbx), %rcx movq %rax, (%rcx,%rbp,8) movq 0x10(%rbx), %rax movq (%rax,%rbp,8), %rax xorps %xmm0, %xmm0 movups %xmm0, (%rax) movups %xmm0, 0x20(%rax) movups %xmm0, 0x10(%rax) movq $0x0, 0x2d(%rax) movslq 0x8(%rbx), %r14 testq %r14, %r14 jle 0xd795 movq (%rbx), %rcx movq %rbp, %rax shlq $0x6, %rax leaq (%rax,%rbp,4), %rax movq %rax, 0x8(%rsp) leaq (%rcx,%rax), %r12 addq $0x19, %r12 movq %rcx, 0x10(%rsp) leaq 0x19(%rcx), %r13 xorl %r15d, %r15d cmpq %r15, %rbp je 0xd789 movq %r12, %rdi movq %r13, %rsi callq 0x43c0 testl %eax, %eax je 0xd7ba incq %r15 addq $0x44, %r13 cmpq %r15, %r14 jne 0xd775 movq (%rbx), %rax movq 0x10(%rbx), %rcx movq (%rcx,%rbp,8), %rdi movq %rbp, %rcx shlq $0x6, %rcx leaq (%rcx,%rbp,4), %rcx leaq (%rax,%rcx), %rsi addq $0x19, %rsi callq 0x42a0 jmp 0xd7dd movq 0x10(%rbx), %rax movq (%rax,%rbp,8), %rdi movq 0x10(%rsp), %rdx addq 0x8(%rsp), %rdx leaq 0xfd43(%rip), %rsi # 0x1d516 movq %r12, %rcx xorl %eax, %eax callq 0x40a0 movq (%rbx), %rax movq %rbp, %rcx shlq $0x6, %rcx leaq (%rcx,%rbp,4), %rcx cmpl $0x2, 0x38(%rax,%rcx) jne 0xd805 addq %rcx, %rax movl 0x3c(%rax), %eax cmpl $0x35, %eax movl $0x35, %ecx cmovgel %ecx, %eax jmp 0xd81f movq 0x10(%rbx), %rax movq (%rax,%rbp,8), %rdi callq 0x4160 cmpq $0xd, %rax movl $0xc, %ecx cmovbq %rcx, %rax movq 0x18(%rbx), %rcx movl %eax, (%rcx,%rbp,4) movq 0x10(%rbx), %rax movq (%rax,%rbp,8), %r15 movq %r15, %rdi callq 0x4160 movq 0x18(%rbx), %rcx movl (%rcx,%rbp,4), %edx subl %eax, %edx movl %edx, (%rcx,%rbp,4) testl %edx, %edx jg 0xd85c movl $0x0, (%rcx,%rbp,4) movq %r15, %rdi callq 0x4160 movw $0x20, (%r15,%rax) incq %rbp movslq 0x8(%rbx), %rax cmpq %rax, %rbp jl 0xd715 addq $0x18, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq nop
/lyang1024[P]redbase/src/printer.cc
Printer::PrintHeader(std::ostream&) const
void Printer::PrintHeader( ostream &c ) const { int dashes = 0; int iLen; int i,j; for (i = 0; i < attrCount; i++) { // Print out the header information name c << psHeader[i]; iLen = strlen(psHeader[i]); dashes += iLen; for (j = 0; j < spaces[i]; j++) c << " "; dashes += spaces[i]; } c << "\n"; for (i = 0; i < dashes; i++) c << "-"; c << "\n"; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movq %rsi, %rbx cmpl $0x0, 0x8(%rdi) jle 0xd994 movq %rdi, %r14 xorl %r13d, %r13d leaq 0x1124b(%rip), %r15 # 0x1eb4a xorl %ebp, %ebp movq 0x10(%r14), %rax movq (%rax,%r13,8), %r12 testq %r12, %r12 je 0xd926 movq %r12, %rdi callq 0x4160 movq %rbx, %rdi movq %r12, %rsi movq %rax, %rdx callq 0x4330 jmp 0xd93d movq (%rbx), %rax movq -0x18(%rax), %rax leaq (%rbx,%rax), %rdi movl 0x20(%rbx,%rax), %esi orl $0x1, %esi callq 0x44c0 movq 0x10(%r14), %rax movq (%rax,%r13,8), %rdi callq 0x4160 movq %rax, (%rsp) movq 0x18(%r14), %rax movl (%rax,%r13,4), %eax testl %eax, %eax jle 0xd97d xorl %r12d, %r12d movl $0x1, %edx movq %rbx, %rdi movq %r15, %rsi callq 0x4330 incl %r12d movq 0x18(%r14), %rax movl (%rax,%r13,4), %eax cmpl %eax, %r12d jl 0xd95d addl (%rsp), %ebp addl %eax, %ebp incq %r13 movslq 0x8(%r14), %rax cmpq %rax, %r13 jl 0xd901 jmp 0xd996 xorl %ebp, %ebp leaq 0xf6e8(%rip), %rsi # 0x1d085 movl $0x1, %edx movq %rbx, %rdi callq 0x4330 testl %ebp, %ebp jle 0xd9c9 leaq 0xf92b(%rip), %r14 # 0x1d2e0 movl $0x1, %edx movq %rbx, %rdi movq %r14, %rsi callq 0x4330 decl %ebp jne 0xd9b5 leaq 0xf6b5(%rip), %rsi # 0x1d085 movl $0x1, %edx movq %rbx, %rdi addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp jmp 0x4330 nop
/lyang1024[P]redbase/src/printer.cc
QL_Manager::Reset()
RC QL_Manager::Reset(){ relToInt.clear(); relToAttrIndex.clear(); attrToRel.clear(); conditionToRel.clear(); nAttrs = 0; nRels = 0; nConds = 0; condptr = NULL; isUpdate = false; return (0); }
pushq %rbx movq %rdi, %rbx addq $0x18, %rdi callq 0x126e2 leaq 0x78(%rbx), %rdi callq 0x126e2 leaq 0x48(%rbx), %rdi callq 0x12710 leaq 0xa8(%rbx), %rdi callq 0x1273e xorl %eax, %eax movq %rax, 0xf8(%rbx) movq %rax, 0xe8(%rbx) movq %rax, 0xed(%rbx) xorl %eax, %eax popq %rbx retq
/lyang1024[P]redbase/src/ql_manager.cc
QL_Manager::RunSelect(QL_Node*)
RC QL_Manager::RunSelect(QL_Node *topNode){ RC rc = 0; // Retrieve the appropriate tuples that one is supposed to // print out by asking for the attribute information from the top node int finalTupLength; topNode->GetTupleLength(finalTupLength); int *attrList; int attrListSize; if((rc = topNode->GetAttrList(attrList, attrListSize))) return (rc); // Set up the DatAttrInfo for the attributes to print DataAttrInfo * attributes = (DataAttrInfo *)malloc(attrListSize* sizeof(DataAttrInfo)); if((rc = SetUpPrinter(topNode, attributes))) return (rc); Printer printer(attributes, attrListSize); printer.PrintHeader(cout); // Open the iterator of the top node, and keep retrieving elements until // there are no more if((rc = topNode->OpenIt())) return (rc); RC it_rc = 0; char *buffer = (char *)malloc(finalTupLength); it_rc = topNode->GetNext(buffer); while(it_rc == 0){ printer.Print(cout, buffer); it_rc = topNode->GetNext(buffer); } free(buffer); if((rc = topNode->CloseIt())) return (rc); printer.PrintFooter(cout); free(attributes); return (0); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x38, %rsp movq %rsi, %rbx movq %rdi, %r15 leaq 0x4(%rsp), %rsi movq %rbx, %rdi callq 0x136c4 leaq 0x30(%rsp), %rsi movq %rsp, %rdx movq %rbx, %rdi callq 0x136b4 testl %eax, %eax jne 0xf59c movslq (%rsp), %rax movq %rax, %rcx shlq $0x6, %rcx leaq (%rcx,%rax,4), %rdi callq 0x43a0 movq %rax, %r14 movq %r15, %rdi movq %rbx, %rsi movq %rax, %rdx callq 0xf6a4 testl %eax, %eax je 0xf5af movl %eax, %ebp movl %ebp, %eax addq $0x38, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movl (%rsp), %edx leaq 0x8(%rsp), %r15 movq %r15, %rdi movq %r14, %rsi callq 0xd638 movq 0x199ff(%rip), %rsi # 0x28fc8 movq %r15, %rdi callq 0xd8da movq (%rbx), %rax movq %rbx, %rdi callq *(%rax) movl %eax, %ebp testl %eax, %eax jne 0xf656 movslq 0x4(%rsp), %rdi callq 0x43a0 movq %rax, %r15 movq (%rbx), %rax movq %rbx, %rdi movq %r15, %rsi callq *0x8(%rax) movq 0x199c9(%rip), %r12 # 0x28fc8 leaq 0x8(%rsp), %r13 testl %eax, %eax jne 0xf624 movq %r13, %rdi movq %r12, %rsi movq %r15, %rdx callq 0xde3a movq (%rbx), %rax movq %rbx, %rdi movq %r15, %rsi callq *0x8(%rax) jmp 0xf604 movq %r15, %rdi callq 0x4350 movq (%rbx), %rax movq %rbx, %rdi callq *0x18(%rax) movl %eax, %ebp testl %eax, %eax jne 0xf656 movq 0x19986(%rip), %rsi # 0x28fc8 leaq 0x8(%rsp), %rdi callq 0xd9ec movq %r14, %rdi callq 0x4350 xorl %ebp, %ebp leaq 0x8(%rsp), %rdi callq 0xd87c jmp 0xf59e jmp 0xf669 jmp 0xf669 movq %rax, %rbx leaq 0x8(%rsp), %rdi callq 0xd87c movq %rbx, %rdi callq 0x4500
/lyang1024[P]redbase/src/ql_manager.cc
QL_Manager::SetUpOneRelation(char const*)
RC QL_Manager::SetUpOneRelation(const char *relName){ RC rc = 0; RelCatEntry *rEntry; RM_Record relRec; if((rc = smm.GetRelEntry(relName, relRec, rEntry))){ return (rc); } memcpy(relEntries, rEntry, sizeof(RelCatEntry)); nRels = 1; nAttrs = rEntry->attrCount; string relString(relName); relToInt.insert({relString, 0}); relToAttrIndex.insert({relString, 0}); return (0); }
pushq %rbp pushq %r15 pushq %r14 pushq %rbx subq $0x68, %rsp movq %rsi, %r14 movq %rdi, %rbx leaq 0x50(%rsp), %r15 movq %r15, %rdi callq 0x7d24 movq 0x10(%rbx), %rdi leaq 0x28(%rsp), %rcx movq %r14, %rsi movq %r15, %rdx callq 0x8f10 movl %eax, %ebp testl %eax, %eax jne 0x10f3c movq 0xd8(%rbx), %rax movq 0x28(%rsp), %rcx movl 0x30(%rcx), %edx movl %edx, 0x30(%rax) movups (%rcx), %xmm0 movups 0x10(%rcx), %xmm1 movups 0x20(%rcx), %xmm2 movups %xmm2, 0x20(%rax) movups %xmm1, 0x10(%rax) movups %xmm0, (%rax) movl $0x1, 0xec(%rbx) movl 0x20(%rcx), %eax movl %eax, 0xe8(%rbx) leaq 0x30(%rsp), %rdi movq %rsp, %rdx movq %r14, %rsi callq 0x4140 leaq 0x10(%rsp), %r14 movq %r14, -0x10(%r14) movq 0x30(%rsp), %rsi movq 0x38(%rsp), %rdx addq %rsi, %rdx movq %rsp, %rdi callq 0xcbb6 movq %rsp, %rsi movl $0x0, 0x20(%rsi) leaq 0x18(%rbx), %rdi callq 0xceb4 movq (%rsp), %rdi cmpq %r14, %rdi je 0x10eeb callq 0x42b0 movq %rsp, %rdi movq %r14, (%rdi) movq 0x30(%rsp), %rsi movq 0x38(%rsp), %rdx addq %rsi, %rdx callq 0xcbb6 movq %rsp, %rsi movl $0x0, 0x20(%rsi) addq $0x78, %rbx movq %rbx, %rdi callq 0xceb4 movq (%rsp), %rdi cmpq %r14, %rdi je 0x10f27 callq 0x42b0 leaq 0x40(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x10f3a callq 0x42b0 xorl %ebp, %ebp leaq 0x50(%rsp), %rdi callq 0x7d3e movl %ebp, %eax addq $0x68, %rsp popq %rbx popq %r14 popq %r15 popq %rbp retq jmp 0x10f57 jmp 0x10f6a movq %rax, %rbx movq (%rsp), %rdi cmpq %r14, %rdi je 0x10f6d callq 0x42b0 jmp 0x10f6d movq %rax, %rbx leaq 0x40(%rsp), %rax movq -0x10(%rax), %rdi cmpq %rax, %rdi je 0x10f87 callq 0x42b0 jmp 0x10f87 jmp 0x10f84 movq %rax, %rbx leaq 0x50(%rsp), %rdi callq 0x7d3e movq %rbx, %rdi callq 0x4500 nop
/lyang1024[P]redbase/src/ql_manager.cc
QL_Manager::InsertIntoIndex(char*, RID)
RC QL_Manager::InsertIntoIndex(char *recbuf, RID recRID){ RC rc = 0; for(int i = 0; i < relEntries->attrCount; i++){ AttrCatEntry aEntry = attrEntries[i]; if(aEntry.indexNo != -1){ IX_IndexHandle ih; if((rc = ixm.OpenIndex(relEntries->relName, aEntry.indexNo, ih))) return (rc); if((rc = ih.InsertEntry((void *)(recbuf + aEntry.offset), recRID))) return (rc); if((rc = ixm.CloseIndex(ih))) return (rc); } } return (0); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x18, %rsp movq %rdx, 0x10(%rsp) movq %rsi, 0x8(%rsp) movq 0xd8(%rdi), %rax cmpl $0x0, 0x20(%rax) jle 0x1134b movq %rdi, %r15 movl $0x40, %r14d xorl %ebp, %ebp leaq 0x3(%rsp), %r12 movq 0xe0(%r15), %rax movl (%rax,%r14), %ebx cmpl $-0x1, %ebx je 0x1130e movslq -0xc(%rax,%r14), %r13 movq %r12, %rdi callq 0x184e4 movq 0x8(%r15), %rdi movq 0xd8(%r15), %rsi movl %ebx, %edx movq %r12, %rcx callq 0x184e4 testl %eax, %eax jne 0x112fe addq 0x8(%rsp), %r13 movq %r12, %rdi movq %r13, %rsi movq 0x10(%rsp), %rdx callq 0x184e8 testl %eax, %eax je 0x1132d xorl %ebx, %ebx movl %eax, 0x4(%rsp) movq %r12, %rdi callq 0x184e6 jmp 0x11310 movb $0x1, %bl testb %bl, %bl je 0x1134f incq %rbp movq 0xd8(%r15), %rax movslq 0x20(%rax), %rax addq $0x54, %r14 cmpq %rax, %rbp jl 0x112af jmp 0x1134b movq 0x8(%r15), %rdi movq %r12, %rsi callq 0x184e4 testl %eax, %eax sete %bl movl 0x4(%rsp), %ecx cmovnel %eax, %ecx movl %ecx, 0x4(%rsp) jmp 0x11304 xorl %eax, %eax jmp 0x11353 movl 0x4(%rsp), %eax addq $0x18, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rax, %rbx leaq 0x3(%rsp), %rdi callq 0x184e6 movq %rbx, %rdi callq 0x4500 nop
/lyang1024[P]redbase/src/ql_manager.cc
QL_Manager::CleanUpRun(Attr*, RM_FileHandle&)
RC QL_Manager::CleanUpRun(Attr* attributes, RM_FileHandle &relFH){ RC rc = 0; if( (rc = rmm.CloseFile(relFH))) return (rc); // Destroy and close the pointers in Attr struct if((rc = smm.CleanUpAttr(attributes, relEntries->attrCount))) return (rc); return (0); }
pushq %r14 pushq %rbx pushq %rax movq %rsi, %rbx movq %rdi, %r14 movq (%rdi), %rdi movq %rdx, %rsi callq 0x70d8 testl %eax, %eax je 0x11a7b addq $0x8, %rsp popq %rbx popq %r14 retq movq 0x10(%r14), %rdi movq 0xd8(%r14), %rax movl 0x20(%rax), %edx movq %rbx, %rsi addq $0x8, %rsp popq %rbx popq %r14 jmp 0xa9f0
/lyang1024[P]redbase/src/ql_manager.cc
QL_Node::CheckConditions(char*)
RC QL_Node::CheckConditions(char *recData){ RC rc = 0; for(int i = 0; i < condIndex; i++){ int offset1 = condList[i].offset1; // If we are comparing this to a value if(! condList[i].isValue){ // If it's not a string, or string of equal length, just compare if(condList[i].type != STRING || condList[i].length == condList[i].length2){ int offset2 = condList[i].offset2; bool comp = condList[i].comparator((void *)(recData + offset1), (void *)(recData + offset2), condList[i].type, condList[i].length); if(comp == false){ return (QL_CONDNOTMET); } } // Depending on if the value or attribute is shorter, null terminate the shorter one and compare else if(condList[i].length < condList[i].length2){ int offset2 = condList[i].offset2; char *shorter = (char*)malloc(condList[i].length + 1); memset((void *)shorter, 0, condList[i].length + 1); memcpy(shorter, recData + offset1, condList[i].length); shorter[condList[i].length] = '\0'; bool comp = condList[i].comparator(shorter, (void*)(recData + offset2), condList[i].type, condList[i].length + 1); free(shorter); if(comp == false) return (QL_CONDNOTMET); } else{ int offset2 = condList[i].offset2; char *shorter = (char*)malloc(condList[i].length2 + 1); memset((void*)shorter, 0, condList[i].length2 + 1); memcpy(shorter, recData + offset2, condList[i].length2); shorter[condList[i].length2] = '\0'; bool comp = condList[i].comparator((void*)(recData + offset1), shorter, condList[i].type, condList[i].length2 +1); free(shorter); if(comp == false) return (QL_CONDNOTMET); } } // Else, we are comparing it to another attribute else{ // If it's not a string, or string of equal length, just compare if(condList[i].type != STRING || condList[i].length == condList[i].length2){ bool comp = condList[i].comparator((void *)(recData + offset1), condList[i].data, condList[i].type, condList[i].length); if(comp == false) return (QL_CONDNOTMET); } // Depending on which one is shorter, null terminate the shorter one and compare else if(condList[i].length < condList[i].length2){ char *shorter = (char*)malloc(condList[i].length + 1); memset((void *)shorter, 0, condList[i].length + 1); memcpy(shorter, recData + offset1, condList[i].length); shorter[condList[i].length] = '\0'; bool comp = condList[i].comparator(shorter, condList[i].data, condList[i].type, condList[i].length + 1); free(shorter); if(comp == false) return (QL_CONDNOTMET); } else{ char *shorter = (char*)malloc(condList[i].length2 + 1); memset((void*)shorter, 0, condList[i].length2 + 1); memcpy(shorter, condList[i].data, condList[i].length2); shorter[condList[i].length2] = '\0'; bool comp = condList[i].comparator((void*)(recData + offset1), shorter, condList[i].type, condList[i].length2 +1); free(shorter); if(comp == false) return (QL_CONDNOTMET); } } } return (0); }
cmpl $0x0, 0x30(%rdi) jle 0x1369f pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x18, %rsp movq %rsi, %r12 movq %rdi, %r14 movl $0x2c, %ebp xorl %ebx, %ebx movq %rsi, 0x8(%rsp) movq 0x28(%r14), %r13 movslq -0x2c(%r13,%rbp), %r15 movl (%r13,%rbp), %edx cmpb $0x0, -0x1c(%r13,%rbp) je 0x134c7 cmpl $0x2, %edx jne 0x134bd movslq -0x8(%r13,%rbp), %rdi movslq -0x4(%r13,%rbp), %rax cmpl %eax, %edi jne 0x13513 addq %r12, %r15 movq -0x14(%r13,%rbp), %rsi jmp 0x134e9 cmpl $0x2, %edx jne 0x134de movslq -0x8(%r13,%rbp), %rdi movslq -0x4(%r13,%rbp), %rax cmpl %eax, %edi jne 0x13570 movslq -0xc(%r13,%rbp), %rsi addq %r12, %r15 addq %r12, %rsi movl -0x8(%r13,%rbp), %ecx movq %r15, %rdi callq *-0x24(%r13,%rbp) testb %al, %al je 0x13698 incq %rbx movslq 0x30(%r14), %rax addq $0x30, %rbp cmpq %rax, %rbx jl 0x13494 jmp 0x136a2 cmpl %eax, %edi jge 0x135fb incq %rdi callq 0x43a0 movq %rax, %r12 movslq -0x8(%r13,%rbp), %rdx incq %rdx movq %rax, %rdi xorl %esi, %esi callq 0x41d0 addq 0x8(%rsp), %r15 movslq -0x8(%r13,%rbp), %rdx movq %r12, %rdi movq %r15, %rsi callq 0x4260 movslq -0x8(%r13,%rbp), %rax movb $0x0, (%r12,%rax) movq -0x14(%r13,%rbp), %rsi movl (%r13,%rbp), %edx movl -0x8(%r13,%rbp), %ecx incl %ecx movq %r12, %rdi jmp 0x1367a movslq -0xc(%r13,%rbp), %rcx movq %rcx, 0x10(%rsp) cmpl %eax, %edi jge 0x13622 incq %rdi callq 0x43a0 movq %rax, %r12 movslq -0x8(%r13,%rbp), %rdx incq %rdx movq %rax, %rdi xorl %esi, %esi callq 0x41d0 addq 0x8(%rsp), %r15 movslq -0x8(%r13,%rbp), %rdx movq %r12, %rdi movq %r15, %rsi callq 0x4260 movslq -0x8(%r13,%rbp), %rax movb $0x0, (%r12,%rax) movq 0x10(%rsp), %rsi movq 0x8(%rsp), %r15 addq %r15, %rsi movl -0x8(%r13,%rbp), %ecx movl (%r13,%rbp), %edx incl %ecx movq %r12, %rdi callq *-0x24(%r13,%rbp) movl %eax, %r13d movq %r12, %rdi movq %r15, %r12 callq 0x4350 testb %r13b, %r13b jne 0x134fe jmp 0x13698 incq %rax movq %rax, %rdi callq 0x43a0 movq %rax, %r12 movslq -0x4(%r13,%rbp), %rdx incq %rdx movq %rax, %rdi xorl %esi, %esi callq 0x41d0 movq -0x14(%r13,%rbp), %rsi jmp 0x1364c incq %rax movq %rax, %rdi callq 0x43a0 movq %rax, %r12 movslq -0x4(%r13,%rbp), %rdx incq %rdx movq %rax, %rdi xorl %esi, %esi callq 0x41d0 movq 0x10(%rsp), %rsi addq 0x8(%rsp), %rsi movslq -0x4(%r13,%rbp), %rdx movq %r12, %rdi callq 0x4260 movslq -0x4(%r13,%rbp), %rax movb $0x0, (%r12,%rax) addq 0x8(%rsp), %r15 movl -0x4(%r13,%rbp), %ecx movl (%r13,%rbp), %edx incl %ecx movq %r15, %rdi movq %r12, %rsi callq *-0x24(%r13,%rbp) movl %eax, %r15d movq %r12, %rdi movq 0x8(%rsp), %r12 callq 0x4350 testb %r15b, %r15b jne 0x134fe movl $0x197, %eax # imm = 0x197 jmp 0x136a4 xorl %eax, %eax retq xorl %eax, %eax addq $0x18, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq nop
/lyang1024[P]redbase/src/ql_node.cc
QL_NodeProj::DeleteNodes()
RC QL_NodeProj::DeleteNodes(){ prevNode.DeleteNodes(); delete &prevNode; if(listsInitialized == true){ free(attrsInRec); free(buffer); //free(attrsToKeep); } listsInitialized = false; return (0); }
pushq %r14 pushq %rbx pushq %rax movq %rdi, %rbx movq 0x48(%rdi), %rdi movq (%rdi), %rax callq *0x20(%rax) movq 0x48(%rbx), %r14 testq %r14, %r14 je 0x13a6a movq %r14, %rdi callq 0x12fb6 movq %r14, %rdi callq 0x42b0 cmpb $0x1, 0x24(%rbx) jne 0x13a82 movq 0x18(%rbx), %rdi callq 0x4350 movq 0x58(%rbx), %rdi callq 0x4350 movb $0x0, 0x24(%rbx) xorl %eax, %eax addq $0x8, %rsp popq %rbx popq %r14 retq
/lyang1024[P]redbase/src/ql_nodeproj.cc
QL_NodeRel::~QL_NodeRel()
QL_NodeRel::~QL_NodeRel(){ if(relNameInitialized == true){ free(relName); } relNameInitialized = false; if(listsInitialized == true){ free(attrsInRec); } listsInitialized = false; }
pushq %rbx movq %rdi, %rbx leaq 0x14e87(%rip), %rax # 0x28a18 movq %rax, (%rdi) cmpb $0x1, 0x50(%rdi) jne 0x13ba3 movq 0x48(%rbx), %rdi callq 0x4350 movb $0x0, 0x50(%rbx) cmpb $0x1, 0x24(%rbx) jne 0x13bb6 movq 0x18(%rbx), %rdi callq 0x4350 movb $0x0, 0x24(%rbx) leaq 0x118(%rbx), %rdi callq 0x184ea leaq 0xb8(%rbx), %rdi callq 0x1bbec leaq 0xb0(%rbx), %rdi callq 0x184e6 leaq 0x68(%rbx), %rdi callq 0x71f6 movq %rbx, %rdi popq %rbx jmp 0x12fb6
/lyang1024[P]redbase/src/ql_noderel.cc
QL_NodeRel::RetrieveNextRec(RM_Record&, char*&)
RC QL_NodeRel::RetrieveNextRec(RM_Record &rec, char *&recData){ RC rc = 0; if(useIndex){ RID rid; if((rc = is.GetNextEntry(rid) )) return (rc); if((rc = fh.GetRec(rid, rec) )) return (rc); } else{ if((rc = fs.GetNextRec(rec))) return (rc); } if((rc = rec.GetData(recData))) return (rc); return (0); }
pushq %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x10, %rsp movq %rdx, %rbx movq %rsi, %r14 movq %rdi, %r15 cmpb $0x1, 0x51(%rdi) jne 0x13de0 leaq 0x8(%rsp), %r12 movq %r12, %rdi callq 0x7e80 leaq 0x118(%r15), %rdi movq %r12, %rsi callq 0x184ec movl %eax, %ebp testl %eax, %eax je 0x13dfa xorl %r15d, %r15d jmp 0x13e16 addq $0xb8, %r15 movq %r15, %rdi movq %r14, %rsi callq 0x1bea8 movl %eax, %ebp testl %eax, %eax jne 0x13e32 jmp 0x13e25 addq $0x68, %r15 leaq 0x8(%rsp), %rsi movq %r15, %rdi movq %r14, %rdx callq 0x739a movl %eax, %ebp testl %eax, %eax sete %r15b leaq 0x8(%rsp), %rdi callq 0x7e8e testb %r15b, %r15b je 0x13e32 movq %r14, %rdi movq %rbx, %rsi callq 0x7dba movl %eax, %ebp movl %ebp, %eax addq $0x10, %rsp popq %rbx popq %r12 popq %r14 popq %r15 popq %rbp retq movq %rax, %rbx leaq 0x8(%rsp), %rdi callq 0x7e8e movq %rbx, %rdi callq 0x4500
/lyang1024[P]redbase/src/ql_noderel.cc
QL_NodeSel::GetNext(char*)
RC QL_NodeSel::GetNext(char *data){ RC rc = 0; while(true){ if((rc = prevNode.GetNext(buffer))){ return (rc); } // keep retrieving records until the conditions are met RC cond = CheckConditions(buffer); if(cond == 0) break; } memcpy(data, buffer, tupleLength); return (0); }
pushq %r14 pushq %rbx pushq %rax movq %rsi, %rbx movq %rdi, %r14 movq 0x48(%r14), %rdi movq 0x50(%r14), %rsi movq (%rdi), %rax callq *0x8(%rax) testl %eax, %eax jne 0x149d4 movq 0x50(%r14), %rsi movq %r14, %rdi callq 0x1346a testl %eax, %eax jne 0x149a0 movq 0x50(%r14), %rsi movslq 0x14(%r14), %rdx movq %rbx, %rdi callq 0x4260 xorl %eax, %eax addq $0x8, %rsp popq %rbx popq %r14 retq
/lyang1024[P]redbase/src/ql_nodesel.cc
QO_Manager::QO_Manager(QL_Manager&, int, RelCatEntry*, int, AttrCatEntry*, int, Condition const*)
QO_Manager::QO_Manager(QL_Manager &qlm, int nRelations, RelCatEntry *relations, int nAttributes, AttrCatEntry *attributes, int nConditions, const Condition conditions[]) : qlm(qlm) { // Construct the new optjoin for(int i=0; i < nRelations; i++){ map<int, costElem*> mapper; optcost.push_back(mapper); } nRels = nRelations; nAttrs = nAttributes; nConds = nConditions; rels = relations; attrs = attributes; conds = conditions; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x48, %rsp movq %r9, 0x10(%rsp) movl %r8d, 0x4(%rsp) movq %rcx, 0x8(%rsp) movq %rdi, %r15 movq %rsi, (%rdi) xorps %xmm0, %xmm0 movups %xmm0, 0x30(%rdi) movq $0x0, 0x40(%rdi) movl %edx, (%rsp) testl %edx, %edx jle 0x14c89 leaq 0x30(%r15), %r13 leaq 0x20(%rsp), %r14 xorl %ebp, %ebp leaq 0x18(%rsp), %rbx movl (%rsp), %r12d movl $0x0, 0x20(%rsp) movq %rbp, 0x28(%rsp) movq %r14, 0x30(%rsp) movq %r14, 0x38(%rsp) movq %rbp, 0x40(%rsp) movq %r13, %rdi movq %rbx, %rsi callq 0x17306 movq %rbx, %rdi callq 0x17566 decl %r12d jne 0x14c55 movq 0x88(%rsp), %rax movl 0x80(%rsp), %ecx movl (%rsp), %edx movl %edx, 0x8(%r15) movl 0x4(%rsp), %edx movl %edx, 0xc(%r15) movl %ecx, 0x10(%r15) movq 0x8(%rsp), %rcx movq %rcx, 0x18(%r15) movq 0x10(%rsp), %rcx movq %rcx, 0x20(%r15) movq %rax, 0x28(%r15) addq $0x48, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rax, %rbx leaq 0x18(%rsp), %rdi callq 0x17566 movq %r13, %rdi callq 0x17332 movq %rbx, %rdi callq 0x4500 nop
/lyang1024[P]redbase/src/qo_manager.cc
QO_Manager::Compute(QO_Rel*, float&, float&)
RC QO_Manager::Compute(QO_Rel *relOrder, float &costEst, float &tupleEst){ RC rc = 0; // initialize the base relations if((rc = InitializeBaseCases())) return (rc); // create a vector containing bitmaps that // reflect all subsets of size 1 vector<int> allSubsets; for(int i=0; i < nRels; i++){ int bitmap = 0; if((rc = AddRelToBitmap(i, bitmap))) return (rc); allSubsets.push_back(bitmap); } for(int i=1; i < nRels; i++){ // for all sizes of subsets vector<int> allNewSubsets; // will hold all subsets of size i+1 // at the end of the iteration // iterate through all sets of the previous size vector<int>::iterator it; for(it= allSubsets.begin(); it != allSubsets.end(); ++it){ for(int j=0; j < nRels; j++){ // go through all ways of adding a new relation int relsInJoin = *it; int newRelsInJoin = relsInJoin; AddRelToBitmap(j, newRelsInJoin); bool isInOptCost1 = (optcost[i-1].find(newRelsInJoin) != optcost[i-1].end()); bool isInOptCost2 = (optcost[i].find(newRelsInJoin) != optcost[i].end()); // If adding this new relation modifies the set (i.e. relation is not) // included in the set of the previous size) and we haven't calculated // the optimal way of joining this yet, do so if(!IsBitSet(j, relsInJoin) && !isInOptCost1 && !isInOptCost2){ if((rc = CalculateOptJoin(newRelsInJoin, i))){ return (rc); } // add this to the set. allNewSubsets.push_back(newRelsInJoin); } } } allSubsets.clear(); allSubsets = allNewSubsets; // set the previous set of joins of size i to the set of joins // of size i+1 } // create the bitmap containing all relations int relsInJoin = 0; for(int i = 0; i < nRels; i++){ if((rc = AddRelToBitmap(i, relsInJoin))) return (rc); } // update the overall estimated costs and tuple numbers costEst = optcost[nRels-1][relsInJoin]->cost; tupleEst = optcost[nRels-1][relsInJoin]->numTuples; // backtrace: start with the set of all relations, and use the // "joins" field to get the cost stats of the previous opt join, and // move them to the appropriate location in QO_Rel array for(int i=0; i < nRels; i++){ int index = nRels-i-1; int nextSubJoin = optcost[index][relsInJoin]->joins; relOrder[index].relIdx = optcost[index][relsInJoin]->newRelIndex; relOrder[index].indexAttr = optcost[index][relsInJoin]->indexAttr; relOrder[index].indexCond = optcost[index][relsInJoin]->indexCond; relsInJoin = nextSubJoin; } return (0); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x78, %rsp movq %rcx, %r15 movq %rdx, %r12 movq %rsi, %rbx movq %rdi, %r14 callq 0x15748 movl %eax, %ebp testl %eax, %eax jne 0x15703 movq %r12, 0x60(%rsp) movq %r15, 0x68(%rsp) movq %rbx, 0x70(%rsp) xorps %xmm0, %xmm0 movaps %xmm0, 0x40(%rsp) movq $0x0, 0x50(%rsp) cmpl $0x0, 0x8(%r14) setg %bpl jle 0x1531f xorl %r13d, %r13d leaq 0x20(%rsp), %r15 xorl %r12d, %r12d movl $0x1, %eax movl %r12d, %ecx shll %cl, %eax cmpl $0x21, %r12d cmovael %r13d, %eax movl $0x19b, %ecx # imm = 0x19B cmovbl %r13d, %ecx movl %eax, 0x20(%rsp) jae 0x15308 movq 0x48(%rsp), %rsi cmpq 0x50(%rsp), %rsi je 0x152f9 movl 0x20(%rsp), %eax movl %eax, (%rsi) addq $0x4, %rsi movq %rsi, 0x48(%rsp) movl %ebx, %ecx jmp 0x15308 leaq 0x40(%rsp), %rdi movq %r15, %rdx callq 0x17d82 movl %ebx, %ecx cmpl $0x21, %r12d je 0x1531f incl %r12d movl %ecx, %ebx cmpl 0x8(%r14), %r12d setl %bpl jl 0x152b9 jmp 0x1531f testb $0x1, %bpl je 0x1532c movl %ecx, %ebp jmp 0x156f4 cmpl $0x2, 0x8(%r14) setge 0xb(%rsp) movl %ecx, %ebp jl 0x15564 movl $0x1, %eax movq %rax, 0x18(%rsp) movl %ebp, 0x14(%rsp) xorps %xmm0, %xmm0 movaps %xmm0, 0x20(%rsp) movq $0x0, 0x30(%rsp) movq 0x40(%rsp), %rbp movq 0x48(%rsp), %rax cmpq %rax, %rbp sete %r12b je 0x154ed movq 0x18(%rsp), %rax leaq (%rax,%rax,2), %r15 shlq $0x4, %r15 movb %r12b, 0x13(%rsp) cmpl $0x0, 0x8(%r14) setg %r12b jle 0x154d1 xorl %ebx, %ebx movl $0x1, %edx movl %ebx, %ecx shll %cl, %edx cmpl $0x21, %ebx movl $0x0, %eax cmovael %eax, %edx movl (%rbp), %eax orl %eax, %edx movl %edx, 0xc(%rsp) movq 0x30(%r14), %rcx leaq (%rcx,%r15), %rdx addq $-0x28, %rdx movq 0x8(%rdx), %rsi movq %rdx, %rdi testq %rsi, %rsi je 0x153ed movl 0xc(%rsp), %r8d movq %rdx, %rdi xorl %r9d, %r9d cmpl %r8d, 0x20(%rsi) setl %r9b cmovgeq %rsi, %rdi movq 0x10(%rsi,%r9,8), %rsi testq %rsi, %rsi jne 0x153d4 movq %rdx, %rsi cmpq %rdx, %rdi je 0x15403 movl 0xc(%rsp), %esi cmpl 0x20(%rdi), %esi cmovlq %rdx, %rdi movq %rdi, %rsi leaq (%rcx,%r15), %rdi addq $0x8, %rdi movq 0x8(%rdi), %r8 movq %rdi, %rcx testq %r8, %r8 je 0x15438 movl 0xc(%rsp), %r9d movq %rdi, %rcx xorl %r10d, %r10d cmpl %r9d, 0x20(%r8) setl %r10b cmovgeq %r8, %rcx movq 0x10(%r8,%r10,8), %r8 testq %r8, %r8 jne 0x1541f movq %rdi, %r8 cmpq %rdi, %rcx je 0x15450 movl 0xc(%rsp), %r8d cmpl 0x20(%rcx), %r8d cmovlq %rdi, %rcx movq %rcx, %r8 movl $0x1, %r9d movl %ebx, %ecx shll %cl, %r9d movb $0x1, %r13b cmpl $0x20, %ebx ja 0x154bc andl %r9d, %eax jne 0x154bc cmpq %rdx, %rsi jne 0x154bc cmpq %rdi, %r8 jne 0x154bc movl 0xc(%rsp), %esi movq %r14, %rdi movq 0x18(%rsp), %rdx callq 0x15b2a testl %eax, %eax je 0x15490 xorl %r13d, %r13d movl %eax, 0x14(%rsp) jmp 0x154bc movq 0x28(%rsp), %rsi cmpq 0x30(%rsp), %rsi je 0x154ad movl 0xc(%rsp), %eax movl %eax, (%rsi) addq $0x4, %rsi movq %rsi, 0x28(%rsp) jmp 0x154bc leaq 0x20(%rsp), %rdi leaq 0xc(%rsp), %rdx callq 0x17d82 testb %r13b, %r13b je 0x154d1 incl %ebx cmpl 0x8(%r14), %ebx setl %r12b jl 0x15397 testb $0x1, %r12b jne 0x1551b addq $0x4, %rbp movq 0x48(%rsp), %rax cmpq %rax, %rbp sete %r12b jne 0x15381 movq 0x40(%rsp), %rcx cmpq %rcx, %rax movl 0x14(%rsp), %ebp je 0x15500 movq %rcx, 0x48(%rsp) leaq 0x40(%rsp), %rdi leaq 0x20(%rsp), %rsi callq 0x1736c movq 0x68(%rsp), %rbx movq 0x60(%rsp), %r15 jmp 0x1552e movq 0x68(%rsp), %rbx movq 0x60(%rsp), %r15 movl 0x14(%rsp), %ebp movb 0x13(%rsp), %r12b movq 0x20(%rsp), %rdi testq %rdi, %rdi je 0x1553d callq 0x42b0 testb $0x1, %r12b je 0x1556e movq 0x18(%rsp), %rdx incq %rdx movslq 0x8(%r14), %rax movq %rdx, 0x18(%rsp) cmpq %rax, %rdx setl 0xb(%rsp) jl 0x15348 jmp 0x1556e movq 0x68(%rsp), %rbx movq 0x60(%rsp), %r15 testb $0x1, 0xb(%rsp) jne 0x156f4 movl $0x0, 0x20(%rsp) movslq 0x8(%r14), %rax testq %rax, %rax setg %sil jle 0x155d6 leal -0x1(%rax), %esi xorl %edi, %edi movl $0x1, %edx xorl %r8d, %r8d cmpl %r8d, %esi je 0x155da movl %r8d, %ecx leal 0x1(%rcx), %r8d movl $0x2, %r9d shll %cl, %r9d cmpl $0x20, %ecx cmovael %edi, %r9d orl %r9d, %edx cmpl $0x21, %r8d jne 0x1559b cmpl %eax, %r8d setl %sil xorl %edi, %edi cmpl $0x20, %ecx movl $0x19b, %ebp # imm = 0x19B cmovbl %edi, %ebp jmp 0x155dc xorl %edx, %edx jmp 0x155dc xorl %esi, %esi movl %edx, 0x20(%rsp) testb %sil, %sil jne 0x156f4 movq 0x30(%r14), %rcx leaq (%rax,%rax,2), %rax shlq $0x4, %rax leaq (%rcx,%rax), %rdi addq $-0x30, %rdi leaq 0x20(%rsp), %rsi callq 0x1743a movq (%rax), %rax movss 0xc(%rax), %xmm0 movss %xmm0, (%r15) movslq 0x8(%r14), %rax movq 0x30(%r14), %rcx leaq (%rax,%rax,2), %rax shlq $0x4, %rax leaq (%rcx,%rax), %rdi addq $-0x30, %rdi leaq 0x20(%rsp), %rsi callq 0x1743a movq (%rax), %rax movss 0x8(%rax), %xmm0 movss %xmm0, (%rbx) movl 0x8(%r14), %eax testl %eax, %eax jle 0x156f2 xorl %ebp, %ebp movl $0xffffffff, %r12d # imm = 0xFFFFFFFF leaq 0x20(%rsp), %r13 addl %r12d, %eax cltq leaq (%rax,%rax,2), %rbx movq %rbx, %r15 shlq $0x4, %r15 movq 0x30(%r14), %rdi addq %r15, %rdi movq %r13, %rsi callq 0x1743a movq (%rax), %rax movl (%rax), %eax movl %eax, 0x18(%rsp) movq 0x30(%r14), %rdi addq %r15, %rdi movq %r13, %rsi callq 0x1743a movq (%rax), %rax movl 0x4(%rax), %eax movq 0x70(%rsp), %rcx movl %eax, (%rcx,%rbx,4) movq 0x30(%r14), %rdi addq %r15, %rdi movq %r13, %rsi callq 0x1743a movq 0x70(%rsp), %rcx leaq (%rcx,%rbx,4), %rbx movq (%rax), %rax movl 0x10(%rax), %eax movl %eax, 0x4(%rbx) addq 0x30(%r14), %r15 movq %r15, %rdi movq %r13, %rsi callq 0x1743a movq (%rax), %rax movl 0x14(%rax), %eax movl %eax, 0x8(%rbx) movl 0x18(%rsp), %eax movl %eax, 0x20(%rsp) incl %ebp movl 0x8(%r14), %eax decl %r12d cmpl %eax, %ebp jl 0x1565b xorl %ebp, %ebp movq 0x40(%rsp), %rdi testq %rdi, %rdi je 0x15703 callq 0x42b0 movl %ebp, %eax addq $0x78, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0x1571a jmp 0x1571a jmp 0x1571f movq %rax, %rbx jmp 0x15731 movq %rax, %rbx movq 0x20(%rsp), %rdi testq %rdi, %rdi je 0x15731 callq 0x42b0 movq 0x40(%rsp), %rdi testq %rdi, %rdi je 0x15740 callq 0x42b0 movq %rbx, %rdi callq 0x4500
/lyang1024[P]redbase/src/qo_manager.cc
QO_Manager::CalculateOptJoin(int, int)
RC QO_Manager::CalculateOptJoin(int relsInJoin, int relSize){ RC rc = 0; // create a vector of these relations in the bitmap vector<int> relsInJoinVec; ConvertBitmapToVec(relsInJoin, relsInJoinVec); // Create a cost element, and initialize its values vector<int>::iterator it; costElem *costTable = new costElem(); costTable->cost = FLT_MAX; costTable->indexAttr = -1; costTable->indexCond = -1; // iterate through all ways of removing a relation a for(it = relsInJoinVec.begin(); it != relsInJoinVec.end(); ++it){ int subJoin = relsInJoin; if((rc = RemoveRelFromBitmap(*it, subJoin))) return (rc); float cost; map<int, attrStat> attrStats; float totalTuples; int indexAttr = -1; int indexCond = -1; // Calculate the a join (S-a) if((rc = CalculateJoin(subJoin, *it, relSize, cost, totalTuples, attrStats, indexAttr, indexCond))) return (rc); // if the cost is the smallest so far, update all values if(cost < costTable->cost){ costTable->cost = cost; costTable->attrs.clear(); costTable->attrs = attrStats; costTable->joins = subJoin; costTable->newRelIndex = *it; costTable->numTuples = totalTuples; costTable->indexAttr = indexAttr; costTable->indexCond = indexCond; } } // insert the costElem as the optimal way of arriving // at this join optcost[relSize].insert({relsInJoin, costTable}); return (0); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x78, %rsp movl %edx, (%rsp) movq %rdi, 0x18(%rsp) xorps %xmm0, %xmm0 leaq 0x20(%rsp), %rdx movaps %xmm0, (%rdx) movq $0x0, 0x10(%rdx) movl %esi, 0x4(%rsp) callq 0x151fe movl $0x48, %edi callq 0x42f0 movq %rax, %r15 addq $0x20, %rax xorps %xmm0, %xmm0 movaps %xmm0, 0x30(%r15) movaps %xmm0, (%r15) movaps %xmm0, 0x10(%r15) movaps %xmm0, 0x20(%r15) movq $0x0, 0x40(%r15) movq %rax, 0x30(%r15) movq %rax, 0x38(%r15) movl $0x7f7fffff, 0xc(%r15) # imm = 0x7F7FFFFF movq $-0x1, 0x10(%r15) movq 0x20(%rsp), %r12 cmpq 0x28(%rsp), %r12 je 0x15cd2 movq %r15, %rax addq $0x18, %rax movq %rax, 0x40(%rsp) movl $0xffffffff, %edx # imm = 0xFFFFFFFF xorl %esi, %esi movl (%r12), %r14d movl $0xfffffffe, %ebp # imm = 0xFFFFFFFE movl %r14d, %ecx roll %cl, %ebp cmpl $0x21, %r14d cmovael %edx, %ebp movl $0x19b, %ebx # imm = 0x19B cmovbl %esi, %ebx jae 0x15cba andl 0x4(%rsp), %ebp movl $0x0, 0x50(%rsp) movq %rsi, 0x58(%rsp) leaq 0x50(%rsp), %rax movq %rax, 0x60(%rsp) movq %rax, 0x68(%rsp) movq %rsi, 0x70(%rsp) movl %edx, 0xc(%rsp) movl %edx, 0x8(%rsp) movl (%r12), %edx subq $0x8, %rsp movq 0x20(%rsp), %rdi movl %ebp, %esi movl 0x8(%rsp), %ecx leaq 0x1c(%rsp), %r8 leaq 0x18(%rsp), %r9 leaq 0x10(%rsp), %rax pushq %rax leaq 0x1c(%rsp), %rax pushq %rax leaq 0x60(%rsp), %rax pushq %rax callq 0x15d62 addq $0x20, %rsp movss 0x14(%rsp), %xmm0 movss 0xc(%r15), %xmm1 ucomiss %xmm0, %xmm1 jbe 0x15ca6 movss %xmm0, 0xc(%r15) movq 0x40(%rsp), %rbx movq %rbx, %rdi callq 0x180b2 movq %rbx, %rdi leaq 0x48(%rsp), %rsi callq 0x17792 movl %ebp, (%r15) movl (%r12), %eax movl %eax, 0x4(%r15) movss 0x10(%rsp), %xmm0 movss %xmm0, 0x8(%r15) movl 0xc(%rsp), %eax movl %eax, 0x10(%r15) movl 0x8(%rsp), %eax movl %eax, 0x14(%r15) leaq 0x48(%rsp), %rdi callq 0x1777e movl %r13d, %ebx movl $0xffffffff, %edx # imm = 0xFFFFFFFF xorl %esi, %esi cmpl $0x21, %r14d jae 0x15cfd addq $0x4, %r12 movl %ebx, %r13d cmpq 0x28(%rsp), %r12 jne 0x15bc6 movslq (%rsp), %rax leaq (%rax,%rax,2), %rdi shlq $0x4, %rdi movq 0x18(%rsp), %rax addq 0x30(%rax), %rdi leaq 0x48(%rsp), %rsi movl 0x4(%rsp), %eax movl %eax, (%rsi) movq %r15, 0x8(%rsi) callq 0x180e0 xorl %ebx, %ebx movq 0x20(%rsp), %rdi testq %rdi, %rdi je 0x15d0c callq 0x42b0 movl %ebx, %eax addq $0x78, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0x15d21 jmp 0x15d21 movq %rax, %rbx jmp 0x15d33 movq %rax, %rbx leaq 0x48(%rsp), %rdi callq 0x1777e movq 0x20(%rsp), %rdi testq %rdi, %rdi je 0x15d42 callq 0x42b0 movq %rbx, %rdi callq 0x4500
/lyang1024[P]redbase/src/qo_manager.cc
QO_Manager::UseCondition(int, int, int)
bool QO_Manager::UseCondition(int relsJoined, int condIndex, int relIdx){ // If attributes on both sides, one of the attributes must fall within // the relation specified by relIdx, and the other must be in a relation // specified in relsJoined if(conds[condIndex].bRhsIsAttr){ int firstRel, secondRel; AttrToRelIndex(conds[condIndex].lhsAttr, firstRel); AttrToRelIndex(conds[condIndex].rhsAttr, secondRel); bool firstBitSet = IsBitSet(firstRel, relsJoined); bool secondBitSet = IsBitSet(secondRel, relsJoined); if(firstBitSet && secondRel == relIdx) return true; else if(secondBitSet && firstRel == relIdx) return true; else if(firstRel == relIdx && secondRel == relIdx) return true; } // If attr-value comparison, then the condition must be of the relation // specified by relIdx else{ int firstRel; AttrToRelIndex(conds[condIndex].lhsAttr, firstRel); if(firstRel == relIdx) return true; } return false; }
pushq %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x10, %rsp movl %ecx, %ebx movq %rdi, %r14 movq 0x28(%rdi), %rax movslq %edx, %rcx imulq $0x38, %rcx, %r12 cmpl $0x0, 0x14(%rax,%r12) je 0x161fd movl %esi, %ebp movq (%rax,%r12), %rsi movq 0x8(%rax,%r12), %rdx leaq 0xc(%rsp), %r15 movq %r14, %rdi movq %r15, %rcx callq 0x16e50 movq 0x28(%r14), %rax movq 0x18(%rax,%r12), %rsi movq 0x20(%rax,%r12), %rdx leaq 0x8(%rsp), %r12 movq %r14, %rdi movq %r12, %rcx callq 0x16e50 movl (%r15), %eax cmpl $0x21, %eax setae %sil movl $0x1, %edi movl %eax, %ecx shll %cl, %edi movl $0x1, %edx testl %ebp, %edi setne %dil orb %sil, %dil movl (%r12), %ecx cmpl %ebx, %ecx sete %sil testb %sil, %dil je 0x1621f movb $0x1, %al jmp 0x16243 movq (%rax,%r12), %rsi movq 0x8(%rax,%r12), %rdx leaq 0x4(%rsp), %r15 movq %r14, %rdi movq %r15, %rcx callq 0x16e50 movb $0x1, %al cmpl %ebx, (%r15) jne 0x16241 jmp 0x16243 cmpl %ebx, %ecx sete %sil cmpl $0x21, %ecx setae %dil shll %cl, %edx testl %ebp, %edx setne %cl cmpl %ebx, %eax jne 0x16241 orb %dil, %sil orb %cl, %sil movb $0x1, %al jne 0x16243 xorl %eax, %eax addq $0x10, %rsp popq %rbx popq %r12 popq %r14 popq %r15 popq %rbp retq
/lyang1024[P]redbase/src/qo_manager.cc
QO_Manager::ApplyLTCond(std::map<int, attrStat, std::less<int>, std::allocator<std::pair<int const, attrStat>>>&, int, float&)
RC QO_Manager::ApplyLTCond(map<int, attrStat> &attr_stats, int condIdx, float& numTuples){ RC rc = 0; // Retrieves the indices of the condition attributes int idx, idx2; if((rc = CondToAttrIdx(condIdx, idx, idx2))) return (rc); float frac = 0.0; if(conds[condIdx].bRhsIsAttr){ // calculate the "mid" value of the range of the two values float mid = 0.5*(min(attr_stats[idx].maxValue, attr_stats[idx2].maxValue) + max(attr_stats[idx].minValue, attr_stats[idx2].minValue)); // based on this mid value, calculate the estimated fraction of // tuples from each relation that passes the condition. float fracS = max(attr_stats[idx2].maxValue - mid + 1, (float)0.0) / (attr_stats[idx2].maxValue - attr_stats[idx2].minValue + 1); float fracR = max(mid - attr_stats[idx].minValue + 1, (float)0.0) / (attr_stats[idx].maxValue - attr_stats[idx].minValue + 1); // calculate the new maxR and minS values float newMaxR = min(attr_stats[idx].maxValue, attr_stats[idx2].maxValue); float newMinS = min(attr_stats[idx].minValue, attr_stats[idx2].minValue); // the number of tuples, based on fracS and fracR calculated above numTuples = numTuples * max(fracR, fracS); // update the join attribute stats attr_stats[idx].numTuples = attr_stats[idx].numTuples*(newMaxR - attr_stats[idx].minValue + 1)/ (attr_stats[idx].maxValue - attr_stats[idx].minValue + 1); attr_stats[idx2].numTuples = attr_stats[idx].numTuples*(attr_stats[idx2].maxValue - newMinS)/ (attr_stats[idx2].maxValue - attr_stats[idx2].minValue + 1); attr_stats[idx].maxValue = newMaxR; attr_stats[idx].minValue = newMinS; frac = max(fracR, fracS); } else{ float value; ConvertValueToFloat(condIdx, value); // get the max value // calculate the fraction of values expected to survive the condition. assume // that values for relation are evenly distributed float fracR = (value - attr_stats[idx].minValue + 1)/(attr_stats[idx].maxValue - attr_stats[idx].minValue + 2); // update values numTuples = numTuples*fracR; attr_stats[idx].numTuples = attr_stats[idx].numTuples * fracR; attr_stats[idx].maxValue = value; frac = fracR; } // Normalize non-join attributes NormalizeStats(attr_stats, frac, numTuples, idx, idx2); return (0); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x28, %rsp movq %rcx, %r14 movl %edx, %ebp movq %rsi, %rbx movq %rdi, %r15 leaq 0x1c(%rsp), %rdx leaq 0x20(%rsp), %rcx movl %ebp, %esi callq 0x17180 testl %eax, %eax jne 0x16890 movq 0x28(%r15), %rax movslq %ebp, %rcx imulq $0x38, %rcx, %rcx cmpl $0x0, 0x14(%rax,%rcx) je 0x1679a leaq 0x1c(%rsp), %r15 movq %rbx, %rdi movq %r15, %rsi callq 0x17502 movq %rax, %r13 leaq 0x20(%rsp), %r12 movq %rbx, %rdi movq %r12, %rsi callq 0x17502 movss 0x4(%rax), %xmm0 minss 0x4(%r13), %xmm0 movss %xmm0, 0xc(%rsp) movq %rbx, %rdi movq %r15, %rsi callq 0x17502 movq %rax, %r13 movq %rbx, %rdi movq %r12, %rsi callq 0x17502 movss 0x8(%rax), %xmm0 maxss 0x8(%r13), %xmm0 addss 0xc(%rsp), %xmm0 mulss 0x7272(%rip), %xmm0 # 0x1d74c movss %xmm0, 0x10(%rsp) movq %rbx, %rdi movq %r12, %rsi callq 0x17502 movss 0x4(%rax), %xmm0 subss 0x10(%rsp), %xmm0 addss 0x7242(%rip), %xmm0 # 0x1d740 xorps %xmm1, %xmm1 movss %xmm1, 0x14(%rsp) maxss %xmm0, %xmm1 movss %xmm1, 0xc(%rsp) movq %rbx, %rdi movq %r12, %rsi callq 0x17502 movss 0x4(%rax), %xmm0 movss %xmm0, 0x18(%rsp) movq %rbx, %rdi movq %r12, %rsi callq 0x17502 movss 0x18(%rsp), %xmm0 subss 0x8(%rax), %xmm0 addss 0x71fb(%rip), %xmm0 # 0x1d740 movaps %xmm0, %xmm1 movss 0xc(%rsp), %xmm0 divss %xmm1, %xmm0 movss %xmm0, 0xc(%rsp) movq %rbx, %rdi movq %r15, %rsi callq 0x17502 movss 0x10(%rsp), %xmm0 subss 0x8(%rax), %xmm0 addss 0x71ca(%rip), %xmm0 # 0x1d740 movaps %xmm0, %xmm1 movss 0x14(%rsp), %xmm0 maxss %xmm1, %xmm0 movss %xmm0, 0x14(%rsp) movq %rbx, %rdi movq %r15, %rsi callq 0x17502 movss 0x4(%rax), %xmm0 movss %xmm0, 0x10(%rsp) movq %rbx, %rdi movq %r15, %rsi callq 0x17502 movss 0x10(%rsp), %xmm0 subss 0x8(%rax), %xmm0 addss 0x7183(%rip), %xmm0 # 0x1d740 movss 0x14(%rsp), %xmm1 divss %xmm0, %xmm1 movss 0xc(%rsp), %xmm0 maxss %xmm1, %xmm0 movss %xmm0, 0xc(%rsp) movq %rbx, %rdi movq %r15, %rsi callq 0x17502 movq %rax, %r13 movq %rbx, %rdi movq %r12, %rsi callq 0x17502 movss 0x4(%rax), %xmm0 minss 0x4(%r13), %xmm0 movss %xmm0, 0x14(%rsp) movq %rbx, %rdi movq %r15, %rsi callq 0x17502 movq %rax, %r13 movq %rbx, %rdi movq %r12, %rsi callq 0x17502 movss 0x8(%rax), %xmm0 minss 0x8(%r13), %xmm0 movss %xmm0, 0x10(%rsp) movss 0xc(%rsp), %xmm0 mulss (%r14), %xmm0 movss %xmm0, (%r14) movq %rbx, %rdi movq %r15, %rsi callq 0x17502 movss (%rax), %xmm0 movss %xmm0, 0xc(%rsp) movq %rbx, %rdi movq %r15, %rsi callq 0x17502 movss 0x14(%rsp), %xmm0 subss 0x8(%rax), %xmm0 addss 0x70d2(%rip), %xmm0 # 0x1d740 mulss 0xc(%rsp), %xmm0 movss %xmm0, 0xc(%rsp) movq %rbx, %rdi movq %r15, %rsi callq 0x17502 movss 0x4(%rax), %xmm0 movss %xmm0, 0x18(%rsp) movq %rbx, %rdi movq %r15, %rsi callq 0x17502 movss 0x18(%rsp), %xmm0 subss 0x8(%rax), %xmm0 addss 0x7092(%rip), %xmm0 # 0x1d740 movaps %xmm0, %xmm1 movss 0xc(%rsp), %xmm0 divss %xmm1, %xmm0 movss %xmm0, 0xc(%rsp) movq %rbx, %rdi movq %r15, %rsi callq 0x17502 movss 0xc(%rsp), %xmm0 movss %xmm0, (%rax) movq %rbx, %rdi movq %r15, %rsi callq 0x17502 movss (%rax), %xmm0 movss %xmm0, 0xc(%rsp) movq %rbx, %rdi movq %r12, %rsi callq 0x17502 movss 0x4(%rax), %xmm0 subss 0x10(%rsp), %xmm0 mulss 0xc(%rsp), %xmm0 movss %xmm0, 0xc(%rsp) movq %rbx, %rdi movq %r12, %rsi callq 0x17502 movss 0x4(%rax), %xmm0 movss %xmm0, 0x18(%rsp) movq %rbx, %rdi movq %r12, %rsi callq 0x17502 movss 0x18(%rsp), %xmm0 subss 0x8(%rax), %xmm0 addss 0x6fff(%rip), %xmm0 # 0x1d740 movaps %xmm0, %xmm1 movss 0xc(%rsp), %xmm0 divss %xmm1, %xmm0 movss %xmm0, 0xc(%rsp) movq %rbx, %rdi movq %r12, %rsi callq 0x17502 movss 0xc(%rsp), %xmm0 movss %xmm0, (%rax) movq %rbx, %rdi movq %r15, %rsi callq 0x17502 movss 0x14(%rsp), %xmm0 movss %xmm0, 0x4(%rax) movq %rbx, %rdi movq %r15, %rsi callq 0x17502 movss 0x10(%rsp), %xmm0 movss %xmm0, 0x8(%rax) jmp 0x16879 leaq 0x24(%rsp), %r12 movq %r15, %rdi movl %ebp, %esi movq %r12, %rdx callq 0x171e4 movss (%r12), %xmm0 movss %xmm0, 0x14(%rsp) leaq 0x1c(%rsp), %r15 movq %rbx, %rdi movq %r15, %rsi callq 0x17502 movss 0x14(%rsp), %xmm0 subss 0x8(%rax), %xmm0 addss 0x6f65(%rip), %xmm0 # 0x1d740 movss %xmm0, 0xc(%rsp) movq %rbx, %rdi movq %r15, %rsi callq 0x17502 movss 0x4(%rax), %xmm0 movss %xmm0, 0x10(%rsp) movq %rbx, %rdi movq %r15, %rsi callq 0x17502 movss 0x10(%rsp), %xmm0 subss 0x8(%rax), %xmm0 addss 0x6f3b(%rip), %xmm0 # 0x1d750 movss 0xc(%rsp), %xmm1 divss %xmm0, %xmm1 movss %xmm1, 0xc(%rsp) movss (%r14), %xmm0 mulss %xmm1, %xmm0 movss %xmm0, (%r14) movq %rbx, %rdi movq %r15, %rsi callq 0x17502 movss 0xc(%rsp), %xmm0 mulss (%rax), %xmm0 movss %xmm0, 0xc(%rsp) movq %rbx, %rdi movq %r15, %rsi callq 0x17502 movss 0xc(%rsp), %xmm0 movss %xmm0, (%rax) movq %rbx, %rdi movq %r15, %rsi callq 0x17502 movss 0x14(%rsp), %xmm0 movss %xmm0, 0x4(%rax) movss (%r14), %xmm1 movl 0x1c(%rsp), %edx movl 0x20(%rsp), %ecx movq %rbx, %rsi callq 0x1726a xorl %eax, %eax addq $0x28, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq nop
/lyang1024[P]redbase/src/qo_manager.cc
yy_create_buffer(_IO_FILE*, int)
YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer( b, file ); return b; }
pushq %rbp pushq %r14 pushq %rbx movl %esi, %ebp movq %rdi, %rbx movl $0x40, %edi callq 0x43a0 testq %rax, %rax je 0x1a44c movq %rax, %r14 movl %ebp, 0x18(%rax) addl $0x2, %ebp movslq %ebp, %rdi callq 0x43a0 movq %rax, 0x8(%r14) testq %rax, %rax je 0x1a44c movl $0x1, 0x20(%r14) movq %r14, %rdi movq %rbx, %rsi callq 0x1a5ff movq %r14, %rax popq %rbx popq %r14 popq %rbp retq leaq 0x4186(%rip), %rdi # 0x1e5d9 callq 0x1a52b
/lyang1024[P]redbase/build_O1/scan.cpp
yy_scan_buffer(char*, unsigned long)
YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return NULL; b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = NULL; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer( b ); return b; }
pushq %r15 pushq %r14 pushq %rbx cmpq $0x2, %rsi jb 0x1a95d movq %rsi, %r14 movq %rdi, %r15 cmpb $0x0, -0x2(%rdi,%rsi) jne 0x1a95d cmpb $0x0, -0x1(%r15,%r14) je 0x1a968 xorl %ebx, %ebx movq %rbx, %rax popq %rbx popq %r14 popq %r15 retq movl $0x40, %edi callq 0x43a0 testq %rax, %rax je 0x1a9b6 movq %rax, %rbx addq $-0x2, %r14 movl %r14d, 0x18(%rax) movq %r15, 0x8(%rax) movq %r15, 0x10(%rax) movl $0x0, 0x20(%rax) xorl %eax, %eax movq %rax, (%rbx) movl %r14d, 0x1c(%rbx) movabsq $0x100000000, %rcx # imm = 0x100000000 movq %rcx, 0x24(%rbx) movq %rax, 0x34(%rbx) movq %rbx, %rdi callq 0x1a680 jmp 0x1a95f leaq 0x3c48(%rip), %rdi # 0x1e605 callq 0x1a52b
/lyang1024[P]redbase/build_O1/scan.cpp
RM_FileScan::OpenScan(RM_FileHandle const&, AttrType, int, int, CompOp, void*, ClientHint)
RC RM_FileScan::OpenScan (const RM_FileHandle &fileHandle, AttrType attrType, int attrLength, int attrOffset, CompOp compOp, void *value, ClientHint pinHint) { // If this is already associated with a scan, return immediately as an error if (openScan == true) return (RM_INVALIDSCAN); // Check that the fileHandle is valid if(fileHandle.isValidFileHeader()) this->fileHandle = const_cast<RM_FileHandle*>(&fileHandle); else return (RM_INVALIDFILE); this->value = NULL; // Set the comparator to the appropriate function this->compOp = compOp; switch(compOp){ case EQ_OP : comparator = &equal; break; case LT_OP : comparator = &less_than; break; case GT_OP : comparator = &greater_than; break; case LE_OP : comparator = &less_than_or_eq_to; break; case GE_OP : comparator = &greater_than_or_eq_to; break; case NE_OP : comparator = &not_equal; break; case NO_OP : comparator = NULL; break; default: return (RM_INVALIDSCAN); } int recSize = (this->fileHandle)->getRecordSize(); // If there is a comparison, update the comparison parameters. if(this->compOp != NO_OP){ // Check that the attribute offset and sizes are compatible with given // FileHandle if((attrOffset + attrLength) > recSize || attrOffset < 0 || attrOffset > MAXSTRINGLEN) return (RM_INVALIDSCAN); this->attrOffset = attrOffset; this->attrLength = attrLength; // Allocate the appropraite memory to store the value being compared if(attrType == FLOAT || attrType == INT){ if(attrLength != 4) return (RM_INVALIDSCAN); this->value = (void *) malloc(4); memcpy(this->value, value, 4); initializedValue = true; } else if(attrType == STRING){ this->value = (void *) malloc(attrLength); memcpy(this->value, value, attrLength); initializedValue = true; } else{ return (RM_INVALIDSCAN); } this->attrType = attrType; } // open the scan openScan = true; scanEnded = false; // set up scan parameters: numRecOnPage = 0; numSeenOnPage = 0; useNextPage = true; scanPage = 0; scanSlot = BEGIN_SCAN; numSeenOnPage = 0; hasPagePinned = false; return (0); }
cmpb $0x0, (%rdi) je 0x1bd69 movl $0x6c, %eax retq pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl %r9d, %r13d movl %r8d, %r15d movl %ecx, %r14d movl %edx, %ebp movq %rsi, %r12 movq %rdi, %rbx movq %rsi, %rdi callq 0x7cb0 movl %eax, %ecx movl $0x6a, %eax testb %cl, %cl je 0x1be6b movq %r12, 0x8(%rbx) movq $0x0, 0x20(%rbx) movl %r13d, 0x2c(%rbx) cmpl $0x6, %r13d ja 0x1be16 movl %r13d, %eax leaq 0xcd9c(%rip), %rcx # 0x28b58 movq (%rcx,%rax,8), %rax movq %rax, 0x10(%rbx) movq %r12, %rdi callq 0x7ce2 cmpl $0x0, 0x2c(%rbx) je 0x1be46 cmpl $0xff, %r15d ja 0x1be16 leal (%r15,%r14), %ecx cmpl %eax, %ecx jg 0x1be16 movq 0x40(%rsp), %r12 movl %r15d, 0x18(%rbx) movl %r14d, 0x1c(%rbx) movl $0x6c, %eax cmpl $0x1, %ebp ja 0x1be1d cmpl $0x4, %r14d jne 0x1be6b movl $0x4, %edi callq 0x43a0 movq %rax, 0x20(%rbx) movl (%r12), %ecx movl %ecx, (%rax) jmp 0x1be3f movl $0x6c, %eax jmp 0x1be6b cmpl $0x2, %ebp jne 0x1be6b movslq %r14d, %r14 movq %r14, %rdi callq 0x43a0 movq %rax, 0x20(%rbx) movq %rax, %rdi movq %r12, %rsi movq %r14, %rdx callq 0x4260 movb $0x1, 0x5a(%rbx) movl %ebp, 0x28(%rbx) movb $0x1, (%rbx) movb $0x0, 0x30(%rbx) movq $0x0, 0x50(%rbx) movw $0x1, 0x58(%rbx) movabsq $-0x100000000, %rax # imm = 0xFFFFFFFF00000000 movq %rax, 0x34(%rbx) xorl %eax, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/lyang1024[P]redbase/src/rm_filescan.cc
RM_FileScan::GetNextRec(RM_Record&)
RC RM_FileScan::GetNextRec(RM_Record &rec) { // If the scan has ended, or is not valid, return immediately if(scanEnded == true) return (RM_EOF); if(openScan == false) return (RM_INVALIDSCAN); hasPagePinned = true; RC rc; while(true){ // Retrieve next record RM_Record temprec; if((rc=fileHandle->GetNextRecord(scanPage, scanSlot, temprec, currentPH, useNextPage))){ if(rc == RM_EOF){ hasPagePinned = false; scanEnded = true; } return (rc); } hasPagePinned = true; // If we retrieved a record on the next page, reset numRecOnPage to // reflect the number of records seen on this new current page if(useNextPage){ GetNumRecOnPage(currentPH, numRecOnPage); useNextPage = false; numSeenOnPage = 0; if(numRecOnPage == 1) currentPH.GetPageNum(scanPage); } numSeenOnPage++; // update # of records seen on this page // If we've seen all the record on this page, then next time, we // need to look on the next page, not this page, so unpin the page // and set the indicator (useNextPage) if(numRecOnPage == numSeenOnPage){ useNextPage = true; //printf("unpin page in filescan\n"); if(rc = fileHandle->pfh.UnpinPage(scanPage)){ return (rc); } hasPagePinned = false; } // Retrieves the RID of the scan to update the progress of the scan RID rid; temprec.GetRid(rid); rid.GetPageNum(scanPage); rid.GetSlotNum(scanSlot); // Check to see if it satisfies the scan comparison, and if it does, // exit the function, returning the record. char *pData; if((rc = temprec.GetData(pData))){ return (rc); } if(compOp != NO_OP){ bool satisfies = (* comparator)(pData + attrOffset, this->value, attrType, attrLength); if(satisfies){ rec = temprec; break; } } else{ rec = temprec; // if no comparison, just return the record break; } } return (0); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x48, %rsp movl $0x6e, %r12d cmpb $0x0, 0x30(%rdi) jne 0x1c090 movq %rdi, %r14 cmpb $0x0, (%rdi) je 0x1c08a movq %rsi, 0x10(%rsp) movb $0x1, 0x59(%r14) leaq 0x34(%r14), %rax movq %rax, 0x18(%rsp) leaq 0x38(%r14), %rax movq %rax, 0x28(%rsp) leaq 0x40(%r14), %r13 leaq 0x30(%rsp), %rbp movl %r12d, %r15d movq %rbp, %rdi callq 0x7d24 movq 0x8(%r14), %rdi movl 0x34(%r14), %esi movl 0x38(%r14), %edx movzbl 0x58(%r14), %r9d movq %rbp, %rcx movq %r13, %r8 callq 0x7a94 movl %eax, %r12d movl $0x1, %ebx testl %eax, %eax je 0x1bf43 cmpl $0x6e, %r12d jne 0x1c020 movb $0x0, 0x59(%r14) movb $0x1, 0x30(%r14) jmp 0x1c020 movb $0x1, 0x59(%r14) cmpb $0x1, 0x58(%r14) jne 0x1bf96 movq 0x8(%r14), %rdi movq %r13, %rsi leaq 0x20(%rsp), %rdx leaq 0x8(%rsp), %rcx callq 0x72de testl %eax, %eax jne 0x1bf75 movq 0x8(%rsp), %rax movl 0x4(%rax), %eax movl %eax, 0x50(%r14) movb $0x0, 0x58(%r14) movl $0x0, 0x54(%r14) cmpl $0x1, 0x50(%r14) jne 0x1bf96 movq %r13, %rdi movq 0x18(%rsp), %rsi callq 0x1c7d0 movl 0x50(%r14), %eax movl 0x54(%r14), %ecx incl %ecx movl %ecx, 0x54(%r14) cmpl %ecx, %eax jne 0x1bfca movb $0x1, 0x58(%r14) movq 0x8(%r14), %rdi addq $0x20, %rdi movl 0x34(%r14), %esi callq 0x60d2 movl %eax, %r12d testl %eax, %eax jne 0x1c020 movb $0x0, 0x59(%r14) leaq 0x20(%rsp), %r12 movq %r12, %rdi callq 0x7e80 movq %rbp, %rdi movq %r12, %rsi callq 0x7dd4 movq %r12, %rdi movq 0x18(%rsp), %rsi callq 0x7eb4 movq %r12, %rdi movq 0x28(%rsp), %rsi callq 0x7ebc movq %rbp, %rdi leaq 0x8(%rsp), %rsi callq 0x7dba testl %eax, %eax je 0x1c032 movl $0x1, %ebx movl %eax, %r15d movq %r12, %rdi callq 0x7e8e movl %r15d, %r12d movq %rbp, %rdi callq 0x7d3e testl %ebx, %ebx je 0x1bef7 jmp 0x1c080 cmpl $0x0, 0x2c(%r14) je 0x1c06c movslq 0x18(%r14), %rdi addq 0x8(%rsp), %rdi movq 0x20(%r14), %rsi movl 0x28(%r14), %edx movl 0x1c(%r14), %ecx callq *0x10(%r14) xorl %ebx, %ebx testb %al, %al je 0x1c015 movl $0x3, %ebx movq 0x10(%rsp), %rdi movq %rbp, %rsi callq 0x7d5a jmp 0x1c015 movl $0x3, %ebx movq 0x10(%rsp), %rdi movq %rbp, %rsi callq 0x7d5a jmp 0x1c015 cmpl $0x3, %ebx jne 0x1c090 xorl %r12d, %r12d jmp 0x1c090 movl $0x6c, %r12d movl %r12d, %eax addq $0x48, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0x1c0a8 jmp 0x1c0b7 jmp 0x1c0a8 movq %rax, %rbx leaq 0x20(%rsp), %rdi callq 0x7e8e jmp 0x1c0ba movq %rax, %rbx leaq 0x30(%rsp), %rdi callq 0x7d3e movq %rbx, %rdi callq 0x4500
/lyang1024[P]redbase/src/rm_filescan.cc
lcp<dna_bwt<dna_string>, unsigned short>::lcp(dna_bwt<dna_string>*)
lcp(bwt_t * bwt){ this->bwt; n = bwt->size(); LCP = vector<lcp_int_t>(n, nil); LCP[0] = 0; /* * FIRST PASS: LEAVES NAVIGATION. COMPUTE LCP VALUES INSIDE SUFFIX TREE LEAVES. */ cout << "\nNow navigating suffix tree leaves of size >= 2 to compute internal LCP values." << endl; uint64_t m = 0;//portion of text covered by visited leaves uint64_t leaves = 0;//number of visited leaves uint64_t max_stack = 0; uint64_t lcp_values = 1;//number of filled LCP values { auto TMP_LEAVES = vector<sa_leaf>(5); stack<sa_leaf> S; sa_leaf root = bwt->first_leaf(); S.push(root); int last_perc = -1; int perc = 0; while(not S.empty()){ sa_leaf L = S.top(); S.pop(); leaves++; max_stack = S.size() > max_stack ? S.size() : max_stack; assert(L.rn.second > L.rn.first); for(uint64_t i = L.rn.first+1; i<L.rn.second; ++i){ assert(LCP[i]==nil); LCP[i] = L.depth; lcp_values++; m++; } m++; assert(m<=n); int t = 0; bwt->next_leaves(L, TMP_LEAVES, t, 2); for(int i=t-1;i>=0;--i) S.push(TMP_LEAVES[i]); perc = (100*lcp_values)/n; if(perc > last_perc){ cout << "LCP: " << perc << "%." << endl; last_perc = perc; } } } cout << "Visited leaves cover " << m << "/" << n << " input characters." << endl; cout << "Computed " << lcp_values << "/" << n << " LCP values." << endl; cout << "Max stack size = " << max_stack << endl; cout << "Processed " << leaves << " suffix-tree leaves of size >= 2." << endl; cout << "\nNow navigating suffix tree nodes to compute remaining LCP values." << endl; { auto TMP_NODES = vector<typename bwt_t::sa_node_t>(5); uint64_t nodes = 0;//visited ST nodes max_stack = 0; stack<typename bwt_t::sa_node_t> S; typename bwt_t::sa_node_t root = bwt->root(); S.push(root); int last_perc = -1; int perc = 0; while(not S.empty()){ max_stack = S.size() > max_stack ? S.size() : max_stack; typename bwt_t::sa_node_t N = S.top(); S.pop(); nodes++; update_lcp<lcp_int_t>(N,LCP,lcp_values); int t = 0; bwt->next_nodes(N, TMP_NODES, t); for(int i=t-1;i>=0;--i){ S.push(TMP_NODES[i]); } perc = (100*lcp_values)/n; if(perc > last_perc){ cout << "LCP: " << perc << "%." << endl; last_perc = perc; } } cout << "Computed " << lcp_values << "/" << n << " LCP values." << endl; cout << "Max stack size = " << max_stack << endl; cout << "Processed " << nodes << " suffix-tree nodes." << endl; } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x108, %rsp # imm = 0x108 movq %rdi, %rbp xorps %xmm0, %xmm0 movups %xmm0, 0x10(%rdi) andq $0x0, 0x20(%rdi) movups %xmm0, (%rdi) orw $-0x1, 0x28(%rdi) leaq 0x28(%rdi), %rdx movq %rsi, 0x20(%rsp) movq 0x8(%rsi), %rsi movq %rsi, 0x18(%rdi) leaq 0x48(%rsp), %rdi leaq 0x98(%rsp), %rcx callq 0x1203e leaq 0x48(%rsp), %r14 movq %rbp, %rdi movq %r14, %rsi callq 0x121e8 movq %r14, %rdi callq 0xee36 movq (%rbp), %rax andw $0x0, (%rax) movq 0x1022e(%rip), %rdi # 0x1bfd8 leaq 0xa6bc(%rip), %rsi # 0x1646d callq 0xa120 movq %rax, %rdi callq 0xa090 movq $0x1, 0x10(%rsp) leaq 0x98(%rsp), %rdi pushq $0x5 popq %rsi leaq 0x48(%rsp), %rdx callq 0xfa18 leaq 0x48(%rsp), %rdi callq 0xfa6a movq %rbp, 0x18(%rsp) leaq 0xd0(%rsp), %rsi andq $0x0, (%rsi) movq 0x20(%rsp), %rax movq 0x10(%rax), %rax movq %rax, 0x8(%rsi) andq $0x0, 0x10(%rsi) leaq 0x48(%rsp), %rdi callq 0x1023e pushq $-0x1 popq %rbx xorl %r13d, %r13d leaq 0x48(%rsp), %rbp xorl %r15d, %r15d movq $0x0, 0x28(%rsp) movq 0x78(%rsp), %rax cmpq 0x58(%rsp), %rax je 0xbf76 cmpq 0x80(%rsp), %rax jne 0xbe58 movq 0x90(%rsp), %rax movq -0x8(%rax), %rax movl $0x1f8, %ecx # imm = 0x1F8 addq %rcx, %rax movq -0x8(%rax), %rcx movq %rcx, 0x40(%rsp) movups -0x18(%rax), %xmm0 movaps %xmm0, 0x30(%rsp) movq %rbp, %rdi callq 0x10480 movq %rbp, %rdi callq 0x102ec cmpq 0x28(%rsp), %rax jbe 0xbe8e movq %rbp, %rdi callq 0x102ec movq %rax, 0x28(%rsp) incq %r15 movq 0x30(%rsp), %rax movq 0x38(%rsp), %rcx movq 0x10(%rsp), %rdx movzwl 0x40(%rsp), %esi movq 0x18(%rsp), %rdi movq (%rdi), %rdi incq %rdx incq %r13 incq %rax cmpq %rcx, %rax jae 0xbec6 movw %si, (%rdi,%rax,2) movq %rdx, 0x10(%rsp) jmp 0xbead andl $0x0, 0xc(%rsp) movq 0x20(%rsp), %rdi leaq 0x30(%rsp), %rsi leaq 0x98(%rsp), %rdx leaq 0xc(%rsp), %rcx pushq $0x2 popq %r8 callq 0xfa86 movl 0xc(%rsp), %eax leal 0x1(%rax), %r14d imulq $0x18, %rax, %rsi addq $-0x18, %rsi decl %r14d testl %r14d, %r14d jle 0xbf1c leaq -0x18(%rsi), %r12 addq 0x98(%rsp), %rsi movq %rbp, %rdi callq 0x1023e movq %r12, %rsi jmp 0xbefb imulq $0x64, 0x10(%rsp), %rax xorl %edx, %edx movq 0x18(%rsp), %rcx divq 0x18(%rcx) movq %rax, %r14 cmpl %r14d, %ebx jge 0xbe2a movq 0x10098(%rip), %rdi # 0x1bfd8 leaq 0xa576(%rip), %rsi # 0x164bd callq 0xa120 movq %rax, %rdi movl %r14d, %esi callq 0xa240 movq %rax, %rdi leaq 0xa562(%rip), %rsi # 0x164c3 callq 0xa120 movq %rax, %rdi callq 0xa090 movl %r14d, %ebx jmp 0xbe2a leaq 0x48(%rsp), %rdi callq 0x10f2e leaq 0x98(%rsp), %rdi callq 0xffd0 movq 0x10044(%rip), %rdi # 0x1bfd8 leaq 0xa52b(%rip), %rsi # 0x164c6 movq 0x18(%rsp), %rbp callq 0xa120 movq %rax, %rdi movq %r13, %rsi callq 0xa0c0 leaq 0xa525(%rip), %rsi # 0x164dc movq %rax, %rdi callq 0xa120 movq 0x18(%rbp), %rsi movq %rax, %rdi callq 0xa0c0 leaq 0xa50c(%rip), %rsi # 0x164de movq %rax, %rdi callq 0xa120 movq %rax, %rdi callq 0xa090 movq 0xffef(%rip), %rdi # 0x1bfd8 leaq 0xa501(%rip), %rsi # 0x164f1 callq 0xa120 movq 0x10(%rsp), %rsi movq %rax, %rdi callq 0xa0c0 leaq 0xa4d3(%rip), %rsi # 0x164dc movq %rax, %rdi callq 0xa120 movq 0x18(%rbp), %rsi movq %rax, %rdi callq 0xa0c0 leaq 0xa54c(%rip), %rsi # 0x16570 movq %rax, %rdi callq 0xa120 movq %rax, %rdi callq 0xa090 movq 0xff9d(%rip), %rdi # 0x1bfd8 leaq 0xa4b9(%rip), %rsi # 0x164fb callq 0xa120 movq %rax, %rdi movq 0x28(%rsp), %rsi callq 0xa0c0 movq %rax, %rdi callq 0xa090 movq 0xff75(%rip), %rdi # 0x1bfd8 leaq 0xa4a3(%rip), %rsi # 0x1650d callq 0xa120 movq %rax, %rdi movq %r15, %rsi callq 0xa0c0 leaq 0xa497(%rip), %rsi # 0x16518 movq %rax, %rdi callq 0xa120 movq %rax, %rdi callq 0xa090 movq 0xff40(%rip), %rdi # 0x1bfd8 leaq 0xa49b(%rip), %rsi # 0x1653a callq 0xa120 movq %rax, %rdi callq 0xa090 leaq 0x30(%rsp), %rdi pushq $0x5 popq %rsi leaq 0x48(%rsp), %rdx callq 0xfbba leaq 0x48(%rsp), %rdi callq 0xfc0c leaq 0x98(%rsp), %rsi andq $0x0, (%rsi) movq 0x20(%rsp), %rax movups 0x10(%rax), %xmm0 movups %xmm0, 0x8(%rsi) movups 0x20(%rax), %xmm0 movups %xmm0, 0x18(%rsi) movq 0x8(%rax), %rax movq %rax, 0x28(%rsi) andq $0x0, 0x30(%rsi) leaq 0x48(%rsp), %rdi callq 0x1124a pushq $-0x1 popq %rbx xorl %r12d, %r12d leaq 0x48(%rsp), %r13 xorl %r15d, %r15d movq 0x78(%rsp), %rax cmpq 0x58(%rsp), %rax je 0xc250 movq %r13, %rdi callq 0x1131a cmpq %r12, %rax jbe 0xc136 movq %r13, %rdi callq 0x1131a movq %rax, %r12 movq 0x78(%rsp), %rax cmpq 0x80(%rsp), %rax jne 0xc159 movq 0x90(%rsp), %rax movq -0x8(%rax), %rax movl $0x1f8, %ecx # imm = 0x1F8 addq %rcx, %rax movq -0x8(%rax), %rcx movq %rcx, 0x100(%rsp) movups -0x38(%rax), %xmm0 movups -0x28(%rax), %xmm1 movups -0x18(%rax), %xmm2 movaps %xmm2, 0xf0(%rsp) movaps %xmm1, 0xe0(%rsp) movaps %xmm0, 0xd0(%rsp) movq %r13, %rdi callq 0x114ae leaq 0xd0(%rsp), %r14 movq %r14, %rdi movq %rbp, %rsi leaq 0x10(%rsp), %rdx callq 0x12094 andl $0x0, 0xc(%rsp) movq 0x20(%rsp), %rdi movq %r14, %rsi leaq 0x30(%rsp), %rdx leaq 0xc(%rsp), %rcx callq 0xfcc2 incq %r15 movl 0xc(%rsp), %eax leal 0x1(%rax), %r14d imulq $0x38, %rax, %rsi addq $-0x38, %rsi decl %r14d testl %r14d, %r14d jle 0xc1f6 leaq -0x38(%rsi), %rbp addq 0x30(%rsp), %rsi movq %r13, %rdi callq 0x1124a movq %rbp, %rsi jmp 0xc1d8 imulq $0x64, 0x10(%rsp), %rax xorl %edx, %edx movq 0x18(%rsp), %rbp divq 0x18(%rbp) movq %rax, %r14 cmpl %r14d, %ebx jge 0xc10e movq 0xfdbe(%rip), %rdi # 0x1bfd8 leaq 0xa29c(%rip), %rsi # 0x164bd callq 0xa120 movq %rax, %rdi movl %r14d, %esi callq 0xa240 movq %rax, %rdi leaq 0xa288(%rip), %rsi # 0x164c3 callq 0xa120 movq %rax, %rdi callq 0xa090 movl %r14d, %ebx jmp 0xc10e movq 0xfd81(%rip), %rdi # 0x1bfd8 leaq 0xa293(%rip), %rsi # 0x164f1 callq 0xa120 movq 0x10(%rsp), %rsi movq %rax, %rdi callq 0xa0c0 leaq 0xa265(%rip), %rsi # 0x164dc movq %rax, %rdi callq 0xa120 movq 0x18(%rbp), %rsi movq %rax, %rdi callq 0xa0c0 leaq 0xa2de(%rip), %rsi # 0x16570 movq %rax, %rdi callq 0xa120 movq %rax, %rdi callq 0xa090 movq 0xfd2f(%rip), %rdi # 0x1bfd8 leaq 0xa24b(%rip), %rsi # 0x164fb callq 0xa120 movq %rax, %rdi movq %r12, %rsi callq 0xa0c0 movq %rax, %rdi callq 0xa090 movq 0xfd09(%rip), %rdi # 0x1bfd8 leaq 0xa237(%rip), %rsi # 0x1650d callq 0xa120 movq %rax, %rdi movq %r15, %rsi callq 0xa0c0 leaq 0xa290(%rip), %rsi # 0x1657d movq %rax, %rdi callq 0xa120 movq %rax, %rdi callq 0xa090 leaq 0x48(%rsp), %rdi callq 0x12018 leaq 0x30(%rsp), %rdi callq 0x10f86 addq $0x108, %rsp # imm = 0x108 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0xc340 movq %rax, %r14 jmp 0xc359 jmp 0xc33b jmp 0xc365 movq %rax, %r14 jmp 0xc377 jmp 0xc33b jmp 0xc33b jmp 0xc33b jmp 0xc340 movq %rax, %r14 jmp 0xc384 movq %rax, %r14 jmp 0xc34f jmp 0xc365 movq %rax, %r14 movq 0x18(%rsp), %rbp leaq 0x48(%rsp), %rdi callq 0x12018 leaq 0x30(%rsp), %rdi callq 0x10f86 jmp 0xc384 movq %rax, %r14 leaq 0x48(%rsp), %rdi callq 0x10f2e movq 0x18(%rsp), %rbp leaq 0x98(%rsp), %rdi callq 0xffd0 movq %rbp, %rdi callq 0xee36 movq %r14, %rdi callq 0xa260
/nicolaprezza[P]bwt2lcp/internal/lcp.hpp
void update_lcp<unsigned long>(sa_node_n&, std::vector<unsigned long, std::allocator<unsigned long>>&, unsigned long&)
void update_lcp(sa_node_n & x, vector<lcp_int_t> & LCP, uint64_t & lcp_values){ assert(x.first_A >= x.first_TERM); assert(x.first_C >= x.first_A); assert(x.first_G >= x.first_C); assert(x.first_N >= x.first_G); assert(x.first_T >= x.first_N); assert(number_of_children(x) >= 2); lcp_int_t nil = ~lcp_int_t(0); if(has_child_TERM(x) and x.first_A != x.last){ assert(LCP[x.first_A]==nil); LCP[x.first_A] = x.depth; lcp_values++; } if(has_child_A(x) and x.first_C != x.last){ assert(LCP[x.first_C]==nil); LCP[x.first_C] = x.depth; lcp_values++; } if(has_child_C(x) and x.first_G != x.last){ assert(LCP[x.first_G]==nil); LCP[x.first_G] = x.depth; lcp_values++; } if(has_child_G(x) and x.first_N != x.last){ assert(LCP[x.first_N]==nil); LCP[x.first_N] = x.depth; lcp_values++; } if(has_child_N(x) and x.first_T != x.last){ assert(LCP[x.first_T]==nil); LCP[x.first_T] = x.depth; lcp_values++; } }
movq 0x8(%rdi), %rcx cmpq (%rdi), %rcx setbe %r8b movq 0x30(%rdi), %rax cmpq %rax, %rcx sete %r9b orb %r8b, %r9b jne 0x156a0 movq 0x38(%rdi), %rax movq (%rsi), %r8 movq %rax, (%r8,%rcx,8) incq (%rdx) movq 0x8(%rdi), %rcx movq 0x30(%rdi), %rax movq 0x10(%rdi), %r8 cmpq %rcx, %r8 setbe %cl cmpq %rax, %r8 sete %r9b orb %cl, %r9b jne 0x156cc movq 0x38(%rdi), %rax movq (%rsi), %rcx movq %rax, (%rcx,%r8,8) incq (%rdx) movq 0x10(%rdi), %r8 movq 0x30(%rdi), %rax movq 0x18(%rdi), %rcx cmpq %r8, %rcx jbe 0x156f0 cmpq %rax, %rcx je 0x156f0 movq 0x38(%rdi), %rax movq (%rsi), %r8 movq %rax, (%r8,%rcx,8) incq (%rdx) movq 0x18(%rdi), %rcx movq 0x30(%rdi), %rax movq 0x20(%rdi), %r8 cmpq %rcx, %r8 jbe 0x15714 cmpq %rax, %r8 je 0x15714 movq 0x38(%rdi), %rax movq (%rsi), %rcx movq %rax, (%rcx,%r8,8) incq (%rdx) movq 0x20(%rdi), %r8 movq 0x30(%rdi), %rax movq 0x28(%rdi), %rcx cmpq %r8, %rcx jbe 0x15730 cmpq %rax, %rcx je 0x15730 movq 0x38(%rdi), %rax movq (%rsi), %rsi movq %rax, (%rsi,%rcx,8) incq (%rdx) retq
/nicolaprezza[P]bwt2lcp/internal/include.hpp
Fir1::Fir1(unsigned int, double)
Fir1::Fir1(unsigned number_of_taps, double value) : coefficients(new double[number_of_taps]), buffer(new double[number_of_taps]), taps(number_of_taps) { for(unsigned int i=0;i<number_of_taps;i++) { coefficients[i] = value; buffer[i] = 0; } }
pushq %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x10, %rsp movq %xmm0, 0x8(%rsp) movl %esi, %ebp movq %rdi, %r15 movl %esi, %r12d leaq (,%r12,8), %r14 movq %r14, %rdi callq 0x2030 movq %rax, %rbx movq %rax, (%r15) movq %r14, %rdi callq 0x2030 movq %rax, 0x8(%r15) movl %ebp, 0x10(%r15) movl $0x0, 0x14(%r15) movq $0x0, 0x18(%r15) testl %ebp, %ebp je 0x2b3d xorl %r15d, %r15d movq %rax, %rdi xorl %esi, %esi movq %r14, %rdx callq 0x20f0 movsd 0x8(%rsp), %xmm8 leaq -0x1(%r12), %rax movq %rax, %xmm0 pshufd $0x44, %xmm0, %xmm0 # xmm0 = xmm0[0,1,0,1] leaq 0x8(,%r12,8), %rax andq $-0x10, %rax movdqa 0x1764(%rip), %xmm1 # 0x4230 movdqa 0x176c(%rip), %xmm2 # 0x4240 pxor %xmm2, %xmm0 pcmpeqd %xmm3, %xmm3 movdqa 0x176c(%rip), %xmm4 # 0x4250 movdqa %xmm1, %xmm5 pxor %xmm2, %xmm5 movdqa %xmm5, %xmm6 pcmpgtd %xmm0, %xmm6 pcmpeqd %xmm0, %xmm5 pshufd $0xf5, %xmm5, %xmm7 # xmm7 = xmm5[1,1,3,3] pand %xmm6, %xmm7 pshufd $0xf5, %xmm6, %xmm5 # xmm5 = xmm6[1,1,3,3] por %xmm7, %xmm5 movd %xmm5, %ecx notl %ecx testb $0x1, %cl je 0x2b1b movsd %xmm8, (%rbx,%r15) pxor %xmm3, %xmm5 pextrw $0x4, %xmm5, %ecx testb $0x1, %cl je 0x2b30 movsd %xmm8, 0x8(%rbx,%r15) paddq %xmm4, %xmm1 addq $0x10, %r15 cmpq %r15, %rax jne 0x2ae4 addq $0x10, %rsp popq %rbx popq %r12 popq %r14 popq %r15 popq %rbp retq
/berndporr[P]fir1/Fir1.cpp
Fir1::setCoeff(double const*, unsigned int)
void Fir1::setCoeff(const double* coeff_data, const unsigned number_of_taps) { if (number_of_taps != taps) { throw std::runtime_error("Invalid number of taps in new coefficient array"); } for (unsigned int i = 0; i < number_of_taps; i++) { coefficients[i] = coeff_data[i]; } }
pushq %r14 pushq %rbx pushq %rax cmpl %edx, 0x10(%rdi) jne 0x2e74 testl %edx, %edx je 0x2e6c movq (%rdi), %rax movl %edx, %ecx xorl %edx, %edx movsd (%rsi,%rdx,8), %xmm0 movsd %xmm0, (%rax,%rdx,8) incq %rdx cmpq %rdx, %rcx jne 0x2e5a addq $0x8, %rsp popq %rbx popq %r14 retq movl $0x10, %edi callq 0x20d0 movq %rax, %rbx leaq 0x1431(%rip), %rsi # 0x42b9 movq %rax, %rdi callq 0x20a0 movq 0x3159(%rip), %rsi # 0x5ff0 movq 0x3102(%rip), %rdx # 0x5fa0 movq %rbx, %rdi callq 0x2250 movq %rax, %r14 movq %rbx, %rdi callq 0x2120 movq %r14, %rdi callq 0x2260 nop
/berndporr[P]fir1/Fir1.cpp
nk_subimage_id
NK_API struct nk_image nk_subimage_id(int id, unsigned short w, unsigned short h, struct nk_rect r) { struct nk_image s; nk_zero(&s, sizeof(s)); s.handle.id = id; s.w = w; s.h = h; s.region[0] = (unsigned short)r.x; s.region[1] = (unsigned short)r.y; s.region[2] = (unsigned short)r.w; s.region[3] = (unsigned short)r.h; return s; }
pushq %rbp movq %rsp, %rbp subq $0x30, %rsp movq %rdi, -0x28(%rbp) movw %cx, %ax movw %dx, %cx movq %rdi, %rdx movq %rdx, -0x20(%rbp) movlpd %xmm0, -0x10(%rbp) movlpd %xmm1, -0x8(%rbp) movl %esi, -0x14(%rbp) movw %cx, -0x16(%rbp) movw %ax, -0x18(%rbp) movl $0x18, %esi callq 0x1f6c0 movq -0x28(%rbp), %rdi movq -0x20(%rbp), %rax movl -0x14(%rbp), %ecx movl %ecx, (%rdi) movw -0x16(%rbp), %cx movw %cx, 0x8(%rdi) movw -0x18(%rbp), %cx movw %cx, 0xa(%rdi) cvttss2si -0x10(%rbp), %ecx movw %cx, 0xc(%rdi) cvttss2si -0xc(%rbp), %ecx movw %cx, 0xe(%rdi) cvttss2si -0x8(%rbp), %ecx movw %cx, 0x10(%rdi) cvttss2si -0x4(%rbp), %ecx movw %cx, 0x12(%rdi) addq $0x30, %rsp popq %rbp retq nop
/Tigermouthbear[P]flappytiger/external/glfw/deps/nuklear.h
nk_subimage_handle
NK_API struct nk_image nk_subimage_handle(nk_handle handle, unsigned short w, unsigned short h, struct nk_rect r) { struct nk_image s; nk_zero(&s, sizeof(s)); s.handle = handle; s.w = w; s.h = h; s.region[0] = (unsigned short)r.x; s.region[1] = (unsigned short)r.y; s.region[2] = (unsigned short)r.w; s.region[3] = (unsigned short)r.h; return s; }
pushq %rbp movq %rsp, %rbp subq $0x30, %rsp movq %rdi, -0x30(%rbp) movw %cx, %ax movw %dx, %cx movq %rdi, %rdx movq %rdx, -0x28(%rbp) movq %rsi, -0x8(%rbp) movlpd %xmm0, -0x18(%rbp) movlpd %xmm1, -0x10(%rbp) movw %cx, -0x1a(%rbp) movw %ax, -0x1c(%rbp) movl $0x18, %esi callq 0x1f6c0 movq -0x30(%rbp), %rdi movq -0x28(%rbp), %rax movq -0x8(%rbp), %rcx movq %rcx, (%rdi) movw -0x1a(%rbp), %cx movw %cx, 0x8(%rdi) movw -0x1c(%rbp), %cx movw %cx, 0xa(%rdi) cvttss2si -0x18(%rbp), %ecx movw %cx, 0xc(%rdi) cvttss2si -0x14(%rbp), %ecx movw %cx, 0xe(%rdi) cvttss2si -0x10(%rbp), %ecx movw %cx, 0x10(%rdi) cvttss2si -0xc(%rbp), %ecx movw %cx, 0x12(%rdi) addq $0x30, %rsp popq %rbp retq nopw %cs:(%rax,%rax)
/Tigermouthbear[P]flappytiger/external/glfw/deps/nuklear.h
nk_button_image_styled
NK_API int nk_button_image_styled(struct nk_context *ctx, const struct nk_style_button *style, struct nk_image img) { struct nk_window *win; struct nk_panel *layout; const struct nk_input *in; struct nk_rect bounds; enum nk_widget_layout_states state; NK_ASSERT(ctx); NK_ASSERT(ctx->current); NK_ASSERT(ctx->current->layout); if (!ctx || !ctx->current || !ctx->current->layout) return 0; win = ctx->current; layout = win->layout; state = nk_widget(&bounds, ctx); if (!state) return 0; in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; return nk_do_button_image(&ctx->last_widget_state, &win->buffer, bounds, img, ctx->button_behavior, style, in); }
pushq %rbp movq %rsp, %rbp subq $0x70, %rsp leaq 0x10(%rbp), %rax movq %rax, -0x50(%rbp) movq %rdi, -0x10(%rbp) movq %rsi, -0x18(%rbp) cmpq $0x0, -0x10(%rbp) je 0x44711 jmp 0x44730 leaq 0x4ca3a(%rip), %rdi # 0x91152 leaq 0x487e1(%rip), %rsi # 0x8cf00 movl $0x4e27, %edx # imm = 0x4E27 leaq 0x4d25d(%rip), %rcx # 0x91988 callq 0x1b1e0 movq -0x10(%rbp), %rax cmpq $0x0, 0x40d8(%rax) je 0x44740 jmp 0x4475f leaq 0x4b5ac(%rip), %rdi # 0x8fcf3 leaq 0x487b2(%rip), %rsi # 0x8cf00 movl $0x4e28, %edx # imm = 0x4E28 leaq 0x4d22e(%rip), %rcx # 0x91988 callq 0x1b1e0 movq -0x10(%rbp), %rax movq 0x40d8(%rax), %rax cmpq $0x0, 0xa8(%rax) je 0x44776 jmp 0x44795 leaq 0x4b6f2(%rip), %rdi # 0x8fe6f leaq 0x4877c(%rip), %rsi # 0x8cf00 movl $0x4e29, %edx # imm = 0x4E29 leaq 0x4d1f8(%rip), %rcx # 0x91988 callq 0x1b1e0 cmpq $0x0, -0x10(%rbp) je 0x447bf movq -0x10(%rbp), %rax cmpq $0x0, 0x40d8(%rax) je 0x447bf movq -0x10(%rbp), %rax movq 0x40d8(%rax), %rax cmpq $0x0, 0xa8(%rax) jne 0x447cb movl $0x0, -0x4(%rbp) jmp 0x44883 movq -0x10(%rbp), %rax movq 0x40d8(%rax), %rax movq %rax, -0x20(%rbp) movq -0x20(%rbp), %rax movq 0xa8(%rax), %rax movq %rax, -0x28(%rbp) movq -0x10(%rbp), %rsi leaq -0x40(%rbp), %rdi callq 0x3b9f0 movl %eax, -0x44(%rbp) cmpl $0x0, -0x44(%rbp) jne 0x44808 movl $0x0, -0x4(%rbp) jmp 0x44883 cmpl $0x2, -0x44(%rbp) je 0x4481f movq -0x28(%rbp), %rax movl 0x4(%rax), %eax andl $0x1000, %eax # imm = 0x1000 cmpl $0x0, %eax je 0x44827 xorl %eax, %eax movq %rax, -0x58(%rbp) jmp 0x4482f movq -0x10(%rbp), %rax movq %rax, -0x58(%rbp) movq -0x50(%rbp), %r9 movq -0x58(%rbp), %rax movq %rax, -0x30(%rbp) movq -0x10(%rbp), %rax movq %rax, %rdi addq $0x1f70, %rdi # imm = 0x1F70 movq -0x20(%rbp), %rsi addq $0x68, %rsi movl 0x1f74(%rax), %edx movq -0x18(%rbp), %rcx movq -0x30(%rbp), %r8 movsd -0x40(%rbp), %xmm0 movsd -0x38(%rbp), %xmm1 movq 0x10(%r9), %r10 movq %rsp, %rax movq %r10, 0x10(%rax) movups (%r9), %xmm2 movups %xmm2, (%rax) callq 0x3c1d0 movl %eax, -0x4(%rbp) movl -0x4(%rbp), %eax addq $0x70, %rsp popq %rbp retq nopl (%rax)
/Tigermouthbear[P]flappytiger/external/glfw/deps/nuklear.h
nk_check_flags_text
NK_API unsigned int nk_check_flags_text(struct nk_context *ctx, const char *text, int len, unsigned int flags, unsigned int value) { int old_active; NK_ASSERT(ctx); NK_ASSERT(text); if (!ctx || !text) return flags; old_active = (int)((flags & value) & value); if (nk_check_text(ctx, text, len, old_active)) flags |= value; else flags &= ~value; return flags; }
pushq %rbp movq %rsp, %rbp subq $0x30, %rsp movq %rdi, -0x10(%rbp) movq %rsi, -0x18(%rbp) movl %edx, -0x1c(%rbp) movl %ecx, -0x20(%rbp) movl %r8d, -0x24(%rbp) cmpq $0x0, -0x10(%rbp) je 0x45643 jmp 0x45662 leaq 0x4bb08(%rip), %rdi # 0x91152 leaq 0x478af(%rip), %rsi # 0x8cf00 movl $0x4f6a, %edx # imm = 0x4F6A leaq 0x4c571(%rip), %rcx # 0x91bce callq 0x1b1e0 cmpq $0x0, -0x18(%rbp) je 0x4566b jmp 0x4568a leaq 0x7327a(%rip), %rdi # 0xb88ec leaq 0x47887(%rip), %rsi # 0x8cf00 movl $0x4f6b, %edx # imm = 0x4F6B leaq 0x4c549(%rip), %rcx # 0x91bce callq 0x1b1e0 cmpq $0x0, -0x10(%rbp) je 0x45698 cmpq $0x0, -0x18(%rbp) jne 0x456a0 movl -0x20(%rbp), %eax movl %eax, -0x4(%rbp) jmp 0x456e1 movl -0x20(%rbp), %eax andl -0x24(%rbp), %eax andl -0x24(%rbp), %eax movl %eax, -0x28(%rbp) movq -0x10(%rbp), %rdi movq -0x18(%rbp), %rsi movl -0x1c(%rbp), %edx movl -0x28(%rbp), %ecx callq 0x44f80 cmpl $0x0, %eax je 0x456cf movl -0x24(%rbp), %eax orl -0x20(%rbp), %eax movl %eax, -0x20(%rbp) jmp 0x456db movl -0x24(%rbp), %eax xorl $-0x1, %eax andl -0x20(%rbp), %eax movl %eax, -0x20(%rbp) movl -0x20(%rbp), %eax movl %eax, -0x4(%rbp) movl -0x4(%rbp), %eax addq $0x30, %rsp popq %rbp retq nopw (%rax,%rax)
/Tigermouthbear[P]flappytiger/external/glfw/deps/nuklear.h
nk_selectable_text
NK_API int nk_selectable_text(struct nk_context *ctx, const char *str, int len, nk_flags align, int *value) { struct nk_window *win; struct nk_panel *layout; const struct nk_input *in; const struct nk_style *style; enum nk_widget_layout_states state; struct nk_rect bounds; NK_ASSERT(ctx); NK_ASSERT(value); NK_ASSERT(ctx->current); NK_ASSERT(ctx->current->layout); if (!ctx || !ctx->current || !ctx->current->layout || !value) return 0; win = ctx->current; layout = win->layout; style = &ctx->style; state = nk_widget(&bounds, ctx); if (!state) return 0; in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; return nk_do_selectable(&ctx->last_widget_state, &win->buffer, bounds, str, len, align, value, &style->selectable, in, style->font); }
pushq %rbp movq %rsp, %rbp pushq %rbx subq $0x88, %rsp movq %rdi, -0x18(%rbp) movq %rsi, -0x20(%rbp) movl %edx, -0x24(%rbp) movl %ecx, -0x28(%rbp) movq %r8, -0x30(%rbp) cmpq $0x0, -0x18(%rbp) je 0x45dc7 jmp 0x45de6 leaq 0x4b384(%rip), %rdi # 0x91152 leaq 0x4712b(%rip), %rsi # 0x8cf00 movl $0x50a4, %edx # imm = 0x50A4 leaq 0x4bf85(%rip), %rcx # 0x91d66 callq 0x1b1e0 cmpq $0x0, -0x30(%rbp) je 0x45def jmp 0x45e0e leaq 0x4bfc0(%rip), %rdi # 0x91db6 leaq 0x47103(%rip), %rsi # 0x8cf00 movl $0x50a5, %edx # imm = 0x50A5 leaq 0x4bf5d(%rip), %rcx # 0x91d66 callq 0x1b1e0 movq -0x18(%rbp), %rax cmpq $0x0, 0x40d8(%rax) je 0x45e1e jmp 0x45e3d leaq 0x49ece(%rip), %rdi # 0x8fcf3 leaq 0x470d4(%rip), %rsi # 0x8cf00 movl $0x50a6, %edx # imm = 0x50A6 leaq 0x4bf2e(%rip), %rcx # 0x91d66 callq 0x1b1e0 movq -0x18(%rbp), %rax movq 0x40d8(%rax), %rax cmpq $0x0, 0xa8(%rax) je 0x45e54 jmp 0x45e73 leaq 0x4a014(%rip), %rdi # 0x8fe6f leaq 0x4709e(%rip), %rsi # 0x8cf00 movl $0x50a7, %edx # imm = 0x50A7 leaq 0x4bef8(%rip), %rcx # 0x91d66 callq 0x1b1e0 cmpq $0x0, -0x18(%rbp) je 0x45ea4 movq -0x18(%rbp), %rax cmpq $0x0, 0x40d8(%rax) je 0x45ea4 movq -0x18(%rbp), %rax movq 0x40d8(%rax), %rax cmpq $0x0, 0xa8(%rax) je 0x45ea4 cmpq $0x0, -0x30(%rbp) jne 0x45eb0 movl $0x0, -0xc(%rbp) jmp 0x45f84 movq -0x18(%rbp), %rax movq 0x40d8(%rax), %rax movq %rax, -0x38(%rbp) movq -0x38(%rbp), %rax movq 0xa8(%rax), %rax movq %rax, -0x40(%rbp) movq -0x18(%rbp), %rax addq $0x168, %rax # imm = 0x168 movq %rax, -0x50(%rbp) movq -0x18(%rbp), %rsi leaq -0x64(%rbp), %rdi callq 0x3b9f0 movl %eax, -0x54(%rbp) cmpl $0x0, -0x54(%rbp) jne 0x45efe movl $0x0, -0xc(%rbp) jmp 0x45f84 cmpl $0x2, -0x54(%rbp) je 0x45f15 movq -0x40(%rbp), %rax movl 0x4(%rax), %eax andl $0x1000, %eax # imm = 0x1000 cmpl $0x0, %eax je 0x45f1d xorl %eax, %eax movq %rax, -0x70(%rbp) jmp 0x45f25 movq -0x18(%rbp), %rax movq %rax, -0x70(%rbp) movq -0x70(%rbp), %rax movq %rax, -0x48(%rbp) movq -0x18(%rbp), %rdi addq $0x1f70, %rdi # imm = 0x1F70 movq -0x38(%rbp), %rsi addq $0x68, %rsi movq -0x20(%rbp), %rdx movl -0x24(%rbp), %ecx movl -0x28(%rbp), %r8d movq -0x30(%rbp), %r9 movq -0x50(%rbp), %rax movq %rax, %r10 addq $0x450, %r10 # imm = 0x450 movq -0x48(%rbp), %r11 movq (%rax), %rbx movsd -0x64(%rbp), %xmm0 movsd -0x5c(%rbp), %xmm1 movq %rsp, %rax movq %rbx, 0x10(%rax) movq %r11, 0x8(%rax) movq %r10, (%rax) callq 0x45fa0 movl %eax, -0xc(%rbp) movl -0xc(%rbp), %eax addq $0x88, %rsp popq %rbx popq %rbp retq nopw %cs:(%rax,%rax)
/Tigermouthbear[P]flappytiger/external/glfw/deps/nuklear.h
nk_do_selectable_symbol
NK_LIB int nk_do_selectable_symbol(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, const char *str, int len, nk_flags align, int *value, enum nk_symbol_type sym, const struct nk_style_selectable *style, const struct nk_input *in, const struct nk_user_font *font) { int old_value; struct nk_rect touch; struct nk_rect icon; NK_ASSERT(state); NK_ASSERT(out); NK_ASSERT(str); NK_ASSERT(len); NK_ASSERT(value); NK_ASSERT(style); NK_ASSERT(font); if (!state || !out || !str || !len || !value || !style || !font) return 0; old_value = *value; /* toggle behavior */ touch.x = bounds.x - style->touch_padding.x; touch.y = bounds.y - style->touch_padding.y; touch.w = bounds.w + style->touch_padding.x * 2; touch.h = bounds.h + style->touch_padding.y * 2; if (nk_button_behavior(state, touch, in, NK_BUTTON_DEFAULT)) *value = !(*value); icon.y = bounds.y + style->padding.y; icon.w = icon.h = bounds.h - 2 * style->padding.y; if (align & NK_TEXT_ALIGN_LEFT) { icon.x = (bounds.x + bounds.w) - (2 * style->padding.x + icon.w); icon.x = NK_MAX(icon.x, 0); } else icon.x = bounds.x + 2 * style->padding.x; icon.x += style->image_padding.x; icon.y += style->image_padding.y; icon.w -= 2 * style->image_padding.x; icon.h -= 2 * style->image_padding.y; /* draw selectable */ if (style->draw_begin) style->draw_begin(out, style->userdata); nk_draw_selectable(out, *state, style, *value, &bounds, &icon, 0, sym, str, len, align, font); if (style->draw_end) style->draw_end(out, style->userdata); return old_value != *value; }
pushq %rbp movq %rsp, %rbp pushq %r15 pushq %r14 pushq %rbx subq $0x98, %rsp movq 0x28(%rbp), %rax movq 0x20(%rbp), %rax movq 0x18(%rbp), %rax movl 0x10(%rbp), %eax movlpd %xmm0, -0x2c(%rbp) movlpd %xmm1, -0x24(%rbp) movq %rdi, -0x38(%rbp) movq %rsi, -0x40(%rbp) movq %rdx, -0x48(%rbp) movl %ecx, -0x4c(%rbp) movl %r8d, -0x50(%rbp) movq %r9, -0x58(%rbp) cmpq $0x0, -0x38(%rbp) je 0x46b59 jmp 0x46b78 leaq 0x4b3b8(%rip), %rdi # 0x91f18 leaq 0x46399(%rip), %rsi # 0x8cf00 movl $0x5072, %edx # imm = 0x5072 leaq 0x4eb2a(%rip), %rcx # 0x9569d callq 0x1b1e0 cmpq $0x0, -0x40(%rbp) je 0x46b81 jmp 0x46ba0 leaq 0x6f8a6(%rip), %rdi # 0xb642e leaq 0x46371(%rip), %rsi # 0x8cf00 movl $0x5073, %edx # imm = 0x5073 leaq 0x4eb02(%rip), %rcx # 0x9569d callq 0x1b1e0 cmpq $0x0, -0x48(%rbp) je 0x46ba9 jmp 0x46bc8 leaq 0x469a9(%rip), %rdi # 0x8d559 leaq 0x46349(%rip), %rsi # 0x8cf00 movl $0x5074, %edx # imm = 0x5074 leaq 0x4eada(%rip), %rcx # 0x9569d callq 0x1b1e0 cmpl $0x0, -0x4c(%rbp) je 0x46bd0 jmp 0x46bef leaq 0x46b58(%rip), %rdi # 0x8d72f leaq 0x46322(%rip), %rsi # 0x8cf00 movl $0x5075, %edx # imm = 0x5075 leaq 0x4eab3(%rip), %rcx # 0x9569d callq 0x1b1e0 cmpq $0x0, -0x58(%rbp) je 0x46bf8 jmp 0x46c17 leaq 0x4b1b7(%rip), %rdi # 0x91db6 leaq 0x462fa(%rip), %rsi # 0x8cf00 movl $0x5076, %edx # imm = 0x5076 leaq 0x4ea8b(%rip), %rcx # 0x9569d callq 0x1b1e0 cmpq $0x0, 0x18(%rbp) je 0x46c20 jmp 0x46c3f leaq 0x4ac41(%rip), %rdi # 0x91868 leaq 0x462d2(%rip), %rsi # 0x8cf00 movl $0x5077, %edx # imm = 0x5077 leaq 0x4ea63(%rip), %rcx # 0x9569d callq 0x1b1e0 cmpq $0x0, 0x28(%rbp) je 0x46c48 jmp 0x46c67 leaq 0x48ef6(%rip), %rdi # 0x8fb45 leaq 0x462aa(%rip), %rsi # 0x8cf00 movl $0x5078, %edx # imm = 0x5078 leaq 0x4ea3b(%rip), %rcx # 0x9569d callq 0x1b1e0 cmpq $0x0, -0x38(%rbp) je 0x46c97 cmpq $0x0, -0x40(%rbp) je 0x46c97 cmpq $0x0, -0x48(%rbp) je 0x46c97 cmpl $0x0, -0x4c(%rbp) je 0x46c97 cmpq $0x0, -0x58(%rbp) je 0x46c97 cmpq $0x0, 0x18(%rbp) je 0x46c97 cmpq $0x0, 0x28(%rbp) jne 0x46ca3 movl $0x0, -0x1c(%rbp) jmp 0x46f31 movq -0x58(%rbp), %rax movl (%rax), %eax movl %eax, -0x5c(%rbp) movss -0x2c(%rbp), %xmm0 movq 0x18(%rbp), %rax movss 0xec(%rax), %xmm1 subss %xmm1, %xmm0 movss %xmm0, -0x6c(%rbp) movss -0x28(%rbp), %xmm0 movq 0x18(%rbp), %rax movss 0xf0(%rax), %xmm1 subss %xmm1, %xmm0 movss %xmm0, -0x68(%rbp) movss -0x24(%rbp), %xmm1 movq 0x18(%rbp), %rax movss 0xec(%rax), %xmm0 addss %xmm0, %xmm0 addss %xmm1, %xmm0 movss %xmm0, -0x64(%rbp) movss -0x20(%rbp), %xmm1 movq 0x18(%rbp), %rax movss 0xf0(%rax), %xmm0 addss %xmm0, %xmm0 addss %xmm1, %xmm0 movss %xmm0, -0x60(%rbp) movq -0x38(%rbp), %rdi movq 0x20(%rbp), %rsi movsd -0x6c(%rbp), %xmm0 movsd -0x64(%rbp), %xmm1 xorl %edx, %edx callq 0x4ef30 cmpl $0x0, %eax je 0x46d51 movq -0x58(%rbp), %rax cmpl $0x0, (%rax) setne %al xorb $-0x1, %al andb $0x1, %al movzbl %al, %ecx movq -0x58(%rbp), %rax movl %ecx, (%rax) movss -0x28(%rbp), %xmm0 movq 0x18(%rbp), %rax addss 0xe8(%rax), %xmm0 movss %xmm0, -0x78(%rbp) movss -0x20(%rbp), %xmm0 movq 0x18(%rbp), %rax movss 0xe8(%rax), %xmm1 addss %xmm1, %xmm1 subss %xmm1, %xmm0 movss %xmm0, -0x70(%rbp) movss %xmm0, -0x74(%rbp) movl -0x50(%rbp), %eax andl $0x1, %eax cmpl $0x0, %eax je 0x46dea movss -0x2c(%rbp), %xmm0 addss -0x24(%rbp), %xmm0 movq 0x18(%rbp), %rax movss 0xe4(%rax), %xmm1 movss -0x74(%rbp), %xmm2 addss %xmm1, %xmm1 addss %xmm2, %xmm1 subss %xmm1, %xmm0 movss %xmm0, -0x7c(%rbp) xorps %xmm0, %xmm0 ucomiss -0x7c(%rbp), %xmm0 jbe 0x46dd4 xorps %xmm0, %xmm0 movss %xmm0, -0x80(%rbp) jmp 0x46dde movss -0x7c(%rbp), %xmm0 movss %xmm0, -0x80(%rbp) movss -0x80(%rbp), %xmm0 movss %xmm0, -0x7c(%rbp) jmp 0x46e08 movss -0x2c(%rbp), %xmm1 movq 0x18(%rbp), %rax movss 0xe4(%rax), %xmm0 addss %xmm0, %xmm0 addss %xmm1, %xmm0 movss %xmm0, -0x7c(%rbp) movq 0x18(%rbp), %rax movss 0xf4(%rax), %xmm0 addss -0x7c(%rbp), %xmm0 movss %xmm0, -0x7c(%rbp) movq 0x18(%rbp), %rax movss 0xf8(%rax), %xmm0 addss -0x78(%rbp), %xmm0 movss %xmm0, -0x78(%rbp) movq 0x18(%rbp), %rax movss 0xf4(%rax), %xmm1 movss -0x74(%rbp), %xmm0 addss %xmm1, %xmm1 subss %xmm1, %xmm0 movss %xmm0, -0x74(%rbp) movq 0x18(%rbp), %rax movss 0xf8(%rax), %xmm1 movss -0x70(%rbp), %xmm0 addss %xmm1, %xmm1 subss %xmm1, %xmm0 movss %xmm0, -0x70(%rbp) movq 0x18(%rbp), %rax cmpq $0x0, 0x108(%rax) je 0x46e9a movq 0x18(%rbp), %rax movq 0x108(%rax), %rax movq -0x40(%rbp), %rdi movq 0x18(%rbp), %rcx movq 0x100(%rcx), %rsi callq *%rax movq -0x40(%rbp), %rdi movq -0x38(%rbp), %rax movl (%rax), %esi movq 0x18(%rbp), %rdx movq -0x58(%rbp), %rax movl (%rax), %ecx movl 0x10(%rbp), %r14d movq -0x48(%rbp), %rbx movl -0x4c(%rbp), %r11d movl -0x50(%rbp), %r10d movq 0x28(%rbp), %rax leaq -0x2c(%rbp), %r8 leaq -0x7c(%rbp), %r9 xorl %r15d, %r15d movq $0x0, (%rsp) movl %r14d, 0x8(%rsp) movq %rbx, 0x10(%rsp) movl %r11d, 0x18(%rsp) movl %r10d, 0x20(%rsp) movq %rax, 0x28(%rsp) callq 0x62330 movq 0x18(%rbp), %rax cmpq $0x0, 0x110(%rax) je 0x46f1d movq 0x18(%rbp), %rax movq 0x110(%rax), %rax movq -0x40(%rbp), %rdi movq 0x18(%rbp), %rcx movq 0x100(%rcx), %rsi callq *%rax movl -0x5c(%rbp), %eax movq -0x58(%rbp), %rcx cmpl (%rcx), %eax setne %al andb $0x1, %al movzbl %al, %eax movl %eax, -0x1c(%rbp) movl -0x1c(%rbp), %eax addq $0x98, %rsp popq %rbx popq %r14 popq %r15 popq %rbp retq nopw %cs:(%rax,%rax)
/Tigermouthbear[P]flappytiger/external/glfw/deps/nuklear.h
nk_do_slider
NK_LIB float nk_do_slider(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, float min, float val, float max, float step, const struct nk_style_slider *style, struct nk_input *in, const struct nk_user_font *font) { float slider_range; float slider_min; float slider_max; float slider_value; float slider_steps; float cursor_offset; struct nk_rect visual_cursor; struct nk_rect logical_cursor; NK_ASSERT(style); NK_ASSERT(out); if (!out || !style) return 0; /* remove padding from slider bounds */ bounds.x = bounds.x + style->padding.x; bounds.y = bounds.y + style->padding.y; bounds.h = NK_MAX(bounds.h, 2*style->padding.y); bounds.w = NK_MAX(bounds.w, 2*style->padding.x + style->cursor_size.x); bounds.w -= 2 * style->padding.x; bounds.h -= 2 * style->padding.y; /* optional buttons */ if (style->show_buttons) { nk_flags ws; struct nk_rect button; button.y = bounds.y; button.w = bounds.h; button.h = bounds.h; /* decrement button */ button.x = bounds.x; if (nk_do_button_symbol(&ws, out, button, style->dec_symbol, NK_BUTTON_DEFAULT, &style->dec_button, in, font)) val -= step; /* increment button */ button.x = (bounds.x + bounds.w) - button.w; if (nk_do_button_symbol(&ws, out, button, style->inc_symbol, NK_BUTTON_DEFAULT, &style->inc_button, in, font)) val += step; bounds.x = bounds.x + button.w + style->spacing.x; bounds.w = bounds.w - (2*button.w + 2*style->spacing.x); } /* remove one cursor size to support visual cursor */ bounds.x += style->cursor_size.x*0.5f; bounds.w -= style->cursor_size.x; /* make sure the provided values are correct */ slider_max = NK_MAX(min, max); slider_min = NK_MIN(min, max); slider_value = NK_CLAMP(slider_min, val, slider_max); slider_range = slider_max - slider_min; slider_steps = slider_range / step; cursor_offset = (slider_value - slider_min) / step; /* calculate cursor Basically you have two cursors. One for visual representation and interaction and one for updating the actual cursor value. */ logical_cursor.h = bounds.h; logical_cursor.w = bounds.w / slider_steps; logical_cursor.x = bounds.x + (logical_cursor.w * cursor_offset); logical_cursor.y = bounds.y; visual_cursor.h = style->cursor_size.y; visual_cursor.w = style->cursor_size.x; visual_cursor.y = (bounds.y + bounds.h*0.5f) - visual_cursor.h*0.5f; visual_cursor.x = logical_cursor.x - visual_cursor.w*0.5f; slider_value = nk_slider_behavior(state, &logical_cursor, &visual_cursor, in, bounds, slider_min, slider_max, slider_value, step, slider_steps); visual_cursor.x = logical_cursor.x - visual_cursor.w*0.5f; /* draw slider */ if (style->draw_begin) style->draw_begin(out, style->userdata); nk_draw_slider(out, *state, style, &bounds, &visual_cursor, slider_min, slider_value, slider_max); if (style->draw_end) style->draw_end(out, style->userdata); return slider_value; }
pushq %rbp movq %rsp, %rbp subq $0xc0, %rsp movlpd %xmm0, -0x14(%rbp) movlpd %xmm1, -0xc(%rbp) movq %rdi, -0x20(%rbp) movq %rsi, -0x28(%rbp) movss %xmm2, -0x2c(%rbp) movss %xmm3, -0x30(%rbp) movss %xmm4, -0x34(%rbp) movss %xmm5, -0x38(%rbp) movq %rdx, -0x40(%rbp) movq %rcx, -0x48(%rbp) movq %r8, -0x50(%rbp) cmpq $0x0, -0x40(%rbp) je 0x47516 jmp 0x47535 leaq 0x4a34b(%rip), %rdi # 0x91868 leaq 0x459dc(%rip), %rsi # 0x8cf00 movl $0x519d, %edx # imm = 0x519D leaq 0x4e254(%rip), %rcx # 0x95784 callq 0x1b1e0 cmpq $0x0, -0x28(%rbp) je 0x4753e jmp 0x4755d leaq 0x6eee9(%rip), %rdi # 0xb642e leaq 0x459b4(%rip), %rsi # 0x8cf00 movl $0x519e, %edx # imm = 0x519E leaq 0x4e22c(%rip), %rcx # 0x95784 callq 0x1b1e0 cmpq $0x0, -0x28(%rbp) je 0x4756b cmpq $0x0, -0x40(%rbp) jne 0x47578 xorps %xmm0, %xmm0 movss %xmm0, -0x4(%rbp) jmp 0x47b39 movss -0x14(%rbp), %xmm0 movq -0x40(%rbp), %rax addss 0xe4(%rax), %xmm0 movss %xmm0, -0x14(%rbp) movss -0x10(%rbp), %xmm0 movq -0x40(%rbp), %rax addss 0xe8(%rax), %xmm0 movss %xmm0, -0x10(%rbp) movss -0x8(%rbp), %xmm1 movq -0x40(%rbp), %rax movss 0x41a4f(%rip), %xmm0 # 0x89004 mulss 0xe8(%rax), %xmm0 ucomiss %xmm1, %xmm0 jbe 0x475e0 movq -0x40(%rbp), %rax movss 0x41a36(%rip), %xmm0 # 0x89004 mulss 0xe8(%rax), %xmm0 movss %xmm0, -0xa0(%rbp) jmp 0x475ed movss -0x8(%rbp), %xmm0 movss %xmm0, -0xa0(%rbp) movss -0xa0(%rbp), %xmm0 movss %xmm0, -0x8(%rbp) movss -0xc(%rbp), %xmm1 movq -0x40(%rbp), %rax movss 0xe4(%rax), %xmm0 movq -0x40(%rbp), %rax movss 0xf4(%rax), %xmm2 addss %xmm0, %xmm0 addss %xmm2, %xmm0 ucomiss %xmm1, %xmm0 jbe 0x4764e movq -0x40(%rbp), %rax movss 0xe4(%rax), %xmm0 movq -0x40(%rbp), %rax movss 0xf4(%rax), %xmm1 addss %xmm0, %xmm0 addss %xmm1, %xmm0 movss %xmm0, -0xa4(%rbp) jmp 0x4765b movss -0xc(%rbp), %xmm0 movss %xmm0, -0xa4(%rbp) movss -0xa4(%rbp), %xmm0 movss %xmm0, -0xc(%rbp) movq -0x40(%rbp), %rax movss 0xe4(%rax), %xmm1 movss -0xc(%rbp), %xmm0 addss %xmm1, %xmm1 subss %xmm1, %xmm0 movss %xmm0, -0xc(%rbp) movq -0x40(%rbp), %rax movss 0xe8(%rax), %xmm1 movss -0x8(%rbp), %xmm0 addss %xmm1, %xmm1 subss %xmm1, %xmm0 movss %xmm0, -0x8(%rbp) movq -0x40(%rbp), %rax cmpl $0x0, 0xfc(%rax) je 0x4780b movss -0x10(%rbp), %xmm0 movss %xmm0, -0x98(%rbp) movss -0x8(%rbp), %xmm0 movss %xmm0, -0x94(%rbp) movss -0x8(%rbp), %xmm0 movss %xmm0, -0x90(%rbp) movss -0x14(%rbp), %xmm0 movss %xmm0, -0x9c(%rbp) movq -0x28(%rbp), %rsi movq -0x40(%rbp), %r8 movl 0x264(%r8), %edx addq $0x1b0, %r8 # imm = 0x1B0 movq -0x48(%rbp), %r9 movq -0x50(%rbp), %rcx movsd -0x9c(%rbp), %xmm0 movsd -0x94(%rbp), %xmm1 movq %rsp, %rax movq %rcx, (%rax) leaq -0x8c(%rbp), %rdi xorl %ecx, %ecx callq 0x3c580 cmpl $0x0, %eax je 0x47743 movss -0x38(%rbp), %xmm1 movss -0x30(%rbp), %xmm0 subss %xmm1, %xmm0 movss %xmm0, -0x30(%rbp) movss -0x14(%rbp), %xmm0 movss -0xc(%rbp), %xmm1 addss %xmm1, %xmm0 movss -0x94(%rbp), %xmm1 subss %xmm1, %xmm0 movss %xmm0, -0x9c(%rbp) movq -0x28(%rbp), %rsi movq -0x40(%rbp), %r8 movl 0x260(%r8), %edx addq $0x100, %r8 # imm = 0x100 movq -0x48(%rbp), %r9 movq -0x50(%rbp), %rcx movsd -0x9c(%rbp), %xmm0 movsd -0x94(%rbp), %xmm1 movq %rsp, %rax movq %rcx, (%rax) leaq -0x8c(%rbp), %rdi xorl %ecx, %ecx callq 0x3c580 cmpl $0x0, %eax je 0x477bb movss -0x38(%rbp), %xmm0 addss -0x30(%rbp), %xmm0 movss %xmm0, -0x30(%rbp) movss -0x14(%rbp), %xmm0 addss -0x94(%rbp), %xmm0 movq -0x40(%rbp), %rax addss 0xec(%rax), %xmm0 movss %xmm0, -0x14(%rbp) movss -0xc(%rbp), %xmm0 movss -0x94(%rbp), %xmm1 movq -0x40(%rbp), %rax movss 0x41812(%rip), %xmm2 # 0x89004 mulss 0xec(%rax), %xmm2 addss %xmm1, %xmm1 addss %xmm2, %xmm1 subss %xmm1, %xmm0 movss %xmm0, -0xc(%rbp) movq -0x40(%rbp), %rax movss 0xf4(%rax), %xmm0 movss -0x14(%rbp), %xmm1 movss 0x41850(%rip), %xmm2 # 0x89074 mulss %xmm2, %xmm0 addss %xmm1, %xmm0 movss %xmm0, -0x14(%rbp) movq -0x40(%rbp), %rax movss 0xf4(%rax), %xmm1 movss -0xc(%rbp), %xmm0 subss %xmm1, %xmm0 movss %xmm0, -0xc(%rbp) movss -0x2c(%rbp), %xmm1 movss -0x34(%rbp), %xmm0 ucomiss %xmm1, %xmm0 jbe 0x47869 movss -0x34(%rbp), %xmm0 movss %xmm0, -0xa8(%rbp) jmp 0x47876 movss -0x2c(%rbp), %xmm0 movss %xmm0, -0xa8(%rbp) movss -0xa8(%rbp), %xmm0 movss %xmm0, -0x5c(%rbp) movss -0x2c(%rbp), %xmm1 movss -0x34(%rbp), %xmm0 ucomiss %xmm1, %xmm0 jbe 0x478a1 movss -0x2c(%rbp), %xmm0 movss %xmm0, -0xac(%rbp) jmp 0x478ae movss -0x34(%rbp), %xmm0 movss %xmm0, -0xac(%rbp) movss -0xac(%rbp), %xmm0 movss %xmm0, -0x58(%rbp) movss -0x30(%rbp), %xmm1 movss -0x5c(%rbp), %xmm0 ucomiss %xmm1, %xmm0 jbe 0x478d9 movss -0x30(%rbp), %xmm0 movss %xmm0, -0xb0(%rbp) jmp 0x478e6 movss -0x5c(%rbp), %xmm0 movss %xmm0, -0xb0(%rbp) movss -0xb0(%rbp), %xmm1 movss -0x58(%rbp), %xmm0 ucomiss %xmm1, %xmm0 jbe 0x47907 movss -0x58(%rbp), %xmm0 movss %xmm0, -0xb4(%rbp) jmp 0x47942 movss -0x30(%rbp), %xmm1 movss -0x5c(%rbp), %xmm0 ucomiss %xmm1, %xmm0 jbe 0x47925 movss -0x30(%rbp), %xmm0 movss %xmm0, -0xb8(%rbp) jmp 0x47932 movss -0x5c(%rbp), %xmm0 movss %xmm0, -0xb8(%rbp) movss -0xb8(%rbp), %xmm0 movss %xmm0, -0xb4(%rbp) movss -0xb4(%rbp), %xmm0 movss %xmm0, -0x60(%rbp) movss -0x5c(%rbp), %xmm0 movss -0x58(%rbp), %xmm1 subss %xmm1, %xmm0 movss %xmm0, -0x54(%rbp) movss -0x54(%rbp), %xmm0 movss -0x38(%rbp), %xmm1 divss %xmm1, %xmm0 movss %xmm0, -0x64(%rbp) movss -0x60(%rbp), %xmm0 movss -0x58(%rbp), %xmm1 subss %xmm1, %xmm0 movss -0x38(%rbp), %xmm1 divss %xmm1, %xmm0 movss %xmm0, -0x68(%rbp) movss -0x8(%rbp), %xmm0 movss %xmm0, -0x7c(%rbp) movss -0xc(%rbp), %xmm0 movss -0x64(%rbp), %xmm1 divss %xmm1, %xmm0 movss %xmm0, -0x80(%rbp) movss -0x14(%rbp), %xmm1 movss -0x80(%rbp), %xmm0 movss -0x68(%rbp), %xmm2 mulss %xmm2, %xmm0 addss %xmm1, %xmm0 movss %xmm0, -0x88(%rbp) movss -0x10(%rbp), %xmm0 movss %xmm0, -0x84(%rbp) movq -0x40(%rbp), %rax movss 0xf8(%rax), %xmm0 movss %xmm0, -0x6c(%rbp) movq -0x40(%rbp), %rax movss 0xf4(%rax), %xmm0 movss %xmm0, -0x70(%rbp) movss -0x10(%rbp), %xmm1 movss -0x8(%rbp), %xmm0 movss 0x41666(%rip), %xmm2 # 0x89074 mulss %xmm2, %xmm0 addss %xmm1, %xmm0 movss -0x6c(%rbp), %xmm1 mulss %xmm2, %xmm1 subss %xmm1, %xmm0 movss %xmm0, -0x74(%rbp) movss -0x88(%rbp), %xmm0 movss -0x70(%rbp), %xmm1 mulss %xmm2, %xmm1 subss %xmm1, %xmm0 movss %xmm0, -0x78(%rbp) movq -0x20(%rbp), %rdi movq -0x48(%rbp), %rcx movss -0x58(%rbp), %xmm2 movss -0x5c(%rbp), %xmm3 movss -0x60(%rbp), %xmm4 movss -0x38(%rbp), %xmm5 movss -0x64(%rbp), %xmm6 movsd -0x14(%rbp), %xmm0 movsd -0xc(%rbp), %xmm1 leaq -0x88(%rbp), %rsi leaq -0x78(%rbp), %rdx callq 0x62550 movss %xmm0, -0x60(%rbp) movss -0x88(%rbp), %xmm1 movss -0x70(%rbp), %xmm0 movd %xmm0, %eax xorl $0x80000000, %eax # imm = 0x80000000 movd %eax, %xmm0 movss 0x415d0(%rip), %xmm2 # 0x89074 mulss %xmm2, %xmm0 addss %xmm1, %xmm0 movss %xmm0, -0x78(%rbp) movq -0x40(%rbp), %rax cmpq $0x0, 0x270(%rax) je 0x47adb movq -0x40(%rbp), %rax movq 0x270(%rax), %rax movq -0x28(%rbp), %rdi movq -0x40(%rbp), %rcx movq 0x268(%rcx), %rsi callq *%rax movq -0x28(%rbp), %rdi movq -0x20(%rbp), %rax movl (%rax), %esi movq -0x40(%rbp), %rdx movss -0x58(%rbp), %xmm0 movss -0x60(%rbp), %xmm1 movss -0x5c(%rbp), %xmm2 leaq -0x14(%rbp), %rcx leaq -0x78(%rbp), %r8 callq 0x628a0 movq -0x40(%rbp), %rax cmpq $0x0, 0x278(%rax) je 0x47b2f movq -0x40(%rbp), %rax movq 0x278(%rax), %rax movq -0x28(%rbp), %rdi movq -0x40(%rbp), %rcx movq 0x268(%rcx), %rsi callq *%rax movss -0x60(%rbp), %xmm0 movss %xmm0, -0x4(%rbp) movss -0x4(%rbp), %xmm0 addq $0xc0, %rsp popq %rbp retq nopw (%rax,%rax)
/Tigermouthbear[P]flappytiger/external/glfw/deps/nuklear.h
nk_textedit_cut
NK_API int nk_textedit_cut(struct nk_text_edit *state) { /* API cut: delete selection */ if (state->mode == NK_TEXT_EDIT_MODE_VIEW) return 0; if (NK_TEXT_HAS_SELECTION(state)) { nk_textedit_delete_selection(state); /* implicitly clamps */ state->has_preferred_x = 0; return 1; } return 0; }
pushq %rbp movq %rsp, %rbp subq $0x10, %rsp movq %rdi, -0x10(%rbp) movq -0x10(%rbp), %rax movzbl 0xb4(%rax), %eax cmpl $0x0, %eax jne 0x484e5 movl $0x0, -0x4(%rbp) jmp 0x4851f movq -0x10(%rbp), %rax movl 0xac(%rax), %eax movq -0x10(%rbp), %rcx cmpl 0xb0(%rcx), %eax je 0x48518 movq -0x10(%rbp), %rdi callq 0x48320 movq -0x10(%rbp), %rax movb $0x0, 0xb7(%rax) movl $0x1, -0x4(%rbp) jmp 0x4851f movl $0x0, -0x4(%rbp) movl -0x4(%rbp), %eax addq $0x10, %rsp popq %rbp retq nopl (%rax,%rax)
/Tigermouthbear[P]flappytiger/external/glfw/deps/nuklear.h
nk_textedit_init_fixed
NK_API void nk_textedit_init_fixed(struct nk_text_edit *state, void *memory, nk_size size) { NK_ASSERT(state); NK_ASSERT(memory); if (!state || !memory || !size) return; NK_MEMSET(state, 0, sizeof(struct nk_text_edit)); nk_textedit_clear_state(state, NK_TEXT_EDIT_SINGLE_LINE, 0); nk_str_init_fixed(&state->string, memory, size); }
pushq %rbp movq %rsp, %rbp subq $0x20, %rsp movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movq %rdx, -0x18(%rbp) cmpq $0x0, -0x8(%rbp) je 0x48fad jmp 0x48fcc leaq 0x48f64(%rip), %rdi # 0x91f18 leaq 0x43f45(%rip), %rsi # 0x8cf00 movl $0x57ae, %edx # imm = 0x57AE leaq 0x48f97(%rip), %rcx # 0x91f5e callq 0x1b1e0 cmpq $0x0, -0x10(%rbp) je 0x48fd5 jmp 0x48ff4 leaq 0x6b33f(%rip), %rdi # 0xb431b leaq 0x43f1d(%rip), %rsi # 0x8cf00 movl $0x57af, %edx # imm = 0x57AF leaq 0x48f6f(%rip), %rcx # 0x91f5e callq 0x1b1e0 cmpq $0x0, -0x8(%rbp) je 0x49009 cmpq $0x0, -0x10(%rbp) je 0x49009 cmpq $0x0, -0x18(%rbp) jne 0x4900b jmp 0x4903f movq -0x8(%rbp), %rdi xorl %esi, %esi movl $0x1508, %edx # imm = 0x1508 callq 0x33f50 movq -0x8(%rbp), %rdi xorl %esi, %esi xorl %eax, %eax movl %eax, %edx callq 0x49050 movq -0x8(%rbp), %rdi addq $0x18, %rdi movq -0x10(%rbp), %rsi movq -0x18(%rbp), %rdx callq 0x20480 addq $0x20, %rsp popq %rbp retq nopw %cs:(%rax,%rax)
/Tigermouthbear[P]flappytiger/external/glfw/deps/nuklear.h
nk_property_int
NK_API void nk_property_int(struct nk_context *ctx, const char *name, int min, int *val, int max, int step, float inc_per_pixel) { struct nk_property_variant variant; NK_ASSERT(ctx); NK_ASSERT(name); NK_ASSERT(val); if (!ctx || !ctx->current || !name || !val) return; variant = nk_property_variant_int(*val, min, max, step); nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_INT); *val = variant.value.i; }
pushq %rbp movq %rsp, %rbp subq $0x80, %rsp movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movl %edx, -0x14(%rbp) movq %rcx, -0x20(%rbp) movl %r8d, -0x24(%rbp) movl %r9d, -0x28(%rbp) movss %xmm0, -0x2c(%rbp) cmpq $0x0, -0x8(%rbp) je 0x4bce0 jmp 0x4bcff leaq 0x4546b(%rip), %rdi # 0x91152 leaq 0x41212(%rip), %rsi # 0x8cf00 movl $0x5ca0, %edx # imm = 0x5CA0 leaq 0x464a8(%rip), %rcx # 0x921a2 callq 0x1b1e0 cmpq $0x0, -0x10(%rbp) je 0x4bd08 jmp 0x4bd27 leaq 0x43e06(%rip), %rdi # 0x8fb15 leaq 0x411ea(%rip), %rsi # 0x8cf00 movl $0x5ca1, %edx # imm = 0x5CA1 leaq 0x46480(%rip), %rcx # 0x921a2 callq 0x1b1e0 cmpq $0x0, -0x20(%rbp) je 0x4bd30 jmp 0x4bd4f leaq 0x6cc1f(%rip), %rdi # 0xb8956 leaq 0x411c2(%rip), %rsi # 0x8cf00 movl $0x5ca2, %edx # imm = 0x5CA2 leaq 0x46458(%rip), %rcx # 0x921a2 callq 0x1b1e0 cmpq $0x0, -0x8(%rbp) je 0x4bd72 movq -0x8(%rbp), %rax cmpq $0x0, 0x40d8(%rax) je 0x4bd72 cmpq $0x0, -0x10(%rbp) je 0x4bd72 cmpq $0x0, -0x20(%rbp) jne 0x4bd74 jmp 0x4bdc0 movq -0x20(%rbp), %rax movl (%rax), %esi movl -0x14(%rbp), %edx movl -0x24(%rbp), %ecx movl -0x28(%rbp), %r8d leaq -0x80(%rbp), %rdi callq 0x4bdd0 leaq -0x58(%rbp), %rdi leaq -0x80(%rbp), %rsi movl $0x28, %edx callq 0x1b9a0 movq -0x8(%rbp), %rdi movq -0x10(%rbp), %rsi movss -0x2c(%rbp), %xmm0 leaq -0x58(%rbp), %rdx xorl %ecx, %ecx callq 0x4be10 movl -0x50(%rbp), %ecx movq -0x20(%rbp), %rax movl %ecx, (%rax) addq $0x80, %rsp popq %rbp retq nopl (%rax)
/Tigermouthbear[P]flappytiger/external/glfw/deps/nuklear.h
nk_property_variant_double
NK_LIB struct nk_property_variant nk_property_variant_double(double value, double min_value, double max_value, double step) { struct nk_property_variant result; result.kind = NK_PROPERTY_DOUBLE; result.value.d = value; result.min_value.d = min_value; result.max_value.d = max_value; result.step.d = step; return result; }
pushq %rbp movq %rsp, %rbp movq %rdi, %rax movsd %xmm0, -0x8(%rbp) movsd %xmm1, -0x10(%rbp) movsd %xmm2, -0x18(%rbp) movsd %xmm3, -0x20(%rbp) movl $0x2, (%rdi) movsd -0x8(%rbp), %xmm0 movsd %xmm0, 0x8(%rdi) movsd -0x10(%rbp), %xmm0 movsd %xmm0, 0x10(%rdi) movsd -0x18(%rbp), %xmm0 movsd %xmm0, 0x18(%rdi) movsd -0x20(%rbp), %xmm0 movsd %xmm0, 0x20(%rdi) popq %rbp retq nopl (%rax,%rax)
/Tigermouthbear[P]flappytiger/external/glfw/deps/nuklear.h
nk_chart_add_slot_colored
NK_API void nk_chart_add_slot_colored(struct nk_context *ctx, const enum nk_chart_type type, struct nk_color color, struct nk_color highlight, int count, float min_value, float max_value) { NK_ASSERT(ctx); NK_ASSERT(ctx->current); NK_ASSERT(ctx->current->layout); NK_ASSERT(ctx->current->layout->chart.slot < NK_CHART_MAX_SLOT); if (!ctx || !ctx->current || !ctx->current->layout) return; if (ctx->current->layout->chart.slot >= NK_CHART_MAX_SLOT) return; /* add another slot into the graph */ {struct nk_chart *chart = &ctx->current->layout->chart; struct nk_chart_slot *slot = &chart->slots[chart->slot++]; slot->type = type; slot->count = count; slot->color = color; slot->highlight = highlight; slot->min = NK_MIN(min_value, max_value); slot->max = NK_MAX(min_value, max_value); slot->range = slot->max - slot->min;} }
pushq %rbp movq %rsp, %rbp subq $0x40, %rsp movl %edx, -0x4(%rbp) movl %ecx, -0x8(%rbp) movq %rdi, -0x10(%rbp) movl %esi, -0x14(%rbp) movl %r8d, -0x18(%rbp) movss %xmm0, -0x1c(%rbp) movss %xmm1, -0x20(%rbp) cmpq $0x0, -0x10(%rbp) je 0x4d00c jmp 0x4d02b leaq 0x4413f(%rip), %rdi # 0x91152 leaq 0x3fee6(%rip), %rsi # 0x8cf00 movl $0x5d40, %edx # imm = 0x5D40 leaq 0x45413(%rip), %rcx # 0x92439 callq 0x1b1e0 movq -0x10(%rbp), %rax cmpq $0x0, 0x40d8(%rax) je 0x4d03b jmp 0x4d05a leaq 0x42cb1(%rip), %rdi # 0x8fcf3 leaq 0x3feb7(%rip), %rsi # 0x8cf00 movl $0x5d41, %edx # imm = 0x5D41 leaq 0x453e4(%rip), %rcx # 0x92439 callq 0x1b1e0 movq -0x10(%rbp), %rax movq 0x40d8(%rax), %rax cmpq $0x0, 0xa8(%rax) je 0x4d071 jmp 0x4d090 leaq 0x42df7(%rip), %rdi # 0x8fe6f leaq 0x3fe81(%rip), %rsi # 0x8cf00 movl $0x5d42, %edx # imm = 0x5D42 leaq 0x453ae(%rip), %rcx # 0x92439 callq 0x1b1e0 movq -0x10(%rbp), %rax movq 0x40d8(%rax), %rax movq 0xa8(%rax), %rax cmpl $0x4, 0xf8(%rax) jge 0x4d0ad jmp 0x4d0cc leaq 0x45408(%rip), %rdi # 0x924bc leaq 0x3fe45(%rip), %rsi # 0x8cf00 movl $0x5d43, %edx # imm = 0x5D43 leaq 0x45372(%rip), %rcx # 0x92439 callq 0x1b1e0 cmpq $0x0, -0x10(%rbp) je 0x4d0f6 movq -0x10(%rbp), %rax cmpq $0x0, 0x40d8(%rax) je 0x4d0f6 movq -0x10(%rbp), %rax movq 0x40d8(%rax), %rax cmpq $0x0, 0xa8(%rax) jne 0x4d0fb jmp 0x4d202 movq -0x10(%rbp), %rax movq 0x40d8(%rax), %rax movq 0xa8(%rax), %rax cmpl $0x4, 0xf8(%rax) jl 0x4d11b jmp 0x4d202 movq -0x10(%rbp), %rax movq 0x40d8(%rax), %rax movq 0xa8(%rax), %rax addq $0xf8, %rax movq %rax, -0x28(%rbp) movq -0x28(%rbp), %rax addq $0x14, %rax movq -0x28(%rbp), %rdx movl (%rdx), %ecx movl %ecx, %esi addl $0x1, %esi movl %esi, (%rdx) movslq %ecx, %rcx imulq $0x28, %rcx, %rcx addq %rcx, %rax movq %rax, -0x30(%rbp) movl -0x14(%rbp), %ecx movq -0x30(%rbp), %rax movl %ecx, (%rax) movl -0x18(%rbp), %ecx movq -0x30(%rbp), %rax movl %ecx, 0x18(%rax) movq -0x30(%rbp), %rax movl -0x4(%rbp), %ecx movl %ecx, 0x4(%rax) movq -0x30(%rbp), %rax movl -0x8(%rbp), %ecx movl %ecx, 0x8(%rax) movss -0x1c(%rbp), %xmm1 movss -0x20(%rbp), %xmm0 ucomiss %xmm1, %xmm0 jbe 0x4d19c movss -0x1c(%rbp), %xmm0 movss %xmm0, -0x34(%rbp) jmp 0x4d1a6 movss -0x20(%rbp), %xmm0 movss %xmm0, -0x34(%rbp) movss -0x34(%rbp), %xmm0 movq -0x30(%rbp), %rax movss %xmm0, 0xc(%rax) movss -0x1c(%rbp), %xmm1 movss -0x20(%rbp), %xmm0 ucomiss %xmm1, %xmm0 jbe 0x4d1cf movss -0x20(%rbp), %xmm0 movss %xmm0, -0x38(%rbp) jmp 0x4d1d9 movss -0x1c(%rbp), %xmm0 movss %xmm0, -0x38(%rbp) movss -0x38(%rbp), %xmm0 movq -0x30(%rbp), %rax movss %xmm0, 0x10(%rax) movq -0x30(%rbp), %rax movss 0x10(%rax), %xmm0 movq -0x30(%rbp), %rax subss 0xc(%rax), %xmm0 movq -0x30(%rbp), %rax movss %xmm0, 0x14(%rax) addq $0x40, %rsp popq %rbp retq nopl (%rax,%rax)
/Tigermouthbear[P]flappytiger/external/glfw/deps/nuklear.h
nk_color_pick
NK_API int nk_color_pick(struct nk_context * ctx, struct nk_colorf *color, enum nk_color_format fmt) { struct nk_window *win; struct nk_panel *layout; const struct nk_style *config; const struct nk_input *in; enum nk_widget_layout_states state; struct nk_rect bounds; NK_ASSERT(ctx); NK_ASSERT(color); NK_ASSERT(ctx->current); NK_ASSERT(ctx->current->layout); if (!ctx || !ctx->current || !ctx->current->layout || !color) return 0; win = ctx->current; config = &ctx->style; layout = win->layout; state = nk_widget(&bounds, ctx); if (!state) return 0; in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; return nk_do_color_picker(&ctx->last_widget_state, &win->buffer, color, fmt, bounds, nk_vec2(0,0), in, config->font); }
pushq %rbp movq %rsp, %rbp subq $0x90, %rsp movq %rdi, -0x10(%rbp) movq %rsi, -0x18(%rbp) movl %edx, -0x1c(%rbp) cmpq $0x0, -0x10(%rbp) je 0x4e48f jmp 0x4e4ae leaq 0x42cbc(%rip), %rdi # 0x91152 leaq 0x3ea63(%rip), %rsi # 0x8cf00 movl $0x5ee1, %edx # imm = 0x5EE1 leaq 0x441a6(%rip), %rcx # 0x9264f callq 0x1b1e0 cmpq $0x0, -0x18(%rbp) je 0x4e4b7 jmp 0x4e4d6 leaq 0x441e2(%rip), %rdi # 0x926a0 leaq 0x3ea3b(%rip), %rsi # 0x8cf00 movl $0x5ee2, %edx # imm = 0x5EE2 leaq 0x4417e(%rip), %rcx # 0x9264f callq 0x1b1e0 movq -0x10(%rbp), %rax cmpq $0x0, 0x40d8(%rax) je 0x4e4e6 jmp 0x4e505 leaq 0x41806(%rip), %rdi # 0x8fcf3 leaq 0x3ea0c(%rip), %rsi # 0x8cf00 movl $0x5ee3, %edx # imm = 0x5EE3 leaq 0x4414f(%rip), %rcx # 0x9264f callq 0x1b1e0 movq -0x10(%rbp), %rax movq 0x40d8(%rax), %rax cmpq $0x0, 0xa8(%rax) je 0x4e51c jmp 0x4e53b leaq 0x4194c(%rip), %rdi # 0x8fe6f leaq 0x3e9d6(%rip), %rsi # 0x8cf00 movl $0x5ee4, %edx # imm = 0x5EE4 leaq 0x44119(%rip), %rcx # 0x9264f callq 0x1b1e0 cmpq $0x0, -0x10(%rbp) je 0x4e56c movq -0x10(%rbp), %rax cmpq $0x0, 0x40d8(%rax) je 0x4e56c movq -0x10(%rbp), %rax movq 0x40d8(%rax), %rax cmpq $0x0, 0xa8(%rax) je 0x4e56c cmpq $0x0, -0x18(%rbp) jne 0x4e578 movl $0x0, -0x4(%rbp) jmp 0x4e664 movq -0x10(%rbp), %rax movq 0x40d8(%rax), %rax movq %rax, -0x28(%rbp) movq -0x10(%rbp), %rax addq $0x168, %rax # imm = 0x168 movq %rax, -0x38(%rbp) movq -0x28(%rbp), %rax movq 0xa8(%rax), %rax movq %rax, -0x30(%rbp) movq -0x10(%rbp), %rsi leaq -0x54(%rbp), %rdi callq 0x3b9f0 movl %eax, -0x44(%rbp) cmpl $0x0, -0x44(%rbp) jne 0x4e5c6 movl $0x0, -0x4(%rbp) jmp 0x4e664 cmpl $0x2, -0x44(%rbp) je 0x4e5dd movq -0x30(%rbp), %rax movl 0x4(%rax), %eax andl $0x1000, %eax # imm = 0x1000 cmpl $0x0, %eax je 0x4e5e5 xorl %eax, %eax movq %rax, -0x68(%rbp) jmp 0x4e5ed movq -0x10(%rbp), %rax movq %rax, -0x68(%rbp) movq -0x68(%rbp), %rax movq %rax, -0x40(%rbp) movq -0x10(%rbp), %rax addq $0x1f70, %rax # imm = 0x1F70 movq %rax, -0x88(%rbp) movq -0x28(%rbp), %rax addq $0x68, %rax movq %rax, -0x80(%rbp) movq -0x18(%rbp), %rax movq %rax, -0x78(%rbp) movl -0x1c(%rbp), %eax movl %eax, -0x6c(%rbp) xorps %xmm1, %xmm1 movaps %xmm1, %xmm0 callq 0x1bd30 movq -0x88(%rbp), %rdi movq -0x80(%rbp), %rsi movq -0x78(%rbp), %rdx movl -0x6c(%rbp), %ecx movlpd %xmm0, -0x5c(%rbp) movq -0x40(%rbp), %r8 movq -0x38(%rbp), %rax movq (%rax), %r9 movsd -0x54(%rbp), %xmm0 movsd -0x4c(%rbp), %xmm1 movsd -0x5c(%rbp), %xmm2 callq 0x4e670 movl %eax, -0x4(%rbp) movl -0x4(%rbp), %eax addq $0x90, %rsp popq %rbp retq
/Tigermouthbear[P]flappytiger/external/glfw/deps/nuklear.h
nk_combo_begin_image
NK_API int nk_combo_begin_image(struct nk_context *ctx, struct nk_image img, struct nk_vec2 size) { struct nk_window *win; struct nk_style *style; const struct nk_input *in; struct nk_rect header; int is_clicked = nk_false; enum nk_widget_layout_states s; const struct nk_style_item *background; NK_ASSERT(ctx); NK_ASSERT(ctx->current); NK_ASSERT(ctx->current->layout); if (!ctx || !ctx->current || !ctx->current->layout) return 0; win = ctx->current; style = &ctx->style; s = nk_widget(&header, ctx); if (s == NK_WIDGET_INVALID) return 0; in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_ROM)? 0: &ctx->input; if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT)) is_clicked = nk_true; /* draw combo box header background and border */ if (ctx->last_widget_state & NK_WIDGET_STATE_ACTIVED) background = &style->combo.active; else if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER) background = &style->combo.hover; else background = &style->combo.normal; if (background->type == NK_STYLE_ITEM_IMAGE) { nk_draw_image(&win->buffer, header, &background->data.image, nk_white); } else { nk_fill_rect(&win->buffer, header, style->combo.rounding, background->data.color); nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, style->combo.border_color); } { struct nk_rect bounds = {0,0,0,0}; struct nk_rect content; struct nk_rect button; enum nk_symbol_type sym; if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER) sym = style->combo.sym_hover; else if (is_clicked) sym = style->combo.sym_active; else sym = style->combo.sym_normal; /* calculate button */ button.w = header.h - 2 * style->combo.button_padding.y; button.x = (header.x + header.w - header.h) - style->combo.button_padding.y; button.y = header.y + style->combo.button_padding.y; button.h = button.w; content.x = button.x + style->combo.button.padding.x; content.y = button.y + style->combo.button.padding.y; content.w = button.w - 2 * style->combo.button.padding.x; content.h = button.h - 2 * style->combo.button.padding.y; /* draw image */ bounds.h = header.h - 2 * style->combo.content_padding.y; bounds.y = header.y + style->combo.content_padding.y; bounds.x = header.x + style->combo.content_padding.x; bounds.w = (button.x - style->combo.content_padding.y) - bounds.x; nk_draw_image(&win->buffer, bounds, &img, nk_white); /* draw open/close button */ nk_draw_button_symbol(&win->buffer, &bounds, &content, ctx->last_widget_state, &ctx->style.combo.button, sym, style->font); } return nk_combo_begin(ctx, win, size, is_clicked, header); }
pushq %rbp movq %rsp, %rbp subq $0xa0, %rsp leaq 0x10(%rbp), %rax movq %rax, -0x90(%rbp) movlpd %xmm0, -0xc(%rbp) movq %rdi, -0x18(%rbp) movl $0x0, -0x44(%rbp) cmpq $0x0, -0x18(%rbp) je 0x5072f jmp 0x5074e leaq 0x40a1c(%rip), %rdi # 0x91152 leaq 0x3c7c3(%rip), %rsi # 0x8cf00 movl $0x6092, %edx # imm = 0x6092 leaq 0x420c5(%rip), %rcx # 0x9280e callq 0x1b1e0 movq -0x18(%rbp), %rax cmpq $0x0, 0x40d8(%rax) je 0x5075e jmp 0x5077d leaq 0x3f58e(%rip), %rdi # 0x8fcf3 leaq 0x3c794(%rip), %rsi # 0x8cf00 movl $0x6093, %edx # imm = 0x6093 leaq 0x42096(%rip), %rcx # 0x9280e callq 0x1b1e0 movq -0x18(%rbp), %rax movq 0x40d8(%rax), %rax cmpq $0x0, 0xa8(%rax) je 0x50794 jmp 0x507b3 leaq 0x3f6d4(%rip), %rdi # 0x8fe6f leaq 0x3c75e(%rip), %rsi # 0x8cf00 movl $0x6094, %edx # imm = 0x6094 leaq 0x42060(%rip), %rcx # 0x9280e callq 0x1b1e0 cmpq $0x0, -0x18(%rbp) je 0x507dd movq -0x18(%rbp), %rax cmpq $0x0, 0x40d8(%rax) je 0x507dd movq -0x18(%rbp), %rax movq 0x40d8(%rax), %rax cmpq $0x0, 0xa8(%rax) jne 0x507e9 movl $0x0, -0x4(%rbp) jmp 0x50bac movq -0x18(%rbp), %rax movq 0x40d8(%rax), %rax movq %rax, -0x20(%rbp) movq -0x18(%rbp), %rax addq $0x168, %rax # imm = 0x168 movq %rax, -0x28(%rbp) movq -0x18(%rbp), %rsi leaq -0x40(%rbp), %rdi callq 0x3b9f0 movl %eax, -0x48(%rbp) cmpl $0x0, -0x48(%rbp) jne 0x50828 movl $0x0, -0x4(%rbp) jmp 0x50bac movq -0x20(%rbp), %rax movq 0xa8(%rax), %rax movl 0x4(%rax), %eax andl $0x1000, %eax # imm = 0x1000 cmpl $0x0, %eax jne 0x50846 cmpl $0x2, -0x48(%rbp) jne 0x50851 xorl %eax, %eax movq %rax, -0x98(%rbp) jmp 0x5085c movq -0x18(%rbp), %rax movq %rax, -0x98(%rbp) movq -0x98(%rbp), %rax movq %rax, -0x30(%rbp) movq -0x18(%rbp), %rdi addq $0x1f70, %rdi # imm = 0x1F70 movq -0x30(%rbp), %rsi movsd -0x40(%rbp), %xmm0 movsd -0x38(%rbp), %xmm1 xorl %edx, %edx callq 0x4ef30 cmpl $0x0, %eax je 0x50893 movl $0x1, -0x44(%rbp) movq -0x18(%rbp), %rax movl 0x1f70(%rax), %eax andl $0x20, %eax cmpl $0x0, %eax je 0x508b9 movq -0x28(%rbp), %rax addq $0x1948, %rax # imm = 0x1948 addq $0x40, %rax movq %rax, -0x50(%rbp) jmp 0x508ef movq -0x18(%rbp), %rax movl 0x1f70(%rax), %eax andl $0x10, %eax cmpl $0x0, %eax je 0x508df movq -0x28(%rbp), %rax addq $0x1948, %rax # imm = 0x1948 addq $0x20, %rax movq %rax, -0x50(%rbp) jmp 0x508ed movq -0x28(%rbp), %rax addq $0x1948, %rax # imm = 0x1948 movq %rax, -0x50(%rbp) jmp 0x508ef movq -0x50(%rbp), %rax cmpl $0x1, (%rax) jne 0x5091f movq -0x20(%rbp), %rdi addq $0x68, %rdi movq -0x50(%rbp), %rsi addq $0x8, %rsi movsd -0x40(%rbp), %xmm0 movsd -0x38(%rbp), %xmm1 movl 0x3c448(%rip), %edx # 0x8cd60 callq 0x233b0 jmp 0x5097a movq -0x20(%rbp), %rdi addq $0x68, %rdi movq -0x28(%rbp), %rax movss 0x1a88(%rax), %xmm2 movq -0x50(%rbp), %rax movsd -0x40(%rbp), %xmm0 movsd -0x38(%rbp), %xmm1 movl 0x8(%rax), %esi callq 0x222a0 movq -0x20(%rbp), %rdi addq $0x68, %rdi movq -0x28(%rbp), %rax movss 0x1a84(%rax), %xmm3 movss 0x1a88(%rax), %xmm2 movsd -0x40(%rbp), %xmm0 movsd -0x38(%rbp), %xmm1 movl 0x19a8(%rax), %esi callq 0x220a0 leaq -0x60(%rbp), %rdi xorl %esi, %esi movl $0x10, %edx callq 0x1b0f0 movq -0x18(%rbp), %rax movl 0x1f70(%rax), %eax andl $0x10, %eax cmpl $0x0, %eax je 0x509ae movq -0x28(%rbp), %rax movl 0x1a7c(%rax), %eax movl %eax, -0x84(%rbp) jmp 0x509d8 cmpl $0x0, -0x44(%rbp) je 0x509c6 movq -0x28(%rbp), %rax movl 0x1a80(%rax), %eax movl %eax, -0x84(%rbp) jmp 0x509d6 movq -0x28(%rbp), %rax movl 0x1a78(%rax), %eax movl %eax, -0x84(%rbp) jmp 0x509d8 movq -0x90(%rbp), %rsi movss -0x34(%rbp), %xmm0 movq -0x28(%rbp), %rax movss 0x1a98(%rax), %xmm1 addss %xmm1, %xmm1 subss %xmm1, %xmm0 movss %xmm0, -0x78(%rbp) movss -0x40(%rbp), %xmm0 movss -0x38(%rbp), %xmm1 addss %xmm1, %xmm0 movss -0x34(%rbp), %xmm1 subss %xmm1, %xmm0 movq -0x28(%rbp), %rax movss 0x1a98(%rax), %xmm1 subss %xmm1, %xmm0 movss %xmm0, -0x80(%rbp) movss -0x3c(%rbp), %xmm0 movq -0x28(%rbp), %rax movss 0x1a98(%rax), %xmm1 addss %xmm1, %xmm0 movss %xmm0, -0x7c(%rbp) movss -0x78(%rbp), %xmm0 movss %xmm0, -0x74(%rbp) movss -0x80(%rbp), %xmm0 movq -0x28(%rbp), %rax movss 0x1a48(%rax), %xmm1 addss %xmm1, %xmm0 movss %xmm0, -0x70(%rbp) movss -0x7c(%rbp), %xmm0 movq -0x28(%rbp), %rax movss 0x1a4c(%rax), %xmm1 addss %xmm1, %xmm0 movss %xmm0, -0x6c(%rbp) movss -0x78(%rbp), %xmm0 movq -0x28(%rbp), %rax movss 0x1a48(%rax), %xmm1 addss %xmm1, %xmm1 subss %xmm1, %xmm0 movss %xmm0, -0x68(%rbp) movss -0x74(%rbp), %xmm0 movq -0x28(%rbp), %rax movss 0x1a4c(%rax), %xmm1 addss %xmm1, %xmm1 subss %xmm1, %xmm0 movss %xmm0, -0x64(%rbp) movss -0x34(%rbp), %xmm0 movq -0x28(%rbp), %rax movss 0x1a90(%rax), %xmm1 addss %xmm1, %xmm1 subss %xmm1, %xmm0 movss %xmm0, -0x54(%rbp) movss -0x3c(%rbp), %xmm0 movq -0x28(%rbp), %rax movss 0x1a90(%rax), %xmm1 addss %xmm1, %xmm0 movss %xmm0, -0x5c(%rbp) movss -0x40(%rbp), %xmm0 movq -0x28(%rbp), %rax movss 0x1a8c(%rax), %xmm1 addss %xmm1, %xmm0 movss %xmm0, -0x60(%rbp) movss -0x80(%rbp), %xmm0 movq -0x28(%rbp), %rax movss 0x1a90(%rax), %xmm1 subss %xmm1, %xmm0 movss -0x60(%rbp), %xmm1 subss %xmm1, %xmm0 movss %xmm0, -0x58(%rbp) movq -0x20(%rbp), %rdi addq $0x68, %rdi movsd -0x60(%rbp), %xmm0 movsd -0x58(%rbp), %xmm1 movl 0x3c216(%rip), %edx # 0x8cd60 callq 0x233b0 movq -0x20(%rbp), %rdi addq $0x68, %rdi movq -0x18(%rbp), %r8 movl 0x1f70(%r8), %ecx addq $0x1b30, %r8 # imm = 0x1B30 movl -0x84(%rbp), %r9d movq -0x28(%rbp), %rax movq (%rax), %rdx movq %rsp, %rax movq %rdx, (%rax) leaq -0x60(%rbp), %rsi leaq -0x70(%rbp), %rdx callq 0x4f080 movq -0x18(%rbp), %rdi movq -0x20(%rbp), %rsi movl -0x44(%rbp), %edx movsd -0xc(%rbp), %xmm0 movsd -0x40(%rbp), %xmm1 movsd -0x38(%rbp), %xmm2 callq 0x4f150 movl %eax, -0x4(%rbp) movl -0x4(%rbp), %eax addq $0xa0, %rsp popq %rbp retq nopl (%rax,%rax)
/Tigermouthbear[P]flappytiger/external/glfw/deps/nuklear.h
nk_combo_callback
NK_API int nk_combo_callback(struct nk_context *ctx, void(*item_getter)(void*, int, const char**), void *userdata, int selected, int count, int item_height, struct nk_vec2 size) { int i; int max_height; struct nk_vec2 item_spacing; struct nk_vec2 window_padding; const char *item; NK_ASSERT(ctx); NK_ASSERT(item_getter); if (!ctx || !item_getter) return selected; /* calculate popup window */ item_spacing = ctx->style.window.spacing; window_padding = nk_panel_get_padding(&ctx->style, ctx->current->layout->type); max_height = count * item_height + count * (int)item_spacing.y; max_height += (int)item_spacing.y * 2 + (int)window_padding.y * 2; size.y = NK_MIN(size.y, (float)max_height); item_getter(userdata, selected, &item); if (nk_combo_begin_label(ctx, item, size)) { nk_layout_row_dynamic(ctx, (float)item_height, 1); for (i = 0; i < count; ++i) { item_getter(userdata, i, &item); if (nk_combo_item_label(ctx, item, NK_TEXT_LEFT)) selected = i; } nk_combo_end(ctx); } return selected; }
pushq %rbp movq %rsp, %rbp subq $0x70, %rsp movlpd %xmm0, -0xc(%rbp) movq %rdi, -0x18(%rbp) movq %rsi, -0x20(%rbp) movq %rdx, -0x28(%rbp) movl %ecx, -0x2c(%rbp) movl %r8d, -0x30(%rbp) movl %r9d, -0x34(%rbp) cmpq $0x0, -0x18(%rbp) je 0x5195d jmp 0x5197c leaq 0x3f7ee(%rip), %rdi # 0x91152 leaq 0x3b595(%rip), %rsi # 0x8cf00 movl $0x61c3, %edx # imm = 0x61C3 leaq 0x4101e(%rip), %rcx # 0x92995 callq 0x1b1e0 cmpq $0x0, -0x20(%rbp) je 0x51985 jmp 0x519a4 leaq 0x41081(%rip), %rdi # 0x92a0d leaq 0x3b56d(%rip), %rsi # 0x8cf00 movl $0x61c4, %edx # imm = 0x61C4 leaq 0x40ff6(%rip), %rcx # 0x92995 callq 0x1b1e0 cmpq $0x0, -0x18(%rbp) je 0x519b2 cmpq $0x0, -0x20(%rbp) jne 0x519bd movl -0x2c(%rbp), %eax movl %eax, -0x4(%rbp) jmp 0x51aec movq -0x18(%rbp), %rax movq 0x1e8c(%rax), %rax movq %rax, -0x48(%rbp) movq -0x18(%rbp), %rax movq %rax, %rdi addq $0x168, %rdi # imm = 0x168 movq 0x40d8(%rax), %rax movq 0xa8(%rax), %rax movl (%rax), %esi callq 0x3b380 movlpd %xmm0, -0x60(%rbp) movq -0x60(%rbp), %rax movq %rax, -0x50(%rbp) movl -0x30(%rbp), %eax imull -0x34(%rbp), %eax movl -0x30(%rbp), %ecx cvttss2si -0x44(%rbp), %edx imull %edx, %ecx addl %ecx, %eax movl %eax, -0x3c(%rbp) cvttss2si -0x44(%rbp), %eax shll %eax cvttss2si -0x4c(%rbp), %ecx shll %ecx addl %ecx, %eax addl -0x3c(%rbp), %eax movl %eax, -0x3c(%rbp) movss -0x8(%rbp), %xmm1 cvtsi2ssl -0x3c(%rbp), %xmm0 ucomiss %xmm1, %xmm0 jbe 0x51a44 movss -0x8(%rbp), %xmm0 movss %xmm0, -0x64(%rbp) jmp 0x51a4e cvtsi2ssl -0x3c(%rbp), %xmm0 movss %xmm0, -0x64(%rbp) movss -0x64(%rbp), %xmm0 movss %xmm0, -0x8(%rbp) movq -0x20(%rbp), %rax movq -0x28(%rbp), %rdi movl -0x2c(%rbp), %esi leaq -0x58(%rbp), %rdx callq *%rax movq -0x18(%rbp), %rdi movq -0x58(%rbp), %rsi movsd -0xc(%rbp), %xmm0 callq 0x4f3e0 cmpl $0x0, %eax je 0x51ae6 movq -0x18(%rbp), %rdi cvtsi2ssl -0x34(%rbp), %xmm0 movl $0x1, %esi callq 0x3d030 movl $0x0, -0x38(%rbp) movl -0x38(%rbp), %eax cmpl -0x30(%rbp), %eax jge 0x51add movq -0x20(%rbp), %rax movq -0x28(%rbp), %rdi movl -0x38(%rbp), %esi leaq -0x58(%rbp), %rdx callq *%rax movq -0x18(%rbp), %rdi movq -0x58(%rbp), %rsi movl $0x11, %edx callq 0x512c0 cmpl $0x0, %eax je 0x51ad0 movl -0x38(%rbp), %eax movl %eax, -0x2c(%rbp) jmp 0x51ad2 movl -0x38(%rbp), %eax addl $0x1, %eax movl %eax, -0x38(%rbp) jmp 0x51a9a movq -0x18(%rbp), %rdi callq 0x51400 movl -0x2c(%rbp), %eax movl %eax, -0x4(%rbp) movl -0x4(%rbp), %eax addq $0x70, %rsp popq %rbp retq nopw %cs:(%rax,%rax)
/Tigermouthbear[P]flappytiger/external/glfw/deps/nuklear.h
nk_glfw3_render
NK_API void nk_glfw3_render(enum nk_anti_aliasing AA) { /* setup global state */ struct nk_glfw_device *dev = &glfw.ogl; glPushAttrib(GL_ENABLE_BIT|GL_COLOR_BUFFER_BIT|GL_TRANSFORM_BIT); glDisable(GL_CULL_FACE); glDisable(GL_DEPTH_TEST); glEnable(GL_SCISSOR_TEST); glEnable(GL_BLEND); glEnable(GL_TEXTURE_2D); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); /* setup viewport/project */ glViewport(0,0,(GLsizei)glfw.display_width,(GLsizei)glfw.display_height); glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); glOrtho(0.0f, glfw.width, glfw.height, 0.0f, -1.0f, 1.0f); glMatrixMode(GL_MODELVIEW); glPushMatrix(); glLoadIdentity(); glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glEnableClientState(GL_COLOR_ARRAY); { GLsizei vs = sizeof(struct nk_glfw_vertex); size_t vp = offsetof(struct nk_glfw_vertex, position); size_t vt = offsetof(struct nk_glfw_vertex, uv); size_t vc = offsetof(struct nk_glfw_vertex, col); /* convert from command queue into draw list and draw to screen */ const struct nk_draw_command *cmd; const nk_draw_index *offset = NULL; struct nk_buffer vbuf, ebuf; /* fill convert configuration */ struct nk_convert_config config; static const struct nk_draw_vertex_layout_element vertex_layout[] = { {NK_VERTEX_POSITION, NK_FORMAT_FLOAT, NK_OFFSETOF(struct nk_glfw_vertex, position)}, {NK_VERTEX_TEXCOORD, NK_FORMAT_FLOAT, NK_OFFSETOF(struct nk_glfw_vertex, uv)}, {NK_VERTEX_COLOR, NK_FORMAT_R8G8B8A8, NK_OFFSETOF(struct nk_glfw_vertex, col)}, {NK_VERTEX_LAYOUT_END} }; NK_MEMSET(&config, 0, sizeof(config)); config.vertex_layout = vertex_layout; config.vertex_size = sizeof(struct nk_glfw_vertex); config.vertex_alignment = NK_ALIGNOF(struct nk_glfw_vertex); config.null = dev->null; config.circle_segment_count = 22; config.curve_segment_count = 22; config.arc_segment_count = 22; config.global_alpha = 1.0f; config.shape_AA = AA; config.line_AA = AA; /* convert shapes into vertexes */ nk_buffer_init_default(&vbuf); nk_buffer_init_default(&ebuf); nk_convert(&glfw.ctx, &dev->cmds, &vbuf, &ebuf, &config); /* setup vertex buffer pointer */ {const void *vertices = nk_buffer_memory_const(&vbuf); glVertexPointer(2, GL_FLOAT, vs, (const void*)((const nk_byte*)vertices + vp)); glTexCoordPointer(2, GL_FLOAT, vs, (const void*)((const nk_byte*)vertices + vt)); glColorPointer(4, GL_UNSIGNED_BYTE, vs, (const void*)((const nk_byte*)vertices + vc));} /* iterate over and execute each draw command */ offset = (const nk_draw_index*)nk_buffer_memory_const(&ebuf); nk_draw_foreach(cmd, &glfw.ctx, &dev->cmds) { if (!cmd->elem_count) continue; glBindTexture(GL_TEXTURE_2D, (GLuint)cmd->texture.id); glScissor( (GLint)(cmd->clip_rect.x * glfw.fb_scale.x), (GLint)((glfw.height - (GLint)(cmd->clip_rect.y + cmd->clip_rect.h)) * glfw.fb_scale.y), (GLint)(cmd->clip_rect.w * glfw.fb_scale.x), (GLint)(cmd->clip_rect.h * glfw.fb_scale.y)); glDrawElements(GL_TRIANGLES, (GLsizei)cmd->elem_count, GL_UNSIGNED_SHORT, offset); offset += cmd->elem_count; } nk_clear(&glfw.ctx); nk_buffer_free(&vbuf); nk_buffer_free(&ebuf); } /* default OpenGL state */ glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisableClientState(GL_COLOR_ARRAY); glDisable(GL_CULL_FACE); glDisable(GL_DEPTH_TEST); glDisable(GL_SCISSOR_TEST); glDisable(GL_BLEND); glDisable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, 0); glMatrixMode(GL_MODELVIEW); glPopMatrix(); glMatrixMode(GL_PROJECTION); glPopMatrix(); glPopAttrib(); }
pushq %rbp movq %rsp, %rbp subq $0x180, %rsp # imm = 0x180 movl %edi, -0x4(%rbp) leaq 0x7509b(%rip), %rax # 0xc7310 addq $0x18, %rax movq %rax, -0x10(%rbp) movl $0x7000, %edi # imm = 0x7000 leaq 0x7a687(%rip), %rax # 0xcc910 callq *(%rax) movl $0xb44, %edi # imm = 0xB44 leaq 0x79c51(%rip), %rax # 0xcbee8 callq *(%rax) movl $0xb71, %edi # imm = 0xB71 leaq 0x79c43(%rip), %rax # 0xcbee8 callq *(%rax) movl $0xc11, %edi # imm = 0xC11 leaq 0x79cc5(%rip), %rax # 0xcbf78 callq *(%rax) movl $0xbe2, %edi # imm = 0xBE2 leaq 0x79cb7(%rip), %rax # 0xcbf78 callq *(%rax) movl $0xde1, %edi # imm = 0xDE1 leaq 0x79ca9(%rip), %rax # 0xcbf78 callq *(%rax) movl $0x302, %edi # imm = 0x302 movl $0x303, %esi # imm = 0x303 leaq 0x798fe(%rip), %rax # 0xcbbe0 callq *(%rax) leaq 0x7af3d(%rip), %rax # 0xcd228 movq (%rax), %rax movl 0x7502c(%rip), %edx # 0xc7320 movl 0x7502a(%rip), %ecx # 0xc7324 xorl %esi, %esi movl %esi, %edi callq *%rax movl $0x1701, %edi # imm = 0x1701 leaq 0x7a334(%rip), %rax # 0xcc640 callq *(%rax) leaq 0x7a613(%rip), %rax # 0xcc928 callq *(%rax) leaq 0x7a27a(%rip), %rax # 0xcc598 callq *(%rax) leaq 0x7a519(%rip), %rax # 0xcc840 movq (%rax), %rax cvtsi2sdl 0x74fe6(%rip), %xmm1 # 0xc7318 cvtsi2sdl 0x74fe2(%rip), %xmm2 # 0xc731c xorps %xmm3, %xmm3 movsd 0x36dcb(%rip), %xmm4 # 0x89110 movsd 0x36dbb(%rip), %xmm5 # 0x89108 movaps %xmm3, %xmm0 callq *%rax movl $0x1700, %edi # imm = 0x1700 leaq 0x7a2e2(%rip), %rax # 0xcc640 callq *(%rax) leaq 0x7a5c1(%rip), %rax # 0xcc928 callq *(%rax) leaq 0x7a228(%rip), %rax # 0xcc598 callq *(%rax) movl $0x8074, %edi # imm = 0x8074 leaq 0x79c02(%rip), %rax # 0xcbf80 callq *(%rax) movl $0x8078, %edi # imm = 0x8078 leaq 0x79bf4(%rip), %rax # 0xcbf80 callq *(%rax) movl $0x8076, %edi # imm = 0x8076 leaq 0x79be6(%rip), %rax # 0xcbf80 callq *(%rax) movl $0x14, -0x14(%rbp) movq $0x0, -0x20(%rbp) movq $0x8, -0x28(%rbp) movq $0x10, -0x30(%rbp) movq $0x0, -0x40(%rbp) leaq -0x170(%rbp), %rdi xorl %esi, %esi movl $0x40, %edx callq 0x33f50 leaq 0x3a993(%rip), %rax # 0x8cd70 movq %rax, -0x148(%rbp) movq $0x14, -0x140(%rbp) xorl %eax, %eax addq $0x4, %rax movq %rax, -0x138(%rbp) movq -0x10(%rbp), %rax movq 0x78(%rax), %rcx movq %rcx, -0x158(%rbp) movq 0x80(%rax), %rax movq %rax, -0x150(%rbp) movl $0x16, -0x164(%rbp) movl $0x16, -0x15c(%rbp) movl $0x16, -0x160(%rbp) movss 0x36bc9(%rip), %xmm0 # 0x89008 movss %xmm0, -0x170(%rbp) movl -0x4(%rbp), %eax movl %eax, -0x168(%rbp) movl -0x4(%rbp), %eax movl %eax, -0x16c(%rbp) leaq -0xb8(%rbp), %rdi callq 0x1f4e0 leaq -0x130(%rbp), %rdi callq 0x1f4e0 movq -0x10(%rbp), %rsi leaq 0x74e94(%rip), %rdi # 0xc7310 addq $0xa8, %rdi leaq -0xb8(%rbp), %rdx leaq -0x130(%rbp), %rcx leaq -0x170(%rbp), %r8 callq 0x28fd0 leaq -0xb8(%rbp), %rdi callq 0x20330 movq %rax, -0x178(%rbp) leaq 0x7ad69(%rip), %rax # 0xcd220 movq (%rax), %rax movl -0x14(%rbp), %edx movq -0x178(%rbp), %rcx addq -0x20(%rbp), %rcx movl $0x2, %edi movl $0x1406, %esi # imm = 0x1406 callq *%rax leaq 0x7a835(%rip), %rax # 0xccd10 movq (%rax), %rax movl -0x14(%rbp), %edx movq -0x178(%rbp), %rcx addq -0x28(%rbp), %rcx movl $0x2, %edi movl $0x1406, %esi # imm = 0x1406 callq *%rax leaq 0x798c9(%rip), %rax # 0xcbdc8 movq (%rax), %rax movl -0x14(%rbp), %edx movq -0x178(%rbp), %rcx addq -0x30(%rbp), %rcx movl $0x4, %edi movl $0x1401, %esi # imm = 0x1401 callq *%rax leaq -0x130(%rbp), %rdi callq 0x20330 movq %rax, -0x40(%rbp) movq -0x10(%rbp), %rsi leaq 0x74dd9(%rip), %rdi # 0xc7310 addq $0xa8, %rdi callq 0x2a050 movq %rax, -0x38(%rbp) cmpq $0x0, -0x38(%rbp) je 0x5264b movq -0x38(%rbp), %rax cmpl $0x0, (%rax) jne 0x52560 jmp 0x52627 leaq 0x79649(%rip), %rax # 0xcbbb0 movq (%rax), %rax movq -0x38(%rbp), %rcx movl 0x18(%rcx), %esi movl $0xde1, %edi # imm = 0xDE1 callq *%rax leaq 0x7a561(%rip), %rax # 0xccae0 movq (%rax), %rax movq -0x38(%rbp), %rcx movss 0x4(%rcx), %xmm0 mulss 0x790a5(%rip), %xmm0 # 0xcb638 cvttss2si %xmm0, %edi movl 0x74d7f(%rip), %ecx # 0xc731c movq -0x38(%rbp), %rdx movss 0x8(%rdx), %xmm0 movq -0x38(%rbp), %rdx addss 0x10(%rdx), %xmm0 cvttss2si %xmm0, %edx subl %edx, %ecx cvtsi2ss %ecx, %xmm0 mulss 0x7907b(%rip), %xmm0 # 0xcb63c cvttss2si %xmm0, %esi movq -0x38(%rbp), %rcx movss 0xc(%rcx), %xmm0 mulss 0x79062(%rip), %xmm0 # 0xcb638 cvttss2si %xmm0, %edx movq -0x38(%rbp), %rcx movss 0x10(%rcx), %xmm0 mulss 0x79051(%rip), %xmm0 # 0xcb63c cvttss2si %xmm0, %ecx callq *%rax leaq 0x79930(%rip), %rax # 0xcbf28 movq (%rax), %rax movq -0x38(%rbp), %rcx movl (%rcx), %esi movq -0x40(%rbp), %rcx movl $0x4, %edi movl $0x1403, %edx # imm = 0x1403 callq *%rax movq -0x38(%rbp), %rax movl (%rax), %ecx movq -0x40(%rbp), %rax movl %ecx, %ecx shlq %rcx addq %rcx, %rax movq %rax, -0x40(%rbp) movq -0x38(%rbp), %rdi movq -0x10(%rbp), %rsi leaq 0x74cda(%rip), %rdx # 0xc7310 addq $0xa8, %rdx callq 0x2a0b0 movq %rax, -0x38(%rbp) jmp 0x52547 leaq 0x74cbe(%rip), %rdi # 0xc7310 addq $0xa8, %rdi callq 0x33c20 leaq -0xb8(%rbp), %rdi callq 0x20150 leaq -0x130(%rbp), %rdi callq 0x20150 movl $0x8074, %edi # imm = 0x8074 leaq 0x7986e(%rip), %rax # 0xcbef0 callq *(%rax) movl $0x8078, %edi # imm = 0x8078 leaq 0x79860(%rip), %rax # 0xcbef0 callq *(%rax) movl $0x8076, %edi # imm = 0x8076 leaq 0x79852(%rip), %rax # 0xcbef0 callq *(%rax) movl $0xb44, %edi # imm = 0xB44 leaq 0x7983c(%rip), %rax # 0xcbee8 callq *(%rax) movl $0xb71, %edi # imm = 0xB71 leaq 0x7982e(%rip), %rax # 0xcbee8 callq *(%rax) movl $0xc11, %edi # imm = 0xC11 leaq 0x79820(%rip), %rax # 0xcbee8 callq *(%rax) movl $0xbe2, %edi # imm = 0xBE2 leaq 0x79812(%rip), %rax # 0xcbee8 callq *(%rax) movl $0xde1, %edi # imm = 0xDE1 leaq 0x79804(%rip), %rax # 0xcbee8 callq *(%rax) movl $0xde1, %edi # imm = 0xDE1 xorl %esi, %esi leaq 0x794bc(%rip), %rax # 0xcbbb0 callq *(%rax) movl $0x1700, %edi # imm = 0x1700 leaq 0x79f3e(%rip), %rax # 0xcc640 callq *(%rax) leaq 0x7a1dd(%rip), %rax # 0xcc8e8 callq *(%rax) movl $0x1701, %edi # imm = 0x1701 leaq 0x79f27(%rip), %rax # 0xcc640 callq *(%rax) leaq 0x7a1c6(%rip), %rax # 0xcc8e8 callq *(%rax) leaq 0x7a1a5(%rip), %rax # 0xcc8d0 callq *(%rax) addq $0x180, %rsp # imm = 0x180 popq %rbp retq nopw %cs:(%rax,%rax)
/Tigermouthbear[P]flappytiger/external/glfw/deps/nuklear_glfw_gl2.h
nk_range_glyph_count
NK_INTERN int nk_range_glyph_count(const nk_rune *range, int count) { int i = 0; int total_glyphs = 0; for (i = 0; i < count; ++i) { int diff; nk_rune f = range[(i*2)+0]; nk_rune t = range[(i*2)+1]; NK_ASSERT(t >= f); diff = (int)((t - f) + 1); total_glyphs += diff; } return total_glyphs; }
pushq %rbp movq %rsp, %rbp subq $0x20, %rsp movq %rdi, -0x8(%rbp) movl %esi, -0xc(%rbp) movl $0x0, -0x10(%rbp) movl $0x0, -0x14(%rbp) movl $0x0, -0x10(%rbp) movl -0x10(%rbp), %eax cmpl -0xc(%rbp), %eax jge 0x558ef movq -0x8(%rbp), %rax movl -0x10(%rbp), %ecx shll %ecx addl $0x0, %ecx movslq %ecx, %rcx movl (%rax,%rcx,4), %eax movl %eax, -0x1c(%rbp) movq -0x8(%rbp), %rax movl -0x10(%rbp), %ecx shll %ecx addl $0x1, %ecx movslq %ecx, %rcx movl (%rax,%rcx,4), %eax movl %eax, -0x20(%rbp) movl -0x20(%rbp), %eax cmpl -0x1c(%rbp), %eax jb 0x558b0 jmp 0x558cf leaq 0x3dc45(%rip), %rdi # 0x934fc leaq 0x37642(%rip), %rsi # 0x8cf00 movl $0x3101, %edx # imm = 0x3101 leaq 0x3dc39(%rip), %rcx # 0x93503 callq 0x1b1e0 movl -0x20(%rbp), %eax subl -0x1c(%rbp), %eax addl $0x1, %eax movl %eax, -0x18(%rbp) movl -0x18(%rbp), %eax addl -0x14(%rbp), %eax movl %eax, -0x14(%rbp) movl -0x10(%rbp), %eax addl $0x1, %eax movl %eax, -0x10(%rbp) jmp 0x55874 movl -0x14(%rbp), %eax addq $0x20, %rsp popq %rbp retq nopl (%rax,%rax)
/Tigermouthbear[P]flappytiger/external/glfw/deps/nuklear.h
nk_tt_PackBegin
NK_INTERN int nk_tt_PackBegin(struct nk_tt_pack_context *spc, unsigned char *pixels, int pw, int ph, int stride_in_bytes, int padding, struct nk_allocator *alloc) { int num_nodes = pw - padding; struct nk_rp_context *context = (struct nk_rp_context *) alloc->alloc(alloc->userdata,0, sizeof(*context)); struct nk_rp_node *nodes = (struct nk_rp_node*) alloc->alloc(alloc->userdata,0, (sizeof(*nodes ) * (nk_size)num_nodes)); if (context == 0 || nodes == 0) { if (context != 0) alloc->free(alloc->userdata, context); if (nodes != 0) alloc->free(alloc->userdata, nodes); return 0; } spc->width = pw; spc->height = ph; spc->pixels = pixels; spc->pack_info = context; spc->nodes = nodes; spc->padding = padding; spc->stride_in_bytes = (stride_in_bytes != 0) ? stride_in_bytes : pw; spc->h_oversample = 1; spc->v_oversample = 1; nk_rp_init_target(context, pw-padding, ph-padding, nodes, num_nodes); if (pixels) NK_MEMSET(pixels, 0, (nk_size)(pw*ph)); /* background of 0 around pixels */ return 1; }
pushq %rbp movq %rsp, %rbp subq $0x50, %rsp movq 0x10(%rbp), %rax movq %rdi, -0x10(%rbp) movq %rsi, -0x18(%rbp) movl %edx, -0x1c(%rbp) movl %ecx, -0x20(%rbp) movl %r8d, -0x24(%rbp) movl %r9d, -0x28(%rbp) movl -0x1c(%rbp), %eax subl -0x28(%rbp), %eax movl %eax, -0x2c(%rbp) movq 0x10(%rbp), %rax movq 0x8(%rax), %rax movq 0x10(%rbp), %rcx movq (%rcx), %rdi xorl %ecx, %ecx movl %ecx, %esi movl $0x48, %edx callq *%rax movq %rax, -0x38(%rbp) movq 0x10(%rbp), %rax movq 0x8(%rax), %rax movq 0x10(%rbp), %rcx movslq -0x2c(%rbp), %rdx shlq $0x4, %rdx movq (%rcx), %rdi xorl %ecx, %ecx movl %ecx, %esi callq *%rax movq %rax, -0x40(%rbp) cmpq $0x0, -0x38(%rbp) je 0x55c38 cmpq $0x0, -0x40(%rbp) jne 0x55c7c cmpq $0x0, -0x38(%rbp) je 0x55c54 movq 0x10(%rbp), %rax movq 0x10(%rax), %rax movq 0x10(%rbp), %rcx movq -0x38(%rbp), %rsi movq (%rcx), %rdi callq *%rax cmpq $0x0, -0x40(%rbp) je 0x55c70 movq 0x10(%rbp), %rax movq 0x10(%rax), %rax movq 0x10(%rbp), %rcx movq -0x40(%rbp), %rsi movq (%rcx), %rdi callq *%rax movl $0x0, -0x4(%rbp) jmp 0x55d31 movl -0x1c(%rbp), %ecx movq -0x10(%rbp), %rax movl %ecx, 0x8(%rax) movl -0x20(%rbp), %ecx movq -0x10(%rbp), %rax movl %ecx, 0xc(%rax) movq -0x18(%rbp), %rcx movq -0x10(%rbp), %rax movq %rcx, 0x20(%rax) movq -0x38(%rbp), %rcx movq -0x10(%rbp), %rax movq %rcx, (%rax) movq -0x40(%rbp), %rcx movq -0x10(%rbp), %rax movq %rcx, 0x28(%rax) movl -0x28(%rbp), %ecx movq -0x10(%rbp), %rax movl %ecx, 0x14(%rax) cmpl $0x0, -0x24(%rbp) je 0x55ccb movl -0x24(%rbp), %eax movl %eax, -0x44(%rbp) jmp 0x55cd1 movl -0x1c(%rbp), %eax movl %eax, -0x44(%rbp) movl -0x44(%rbp), %ecx movq -0x10(%rbp), %rax movl %ecx, 0x10(%rax) movq -0x10(%rbp), %rax movl $0x1, 0x18(%rax) movq -0x10(%rbp), %rax movl $0x1, 0x1c(%rax) movq -0x38(%rbp), %rdi movl -0x1c(%rbp), %esi subl -0x28(%rbp), %esi movl -0x20(%rbp), %edx subl -0x28(%rbp), %edx movq -0x40(%rbp), %rcx movl -0x2c(%rbp), %r8d callq 0x56300 cmpq $0x0, -0x18(%rbp) je 0x55d2a movq -0x18(%rbp), %rdi movl -0x1c(%rbp), %eax imull -0x20(%rbp), %eax movslq %eax, %rdx xorl %esi, %esi callq 0x33f50 movl $0x1, -0x4(%rbp) movl -0x4(%rbp), %eax addq $0x50, %rsp popq %rbp retq nopw (%rax,%rax)
/Tigermouthbear[P]flappytiger/external/glfw/deps/nuklear.h
nk_rp_init_target
NK_INTERN void nk_rp_init_target(struct nk_rp_context *context, int width, int height, struct nk_rp_node *nodes, int num_nodes) { int i; #ifndef STBRP_LARGE_RECTS NK_ASSERT(width <= 0xffff && height <= 0xffff); #endif for (i=0; i < num_nodes-1; ++i) nodes[i].next = &nodes[i+1]; nodes[i].next = 0; context->init_mode = NK_RP__INIT_skyline; context->heuristic = NK_RP_HEURISTIC_Skyline_default; context->free_head = &nodes[0]; context->active_head = &context->extra[0]; context->width = width; context->height = height; context->num_nodes = num_nodes; nk_rp_setup_allow_out_of_mem(context, 0); /* node 0 is the full width, node 1 is the sentinel (lets us not store width explicitly) */ context->extra[0].x = 0; context->extra[0].y = 0; context->extra[0].next = &context->extra[1]; context->extra[1].x = (nk_rp_coord) width; context->extra[1].y = 65535; context->extra[1].next = 0; }
pushq %rbp movq %rsp, %rbp subq $0x20, %rsp movq %rdi, -0x8(%rbp) movl %esi, -0xc(%rbp) movl %edx, -0x10(%rbp) movq %rcx, -0x18(%rbp) movl %r8d, -0x1c(%rbp) cmpl $0xffff, -0xc(%rbp) # imm = 0xFFFF jg 0x5632e cmpl $0xffff, -0x10(%rbp) # imm = 0xFFFF jg 0x5632e jmp 0x5634d leaq 0x3d31c(%rip), %rdi # 0x93651 leaq 0x36bc4(%rip), %rsi # 0x8cf00 movl $0x292f, %edx # imm = 0x292F leaq 0x3d32d(%rip), %rcx # 0x93675 callq 0x1b1e0 movl $0x0, -0x20(%rbp) movl -0x20(%rbp), %eax movl -0x1c(%rbp), %ecx subl $0x1, %ecx cmpl %ecx, %eax jge 0x56392 movq -0x18(%rbp), %rcx movl -0x20(%rbp), %eax addl $0x1, %eax cltq shlq $0x4, %rax addq %rax, %rcx movq -0x18(%rbp), %rax movslq -0x20(%rbp), %rdx shlq $0x4, %rdx addq %rdx, %rax movq %rcx, 0x8(%rax) movl -0x20(%rbp), %eax addl $0x1, %eax movl %eax, -0x20(%rbp) jmp 0x56354 movq -0x18(%rbp), %rax movslq -0x20(%rbp), %rcx shlq $0x4, %rcx addq %rcx, %rax movq $0x0, 0x8(%rax) movq -0x8(%rbp), %rax movl $0x1, 0xc(%rax) movq -0x8(%rbp), %rax movl $0x0, 0x10(%rax) movq -0x18(%rbp), %rcx movq -0x8(%rbp), %rax movq %rcx, 0x20(%rax) movq -0x8(%rbp), %rcx addq $0x28, %rcx movq -0x8(%rbp), %rax movq %rcx, 0x18(%rax) movl -0xc(%rbp), %ecx movq -0x8(%rbp), %rax movl %ecx, (%rax) movl -0x10(%rbp), %ecx movq -0x8(%rbp), %rax movl %ecx, 0x4(%rax) movl -0x1c(%rbp), %ecx movq -0x8(%rbp), %rax movl %ecx, 0x14(%rax) movq -0x8(%rbp), %rdi xorl %esi, %esi callq 0x56460 movq -0x8(%rbp), %rax movw $0x0, 0x28(%rax) movq -0x8(%rbp), %rax movw $0x0, 0x2a(%rax) movq -0x8(%rbp), %rcx addq $0x28, %rcx addq $0x10, %rcx movq -0x8(%rbp), %rax movq %rcx, 0x30(%rax) movl -0xc(%rbp), %eax movw %ax, %cx movq -0x8(%rbp), %rax movw %cx, 0x38(%rax) movq -0x8(%rbp), %rax movw $0xffff, 0x3a(%rax) # imm = 0xFFFF movq -0x8(%rbp), %rax movq $0x0, 0x40(%rax) addq $0x20, %rsp popq %rbp retq nopw %cs:(%rax,%rax)
/Tigermouthbear[P]flappytiger/external/glfw/deps/nuklear.h
nk_tt_PackFontRangesRenderIntoRects
NK_INTERN int nk_tt_PackFontRangesRenderIntoRects(struct nk_tt_pack_context *spc, struct nk_tt_fontinfo *info, struct nk_tt_pack_range *ranges, int num_ranges, struct nk_rp_rect *rects, struct nk_allocator *alloc) { int i,j,k, return_value = 1; /* save current values */ int old_h_over = (int)spc->h_oversample; int old_v_over = (int)spc->v_oversample; /* rects array must be big enough to accommodate all characters in the given ranges */ k = 0; for (i=0; i < num_ranges; ++i) { float fh = ranges[i].font_size; float recip_h,recip_v,sub_x,sub_y; float scale = fh > 0 ? nk_tt_ScaleForPixelHeight(info, fh): nk_tt_ScaleForMappingEmToPixels(info, -fh); spc->h_oversample = ranges[i].h_oversample; spc->v_oversample = ranges[i].v_oversample; recip_h = 1.0f / (float)spc->h_oversample; recip_v = 1.0f / (float)spc->v_oversample; sub_x = nk_tt__oversample_shift((int)spc->h_oversample); sub_y = nk_tt__oversample_shift((int)spc->v_oversample); for (j=0; j < ranges[i].num_chars; ++j) { struct nk_rp_rect *r = &rects[k]; if (r->was_packed) { struct nk_tt_packedchar *bc = &ranges[i].chardata_for_range[j]; int advance, lsb, x0,y0,x1,y1; int codepoint = ranges[i].first_unicode_codepoint_in_range ? ranges[i].first_unicode_codepoint_in_range + j : ranges[i].array_of_unicode_codepoints[j]; int glyph = nk_tt_FindGlyphIndex(info, codepoint); nk_rp_coord pad = (nk_rp_coord) spc->padding; /* pad on left and top */ r->x = (nk_rp_coord)((int)r->x + (int)pad); r->y = (nk_rp_coord)((int)r->y + (int)pad); r->w = (nk_rp_coord)((int)r->w - (int)pad); r->h = (nk_rp_coord)((int)r->h - (int)pad); nk_tt_GetGlyphHMetrics(info, glyph, &advance, &lsb); nk_tt_GetGlyphBitmapBox(info, glyph, scale * (float)spc->h_oversample, (scale * (float)spc->v_oversample), &x0,&y0,&x1,&y1); nk_tt_MakeGlyphBitmapSubpixel(info, spc->pixels + r->x + r->y*spc->stride_in_bytes, (int)(r->w - spc->h_oversample+1), (int)(r->h - spc->v_oversample+1), spc->stride_in_bytes, scale * (float)spc->h_oversample, scale * (float)spc->v_oversample, 0,0, glyph, alloc); if (spc->h_oversample > 1) nk_tt__h_prefilter(spc->pixels + r->x + r->y*spc->stride_in_bytes, r->w, r->h, spc->stride_in_bytes, (int)spc->h_oversample); if (spc->v_oversample > 1) nk_tt__v_prefilter(spc->pixels + r->x + r->y*spc->stride_in_bytes, r->w, r->h, spc->stride_in_bytes, (int)spc->v_oversample); bc->x0 = (nk_ushort) r->x; bc->y0 = (nk_ushort) r->y; bc->x1 = (nk_ushort) (r->x + r->w); bc->y1 = (nk_ushort) (r->y + r->h); bc->xadvance = scale * (float)advance; bc->xoff = (float) x0 * recip_h + sub_x; bc->yoff = (float) y0 * recip_v + sub_y; bc->xoff2 = ((float)x0 + r->w) * recip_h + sub_x; bc->yoff2 = ((float)y0 + r->h) * recip_v + sub_y; } else { return_value = 0; /* if any fail, report failure */ } ++k; } } /* restore original values */ spc->h_oversample = (unsigned int)old_h_over; spc->v_oversample = (unsigned int)old_v_over; return return_value; }
pushq %rbp movq %rsp, %rbp subq $0xb0, %rsp movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movq %rdx, -0x18(%rbp) movl %ecx, -0x1c(%rbp) movq %r8, -0x28(%rbp) movq %r9, -0x30(%rbp) movl $0x1, -0x40(%rbp) movq -0x8(%rbp), %rax movl 0x18(%rax), %eax movl %eax, -0x44(%rbp) movq -0x8(%rbp), %rax movl 0x1c(%rax), %eax movl %eax, -0x48(%rbp) movl $0x0, -0x3c(%rbp) movl $0x0, -0x34(%rbp) movl -0x34(%rbp), %eax cmpl -0x1c(%rbp), %eax jge 0x57d55 movq -0x18(%rbp), %rax movslq -0x34(%rbp), %rcx imulq $0x28, %rcx, %rcx addq %rcx, %rax movss (%rax), %xmm0 movss %xmm0, -0x4c(%rbp) movss -0x4c(%rbp), %xmm0 xorps %xmm1, %xmm1 ucomiss %xmm1, %xmm0 jbe 0x57894 movq -0x10(%rbp), %rdi movss -0x4c(%rbp), %xmm0 callq 0x56e30 movss %xmm0, -0x98(%rbp) jmp 0x578b7 movq -0x10(%rbp), %rdi movss -0x4c(%rbp), %xmm0 movd %xmm0, %eax xorl $0x80000000, %eax # imm = 0x80000000 movd %eax, %xmm0 callq 0x56ea0 movss %xmm0, -0x98(%rbp) movss -0x98(%rbp), %xmm0 movss %xmm0, -0x60(%rbp) movq -0x18(%rbp), %rax movslq -0x34(%rbp), %rcx leaq (%rcx,%rcx,4), %rcx movzbl 0x20(%rax,%rcx,8), %ecx movq -0x8(%rbp), %rax movl %ecx, 0x18(%rax) movq -0x18(%rbp), %rax movslq -0x34(%rbp), %rcx leaq (%rcx,%rcx,4), %rcx movzbl 0x21(%rax,%rcx,8), %ecx movq -0x8(%rbp), %rax movl %ecx, 0x1c(%rax) movq -0x8(%rbp), %rax movl 0x18(%rax), %eax cvtsi2ss %rax, %xmm1 movss 0x31700(%rip), %xmm0 # 0x89008 divss %xmm1, %xmm0 movss %xmm0, -0x50(%rbp) movq -0x8(%rbp), %rax movl 0x1c(%rax), %eax cvtsi2ss %rax, %xmm1 movss 0x316e3(%rip), %xmm0 # 0x89008 divss %xmm1, %xmm0 movss %xmm0, -0x54(%rbp) movq -0x8(%rbp), %rax movl 0x18(%rax), %edi callq 0x58090 movss %xmm0, -0x58(%rbp) movq -0x8(%rbp), %rax movl 0x1c(%rax), %edi callq 0x58090 movss %xmm0, -0x5c(%rbp) movl $0x0, -0x38(%rbp) movl -0x38(%rbp), %eax movq -0x18(%rbp), %rcx movslq -0x34(%rbp), %rdx imulq $0x28, %rdx, %rdx addq %rdx, %rcx cmpl 0x10(%rcx), %eax jge 0x57d45 movq -0x28(%rbp), %rax movslq -0x3c(%rbp), %rcx shlq $0x4, %rcx addq %rcx, %rax movq %rax, -0x68(%rbp) movq -0x68(%rbp), %rax cmpl $0x0, 0xc(%rax) je 0x57d27 movq -0x18(%rbp), %rax movslq -0x34(%rbp), %rcx imulq $0x28, %rcx, %rcx addq %rcx, %rax movq 0x18(%rax), %rax movslq -0x38(%rbp), %rcx imulq $0x1c, %rcx, %rcx addq %rcx, %rax movq %rax, -0x70(%rbp) movq -0x18(%rbp), %rax movslq -0x34(%rbp), %rcx imulq $0x28, %rcx, %rcx addq %rcx, %rax cmpl $0x0, 0x4(%rax) je 0x579e7 movq -0x18(%rbp), %rax movslq -0x34(%rbp), %rcx imulq $0x28, %rcx, %rcx addq %rcx, %rax movl 0x4(%rax), %eax addl -0x38(%rbp), %eax movl %eax, -0x9c(%rbp) jmp 0x57a07 movq -0x18(%rbp), %rax movslq -0x34(%rbp), %rcx imulq $0x28, %rcx, %rcx addq %rcx, %rax movq 0x8(%rax), %rax movslq -0x38(%rbp), %rcx movl (%rax,%rcx,4), %eax movl %eax, -0x9c(%rbp) movl -0x9c(%rbp), %eax movl %eax, -0x8c(%rbp) movq -0x10(%rbp), %rdi movl -0x8c(%rbp), %esi callq 0x56ef0 movl %eax, -0x90(%rbp) movq -0x8(%rbp), %rax movw 0x14(%rax), %ax movw %ax, -0x92(%rbp) movq -0x68(%rbp), %rax movl 0x8(%rax), %ecx movzwl -0x92(%rbp), %edx addl %edx, %ecx movw %cx, 0x8(%rax) movq -0x68(%rbp), %rax movzwl 0xa(%rax), %ecx movzwl -0x92(%rbp), %edx addl %edx, %ecx movw %cx, 0xa(%rax) movq -0x68(%rbp), %rax movl 0x4(%rax), %ecx movzwl -0x92(%rbp), %edx subl %edx, %ecx movw %cx, 0x4(%rax) movq -0x68(%rbp), %rax movzwl 0x6(%rax), %ecx movzwl -0x92(%rbp), %edx subl %edx, %ecx movw %cx, 0x6(%rax) movq -0x10(%rbp), %rdi movl -0x90(%rbp), %esi leaq -0x74(%rbp), %rdx leaq -0x78(%rbp), %rcx callq 0x580e0 movq -0x10(%rbp), %rdi movl -0x90(%rbp), %esi movss -0x60(%rbp), %xmm1 movq -0x8(%rbp), %rax movl 0x18(%rax), %ecx movl 0x1c(%rax), %eax cvtsi2ss %rcx, %xmm2 movaps %xmm1, %xmm0 mulss %xmm2, %xmm0 cvtsi2ss %rax, %xmm2 mulss %xmm2, %xmm1 leaq -0x7c(%rbp), %rdx leaq -0x80(%rbp), %rcx leaq -0x84(%rbp), %r8 leaq -0x88(%rbp), %r9 callq 0x58210 movq -0x10(%rbp), %rdi movq -0x8(%rbp), %rax movq 0x20(%rax), %rsi movq -0x68(%rbp), %rcx movzwl 0x8(%rcx), %edx addq %rdx, %rsi movzwl 0xa(%rcx), %edx movl 0x10(%rax), %r8d movl 0x18(%rax), %r9d imull %r8d, %edx movslq %edx, %rdx addq %rdx, %rsi movzwl 0x4(%rcx), %edx movl %r9d, %r10d subl %r10d, %edx incl %edx movzwl 0x6(%rcx), %ecx movl 0x1c(%rax), %eax movl %eax, %r10d subl %r10d, %ecx incl %ecx movss -0x60(%rbp), %xmm1 cvtsi2ss %r9, %xmm2 movaps %xmm1, %xmm0 mulss %xmm2, %xmm0 cvtsi2ss %rax, %xmm2 mulss %xmm2, %xmm1 movl -0x90(%rbp), %r9d movq -0x30(%rbp), %rax xorps %xmm3, %xmm3 movaps %xmm3, %xmm2 movq %rax, (%rsp) callq 0x58270 movq -0x8(%rbp), %rax cmpl $0x1, 0x18(%rax) jbe 0x57bbd movq -0x8(%rbp), %rax movq 0x20(%rax), %rdi movq -0x68(%rbp), %rax movzwl 0x8(%rax), %eax cltq addq %rax, %rdi movq -0x68(%rbp), %rax movzwl 0xa(%rax), %eax movq -0x8(%rbp), %rcx imull 0x10(%rcx), %eax cltq addq %rax, %rdi movq -0x68(%rbp), %rax movzwl 0x4(%rax), %esi movq -0x68(%rbp), %rax movzwl 0x6(%rax), %edx movq -0x8(%rbp), %rax movl 0x10(%rax), %ecx movq -0x8(%rbp), %rax movl 0x18(%rax), %r8d callq 0x58370 movq -0x8(%rbp), %rax cmpl $0x1, 0x1c(%rax) jbe 0x57c15 movq -0x8(%rbp), %rax movq 0x20(%rax), %rdi movq -0x68(%rbp), %rax movzwl 0x8(%rax), %eax cltq addq %rax, %rdi movq -0x68(%rbp), %rax movzwl 0xa(%rax), %eax movq -0x8(%rbp), %rcx imull 0x10(%rcx), %eax cltq addq %rax, %rdi movq -0x68(%rbp), %rax movzwl 0x4(%rax), %esi movq -0x68(%rbp), %rax movzwl 0x6(%rax), %edx movq -0x8(%rbp), %rax movl 0x10(%rax), %ecx movq -0x8(%rbp), %rax movl 0x1c(%rax), %r8d callq 0x586b0 movq -0x68(%rbp), %rax movw 0x8(%rax), %cx movq -0x70(%rbp), %rax movw %cx, (%rax) movq -0x68(%rbp), %rax movw 0xa(%rax), %cx movq -0x70(%rbp), %rax movw %cx, 0x2(%rax) movq -0x68(%rbp), %rax movzwl 0x8(%rax), %eax movq -0x68(%rbp), %rcx movzwl 0x4(%rcx), %ecx addl %ecx, %eax movw %ax, %cx movq -0x70(%rbp), %rax movw %cx, 0x4(%rax) movq -0x68(%rbp), %rax movzwl 0xa(%rax), %eax movq -0x68(%rbp), %rcx movzwl 0x6(%rcx), %ecx addl %ecx, %eax movw %ax, %cx movq -0x70(%rbp), %rax movw %cx, 0x6(%rax) movss -0x60(%rbp), %xmm0 cvtsi2ssl -0x74(%rbp), %xmm1 mulss %xmm1, %xmm0 movq -0x70(%rbp), %rax movss %xmm0, 0x10(%rax) cvtsi2ssl -0x7c(%rbp), %xmm0 movss -0x50(%rbp), %xmm2 movss -0x58(%rbp), %xmm1 mulss %xmm2, %xmm0 addss %xmm1, %xmm0 movq -0x70(%rbp), %rax movss %xmm0, 0x8(%rax) cvtsi2ssl -0x80(%rbp), %xmm0 movss -0x54(%rbp), %xmm2 movss -0x5c(%rbp), %xmm1 mulss %xmm2, %xmm0 addss %xmm1, %xmm0 movq -0x70(%rbp), %rax movss %xmm0, 0xc(%rax) cvtsi2ssl -0x7c(%rbp), %xmm0 movq -0x68(%rbp), %rax movzwl 0x4(%rax), %eax cvtsi2ss %eax, %xmm1 addss %xmm1, %xmm0 movss -0x50(%rbp), %xmm2 movss -0x58(%rbp), %xmm1 mulss %xmm2, %xmm0 addss %xmm1, %xmm0 movq -0x70(%rbp), %rax movss %xmm0, 0x14(%rax) cvtsi2ssl -0x80(%rbp), %xmm0 movq -0x68(%rbp), %rax movzwl 0x6(%rax), %eax cvtsi2ss %eax, %xmm1 addss %xmm1, %xmm0 movss -0x54(%rbp), %xmm2 movss -0x5c(%rbp), %xmm1 mulss %xmm2, %xmm0 addss %xmm1, %xmm0 movq -0x70(%rbp), %rax movss %xmm0, 0x18(%rax) jmp 0x57d2e movl $0x0, -0x40(%rbp) movl -0x3c(%rbp), %eax addl $0x1, %eax movl %eax, -0x3c(%rbp) movl -0x38(%rbp), %eax addl $0x1, %eax movl %eax, -0x38(%rbp) jmp 0x57957 jmp 0x57d47 movl -0x34(%rbp), %eax addl $0x1, %eax movl %eax, -0x34(%rbp) jmp 0x5784b movl -0x44(%rbp), %ecx movq -0x8(%rbp), %rax movl %ecx, 0x18(%rax) movl -0x48(%rbp), %ecx movq -0x8(%rbp), %rax movl %ecx, 0x1c(%rax) movl -0x40(%rbp), %eax addq $0xb0, %rsp popq %rbp retq nopw %cs:(%rax,%rax)
/Tigermouthbear[P]flappytiger/external/glfw/deps/nuklear.h
nk_tt__v_prefilter
NK_INTERN void nk_tt__v_prefilter(unsigned char *pixels, int w, int h, int stride_in_bytes, int kernel_width) { unsigned char buffer[NK_TT_MAX_OVERSAMPLE]; int safe_h = h - kernel_width; int j; for (j=0; j < w; ++j) { int i; unsigned int total; NK_MEMSET(buffer, 0, (nk_size)kernel_width); total = 0; /* make kernel_width a constant in common cases so compiler can optimize out the divide */ switch (kernel_width) { case 2: for (i=0; i <= safe_h; ++i) { total += (unsigned int)(pixels[i*stride_in_bytes] - buffer[i & NK_TT__OVER_MASK]); buffer[(i+kernel_width) & NK_TT__OVER_MASK] = pixels[i*stride_in_bytes]; pixels[i*stride_in_bytes] = (unsigned char) (total / 2); } break; case 3: for (i=0; i <= safe_h; ++i) { total += (unsigned int)(pixels[i*stride_in_bytes] - buffer[i & NK_TT__OVER_MASK]); buffer[(i+kernel_width) & NK_TT__OVER_MASK] = pixels[i*stride_in_bytes]; pixels[i*stride_in_bytes] = (unsigned char) (total / 3); } break; case 4: for (i=0; i <= safe_h; ++i) { total += (unsigned int)(pixels[i*stride_in_bytes] - buffer[i & NK_TT__OVER_MASK]); buffer[(i+kernel_width) & NK_TT__OVER_MASK] = pixels[i*stride_in_bytes]; pixels[i*stride_in_bytes] = (unsigned char) (total / 4); } break; case 5: for (i=0; i <= safe_h; ++i) { total += (unsigned int)(pixels[i*stride_in_bytes] - buffer[i & NK_TT__OVER_MASK]); buffer[(i+kernel_width) & NK_TT__OVER_MASK] = pixels[i*stride_in_bytes]; pixels[i*stride_in_bytes] = (unsigned char) (total / 5); } break; default: for (i=0; i <= safe_h; ++i) { total += (unsigned int)(pixels[i*stride_in_bytes] - buffer[i & NK_TT__OVER_MASK]); buffer[(i+kernel_width) & NK_TT__OVER_MASK] = pixels[i*stride_in_bytes]; pixels[i*stride_in_bytes] = (unsigned char) (total / (unsigned int)kernel_width); } break; } for (; i < h; ++i) { NK_ASSERT(pixels[i*stride_in_bytes] == 0); total -= (unsigned int)(buffer[i & NK_TT__OVER_MASK]); pixels[i*stride_in_bytes] = (unsigned char) (total / (unsigned int)kernel_width); } pixels += 1; } }
pushq %rbp movq %rsp, %rbp subq $0x40, %rsp movq %rdi, -0x8(%rbp) movl %esi, -0xc(%rbp) movl %edx, -0x10(%rbp) movl %ecx, -0x14(%rbp) movl %r8d, -0x18(%rbp) movl -0x10(%rbp), %eax subl -0x18(%rbp), %eax movl %eax, -0x24(%rbp) movl $0x0, -0x28(%rbp) movl -0x28(%rbp), %eax cmpl -0xc(%rbp), %eax jge 0x58a42 movslq -0x18(%rbp), %rdx leaq -0x20(%rbp), %rdi xorl %esi, %esi callq 0x33f50 movl $0x0, -0x30(%rbp) movl -0x18(%rbp), %eax addl $-0x2, %eax movl %eax, %ecx movq %rcx, -0x38(%rbp) subl $0x3, %eax ja 0x5892c movq -0x38(%rbp), %rax leaq 0x30b3d(%rip), %rcx # 0x89258 movslq (%rcx,%rax,4), %rax addq %rcx, %rax jmpq *%rax movl $0x0, -0x2c(%rbp) movl -0x2c(%rbp), %eax cmpl -0x24(%rbp), %eax jg 0x5879e movq -0x8(%rbp), %rax movl -0x2c(%rbp), %ecx imull -0x14(%rbp), %ecx movslq %ecx, %rcx movzbl (%rax,%rcx), %eax movl -0x2c(%rbp), %ecx andl $0x7, %ecx movslq %ecx, %rcx movzbl -0x20(%rbp,%rcx), %ecx subl %ecx, %eax addl -0x30(%rbp), %eax movl %eax, -0x30(%rbp) movq -0x8(%rbp), %rax movl -0x2c(%rbp), %ecx imull -0x14(%rbp), %ecx movslq %ecx, %rcx movb (%rax,%rcx), %cl movl -0x2c(%rbp), %eax addl -0x18(%rbp), %eax andl $0x7, %eax cltq movb %cl, -0x20(%rbp,%rax) movl -0x30(%rbp), %eax shrl %eax movb %al, %dl movq -0x8(%rbp), %rax movl -0x2c(%rbp), %ecx imull -0x14(%rbp), %ecx movslq %ecx, %rcx movb %dl, (%rax,%rcx) movl -0x2c(%rbp), %eax addl $0x1, %eax movl %eax, -0x2c(%rbp) jmp 0x5872b jmp 0x589ab movl $0x0, -0x2c(%rbp) movl -0x2c(%rbp), %eax cmpl -0x24(%rbp), %eax jg 0x58824 movq -0x8(%rbp), %rax movl -0x2c(%rbp), %ecx imull -0x14(%rbp), %ecx movslq %ecx, %rcx movzbl (%rax,%rcx), %eax movl -0x2c(%rbp), %ecx andl $0x7, %ecx movslq %ecx, %rcx movzbl -0x20(%rbp,%rcx), %ecx subl %ecx, %eax addl -0x30(%rbp), %eax movl %eax, -0x30(%rbp) movq -0x8(%rbp), %rax movl -0x2c(%rbp), %ecx imull -0x14(%rbp), %ecx movslq %ecx, %rcx movb (%rax,%rcx), %cl movl -0x2c(%rbp), %eax addl -0x18(%rbp), %eax andl $0x7, %eax cltq movb %cl, -0x20(%rbp,%rax) movl -0x30(%rbp), %eax movl $0x3, %ecx xorl %edx, %edx divl %ecx movb %al, %dl movq -0x8(%rbp), %rax movl -0x2c(%rbp), %ecx imull -0x14(%rbp), %ecx movslq %ecx, %rcx movb %dl, (%rax,%rcx) movl -0x2c(%rbp), %eax addl $0x1, %eax movl %eax, -0x2c(%rbp) jmp 0x587aa jmp 0x589ab movl $0x0, -0x2c(%rbp) movl -0x2c(%rbp), %eax cmpl -0x24(%rbp), %eax jg 0x588a4 movq -0x8(%rbp), %rax movl -0x2c(%rbp), %ecx imull -0x14(%rbp), %ecx movslq %ecx, %rcx movzbl (%rax,%rcx), %eax movl -0x2c(%rbp), %ecx andl $0x7, %ecx movslq %ecx, %rcx movzbl -0x20(%rbp,%rcx), %ecx subl %ecx, %eax addl -0x30(%rbp), %eax movl %eax, -0x30(%rbp) movq -0x8(%rbp), %rax movl -0x2c(%rbp), %ecx imull -0x14(%rbp), %ecx movslq %ecx, %rcx movb (%rax,%rcx), %cl movl -0x2c(%rbp), %eax addl -0x18(%rbp), %eax andl $0x7, %eax cltq movb %cl, -0x20(%rbp,%rax) movl -0x30(%rbp), %eax shrl $0x2, %eax movb %al, %dl movq -0x8(%rbp), %rax movl -0x2c(%rbp), %ecx imull -0x14(%rbp), %ecx movslq %ecx, %rcx movb %dl, (%rax,%rcx) movl -0x2c(%rbp), %eax addl $0x1, %eax movl %eax, -0x2c(%rbp) jmp 0x58830 jmp 0x589ab movl $0x0, -0x2c(%rbp) movl -0x2c(%rbp), %eax cmpl -0x24(%rbp), %eax jg 0x5892a movq -0x8(%rbp), %rax movl -0x2c(%rbp), %ecx imull -0x14(%rbp), %ecx movslq %ecx, %rcx movzbl (%rax,%rcx), %eax movl -0x2c(%rbp), %ecx andl $0x7, %ecx movslq %ecx, %rcx movzbl -0x20(%rbp,%rcx), %ecx subl %ecx, %eax addl -0x30(%rbp), %eax movl %eax, -0x30(%rbp) movq -0x8(%rbp), %rax movl -0x2c(%rbp), %ecx imull -0x14(%rbp), %ecx movslq %ecx, %rcx movb (%rax,%rcx), %cl movl -0x2c(%rbp), %eax addl -0x18(%rbp), %eax andl $0x7, %eax cltq movb %cl, -0x20(%rbp,%rax) movl -0x30(%rbp), %eax movl $0x5, %ecx xorl %edx, %edx divl %ecx movb %al, %dl movq -0x8(%rbp), %rax movl -0x2c(%rbp), %ecx imull -0x14(%rbp), %ecx movslq %ecx, %rcx movb %dl, (%rax,%rcx) movl -0x2c(%rbp), %eax addl $0x1, %eax movl %eax, -0x2c(%rbp) jmp 0x588b0 jmp 0x589ab movl $0x0, -0x2c(%rbp) movl -0x2c(%rbp), %eax cmpl -0x24(%rbp), %eax jg 0x589a9 movq -0x8(%rbp), %rax movl -0x2c(%rbp), %ecx imull -0x14(%rbp), %ecx movslq %ecx, %rcx movzbl (%rax,%rcx), %eax movl -0x2c(%rbp), %ecx andl $0x7, %ecx movslq %ecx, %rcx movzbl -0x20(%rbp,%rcx), %ecx subl %ecx, %eax addl -0x30(%rbp), %eax movl %eax, -0x30(%rbp) movq -0x8(%rbp), %rax movl -0x2c(%rbp), %ecx imull -0x14(%rbp), %ecx movslq %ecx, %rcx movb (%rax,%rcx), %cl movl -0x2c(%rbp), %eax addl -0x18(%rbp), %eax andl $0x7, %eax cltq movb %cl, -0x20(%rbp,%rax) movl -0x30(%rbp), %eax xorl %edx, %edx divl -0x18(%rbp) movb %al, %dl movq -0x8(%rbp), %rax movl -0x2c(%rbp), %ecx imull -0x14(%rbp), %ecx movslq %ecx, %rcx movb %dl, (%rax,%rcx) movl -0x2c(%rbp), %eax addl $0x1, %eax movl %eax, -0x2c(%rbp) jmp 0x58933 jmp 0x589ab jmp 0x589ad movl -0x2c(%rbp), %eax cmpl -0x10(%rbp), %eax jge 0x58a28 movq -0x8(%rbp), %rax movl -0x2c(%rbp), %ecx imull -0x14(%rbp), %ecx movslq %ecx, %rcx movzbl (%rax,%rcx), %eax cmpl $0x0, %eax jne 0x589ce jmp 0x589ed leaq 0x3b2f8(%rip), %rdi # 0x93ccd leaq 0x34524(%rip), %rsi # 0x8cf00 movl $0x3030, %edx # imm = 0x3030 leaq 0x3b304(%rip), %rcx # 0x93cec callq 0x1b1e0 movl -0x2c(%rbp), %eax andl $0x7, %eax cltq movzbl -0x20(%rbp,%rax), %ecx movl -0x30(%rbp), %eax subl %ecx, %eax movl %eax, -0x30(%rbp) movl -0x30(%rbp), %eax xorl %edx, %edx divl -0x18(%rbp) movb %al, %dl movq -0x8(%rbp), %rax movl -0x2c(%rbp), %ecx imull -0x14(%rbp), %ecx movslq %ecx, %rcx movb %dl, (%rax,%rcx) movl -0x2c(%rbp), %eax addl $0x1, %eax movl %eax, -0x2c(%rbp) jmp 0x589ad movq -0x8(%rbp), %rax addq $0x1, %rax movq %rax, -0x8(%rbp) movl -0x28(%rbp), %eax addl $0x1, %eax movl %eax, -0x28(%rbp) jmp 0x586d9 addq $0x40, %rsp popq %rbp retq nopl (%rax,%rax)
/Tigermouthbear[P]flappytiger/external/glfw/deps/nuklear.h
nk_tt_Rasterize
NK_INTERN void nk_tt_Rasterize(struct nk_tt__bitmap *result, float flatness_in_pixels, struct nk_tt_vertex *vertices, int num_verts, float scale_x, float scale_y, float shift_x, float shift_y, int x_off, int y_off, int invert, struct nk_allocator *alloc) { float scale = scale_x > scale_y ? scale_y : scale_x; int winding_count, *winding_lengths; struct nk_tt__point *windings = nk_tt_FlattenCurves(vertices, num_verts, flatness_in_pixels / scale, &winding_lengths, &winding_count, alloc); NK_ASSERT(alloc); if (windings) { nk_tt__rasterize(result, windings, winding_lengths, winding_count, scale_x, scale_y, shift_x, shift_y, x_off, y_off, invert, alloc); alloc->free(alloc->userdata, winding_lengths); alloc->free(alloc->userdata, windings); } }
pushq %rbp movq %rsp, %rbp subq $0x70, %rsp movq 0x10(%rbp), %rax movq %rdi, -0x8(%rbp) movss %xmm0, -0xc(%rbp) movq %rsi, -0x18(%rbp) movl %edx, -0x1c(%rbp) movss %xmm1, -0x20(%rbp) movss %xmm2, -0x24(%rbp) movss %xmm3, -0x28(%rbp) movss %xmm4, -0x2c(%rbp) movl %ecx, -0x30(%rbp) movl %r8d, -0x34(%rbp) movl %r9d, -0x38(%rbp) movss -0x20(%rbp), %xmm0 ucomiss -0x24(%rbp), %xmm0 jbe 0x59a92 movss -0x24(%rbp), %xmm0 movss %xmm0, -0x54(%rbp) jmp 0x59a9c movss -0x20(%rbp), %xmm0 movss %xmm0, -0x54(%rbp) movss -0x54(%rbp), %xmm0 movss %xmm0, -0x3c(%rbp) movq -0x18(%rbp), %rdi movl -0x1c(%rbp), %esi movss -0xc(%rbp), %xmm0 divss -0x3c(%rbp), %xmm0 movq 0x10(%rbp), %r8 leaq -0x48(%rbp), %rdx leaq -0x40(%rbp), %rcx callq 0x59d30 movq %rax, -0x50(%rbp) cmpq $0x0, 0x10(%rbp) je 0x59ad5 jmp 0x59af4 leaq 0x3532a(%rip), %rdi # 0x8ee06 leaq 0x3341d(%rip), %rsi # 0x8cf00 movl $0x2f67, %edx # imm = 0x2F67 leaq 0x39f0b(%rip), %rcx # 0x939fa callq 0x1b1e0 cmpq $0x0, -0x50(%rbp) je 0x59b66 movq -0x8(%rbp), %rdi movq -0x50(%rbp), %rsi movq -0x48(%rbp), %rdx movl -0x40(%rbp), %ecx movss -0x20(%rbp), %xmm0 movss -0x24(%rbp), %xmm1 movss -0x28(%rbp), %xmm2 movss -0x2c(%rbp), %xmm3 movl -0x30(%rbp), %r8d movl -0x34(%rbp), %r9d movl -0x38(%rbp), %r10d movq 0x10(%rbp), %rax movl %r10d, (%rsp) movq %rax, 0x8(%rsp) callq 0x5a0c0 movq 0x10(%rbp), %rax movq 0x10(%rax), %rax movq 0x10(%rbp), %rcx movq -0x48(%rbp), %rsi movq (%rcx), %rdi callq *%rax movq 0x10(%rbp), %rax movq 0x10(%rax), %rax movq 0x10(%rbp), %rcx movq -0x50(%rbp), %rsi movq (%rcx), %rdi callq *%rax addq $0x70, %rsp popq %rbp retq nopl (%rax)
/Tigermouthbear[P]flappytiger/external/glfw/deps/nuklear.h
nk_tt__rasterize_sorted_edges
NK_INTERN void nk_tt__rasterize_sorted_edges(struct nk_tt__bitmap *result, struct nk_tt__edge *e, int n, int vsubsample, int off_x, int off_y, struct nk_allocator *alloc) { /* directly AA rasterize edges w/o supersampling */ struct nk_tt__hheap hh; struct nk_tt__active_edge *active = 0; int y,j=0, i; float scanline_data[129], *scanline, *scanline2; NK_UNUSED(vsubsample); nk_zero_struct(hh); hh.alloc = *alloc; if (result->w > 64) scanline = (float *) alloc->alloc(alloc->userdata,0, (nk_size)(result->w*2+1) * sizeof(float)); else scanline = scanline_data; scanline2 = scanline + result->w; y = off_y; e[n].y0 = (float) (off_y + result->h) + 1; while (j < result->h) { /* find center of pixel for this scanline */ float scan_y_top = (float)y + 0.0f; float scan_y_bottom = (float)y + 1.0f; struct nk_tt__active_edge **step = &active; NK_MEMSET(scanline , 0, (nk_size)result->w*sizeof(scanline[0])); NK_MEMSET(scanline2, 0, (nk_size)(result->w+1)*sizeof(scanline[0])); /* update all active edges; */ /* remove all active edges that terminate before the top of this scanline */ while (*step) { struct nk_tt__active_edge * z = *step; if (z->ey <= scan_y_top) { *step = z->next; /* delete from list */ NK_ASSERT(z->direction); z->direction = 0; nk_tt__hheap_free(&hh, z); } else { step = &((*step)->next); /* advance through list */ } } /* insert all edges that start before the bottom of this scanline */ while (e->y0 <= scan_y_bottom) { if (e->y0 != e->y1) { struct nk_tt__active_edge *z = nk_tt__new_active(&hh, e, off_x, scan_y_top); if (z != 0) { NK_ASSERT(z->ey >= scan_y_top); /* insert at front */ z->next = active; active = z; } } ++e; } /* now process all active edges */ if (active) nk_tt__fill_active_edges_new(scanline, scanline2+1, result->w, active, scan_y_top); { float sum = 0; for (i=0; i < result->w; ++i) { float k; int m; sum += scanline2[i]; k = scanline[i] + sum; k = (float) NK_ABS(k) * 255.0f + 0.5f; m = (int) k; if (m > 255) m = 255; result->pixels[j*result->stride + i] = (unsigned char) m; } } /* advance all the edges */ step = &active; while (*step) { struct nk_tt__active_edge *z = *step; z->fx += z->fdx; /* advance to position for current scanline */ step = &((*step)->next); /* advance through list */ } ++y; ++j; } nk_tt__hheap_cleanup(&hh); if (scanline != scanline_data) alloc->free(alloc->userdata, scanline); }
pushq %rbp movq %rsp, %rbp subq $0x2c0, %rsp # imm = 0x2C0 movq 0x10(%rbp), %rax movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movl %edx, -0x14(%rbp) movl %ecx, -0x18(%rbp) movl %r8d, -0x1c(%rbp) movl %r9d, -0x20(%rbp) movq $0x0, -0x58(%rbp) movl $0x0, -0x60(%rbp) leaq -0x50(%rbp), %rdi movl $0x30, %esi callq 0x1f6c0 movq 0x10(%rbp), %rax movq (%rax), %rcx movq %rcx, -0x50(%rbp) movq 0x8(%rax), %rcx movq %rcx, -0x48(%rbp) movq 0x10(%rax), %rax movq %rax, -0x40(%rbp) movq -0x8(%rbp), %rax cmpl $0x40, (%rax) jle 0x5a726 movq 0x10(%rbp), %rax movq 0x8(%rax), %rax movq 0x10(%rbp), %rcx movq -0x8(%rbp), %rdx movl (%rdx), %edx shll %edx addl $0x1, %edx movslq %edx, %rdx shlq $0x2, %rdx movq (%rcx), %rdi xorl %ecx, %ecx movl %ecx, %esi callq *%rax movq %rax, -0x278(%rbp) jmp 0x5a734 leaq -0x270(%rbp), %rax movq %rax, -0x278(%rbp) movq -0x278(%rbp), %rax movq -0x8(%rbp), %rcx movslq (%rcx), %rcx shlq $0x2, %rcx addq %rcx, %rax movq %rax, -0x280(%rbp) movl -0x20(%rbp), %eax movl %eax, -0x5c(%rbp) movl -0x20(%rbp), %eax movq -0x8(%rbp), %rcx addl 0x4(%rcx), %eax cvtsi2ss %eax, %xmm0 movss 0x2e89c(%rip), %xmm1 # 0x89008 addss %xmm1, %xmm0 movq -0x10(%rbp), %rax movslq -0x14(%rbp), %rcx imulq $0x14, %rcx, %rcx addq %rcx, %rax movss %xmm0, 0x4(%rax) movl -0x60(%rbp), %eax movq -0x8(%rbp), %rcx cmpl 0x4(%rcx), %eax jge 0x5ab3a cvtsi2ssl -0x5c(%rbp), %xmm0 xorps %xmm1, %xmm1 addss %xmm1, %xmm0 movss %xmm0, -0x284(%rbp) cvtsi2ssl -0x5c(%rbp), %xmm0 movss 0x2e853(%rip), %xmm1 # 0x89008 addss %xmm1, %xmm0 movss %xmm0, -0x288(%rbp) leaq -0x58(%rbp), %rax movq %rax, -0x290(%rbp) movq -0x278(%rbp), %rdi movq -0x8(%rbp), %rax movslq (%rax), %rdx shlq $0x2, %rdx xorl %esi, %esi callq 0x33f50 movq -0x280(%rbp), %rdi movq -0x8(%rbp), %rax movl (%rax), %eax addl $0x1, %eax movslq %eax, %rdx shlq $0x2, %rdx xorl %esi, %esi callq 0x33f50 movq -0x290(%rbp), %rax cmpq $0x0, (%rax) je 0x5a8c2 movq -0x290(%rbp), %rax movq (%rax), %rax movq %rax, -0x298(%rbp) movq -0x298(%rbp), %rax movss 0x1c(%rax), %xmm1 movss -0x284(%rbp), %xmm0 ucomiss %xmm1, %xmm0 jb 0x5a8ac movq -0x298(%rbp), %rax movq (%rax), %rcx movq -0x290(%rbp), %rax movq %rcx, (%rax) movq -0x298(%rbp), %rax movss 0x14(%rax), %xmm0 xorps %xmm1, %xmm1 ucomiss %xmm1, %xmm0 jne 0x5a86a jp 0x5a86a jmp 0x5a86c jmp 0x5a88b leaq 0x39219(%rip), %rdi # 0x93a8c leaq 0x32686(%rip), %rsi # 0x8cf00 movl $0x2e23, %edx # imm = 0x2E23 leaq 0x39213(%rip), %rcx # 0x93a99 callq 0x1b1e0 movq -0x298(%rbp), %rax xorps %xmm0, %xmm0 movss %xmm0, 0x14(%rax) movq -0x298(%rbp), %rsi leaq -0x50(%rbp), %rdi callq 0x5afe0 jmp 0x5a8bd movq -0x290(%rbp), %rax movq (%rax), %rax movq %rax, -0x290(%rbp) jmp 0x5a803 jmp 0x5a8c4 movq -0x10(%rbp), %rax movss 0x4(%rax), %xmm1 movss -0x288(%rbp), %xmm0 ucomiss %xmm1, %xmm0 jb 0x5a980 movq -0x10(%rbp), %rax movss 0x4(%rax), %xmm0 movq -0x10(%rbp), %rax ucomiss 0xc(%rax), %xmm0 jne 0x5a8f5 jp 0x5a8f5 jmp 0x5a96f movq -0x10(%rbp), %rsi movl -0x1c(%rbp), %edx movss -0x284(%rbp), %xmm0 leaq -0x50(%rbp), %rdi callq 0x5b010 movq %rax, -0x2a0(%rbp) cmpq $0x0, -0x2a0(%rbp) je 0x5a96d movq -0x2a0(%rbp), %rax movss 0x1c(%rax), %xmm0 ucomiss -0x284(%rbp), %xmm0 jb 0x5a935 jmp 0x5a954 leaq 0x391d9(%rip), %rdi # 0x93b15 leaq 0x325bd(%rip), %rsi # 0x8cf00 movl $0x2e30, %edx # imm = 0x2E30 leaq 0x3914a(%rip), %rcx # 0x93a99 callq 0x1b1e0 movq -0x58(%rbp), %rcx movq -0x2a0(%rbp), %rax movq %rcx, (%rax) movq -0x2a0(%rbp), %rax movq %rax, -0x58(%rbp) jmp 0x5a96f movq -0x10(%rbp), %rax addq $0x14, %rax movq %rax, -0x10(%rbp) jmp 0x5a8c4 cmpq $0x0, -0x58(%rbp) je 0x5a9b0 movq -0x278(%rbp), %rdi movq -0x280(%rbp), %rsi addq $0x4, %rsi movq -0x8(%rbp), %rax movl (%rax), %edx movq -0x58(%rbp), %rcx movss -0x284(%rbp), %xmm0 callq 0x5b190 xorps %xmm0, %xmm0 movss %xmm0, -0x2a4(%rbp) movl $0x0, -0x64(%rbp) movl -0x64(%rbp), %eax movq -0x8(%rbp), %rcx cmpl (%rcx), %eax jge 0x5aaca movq -0x280(%rbp), %rax movslq -0x64(%rbp), %rcx movss (%rax,%rcx,4), %xmm0 addss -0x2a4(%rbp), %xmm0 movss %xmm0, -0x2a4(%rbp) movq -0x278(%rbp), %rax movslq -0x64(%rbp), %rcx movss (%rax,%rcx,4), %xmm0 addss -0x2a4(%rbp), %xmm0 movss %xmm0, -0x2a8(%rbp) xorps %xmm0, %xmm0 ucomiss -0x2a8(%rbp), %xmm0 jbe 0x5aa3c movss -0x2a8(%rbp), %xmm0 movd %xmm0, %eax xorl $0x80000000, %eax # imm = 0x80000000 movd %eax, %xmm0 movss %xmm0, -0x2bc(%rbp) jmp 0x5aa4c movss -0x2a8(%rbp), %xmm0 movss %xmm0, -0x2bc(%rbp) movss -0x2bc(%rbp), %xmm0 movss 0x2e5b0(%rip), %xmm1 # 0x8900c mulss %xmm1, %xmm0 movss 0x2e60c(%rip), %xmm1 # 0x89074 addss %xmm1, %xmm0 movss %xmm0, -0x2a8(%rbp) cvttss2si -0x2a8(%rbp), %eax movl %eax, -0x2ac(%rbp) cmpl $0xff, -0x2ac(%rbp) jle 0x5aa98 movl $0xff, -0x2ac(%rbp) movl -0x2ac(%rbp), %eax movb %al, %dl movq -0x8(%rbp), %rax movq 0x10(%rax), %rax movl -0x60(%rbp), %ecx movq -0x8(%rbp), %rsi imull 0x8(%rsi), %ecx addl -0x64(%rbp), %ecx movslq %ecx, %rcx movb %dl, (%rax,%rcx) movl -0x64(%rbp), %eax addl $0x1, %eax movl %eax, -0x64(%rbp) jmp 0x5a9c2 leaq -0x58(%rbp), %rax movq %rax, -0x290(%rbp) movq -0x290(%rbp), %rax cmpq $0x0, (%rax) je 0x5ab23 movq -0x290(%rbp), %rax movq (%rax), %rax movq %rax, -0x2b8(%rbp) movq -0x2b8(%rbp), %rax movss 0xc(%rax), %xmm0 movq -0x2b8(%rbp), %rax addss 0x8(%rax), %xmm0 movss %xmm0, 0x8(%rax) movq -0x290(%rbp), %rax movq (%rax), %rax movq %rax, -0x290(%rbp) jmp 0x5aad5 movl -0x5c(%rbp), %eax addl $0x1, %eax movl %eax, -0x5c(%rbp) movl -0x60(%rbp), %eax addl $0x1, %eax movl %eax, -0x60(%rbp) jmp 0x5a784 leaq -0x50(%rbp), %rdi callq 0x5bc10 movq -0x278(%rbp), %rax leaq -0x270(%rbp), %rcx cmpq %rcx, %rax je 0x5ab6e movq 0x10(%rbp), %rax movq 0x10(%rax), %rax movq 0x10(%rbp), %rcx movq -0x278(%rbp), %rsi movq (%rcx), %rdi callq *%rax addq $0x2c0, %rsp # imm = 0x2C0 popq %rbp retq nopw (%rax,%rax)
/Tigermouthbear[P]flappytiger/external/glfw/deps/nuklear.h
nk_tt__sort_edges_ins_sort
NK_INTERN void nk_tt__sort_edges_ins_sort(struct nk_tt__edge *p, int n) { int i,j; #define NK_TT__COMPARE(a,b) ((a)->y0 < (b)->y0) for (i=1; i < n; ++i) { struct nk_tt__edge t = p[i], *a = &t; j = i; while (j > 0) { struct nk_tt__edge *b = &p[j-1]; int c = NK_TT__COMPARE(a,b); if (!c) break; p[j] = p[j-1]; --j; } if (i != j) p[j] = t; } }
pushq %rbp movq %rsp, %rbp movq %rdi, -0x8(%rbp) movl %esi, -0xc(%rbp) movl $0x1, -0x10(%rbp) movl -0x10(%rbp), %eax cmpl -0xc(%rbp), %eax jge 0x5afdb movq -0x8(%rbp), %rax movslq -0x10(%rbp), %rcx imulq $0x14, %rcx, %rcx addq %rcx, %rax movq (%rax), %rcx movq %rcx, -0x28(%rbp) movq 0x8(%rax), %rcx movq %rcx, -0x20(%rbp) movl 0x10(%rax), %eax movl %eax, -0x18(%rbp) leaq -0x28(%rbp), %rax movq %rax, -0x30(%rbp) movl -0x10(%rbp), %eax movl %eax, -0x14(%rbp) cmpl $0x0, -0x14(%rbp) jle 0x5af9f movq -0x8(%rbp), %rax movl -0x14(%rbp), %ecx subl $0x1, %ecx movslq %ecx, %rcx imulq $0x14, %rcx, %rcx addq %rcx, %rax movq %rax, -0x38(%rbp) movq -0x30(%rbp), %rax movss 0x4(%rax), %xmm1 movq -0x38(%rbp), %rax movss 0x4(%rax), %xmm0 ucomiss %xmm1, %xmm0 seta %al andb $0x1, %al movzbl %al, %eax movl %eax, -0x3c(%rbp) cmpl $0x0, -0x3c(%rbp) jne 0x5af5a jmp 0x5af9f movq -0x8(%rbp), %rax movslq -0x14(%rbp), %rcx imulq $0x14, %rcx, %rcx addq %rcx, %rax movq -0x8(%rbp), %rcx movl -0x14(%rbp), %edx subl $0x1, %edx movslq %edx, %rdx imulq $0x14, %rdx, %rdx addq %rdx, %rcx movq (%rcx), %rdx movq %rdx, (%rax) movq 0x8(%rcx), %rdx movq %rdx, 0x8(%rax) movl 0x10(%rcx), %ecx movl %ecx, 0x10(%rax) movl -0x14(%rbp), %eax addl $-0x1, %eax movl %eax, -0x14(%rbp) jmp 0x5af10 movl -0x10(%rbp), %eax cmpl -0x14(%rbp), %eax je 0x5afcb movq -0x8(%rbp), %rax movslq -0x14(%rbp), %rcx imulq $0x14, %rcx, %rcx addq %rcx, %rax movq -0x28(%rbp), %rcx movq %rcx, (%rax) movq -0x20(%rbp), %rcx movq %rcx, 0x8(%rax) movl -0x18(%rbp), %ecx movl %ecx, 0x10(%rax) jmp 0x5afcd movl -0x10(%rbp), %eax addl $0x1, %eax movl %eax, -0x10(%rbp) jmp 0x5aed2 popq %rbp retq nopl (%rax)
/Tigermouthbear[P]flappytiger/external/glfw/deps/nuklear.h
nk_free_page_element
NK_LIB void nk_free_page_element(struct nk_context *ctx, struct nk_page_element *elem) { /* we have a pool so just add to free list */ if (ctx->use_pool) { nk_link_page_element_into_freelist(ctx, elem); return; } /* if possible remove last element from back of fixed memory buffer */ {void *elem_end = (void*)(elem + 1); void *buffer_end = (nk_byte*)ctx->memory.memory.ptr + ctx->memory.size; if (elem_end == buffer_end) ctx->memory.size -= sizeof(struct nk_page_element); else nk_link_page_element_into_freelist(ctx, elem);} }
pushq %rbp movq %rsp, %rbp subq $0x20, %rsp movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movq -0x8(%rbp), %rax cmpl $0x0, 0x4074(%rax) je 0x5c6bc movq -0x8(%rbp), %rdi movq -0x10(%rbp), %rsi callq 0x5c720 jmp 0x5c716 movq -0x10(%rbp), %rax addq $0x200, %rax # imm = 0x200 movq %rax, -0x18(%rbp) movq -0x8(%rbp), %rax movq 0x1f20(%rax), %rax movq -0x8(%rbp), %rcx addq 0x1f50(%rcx), %rax movq %rax, -0x20(%rbp) movq -0x18(%rbp), %rax cmpq -0x20(%rbp), %rax jne 0x5c709 movq -0x8(%rbp), %rax movq 0x1f50(%rax), %rcx subq $0x200, %rcx # imm = 0x200 movq %rcx, 0x1f50(%rax) jmp 0x5c716 movq -0x8(%rbp), %rdi movq -0x10(%rbp), %rsi callq 0x5c720 addq $0x20, %rsp popq %rbp retq nopl (%rax)
/Tigermouthbear[P]flappytiger/external/glfw/deps/nuklear.h
nk_do_scrollbarh
NK_LIB float nk_do_scrollbarh(nk_flags *state, struct nk_command_buffer *out, struct nk_rect scroll, int has_scrolling, float offset, float target, float step, float button_pixel_inc, const struct nk_style_scrollbar *style, struct nk_input *in, const struct nk_user_font *font) { struct nk_rect cursor; struct nk_rect empty_west; struct nk_rect empty_east; float scroll_step; float scroll_offset; float scroll_off; float scroll_ratio; NK_ASSERT(out); NK_ASSERT(style); if (!out || !style) return 0; /* scrollbar background */ scroll.h = NK_MAX(scroll.h, 1); scroll.w = NK_MAX(scroll.w, 2 * scroll.h); if (target <= scroll.w) return 0; /* optional scrollbar buttons */ if (style->show_buttons) { nk_flags ws; float scroll_w; struct nk_rect button; button.y = scroll.y; button.w = scroll.h; button.h = scroll.h; scroll_w = scroll.w - 2 * button.w; scroll_step = NK_MIN(step, button_pixel_inc); /* decrement button */ button.x = scroll.x; if (nk_do_button_symbol(&ws, out, button, style->dec_symbol, NK_BUTTON_REPEATER, &style->dec_button, in, font)) offset = offset - scroll_step; /* increment button */ button.x = scroll.x + scroll.w - button.w; if (nk_do_button_symbol(&ws, out, button, style->inc_symbol, NK_BUTTON_REPEATER, &style->inc_button, in, font)) offset = offset + scroll_step; scroll.x = scroll.x + button.w; scroll.w = scroll_w; } /* calculate scrollbar constants */ scroll_step = NK_MIN(step, scroll.w); scroll_offset = NK_CLAMP(0, offset, target - scroll.w); scroll_ratio = scroll.w / target; scroll_off = scroll_offset / target; /* calculate cursor bounds */ cursor.w = (scroll_ratio * scroll.w) - (2*style->border + 2*style->padding.x); cursor.x = scroll.x + (scroll_off * scroll.w) + style->border + style->padding.x; cursor.h = scroll.h - (2 * style->border + 2 * style->padding.y); cursor.y = scroll.y + style->border + style->padding.y; /* calculate empty space around cursor */ empty_west.x = scroll.x; empty_west.y = scroll.y; empty_west.w = cursor.x - scroll.x; empty_west.h = scroll.h; empty_east.x = cursor.x + cursor.w; empty_east.y = scroll.y; empty_east.w = (scroll.x + scroll.w) - (cursor.x + cursor.w); empty_east.h = scroll.h; /* update scrollbar */ scroll_offset = nk_scrollbar_behavior(state, in, has_scrolling, &scroll, &cursor, &empty_west, &empty_east, scroll_offset, target, scroll_step, NK_HORIZONTAL); scroll_off = scroll_offset / target; cursor.x = scroll.x + (scroll_off * scroll.w); /* draw scrollbar */ if (style->draw_begin) style->draw_begin(out, style->userdata); nk_draw_scrollbar(out, *state, style, &scroll, &cursor); if (style->draw_end) style->draw_end(out, style->userdata); return scroll_offset; }
pushq %rbp movq %rsp, %rbp subq $0xe0, %rsp movlpd %xmm0, -0x14(%rbp) movlpd %xmm1, -0xc(%rbp) movq %rdi, -0x20(%rbp) movq %rsi, -0x28(%rbp) movl %edx, -0x2c(%rbp) movss %xmm2, -0x30(%rbp) movss %xmm3, -0x34(%rbp) movss %xmm4, -0x38(%rbp) movss %xmm5, -0x3c(%rbp) movq %rcx, -0x48(%rbp) movq %r8, -0x50(%rbp) movq %r9, -0x58(%rbp) cmpq $0x0, -0x28(%rbp) je 0x5d3c9 jmp 0x5d3e8 leaq 0x5905e(%rip), %rdi # 0xb642e leaq 0x2fb29(%rip), %rsi # 0x8cf00 movl $0x538a, %edx # imm = 0x538A leaq 0x37227(%rip), %rcx # 0x9460a callq 0x1b1e0 cmpq $0x0, -0x48(%rbp) je 0x5d3f1 jmp 0x5d410 leaq 0x34470(%rip), %rdi # 0x91868 leaq 0x2fb01(%rip), %rsi # 0x8cf00 movl $0x538b, %edx # imm = 0x538B leaq 0x371ff(%rip), %rcx # 0x9460a callq 0x1b1e0 cmpq $0x0, -0x28(%rbp) je 0x5d41e cmpq $0x0, -0x48(%rbp) jne 0x5d42b xorps %xmm0, %xmm0 movss %xmm0, -0x4(%rbp) jmp 0x5d9b5 movss 0x2bbd5(%rip), %xmm0 # 0x89008 ucomiss -0x8(%rbp), %xmm0 jbe 0x5d44b movss 0x2bbc7(%rip), %xmm0 # 0x89008 movss %xmm0, -0xb4(%rbp) jmp 0x5d458 movss -0x8(%rbp), %xmm0 movss %xmm0, -0xb4(%rbp) movss -0xb4(%rbp), %xmm0 movss %xmm0, -0x8(%rbp) movss -0xc(%rbp), %xmm1 movss 0x2bb92(%rip), %xmm0 # 0x89004 mulss -0x8(%rbp), %xmm0 ucomiss %xmm1, %xmm0 jbe 0x5d493 movss 0x2bb80(%rip), %xmm0 # 0x89004 mulss -0x8(%rbp), %xmm0 movss %xmm0, -0xb8(%rbp) jmp 0x5d4a0 movss -0xc(%rbp), %xmm0 movss %xmm0, -0xb8(%rbp) movss -0xb8(%rbp), %xmm0 movss %xmm0, -0xc(%rbp) movss -0x34(%rbp), %xmm1 movss -0xc(%rbp), %xmm0 ucomiss %xmm1, %xmm0 jb 0x5d4c9 xorps %xmm0, %xmm0 movss %xmm0, -0x4(%rbp) jmp 0x5d9b5 movq -0x48(%rbp), %rax cmpl $0x0, 0xe4(%rax) je 0x5d65f movss -0x10(%rbp), %xmm0 movss %xmm0, -0xac(%rbp) movss -0x8(%rbp), %xmm0 movss %xmm0, -0xa8(%rbp) movss -0x8(%rbp), %xmm0 movss %xmm0, -0xa4(%rbp) movss -0xc(%rbp), %xmm0 movss -0xa8(%rbp), %xmm1 addss %xmm1, %xmm1 subss %xmm1, %xmm0 movss %xmm0, -0xa0(%rbp) movss -0x38(%rbp), %xmm1 movss -0x3c(%rbp), %xmm0 ucomiss %xmm1, %xmm0 jbe 0x5d53c movss -0x38(%rbp), %xmm0 movss %xmm0, -0xbc(%rbp) jmp 0x5d549 movss -0x3c(%rbp), %xmm0 movss %xmm0, -0xbc(%rbp) movss -0xbc(%rbp), %xmm0 movss %xmm0, -0x8c(%rbp) movss -0x14(%rbp), %xmm0 movss %xmm0, -0xb0(%rbp) movq -0x28(%rbp), %rsi movq -0x48(%rbp), %r8 movl 0x24c(%r8), %edx addq $0x198, %r8 # imm = 0x198 movq -0x50(%rbp), %r9 movq -0x58(%rbp), %rcx movsd -0xb0(%rbp), %xmm0 movsd -0xa8(%rbp), %xmm1 movq %rsp, %rax movq %rcx, (%rax) leaq -0x9c(%rbp), %rdi movl $0x1, %ecx callq 0x3c580 cmpl $0x0, %eax je 0x5d5c2 movss -0x30(%rbp), %xmm0 subss -0x8c(%rbp), %xmm0 movss %xmm0, -0x30(%rbp) movss -0x14(%rbp), %xmm0 movss -0xc(%rbp), %xmm1 addss %xmm1, %xmm0 movss -0xa8(%rbp), %xmm1 subss %xmm1, %xmm0 movss %xmm0, -0xb0(%rbp) movq -0x28(%rbp), %rsi movq -0x48(%rbp), %r8 movl 0x248(%r8), %edx addq $0xe8, %r8 movq -0x50(%rbp), %r9 movq -0x58(%rbp), %rcx movsd -0xb0(%rbp), %xmm0 movsd -0xa8(%rbp), %xmm1 movq %rsp, %rax movq %rcx, (%rax) leaq -0x9c(%rbp), %rdi movl $0x1, %ecx callq 0x3c580 cmpl $0x0, %eax je 0x5d640 movss -0x30(%rbp), %xmm0 addss -0x8c(%rbp), %xmm0 movss %xmm0, -0x30(%rbp) movss -0x14(%rbp), %xmm0 addss -0xa8(%rbp), %xmm0 movss %xmm0, -0x14(%rbp) movss -0xa0(%rbp), %xmm0 movss %xmm0, -0xc(%rbp) movss -0x38(%rbp), %xmm1 movss -0xc(%rbp), %xmm0 ucomiss %xmm1, %xmm0 jbe 0x5d67d movss -0x38(%rbp), %xmm0 movss %xmm0, -0xc0(%rbp) jmp 0x5d68a movss -0xc(%rbp), %xmm0 movss %xmm0, -0xc0(%rbp) movss -0xc0(%rbp), %xmm0 movss %xmm0, -0x8c(%rbp) movss -0x30(%rbp), %xmm1 movss -0x34(%rbp), %xmm0 subss -0xc(%rbp), %xmm0 ucomiss %xmm1, %xmm0 jbe 0x5d6bd movss -0x30(%rbp), %xmm0 movss %xmm0, -0xc4(%rbp) jmp 0x5d6cf movss -0x34(%rbp), %xmm0 subss -0xc(%rbp), %xmm0 movss %xmm0, -0xc4(%rbp) movss -0xc4(%rbp), %xmm1 xorps %xmm0, %xmm0 ucomiss %xmm1, %xmm0 jbe 0x5d6ec xorps %xmm0, %xmm0 movss %xmm0, -0xc8(%rbp) jmp 0x5d731 movss -0x30(%rbp), %xmm1 movss -0x34(%rbp), %xmm0 subss -0xc(%rbp), %xmm0 ucomiss %xmm1, %xmm0 jbe 0x5d70f movss -0x30(%rbp), %xmm0 movss %xmm0, -0xcc(%rbp) jmp 0x5d721 movss -0x34(%rbp), %xmm0 subss -0xc(%rbp), %xmm0 movss %xmm0, -0xcc(%rbp) movss -0xcc(%rbp), %xmm0 movss %xmm0, -0xc8(%rbp) movss -0xc8(%rbp), %xmm0 movss %xmm0, -0x90(%rbp) movss -0xc(%rbp), %xmm0 divss -0x34(%rbp), %xmm0 movss %xmm0, -0x98(%rbp) movss -0x90(%rbp), %xmm0 divss -0x34(%rbp), %xmm0 movss %xmm0, -0x94(%rbp) movss -0x98(%rbp), %xmm0 movss -0xc(%rbp), %xmm2 movq -0x48(%rbp), %rax movss 0xcc(%rax), %xmm1 movq -0x48(%rbp), %rax movss 0x2b877(%rip), %xmm3 # 0x89004 mulss 0xdc(%rax), %xmm3 addss %xmm1, %xmm1 addss %xmm3, %xmm1 movd %xmm1, %eax xorl $0x80000000, %eax # imm = 0x80000000 movd %eax, %xmm1 mulss %xmm2, %xmm0 addss %xmm1, %xmm0 movss %xmm0, -0x60(%rbp) movss -0x14(%rbp), %xmm1 movss -0x94(%rbp), %xmm0 movss -0xc(%rbp), %xmm2 mulss %xmm2, %xmm0 addss %xmm1, %xmm0 movq -0x48(%rbp), %rax addss 0xcc(%rax), %xmm0 movq -0x48(%rbp), %rax addss 0xdc(%rax), %xmm0 movss %xmm0, -0x68(%rbp) movss -0x8(%rbp), %xmm0 movq -0x48(%rbp), %rax movss 0xcc(%rax), %xmm1 movq -0x48(%rbp), %rax movss 0x2b7f9(%rip), %xmm2 # 0x89004 mulss 0xe0(%rax), %xmm2 addss %xmm1, %xmm1 addss %xmm2, %xmm1 subss %xmm1, %xmm0 movss %xmm0, -0x5c(%rbp) movss -0x10(%rbp), %xmm0 movq -0x48(%rbp), %rax addss 0xcc(%rax), %xmm0 movq -0x48(%rbp), %rax addss 0xe0(%rax), %xmm0 movss %xmm0, -0x64(%rbp) movss -0x14(%rbp), %xmm0 movss %xmm0, -0x78(%rbp) movss -0x10(%rbp), %xmm0 movss %xmm0, -0x74(%rbp) movss -0x68(%rbp), %xmm0 subss -0x14(%rbp), %xmm0 movss %xmm0, -0x70(%rbp) movss -0x8(%rbp), %xmm0 movss %xmm0, -0x6c(%rbp) movss -0x68(%rbp), %xmm0 addss -0x60(%rbp), %xmm0 movss %xmm0, -0x88(%rbp) movss -0x10(%rbp), %xmm0 movss %xmm0, -0x84(%rbp) movss -0x14(%rbp), %xmm0 addss -0xc(%rbp), %xmm0 movss -0x68(%rbp), %xmm1 addss -0x60(%rbp), %xmm1 subss %xmm1, %xmm0 movss %xmm0, -0x80(%rbp) movss -0x8(%rbp), %xmm0 movss %xmm0, -0x7c(%rbp) movq -0x20(%rbp), %rdi movq -0x50(%rbp), %rsi movl -0x2c(%rbp), %edx movss -0x90(%rbp), %xmm0 movss -0x34(%rbp), %xmm1 movss -0x8c(%rbp), %xmm2 leaq -0x14(%rbp), %rcx leaq -0x68(%rbp), %r8 leaq -0x78(%rbp), %r9 leaq -0x88(%rbp), %rax movq %rax, (%rsp) movl $0x1, 0x8(%rsp) callq 0x5dc10 movss %xmm0, -0x90(%rbp) movss -0x90(%rbp), %xmm0 divss -0x34(%rbp), %xmm0 movss %xmm0, -0x94(%rbp) movss -0x14(%rbp), %xmm1 movss -0x94(%rbp), %xmm0 movss -0xc(%rbp), %xmm2 mulss %xmm2, %xmm0 addss %xmm1, %xmm0 movss %xmm0, -0x68(%rbp) movq -0x48(%rbp), %rax cmpq $0x0, 0x258(%rax) je 0x5d963 movq -0x48(%rbp), %rax movq 0x258(%rax), %rax movq -0x28(%rbp), %rdi movq -0x48(%rbp), %rcx movq 0x250(%rcx), %rsi callq *%rax movq -0x28(%rbp), %rdi movq -0x20(%rbp), %rax movl (%rax), %esi movq -0x48(%rbp), %rdx leaq -0x14(%rbp), %rcx leaq -0x68(%rbp), %r8 callq 0x5e420 movq -0x48(%rbp), %rax cmpq $0x0, 0x260(%rax) je 0x5d9a8 movq -0x48(%rbp), %rax movq 0x260(%rax), %rax movq -0x28(%rbp), %rdi movq -0x48(%rbp), %rcx movq 0x250(%rcx), %rsi callq *%rax movss -0x90(%rbp), %xmm0 movss %xmm0, -0x4(%rbp) movss -0x4(%rbp), %xmm0 addq $0xe0, %rsp popq %rbp retq nopw %cs:(%rax,%rax)
/Tigermouthbear[P]flappytiger/external/glfw/deps/nuklear.h
nk_tree_element_image_push_hashed_base
NK_INTERN int nk_tree_element_image_push_hashed_base(struct nk_context *ctx, enum nk_tree_type type, struct nk_image *img, const char *title, int title_len, enum nk_collapse_states *state, int *selected) { struct nk_window *win; struct nk_panel *layout; const struct nk_style *style; struct nk_command_buffer *out; const struct nk_input *in; const struct nk_style_button *button; enum nk_symbol_type symbol; float row_height; struct nk_vec2 padding; int text_len; float text_width; struct nk_vec2 item_spacing; struct nk_rect header = {0,0,0,0}; struct nk_rect sym = {0,0,0,0}; struct nk_text text; nk_flags ws = 0; enum nk_widget_layout_states widget_state; NK_ASSERT(ctx); NK_ASSERT(ctx->current); NK_ASSERT(ctx->current->layout); if (!ctx || !ctx->current || !ctx->current->layout) return 0; /* cache some data */ win = ctx->current; layout = win->layout; out = &win->buffer; style = &ctx->style; item_spacing = style->window.spacing; padding = style->selectable.padding; /* calculate header bounds and draw background */ row_height = style->font->height + 2 * style->tab.padding.y; nk_layout_set_min_row_height(ctx, row_height); nk_layout_row_dynamic(ctx, row_height, 1); nk_layout_reset_min_row_height(ctx); widget_state = nk_widget(&header, ctx); if (type == NK_TREE_TAB) { const struct nk_style_item *background = &style->tab.background; if (background->type == NK_STYLE_ITEM_IMAGE) { nk_draw_image(out, header, &background->data.image, nk_white); text.background = nk_rgba(0,0,0,0); } else { text.background = background->data.color; nk_fill_rect(out, header, 0, style->tab.border_color); nk_fill_rect(out, nk_shrink_rect(header, style->tab.border), style->tab.rounding, background->data.color); } } else text.background = style->window.background; in = (!(layout->flags & NK_WINDOW_ROM)) ? &ctx->input: 0; in = (in && widget_state == NK_WIDGET_VALID) ? &ctx->input : 0; /* select correct button style */ if (*state == NK_MAXIMIZED) { symbol = style->tab.sym_maximize; if (type == NK_TREE_TAB) button = &style->tab.tab_maximize_button; else button = &style->tab.node_maximize_button; } else { symbol = style->tab.sym_minimize; if (type == NK_TREE_TAB) button = &style->tab.tab_minimize_button; else button = &style->tab.node_minimize_button; } {/* draw triangle button */ sym.w = sym.h = style->font->height; sym.y = header.y + style->tab.padding.y; sym.x = header.x + style->tab.padding.x; if (nk_do_button_symbol(&ws, &win->buffer, sym, symbol, NK_BUTTON_DEFAULT, button, in, style->font)) *state = (*state == NK_MAXIMIZED) ? NK_MINIMIZED : NK_MAXIMIZED;} /* draw label */ {nk_flags dummy = 0; struct nk_rect label; /* calculate size of the text and tooltip */ text_len = nk_strlen(title); text_width = style->font->width(style->font->userdata, style->font->height, title, text_len); text_width += (4 * padding.x); header.w = NK_MAX(header.w, sym.w + item_spacing.x); label.x = sym.x + sym.w + item_spacing.x; label.y = sym.y; label.w = NK_MIN(header.w - (sym.w + item_spacing.y + style->tab.indent), text_width); label.h = style->font->height; if (img) { nk_do_selectable_image(&dummy, &win->buffer, label, title, title_len, NK_TEXT_LEFT, selected, img, &style->selectable, in, style->font); } else nk_do_selectable(&dummy, &win->buffer, label, title, title_len, NK_TEXT_LEFT, selected, &style->selectable, in, style->font); } /* increase x-axis cursor widget position pointer */ if (*state == NK_MAXIMIZED) { layout->at_x = header.x + (float)*layout->offset_x + style->tab.indent; layout->bounds.w = NK_MAX(layout->bounds.w, style->tab.indent); layout->bounds.w -= (style->tab.indent + style->window.padding.x); layout->row.tree_depth++; return nk_true; } else return nk_false; }
pushq %rbp movq %rsp, %rbp subq $0x140, %rsp # imm = 0x140 movq 0x10(%rbp), %rax movq %rdi, -0x10(%rbp) movl %esi, -0x14(%rbp) movq %rdx, -0x20(%rbp) movq %rcx, -0x28(%rbp) movl %r8d, -0x2c(%rbp) movq %r9, -0x38(%rbp) leaq -0x98(%rbp), %rdi xorl %esi, %esi movl $0x10, %edx callq 0x1b0f0 leaq -0xa8(%rbp), %rdi xorl %esi, %esi movl $0x10, %edx callq 0x1b0f0 movl $0x0, -0xbc(%rbp) cmpq $0x0, -0x10(%rbp) je 0x5e61f jmp 0x5e63e leaq 0x32b2c(%rip), %rdi # 0x91152 leaq 0x2e8d3(%rip), %rsi # 0x8cf00 movl $0x47da, %edx # imm = 0x47DA leaq 0x363a4(%rip), %rcx # 0x949dd callq 0x1b1e0 movq -0x10(%rbp), %rax cmpq $0x0, 0x40d8(%rax) je 0x5e64e jmp 0x5e66d leaq 0x3169e(%rip), %rdi # 0x8fcf3 leaq 0x2e8a4(%rip), %rsi # 0x8cf00 movl $0x47db, %edx # imm = 0x47DB leaq 0x36375(%rip), %rcx # 0x949dd callq 0x1b1e0 movq -0x10(%rbp), %rax movq 0x40d8(%rax), %rax cmpq $0x0, 0xa8(%rax) je 0x5e684 jmp 0x5e6a3 leaq 0x317e4(%rip), %rdi # 0x8fe6f leaq 0x2e86e(%rip), %rsi # 0x8cf00 movl $0x47dc, %edx # imm = 0x47DC leaq 0x3633f(%rip), %rcx # 0x949dd callq 0x1b1e0 cmpq $0x0, -0x10(%rbp) je 0x5e6cd movq -0x10(%rbp), %rax cmpq $0x0, 0x40d8(%rax) je 0x5e6cd movq -0x10(%rbp), %rax movq 0x40d8(%rax), %rax cmpq $0x0, 0xa8(%rax) jne 0x5e6d9 movl $0x0, -0x4(%rbp) jmp 0x5ed83 movq -0x10(%rbp), %rax movq 0x40d8(%rax), %rax movq %rax, -0x40(%rbp) movq -0x40(%rbp), %rax movq 0xa8(%rax), %rax movq %rax, -0x48(%rbp) movq -0x40(%rbp), %rax addq $0x68, %rax movq %rax, -0x58(%rbp) movq -0x10(%rbp), %rax addq $0x168, %rax # imm = 0x168 movq %rax, -0x50(%rbp) movq -0x50(%rbp), %rax movq 0x1d24(%rax), %rax movq %rax, -0x88(%rbp) movq -0x50(%rbp), %rax movq 0x534(%rax), %rax movq %rax, -0x78(%rbp) movq -0x50(%rbp), %rax movq (%rax), %rax movss 0x8(%rax), %xmm1 movq -0x50(%rbp), %rax movss 0x1938(%rax), %xmm0 addss %xmm0, %xmm0 addss %xmm1, %xmm0 movss %xmm0, -0x70(%rbp) movq -0x10(%rbp), %rdi movss -0x70(%rbp), %xmm0 callq 0x3cdc0 movq -0x10(%rbp), %rdi movss -0x70(%rbp), %xmm0 movl $0x1, %esi callq 0x3d030 movq -0x10(%rbp), %rdi callq 0x32750 movq -0x10(%rbp), %rsi leaq -0x98(%rbp), %rdi callq 0x3b9f0 movl %eax, -0xc0(%rbp) cmpl $0x1, -0x14(%rbp) jne 0x5e8b2 movq -0x50(%rbp), %rax addq $0x1638, %rax # imm = 0x1638 movq %rax, -0xc8(%rbp) movq -0xc8(%rbp), %rax cmpl $0x1, (%rax) jne 0x5e80c movq -0x58(%rbp), %rdi movq -0xc8(%rbp), %rsi addq $0x8, %rsi movsd -0x98(%rbp), %xmm0 movsd -0x90(%rbp), %xmm1 movl 0x2e57d(%rip), %edx # 0x8cd60 callq 0x233b0 xorl %ecx, %ecx movl %ecx, %edi movl %ecx, %esi movl %ecx, %edx callq 0x1d120 movl %eax, -0xcc(%rbp) movl -0xcc(%rbp), %eax movl %eax, -0xb0(%rbp) jmp 0x5e8b0 movq -0xc8(%rbp), %rax movl 0x8(%rax), %eax movl %eax, -0xb0(%rbp) movq -0x58(%rbp), %rdi movq -0x50(%rbp), %rax movsd -0x98(%rbp), %xmm0 movsd -0x90(%rbp), %xmm1 movl 0x1658(%rax), %esi xorps %xmm2, %xmm2 callq 0x222a0 movq -0x58(%rbp), %rax movq %rax, -0xf8(%rbp) movq -0x50(%rbp), %rax movss 0x1928(%rax), %xmm2 movsd -0x98(%rbp), %xmm0 movsd -0x90(%rbp), %xmm1 callq 0x4ce90 movq -0xf8(%rbp), %rdi movlpd %xmm0, -0xdc(%rbp) movlpd %xmm1, -0xd4(%rbp) movq -0x50(%rbp), %rax movss 0x192c(%rax), %xmm2 movq -0xc8(%rbp), %rax movsd -0xdc(%rbp), %xmm0 movsd -0xd4(%rbp), %xmm1 movl 0x8(%rax), %esi callq 0x222a0 jmp 0x5e8c2 movq -0x50(%rbp), %rax movl 0x1cc0(%rax), %eax movl %eax, -0xb0(%rbp) movq -0x48(%rbp), %rax movl 0x4(%rax), %eax andl $0x1000, %eax # imm = 0x1000 cmpl $0x0, %eax jne 0x5e8e0 movq -0x10(%rbp), %rax movq %rax, -0x100(%rbp) jmp 0x5e8eb xorl %eax, %eax movq %rax, -0x100(%rbp) jmp 0x5e8eb movq -0x100(%rbp), %rax movq %rax, -0x60(%rbp) cmpq $0x0, -0x60(%rbp) je 0x5e913 cmpl $0x1, -0xc0(%rbp) jne 0x5e913 movq -0x10(%rbp), %rax movq %rax, -0x108(%rbp) jmp 0x5e91e xorl %eax, %eax movq %rax, -0x108(%rbp) jmp 0x5e91e movq -0x108(%rbp), %rax movq %rax, -0x60(%rbp) movq -0x38(%rbp), %rax cmpl $0x1, (%rax) jne 0x5e96f movq -0x50(%rbp), %rax movl 0x1924(%rax), %eax movl %eax, -0x6c(%rbp) cmpl $0x1, -0x14(%rbp) jne 0x5e959 movq -0x50(%rbp), %rax addq $0x1638, %rax # imm = 0x1638 addq $0x28, %rax movq %rax, -0x68(%rbp) jmp 0x5e96d movq -0x50(%rbp), %rax addq $0x1638, %rax # imm = 0x1638 addq $0x188, %rax # imm = 0x188 movq %rax, -0x68(%rbp) jmp 0x5e9ae movq -0x50(%rbp), %rax movl 0x1920(%rax), %eax movl %eax, -0x6c(%rbp) cmpl $0x1, -0x14(%rbp) jne 0x5e998 movq -0x50(%rbp), %rax addq $0x1638, %rax # imm = 0x1638 addq $0xd8, %rax movq %rax, -0x68(%rbp) jmp 0x5e9ac movq -0x50(%rbp), %rax addq $0x1638, %rax # imm = 0x1638 addq $0x238, %rax # imm = 0x238 movq %rax, -0x68(%rbp) jmp 0x5e9ae movq -0x50(%rbp), %rax movq (%rax), %rax movss 0x8(%rax), %xmm0 movss %xmm0, -0x9c(%rbp) movss %xmm0, -0xa0(%rbp) movss -0x94(%rbp), %xmm0 movq -0x50(%rbp), %rax movss 0x1938(%rax), %xmm1 addss %xmm1, %xmm0 movss %xmm0, -0xa4(%rbp) movss -0x98(%rbp), %xmm0 movq -0x50(%rbp), %rax movss 0x1934(%rax), %xmm1 addss %xmm1, %xmm0 movss %xmm0, -0xa8(%rbp) movq -0x40(%rbp), %rsi addq $0x68, %rsi movl -0x6c(%rbp), %edx movq -0x68(%rbp), %r8 movq -0x60(%rbp), %r9 movq -0x50(%rbp), %rax movq (%rax), %rcx movsd -0xa8(%rbp), %xmm0 movsd -0xa0(%rbp), %xmm1 movq %rsp, %rax movq %rcx, (%rax) leaq -0xbc(%rbp), %rdi xorl %ecx, %ecx callq 0x3c580 cmpl $0x0, %eax je 0x5ea66 movq -0x38(%rbp), %rax movl (%rax), %edx movl $0x1, %ecx xorl %eax, %eax cmpl $0x1, %edx cmovel %eax, %ecx movq -0x38(%rbp), %rax movl %ecx, (%rax) movl $0x0, -0xe0(%rbp) movq -0x28(%rbp), %rdi callq 0x1c230 movl %eax, -0x7c(%rbp) movq -0x50(%rbp), %rax movq (%rax), %rax movq 0x10(%rax), %rax movq -0x50(%rbp), %rcx movq (%rcx), %rcx movq -0x50(%rbp), %rdx movq (%rdx), %rdx movss 0x8(%rdx), %xmm0 movq -0x28(%rbp), %rsi movl -0x7c(%rbp), %edx movq (%rcx), %rdi callq *%rax movss %xmm0, -0x80(%rbp) movss -0x78(%rbp), %xmm0 movss -0x80(%rbp), %xmm1 movss 0x2a5db(%rip), %xmm2 # 0x89098 mulss %xmm2, %xmm0 addss %xmm1, %xmm0 movss %xmm0, -0x80(%rbp) movss -0x90(%rbp), %xmm1 movss -0xa0(%rbp), %xmm0 addss -0x88(%rbp), %xmm0 ucomiss %xmm1, %xmm0 jbe 0x5eb01 movss -0xa0(%rbp), %xmm0 addss -0x88(%rbp), %xmm0 movss %xmm0, -0x10c(%rbp) jmp 0x5eb11 movss -0x90(%rbp), %xmm0 movss %xmm0, -0x10c(%rbp) movss -0x10c(%rbp), %xmm0 movss %xmm0, -0x90(%rbp) movss -0xa8(%rbp), %xmm0 addss -0xa0(%rbp), %xmm0 addss -0x88(%rbp), %xmm0 movss %xmm0, -0xf0(%rbp) movss -0xa4(%rbp), %xmm0 movss %xmm0, -0xec(%rbp) movss -0x90(%rbp), %xmm1 movss -0xa0(%rbp), %xmm0 addss -0x84(%rbp), %xmm0 movq -0x50(%rbp), %rax addss 0x1930(%rax), %xmm0 subss %xmm0, %xmm1 movss -0x80(%rbp), %xmm0 ucomiss %xmm1, %xmm0 jbe 0x5ebb5 movss -0x90(%rbp), %xmm0 movss -0xa0(%rbp), %xmm1 addss -0x84(%rbp), %xmm1 movq -0x50(%rbp), %rax addss 0x1930(%rax), %xmm1 subss %xmm1, %xmm0 movss %xmm0, -0x110(%rbp) jmp 0x5ebc2 movss -0x80(%rbp), %xmm0 movss %xmm0, -0x110(%rbp) movss -0x110(%rbp), %xmm0 movss %xmm0, -0xe8(%rbp) movq -0x50(%rbp), %rax movq (%rax), %rax movss 0x8(%rax), %xmm0 movss %xmm0, -0xe4(%rbp) cmpq $0x0, -0x20(%rbp) je 0x5ec4f movq -0x40(%rbp), %rsi addq $0x68, %rsi movq -0x28(%rbp), %rdx movl -0x2c(%rbp), %ecx movq 0x10(%rbp), %r9 movq -0x20(%rbp), %rdi movq -0x50(%rbp), %rax movq %rax, %r8 addq $0x450, %r8 # imm = 0x450 movq -0x60(%rbp), %r10 movq (%rax), %r11 movsd -0xf0(%rbp), %xmm0 movsd -0xe8(%rbp), %xmm1 movq %rsp, %rax movq %r11, 0x18(%rax) movq %r10, 0x10(%rax) movq %r8, 0x8(%rax) movq %rdi, (%rax) leaq -0xe0(%rbp), %rdi movl $0x11, %r8d callq 0x464c0 jmp 0x5eca7 movq -0x40(%rbp), %rsi addq $0x68, %rsi movq -0x28(%rbp), %rdx movl -0x2c(%rbp), %ecx movq 0x10(%rbp), %r9 movq -0x50(%rbp), %rax movq %rax, %rdi addq $0x450, %rdi # imm = 0x450 movq -0x60(%rbp), %r8 movq (%rax), %r10 movsd -0xf0(%rbp), %xmm0 movsd -0xe8(%rbp), %xmm1 movq %rsp, %rax movq %r10, 0x10(%rax) movq %r8, 0x8(%rax) movq %rdi, (%rax) leaq -0xe0(%rbp), %rdi movl $0x11, %r8d callq 0x45fa0 movq -0x38(%rbp), %rax cmpl $0x1, (%rax) jne 0x5ed7c movss -0x98(%rbp), %xmm0 movq -0x48(%rbp), %rax movq 0x18(%rax), %rax movl (%rax), %eax cvtsi2ss %rax, %xmm1 addss %xmm1, %xmm0 movq -0x50(%rbp), %rax addss 0x1930(%rax), %xmm0 movq -0x48(%rbp), %rax movss %xmm0, 0x28(%rax) movq -0x48(%rbp), %rax movss 0x10(%rax), %xmm1 movq -0x50(%rbp), %rax movss 0x1930(%rax), %xmm0 ucomiss %xmm1, %xmm0 jbe 0x5ed14 movq -0x50(%rbp), %rax movss 0x1930(%rax), %xmm0 movss %xmm0, -0x114(%rbp) jmp 0x5ed25 movq -0x48(%rbp), %rax movss 0x10(%rax), %xmm0 movss %xmm0, -0x114(%rbp) movss -0x114(%rbp), %xmm0 movq -0x48(%rbp), %rax movss %xmm0, 0x10(%rax) movq -0x50(%rbp), %rax movss 0x1930(%rax), %xmm1 movq -0x50(%rbp), %rax addss 0x1d3c(%rax), %xmm1 movq -0x48(%rbp), %rax movss 0x10(%rax), %xmm0 subss %xmm1, %xmm0 movss %xmm0, 0x10(%rax) movq -0x48(%rbp), %rax movl 0xb0(%rax), %ecx addl $0x1, %ecx movl %ecx, 0xb0(%rax) movl $0x1, -0x4(%rbp) jmp 0x5ed83 movl $0x0, -0x4(%rbp) movl -0x4(%rbp), %eax addq $0x140, %rsp # imm = 0x140 popq %rbp retq nop
/Tigermouthbear[P]flappytiger/external/glfw/deps/nuklear.h
nk_vsnprintf
NK_INTERN int nk_vsnprintf(char *buf, int buf_size, const char *fmt, va_list args) { enum nk_arg_type { NK_ARG_TYPE_CHAR, NK_ARG_TYPE_SHORT, NK_ARG_TYPE_DEFAULT, NK_ARG_TYPE_LONG }; enum nk_arg_flags { NK_ARG_FLAG_LEFT = 0x01, NK_ARG_FLAG_PLUS = 0x02, NK_ARG_FLAG_SPACE = 0x04, NK_ARG_FLAG_NUM = 0x10, NK_ARG_FLAG_ZERO = 0x20 }; char number_buffer[NK_MAX_NUMBER_BUFFER]; enum nk_arg_type arg_type = NK_ARG_TYPE_DEFAULT; int precision = NK_DEFAULT; int width = NK_DEFAULT; nk_flags flag = 0; int len = 0; int result = -1; const char *iter = fmt; NK_ASSERT(buf); NK_ASSERT(buf_size); if (!buf || !buf_size || !fmt) return 0; for (iter = fmt; *iter && len < buf_size; iter++) { /* copy all non-format characters */ while (*iter && (*iter != '%') && (len < buf_size)) buf[len++] = *iter++; if (!(*iter) || len >= buf_size) break; iter++; /* flag arguments */ while (*iter) { if (*iter == '-') flag |= NK_ARG_FLAG_LEFT; else if (*iter == '+') flag |= NK_ARG_FLAG_PLUS; else if (*iter == ' ') flag |= NK_ARG_FLAG_SPACE; else if (*iter == '#') flag |= NK_ARG_FLAG_NUM; else if (*iter == '0') flag |= NK_ARG_FLAG_ZERO; else break; iter++; } /* width argument */ width = NK_DEFAULT; if (*iter >= '1' && *iter <= '9') { const char *end; width = nk_strtoi(iter, &end); if (end == iter) width = -1; else iter = end; } else if (*iter == '*') { width = va_arg(args, int); iter++; } /* precision argument */ precision = NK_DEFAULT; if (*iter == '.') { iter++; if (*iter == '*') { precision = va_arg(args, int); iter++; } else { const char *end; precision = nk_strtoi(iter, &end); if (end == iter) precision = -1; else iter = end; } } /* length modifier */ if (*iter == 'h') { if (*(iter+1) == 'h') { arg_type = NK_ARG_TYPE_CHAR; iter++; } else arg_type = NK_ARG_TYPE_SHORT; iter++; } else if (*iter == 'l') { arg_type = NK_ARG_TYPE_LONG; iter++; } else arg_type = NK_ARG_TYPE_DEFAULT; /* specifier */ if (*iter == '%') { NK_ASSERT(arg_type == NK_ARG_TYPE_DEFAULT); NK_ASSERT(precision == NK_DEFAULT); NK_ASSERT(width == NK_DEFAULT); if (len < buf_size) buf[len++] = '%'; } else if (*iter == 's') { /* string */ const char *str = va_arg(args, const char*); NK_ASSERT(str != buf && "buffer and argument are not allowed to overlap!"); NK_ASSERT(arg_type == NK_ARG_TYPE_DEFAULT); NK_ASSERT(precision == NK_DEFAULT); NK_ASSERT(width == NK_DEFAULT); if (str == buf) return -1; while (str && *str && len < buf_size) buf[len++] = *str++; } else if (*iter == 'n') { /* current length callback */ signed int *n = va_arg(args, int*); NK_ASSERT(arg_type == NK_ARG_TYPE_DEFAULT); NK_ASSERT(precision == NK_DEFAULT); NK_ASSERT(width == NK_DEFAULT); if (n) *n = len; } else if (*iter == 'c' || *iter == 'i' || *iter == 'd') { /* signed integer */ long value = 0; const char *num_iter; int num_len, num_print, padding; int cur_precision = NK_MAX(precision, 1); int cur_width = NK_MAX(width, 0); /* retrieve correct value type */ if (arg_type == NK_ARG_TYPE_CHAR) value = (signed char)va_arg(args, int); else if (arg_type == NK_ARG_TYPE_SHORT) value = (signed short)va_arg(args, int); else if (arg_type == NK_ARG_TYPE_LONG) value = va_arg(args, signed long); else if (*iter == 'c') value = (unsigned char)va_arg(args, int); else value = va_arg(args, signed int); /* convert number to string */ nk_itoa(number_buffer, value); num_len = nk_strlen(number_buffer); padding = NK_MAX(cur_width - NK_MAX(cur_precision, num_len), 0); if ((flag & NK_ARG_FLAG_PLUS) || (flag & NK_ARG_FLAG_SPACE)) padding = NK_MAX(padding-1, 0); /* fill left padding up to a total of `width` characters */ if (!(flag & NK_ARG_FLAG_LEFT)) { while (padding-- > 0 && (len < buf_size)) { if ((flag & NK_ARG_FLAG_ZERO) && (precision == NK_DEFAULT)) buf[len++] = '0'; else buf[len++] = ' '; } } /* copy string value representation into buffer */ if ((flag & NK_ARG_FLAG_PLUS) && value >= 0 && len < buf_size) buf[len++] = '+'; else if ((flag & NK_ARG_FLAG_SPACE) && value >= 0 && len < buf_size) buf[len++] = ' '; /* fill up to precision number of digits with '0' */ num_print = NK_MAX(cur_precision, num_len); while (precision && (num_print > num_len) && (len < buf_size)) { buf[len++] = '0'; num_print--; } /* copy string value representation into buffer */ num_iter = number_buffer; while (precision && *num_iter && len < buf_size) buf[len++] = *num_iter++; /* fill right padding up to width characters */ if (flag & NK_ARG_FLAG_LEFT) { while ((padding-- > 0) && (len < buf_size)) buf[len++] = ' '; } } else if (*iter == 'o' || *iter == 'x' || *iter == 'X' || *iter == 'u') { /* unsigned integer */ unsigned long value = 0; int num_len = 0, num_print, padding = 0; int cur_precision = NK_MAX(precision, 1); int cur_width = NK_MAX(width, 0); unsigned int base = (*iter == 'o') ? 8: (*iter == 'u')? 10: 16; /* print oct/hex/dec value */ const char *upper_output_format = "0123456789ABCDEF"; const char *lower_output_format = "0123456789abcdef"; const char *output_format = (*iter == 'x') ? lower_output_format: upper_output_format; /* retrieve correct value type */ if (arg_type == NK_ARG_TYPE_CHAR) value = (unsigned char)va_arg(args, int); else if (arg_type == NK_ARG_TYPE_SHORT) value = (unsigned short)va_arg(args, int); else if (arg_type == NK_ARG_TYPE_LONG) value = va_arg(args, unsigned long); else value = va_arg(args, unsigned int); do { /* convert decimal number into hex/oct number */ int digit = output_format[value % base]; if (num_len < NK_MAX_NUMBER_BUFFER) number_buffer[num_len++] = (char)digit; value /= base; } while (value > 0); num_print = NK_MAX(cur_precision, num_len); padding = NK_MAX(cur_width - NK_MAX(cur_precision, num_len), 0); if (flag & NK_ARG_FLAG_NUM) padding = NK_MAX(padding-1, 0); /* fill left padding up to a total of `width` characters */ if (!(flag & NK_ARG_FLAG_LEFT)) { while ((padding-- > 0) && (len < buf_size)) { if ((flag & NK_ARG_FLAG_ZERO) && (precision == NK_DEFAULT)) buf[len++] = '0'; else buf[len++] = ' '; } } /* fill up to precision number of digits */ if (num_print && (flag & NK_ARG_FLAG_NUM)) { if ((*iter == 'o') && (len < buf_size)) { buf[len++] = '0'; } else if ((*iter == 'x') && ((len+1) < buf_size)) { buf[len++] = '0'; buf[len++] = 'x'; } else if ((*iter == 'X') && ((len+1) < buf_size)) { buf[len++] = '0'; buf[len++] = 'X'; } } while (precision && (num_print > num_len) && (len < buf_size)) { buf[len++] = '0'; num_print--; } /* reverse number direction */ while (num_len > 0) { if (precision && (len < buf_size)) buf[len++] = number_buffer[num_len-1]; num_len--; } /* fill right padding up to width characters */ if (flag & NK_ARG_FLAG_LEFT) { while ((padding-- > 0) && (len < buf_size)) buf[len++] = ' '; } } else if (*iter == 'f') { /* floating point */ const char *num_iter; int cur_precision = (precision < 0) ? 6: precision; int prefix, cur_width = NK_MAX(width, 0); double value = va_arg(args, double); int num_len = 0, frac_len = 0, dot = 0; int padding = 0; NK_ASSERT(arg_type == NK_ARG_TYPE_DEFAULT); NK_DTOA(number_buffer, value); num_len = nk_strlen(number_buffer); /* calculate padding */ num_iter = number_buffer; while (*num_iter && *num_iter != '.') num_iter++; prefix = (*num_iter == '.')?(int)(num_iter - number_buffer)+1:0; padding = NK_MAX(cur_width - (prefix + NK_MIN(cur_precision, num_len - prefix)) , 0); if ((flag & NK_ARG_FLAG_PLUS) || (flag & NK_ARG_FLAG_SPACE)) padding = NK_MAX(padding-1, 0); /* fill left padding up to a total of `width` characters */ if (!(flag & NK_ARG_FLAG_LEFT)) { while (padding-- > 0 && (len < buf_size)) { if (flag & NK_ARG_FLAG_ZERO) buf[len++] = '0'; else buf[len++] = ' '; } } /* copy string value representation into buffer */ num_iter = number_buffer; if ((flag & NK_ARG_FLAG_PLUS) && (value >= 0) && (len < buf_size)) buf[len++] = '+'; else if ((flag & NK_ARG_FLAG_SPACE) && (value >= 0) && (len < buf_size)) buf[len++] = ' '; while (*num_iter) { if (dot) frac_len++; if (len < buf_size) buf[len++] = *num_iter; if (*num_iter == '.') dot = 1; if (frac_len >= cur_precision) break; num_iter++; } /* fill number up to precision */ while (frac_len < cur_precision) { if (!dot && len < buf_size) { buf[len++] = '.'; dot = 1; } if (len < buf_size) buf[len++] = '0'; frac_len++; } /* fill right padding up to width characters */ if (flag & NK_ARG_FLAG_LEFT) { while ((padding-- > 0) && (len < buf_size)) buf[len++] = ' '; } } else { /* Specifier not supported: g,G,e,E,p,z */ NK_ASSERT(0 && "specifier is not supported!"); return result; } } buf[(len >= buf_size)?(buf_size-1):len] = 0; result = (len >= buf_size)?-1:len; return result; }
pushq %rbp movq %rsp, %rbp subq $0x350, %rsp # imm = 0x350 movq %rdi, -0x10(%rbp) movl %esi, -0x14(%rbp) movq %rdx, -0x20(%rbp) movq %rcx, -0x28(%rbp) movl $0x2, -0x74(%rbp) movl $0xffffffff, -0x78(%rbp) # imm = 0xFFFFFFFF movl $0xffffffff, -0x7c(%rbp) # imm = 0xFFFFFFFF movl $0x0, -0x80(%rbp) movl $0x0, -0x84(%rbp) movl $0xffffffff, -0x88(%rbp) # imm = 0xFFFFFFFF movq -0x20(%rbp), %rax movq %rax, -0x90(%rbp) cmpq $0x0, -0x10(%rbp) je 0x5f70e jmp 0x5f72d leaq 0x3566c(%rip), %rdi # 0x94d81 leaq 0x2d7e4(%rip), %rsi # 0x8cf00 movl $0x1ab8, %edx # imm = 0x1AB8 leaq 0x356a7(%rip), %rcx # 0x94dcf callq 0x1b1e0 cmpl $0x0, -0x14(%rbp) je 0x5f735 jmp 0x5f754 leaq 0x3568a(%rip), %rdi # 0x94dc6 leaq 0x2d7bd(%rip), %rsi # 0x8cf00 movl $0x1ab9, %edx # imm = 0x1AB9 leaq 0x35680(%rip), %rcx # 0x94dcf callq 0x1b1e0 cmpq $0x0, -0x10(%rbp) je 0x5f768 cmpl $0x0, -0x14(%rbp) je 0x5f768 cmpq $0x0, -0x20(%rbp) jne 0x5f774 movl $0x0, -0x4(%rbp) jmp 0x613a2 movq -0x20(%rbp), %rax movq %rax, -0x90(%rbp) movq -0x90(%rbp), %rax movsbl (%rax), %ecx xorl %eax, %eax cmpl $0x0, %ecx movb %al, -0x149(%rbp) je 0x5f7a8 movl -0x84(%rbp), %eax cmpl -0x14(%rbp), %eax setl %al movb %al, -0x149(%rbp) movb -0x149(%rbp), %al testb $0x1, %al jne 0x5f7b7 jmp 0x61325 jmp 0x5f7b9 movq -0x90(%rbp), %rax movsbl (%rax), %ecx xorl %eax, %eax cmpl $0x0, %ecx movb %al, -0x14a(%rbp) je 0x5f7f9 movq -0x90(%rbp), %rax movsbl (%rax), %ecx xorl %eax, %eax cmpl $0x25, %ecx movb %al, -0x14a(%rbp) je 0x5f7f9 movl -0x84(%rbp), %eax cmpl -0x14(%rbp), %eax setl %al movb %al, -0x14a(%rbp) movb -0x14a(%rbp), %al testb $0x1, %al jne 0x5f805 jmp 0x5f839 movq -0x90(%rbp), %rax movq %rax, %rcx addq $0x1, %rcx movq %rcx, -0x90(%rbp) movb (%rax), %dl movq -0x10(%rbp), %rax movl -0x84(%rbp), %ecx movl %ecx, %esi addl $0x1, %esi movl %esi, -0x84(%rbp) movslq %ecx, %rcx movb %dl, (%rax,%rcx) jmp 0x5f7b9 movq -0x90(%rbp), %rax cmpb $0x0, (%rax) je 0x5f850 movl -0x84(%rbp), %eax cmpl -0x14(%rbp), %eax jl 0x5f855 jmp 0x61325 movq -0x90(%rbp), %rax addq $0x1, %rax movq %rax, -0x90(%rbp) movq -0x90(%rbp), %rax cmpb $0x0, (%rax) je 0x5f91a movq -0x90(%rbp), %rax movsbl (%rax), %eax cmpl $0x2d, %eax jne 0x5f891 movl -0x80(%rbp), %eax orl $0x1, %eax movl %eax, -0x80(%rbp) jmp 0x5f903 movq -0x90(%rbp), %rax movsbl (%rax), %eax cmpl $0x2b, %eax jne 0x5f8ab movl -0x80(%rbp), %eax orl $0x2, %eax movl %eax, -0x80(%rbp) jmp 0x5f901 movq -0x90(%rbp), %rax movsbl (%rax), %eax cmpl $0x20, %eax jne 0x5f8c5 movl -0x80(%rbp), %eax orl $0x4, %eax movl %eax, -0x80(%rbp) jmp 0x5f8ff movq -0x90(%rbp), %rax movsbl (%rax), %eax cmpl $0x23, %eax jne 0x5f8df movl -0x80(%rbp), %eax orl $0x10, %eax movl %eax, -0x80(%rbp) jmp 0x5f8fd movq -0x90(%rbp), %rax movsbl (%rax), %eax cmpl $0x30, %eax jne 0x5f8f9 movl -0x80(%rbp), %eax orl $0x20, %eax movl %eax, -0x80(%rbp) jmp 0x5f8fb jmp 0x5f91a jmp 0x5f8fd jmp 0x5f8ff jmp 0x5f901 jmp 0x5f903 movq -0x90(%rbp), %rax addq $0x1, %rax movq %rax, -0x90(%rbp) jmp 0x5f867 movl $0xffffffff, -0x7c(%rbp) # imm = 0xFFFFFFFF movq -0x90(%rbp), %rax movsbl (%rax), %eax cmpl $0x31, %eax jl 0x5f981 movq -0x90(%rbp), %rax movsbl (%rax), %eax cmpl $0x39, %eax jg 0x5f981 movq -0x90(%rbp), %rdi leaq -0x98(%rbp), %rsi callq 0x1c2c0 movl %eax, -0x7c(%rbp) movq -0x98(%rbp), %rax cmpq -0x90(%rbp), %rax jne 0x5f96e movl $0xffffffff, -0x7c(%rbp) # imm = 0xFFFFFFFF jmp 0x5f97c movq -0x98(%rbp), %rax movq %rax, -0x90(%rbp) jmp 0x5fa07 movq -0x90(%rbp), %rax movsbl (%rax), %eax cmpl $0x2a, %eax jne 0x5fa05 movq -0x28(%rbp), %rax movq %rax, -0x158(%rbp) movl (%rax), %eax movl %eax, -0x150(%rbp) cmpl $0x28, %eax ja 0x5f9ca movq -0x158(%rbp), %rcx movl -0x150(%rbp), %edx movslq %edx, %rax addq 0x10(%rcx), %rax addl $0x8, %edx movl %edx, (%rcx) movq %rax, -0x160(%rbp) jmp 0x5f9e7 movq -0x158(%rbp), %rcx movq 0x8(%rcx), %rax movq %rax, %rdx addq $0x8, %rdx movq %rdx, 0x8(%rcx) movq %rax, -0x160(%rbp) movq -0x160(%rbp), %rax movl (%rax), %eax movl %eax, -0x7c(%rbp) movq -0x90(%rbp), %rax addq $0x1, %rax movq %rax, -0x90(%rbp) jmp 0x5fa07 movl $0xffffffff, -0x78(%rbp) # imm = 0xFFFFFFFF movq -0x90(%rbp), %rax movsbl (%rax), %eax cmpl $0x2e, %eax jne 0x5fafa movq -0x90(%rbp), %rax addq $0x1, %rax movq %rax, -0x90(%rbp) movq -0x90(%rbp), %rax movsbl (%rax), %eax cmpl $0x2a, %eax jne 0x5fab9 movq -0x28(%rbp), %rax movq %rax, -0x170(%rbp) movl (%rax), %eax movl %eax, -0x164(%rbp) cmpl $0x28, %eax ja 0x5fa7c movq -0x170(%rbp), %rcx movl -0x164(%rbp), %edx movslq %edx, %rax addq 0x10(%rcx), %rax addl $0x8, %edx movl %edx, (%rcx) movq %rax, -0x178(%rbp) jmp 0x5fa99 movq -0x170(%rbp), %rcx movq 0x8(%rcx), %rax movq %rax, %rdx addq $0x8, %rdx movq %rdx, 0x8(%rcx) movq %rax, -0x178(%rbp) movq -0x178(%rbp), %rax movl (%rax), %eax movl %eax, -0x78(%rbp) movq -0x90(%rbp), %rax addq $0x1, %rax movq %rax, -0x90(%rbp) jmp 0x5faf8 movq -0x90(%rbp), %rdi leaq -0xa0(%rbp), %rsi callq 0x1c2c0 movl %eax, -0x78(%rbp) movq -0xa0(%rbp), %rax cmpq -0x90(%rbp), %rax jne 0x5fae8 movl $0xffffffff, -0x78(%rbp) # imm = 0xFFFFFFFF jmp 0x5faf6 movq -0xa0(%rbp), %rax movq %rax, -0x90(%rbp) jmp 0x5faf8 jmp 0x5fafa movq -0x90(%rbp), %rax movsbl (%rax), %eax cmpl $0x68, %eax jne 0x5fb4f movq -0x90(%rbp), %rax movsbl 0x1(%rax), %eax cmpl $0x68, %eax jne 0x5fb34 movl $0x0, -0x74(%rbp) movq -0x90(%rbp), %rax addq $0x1, %rax movq %rax, -0x90(%rbp) jmp 0x5fb3b movl $0x1, -0x74(%rbp) movq -0x90(%rbp), %rax addq $0x1, %rax movq %rax, -0x90(%rbp) jmp 0x5fb82 movq -0x90(%rbp), %rax movsbl (%rax), %eax cmpl $0x6c, %eax jne 0x5fb79 movl $0x3, -0x74(%rbp) movq -0x90(%rbp), %rax addq $0x1, %rax movq %rax, -0x90(%rbp) jmp 0x5fb80 movl $0x2, -0x74(%rbp) jmp 0x5fb82 movq -0x90(%rbp), %rax movsbl (%rax), %eax cmpl $0x25, %eax jne 0x5fc36 cmpl $0x2, -0x74(%rbp) jne 0x5fb9d jmp 0x5fbbc leaq 0x3526f(%rip), %rdi # 0x94e13 leaq 0x2d355(%rip), %rsi # 0x8cf00 movl $0x1af8, %edx # imm = 0x1AF8 leaq 0x35218(%rip), %rcx # 0x94dcf callq 0x1b1e0 cmpl $-0x1, -0x78(%rbp) jne 0x5fbc4 jmp 0x5fbe3 leaq 0x35268(%rip), %rdi # 0x94e33 leaq 0x2d32e(%rip), %rsi # 0x8cf00 movl $0x1af9, %edx # imm = 0x1AF9 leaq 0x351f1(%rip), %rcx # 0x94dcf callq 0x1b1e0 cmpl $-0x1, -0x7c(%rbp) jne 0x5fbeb jmp 0x5fc0a leaq 0x35253(%rip), %rdi # 0x94e45 leaq 0x2d307(%rip), %rsi # 0x8cf00 movl $0x1afa, %edx # imm = 0x1AFA leaq 0x351ca(%rip), %rcx # 0x94dcf callq 0x1b1e0 movl -0x84(%rbp), %eax cmpl -0x14(%rbp), %eax jge 0x5fc31 movq -0x10(%rbp), %rax movl -0x84(%rbp), %ecx movl %ecx, %edx addl $0x1, %edx movl %edx, -0x84(%rbp) movslq %ecx, %rcx movb $0x25, (%rax,%rcx) jmp 0x6130c movq -0x90(%rbp), %rax movsbl (%rax), %eax cmpl $0x73, %eax jne 0x5fdf7 movq -0x28(%rbp), %rax movq %rax, -0x188(%rbp) movl (%rax), %eax movl %eax, -0x17c(%rbp) cmpl $0x28, %eax ja 0x5fc83 movq -0x188(%rbp), %rcx movl -0x17c(%rbp), %edx movslq %edx, %rax addq 0x10(%rcx), %rax addl $0x8, %edx movl %edx, (%rcx) movq %rax, -0x190(%rbp) jmp 0x5fca0 movq -0x188(%rbp), %rcx movq 0x8(%rcx), %rax movq %rax, %rdx addq $0x8, %rdx movq %rdx, 0x8(%rcx) movq %rax, -0x190(%rbp) movq -0x190(%rbp), %rax movq (%rax), %rax movq %rax, -0xa8(%rbp) movq -0xa8(%rbp), %rax cmpq -0x10(%rbp), %rax je 0x5fcc8 movb $0x1, %al testb $0x1, %al jne 0x5fcc6 jmp 0x5fcc8 jmp 0x5fce7 leaq 0x351b4(%rip), %rdi # 0x94e83 leaq 0x2d22a(%rip), %rsi # 0x8cf00 movl $0x1b00, %edx # imm = 0x1B00 leaq 0x350ed(%rip), %rcx # 0x94dcf callq 0x1b1e0 cmpl $0x2, -0x74(%rbp) jne 0x5fcef jmp 0x5fd0e leaq 0x3511d(%rip), %rdi # 0x94e13 leaq 0x2d203(%rip), %rsi # 0x8cf00 movl $0x1b01, %edx # imm = 0x1B01 leaq 0x350c6(%rip), %rcx # 0x94dcf callq 0x1b1e0 cmpl $-0x1, -0x78(%rbp) jne 0x5fd16 jmp 0x5fd35 leaq 0x35116(%rip), %rdi # 0x94e33 leaq 0x2d1dc(%rip), %rsi # 0x8cf00 movl $0x1b02, %edx # imm = 0x1B02 leaq 0x3509f(%rip), %rcx # 0x94dcf callq 0x1b1e0 cmpl $-0x1, -0x7c(%rbp) jne 0x5fd3d jmp 0x5fd5c leaq 0x35101(%rip), %rdi # 0x94e45 leaq 0x2d1b5(%rip), %rsi # 0x8cf00 movl $0x1b03, %edx # imm = 0x1B03 leaq 0x35078(%rip), %rcx # 0x94dcf callq 0x1b1e0 movq -0xa8(%rbp), %rax cmpq -0x10(%rbp), %rax jne 0x5fd75 movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF jmp 0x613a2 jmp 0x5fd77 xorl %eax, %eax cmpq $0x0, -0xa8(%rbp) movb %al, -0x191(%rbp) je 0x5fdb2 movq -0xa8(%rbp), %rax movsbl (%rax), %ecx xorl %eax, %eax cmpl $0x0, %ecx movb %al, -0x191(%rbp) je 0x5fdb2 movl -0x84(%rbp), %eax cmpl -0x14(%rbp), %eax setl %al movb %al, -0x191(%rbp) movb -0x191(%rbp), %al testb $0x1, %al jne 0x5fdbe jmp 0x5fdf2 movq -0xa8(%rbp), %rax movq %rax, %rcx addq $0x1, %rcx movq %rcx, -0xa8(%rbp) movb (%rax), %dl movq -0x10(%rbp), %rax movl -0x84(%rbp), %ecx movl %ecx, %esi addl $0x1, %esi movl %esi, -0x84(%rbp) movslq %ecx, %rcx movb %dl, (%rax,%rcx) jmp 0x5fd77 jmp 0x6130a movq -0x90(%rbp), %rax movsbl (%rax), %eax cmpl $0x6e, %eax jne 0x5ff05 movq -0x28(%rbp), %rax movq %rax, -0x1a0(%rbp) movl (%rax), %eax movl %eax, -0x198(%rbp) cmpl $0x28, %eax ja 0x5fe44 movq -0x1a0(%rbp), %rcx movl -0x198(%rbp), %edx movslq %edx, %rax addq 0x10(%rcx), %rax addl $0x8, %edx movl %edx, (%rcx) movq %rax, -0x1a8(%rbp) jmp 0x5fe61 movq -0x1a0(%rbp), %rcx movq 0x8(%rcx), %rax movq %rax, %rdx addq $0x8, %rdx movq %rdx, 0x8(%rcx) movq %rax, -0x1a8(%rbp) movq -0x1a8(%rbp), %rax movq (%rax), %rax movq %rax, -0xb0(%rbp) cmpl $0x2, -0x74(%rbp) jne 0x5fe7a jmp 0x5fe99 leaq 0x34f92(%rip), %rdi # 0x94e13 leaq 0x2d078(%rip), %rsi # 0x8cf00 movl $0x1b0a, %edx # imm = 0x1B0A leaq 0x34f3b(%rip), %rcx # 0x94dcf callq 0x1b1e0 cmpl $-0x1, -0x78(%rbp) jne 0x5fea1 jmp 0x5fec0 leaq 0x34f8b(%rip), %rdi # 0x94e33 leaq 0x2d051(%rip), %rsi # 0x8cf00 movl $0x1b0b, %edx # imm = 0x1B0B leaq 0x34f14(%rip), %rcx # 0x94dcf callq 0x1b1e0 cmpl $-0x1, -0x7c(%rbp) jne 0x5fec8 jmp 0x5fee7 leaq 0x34f76(%rip), %rdi # 0x94e45 leaq 0x2d02a(%rip), %rsi # 0x8cf00 movl $0x1b0c, %edx # imm = 0x1B0C leaq 0x34eed(%rip), %rcx # 0x94dcf callq 0x1b1e0 cmpq $0x0, -0xb0(%rbp) je 0x5ff00 movl -0x84(%rbp), %ecx movq -0xb0(%rbp), %rax movl %ecx, (%rax) jmp 0x61308 movq -0x90(%rbp), %rax movsbl (%rax), %eax cmpl $0x63, %eax je 0x5ff36 movq -0x90(%rbp), %rax movsbl (%rax), %eax cmpl $0x69, %eax je 0x5ff36 movq -0x90(%rbp), %rax movsbl (%rax), %eax cmpl $0x64, %eax jne 0x60591 movq $0x0, -0xb8(%rbp) cmpl $0x1, -0x78(%rbp) jge 0x5ff54 movl $0x1, %eax movl %eax, -0x1ac(%rbp) jmp 0x5ff5d movl -0x78(%rbp), %eax movl %eax, -0x1ac(%rbp) movl -0x1ac(%rbp), %eax movl %eax, -0xd0(%rbp) cmpl $0x0, -0x7c(%rbp) jge 0x5ff79 xorl %eax, %eax movl %eax, -0x1b0(%rbp) jmp 0x5ff82 movl -0x7c(%rbp), %eax movl %eax, -0x1b0(%rbp) movl -0x1b0(%rbp), %eax movl %eax, -0xd4(%rbp) cmpl $0x0, -0x74(%rbp) jne 0x60004 movq -0x28(%rbp), %rax movq %rax, -0x1c0(%rbp) movl (%rax), %eax movl %eax, -0x1b4(%rbp) cmpl $0x28, %eax ja 0x5ffce movq -0x1c0(%rbp), %rcx movl -0x1b4(%rbp), %edx movslq %edx, %rax addq 0x10(%rcx), %rax addl $0x8, %edx movl %edx, (%rcx) movq %rax, -0x1c8(%rbp) jmp 0x5ffeb movq -0x1c0(%rbp), %rcx movq 0x8(%rcx), %rax movq %rax, %rdx addq $0x8, %rdx movq %rdx, 0x8(%rcx) movq %rax, -0x1c8(%rbp) movq -0x1c8(%rbp), %rax movl (%rax), %eax movsbq %al, %rax movq %rax, -0xb8(%rbp) jmp 0x601d6 cmpl $0x1, -0x74(%rbp) jne 0x6007a movq -0x28(%rbp), %rax movq %rax, -0x1d8(%rbp) movl (%rax), %eax movl %eax, -0x1cc(%rbp) cmpl $0x28, %eax ja 0x60044 movq -0x1d8(%rbp), %rcx movl -0x1cc(%rbp), %edx movslq %edx, %rax addq 0x10(%rcx), %rax addl $0x8, %edx movl %edx, (%rcx) movq %rax, -0x1e0(%rbp) jmp 0x60061 movq -0x1d8(%rbp), %rcx movq 0x8(%rcx), %rax movq %rax, %rdx addq $0x8, %rdx movq %rdx, 0x8(%rcx) movq %rax, -0x1e0(%rbp) movq -0x1e0(%rbp), %rax movl (%rax), %eax movswq %ax, %rax movq %rax, -0xb8(%rbp) jmp 0x601d4 cmpl $0x3, -0x74(%rbp) jne 0x600ed movq -0x28(%rbp), %rax movq %rax, -0x1f0(%rbp) movl (%rax), %eax movl %eax, -0x1e4(%rbp) cmpl $0x28, %eax ja 0x600ba movq -0x1f0(%rbp), %rcx movl -0x1e4(%rbp), %edx movslq %edx, %rax addq 0x10(%rcx), %rax addl $0x8, %edx movl %edx, (%rcx) movq %rax, -0x1f8(%rbp) jmp 0x600d7 movq -0x1f0(%rbp), %rcx movq 0x8(%rcx), %rax movq %rax, %rdx addq $0x8, %rdx movq %rdx, 0x8(%rcx) movq %rax, -0x1f8(%rbp) movq -0x1f8(%rbp), %rax movq (%rax), %rax movq %rax, -0xb8(%rbp) jmp 0x601d2 movq -0x90(%rbp), %rax movsbl (%rax), %eax cmpl $0x63, %eax jne 0x60168 movq -0x28(%rbp), %rax movq %rax, -0x208(%rbp) movl (%rax), %eax movl %eax, -0x1fc(%rbp) cmpl $0x28, %eax ja 0x60136 movq -0x208(%rbp), %rcx movl -0x1fc(%rbp), %edx movslq %edx, %rax addq 0x10(%rcx), %rax addl $0x8, %edx movl %edx, (%rcx) movq %rax, -0x210(%rbp) jmp 0x60153 movq -0x208(%rbp), %rcx movq 0x8(%rcx), %rax movq %rax, %rdx addq $0x8, %rdx movq %rdx, 0x8(%rcx) movq %rax, -0x210(%rbp) movq -0x210(%rbp), %rax movl (%rax), %eax movzbl %al, %eax movq %rax, -0xb8(%rbp) jmp 0x601d0 movq -0x28(%rbp), %rax movq %rax, -0x220(%rbp) movl (%rax), %eax movl %eax, -0x214(%rbp) cmpl $0x28, %eax ja 0x601a2 movq -0x220(%rbp), %rcx movl -0x214(%rbp), %edx movslq %edx, %rax addq 0x10(%rcx), %rax addl $0x8, %edx movl %edx, (%rcx) movq %rax, -0x228(%rbp) jmp 0x601bf movq -0x220(%rbp), %rcx movq 0x8(%rcx), %rax movq %rax, %rdx addq $0x8, %rdx movq %rdx, 0x8(%rcx) movq %rax, -0x228(%rbp) movq -0x228(%rbp), %rax movslq (%rax), %rax movq %rax, -0xb8(%rbp) jmp 0x601d2 jmp 0x601d4 jmp 0x601d6 leaq -0x70(%rbp), %rdi movq -0xb8(%rbp), %rsi callq 0x613b0 leaq -0x70(%rbp), %rdi callq 0x1c230 movl %eax, -0xc4(%rbp) movl -0xd4(%rbp), %eax movl %eax, -0x22c(%rbp) movl -0xd0(%rbp), %eax cmpl -0xc4(%rbp), %eax jge 0x6021d movl -0xc4(%rbp), %eax movl %eax, -0x230(%rbp) jmp 0x60229 movl -0xd0(%rbp), %eax movl %eax, -0x230(%rbp) movl -0x22c(%rbp), %eax movl -0x230(%rbp), %ecx subl %ecx, %eax cmpl $0x0, %eax jge 0x60246 xorl %eax, %eax movl %eax, -0x234(%rbp) jmp 0x6028e movl -0xd4(%rbp), %eax movl %eax, -0x238(%rbp) movl -0xd0(%rbp), %eax cmpl -0xc4(%rbp), %eax jge 0x6026e movl -0xc4(%rbp), %eax movl %eax, -0x23c(%rbp) jmp 0x6027a movl -0xd0(%rbp), %eax movl %eax, -0x23c(%rbp) movl -0x238(%rbp), %eax movl -0x23c(%rbp), %ecx subl %ecx, %eax movl %eax, -0x234(%rbp) movl -0x234(%rbp), %eax movl %eax, -0xcc(%rbp) movl -0x80(%rbp), %eax andl $0x2, %eax cmpl $0x0, %eax jne 0x602b0 movl -0x80(%rbp), %eax andl $0x4, %eax cmpl $0x0, %eax je 0x602e3 movl -0xcc(%rbp), %eax subl $0x1, %eax cmpl $0x0, %eax jge 0x602c8 xorl %eax, %eax movl %eax, -0x240(%rbp) jmp 0x602d7 movl -0xcc(%rbp), %eax subl $0x1, %eax movl %eax, -0x240(%rbp) movl -0x240(%rbp), %eax movl %eax, -0xcc(%rbp) movl -0x80(%rbp), %eax andl $0x1, %eax cmpl $0x0, %eax jne 0x60382 jmp 0x602f4 movl -0xcc(%rbp), %ecx movl %ecx, %eax addl $-0x1, %eax movl %eax, -0xcc(%rbp) xorl %eax, %eax cmpl $0x0, %ecx movb %al, -0x241(%rbp) jle 0x60324 movl -0x84(%rbp), %eax cmpl -0x14(%rbp), %eax setl %al movb %al, -0x241(%rbp) movb -0x241(%rbp), %al testb $0x1, %al jne 0x60330 jmp 0x60380 movl -0x80(%rbp), %eax andl $0x20, %eax cmpl $0x0, %eax je 0x6035f cmpl $-0x1, -0x78(%rbp) jne 0x6035f movq -0x10(%rbp), %rax movl -0x84(%rbp), %ecx movl %ecx, %edx addl $0x1, %edx movl %edx, -0x84(%rbp) movslq %ecx, %rcx movb $0x30, (%rax,%rcx) jmp 0x6037b movq -0x10(%rbp), %rax movl -0x84(%rbp), %ecx movl %ecx, %edx addl $0x1, %edx movl %edx, -0x84(%rbp) movslq %ecx, %rcx movb $0x20, (%rax,%rcx) jmp 0x602f4 jmp 0x60382 movl -0x80(%rbp), %eax andl $0x2, %eax cmpl $0x0, %eax je 0x603c0 cmpq $0x0, -0xb8(%rbp) jl 0x603c0 movl -0x84(%rbp), %eax cmpl -0x14(%rbp), %eax jge 0x603c0 movq -0x10(%rbp), %rax movl -0x84(%rbp), %ecx movl %ecx, %edx addl $0x1, %edx movl %edx, -0x84(%rbp) movslq %ecx, %rcx movb $0x2b, (%rax,%rcx) jmp 0x603fe movl -0x80(%rbp), %eax andl $0x4, %eax cmpl $0x0, %eax je 0x603fc cmpq $0x0, -0xb8(%rbp) jl 0x603fc movl -0x84(%rbp), %eax cmpl -0x14(%rbp), %eax jge 0x603fc movq -0x10(%rbp), %rax movl -0x84(%rbp), %ecx movl %ecx, %edx addl $0x1, %edx movl %edx, -0x84(%rbp) movslq %ecx, %rcx movb $0x20, (%rax,%rcx) jmp 0x603fe movl -0xd0(%rbp), %eax cmpl -0xc4(%rbp), %eax jge 0x6041a movl -0xc4(%rbp), %eax movl %eax, -0x248(%rbp) jmp 0x60426 movl -0xd0(%rbp), %eax movl %eax, -0x248(%rbp) movl -0x248(%rbp), %eax movl %eax, -0xc8(%rbp) xorl %eax, %eax cmpl $0x0, -0x78(%rbp) movb %al, -0x249(%rbp) je 0x60468 movl -0xc8(%rbp), %ecx xorl %eax, %eax cmpl -0xc4(%rbp), %ecx movb %al, -0x249(%rbp) jle 0x60468 movl -0x84(%rbp), %eax cmpl -0x14(%rbp), %eax setl %al movb %al, -0x249(%rbp) movb -0x249(%rbp), %al testb $0x1, %al jne 0x60474 jmp 0x604a1 movq -0x10(%rbp), %rax movl -0x84(%rbp), %ecx movl %ecx, %edx addl $0x1, %edx movl %edx, -0x84(%rbp) movslq %ecx, %rcx movb $0x30, (%rax,%rcx) movl -0xc8(%rbp), %eax addl $-0x1, %eax movl %eax, -0xc8(%rbp) jmp 0x60432 leaq -0x70(%rbp), %rax movq %rax, -0xc0(%rbp) xorl %eax, %eax cmpl $0x0, -0x78(%rbp) movb %al, -0x24a(%rbp) je 0x604e3 movq -0xc0(%rbp), %rax movsbl (%rax), %ecx xorl %eax, %eax cmpl $0x0, %ecx movb %al, -0x24a(%rbp) je 0x604e3 movl -0x84(%rbp), %eax cmpl -0x14(%rbp), %eax setl %al movb %al, -0x24a(%rbp) movb -0x24a(%rbp), %al testb $0x1, %al jne 0x604ef jmp 0x60523 movq -0xc0(%rbp), %rax movq %rax, %rcx addq $0x1, %rcx movq %rcx, -0xc0(%rbp) movb (%rax), %dl movq -0x10(%rbp), %rax movl -0x84(%rbp), %ecx movl %ecx, %esi addl $0x1, %esi movl %esi, -0x84(%rbp) movslq %ecx, %rcx movb %dl, (%rax,%rcx) jmp 0x604ac movl -0x80(%rbp), %eax andl $0x1, %eax cmpl $0x0, %eax je 0x6058c jmp 0x60530 movl -0xcc(%rbp), %ecx movl %ecx, %eax addl $-0x1, %eax movl %eax, -0xcc(%rbp) xorl %eax, %eax cmpl $0x0, %ecx movb %al, -0x24b(%rbp) jle 0x60560 movl -0x84(%rbp), %eax cmpl -0x14(%rbp), %eax setl %al movb %al, -0x24b(%rbp) movb -0x24b(%rbp), %al testb $0x1, %al jne 0x6056c jmp 0x6058a movq -0x10(%rbp), %rax movl -0x84(%rbp), %ecx movl %ecx, %edx addl $0x1, %edx movl %edx, -0x84(%rbp) movslq %ecx, %rcx movb $0x20, (%rax,%rcx) jmp 0x60530 jmp 0x6058c jmp 0x61306 movq -0x90(%rbp), %rax movsbl (%rax), %eax cmpl $0x6f, %eax je 0x605d1 movq -0x90(%rbp), %rax movsbl (%rax), %eax cmpl $0x78, %eax je 0x605d1 movq -0x90(%rbp), %rax movsbl (%rax), %eax cmpl $0x58, %eax je 0x605d1 movq -0x90(%rbp), %rax movsbl (%rax), %eax cmpl $0x75, %eax jne 0x60d16 movq $0x0, -0xe0(%rbp) movl $0x0, -0xe4(%rbp) movl $0x0, -0xec(%rbp) cmpl $0x1, -0x78(%rbp) jge 0x60603 movl $0x1, %eax movl %eax, -0x250(%rbp) jmp 0x6060c movl -0x78(%rbp), %eax movl %eax, -0x250(%rbp) movl -0x250(%rbp), %eax movl %eax, -0xf0(%rbp) cmpl $0x0, -0x7c(%rbp) jge 0x60628 xorl %eax, %eax movl %eax, -0x254(%rbp) jmp 0x60631 movl -0x7c(%rbp), %eax movl %eax, -0x254(%rbp) movl -0x254(%rbp), %eax movl %eax, -0xf4(%rbp) movq -0x90(%rbp), %rax movsbl (%rax), %eax cmpl $0x6f, %eax jne 0x60659 movl $0x8, %eax movl %eax, -0x258(%rbp) jmp 0x60679 movq -0x90(%rbp), %rax movsbl (%rax), %edx movl $0x10, %eax movl $0xa, %ecx cmpl $0x75, %edx cmovel %ecx, %eax movl %eax, -0x258(%rbp) movl -0x258(%rbp), %eax movl %eax, -0xf8(%rbp) leaq 0x34837(%rip), %rax # 0x94ec3 movq %rax, -0x100(%rbp) leaq 0x3483a(%rip), %rax # 0x94ed4 movq %rax, -0x108(%rbp) movq -0x90(%rbp), %rax movsbl (%rax), %eax cmpl $0x78, %eax jne 0x606c0 movq -0x108(%rbp), %rax movq %rax, -0x260(%rbp) jmp 0x606ce movq -0x100(%rbp), %rax movq %rax, -0x260(%rbp) movq -0x260(%rbp), %rax movq %rax, -0x110(%rbp) cmpl $0x0, -0x74(%rbp) jne 0x60751 movq -0x28(%rbp), %rax movq %rax, -0x270(%rbp) movl (%rax), %eax movl %eax, -0x264(%rbp) cmpl $0x28, %eax ja 0x6071c movq -0x270(%rbp), %rcx movl -0x264(%rbp), %edx movslq %edx, %rax addq 0x10(%rcx), %rax addl $0x8, %edx movl %edx, (%rcx) movq %rax, -0x278(%rbp) jmp 0x60739 movq -0x270(%rbp), %rcx movq 0x8(%rcx), %rax movq %rax, %rdx addq $0x8, %rdx movq %rdx, 0x8(%rcx) movq %rax, -0x278(%rbp) movq -0x278(%rbp), %rax movl (%rax), %eax movzbl %al, %eax movq %rax, -0xe0(%rbp) jmp 0x608a1 cmpl $0x1, -0x74(%rbp) jne 0x607c6 movq -0x28(%rbp), %rax movq %rax, -0x288(%rbp) movl (%rax), %eax movl %eax, -0x27c(%rbp) cmpl $0x28, %eax ja 0x60791 movq -0x288(%rbp), %rcx movl -0x27c(%rbp), %edx movslq %edx, %rax addq 0x10(%rcx), %rax addl $0x8, %edx movl %edx, (%rcx) movq %rax, -0x290(%rbp) jmp 0x607ae movq -0x288(%rbp), %rcx movq 0x8(%rcx), %rax movq %rax, %rdx addq $0x8, %rdx movq %rdx, 0x8(%rcx) movq %rax, -0x290(%rbp) movq -0x290(%rbp), %rax movl (%rax), %eax movzwl %ax, %eax movq %rax, -0xe0(%rbp) jmp 0x6089f cmpl $0x3, -0x74(%rbp) jne 0x60836 movq -0x28(%rbp), %rax movq %rax, -0x2a0(%rbp) movl (%rax), %eax movl %eax, -0x294(%rbp) cmpl $0x28, %eax ja 0x60806 movq -0x2a0(%rbp), %rcx movl -0x294(%rbp), %edx movslq %edx, %rax addq 0x10(%rcx), %rax addl $0x8, %edx movl %edx, (%rcx) movq %rax, -0x2a8(%rbp) jmp 0x60823 movq -0x2a0(%rbp), %rcx movq 0x8(%rcx), %rax movq %rax, %rdx addq $0x8, %rdx movq %rdx, 0x8(%rcx) movq %rax, -0x2a8(%rbp) movq -0x2a8(%rbp), %rax movq (%rax), %rax movq %rax, -0xe0(%rbp) jmp 0x6089d movq -0x28(%rbp), %rax movq %rax, -0x2b8(%rbp) movl (%rax), %eax movl %eax, -0x2ac(%rbp) cmpl $0x28, %eax ja 0x60870 movq -0x2b8(%rbp), %rcx movl -0x2ac(%rbp), %edx movslq %edx, %rax addq 0x10(%rcx), %rax addl $0x8, %edx movl %edx, (%rcx) movq %rax, -0x2c0(%rbp) jmp 0x6088d movq -0x2b8(%rbp), %rcx movq 0x8(%rcx), %rax movq %rax, %rdx addq $0x8, %rdx movq %rdx, 0x8(%rcx) movq %rax, -0x2c0(%rbp) movq -0x2c0(%rbp), %rax movl (%rax), %eax movq %rax, -0xe0(%rbp) jmp 0x6089f jmp 0x608a1 jmp 0x608a3 movq -0x110(%rbp), %rax movq %rax, -0x2c8(%rbp) movq -0xe0(%rbp), %rax movl -0xf8(%rbp), %ecx xorl %edx, %edx divq %rcx movq -0x2c8(%rbp), %rax movsbl (%rax,%rdx), %eax movl %eax, -0x114(%rbp) cmpl $0x40, -0xe4(%rbp) jge 0x608fc movl -0x114(%rbp), %eax movb %al, %cl movl -0xe4(%rbp), %eax movl %eax, %edx addl $0x1, %edx movl %edx, -0xe4(%rbp) cltq movb %cl, -0x70(%rbp,%rax) movl -0xf8(%rbp), %eax movl %eax, %ecx movq -0xe0(%rbp), %rax xorl %edx, %edx divq %rcx movq %rax, -0xe0(%rbp) cmpq $0x0, -0xe0(%rbp) ja 0x608a3 movl -0xf0(%rbp), %eax cmpl -0xe4(%rbp), %eax jge 0x6093d movl -0xe4(%rbp), %eax movl %eax, -0x2cc(%rbp) jmp 0x60949 movl -0xf0(%rbp), %eax movl %eax, -0x2cc(%rbp) movl -0x2cc(%rbp), %eax movl %eax, -0xe8(%rbp) movl -0xf4(%rbp), %eax movl %eax, -0x2d0(%rbp) movl -0xf0(%rbp), %eax cmpl -0xe4(%rbp), %eax jge 0x6097d movl -0xe4(%rbp), %eax movl %eax, -0x2d4(%rbp) jmp 0x60989 movl -0xf0(%rbp), %eax movl %eax, -0x2d4(%rbp) movl -0x2d0(%rbp), %eax movl -0x2d4(%rbp), %ecx subl %ecx, %eax cmpl $0x0, %eax jge 0x609a6 xorl %eax, %eax movl %eax, -0x2d8(%rbp) jmp 0x609ee movl -0xf4(%rbp), %eax movl %eax, -0x2dc(%rbp) movl -0xf0(%rbp), %eax cmpl -0xe4(%rbp), %eax jge 0x609ce movl -0xe4(%rbp), %eax movl %eax, -0x2e0(%rbp) jmp 0x609da movl -0xf0(%rbp), %eax movl %eax, -0x2e0(%rbp) movl -0x2dc(%rbp), %eax movl -0x2e0(%rbp), %ecx subl %ecx, %eax movl %eax, -0x2d8(%rbp) movl -0x2d8(%rbp), %eax movl %eax, -0xec(%rbp) movl -0x80(%rbp), %eax andl $0x10, %eax cmpl $0x0, %eax je 0x60a38 movl -0xec(%rbp), %eax subl $0x1, %eax cmpl $0x0, %eax jge 0x60a1d xorl %eax, %eax movl %eax, -0x2e4(%rbp) jmp 0x60a2c movl -0xec(%rbp), %eax subl $0x1, %eax movl %eax, -0x2e4(%rbp) movl -0x2e4(%rbp), %eax movl %eax, -0xec(%rbp) movl -0x80(%rbp), %eax andl $0x1, %eax cmpl $0x0, %eax jne 0x60ad7 jmp 0x60a49 movl -0xec(%rbp), %ecx movl %ecx, %eax addl $-0x1, %eax movl %eax, -0xec(%rbp) xorl %eax, %eax cmpl $0x0, %ecx movb %al, -0x2e5(%rbp) jle 0x60a79 movl -0x84(%rbp), %eax cmpl -0x14(%rbp), %eax setl %al movb %al, -0x2e5(%rbp) movb -0x2e5(%rbp), %al testb $0x1, %al jne 0x60a85 jmp 0x60ad5 movl -0x80(%rbp), %eax andl $0x20, %eax cmpl $0x0, %eax je 0x60ab4 cmpl $-0x1, -0x78(%rbp) jne 0x60ab4 movq -0x10(%rbp), %rax movl -0x84(%rbp), %ecx movl %ecx, %edx addl $0x1, %edx movl %edx, -0x84(%rbp) movslq %ecx, %rcx movb $0x30, (%rax,%rcx) jmp 0x60ad0 movq -0x10(%rbp), %rax movl -0x84(%rbp), %ecx movl %ecx, %edx addl $0x1, %edx movl %edx, -0x84(%rbp) movslq %ecx, %rcx movb $0x20, (%rax,%rcx) jmp 0x60a49 jmp 0x60ad7 cmpl $0x0, -0xe8(%rbp) je 0x60be0 movl -0x80(%rbp), %eax andl $0x10, %eax cmpl $0x0, %eax je 0x60be0 movq -0x90(%rbp), %rax movsbl (%rax), %eax cmpl $0x6f, %eax jne 0x60b2e movl -0x84(%rbp), %eax cmpl -0x14(%rbp), %eax jge 0x60b2e movq -0x10(%rbp), %rax movl -0x84(%rbp), %ecx movl %ecx, %edx addl $0x1, %edx movl %edx, -0x84(%rbp) movslq %ecx, %rcx movb $0x30, (%rax,%rcx) jmp 0x60bde movq -0x90(%rbp), %rax movsbl (%rax), %eax cmpl $0x78, %eax jne 0x60b85 movl -0x84(%rbp), %eax addl $0x1, %eax cmpl -0x14(%rbp), %eax jge 0x60b85 movq -0x10(%rbp), %rax movl -0x84(%rbp), %ecx movl %ecx, %edx addl $0x1, %edx movl %edx, -0x84(%rbp) movslq %ecx, %rcx movb $0x30, (%rax,%rcx) movq -0x10(%rbp), %rax movl -0x84(%rbp), %ecx movl %ecx, %edx addl $0x1, %edx movl %edx, -0x84(%rbp) movslq %ecx, %rcx movb $0x78, (%rax,%rcx) jmp 0x60bdc movq -0x90(%rbp), %rax movsbl (%rax), %eax cmpl $0x58, %eax jne 0x60bda movl -0x84(%rbp), %eax addl $0x1, %eax cmpl -0x14(%rbp), %eax jge 0x60bda movq -0x10(%rbp), %rax movl -0x84(%rbp), %ecx movl %ecx, %edx addl $0x1, %edx movl %edx, -0x84(%rbp) movslq %ecx, %rcx movb $0x30, (%rax,%rcx) movq -0x10(%rbp), %rax movl -0x84(%rbp), %ecx movl %ecx, %edx addl $0x1, %edx movl %edx, -0x84(%rbp) movslq %ecx, %rcx movb $0x58, (%rax,%rcx) jmp 0x60bdc jmp 0x60bde jmp 0x60be0 jmp 0x60be2 xorl %eax, %eax cmpl $0x0, -0x78(%rbp) movb %al, -0x2e6(%rbp) je 0x60c18 movl -0xe8(%rbp), %ecx xorl %eax, %eax cmpl -0xe4(%rbp), %ecx movb %al, -0x2e6(%rbp) jle 0x60c18 movl -0x84(%rbp), %eax cmpl -0x14(%rbp), %eax setl %al movb %al, -0x2e6(%rbp) movb -0x2e6(%rbp), %al testb $0x1, %al jne 0x60c24 jmp 0x60c51 movq -0x10(%rbp), %rax movl -0x84(%rbp), %ecx movl %ecx, %edx addl $0x1, %edx movl %edx, -0x84(%rbp) movslq %ecx, %rcx movb $0x30, (%rax,%rcx) movl -0xe8(%rbp), %eax addl $-0x1, %eax movl %eax, -0xe8(%rbp) jmp 0x60be2 jmp 0x60c53 cmpl $0x0, -0xe4(%rbp) jle 0x60ca8 cmpl $0x0, -0x78(%rbp) je 0x60c97 movl -0x84(%rbp), %eax cmpl -0x14(%rbp), %eax jge 0x60c97 movl -0xe4(%rbp), %eax subl $0x1, %eax cltq movb -0x70(%rbp,%rax), %dl movq -0x10(%rbp), %rax movl -0x84(%rbp), %ecx movl %ecx, %esi addl $0x1, %esi movl %esi, -0x84(%rbp) movslq %ecx, %rcx movb %dl, (%rax,%rcx) movl -0xe4(%rbp), %eax addl $-0x1, %eax movl %eax, -0xe4(%rbp) jmp 0x60c53 movl -0x80(%rbp), %eax andl $0x1, %eax cmpl $0x0, %eax je 0x60d11 jmp 0x60cb5 movl -0xec(%rbp), %ecx movl %ecx, %eax addl $-0x1, %eax movl %eax, -0xec(%rbp) xorl %eax, %eax cmpl $0x0, %ecx movb %al, -0x2e7(%rbp) jle 0x60ce5 movl -0x84(%rbp), %eax cmpl -0x14(%rbp), %eax setl %al movb %al, -0x2e7(%rbp) movb -0x2e7(%rbp), %al testb $0x1, %al jne 0x60cf1 jmp 0x60d0f movq -0x10(%rbp), %rax movl -0x84(%rbp), %ecx movl %ecx, %edx addl $0x1, %edx movl %edx, -0x84(%rbp) movslq %ecx, %rcx movb $0x20, (%rax,%rcx) jmp 0x60cb5 jmp 0x60d11 jmp 0x61304 movq -0x90(%rbp), %rax movsbl (%rax), %eax cmpl $0x66, %eax jne 0x612e3 cmpl $0x0, -0x78(%rbp) jge 0x60d3c movl $0x6, %eax movl %eax, -0x2ec(%rbp) jmp 0x60d45 movl -0x78(%rbp), %eax movl %eax, -0x2ec(%rbp) movl -0x2ec(%rbp), %eax movl %eax, -0x124(%rbp) cmpl $0x0, -0x7c(%rbp) jge 0x60d61 xorl %eax, %eax movl %eax, -0x2f0(%rbp) jmp 0x60d6a movl -0x7c(%rbp), %eax movl %eax, -0x2f0(%rbp) movl -0x2f0(%rbp), %eax movl %eax, -0x12c(%rbp) movq -0x28(%rbp), %rax movq %rax, -0x308(%rbp) movq %rax, %rcx addq $0x4, %rcx movq %rcx, -0x300(%rbp) movl 0x4(%rax), %eax movl %eax, -0x2f4(%rbp) cmpl $0xa0, %eax ja 0x60dc8 movq -0x300(%rbp), %rcx movl -0x2f4(%rbp), %edx movq -0x308(%rbp), %rsi movslq %edx, %rax addq 0x10(%rsi), %rax addl $0x10, %edx movl %edx, (%rcx) movq %rax, -0x310(%rbp) jmp 0x60de5 movq -0x308(%rbp), %rcx movq 0x8(%rcx), %rax movq %rax, %rdx addq $0x8, %rdx movq %rdx, 0x8(%rcx) movq %rax, -0x310(%rbp) movq -0x310(%rbp), %rax movsd (%rax), %xmm0 movsd %xmm0, -0x138(%rbp) movl $0x0, -0x13c(%rbp) movl $0x0, -0x140(%rbp) movl $0x0, -0x144(%rbp) movl $0x0, -0x148(%rbp) cmpl $0x2, -0x74(%rbp) jne 0x60e28 jmp 0x60e47 leaq 0x33fe4(%rip), %rdi # 0x94e13 leaq 0x2c0ca(%rip), %rsi # 0x8cf00 movl $0x1b9b, %edx # imm = 0x1B9B leaq 0x33f8d(%rip), %rcx # 0x94dcf callq 0x1b1e0 leaq -0x70(%rbp), %rdi movsd -0x138(%rbp), %xmm0 callq 0x614b0 leaq -0x70(%rbp), %rdi callq 0x1c230 movl %eax, -0x13c(%rbp) leaq -0x70(%rbp), %rax movq %rax, -0x120(%rbp) movq -0x120(%rbp), %rax movsbl (%rax), %ecx xorl %eax, %eax cmpl $0x0, %ecx movb %al, -0x311(%rbp) je 0x60e9f movq -0x120(%rbp), %rax movsbl (%rax), %eax cmpl $0x2e, %eax setne %al movb %al, -0x311(%rbp) movb -0x311(%rbp), %al testb $0x1, %al jne 0x60eab jmp 0x60ebf movq -0x120(%rbp), %rax addq $0x1, %rax movq %rax, -0x120(%rbp) jmp 0x60e72 movq -0x120(%rbp), %rax movsbl (%rax), %eax cmpl $0x2e, %eax jne 0x60ee7 movq -0x120(%rbp), %rax leaq -0x70(%rbp), %rcx subq %rcx, %rax addl $0x1, %eax movl %eax, -0x318(%rbp) jmp 0x60ef1 xorl %eax, %eax movl %eax, -0x318(%rbp) jmp 0x60ef1 movl -0x318(%rbp), %eax movl %eax, -0x128(%rbp) movl -0x12c(%rbp), %eax movl %eax, -0x320(%rbp) movl -0x128(%rbp), %eax movl %eax, -0x31c(%rbp) movl -0x124(%rbp), %eax movl -0x13c(%rbp), %ecx subl -0x128(%rbp), %ecx cmpl %ecx, %eax jge 0x60f39 movl -0x124(%rbp), %eax movl %eax, -0x324(%rbp) jmp 0x60f4b movl -0x13c(%rbp), %eax subl -0x128(%rbp), %eax movl %eax, -0x324(%rbp) movl -0x320(%rbp), %eax movl -0x31c(%rbp), %ecx movl -0x324(%rbp), %edx addl %edx, %ecx subl %ecx, %eax cmpl $0x0, %eax jge 0x60f70 xorl %eax, %eax movl %eax, -0x328(%rbp) jmp 0x60fda movl -0x12c(%rbp), %eax movl %eax, -0x330(%rbp) movl -0x128(%rbp), %eax movl %eax, -0x32c(%rbp) movl -0x124(%rbp), %eax movl -0x13c(%rbp), %ecx subl -0x128(%rbp), %ecx cmpl %ecx, %eax jge 0x60fac movl -0x124(%rbp), %eax movl %eax, -0x334(%rbp) jmp 0x60fbe movl -0x13c(%rbp), %eax subl -0x128(%rbp), %eax movl %eax, -0x334(%rbp) movl -0x330(%rbp), %eax movl -0x32c(%rbp), %ecx movl -0x334(%rbp), %edx addl %edx, %ecx subl %ecx, %eax movl %eax, -0x328(%rbp) movl -0x328(%rbp), %eax movl %eax, -0x148(%rbp) movl -0x80(%rbp), %eax andl $0x2, %eax cmpl $0x0, %eax jne 0x60ffc movl -0x80(%rbp), %eax andl $0x4, %eax cmpl $0x0, %eax je 0x6102f movl -0x148(%rbp), %eax subl $0x1, %eax cmpl $0x0, %eax jge 0x61014 xorl %eax, %eax movl %eax, -0x338(%rbp) jmp 0x61023 movl -0x148(%rbp), %eax subl $0x1, %eax movl %eax, -0x338(%rbp) movl -0x338(%rbp), %eax movl %eax, -0x148(%rbp) movl -0x80(%rbp), %eax andl $0x1, %eax cmpl $0x0, %eax jne 0x610c8 jmp 0x61040 movl -0x148(%rbp), %ecx movl %ecx, %eax addl $-0x1, %eax movl %eax, -0x148(%rbp) xorl %eax, %eax cmpl $0x0, %ecx movb %al, -0x339(%rbp) jle 0x61070 movl -0x84(%rbp), %eax cmpl -0x14(%rbp), %eax setl %al movb %al, -0x339(%rbp) movb -0x339(%rbp), %al testb $0x1, %al jne 0x6107c jmp 0x610c6 movl -0x80(%rbp), %eax andl $0x20, %eax cmpl $0x0, %eax je 0x610a5 movq -0x10(%rbp), %rax movl -0x84(%rbp), %ecx movl %ecx, %edx addl $0x1, %edx movl %edx, -0x84(%rbp) movslq %ecx, %rcx movb $0x30, (%rax,%rcx) jmp 0x610c1 movq -0x10(%rbp), %rax movl -0x84(%rbp), %ecx movl %ecx, %edx addl $0x1, %edx movl %edx, -0x84(%rbp) movslq %ecx, %rcx movb $0x20, (%rax,%rcx) jmp 0x61040 jmp 0x610c8 leaq -0x70(%rbp), %rax movq %rax, -0x120(%rbp) movl -0x80(%rbp), %eax andl $0x2, %eax cmpl $0x0, %eax je 0x61118 movsd -0x138(%rbp), %xmm0 xorps %xmm1, %xmm1 ucomisd %xmm1, %xmm0 jb 0x61118 movl -0x84(%rbp), %eax cmpl -0x14(%rbp), %eax jge 0x61118 movq -0x10(%rbp), %rax movl -0x84(%rbp), %ecx movl %ecx, %edx addl $0x1, %edx movl %edx, -0x84(%rbp) movslq %ecx, %rcx movb $0x2b, (%rax,%rcx) jmp 0x6115d movl -0x80(%rbp), %eax andl $0x4, %eax cmpl $0x0, %eax je 0x6115b movsd -0x138(%rbp), %xmm0 xorps %xmm1, %xmm1 ucomisd %xmm1, %xmm0 jb 0x6115b movl -0x84(%rbp), %eax cmpl -0x14(%rbp), %eax jge 0x6115b movq -0x10(%rbp), %rax movl -0x84(%rbp), %ecx movl %ecx, %edx addl $0x1, %edx movl %edx, -0x84(%rbp) movslq %ecx, %rcx movb $0x20, (%rax,%rcx) jmp 0x6115d jmp 0x6115f movq -0x120(%rbp), %rax cmpb $0x0, (%rax) je 0x611f6 cmpl $0x0, -0x144(%rbp) je 0x61187 movl -0x140(%rbp), %eax addl $0x1, %eax movl %eax, -0x140(%rbp) movl -0x84(%rbp), %eax cmpl -0x14(%rbp), %eax jge 0x611b6 movq -0x120(%rbp), %rax movb (%rax), %dl movq -0x10(%rbp), %rax movl -0x84(%rbp), %ecx movl %ecx, %esi addl $0x1, %esi movl %esi, -0x84(%rbp) movslq %ecx, %rcx movb %dl, (%rax,%rcx) movq -0x120(%rbp), %rax movsbl (%rax), %eax cmpl $0x2e, %eax jne 0x611cf movl $0x1, -0x144(%rbp) movl -0x140(%rbp), %eax cmpl -0x124(%rbp), %eax jl 0x611df jmp 0x611f6 movq -0x120(%rbp), %rax addq $0x1, %rax movq %rax, -0x120(%rbp) jmp 0x6115f jmp 0x611f8 movl -0x140(%rbp), %eax cmpl -0x124(%rbp), %eax jge 0x61278 cmpl $0x0, -0x144(%rbp) jne 0x61240 movl -0x84(%rbp), %eax cmpl -0x14(%rbp), %eax jge 0x61240 movq -0x10(%rbp), %rax movl -0x84(%rbp), %ecx movl %ecx, %edx addl $0x1, %edx movl %edx, -0x84(%rbp) movslq %ecx, %rcx movb $0x2e, (%rax,%rcx) movl $0x1, -0x144(%rbp) movl -0x84(%rbp), %eax cmpl -0x14(%rbp), %eax jge 0x61267 movq -0x10(%rbp), %rax movl -0x84(%rbp), %ecx movl %ecx, %edx addl $0x1, %edx movl %edx, -0x84(%rbp) movslq %ecx, %rcx movb $0x30, (%rax,%rcx) movl -0x140(%rbp), %eax addl $0x1, %eax movl %eax, -0x140(%rbp) jmp 0x611f8 movl -0x80(%rbp), %eax andl $0x1, %eax cmpl $0x0, %eax je 0x612e1 jmp 0x61285 movl -0x148(%rbp), %ecx movl %ecx, %eax addl $-0x1, %eax movl %eax, -0x148(%rbp) xorl %eax, %eax cmpl $0x0, %ecx movb %al, -0x33a(%rbp) jle 0x612b5 movl -0x84(%rbp), %eax cmpl -0x14(%rbp), %eax setl %al movb %al, -0x33a(%rbp) movb -0x33a(%rbp), %al testb $0x1, %al jne 0x612c1 jmp 0x612df movq -0x10(%rbp), %rax movl -0x84(%rbp), %ecx movl %ecx, %edx addl $0x1, %edx movl %edx, -0x84(%rbp) movslq %ecx, %rcx movb $0x20, (%rax,%rcx) jmp 0x61285 jmp 0x612e1 jmp 0x61302 leaq 0x33bfb(%rip), %rdi # 0x94ee5 leaq 0x2bc0f(%rip), %rsi # 0x8cf00 movl $0x1bd3, %edx # imm = 0x1BD3 leaq 0x33ad2(%rip), %rcx # 0x94dcf callq 0x1b1e0 jmp 0x61304 jmp 0x61306 jmp 0x61308 jmp 0x6130a jmp 0x6130c jmp 0x6130e movq -0x90(%rbp), %rax addq $0x1, %rax movq %rax, -0x90(%rbp) jmp 0x5f77f movq -0x10(%rbp), %rax movq %rax, -0x348(%rbp) movl -0x84(%rbp), %eax cmpl -0x14(%rbp), %eax jl 0x61349 movl -0x14(%rbp), %eax subl $0x1, %eax movl %eax, -0x34c(%rbp) jmp 0x61355 movl -0x84(%rbp), %eax movl %eax, -0x34c(%rbp) movq -0x348(%rbp), %rax movl -0x34c(%rbp), %ecx movslq %ecx, %rcx movb $0x0, (%rax,%rcx) movl -0x84(%rbp), %eax cmpl -0x14(%rbp), %eax jl 0x61381 movl $0xffffffff, %eax # imm = 0xFFFFFFFF movl %eax, -0x350(%rbp) jmp 0x6138d movl -0x84(%rbp), %eax movl %eax, -0x350(%rbp) movl -0x350(%rbp), %eax movl %eax, -0x88(%rbp) movl -0x88(%rbp), %eax movl %eax, -0x4(%rbp) movl -0x4(%rbp), %eax addq $0x350, %rsp # imm = 0x350 popq %rbp retq nop
/Tigermouthbear[P]flappytiger/external/glfw/deps/nuklear.h
nk_draw_option
NK_LIB void nk_draw_option(struct nk_command_buffer *out, nk_flags state, const struct nk_style_toggle *style, int active, const struct nk_rect *label, const struct nk_rect *selector, const struct nk_rect *cursors, const char *string, int len, const struct nk_user_font *font) { const struct nk_style_item *background; const struct nk_style_item *cursor; struct nk_text text; /* select correct colors/images */ if (state & NK_WIDGET_STATE_HOVER) { background = &style->hover; cursor = &style->cursor_hover; text.text = style->text_hover; } else if (state & NK_WIDGET_STATE_ACTIVED) { background = &style->hover; cursor = &style->cursor_hover; text.text = style->text_active; } else { background = &style->normal; cursor = &style->cursor_normal; text.text = style->text_normal; } /* draw background and cursor */ if (background->type == NK_STYLE_ITEM_COLOR) { nk_fill_circle(out, *selector, style->border_color); nk_fill_circle(out, nk_shrink_rect(*selector, style->border), background->data.color); } else nk_draw_image(out, *selector, &background->data.image, nk_white); if (active) { if (cursor->type == NK_STYLE_ITEM_IMAGE) nk_draw_image(out, *cursors, &cursor->data.image, nk_white); else nk_fill_circle(out, *cursors, cursor->data.color); } text.padding.x = 0; text.padding.y = 0; text.background = style->text_background; nk_widget_text(out, *label, string, len, &text, NK_TEXT_LEFT, font); }
pushq %rbp movq %rsp, %rbp subq $0x70, %rsp movq 0x28(%rbp), %rax movl 0x20(%rbp), %eax movq 0x18(%rbp), %rax movq 0x10(%rbp), %rax movq %rdi, -0x8(%rbp) movl %esi, -0xc(%rbp) movq %rdx, -0x18(%rbp) movl %ecx, -0x1c(%rbp) movq %r8, -0x28(%rbp) movq %r9, -0x30(%rbp) movl -0xc(%rbp), %eax andl $0x10, %eax cmpl $0x0, %eax je 0x621a1 movq -0x18(%rbp), %rax addq $0x20, %rax movq %rax, -0x38(%rbp) movq -0x18(%rbp), %rax addq $0x88, %rax movq %rax, -0x40(%rbp) movq -0x18(%rbp), %rax movl 0xac(%rax), %eax movl %eax, -0x44(%rbp) jmp 0x621f8 movl -0xc(%rbp), %eax andl $0x20, %eax cmpl $0x0, %eax je 0x621d5 movq -0x18(%rbp), %rax addq $0x20, %rax movq %rax, -0x38(%rbp) movq -0x18(%rbp), %rax addq $0x88, %rax movq %rax, -0x40(%rbp) movq -0x18(%rbp), %rax movl 0xb0(%rax), %eax movl %eax, -0x44(%rbp) jmp 0x621f6 movq -0x18(%rbp), %rax movq %rax, -0x38(%rbp) movq -0x18(%rbp), %rax addq $0x68, %rax movq %rax, -0x40(%rbp) movq -0x18(%rbp), %rax movl 0xa8(%rax), %eax movl %eax, -0x44(%rbp) jmp 0x621f8 movq -0x38(%rbp), %rax cmpl $0x0, (%rax) jne 0x6226a movq -0x8(%rbp), %rdi movq -0x30(%rbp), %rcx movq -0x18(%rbp), %rax movsd (%rcx), %xmm0 movsd 0x8(%rcx), %xmm1 movl 0x60(%rax), %esi callq 0x22810 movq -0x8(%rbp), %rax movq %rax, -0x68(%rbp) movq -0x30(%rbp), %rax movq -0x18(%rbp), %rcx movss 0xd0(%rcx), %xmm2 movsd (%rax), %xmm0 movsd 0x8(%rax), %xmm1 callq 0x4ce90 movq -0x68(%rbp), %rdi movlpd %xmm0, -0x60(%rbp) movlpd %xmm1, -0x58(%rbp) movq -0x38(%rbp), %rax movsd -0x60(%rbp), %xmm0 movsd -0x58(%rbp), %xmm1 movl 0x8(%rax), %esi callq 0x22810 jmp 0x6228e movq -0x8(%rbp), %rdi movq -0x30(%rbp), %rax movq -0x38(%rbp), %rsi addq $0x8, %rsi movsd (%rax), %xmm0 movsd 0x8(%rax), %xmm1 movl 0x2aad7(%rip), %edx # 0x8cd60 callq 0x233b0 cmpl $0x0, -0x1c(%rbp) je 0x622e2 movq -0x40(%rbp), %rax cmpl $0x1, (%rax) jne 0x622c3 movq -0x8(%rbp), %rdi movq 0x10(%rbp), %rax movq -0x40(%rbp), %rsi addq $0x8, %rsi movsd (%rax), %xmm0 movsd 0x8(%rax), %xmm1 movl 0x2aaa4(%rip), %edx # 0x8cd60 callq 0x233b0 jmp 0x622e0 movq -0x8(%rbp), %rdi movq 0x10(%rbp), %rcx movq -0x40(%rbp), %rax movsd (%rcx), %xmm0 movsd 0x8(%rcx), %xmm1 movl 0x8(%rax), %esi callq 0x22810 jmp 0x622e2 movl $0x0, -0x50(%rbp) movl $0x0, -0x4c(%rbp) movq -0x18(%rbp), %rax movl 0xb4(%rax), %eax movl %eax, -0x48(%rbp) movq -0x8(%rbp), %rdi movq -0x28(%rbp), %rax movq 0x18(%rbp), %rsi movl 0x20(%rbp), %edx movq 0x28(%rbp), %r9 movsd (%rax), %xmm0 movsd 0x8(%rax), %xmm1 leaq -0x50(%rbp), %rcx movl $0x11, %r8d callq 0x42270 addq $0x70, %rsp popq %rbp retq nop
/Tigermouthbear[P]flappytiger/external/glfw/deps/nuklear.h
glfwInitHint
GLFWAPI void glfwInitHint(int hint, int value) { switch (hint) { case GLFW_JOYSTICK_HAT_BUTTONS: _glfwInitHints.hatButtons = value; return; case GLFW_COCOA_CHDIR_RESOURCES: _glfwInitHints.ns.chdir = value; return; case GLFW_COCOA_MENUBAR: _glfwInitHints.ns.menubar = value; return; } _glfwInputError(GLFW_INVALID_ENUM, "Invalid init hint 0x%08X", hint); }
cmpl $0x51002, %edi # imm = 0x51002 je 0x1918b movl %edi, %edx cmpl $0x51001, %edi # imm = 0x51001 je 0x19184 cmpl $0x50001, %edx # imm = 0x50001 jne 0x19192 movl %esi, 0x3b095(%rip) # 0x54218 retq movl %esi, 0x3b096(%rip) # 0x54220 retq movl %esi, 0x3b08b(%rip) # 0x5421c retq leaq 0x2eccb(%rip), %rsi # 0x47e64 movl $0x10003, %edi # imm = 0x10003 xorl %eax, %eax jmp 0x18da7
/Konf[P]LearnOpenGL-CLion/glfw/src/init.c
glfwInputCursorPos
void _glfwInputCursorPos(_GLFWwindow* window, double xpos, double ypos) { if (window->virtualCursorPosX == xpos && window->virtualCursorPosY == ypos) return; window->virtualCursorPosX = xpos; window->virtualCursorPosY = ypos; if (window->callbacks.cursorPos) window->callbacks.cursorPos((GLFWwindow*) window, xpos, ypos); }
movsd 0x1e0(%rdi), %xmm2 ucomisd %xmm0, %xmm2 jne 0x19388 jp 0x19388 movsd 0x1e8(%rdi), %xmm2 ucomisd %xmm1, %xmm2 jne 0x19388 jnp 0x193a6 movsd %xmm0, 0x1e0(%rdi) movsd %xmm1, 0x1e8(%rdi) movq 0x300(%rdi), %rax testq %rax, %rax je 0x193a6 jmpq *%rax retq
/Konf[P]LearnOpenGL-CLion/glfw/src/input.c
glfwAllocJoystick
_GLFWjoystick* _glfwAllocJoystick(const char* name, const char* guid, int axisCount, int buttonCount, int hatCount) { int jid; _GLFWjoystick* js; for (jid = 0; jid <= GLFW_JOYSTICK_LAST; jid++) { if (!_glfw.joysticks[jid].present) break; } if (jid > GLFW_JOYSTICK_LAST) return NULL; js = _glfw.joysticks + jid; js->present = GLFW_TRUE; js->name = _glfw_strdup(name); js->axes = calloc(axisCount, sizeof(float)); js->buttons = calloc(buttonCount + hatCount * 4, 1); js->hats = calloc(hatCount, 1); js->axisCount = axisCount; js->buttonCount = buttonCount; js->hatCount = hatCount; strcpy(js->guid, guid); js->mapping = findValidMapping(js); return js; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl %r8d, %r12d movl %ecx, %r15d movl %edx, %ebp movq %rsi, %r14 movl $0x400, %ebx # imm = 0x400 addq 0x39b52(%rip), %rbx # 0x52fd8 movl $0x10, %eax cmpl $0x0, (%rbx) je 0x194a0 addq $0x1fa0, %rbx # imm = 0x1FA0 decq %rax jne 0x1948b xorl %ebx, %ebx jmp 0x19510 movl $0x1, (%rbx) callq 0x18d84 movq %rax, 0x38(%rbx) movslq %ebp, %r13 movl $0x4, %esi movq %r13, %rdi callq 0x13780 movq %rax, 0x8(%rbx) leal (%r15,%r12,4), %eax movslq %eax, %rdi movl $0x1, %esi callq 0x13780 movq %rax, 0x18(%rbx) movslq %r12d, %r12 movl $0x1, %esi movq %r12, %rdi callq 0x13780 movq %rax, 0x28(%rbx) movl %r13d, 0x10(%rbx) movl %r15d, 0x20(%rbx) movl %r12d, 0x30(%rbx) leaq 0x48(%rbx), %rdi movq %r14, %rsi callq 0x13710 movq %rbx, %rdi callq 0x19522 movq %rax, 0x70(%rbx) movq %rbx, %rax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Konf[P]LearnOpenGL-CLion/glfw/src/input.c
glfwGetMouseButton
GLFWAPI int glfwGetMouseButton(GLFWwindow* handle, int button) { _GLFWwindow* window = (_GLFWwindow*) handle; assert(window != NULL); _GLFW_REQUIRE_INIT_OR_RETURN(GLFW_RELEASE); if (button < GLFW_MOUSE_BUTTON_1 || button > GLFW_MOUSE_BUTTON_LAST) { _glfwInputError(GLFW_INVALID_ENUM, "Invalid mouse button %i", button); return GLFW_RELEASE; } if (window->mouseButtons[button] == _GLFW_STICK) { // Sticky mode: release mouse button now window->mouseButtons[button] = GLFW_RELEASE; return GLFW_PRESS; } return (int) window->mouseButtons[button]; }
pushq %rbx testq %rdi, %rdi je 0x19a92 leaq 0x3c0c5(%rip), %rax # 0x55b08 cmpl $0x0, (%rax) je 0x19a66 movl %esi, %edx cmpl $0x8, %esi jb 0x19a78 leaq 0x2e804(%rip), %rsi # 0x4825a xorl %ebx, %ebx movl $0x10003, %edi # imm = 0x10003 xorl %eax, %eax callq 0x18da7 jmp 0x19a8e xorl %ebx, %ebx movl $0x10001, %edi # imm = 0x10001 xorl %esi, %esi xorl %eax, %eax callq 0x18da7 jmp 0x19a8e movl %edx, %eax movsbl 0x78(%rdi,%rax), %ebx cmpl $0x3, %ebx jne 0x19a8e movb $0x0, 0x78(%rdi,%rax) movl $0x1, %ebx movl %ebx, %eax popq %rbx retq leaq 0x12fc8(%rip), %rdi # 0x2ca61 leaq 0x2e678(%rip), %rsi # 0x48118 leaq 0x2e789(%rip), %rcx # 0x48230 movl $0x26c, %edx # imm = 0x26C callq 0x131e0
/Konf[P]LearnOpenGL-CLion/glfw/src/input.c
glfwSetCursorPos
GLFWAPI void glfwSetCursorPos(GLFWwindow* handle, double xpos, double ypos) { _GLFWwindow* window = (_GLFWwindow*) handle; assert(window != NULL); _GLFW_REQUIRE_INIT(); if (xpos != xpos || xpos < -DBL_MAX || xpos > DBL_MAX || ypos != ypos || ypos < -DBL_MAX || ypos > DBL_MAX) { _glfwInputError(GLFW_INVALID_VALUE, "Invalid cursor position %f %f", xpos, ypos); return; } if (!_glfwPlatformWindowFocused(window)) return; if (window->cursorMode == GLFW_CURSOR_DISABLED) { // Only update the accumulated position if the cursor is disabled window->virtualCursorPosX = xpos; window->virtualCursorPosY = ypos; } else { // Update system cursor position _glfwPlatformSetCursorPos(window, xpos, ypos); } }
pushq %rbx subq $0x10, %rsp testq %rdi, %rdi je 0x19c0e leaq 0x3bfbb(%rip), %rax # 0x55b08 cmpl $0x0, (%rax) je 0x19be3 ucomisd 0x2e592(%rip), %xmm0 # 0x480f0 ja 0x19bcb ucomisd %xmm0, %xmm0 jp 0x19bcb movsd 0x2e58a(%rip), %xmm2 # 0x480f8 ucomisd %xmm0, %xmm2 ja 0x19bcb ucomisd 0x2e574(%rip), %xmm1 # 0x480f0 ja 0x19bcb ucomisd %xmm1, %xmm1 jp 0x19bcb ucomisd %xmm1, %xmm2 ja 0x19bcb movq %rdi, %rbx movsd %xmm0, (%rsp) movsd %xmm1, 0x8(%rsp) callq 0x2302b testl %eax, %eax je 0x19bc5 cmpl $0x34003, 0x74(%rbx) # imm = 0x34003 jne 0x19bf6 movsd (%rsp), %xmm0 movsd %xmm0, 0x1e0(%rbx) movsd 0x8(%rsp), %xmm0 movsd %xmm0, 0x1e8(%rbx) addq $0x10, %rsp popq %rbx retq leaq 0x2e70c(%rip), %rsi # 0x482de movl $0x10004, %edi # imm = 0x10004 movb $0x2, %al addq $0x10, %rsp popq %rbx jmp 0x18da7 movl $0x10001, %edi # imm = 0x10001 xorl %esi, %esi xorl %eax, %eax addq $0x10, %rsp popq %rbx jmp 0x18da7 movq %rbx, %rdi movsd (%rsp), %xmm0 movsd 0x8(%rsp), %xmm1 addq $0x10, %rsp popq %rbx jmp 0x2465c leaq 0x12e4c(%rip), %rdi # 0x2ca61 leaq 0x2e4fc(%rip), %rsi # 0x48118 leaq 0x2e687(%rip), %rcx # 0x482aa movl $0x29a, %edx # imm = 0x29A callq 0x131e0
/Konf[P]LearnOpenGL-CLion/glfw/src/input.c
glfwGetVideoModes
GLFWAPI const GLFWvidmode* glfwGetVideoModes(GLFWmonitor* handle, int* count) { _GLFWmonitor* monitor = (_GLFWmonitor*) handle; assert(monitor != NULL); assert(count != NULL); *count = 0; _GLFW_REQUIRE_INIT_OR_RETURN(NULL); if (!refreshVideoModes(monitor)) return NULL; *count = monitor->modeCount; return monitor->modes; }
pushq %r14 pushq %rbx pushq %rax testq %rdi, %rdi je 0x1bda7 movq %rsi, %r14 testq %rsi, %rsi je 0x1bdc6 movl $0x0, (%r14) leaq 0x39d9d(%rip), %rax # 0x55b08 cmpl $0x0, (%rax) je 0x1bd88 movq %rdi, %rbx callq 0x1b9b7 testl %eax, %eax je 0x1bd9a movl 0x28(%rbx), %eax movl %eax, (%r14) movq 0x20(%rbx), %rbx jmp 0x1bd9c xorl %ebx, %ebx movl $0x10001, %edi # imm = 0x10001 xorl %esi, %esi xorl %eax, %eax callq 0x18da7 jmp 0x1bd9c xorl %ebx, %ebx movq %rbx, %rax addq $0x8, %rsp popq %rbx popq %r14 retq leaq 0x2cc1d(%rip), %rdi # 0x489cb leaq 0x2cb93(%rip), %rsi # 0x48948 leaq 0x2cd64(%rip), %rcx # 0x48b20 movl $0x191, %edx # imm = 0x191 callq 0x131e0 leaq 0x2c860(%rip), %rdi # 0x4862d leaq 0x2cb74(%rip), %rsi # 0x48948 leaq 0x2cd45(%rip), %rcx # 0x48b20 movl $0x192, %edx # imm = 0x192 callq 0x131e0
/Konf[P]LearnOpenGL-CLion/glfw/src/monitor.c
glfwGetWindowContentScale
GLFWAPI void glfwGetWindowContentScale(GLFWwindow* handle, float* xscale, float* yscale) { _GLFWwindow* window = (_GLFWwindow*) handle; assert(window != NULL); if (xscale) *xscale = 0.f; if (yscale) *yscale = 0.f; _GLFW_REQUIRE_INIT(); _glfwPlatformGetWindowContentScale(window, xscale, yscale); }
testq %rdi, %rdi je 0x1d55d testq %rsi, %rsi je 0x1d533 movl $0x0, (%rsi) testq %rdx, %rdx je 0x1d53e movl $0x0, (%rdx) leaq 0x385c3(%rip), %rax # 0x55b08 cmpl $0x0, (%rax) je 0x1d54f jmp 0x22a6e movl $0x10001, %edi # imm = 0x10001 xorl %esi, %esi xorl %eax, %eax jmp 0x18da7 pushq %rax leaq 0xf4fc(%rip), %rdi # 0x2ca61 leaq 0x2c152(%rip), %rsi # 0x496be leaq 0x2c5c6(%rip), %rcx # 0x49b39 movl $0x2a5, %edx # imm = 0x2A5 callq 0x131e0
/Konf[P]LearnOpenGL-CLion/glfw/src/window.c
glfwSetWindowAttrib
GLFWAPI void glfwSetWindowAttrib(GLFWwindow* handle, int attrib, int value) { _GLFWwindow* window = (_GLFWwindow*) handle; assert(window != NULL); _GLFW_REQUIRE_INIT(); value = value ? GLFW_TRUE : GLFW_FALSE; if (attrib == GLFW_AUTO_ICONIFY) window->autoIconify = value; else if (attrib == GLFW_RESIZABLE) { if (window->resizable == value) return; window->resizable = value; if (!window->monitor) _glfwPlatformSetWindowResizable(window, value); } else if (attrib == GLFW_DECORATED) { if (window->decorated == value) return; window->decorated = value; if (!window->monitor) _glfwPlatformSetWindowDecorated(window, value); } else if (attrib == GLFW_FLOATING) { if (window->floating == value) return; window->floating = value; if (!window->monitor) _glfwPlatformSetWindowFloating(window, value); } else _glfwInputError(GLFW_INVALID_ENUM, "Invalid window attribute 0x%08X", attrib); }
testq %rdi, %rdi je 0x1da90 leaq 0x38108(%rip), %rcx # 0x55b08 cmpl $0x0, (%rcx) je 0x1da40 movl %esi, %eax xorl %esi, %esi testl %edx, %edx setne %dl leal -0x20003(%rax), %ecx cmpl $0x4, %ecx ja 0x1da76 movb %dl, %sil leaq 0x2bc79(%rip), %rdx # 0x4969c movslq (%rdx,%rcx,4), %rcx addq %rdx, %rcx jmpq *%rcx cmpl %esi, 0x8(%rdi) je 0x1da75 movl %esi, 0x8(%rdi) cmpq $0x0, 0x40(%rdi) jne 0x1da75 jmp 0x2327f movl $0x10001, %edi # imm = 0x10001 xorl %esi, %esi xorl %eax, %eax jmp 0x18da7 movl %esi, 0x10(%rdi) retq cmpl %esi, 0xc(%rdi) je 0x1da75 movl %esi, 0xc(%rdi) cmpq $0x0, 0x40(%rdi) jne 0x1da75 jmp 0x232c7 cmpl %esi, 0x14(%rdi) je 0x1da75 movl %esi, 0x14(%rdi) cmpq $0x0, 0x40(%rdi) je 0x1da8b retq leaq 0x2c2ce(%rip), %rsi # 0x49d4b movl $0x10003, %edi # imm = 0x10003 movl %eax, %edx xorl %eax, %eax jmp 0x18da7 jmp 0x2333e pushq %rax leaq 0xefc9(%rip), %rdi # 0x2ca61 leaq 0x2bc1f(%rip), %rsi # 0x496be leaq 0x2c2c5(%rip), %rcx # 0x49d6b movl $0x356, %edx # imm = 0x356 callq 0x131e0
/Konf[P]LearnOpenGL-CLion/glfw/src/window.c
acquireMonitor
static void acquireMonitor(_GLFWwindow* window) { if (_glfw.x11.saver.count == 0) { // Remember old screen saver settings XGetScreenSaver(_glfw.x11.display, &_glfw.x11.saver.timeout, &_glfw.x11.saver.interval, &_glfw.x11.saver.blanking, &_glfw.x11.saver.exposure); // Disable screen saver XSetScreenSaver(_glfw.x11.display, 0, 0, DontPreferBlanking, DefaultExposures); } if (!window->monitor->window) _glfw.x11.saver.count++; _glfwSetVideoModeX11(window->monitor, &window->videoMode); if (window->x11.overrideRedirect) { int xpos, ypos; GLFWvidmode mode; // Manually position the window over its monitor _glfwPlatformGetMonitorPos(window->monitor, &xpos, &ypos); _glfwPlatformGetVideoMode(window->monitor, &mode); XMoveResizeWindow(_glfw.x11.display, window->x11.handle, xpos, ypos, mode.width, mode.height); } _glfwInputMonitorWindow(window->monitor, window); }
pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x20, %rsp movq %rdi, %rbx leaq 0x33b2f(%rip), %r13 # 0x55b08 cmpl $0x0, 0x20624(%r13) jne 0x22023 movq 0x1feb8(%r13), %rdi leaq 0x20628(%r13), %rsi leaq 0x2062c(%r13), %rdx leaq 0x20630(%r13), %rcx leaq 0x20634(%r13), %r8 callq 0x13790 movq 0x1feb8(%r13), %rdi xorl %esi, %esi xorl %edx, %edx xorl %ecx, %ecx movl $0x2, %r8d callq 0x139e0 movq 0x40(%rbx), %rdi cmpq $0x0, 0x18(%rdi) jne 0x22035 incl 0x20624(%r13) leaq 0x28(%rbx), %rsi callq 0x20622 cmpl $0x0, 0x350(%rbx) je 0x22091 movq 0x40(%rbx), %rdi leaq 0x4(%rsp), %r14 movq %rsp, %r15 movq %r14, %rsi movq %r15, %rdx callq 0x20a93 movq 0x40(%rbx), %rdi leaq 0x8(%rsp), %r12 movq %r12, %rsi callq 0x207e4 movq 0x1feb8(%r13), %rdi movq 0x340(%rbx), %rsi movl (%r14), %edx movl (%r15), %ecx movl (%r12), %r8d movl 0x4(%r12), %r9d callq 0x134b0 movq 0x40(%rbx), %rdi movq %rbx, %rsi callq 0x1b7d1 addq $0x20, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq
/Konf[P]LearnOpenGL-CLion/glfw/src/x11_window.c
glfwPlatformRestoreWindow
void _glfwPlatformRestoreWindow(_GLFWwindow* window) { if (window->x11.overrideRedirect) { // Override-redirect windows cannot be iconified or restored, as those // tasks are performed by the window manager _glfwInputError(GLFW_PLATFORM_ERROR, "X11: Iconification of full screen windows requires a WM that supports EWMH full screen"); return; } if (_glfwPlatformWindowIconified(window)) { XMapWindow(_glfw.x11.display, window->x11.handle); waitForVisibilityNotify(window); } else if (_glfwPlatformWindowVisible(window)) { if (_glfw.x11.NET_WM_STATE && _glfw.x11.NET_WM_STATE_MAXIMIZED_VERT && _glfw.x11.NET_WM_STATE_MAXIMIZED_HORZ) { sendEventToWM(window, _glfw.x11.NET_WM_STATE, _NET_WM_STATE_REMOVE, _glfw.x11.NET_WM_STATE_MAXIMIZED_VERT, _glfw.x11.NET_WM_STATE_MAXIMIZED_HORZ, 1, 0); } } XFlush(_glfw.x11.display); }
cmpl $0x0, 0x350(%rdi) je 0x22b08 leaq 0x2847d(%rip), %rsi # 0x4af79 movl $0x10008, %edi # imm = 0x10008 xorl %eax, %eax jmp 0x18da7 pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xc8, %rsp movq %rdi, %rbx movq 0x340(%rdi), %rdi callq 0x2306c cmpl $0x3, %eax jne 0x22b54 leaq 0x32fd4(%rip), %rax # 0x55b08 movq 0x1feb8(%rax), %rdi movq 0x340(%rbx), %rsi callq 0x13550 movq %rbx, %rdi callq 0x22c4b jmp 0x22c0d leaq 0x32fad(%rip), %r15 # 0x55b08 movq 0x1feb8(%r15), %rdi movq 0x340(%rbx), %rsi leaq 0x8(%rsp), %r14 movq %r14, %rdx callq 0x13840 cmpl $0x2, 0x5c(%r14) jne 0x22c0d movq 0x20438(%r15), %r14 movq 0x20450(%r15), %r12 testq %r14, %r14 setne %al testq %r12, %r12 setne %cl andb %al, %cl movq 0x20458(%r15), %r13 testq %r13, %r13 setne %al andb %cl, %al cmpb $0x1, %al jne 0x22c0d movq 0x340(%rbx), %rbp leaq 0x8(%rsp), %rbx movl $0xc0, %edx movq %rbx, %rdi xorl %esi, %esi callq 0x130e0 movl $0x21, (%rbx) movq %rbp, 0x20(%rbx) movl $0x20, 0x30(%rbx) movq %r14, 0x28(%rbx) movq %r12, 0x40(%rbx) movq %r13, 0x48(%rbx) movq $0x1, 0x50(%rbx) movq 0x1feb8(%r15), %rdi movq 0x1fec8(%r15), %rsi movl $0x180000, %ecx # imm = 0x180000 xorl %edx, %edx movq %rbx, %r8 callq 0x13660 leaq 0x32ef4(%rip), %rax # 0x55b08 movq 0x1feb8(%rax), %rdi callq 0x13620 addq $0xc8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Konf[P]LearnOpenGL-CLion/glfw/src/x11_window.c
waitForVisibilityNotify
static GLFWbool waitForVisibilityNotify(_GLFWwindow* window) { XEvent dummy; double timeout = 0.1; while (!XCheckTypedWindowEvent(_glfw.x11.display, window->x11.handle, VisibilityNotify, &dummy)) { if (!waitForEvent(&timeout)) return GLFW_FALSE; } return GLFW_TRUE; }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0xc8, %rsp movq %rdi, %rbx movabsq $0x3fb999999999999a, %rax # imm = 0x3FB999999999999A movq %rsp, %r14 movq %rax, (%r14) leaq 0x32e95(%rip), %r12 # 0x55b08 leaq 0x8(%rsp), %r15 movq 0x1feb8(%r12), %rdi movq 0x340(%rbx), %rsi movl $0xf, %edx movq %r15, %rcx callq 0x13130 testl %eax, %eax jne 0x22ca8 movq %r14, %rdi callq 0x21451 testl %eax, %eax jne 0x22c78 xorl %eax, %eax jmp 0x22cad movl $0x1, %eax addq $0xc8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq
/Konf[P]LearnOpenGL-CLion/glfw/src/x11_window.c
glfwPlatformWindowMaximized
int _glfwPlatformWindowMaximized(_GLFWwindow* window) { Atom* states; unsigned long i; GLFWbool maximized = GLFW_FALSE; const unsigned long count = _glfwGetWindowPropertyX11(window->x11.handle, _glfw.x11.NET_WM_STATE, XA_ATOM, (unsigned char**) &states); for (i = 0; i < count; i++) { if (states[i] == _glfw.x11.NET_WM_STATE_MAXIMIZED_VERT || states[i] == _glfw.x11.NET_WM_STATE_MAXIMIZED_HORZ) { maximized = GLFW_TRUE; break; } } if (states) XFree(states); return maximized; }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x28, %rsp movq 0x340(%rdi), %rsi leaq 0x329fb(%rip), %r14 # 0x55b08 movq 0x20438(%r14), %rdx movq 0x1feb8(%r14), %rdi leaq 0x8(%rsp), %r15 leaq 0x10(%rsp), %rax leaq 0x18(%rsp), %r12 leaq 0x4(%rsp), %r10 leaq 0x20(%rsp), %r11 xorl %ebx, %ebx movabsq $0x7fffffffffffffff, %r8 # imm = 0x7FFFFFFFFFFFFFFF xorl %ecx, %ecx xorl %r9d, %r9d pushq %r15 pushq %rax pushq %r12 pushq %r10 pushq %r11 pushq $0x4 callq 0x13240 addq $0x30, %rsp movq (%r12), %rax movq (%r15), %rdi testq %rax, %rax je 0x23194 movq 0x20450(%r14), %rcx movq 0x20458(%r14), %rdx xorl %esi, %esi movq (%rdi,%rsi,8), %r8 movl $0x1, %ebx cmpq %rcx, %r8 je 0x23199 cmpq %rdx, %r8 je 0x23199 incq %rsi cmpq %rsi, %rax jne 0x23175 xorl %ebx, %ebx jmp 0x23199 testq %rdi, %rdi je 0x2319e callq 0x13070 movl %ebx, %eax addq $0x28, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq
/Konf[P]LearnOpenGL-CLion/glfw/src/x11_window.c
isSelPropNewValueNotify
static Bool isSelPropNewValueNotify(Display* display, XEvent* event, XPointer pointer) { XEvent* notification = (XEvent*) pointer; return event->type == PropertyNotify && event->xproperty.state == PropertyNewValue && event->xproperty.window == notification->xselection.requestor && event->xproperty.atom == notification->xselection.property; }
xorl %eax, %eax cmpl $0x1c, (%rsi) jne 0x2539f cmpl $0x0, 0x38(%rsi) je 0x253a0 retq movq 0x20(%rsi), %rcx cmpq 0x20(%rdx), %rcx jne 0x2539f movq 0x28(%rsi), %rcx xorl %eax, %eax cmpq 0x38(%rdx), %rcx sete %al retq
/Konf[P]LearnOpenGL-CLion/glfw/src/x11_window.c
convertLatin1toUTF8
static char* convertLatin1toUTF8(const char* source) { size_t size = 1; const char* sp; for (sp = source; *sp; sp++) size += (*sp & 0x80) ? 2 : 1; char* target = calloc(size, 1); char* tp = target; for (sp = source; *sp; sp++) tp += encodeUTF8(tp, *sp); return target; }
pushq %rbp pushq %r15 pushq %r14 pushq %rbx pushq %rax movb (%rdi), %bpl testb %bpl, %bpl je 0x2542c movq %rdi, %rbx leaq 0x1(%rdi), %rax movl $0x1, %edi movl %ebp, %ecx xorl %edx, %edx testb %cl, %cl setns %dl subq %rdx, %rdi addq $0x2, %rdi movb (%rax), %cl incq %rax testb %cl, %cl jne 0x253d5 movl $0x1, %esi callq 0x13780 movq %rax, %r14 testb %bpl, %bpl je 0x2541e incq %rbx movq %r14, %r15 movsbl %bpl, %esi movq %r15, %rdi callq 0x24aa7 addq %rax, %r15 movb (%rbx), %bpl incq %rbx testb %bpl, %bpl jne 0x25404 movq %r14, %rax addq $0x8, %rsp popq %rbx popq %r14 popq %r15 popq %rbp retq movl $0x1, %edi movl $0x1, %esi addq $0x8, %rsp popq %rbx popq %r14 popq %r15 popq %rbp jmp 0x13780 nopl (%rax)
/Konf[P]LearnOpenGL-CLion/glfw/src/x11_window.c
glfwKeySym2Unicode
long _glfwKeySym2Unicode(unsigned int keysym) { int min = 0; int max = sizeof(keysymtab) / sizeof(struct codepair) - 1; int mid; // First check for Latin-1 characters (1:1 mapping) if ((keysym >= 0x0020 && keysym <= 0x007e) || (keysym >= 0x00a0 && keysym <= 0x00ff)) { return keysym; } // Also check for directly encoded 24-bit UCS characters if ((keysym & 0xff000000) == 0x01000000) return keysym & 0x00ffffff; // Binary search in table while (max >= min) { mid = (min + max) / 2; if (keysymtab[mid].keysym < keysym) min = mid + 1; else if (keysymtab[mid].keysym > keysym) max = mid - 1; else return keysymtab[mid].ucs; } // No matching Unicode value found return -1; }
movl %edi, %eax leal -0x20(%rax), %ecx cmpl $0x5f, %ecx setae %cl leal -0xa0(%rax), %edx cmpl $0x60, %edx setae %dl testb %dl, %cl jne 0x25466 movl %eax, %eax retq movl %eax, %ecx andl $0xff000000, %ecx # imm = 0xFF000000 cmpl $0x1000000, %ecx # imm = 0x1000000 jne 0x2547c andl $0xffffff, %eax # imm = 0xFFFFFF retq xorl %edx, %edx movl $0x33b, %esi # imm = 0x33B leaq 0x25ea6(%rip), %rcx # 0x4b330 leal (%rsi,%rdx), %r8d movl %r8d, %edi shrl $0x1f, %edi addl %r8d, %edi sarl %edi movslq %edi, %r8 movzwl (%rcx,%r8,4), %r9d cmpl %eax, %r9d jae 0x254ac incl %edi movl %edi, %edx jmp 0x254b2 jbe 0x254be decl %edi movl %edi, %esi cmpl %edx, %esi jge 0x2548a movq $-0x1, %rax retq movzwl 0x2(%rcx,%r8,4), %eax retq nopl (%rax)
/Konf[P]LearnOpenGL-CLion/glfw/src/xkb_unicode.c
chooseGLXFBConfig
static GLFWbool chooseGLXFBConfig(const _GLFWfbconfig* desired, GLXFBConfig* result) { GLXFBConfig* nativeConfigs; _GLFWfbconfig* usableConfigs; const _GLFWfbconfig* closest; int i, nativeCount, usableCount; const char* vendor; GLFWbool trustWindowBit = GLFW_TRUE; // HACK: This is a (hopefully temporary) workaround for Chromium // (VirtualBox GL) not setting the window bit on any GLXFBConfigs vendor = glXGetClientString(_glfw.x11.display, GLX_VENDOR); if (vendor && strcmp(vendor, "Chromium") == 0) trustWindowBit = GLFW_FALSE; nativeConfigs = glXGetFBConfigs(_glfw.x11.display, _glfw.x11.screen, &nativeCount); if (!nativeConfigs || !nativeCount) { _glfwInputError(GLFW_API_UNAVAILABLE, "GLX: No GLXFBConfigs returned"); return GLFW_FALSE; } usableConfigs = calloc(nativeCount, sizeof(_GLFWfbconfig)); usableCount = 0; for (i = 0; i < nativeCount; i++) { const GLXFBConfig n = nativeConfigs[i]; _GLFWfbconfig* u = usableConfigs + usableCount; // Only consider RGBA GLXFBConfigs if (!(getGLXFBConfigAttrib(n, GLX_RENDER_TYPE) & GLX_RGBA_BIT)) continue; // Only consider window GLXFBConfigs if (!(getGLXFBConfigAttrib(n, GLX_DRAWABLE_TYPE) & GLX_WINDOW_BIT)) { if (trustWindowBit) continue; } if (desired->transparent) { XVisualInfo* vi = glXGetVisualFromFBConfig(_glfw.x11.display, n); if (vi) { u->transparent = _glfwIsVisualTransparentX11(vi->visual); XFree(vi); } } u->redBits = getGLXFBConfigAttrib(n, GLX_RED_SIZE); u->greenBits = getGLXFBConfigAttrib(n, GLX_GREEN_SIZE); u->blueBits = getGLXFBConfigAttrib(n, GLX_BLUE_SIZE); u->alphaBits = getGLXFBConfigAttrib(n, GLX_ALPHA_SIZE); u->depthBits = getGLXFBConfigAttrib(n, GLX_DEPTH_SIZE); u->stencilBits = getGLXFBConfigAttrib(n, GLX_STENCIL_SIZE); u->accumRedBits = getGLXFBConfigAttrib(n, GLX_ACCUM_RED_SIZE); u->accumGreenBits = getGLXFBConfigAttrib(n, GLX_ACCUM_GREEN_SIZE); u->accumBlueBits = getGLXFBConfigAttrib(n, GLX_ACCUM_BLUE_SIZE); u->accumAlphaBits = getGLXFBConfigAttrib(n, GLX_ACCUM_ALPHA_SIZE); u->auxBuffers = getGLXFBConfigAttrib(n, GLX_AUX_BUFFERS); if (getGLXFBConfigAttrib(n, GLX_STEREO)) u->stereo = GLFW_TRUE; if (getGLXFBConfigAttrib(n, GLX_DOUBLEBUFFER)) u->doublebuffer = GLFW_TRUE; if (_glfw.glx.ARB_multisample) u->samples = getGLXFBConfigAttrib(n, GLX_SAMPLES); if (_glfw.glx.ARB_framebuffer_sRGB || _glfw.glx.EXT_framebuffer_sRGB) u->sRGB = getGLXFBConfigAttrib(n, GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB); u->handle = (uintptr_t) n; usableCount++; } closest = _glfwChooseFBConfig(desired, usableConfigs, usableCount); if (closest) *result = (GLXFBConfig) closest->handle; XFree(nativeConfigs); free(usableConfigs); return closest != NULL; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x38, %rsp movq %rsi, %r14 movq %rdi, 0x20(%rsp) leaq 0x2fa49(%rip), %r12 # 0x55b08 movq 0x1feb8(%r12), %rdi movl $0x1, %esi callq *0x20780(%r12) testq %rax, %rax je 0x260f1 leaq 0x26667(%rip), %rsi # 0x4c747 movq %rax, %rdi callq 0x13690 testl %eax, %eax setne 0xf(%rsp) jmp 0x260f6 movb $0x1, 0xf(%rsp) movq 0x1feb8(%r12), %rdi movl 0x1fec0(%r12), %esi leaq 0x1c(%rsp), %rbx movq %rbx, %rdx callq *0x20770(%r12) movq %rax, %r15 testq %rax, %rax setne %al movl (%rbx), %ebx testl %ebx, %ebx setne %cl testb %cl, %al je 0x2645d movq %r14, 0x28(%rsp) movslq %ebx, %rdi movl $0x48, %esi callq 0x13780 movq %rax, 0x10(%rsp) testl %ebx, %ebx jle 0x26474 xorl %ebp, %ebp leaq 0x8(%rsp), %r13 xorl %r14d, %r14d movq %r15, 0x30(%rsp) movq (%r15,%rbp,8), %rbx movq 0x1feb8(%r12), %rdi movq %rbx, %rsi movl $0x8011, %edx # imm = 0x8011 movq %r13, %rcx callq *0x20778(%r12) testb $0x1, 0x8(%rsp) je 0x2644a movq 0x1feb8(%r12), %rdi movq %rbx, %rsi movl $0x8010, %edx # imm = 0x8010 movq %r13, %rcx callq *0x20778(%r12) testb $0x1, 0x8(%rsp) sete %al testb %al, 0xf(%rsp) jne 0x2644a movl %r14d, 0x18(%rsp) movslq %r14d, %rax leaq (%rax,%rax,8), %rax movq 0x10(%rsp), %rcx leaq (%rcx,%rax,8), %r15 movq 0x20(%rsp), %rax cmpl $0x0, 0x3c(%rax) je 0x26202 movq 0x1feb8(%r12), %rdi movq %rbx, %rsi callq *0x207c0(%r12) testq %rax, %rax je 0x26202 movq %rax, %r14 movq (%rax), %rdi callq 0x21036 movl %eax, 0x3c(%r15) movq %r14, %rdi callq 0x13070 movq 0x1feb8(%r12), %rdi movq %rbx, %rsi movl $0x8, %edx movq %r13, %rcx callq *0x20778(%r12) movl 0x8(%rsp), %eax movl %eax, (%r15) movq 0x1feb8(%r12), %rdi movq %rbx, %rsi movl $0x9, %edx movq %r13, %rcx callq *0x20778(%r12) movl 0x8(%rsp), %eax movl %eax, 0x4(%r15) movq 0x1feb8(%r12), %rdi movq %rbx, %rsi movl $0xa, %edx movq %r13, %rcx callq *0x20778(%r12) movl 0x8(%rsp), %eax movl %eax, 0x8(%r15) movq 0x1feb8(%r12), %rdi movq %rbx, %rsi movl $0xb, %edx movq %r13, %rcx callq *0x20778(%r12) movl 0x8(%rsp), %eax movl %eax, 0xc(%r15) movq 0x1feb8(%r12), %rdi movq %rbx, %rsi movl $0xc, %edx movq %r13, %rcx callq *0x20778(%r12) movl 0x8(%rsp), %eax movl %eax, 0x10(%r15) movq 0x1feb8(%r12), %rdi movq %rbx, %rsi movl $0xd, %edx movq %r13, %rcx callq *0x20778(%r12) movl 0x8(%rsp), %eax movl %eax, 0x14(%r15) movq 0x1feb8(%r12), %rdi movq %rbx, %rsi movl $0xe, %edx movq %r13, %rcx callq *0x20778(%r12) movl 0x8(%rsp), %eax movl %eax, 0x18(%r15) movq 0x1feb8(%r12), %rdi movq %rbx, %rsi movl $0xf, %edx movq %r13, %rcx callq *0x20778(%r12) movl 0x8(%rsp), %eax movl %eax, 0x1c(%r15) movq 0x1feb8(%r12), %rdi movq %rbx, %rsi movl $0x10, %edx movq %r13, %rcx callq *0x20778(%r12) movl 0x8(%rsp), %eax movl %eax, 0x20(%r15) movq 0x1feb8(%r12), %rdi movq %rbx, %rsi movl $0x11, %edx movq %r13, %rcx callq *0x20778(%r12) movl 0x8(%rsp), %eax movl %eax, 0x24(%r15) movq 0x1feb8(%r12), %rdi movq %rbx, %rsi movl $0x7, %edx movq %r13, %rcx callq *0x20778(%r12) movl 0x8(%rsp), %eax movl %eax, 0x28(%r15) movq 0x1feb8(%r12), %rdi movq %rbx, %rsi movl $0x6, %edx movq %r13, %rcx callq *0x20778(%r12) cmpl $0x0, 0x8(%rsp) je 0x263ac movl $0x1, 0x2c(%r15) movq 0x1feb8(%r12), %rdi movq %rbx, %rsi movl $0x5, %edx movq %r13, %rcx callq *0x20778(%r12) cmpl $0x0, 0x8(%rsp) je 0x263d6 movl $0x1, 0x38(%r15) cmpl $0x0, 0x20814(%r12) movl 0x18(%rsp), %r14d je 0x26409 movq 0x1feb8(%r12), %rdi movq %rbx, %rsi movl $0x186a1, %edx # imm = 0x186A1 movq %r13, %rcx callq *0x20778(%r12) movl 0x8(%rsp), %eax movl %eax, 0x30(%r15) movl 0x2081c(%r12), %eax orl 0x20818(%r12), %eax je 0x2643e movq 0x1feb8(%r12), %rdi movq %rbx, %rsi movl $0x20b2, %edx # imm = 0x20B2 movq %r13, %rcx callq *0x20778(%r12) movl 0x8(%rsp), %eax movl %eax, 0x34(%r15) movq %rbx, 0x40(%r15) incl %r14d movq 0x30(%rsp), %r15 incq %rbp movslq 0x1c(%rsp), %rax cmpq %rax, %rbp jl 0x2615c jmp 0x26477 leaq 0x262ec(%rip), %rsi # 0x4c750 xorl %ebx, %ebx movl $0x10006, %edi # imm = 0x10006 xorl %eax, %eax callq 0x18da7 jmp 0x264b4 xorl %r14d, %r14d movq 0x20(%rsp), %rdi movq 0x10(%rsp), %rsi movl %r14d, %edx callq 0x18453 testq %rax, %rax je 0x2649a movq 0x40(%rax), %rcx movq 0x28(%rsp), %rdx movq %rcx, (%rdx) xorl %ebx, %ebx testq %rax, %rax setne %bl movq %r15, %rdi callq 0x13070 movq 0x10(%rsp), %rdi callq 0x133c0 movl %ebx, %eax addq $0x38, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Konf[P]LearnOpenGL-CLion/glfw/src/glx_context.c
glfwTerminateEGL
void _glfwTerminateEGL(void) { if (_glfw.egl.display) { eglTerminate(_glfw.egl.display); _glfw.egl.display = EGL_NO_DISPLAY; } if (_glfw.egl.handle) { _glfw_dlclose(_glfw.egl.handle); _glfw.egl.handle = NULL; } }
pushq %rbx leaq 0x2efdf(%rip), %rbx # 0x55b08 movq 0x20888(%rbx), %rdi testq %rdi, %rdi je 0x26b46 callq *0x208e0(%rbx) movq $0x0, 0x20888(%rbx) movq 0x208b0(%rbx), %rdi testq %rdi, %rdi je 0x26b62 callq 0x13a10 movq $0x0, 0x208b0(%rbx) popq %rbx retq
/Konf[P]LearnOpenGL-CLion/glfw/src/egl_context.c
makeContextCurrentEGL
static void makeContextCurrentEGL(_GLFWwindow* window) { if (window) { if (!eglMakeCurrent(_glfw.egl.display, window->context.egl.surface, window->context.egl.surface, window->context.egl.handle)) { _glfwInputError(GLFW_PLATFORM_ERROR, "EGL: Failed to make context current: %s", getEGLErrorString(eglGetError())); return; } } else { if (!eglMakeCurrent(_glfw.egl.display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT)) { _glfwInputError(GLFW_PLATFORM_ERROR, "EGL: Failed to clear current context: %s", getEGLErrorString(eglGetError())); return; } } _glfwPlatformSetTls(&_glfw.contextSlot, window); }
pushq %r14 pushq %rbx pushq %rax movq %rdi, %rbx leaq 0x2e741(%rip), %r14 # 0x55b08 movq 0x20888(%r14), %rdi movq 0x20910(%r14), %rax testq %rbx, %rbx je 0x27408 movq 0x280(%rbx), %rcx movq 0x288(%rbx), %rdx movq %rdx, %rsi callq *%rax testl %eax, %eax jne 0x27414 callq *0x208d0(%r14) movl %eax, %edi callq 0x26b64 leaq 0x25ab3(%rip), %rsi # 0x4ceb9 jmp 0x27444 xorl %esi, %esi xorl %edx, %edx xorl %ecx, %ecx callq *%rax testl %eax, %eax je 0x2742f movl $0x1fe14, %edi # imm = 0x1FE14 addq 0x2bbb8(%rip), %rdi # 0x52fd8 movq %rbx, %rsi addq $0x8, %rsp popq %rbx popq %r14 jmp 0x25612 callq *0x208d0(%r14) movl %eax, %edi callq 0x26b64 leaq 0x25a9d(%rip), %rsi # 0x4cee1 movl $0x10008, %edi # imm = 0x10008 movq %rax, %rdx xorl %eax, %eax addq $0x8, %rsp popq %rbx popq %r14 jmp 0x18da7
/Konf[P]LearnOpenGL-CLion/glfw/src/egl_context.c
mbedtls_pkcs12_pbe
int mbedtls_pkcs12_pbe( mbedtls_asn1_buf *pbe_params, int mode, mbedtls_cipher_type_t cipher_type, mbedtls_md_type_t md_type, const unsigned char *pwd, size_t pwdlen, const unsigned char *data, size_t len, unsigned char *output ) { int ret, keylen = 0; unsigned char key[32]; unsigned char iv[16]; const mbedtls_cipher_info_t *cipher_info; mbedtls_cipher_context_t cipher_ctx; size_t olen = 0; cipher_info = mbedtls_cipher_info_from_type( cipher_type ); if( cipher_info == NULL ) return( MBEDTLS_ERR_PKCS12_FEATURE_UNAVAILABLE ); keylen = cipher_info->key_bitlen / 8; if( ( ret = pkcs12_pbe_derive_key_iv( pbe_params, md_type, pwd, pwdlen, key, keylen, iv, cipher_info->iv_size ) ) != 0 ) { return( ret ); } mbedtls_cipher_init( &cipher_ctx ); if( ( ret = mbedtls_cipher_setup( &cipher_ctx, cipher_info ) ) != 0 ) goto exit; if( ( ret = mbedtls_cipher_setkey( &cipher_ctx, key, 8 * keylen, (mbedtls_operation_t) mode ) ) != 0 ) goto exit; if( ( ret = mbedtls_cipher_set_iv( &cipher_ctx, iv, cipher_info->iv_size ) ) != 0 ) goto exit; if( ( ret = mbedtls_cipher_reset( &cipher_ctx ) ) != 0 ) goto exit; if( ( ret = mbedtls_cipher_update( &cipher_ctx, data, len, output, &olen ) ) != 0 ) { goto exit; } if( ( ret = mbedtls_cipher_finish( &cipher_ctx, output + olen, &olen ) ) != 0 ) ret = MBEDTLS_ERR_PKCS12_PASSWORD_MISMATCH; exit: mbedtls_zeroize( key, sizeof( key ) ); mbedtls_zeroize( iv, sizeof( iv ) ); mbedtls_cipher_free( &cipher_ctx ); return( ret ); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x98, %rsp movq %r9, %rbx movq %r8, %r12 movl %ecx, %r13d movl %esi, %r15d movq %rdi, %rbp andq $0x0, 0x8(%rsp) movl %edx, %edi callq 0x2ae64 testq %rax, %rax je 0x29a48 movq %rax, %r14 movl %r15d, 0x4(%rsp) movl 0x8(%rax), %r15d movl 0x18(%rax), %eax movl %r15d, %r9d shrl $0x3, %r9d leaq 0x10(%rsp), %r10 leaq 0x20(%rsp), %r8 movq %rbp, %rdi movl %r13d, %esi movq %r12, %rdx movq %rbx, %rcx pushq %rax pushq %r10 callq 0x2977f popq %rcx popq %rdx movl %eax, %ebx testl %eax, %eax jne 0x29a4d leaq 0x40(%rsp), %rbx movq %rbx, %rdi callq 0x2aef3 movq %rbx, %rdi movq %r14, %rsi callq 0x2af3f testl %eax, %eax jne 0x29a20 andl $-0x8, %r15d leaq 0x40(%rsp), %rdi leaq 0x20(%rsp), %rsi movl %r15d, %edx movl 0x4(%rsp), %ecx callq 0x2affa testl %eax, %eax jne 0x29a20 movl 0x18(%r14), %edx leaq 0x40(%rsp), %rdi leaq 0x10(%rsp), %rsi callq 0x2b04d testl %eax, %eax jne 0x29a20 leaq 0x40(%rsp), %rdi callq 0x2b0b1 testl %eax, %eax jne 0x29a20 movq 0xe0(%rsp), %r14 movq 0xd8(%rsp), %rdx movq 0xd0(%rsp), %rsi leaq 0x40(%rsp), %rdi leaq 0x8(%rsp), %r8 movq %r14, %rcx callq 0x2b101 testl %eax, %eax je 0x29a61 movl %eax, %ebx leaq 0x20(%rsp), %rdi pushq $0x20 popq %rsi callq 0x2990c leaq 0x10(%rsp), %rdi pushq $0x10 popq %rsi callq 0x2990c leaq 0x40(%rsp), %rdi callq 0x2af0f jmp 0x29a4d movl $0xffffe100, %ebx # imm = 0xFFFFE100 movl %ebx, %eax addq $0x98, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x8(%rsp), %rdx addq (%rdx), %r14 leaq 0x40(%rsp), %rdi movq %r14, %rsi callq 0x2b407 testl %eax, %eax movl $0xffffe200, %ebx # imm = 0xFFFFE200 cmovel %eax, %ebx jmp 0x29a22
/project-everest[P]mbedtls/library/pkcs12.c
mbedtls_pkcs12_derivation
int mbedtls_pkcs12_derivation( unsigned char *data, size_t datalen, const unsigned char *pwd, size_t pwdlen, const unsigned char *salt, size_t saltlen, mbedtls_md_type_t md_type, int id, int iterations ) { int ret; unsigned int j; unsigned char diversifier[128]; unsigned char salt_block[128], pwd_block[128], hash_block[128]; unsigned char hash_output[MBEDTLS_MD_MAX_SIZE]; unsigned char *p; unsigned char c; size_t hlen, use_len, v, i; const mbedtls_md_info_t *md_info; mbedtls_md_context_t md_ctx; // This version only allows max of 64 bytes of password or salt if( datalen > 128 || pwdlen > 64 || saltlen > 64 ) return( MBEDTLS_ERR_PKCS12_BAD_INPUT_DATA ); md_info = mbedtls_md_info_from_type( md_type ); if( md_info == NULL ) return( MBEDTLS_ERR_PKCS12_FEATURE_UNAVAILABLE ); mbedtls_md_init( &md_ctx ); if( ( ret = mbedtls_md_setup( &md_ctx, md_info, 0 ) ) != 0 ) return( ret ); hlen = mbedtls_md_get_size( md_info ); if( hlen <= 32 ) v = 64; else v = 128; memset( diversifier, (unsigned char) id, v ); pkcs12_fill_buffer( salt_block, v, salt, saltlen ); pkcs12_fill_buffer( pwd_block, v, pwd, pwdlen ); p = data; while( datalen > 0 ) { // Calculate hash( diversifier || salt_block || pwd_block ) if( ( ret = mbedtls_md_starts( &md_ctx ) ) != 0 ) goto exit; if( ( ret = mbedtls_md_update( &md_ctx, diversifier, v ) ) != 0 ) goto exit; if( ( ret = mbedtls_md_update( &md_ctx, salt_block, v ) ) != 0 ) goto exit; if( ( ret = mbedtls_md_update( &md_ctx, pwd_block, v ) ) != 0 ) goto exit; if( ( ret = mbedtls_md_finish( &md_ctx, hash_output ) ) != 0 ) goto exit; // Perform remaining ( iterations - 1 ) recursive hash calculations for( i = 1; i < (size_t) iterations; i++ ) { if( ( ret = mbedtls_md( md_info, hash_output, hlen, hash_output ) ) != 0 ) goto exit; } use_len = ( datalen > hlen ) ? hlen : datalen; memcpy( p, hash_output, use_len ); datalen -= use_len; p += use_len; if( datalen == 0 ) break; // Concatenating copies of hash_output into hash_block (B) pkcs12_fill_buffer( hash_block, v, hash_output, hlen ); // B += 1 for( i = v; i > 0; i-- ) if( ++hash_block[i - 1] != 0 ) break; // salt_block += B c = 0; for( i = v; i > 0; i-- ) { j = salt_block[i - 1] + hash_block[i - 1] + c; c = (unsigned char) (j >> 8); salt_block[i - 1] = j & 0xFF; } // pwd_block += B c = 0; for( i = v; i > 0; i-- ) { j = pwd_block[i - 1] + hash_block[i - 1] + c; c = (unsigned char) (j >> 8); pwd_block[i - 1] = j & 0xFF; } } ret = 0; exit: mbedtls_zeroize( salt_block, sizeof( salt_block ) ); mbedtls_zeroize( pwd_block, sizeof( pwd_block ) ); mbedtls_zeroize( hash_block, sizeof( hash_block ) ); mbedtls_zeroize( hash_output, sizeof( hash_output ) ); mbedtls_md_free( &md_ctx ); return( ret ); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x298, %rsp # imm = 0x298 movq %rcx, %r14 movq %rdx, 0x10(%rsp) cmpq $0x81, %rsi setae %al cmpq $0x41, %rcx setae %cl orb %al, %cl cmpq $0x41, %r9 setae %al orb %cl, %al movl $0xffffe080, %eax # imm = 0xFFFFE080 jne 0x29dd5 movq %r9, %r15 movq %r8, %rbx movq %rsi, %r12 movq %rdi, %rbp movl 0x2d0(%rsp), %edi callq 0x13f8b testq %rax, %rax je 0x29b81 movq %rax, 0x28(%rsp) leaq 0x38(%rsp), %r13 movq %r13, %rdi callq 0x13fa4 movq %r13, %rdi movq 0x28(%rsp), %r13 movq %r13, %rsi xorl %edx, %edx callq 0x1404a testl %eax, %eax jne 0x29dd5 movq %rbp, 0x30(%rsp) movq %r12, 0x20(%rsp) movq %r13, %rdi movl 0x2d8(%rsp), %r13d callq 0x1450a xorl %ebp, %ebp movb %al, 0xf(%rsp) cmpb $0x21, %al setae %bpl shll $0x6, %ebp addq $0x40, %rbp leaq 0x210(%rsp), %rdi movl %r13d, %esi movq %rbp, %rdx callq 0xc0e0 leaq 0x150(%rsp), %r13 movq %rbp, 0x18(%rsp) testq %rbp, %rbp je 0x29b8b cmpq %r15, %rbp movq %r15, %r12 cmovbq %rbp, %r12 movq %r13, %rdi movq %rbx, %rsi movq %r12, %rdx callq 0xc150 addq %r12, %r13 subq %r12, %rbp jmp 0x29b5c movl $0xffffe100, %eax # imm = 0xFFFFE100 jmp 0x29dd5 leaq 0xd0(%rsp), %rbx movq 0x18(%rsp), %r12 movq 0x28(%rsp), %r13 movq 0x10(%rsp), %rbp testq %r12, %r12 je 0x29bc7 cmpq %r14, %r12 movq %r14, %r15 cmovbq %r12, %r15 movq %rbx, %rdi movq %rbp, %rsi movq %r15, %rdx callq 0xc150 addq %r15, %rbx subq %r15, %r12 jmp 0x29ba2 movzbl 0xf(%rsp), %ebp movslq 0x2e0(%rsp), %r12 leaq 0x38(%rsp), %r15 leaq 0x1d0(%rsp), %r14 movq 0x18(%rsp), %rbx cmpq $0x0, 0x20(%rsp) je 0x29de7 movq $0x0, 0x10(%rsp) movq %r15, %rdi callq 0x140b6 testl %eax, %eax jne 0x29d7e movq %r15, %rdi leaq 0x210(%rsp), %rsi movq %rbx, %rdx callq 0x140d0 testl %eax, %eax jne 0x29d7e movq %r15, %rdi leaq 0x150(%rsp), %rsi movq %rbx, %rdx callq 0x140d0 testl %eax, %eax jne 0x29d7e movq %r15, %rdi leaq 0xd0(%rsp), %rsi movq %rbx, %rdx callq 0x140d0 testl %eax, %eax jne 0x29d7e movq %r15, %rdi movq %r14, %rsi callq 0x140ed testl %eax, %eax jne 0x29d7e xorl %ebx, %ebx incq %rbx cmpq %r12, %rbx jae 0x29c93 movq %r13, %rdi movq %r14, %rsi movq %rbp, %rdx movq %r14, %rcx callq 0x1410a testl %eax, %eax je 0x29c71 jmp 0x29d7e movq 0x20(%rsp), %r15 cmpq %rbp, %r15 movq %rbp, %rbx cmovbq %r15, %rbx movq 0x30(%rsp), %r13 movq %r13, %rdi movq %r14, %rsi movq %rbx, %rdx callq 0xc150 subq %rbx, %r15 movq %r15, 0x20(%rsp) je 0x29d83 addq %rbx, %r13 movq %r13, 0x30(%rsp) leaq 0x50(%rsp), %rbx movq 0x18(%rsp), %r13 testq %r13, %r13 je 0x29cfa cmpq %rbp, %r13 movq %rbp, %r15 cmovbq %r13, %r15 movq %rbx, %rdi movq %r14, %rsi movq %r15, %rdx callq 0xc150 addq %r15, %rbx subq %r15, %r13 jmp 0x29cd5 movq 0x18(%rsp), %rbx movq %rbx, %rcx movq %rbx, %rax subq $0x1, %rax jb 0x29d14 incb 0x4f(%rsp,%rcx) movq %rax, %rcx je 0x29d05 xorl %eax, %eax movq %rbx, %rdx movq %rbx, %rcx movq 0x28(%rsp), %r13 leaq 0x38(%rsp), %r15 subq $0x1, %rcx jb 0x29d4c movzbl 0x14f(%rsp,%rdx), %esi movzbl 0x4f(%rsp,%rdx), %edi addl %esi, %eax addl %edi, %eax movb %al, 0x14f(%rsp,%rdx) movzbl %ah, %eax movq %rcx, %rdx jmp 0x29d26 xorl %eax, %eax movq %rbx, %rdx movq %rbx, %rcx subq $0x1, %rcx jb 0x29be6 movzbl 0xcf(%rsp,%rdx), %esi movzbl 0x4f(%rsp,%rdx), %edi addl %esi, %eax addl %edi, %eax movb %al, 0xcf(%rsp,%rdx) movzbl %ah, %eax movq %rcx, %rdx jmp 0x29d54 movq %rax, 0x10(%rsp) leaq 0x150(%rsp), %rdi movl $0x80, %esi callq 0x2990c leaq 0xd0(%rsp), %rdi movl $0x80, %esi callq 0x2990c leaq 0x50(%rsp), %rdi movl $0x80, %esi callq 0x2990c leaq 0x1d0(%rsp), %rdi pushq $0x40 popq %rsi callq 0x2990c leaq 0x38(%rsp), %rdi callq 0x13fb0 movq 0x10(%rsp), %rax addq $0x298, %rsp # imm = 0x298 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq $0x0, 0x10(%rsp) jmp 0x29d83 nop
/project-everest[P]mbedtls/library/pkcs12.c
mbedtls_pkcs5_pbes2
int mbedtls_pkcs5_pbes2( const mbedtls_asn1_buf *pbe_params, int mode, const unsigned char *pwd, size_t pwdlen, const unsigned char *data, size_t datalen, unsigned char *output ) { int ret, iterations = 0, keylen = 0; unsigned char *p, *end; mbedtls_asn1_buf kdf_alg_oid, enc_scheme_oid, kdf_alg_params, enc_scheme_params; mbedtls_asn1_buf salt; mbedtls_md_type_t md_type = MBEDTLS_MD_SHA1; unsigned char key[32], iv[32]; size_t olen = 0; const mbedtls_md_info_t *md_info; const mbedtls_cipher_info_t *cipher_info; mbedtls_md_context_t md_ctx; mbedtls_cipher_type_t cipher_alg; mbedtls_cipher_context_t cipher_ctx; p = pbe_params->p; end = p + pbe_params->len; /* * PBES2-params ::= SEQUENCE { * keyDerivationFunc AlgorithmIdentifier {{PBES2-KDFs}}, * encryptionScheme AlgorithmIdentifier {{PBES2-Encs}} * } */ if( pbe_params->tag != ( MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE ) ) return( MBEDTLS_ERR_PKCS5_INVALID_FORMAT + MBEDTLS_ERR_ASN1_UNEXPECTED_TAG ); if( ( ret = mbedtls_asn1_get_alg( &p, end, &kdf_alg_oid, &kdf_alg_params ) ) != 0 ) return( MBEDTLS_ERR_PKCS5_INVALID_FORMAT + ret ); // Only PBKDF2 supported at the moment // if( MBEDTLS_OID_CMP( MBEDTLS_OID_PKCS5_PBKDF2, &kdf_alg_oid ) != 0 ) return( MBEDTLS_ERR_PKCS5_FEATURE_UNAVAILABLE ); if( ( ret = pkcs5_parse_pbkdf2_params( &kdf_alg_params, &salt, &iterations, &keylen, &md_type ) ) != 0 ) { return( ret ); } md_info = mbedtls_md_info_from_type( md_type ); if( md_info == NULL ) return( MBEDTLS_ERR_PKCS5_FEATURE_UNAVAILABLE ); if( ( ret = mbedtls_asn1_get_alg( &p, end, &enc_scheme_oid, &enc_scheme_params ) ) != 0 ) { return( MBEDTLS_ERR_PKCS5_INVALID_FORMAT + ret ); } if( mbedtls_oid_get_cipher_alg( &enc_scheme_oid, &cipher_alg ) != 0 ) return( MBEDTLS_ERR_PKCS5_FEATURE_UNAVAILABLE ); cipher_info = mbedtls_cipher_info_from_type( cipher_alg ); if( cipher_info == NULL ) return( MBEDTLS_ERR_PKCS5_FEATURE_UNAVAILABLE ); /* * The value of keylen from pkcs5_parse_pbkdf2_params() is ignored * since it is optional and we don't know if it was set or not */ keylen = cipher_info->key_bitlen / 8; if( enc_scheme_params.tag != MBEDTLS_ASN1_OCTET_STRING || enc_scheme_params.len != cipher_info->iv_size ) { return( MBEDTLS_ERR_PKCS5_INVALID_FORMAT ); } mbedtls_md_init( &md_ctx ); mbedtls_cipher_init( &cipher_ctx ); memcpy( iv, enc_scheme_params.p, enc_scheme_params.len ); if( ( ret = mbedtls_md_setup( &md_ctx, md_info, 1 ) ) != 0 ) goto exit; if( ( ret = mbedtls_pkcs5_pbkdf2_hmac( &md_ctx, pwd, pwdlen, salt.p, salt.len, iterations, keylen, key ) ) != 0 ) { goto exit; } if( ( ret = mbedtls_cipher_setup( &cipher_ctx, cipher_info ) ) != 0 ) goto exit; if( ( ret = mbedtls_cipher_setkey( &cipher_ctx, key, 8 * keylen, (mbedtls_operation_t) mode ) ) != 0 ) goto exit; if( ( ret = mbedtls_cipher_crypt( &cipher_ctx, iv, enc_scheme_params.len, data, datalen, output, &olen ) ) != 0 ) ret = MBEDTLS_ERR_PKCS5_PASSWORD_MISMATCH; exit: mbedtls_md_free( &md_ctx ); mbedtls_cipher_free( &cipher_ctx ); return( ret ); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x178, %rsp # imm = 0x178 andl $0x0, 0x20(%rsp) andl $0x0, 0xc(%rsp) movl $0x4, 0x1c(%rsp) andq $0x0, 0x60(%rsp) movq 0x10(%rdi), %r13 movq %r13, 0x28(%rsp) movl $0xffffd09e, %ebx # imm = 0xFFFFD09E cmpl $0x30, (%rdi) jne 0x29e9a movq %r8, %r14 movq %rcx, %r15 movq %rdx, %r12 movl %esi, %ebp movq %r9, 0x58(%rsp) addq 0x8(%rdi), %r13 leaq 0x28(%rsp), %rdi leaq 0xc8(%rsp), %rdx leaq 0x98(%rsp), %rcx movq %r13, %rsi callq 0x1068b testl %eax, %eax je 0x29e6f movl %eax, %ebx addl $0xffffd100, %ebx # imm = 0xFFFFD100 jmp 0x29e9a cmpq $0x9, 0xd0(%rsp) jne 0x29e95 movq 0xd8(%rsp), %rsi leaq 0xecb7(%rip), %rdi # 0x38b40 pushq $0x9 popq %rdx callq 0xc190 testl %eax, %eax je 0x29eae movl $0xffffd180, %ebx # imm = 0xFFFFD180 movl %ebx, %eax addq $0x178, %rsp # imm = 0x178 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq 0xa8(%rsp), %rax movq %rax, 0x30(%rsp) movl $0xffffd09e, %ebx # imm = 0xFFFFD09E cmpl $0x30, 0x98(%rsp) jne 0x29e9a addq 0xa0(%rsp), %rax leaq 0x88(%rsp), %rdx leaq 0x30(%rsp), %rdi pushq $0x4 popq %rcx movq %rax, %rsi movq %rax, 0x10(%rsp) movl %ecx, 0x18(%rsp) callq 0x10417 testl %eax, %eax jne 0x29f29 leaq 0x30(%rsp), %rdi movq (%rdi), %rax movq %rax, 0x90(%rsp) addq 0x88(%rsp), %rax movq %rax, (%rdi) leaq 0x20(%rsp), %rdx movq 0x10(%rsp), %rsi callq 0x10484 testl %eax, %eax je 0x2a0a9 movl %eax, %ebx addl $0xffffd100, %ebx # imm = 0xFFFFD100 jne 0x29e9a movl 0x18(%rsp), %edi callq 0x13f8b testq %rax, %rax je 0x29e95 movq %rax, 0x10(%rsp) leaq 0x28(%rsp), %rdi leaq 0xe0(%rsp), %rdx leaq 0x68(%rsp), %rcx movq %r13, %rsi callq 0x1068b testl %eax, %eax jne 0x29e65 leaq 0xe0(%rsp), %rdi leaq 0x24(%rsp), %rsi callq 0x149c2 testl %eax, %eax jne 0x29e95 movl 0x24(%rsp), %edi callq 0x2ae64 movl $0xffffd180, %ebx # imm = 0xFFFFD180 testq %rax, %rax je 0x29e9a movq %rax, %r13 movl 0x8(%rax), %eax shrl $0x3, %eax movl %eax, 0xc(%rsp) movl $0xffffd100, %ebx # imm = 0xFFFFD100 cmpl $0x4, 0x68(%rsp) jne 0x29e9a movl 0x18(%r13), %eax cmpq %rax, 0x70(%rsp) jne 0x29e9a leaq 0xb0(%rsp), %rbx movq %rbx, %rdi callq 0x13fa4 leaq 0xf8(%rsp), %rdi callq 0x2aef3 movq 0x70(%rsp), %rdx movq 0x78(%rsp), %rsi leaq 0x150(%rsp), %rdi callq 0xc150 pushq $0x1 popq %rdx movq %rbx, %rdi movq 0x10(%rsp), %rsi callq 0x1404a testl %eax, %eax jne 0x2a088 movq 0x88(%rsp), %r8 movq 0x90(%rsp), %rcx movl 0x20(%rsp), %r9d movl 0xc(%rsp), %eax leaq 0xb0(%rsp), %rdi movq %r12, %rsi movq %r15, %rdx leaq 0x30(%rsp), %r10 pushq %r10 pushq %rax callq 0x2a18e addq $0x10, %rsp testl %eax, %eax jne 0x2a088 leaq 0xf8(%rsp), %rdi movq %r13, %rsi callq 0x2af3f testl %eax, %eax jne 0x2a088 movl 0xc(%rsp), %edx shll $0x3, %edx leaq 0xf8(%rsp), %rdi leaq 0x30(%rsp), %rsi movl %ebp, %ecx callq 0x2affa testl %eax, %eax je 0x2a147 movl %eax, %ebx leaq 0xb0(%rsp), %rdi callq 0x13fb0 leaq 0xf8(%rsp), %rdi callq 0x2af0f jmp 0x29e9a pushq $0x4 popq %rcx movq 0x10(%rsp), %rsi cmpq %rsi, 0x30(%rsp) je 0x2a13e leaq 0x30(%rsp), %rdi leaq 0xc(%rsp), %rdx callq 0x10484 testl %eax, %eax je 0x2a0da movl %eax, %ebx cmpl $-0x62, %eax jne 0x29f2b movq 0x10(%rsp), %rax cmpq %rax, 0x30(%rsp) pushq $0x4 popq %rcx je 0x2a13e leaq 0x30(%rsp), %rdi leaq 0xf8(%rsp), %rdx movq %rax, %rsi callq 0x1076e testl %eax, %eax jne 0x29f29 leaq 0xf8(%rsp), %rdi leaq 0x1c(%rsp), %rsi callq 0x14aa4 movl $0xffffd180, %ebx # imm = 0xFFFFD180 testl %eax, %eax movq 0x10(%rsp), %rax jne 0x29e9a movl $0xffffd09a, %ebx # imm = 0xFFFFD09A cmpq %rax, 0x30(%rsp) jne 0x29e9a movl 0x1c(%rsp), %ecx movl %ecx, 0x18(%rsp) jmp 0x29f37 movq 0x1b0(%rsp), %r9 movq 0x70(%rsp), %rdx subq $0x8, %rsp leaq 0x68(%rsp), %rax leaq 0x100(%rsp), %rdi leaq 0x158(%rsp), %rsi movq %r14, %rcx movq 0x60(%rsp), %r8 pushq %rax callq 0x2b7da addq $0x10, %rsp testl %eax, %eax movl $0xffffd200, %ebx # imm = 0xFFFFD200 cmovel %eax, %ebx jmp 0x2a08a
/project-everest[P]mbedtls/library/pkcs5.c
mbedtls_pkcs5_pbkdf2_hmac
int mbedtls_pkcs5_pbkdf2_hmac( mbedtls_md_context_t *ctx, const unsigned char *password, size_t plen, const unsigned char *salt, size_t slen, unsigned int iteration_count, uint32_t key_length, unsigned char *output ) { int ret, j; unsigned int i; unsigned char md1[MBEDTLS_MD_MAX_SIZE]; unsigned char work[MBEDTLS_MD_MAX_SIZE]; unsigned char md_size = mbedtls_md_get_size( ctx->md_info ); size_t use_len; unsigned char *out_p = output; unsigned char counter[4]; memset( counter, 0, 4 ); counter[3] = 1; if( iteration_count > 0xFFFFFFFF ) return( MBEDTLS_ERR_PKCS5_BAD_INPUT_DATA ); while( key_length ) { // U1 ends up in work // if( ( ret = mbedtls_md_hmac_starts( ctx, password, plen ) ) != 0 ) return( ret ); if( ( ret = mbedtls_md_hmac_update( ctx, salt, slen ) ) != 0 ) return( ret ); if( ( ret = mbedtls_md_hmac_update( ctx, counter, 4 ) ) != 0 ) return( ret ); if( ( ret = mbedtls_md_hmac_finish( ctx, work ) ) != 0 ) return( ret ); memcpy( md1, work, md_size ); for( i = 1; i < iteration_count; i++ ) { // U2 ends up in md1 // if( ( ret = mbedtls_md_hmac_starts( ctx, password, plen ) ) != 0 ) return( ret ); if( ( ret = mbedtls_md_hmac_update( ctx, md1, md_size ) ) != 0 ) return( ret ); if( ( ret = mbedtls_md_hmac_finish( ctx, md1 ) ) != 0 ) return( ret ); // U1 xor U2 // for( j = 0; j < md_size; j++ ) work[j] ^= md1[j]; } use_len = ( key_length < md_size ) ? key_length : md_size; memcpy( out_p, work, use_len ); key_length -= (uint32_t) use_len; out_p += use_len; for( i = 4; i > 0; i-- ) if( ++counter[i - 1] != 0 ) break; } return( 0 ); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xb8, %rsp movl %r9d, 0xc(%rsp) movq %r8, 0x28(%rsp) movq %rcx, 0x20(%rsp) movq %rdx, %r12 movq %rsi, %r13 movq %rdi, %r14 movq 0xf8(%rsp), %rax movq %rax, 0x10(%rsp) movl 0xf0(%rsp), %ebx movq (%rdi), %rdi callq 0x1450a leaq 0x4(%rsp), %rcx movl $0x1000000, (%rcx) # imm = 0x1000000 movzbl %al, %r15d leaq 0x70(%rsp), %rbp testl %ebx, %ebx je 0x2a315 movl %ebx, 0x8(%rsp) movq %r14, %rdi movq %r13, %rsi movq %r12, %rdx callq 0x1422f testl %eax, %eax jne 0x2a303 movq %r14, %rdi movq 0x20(%rsp), %rsi movq 0x28(%rsp), %rdx callq 0x1433b testl %eax, %eax jne 0x2a303 movq %r14, %rdi leaq 0x4(%rsp), %rsi pushq $0x4 popq %rdx callq 0x1433b testl %eax, %eax jne 0x2a303 movq %r14, %rdi leaq 0x30(%rsp), %rbx movq %rbx, %rsi callq 0x1435f testl %eax, %eax jne 0x2a303 movq %rbp, %rdi movq %rbx, %rsi movq %r15, %rdx callq 0xc150 pushq $0x1 popq %rbx cmpl 0xc(%rsp), %ebx jae 0x2a2b9 movq %r14, %rdi movq %r13, %rsi movq %r12, %rdx callq 0x1422f testl %eax, %eax jne 0x2a303 movq %r14, %rdi movq %rbp, %rsi movq %r15, %rdx callq 0x1433b testl %eax, %eax jne 0x2a303 movq %r14, %rdi movq %rbp, %rsi callq 0x1435f testl %eax, %eax jne 0x2a303 xorl %eax, %eax cmpq %rax, %r15 je 0x2a2b5 movb 0x70(%rsp,%rax), %cl xorb %cl, 0x30(%rsp,%rax) incq %rax jmp 0x2a2a3 incl %ebx jmp 0x2a264 movl 0x8(%rsp), %ebx cmpl %r15d, %ebx movl %r15d, %edx cmovbl %ebx, %edx movq %rdx, 0x18(%rsp) movq 0x10(%rsp), %rdi leaq 0x30(%rsp), %rsi callq 0xc150 movq 0x18(%rsp), %rax subl %eax, %ebx addq %rax, 0x10(%rsp) pushq $0x3 popq %rax cmpq $-0x1, %rax je 0x2a1e7 movl %eax, %ecx decq %rax incb 0x4(%rsp,%rcx) je 0x2a2e9 jmp 0x2a1e7 addq $0xb8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq xorl %eax, %eax jmp 0x2a303
/project-everest[P]mbedtls/library/pkcs5.c
mbedtls_pkcs5_self_test
int mbedtls_pkcs5_self_test( int verbose ) { mbedtls_md_context_t sha1_ctx; const mbedtls_md_info_t *info_sha1; int ret, i; unsigned char key[64]; mbedtls_md_init( &sha1_ctx ); info_sha1 = mbedtls_md_info_from_type( MBEDTLS_MD_SHA1 ); if( info_sha1 == NULL ) { ret = 1; goto exit; } if( ( ret = mbedtls_md_setup( &sha1_ctx, info_sha1, 1 ) ) != 0 ) { ret = 1; goto exit; } for( i = 0; i < MAX_TESTS; i++ ) { if( verbose != 0 ) mbedtls_printf( " PBKDF2 (SHA1) #%d: ", i ); ret = mbedtls_pkcs5_pbkdf2_hmac( &sha1_ctx, password[i], plen[i], salt[i], slen[i], it_cnt[i], key_len[i], key ); if( ret != 0 || memcmp( result_key[i], key, key_len[i] ) != 0 ) { if( verbose != 0 ) mbedtls_printf( "failed\n" ); ret = 1; goto exit; } if( verbose != 0 ) mbedtls_printf( "passed\n" ); } if( verbose != 0 ) mbedtls_printf( "\n" ); exit: mbedtls_md_free( &sha1_ctx ); return( ret ); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x78, %rsp movl %edi, %r12d leaq 0x18(%rsp), %rdi callq 0x13fa4 pushq $0x4 popq %rdi callq 0x13f8b testq %rax, %rax je 0x2a45c leaq 0x18(%rsp), %rdi pushq $0x1 popq %rbx movq %rax, %rsi movl %ebx, %edx callq 0x1404a testl %eax, %eax jne 0x2a45f leaq 0xe8ea(%rip), %rax # 0x38c50 movq %rax, 0x10(%rsp) leaq 0x30(%rsp), %r14 movl $0x0, 0xc(%rsp) xorl %ebx, %ebx xorl %r15d, %r15d xorl %ebp, %ebp cmpq $0xc0, %rbp je 0x2a47a movl %r12d, %r13d testl %r12d, %r12d je 0x2a3ab leaq 0xe7af(%rip), %rdi # 0x38b4a movl 0xc(%rsp), %esi xorl %eax, %eax callq 0xc0c0 leaq 0x30(%rsp), %r14 leaq 0xe7ae(%rip), %rax # 0x38b60 leaq (%rax,%rbp), %rsi leaq 0xe863(%rip), %rax # 0x38c20 movq (%rbx,%rax), %rdx leaq 0xe978(%rip), %rax # 0x38d40 movq (%rbx,%rax), %r8 leaq 0xea5d(%rip), %rax # 0x38e30 movl (%r15,%rax), %r9d leaq 0xea72(%rip), %rax # 0x38e50 movl (%r15,%rax), %r12d leaq 0x18(%rsp), %rdi movq 0x10(%rsp), %rcx pushq %r14 pushq %r12 callq 0x2a18e addq $0x10, %rsp testl %eax, %eax jne 0x2a44b leaq 0xe96c(%rip), %rax # 0x38d70 leaq (%rax,%rbp), %rdi movq %r14, %rsi movq %r12, %rdx callq 0xc190 testl %eax, %eax jne 0x2a44b movl %r13d, %r12d testl %r13d, %r13d je 0x2a42b leaq 0xa421(%rip), %rdi # 0x34847 callq 0xc050 addq $0x20, %rbp addq $0x4, %r15 addq $0x8, %rbx addq $0x28, 0x10(%rsp) incl 0xc(%rsp) leaq 0x30(%rsp), %r14 jmp 0x2a37f testl %r13d, %r13d je 0x2a45c leaq 0xbfcf(%rip), %rdi # 0x36426 callq 0xc050 pushq $0x1 popq %rbx leaq 0x18(%rsp), %rdi callq 0x13fb0 movl %ebx, %eax addq $0x78, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq xorl %ebx, %ebx testl %r12d, %r12d je 0x2a45f pushq $0xa popq %rdi callq 0xc040 jmp 0x2a45f nop
/project-everest[P]mbedtls/library/pkcs5.c
mbedtls_arc4_setup
void mbedtls_arc4_setup( mbedtls_arc4_context *ctx, const unsigned char *key, unsigned int keylen ) { int i, j, a; unsigned int k; unsigned char *m; ctx->x = 0; ctx->y = 0; m = ctx->m; for( i = 0; i < 256; i++ ) m[i] = (unsigned char) i; j = k = 0; for( i = 0; i < 256; i++, k++ ) { if( k >= keylen ) k = 0; a = m[i]; j = ( j + a + key[k] ) & 0xFF; m[i] = m[j]; m[j] = (unsigned char) a; } }
andq $0x0, (%rdi) xorl %eax, %eax cmpq $0x100, %rax # imm = 0x100 je 0x2a4ce movb %al, 0x8(%rdi,%rax) incq %rax jmp 0x2a4bd pushq %rbx xorl %eax, %eax xorl %ecx, %ecx xorl %r8d, %r8d xorl %r9d, %r9d cmpq $0x100, %rcx # imm = 0x100 je 0x2a50f cmpl %edx, %r9d cmovael %eax, %r9d movb 0x8(%rdi,%rcx), %r10b addb %r10b, %r8b addb (%rsi,%r9), %r8b movzbl %r8b, %r11d movb 0x8(%rdi,%r11), %bl movb %bl, 0x8(%rdi,%rcx) movb %r10b, 0x8(%rdi,%r11) incq %rcx incl %r9d jmp 0x2a4d9 popq %rbx retq
/project-everest[P]mbedtls/library/arc4.c
mbedtls_arc4_self_test
int mbedtls_arc4_self_test( int verbose ) { int i, ret = 0; unsigned char ibuf[8]; unsigned char obuf[8]; mbedtls_arc4_context ctx; mbedtls_arc4_init( &ctx ); for( i = 0; i < 3; i++ ) { if( verbose != 0 ) mbedtls_printf( " ARC4 test #%d: ", i + 1 ); memcpy( ibuf, arc4_test_pt[i], 8 ); mbedtls_arc4_setup( &ctx, arc4_test_key[i], 8 ); mbedtls_arc4_crypt( &ctx, 8, ibuf, obuf ); if( memcmp( obuf, arc4_test_ct[i], 8 ) != 0 ) { if( verbose != 0 ) mbedtls_printf( "failed\n" ); ret = 1; goto exit; } if( verbose != 0 ) mbedtls_printf( "passed\n" ); } if( verbose != 0 ) mbedtls_printf( "\n" ); exit: mbedtls_arc4_free( &ctx ); return( ret ); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x118, %rsp # imm = 0x118 movl %edi, %ebx leaq 0x10(%rsp), %r14 movl $0x108, %edx # imm = 0x108 movq %r14, %rdi xorl %esi, %esi callq 0xc0e0 pushq $0x1 popq %rbp leaq 0x8(%rsp), %r15 leaq 0xe929(%rip), %r12 # 0x38ec0 xorl %r13d, %r13d cmpq $0x18, %r13 je 0x2a60f testl %ebx, %ebx je 0x2a5b4 leaq 0xe8bd(%rip), %rdi # 0x38e68 movl %ebp, %esi xorl %eax, %eax callq 0xc0c0 leaq 0xe8c5(%rip), %rax # 0x38e80 movq (%r13,%rax), %rax movq %rax, (%rsp) leaq 0xe8d5(%rip), %rax # 0x38ea0 leaq (%rax,%r13), %rsi movq %r14, %rdi pushq $0x8 popq %rdx callq 0x2a4b7 movq %r14, %rdi pushq $0x8 popq %rsi movq %rsp, %rdx movq %r15, %rcx callq 0x2a511 movq 0x8(%rsp), %rax cmpq (%r13,%r12), %rax jne 0x2a61f testl %ebx, %ebx je 0x2a607 leaq 0xa245(%rip), %rdi # 0x34847 callq 0xc050 incl %ebp addq $0x8, %r13 jmp 0x2a59a xorl %ebp, %ebp testl %ebx, %ebx je 0x2a632 pushq $0xa popq %rdi callq 0xc040 jmp 0x2a632 pushq $0x1 popq %rbp testl %ebx, %ebx je 0x2a632 leaq 0xbdf9(%rip), %rdi # 0x36426 callq 0xc050 leaq 0x10(%rsp), %rdi callq 0x2a498 movl %ebp, %eax addq $0x118, %rsp # imm = 0x118 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/project-everest[P]mbedtls/library/arc4.c
mbedtls_asn1_write_len
int mbedtls_asn1_write_len( unsigned char **p, unsigned char *start, size_t len ) { if( len < 0x80 ) { if( *p - start < 1 ) return( MBEDTLS_ERR_ASN1_BUF_TOO_SMALL ); *--(*p) = (unsigned char) len; return( 1 ); } if( len <= 0xFF ) { if( *p - start < 2 ) return( MBEDTLS_ERR_ASN1_BUF_TOO_SMALL ); *--(*p) = (unsigned char) len; *--(*p) = 0x81; return( 2 ); } if( len <= 0xFFFF ) { if( *p - start < 3 ) return( MBEDTLS_ERR_ASN1_BUF_TOO_SMALL ); *--(*p) = ( len ) & 0xFF; *--(*p) = ( len >> 8 ) & 0xFF; *--(*p) = 0x82; return( 3 ); } if( len <= 0xFFFFFF ) { if( *p - start < 4 ) return( MBEDTLS_ERR_ASN1_BUF_TOO_SMALL ); *--(*p) = ( len ) & 0xFF; *--(*p) = ( len >> 8 ) & 0xFF; *--(*p) = ( len >> 16 ) & 0xFF; *--(*p) = 0x83; return( 4 ); } if( len <= 0xFFFFFFFF ) { if( *p - start < 5 ) return( MBEDTLS_ERR_ASN1_BUF_TOO_SMALL ); *--(*p) = ( len ) & 0xFF; *--(*p) = ( len >> 8 ) & 0xFF; *--(*p) = ( len >> 16 ) & 0xFF; *--(*p) = ( len >> 24 ) & 0xFF; *--(*p) = 0x84; return( 5 ); } return( MBEDTLS_ERR_ASN1_INVALID_LENGTH ); }
cmpq $0x7f, %rdx ja 0x2a670 movq (%rdi), %rcx movq %rcx, %rax subq %rsi, %rax testq %rax, %rax jle 0x2a744 pushq $0x1 popq %rax jmp 0x2a78d cmpq $0xff, %rdx ja 0x2a6a3 movq (%rdi), %rax movq %rax, %rcx subq %rsi, %rcx cmpq $0x2, %rcx jl 0x2a744 leaq -0x1(%rax), %rcx movq %rcx, (%rdi) movb %dl, -0x1(%rax) movq (%rdi), %rcx pushq $0x2 popq %rax movb $-0x7f, %dl jmp 0x2a78d cmpq $0xffff, %rdx # imm = 0xFFFF ja 0x2a6e3 movq (%rdi), %rax movq %rax, %rcx subq %rsi, %rcx cmpq $0x3, %rcx jl 0x2a744 leaq -0x1(%rax), %rcx movq %rcx, (%rdi) movb %dl, -0x1(%rax) movq (%rdi), %rax leaq -0x1(%rax), %rcx movq %rcx, (%rdi) movb %dh, -0x1(%rax) movq (%rdi), %rcx pushq $0x3 popq %rax movb $-0x7e, %dl jmp 0x2a78d cmpq $0xffffff, %rdx # imm = 0xFFFFFF ja 0x2a72c movq (%rdi), %rax movq %rax, %rcx subq %rsi, %rcx cmpq $0x4, %rcx jl 0x2a744 leaq -0x1(%rax), %rcx movq %rcx, (%rdi) movb %dl, -0x1(%rax) movq (%rdi), %rax leaq -0x1(%rax), %rcx movq %rcx, (%rdi) movb %dh, -0x1(%rax) shrl $0x10, %edx movq (%rdi), %rax leaq -0x1(%rax), %rcx movq %rcx, (%rdi) movb %dl, -0x1(%rax) movq (%rdi), %rcx pushq $0x4 popq %rax movb $-0x7d, %dl jmp 0x2a78d movq %rdx, %rax shrq $0x20, %rax jne 0x2a748 movq (%rdi), %rax movq %rax, %rcx subq %rsi, %rcx cmpq $0x5, %rcx jge 0x2a74c pushq $-0x6c popq %rax retq pushq $-0x64 jmp 0x2a746 leaq -0x1(%rax), %rcx movq %rcx, (%rdi) movb %dl, -0x1(%rax) movq (%rdi), %rax leaq -0x1(%rax), %rcx movq %rcx, (%rdi) movb %dh, -0x1(%rax) movl %edx, %eax shrl $0x10, %eax movq (%rdi), %rcx leaq -0x1(%rcx), %rsi movq %rsi, (%rdi) movb %al, -0x1(%rcx) shrl $0x18, %edx movq (%rdi), %rax leaq -0x1(%rax), %rcx movq %rcx, (%rdi) movb %dl, -0x1(%rax) movq (%rdi), %rcx pushq $0x5 popq %rax movb $-0x7c, %dl leaq -0x1(%rcx), %rsi movq %rsi, (%rdi) movb %dl, -0x1(%rcx) retq
/project-everest[P]mbedtls/library/asn1write.c
mbedtls_asn1_write_raw_buffer
int mbedtls_asn1_write_raw_buffer( unsigned char **p, unsigned char *start, const unsigned char *buf, size_t size ) { size_t len = 0; if( *p < start || (size_t)( *p - start ) < size ) return( MBEDTLS_ERR_ASN1_BUF_TOO_SMALL ); len = size; (*p) -= len; memcpy( *p, buf, len ); return( (int) len ); }
pushq %rbx movq %rcx, %rbx movq %rdi, %rax movq (%rdi), %rdi movq %rdi, %rcx subq %rsi, %rcx setb %sil cmpq %rbx, %rcx setb %cl orb %sil, %cl je 0x2a7dc pushq $-0x6c popq %rbx jmp 0x2a7ed subq %rbx, %rdi movq %rdi, (%rax) movq %rdx, %rsi movq %rbx, %rdx callq 0xc150 movl %ebx, %eax popq %rbx retq
/project-everest[P]mbedtls/library/asn1write.c
mbedtls_asn1_write_mpi
int mbedtls_asn1_write_mpi( unsigned char **p, unsigned char *start, const mbedtls_mpi *X ) { int ret; size_t len = 0; // Write the MPI // len = mbedtls_mpi_size( X ); if( *p < start || (size_t)( *p - start ) < len ) return( MBEDTLS_ERR_ASN1_BUF_TOO_SMALL ); (*p) -= len; MBEDTLS_MPI_CHK( mbedtls_mpi_write_binary( X, *p, len ) ); // DER format assumes 2s complement for numbers, so the leftmost bit // should be 0 for positive numbers and 1 for negative numbers. // if( X->s ==1 && **p & 0x80 ) { if( *p - start < 1 ) return( MBEDTLS_ERR_ASN1_BUF_TOO_SMALL ); *--(*p) = 0x00; len += 1; } MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, MBEDTLS_ASN1_INTEGER ) ); ret = (int) len; cleanup: return( ret ); }
pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx movq %rdx, %r13 movq %rsi, %r12 movq %rdi, %r14 movq %rdx, %rdi callq 0x10d1c movq %rax, %r15 movq (%r14), %rsi pushq $-0x6c popq %rbx movq %rsi, %rax subq %r12, %rax jb 0x2a838 cmpq %r15, %rax jb 0x2a838 subq %r15, %rsi movq %rsi, (%r14) movq %r13, %rdi movq %r15, %rdx callq 0x11434 testl %eax, %eax je 0x2a844 movl %eax, %ebx movl %ebx, %eax popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq cmpl $0x1, (%r13) jne 0x2a86c movq (%r14), %rax cmpb $0x0, (%rax) jns 0x2a86c movq %rax, %rcx subq %r12, %rcx testq %rcx, %rcx jle 0x2a838 leaq -0x1(%rax), %rcx movq %rcx, (%r14) movb $0x0, -0x1(%rax) incq %r15 movq %r14, %rdi movq %r12, %rsi movq %r15, %rdx callq 0x2a650 testl %eax, %eax js 0x2a89f movq (%r14), %rcx movq %rcx, %rdx subq %r12, %rdx testq %rdx, %rdx jle 0x2a838 leaq -0x1(%rcx), %rdx movq %rdx, (%r14) movb $0x2, -0x1(%rcx) leal (%r15,%rax), %ebx incl %ebx jmp 0x2a838 movl %eax, %ebx jmp 0x2a838
/project-everest[P]mbedtls/library/asn1write.c
mbedtls_asn1_write_null
int mbedtls_asn1_write_len( unsigned char **p, unsigned char *start, size_t len ) { if( len < 0x80 ) { if( *p - start < 1 ) return( MBEDTLS_ERR_ASN1_BUF_TOO_SMALL ); *--(*p) = (unsigned char) len; return( 1 ); } if( len <= 0xFF ) { if( *p - start < 2 ) return( MBEDTLS_ERR_ASN1_BUF_TOO_SMALL ); *--(*p) = (unsigned char) len; *--(*p) = 0x81; return( 2 ); } if( len <= 0xFFFF ) { if( *p - start < 3 ) return( MBEDTLS_ERR_ASN1_BUF_TOO_SMALL ); *--(*p) = ( len ) & 0xFF; *--(*p) = ( len >> 8 ) & 0xFF; *--(*p) = 0x82; return( 3 ); } if( len <= 0xFFFFFF ) { if( *p - start < 4 ) return( MBEDTLS_ERR_ASN1_BUF_TOO_SMALL ); *--(*p) = ( len ) & 0xFF; *--(*p) = ( len >> 8 ) & 0xFF; *--(*p) = ( len >> 16 ) & 0xFF; *--(*p) = 0x83; return( 4 ); } if( len <= 0xFFFFFFFF ) { if( *p - start < 5 ) return( MBEDTLS_ERR_ASN1_BUF_TOO_SMALL ); *--(*p) = ( len ) & 0xFF; *--(*p) = ( len >> 8 ) & 0xFF; *--(*p) = ( len >> 16 ) & 0xFF; *--(*p) = ( len >> 24 ) & 0xFF; *--(*p) = 0x84; return( 5 ); } return( MBEDTLS_ERR_ASN1_INVALID_LENGTH ); }
movq (%rdi), %rcx movq %rcx, %rdx subq %rsi, %rdx pushq $-0x6c popq %rax testq %rdx, %rdx jle 0x2a8db leaq -0x1(%rcx), %rdx movq %rdx, (%rdi) movb $0x0, -0x1(%rcx) movq (%rdi), %rcx movq %rcx, %rdx subq %rsi, %rdx testq %rdx, %rdx jle 0x2a8db leaq -0x1(%rcx), %rax movq %rax, (%rdi) movb $0x5, -0x1(%rcx) pushq $0x2 popq %rax retq
/project-everest[P]mbedtls/library/asn1write.c
mbedtls_asn1_write_oid
int mbedtls_asn1_write_oid( unsigned char **p, unsigned char *start, const char *oid, size_t oid_len ) { int ret; size_t len = 0; MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_raw_buffer( p, start, (const unsigned char *) oid, oid_len ) ); MBEDTLS_ASN1_CHK_ADD( len , mbedtls_asn1_write_len( p, start, len ) ); MBEDTLS_ASN1_CHK_ADD( len , mbedtls_asn1_write_tag( p, start, MBEDTLS_ASN1_OID ) ); return( (int) len ); }
pushq %rbp pushq %r15 pushq %r14 pushq %rbx pushq %rax movq %rcx, %rbx movq %rdi, %r14 movq (%rdi), %rdi movq %rdi, %rax subq %rsi, %rax setb %cl cmpq %rbx, %rax setb %al orb %cl, %al pushq $-0x6c popq %rbp jne 0x2a957 movq %rsi, %r15 subq %rbx, %rdi movq %rdi, (%r14) movq %rdx, %rsi movq %rbx, %rdx callq 0xc150 testl %ebx, %ebx js 0x2a951 movl %ebx, %edx andl $0x7fffffff, %edx # imm = 0x7FFFFFFF movq %r14, %rdi movq %r15, %rsi callq 0x2a650 testl %eax, %eax js 0x2a955 movq (%r14), %rcx movq %rcx, %rdx subq %r15, %rdx testq %rdx, %rdx jle 0x2a957 leaq -0x1(%rcx), %rdx movq %rdx, (%r14) movb $0x6, -0x1(%rcx) leal (%rbx,%rax), %ebp incl %ebp jmp 0x2a957 movl %ebx, %ebp jmp 0x2a957 movl %eax, %ebp movl %ebp, %eax addq $0x8, %rsp popq %rbx popq %r14 popq %r15 popq %rbp retq
/project-everest[P]mbedtls/library/asn1write.c