name
stringlengths
1
473k
code
stringlengths
7
647k
asm
stringlengths
4
3.39M
file
stringlengths
8
196
ffgsdt
int ffgsdt( int *day, int *month, int *year, int *status ) { /* This routine is included for backward compatibility with the Fortran FITSIO library. ffgsdt : Get current System DaTe (GMT if available) Return integer values of the day, month, and year Function parameters: day Day of the month month Numerical month (1=Jan, etc.) year Year (1999, 2000, etc.) status output error status */ time_t now; struct tm *date; now = time( NULL ); date = gmtime(&now); /* get GMT (= UTC) time */ if (!date) /* GMT not available on this machine */ { date = localtime(&now); } *day = date->tm_mday; *month = date->tm_mon + 1; *year = date->tm_year + 1900; /* tm_year is defined as years since 1900 */ return( *status ); }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx pushq %rax movq %rcx, %rbx movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %r12 xorl %edi, %edi callq 0x6610 movq %rsp, %rdi movq %rax, (%rdi) callq 0x61d0 testq %rax, %rax jne 0xb11c8 movq %rsp, %rdi callq 0x6570 movl 0xc(%rax), %ecx movl %ecx, (%r12) movl 0x10(%rax), %ecx incl %ecx movl %ecx, (%r15) movl $0x76c, %ecx # imm = 0x76C addl 0x14(%rax), %ecx movl %ecx, (%r14) movl (%rbx), %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/putkey.c
main
int main(int argc, char *argv[]) { int sockfd; struct sockaddr_in servaddr; sockfd = socket(AF_INET, SOCK_STREAM, 0); bzero(&servaddr, sizeof(servaddr)); servaddr.sin_family = AF_INET; servaddr.sin_port = htons(SERV_PORT); inet_pton(AF_INET, IPADDRESS, &servaddr.sin_addr); // inet_pton(AF_INET, const char *__restrict __cp, void *__restrict __buf); char buff[4096]; buff[0] = '\0'; // 发空串 const char *p = " "; if (connect(sockfd, (struct sockaddr *)&servaddr, sizeof(servaddr)) == 0) { setSocketNonBlocking1(sockfd); cout << "=========1:" << endl; ssize_t n = write(sockfd, p, strlen(p)); cout << "strlen(p) = " << strlen(p) << endl; sleep(1); n = read(sockfd, buff, 4096); cout << "n=" << n << endl; printf("%s", buff); close(sockfd); } else { perror("err1"); } sleep(1); // 发"GET HTTP/1.1" p = "GET HTTP/1.1"; sockfd = socket(AF_INET, SOCK_STREAM, 0); if (connect(sockfd, (struct sockaddr *)&servaddr, sizeof(servaddr)) == 0) { setSocketNonBlocking1(sockfd); cout << "=========2:" << endl; ssize_t n = write(sockfd, p, strlen(p)); cout << "strlen(p) = " << strlen(p) << endl; sleep(1); n = read(sockfd, buff, 4096); cout << "n=" << n << endl; printf("%s", buff); close(sockfd); } else { perror("err2"); } sleep(1); // 发 // GET HTTP/1.1 // Host: 192.168.52.135:8088 // Content-Type: application/x-www-form-urlencoded // Connection: Keep-Alive p = "GET / HTTP/1.1\r\nHost: 192.168.52.135:8088\r\nContent-Type: " "application/x-www-form-urlencoded\r\nConnection: Keep-Alive\r\n\r\n"; sockfd = socket(AF_INET, SOCK_STREAM, 0); if (connect(sockfd, (struct sockaddr *)&servaddr, sizeof(servaddr)) == 0) { setSocketNonBlocking1(sockfd); cout << "========3:" << endl; ssize_t n = write(sockfd, p, strlen(p)); cout << "strlen(p) = " << strlen(p) << endl; sleep(1); n = read(sockfd, buff, 4096); cout << "n=" << n << endl; printf("%s", buff); close(sockfd); } else { perror("err3"); } return 0; }
subq $0x1098, %rsp # imm = 0x1098 movl $0x0, 0x1094(%rsp) movl %edi, 0x1090(%rsp) movq %rsi, 0x1088(%rsp) movl $0x2, %edi movl $0x1, %esi xorl %edx, %edx callq 0x1060 movl %eax, 0x1084(%rsp) leaq 0x1074(%rsp), %rdi movl $0x10, %esi callq 0x1120 movw $0x2, 0x1074(%rsp) movl $0x1f98, %edi # imm = 0x1F98 callq 0x1040 movw %ax, 0x1076(%rsp) leaq 0x1074(%rsp), %rdx addq $0x4, %rdx movl $0x2, %edi leaq 0xc75(%rip), %rsi # 0x2004 callq 0x1140 movb $0x0, 0x70(%rsp) leaq 0xc85(%rip), %rax # 0x2025 movq %rax, 0x68(%rsp) movl 0x1084(%rsp), %edi leaq 0x1074(%rsp), %rsi movl $0x10, %edx callq 0x10b0 cmpl $0x0, %eax jne 0x14dd movl 0x1084(%rsp), %edi callq 0x12a0 movq 0x2bfe(%rip), %rdi # 0x3fd8 leaq 0xc2d(%rip), %rsi # 0x200e callq 0x10e0 movq %rax, %rdi movq 0x2bd8(%rip), %rsi # 0x3fc8 callq 0x10f0 movl 0x1084(%rsp), %eax movl %eax, 0x3c(%rsp) movq 0x68(%rsp), %rax movq %rax, 0x40(%rsp) movq 0x68(%rsp), %rdi callq 0x1080 movl 0x3c(%rsp), %edi movq 0x40(%rsp), %rsi movq %rax, %rdx callq 0x1070 movq %rax, 0x60(%rsp) movq 0x2ba7(%rip), %rdi # 0x3fd8 leaq 0xbe2(%rip), %rsi # 0x201a callq 0x10e0 movq %rax, 0x48(%rsp) movq 0x68(%rsp), %rdi callq 0x1080 movq 0x48(%rsp), %rdi movq %rax, %rsi callq 0x1050 movq %rax, %rdi movq 0x2b65(%rip), %rsi # 0x3fc8 callq 0x10f0 movl $0x1, %edi callq 0x10a0 movl 0x1084(%rsp), %edi leaq 0x70(%rsp), %rsi movl $0x1000, %edx # imm = 0x1000 callq 0x1100 movq %rax, 0x60(%rsp) movq 0x2b44(%rip), %rdi # 0x3fd8 leaq 0xb8c(%rip), %rsi # 0x2027 callq 0x10e0 movq %rax, %rdi movq 0x60(%rsp), %rsi callq 0x1130 movq %rax, %rdi movq 0x2b11(%rip), %rsi # 0x3fc8 callq 0x10f0 leaq 0x70(%rsp), %rsi leaq 0xb62(%rip), %rdi # 0x202a movb $0x0, %al callq 0x1030 movl 0x1084(%rsp), %edi callq 0x1150 jmp 0x14e9 leaq 0xb49(%rip), %rdi # 0x202d callq 0x10c0 movl $0x1, %edi callq 0x10a0 leaq 0xb38(%rip), %rax # 0x2032 movq %rax, 0x68(%rsp) movl $0x2, %edi movl $0x1, %esi xorl %edx, %edx callq 0x1060 movl %eax, 0x1084(%rsp) movl 0x1084(%rsp), %edi leaq 0x1074(%rsp), %rsi movl $0x10, %edx callq 0x10b0 cmpl $0x0, %eax jne 0x164f movl 0x1084(%rsp), %edi callq 0x12a0 movq 0x2a8c(%rip), %rdi # 0x3fd8 leaq 0xaed(%rip), %rsi # 0x2040 callq 0x10e0 movq %rax, %rdi movq 0x2a66(%rip), %rsi # 0x3fc8 callq 0x10f0 movl 0x1084(%rsp), %eax movl %eax, 0x24(%rsp) movq 0x68(%rsp), %rax movq %rax, 0x28(%rsp) movq 0x68(%rsp), %rdi callq 0x1080 movl 0x24(%rsp), %edi movq 0x28(%rsp), %rsi movq %rax, %rdx callq 0x1070 movq %rax, 0x58(%rsp) movq 0x2a35(%rip), %rdi # 0x3fd8 leaq 0xa70(%rip), %rsi # 0x201a callq 0x10e0 movq %rax, 0x30(%rsp) movq 0x68(%rsp), %rdi callq 0x1080 movq 0x30(%rsp), %rdi movq %rax, %rsi callq 0x1050 movq %rax, %rdi movq 0x29f3(%rip), %rsi # 0x3fc8 callq 0x10f0 movl $0x1, %edi callq 0x10a0 movl 0x1084(%rsp), %edi leaq 0x70(%rsp), %rsi movl $0x1000, %edx # imm = 0x1000 callq 0x1100 movq %rax, 0x58(%rsp) movq 0x29d2(%rip), %rdi # 0x3fd8 leaq 0xa1a(%rip), %rsi # 0x2027 callq 0x10e0 movq %rax, %rdi movq 0x58(%rsp), %rsi callq 0x1130 movq %rax, %rdi movq 0x299f(%rip), %rsi # 0x3fc8 callq 0x10f0 leaq 0x70(%rsp), %rsi leaq 0x9f0(%rip), %rdi # 0x202a movb $0x0, %al callq 0x1030 movl 0x1084(%rsp), %edi callq 0x1150 jmp 0x165b leaq 0x9f6(%rip), %rdi # 0x204c callq 0x10c0 movl $0x1, %edi callq 0x10a0 leaq 0x9e5(%rip), %rax # 0x2051 movq %rax, 0x68(%rsp) movl $0x2, %edi movl $0x1, %esi xorl %edx, %edx callq 0x1060 movl %eax, 0x1084(%rsp) movl 0x1084(%rsp), %edi leaq 0x1074(%rsp), %rsi movl $0x10, %edx callq 0x10b0 cmpl $0x0, %eax jne 0x17c1 movl 0x1084(%rsp), %edi callq 0x12a0 movq 0x291a(%rip), %rdi # 0x3fd8 leaq 0xa03(%rip), %rsi # 0x20c8 callq 0x10e0 movq %rax, %rdi movq 0x28f4(%rip), %rsi # 0x3fc8 callq 0x10f0 movl 0x1084(%rsp), %eax movl %eax, 0xc(%rsp) movq 0x68(%rsp), %rax movq %rax, 0x10(%rsp) movq 0x68(%rsp), %rdi callq 0x1080 movl 0xc(%rsp), %edi movq 0x10(%rsp), %rsi movq %rax, %rdx callq 0x1070 movq %rax, 0x50(%rsp) movq 0x28c3(%rip), %rdi # 0x3fd8 leaq 0x8fe(%rip), %rsi # 0x201a callq 0x10e0 movq %rax, 0x18(%rsp) movq 0x68(%rsp), %rdi callq 0x1080 movq 0x18(%rsp), %rdi movq %rax, %rsi callq 0x1050 movq %rax, %rdi movq 0x2881(%rip), %rsi # 0x3fc8 callq 0x10f0 movl $0x1, %edi callq 0x10a0 movl 0x1084(%rsp), %edi leaq 0x70(%rsp), %rsi movl $0x1000, %edx # imm = 0x1000 callq 0x1100 movq %rax, 0x50(%rsp) movq 0x2860(%rip), %rdi # 0x3fd8 leaq 0x8a8(%rip), %rsi # 0x2027 callq 0x10e0 movq %rax, %rdi movq 0x50(%rsp), %rsi callq 0x1130 movq %rax, %rdi movq 0x282d(%rip), %rsi # 0x3fc8 callq 0x10f0 leaq 0x70(%rsp), %rsi leaq 0x87e(%rip), %rdi # 0x202a movb $0x0, %al callq 0x1030 movl 0x1084(%rsp), %edi callq 0x1150 jmp 0x17cd leaq 0x90b(%rip), %rdi # 0x20d3 callq 0x10c0 xorl %eax, %eax addq $0x1098, %rsp # imm = 0x1098 retq
/ruanyvan[P]WebServer/WebServer/tests/HTTPClient.cpp
main
int main() { std::pair<int, int> p[10000]; int n; std::cin >> n; int sum = 0; for (int i = 0; i < n; ++i) { std::cin >> p[i].second; sum += p[i].second; p[i].first = i + 1; } sort(p, p + n, comp); while (sum--) { std::cout << p[0].first << " "; p[0].second--; if (p[1].second != 0) { std::cout << p[1].first << " "; p[1].second--; } int j = 1, k = 2; while (p[j].second < p[k].second) { int t = p[j].second; p[j].second = p[k].second; p[k].second = t; t = p[j].first; p[j].first = p[k].first; p[k].first = t; k++; j++; if (k == n) { break; } } j = 0, k = 1; while (p[j].second < p[k].second) { int t = p[j].second; p[j].second = p[k].second; p[k].second = t; t = p[j].first; p[j].first = p[k].first; p[k].first = t; k++; j++; if (k == n) { break; } } if (p[0].second <= 0) { return 0; } } return 0; }
pushq %rbp movq %rsp, %rbp subq $0x138d0, %rsp # imm = 0x138D0 movl $0x0, -0x4(%rbp) leaq -0x13890(%rbp), %rax movq %rax, %rcx addq $0x13880, %rcx # imm = 0x13880 movq %rcx, -0x138c0(%rbp) movq %rax, -0x138b8(%rbp) movq -0x138b8(%rbp), %rdi movq %rdi, -0x138c8(%rbp) callq 0x15a0 movq -0x138c8(%rbp), %rax movq -0x138c0(%rbp), %rcx addq $0x8, %rax cmpq %rcx, %rax movq %rax, -0x138b8(%rbp) jne 0x1211 movq 0x3d97(%rip), %rdi # 0x4fe0 leaq -0x13894(%rbp), %rsi callq 0x1030 movl $0x0, -0x13898(%rbp) movl $0x0, -0x1389c(%rbp) movl -0x1389c(%rbp), %eax cmpl -0x13894(%rbp), %eax jge 0x12de movslq -0x1389c(%rbp), %rax leaq -0x13890(%rbp), %rsi shlq $0x3, %rax addq %rax, %rsi addq $0x4, %rsi movq 0x3d49(%rip), %rdi # 0x4fe0 callq 0x1030 movslq -0x1389c(%rbp), %rax movl -0x1388c(%rbp,%rax,8), %eax addl -0x13898(%rbp), %eax movl %eax, -0x13898(%rbp) movl -0x1389c(%rbp), %ecx addl $0x1, %ecx movslq -0x1389c(%rbp), %rax movl %ecx, -0x13890(%rbp,%rax,8) movl -0x1389c(%rbp), %eax addl $0x1, %eax movl %eax, -0x1389c(%rbp) jmp 0x1269 leaq -0x13890(%rbp), %rdi leaq -0x13890(%rbp), %rsi movslq -0x13894(%rbp), %rax shlq $0x3, %rax addq %rax, %rsi leaq -0x141(%rip), %rdx # 0x11c0 callq 0x15c0 movl -0x13898(%rbp), %eax movl %eax, %ecx addl $-0x1, %ecx movl %ecx, -0x13898(%rbp) cmpl $0x0, %eax je 0x1582 movl -0x13890(%rbp), %esi movq 0x3ca3(%rip), %rdi # 0x4fd0 callq 0x1070 movq %rax, %rdi leaq 0x1cc8(%rip), %rsi # 0x3004 callq 0x1050 movl -0x1388c(%rbp), %eax addl $-0x1, %eax movl %eax, -0x1388c(%rbp) cmpl $0x0, -0x13884(%rbp) je 0x1389 movl -0x13888(%rbp), %esi movq 0x3c6a(%rip), %rdi # 0x4fd0 callq 0x1070 movq %rax, %rdi leaq 0x1c8f(%rip), %rsi # 0x3004 callq 0x1050 movl -0x13884(%rbp), %eax addl $-0x1, %eax movl %eax, -0x13884(%rbp) movl $0x1, -0x138a0(%rbp) movl $0x2, -0x138a4(%rbp) movslq -0x138a0(%rbp), %rax movl -0x1388c(%rbp,%rax,8), %eax movslq -0x138a4(%rbp), %rcx cmpl -0x1388c(%rbp,%rcx,8), %eax jge 0x147a movslq -0x138a0(%rbp), %rax movl -0x1388c(%rbp,%rax,8), %eax movl %eax, -0x138a8(%rbp) movslq -0x138a4(%rbp), %rax movl -0x1388c(%rbp,%rax,8), %ecx movslq -0x138a0(%rbp), %rax movl %ecx, -0x1388c(%rbp,%rax,8) movl -0x138a8(%rbp), %ecx movslq -0x138a4(%rbp), %rax movl %ecx, -0x1388c(%rbp,%rax,8) movslq -0x138a0(%rbp), %rax movl -0x13890(%rbp,%rax,8), %eax movl %eax, -0x138a8(%rbp) movslq -0x138a4(%rbp), %rax movl -0x13890(%rbp,%rax,8), %ecx movslq -0x138a0(%rbp), %rax movl %ecx, -0x13890(%rbp,%rax,8) movl -0x138a8(%rbp), %ecx movslq -0x138a4(%rbp), %rax movl %ecx, -0x13890(%rbp,%rax,8) movl -0x138a4(%rbp), %eax addl $0x1, %eax movl %eax, -0x138a4(%rbp) movl -0x138a0(%rbp), %eax addl $0x1, %eax movl %eax, -0x138a0(%rbp) movl -0x138a4(%rbp), %eax cmpl -0x13894(%rbp), %eax jne 0x1475 jmp 0x147a jmp 0x139d movl $0x0, -0x138a0(%rbp) movl $0x1, -0x138a4(%rbp) movslq -0x138a0(%rbp), %rax movl -0x1388c(%rbp,%rax,8), %eax movslq -0x138a4(%rbp), %rcx cmpl -0x1388c(%rbp,%rcx,8), %eax jge 0x156b movslq -0x138a0(%rbp), %rax movl -0x1388c(%rbp,%rax,8), %eax movl %eax, -0x138ac(%rbp) movslq -0x138a4(%rbp), %rax movl -0x1388c(%rbp,%rax,8), %ecx movslq -0x138a0(%rbp), %rax movl %ecx, -0x1388c(%rbp,%rax,8) movl -0x138ac(%rbp), %ecx movslq -0x138a4(%rbp), %rax movl %ecx, -0x1388c(%rbp,%rax,8) movslq -0x138a0(%rbp), %rax movl -0x13890(%rbp,%rax,8), %eax movl %eax, -0x138ac(%rbp) movslq -0x138a4(%rbp), %rax movl -0x13890(%rbp,%rax,8), %ecx movslq -0x138a0(%rbp), %rax movl %ecx, -0x13890(%rbp,%rax,8) movl -0x138ac(%rbp), %ecx movslq -0x138a4(%rbp), %rax movl %ecx, -0x13890(%rbp,%rax,8) movl -0x138a4(%rbp), %eax addl $0x1, %eax movl %eax, -0x138a4(%rbp) movl -0x138a0(%rbp), %eax addl $0x1, %eax movl %eax, -0x138a0(%rbp) movl -0x138a4(%rbp), %eax cmpl -0x13894(%rbp), %eax jne 0x1566 jmp 0x156b jmp 0x148e cmpl $0x0, -0x1388c(%rbp) jg 0x157d movl $0x0, -0x4(%rbp) jmp 0x1589 jmp 0x1306 movl $0x0, -0x4(%rbp) movl -0x4(%rbp), %eax addq $0x138d0, %rsp # imm = 0x138D0 popq %rbp retq nopw %cs:(%rax,%rax) nop
/KaluginaMarina[P]algorithms_and_data_structures/1604.cpp
(anonymous namespace)::QSBROOMTest_Resume_Test::QSBROOMTest_Resume_Test()
UNODB_TEST_F(QSBROOMTest, Resume) { qsbr_pause(); UNODB_ASSERT_EQ(get_qsbr_thread_count(), 0); oom_test( 3, [] { unodb::this_thread().qsbr_resume(); }, []() noexcept { UNODB_ASSERT_EQ(get_qsbr_thread_count(), 0); }); UNODB_ASSERT_EQ(get_qsbr_thread_count(), 1); }
pushq %rbp movq %rsp, %rbp subq $0x10, %rsp movq %rdi, -0x8(%rbp) movq -0x8(%rbp), %rdi movq %rdi, -0x10(%rbp) callq 0x287b0 movq -0x10(%rbp), %rax leaq 0xb06dc(%rip), %rcx # 0xbd7b0 addq $0x10, %rcx movq %rcx, (%rax) addq $0x10, %rsp popq %rbp retq nopw %cs:(%rax,%rax)
/laurynas-biveinis[P]unodb/test/test_qsbr_oom.cpp
std::thread unodb::qsbr_thread::make_qsbr_thread<(anonymous namespace)::QSBROOMTest_StartThread_Test::TestBody()::$_0::operator()() const::'lambda'()>((anonymous namespace)::QSBROOMTest_StartThread_Test::TestBody()::$_0::operator()() const::'lambda'()&&)
[[nodiscard]] static std::thread make_qsbr_thread(Function &&f, Args &&...args) { auto new_qsbr_per_thread = std::make_unique<qsbr_per_thread>(); return std::thread{ [inner_new_qsbr_per_thread = std::move(new_qsbr_per_thread)]( auto &&f2, auto &&...args2) mutable noexcept(noexcept(f2)) { qsbr_per_thread::set_instance(std::move(inner_new_qsbr_per_thread)); f2(std::forward<Args>(args2)...); }, std::forward<Function>(f), std::forward<Args>(args)...}; }
pushq %rbp movq %rsp, %rbp subq $0x50, %rsp movq %rdi, -0x40(%rbp) movq %rdi, %rax movq %rax, -0x50(%rbp) movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) leaq -0x18(%rbp), %rdi movq %rdi, -0x48(%rbp) callq 0x18c90 movq -0x48(%rbp), %rsi leaq -0x20(%rbp), %rdi movq %rdi, -0x38(%rbp) callq 0x18d00 movq -0x40(%rbp), %rdi movq -0x38(%rbp), %rsi movq -0x10(%rbp), %rdx callq 0xe050 jmp 0xe00c leaq -0x20(%rbp), %rdi callq 0xe110 leaq -0x18(%rbp), %rdi callq 0x18d30 movq -0x50(%rbp), %rax addq $0x50, %rsp popq %rbp retq movq %rax, %rcx movl %edx, %eax movq %rcx, -0x28(%rbp) movl %eax, -0x2c(%rbp) leaq -0x20(%rbp), %rdi callq 0xe110 leaq -0x18(%rbp), %rdi callq 0x18d30 movq -0x28(%rbp), %rdi callq 0xbcc0 nop
/laurynas-biveinis[P]unodb/./qsbr.hpp
testing::internal::SuiteApiResolver<unodb::test::QSBRTestBase>::GetSetUpCaseOrSuite(char const*, int)
static SetUpTearDownSuiteFuncType GetSetUpCaseOrSuite(const char* filename, int line_num) { #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ SetUpTearDownSuiteFuncType test_case_fp = GetNotDefaultOrNull(&T::SetUpTestCase, &Test::SetUpTestCase); SetUpTearDownSuiteFuncType test_suite_fp = GetNotDefaultOrNull(&T::SetUpTestSuite, &Test::SetUpTestSuite); GTEST_CHECK_(!test_case_fp || !test_suite_fp) << "Test can not provide both SetUpTestSuite and SetUpTestCase, please " "make sure there is only one present at " << filename << ":" << line_num; return test_case_fp != nullptr ? test_case_fp : test_suite_fp; #else (void)(filename); (void)(line_num); return &T::SetUpTestSuite; #endif }
pushq %rbp movq %rsp, %rbp subq $0x70, %rsp movq %rdi, -0x8(%rbp) movl %esi, -0xc(%rbp) leaq 0x12eea(%rip), %rsi # 0x223a0 movq %rsi, %rdi callq 0x22370 movq %rax, -0x18(%rbp) leaq 0x12ee7(%rip), %rsi # 0x223b0 movq %rsi, %rdi callq 0x22370 movq %rax, -0x20(%rbp) movb $0x1, %al cmpq $0x0, -0x18(%rbp) movb %al, -0x35(%rbp) je 0xf4ee cmpq $0x0, -0x20(%rbp) setne %al xorb $-0x1, %al movb %al, -0x35(%rbp) movb -0x35(%rbp), %al movzbl %al, %edi andl $0x1, %edi callq 0x2be30 testb $0x1, %al jne 0xf502 jmp 0xf507 jmp 0xf5b9 leaq 0x71ba1(%rip), %rdx # 0x810af leaq -0x24(%rbp), %rdi movq %rdi, -0x48(%rbp) movl $0x3, %esi movl $0x201, %ecx # imm = 0x201 callq 0x30fb0 movq -0x48(%rbp), %rdi callq 0x223c0 movq %rax, -0x40(%rbp) jmp 0xf534 movq -0x40(%rbp), %rdi leaq 0x71c04(%rip), %rsi # 0x81143 callq 0xb680 movq %rax, -0x50(%rbp) jmp 0xf54a movq -0x50(%rbp), %rdi leaq 0x71c21(%rip), %rsi # 0x81176 callq 0xb680 movq %rax, -0x58(%rbp) jmp 0xf560 movq -0x58(%rbp), %rdi movq -0x8(%rbp), %rsi callq 0xb680 movq %rax, -0x60(%rbp) jmp 0xf573 movq -0x60(%rbp), %rdi leaq 0x71129(%rip), %rsi # 0x806a7 callq 0xb680 movq %rax, -0x68(%rbp) jmp 0xf589 movq -0x68(%rbp), %rdi movl -0xc(%rbp), %esi callq 0xbc90 jmp 0xf597 leaq -0x24(%rbp), %rdi callq 0x310f0 jmp 0xf5b9 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x30(%rbp) movl %eax, -0x34(%rbp) leaq -0x24(%rbp), %rdi callq 0x310f0 jmp 0xf5dc cmpq $0x0, -0x18(%rbp) je 0xf5ca movq -0x18(%rbp), %rax movq %rax, -0x70(%rbp) jmp 0xf5d2 movq -0x20(%rbp), %rax movq %rax, -0x70(%rbp) movq -0x70(%rbp), %rax addq $0x70, %rsp popq %rbp retq movq -0x30(%rbp), %rdi callq 0xbcc0 nopw %cs:(%rax,%rax) nop
/laurynas-biveinis[P]unodb/3rd_party/googletest/googletest/include/gtest/internal/gtest-internal.h
unodb::qsbr_per_thread::~qsbr_per_thread()
~qsbr_per_thread() noexcept { if (!is_qsbr_paused()) { #ifdef UNODB_DETAIL_WITH_STATS // TODO(laurynas): to avoid try/catch below: // - replace std::mutex with noexcept synchronization, realistically only // spinlock fits, which might not be good enough; // - replace Boost.Accumulator with own noexcept stats. try { qsbr_pause(); } // The QSBR destructor can only throw std::system_error from the stats // mutex lock. Eat this exception, and eat any other unexpected exceptions // too, except for the debug build. // LCOV_EXCL_START catch (const std::system_error &e) { std::cerr << "Failed to register QSBR stats for the quitting thread: " << e.what() << '\n'; } catch (const std::exception &e) { std::cerr << "Unknown exception in the QSBR thread destructor: " << e.what() << '\n'; UNODB_DETAIL_DEBUG_CRASH(); } catch (...) { std::cerr << "Unknown exception in the QSBR thread destructor"; UNODB_DETAIL_DEBUG_CRASH(); } #else qsbr_pause(); #endif // LCOV_EXCL_STOP } }
pushq %rbp movq %rsp, %rbp subq $0x60, %rsp movq %rdi, -0x8(%rbp) movq -0x8(%rbp), %rdi movq %rdi, -0x30(%rbp) callq 0x19760 testb $0x1, %al jne 0x19715 movq -0x30(%rbp), %rdi callq 0x100a0 jmp 0x1960c jmp 0x19687 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x10(%rbp) movl %eax, -0x14(%rbp) movl -0x14(%rbp), %eax movl %eax, -0x34(%rbp) movl $0x3, %ecx cmpl %ecx, %eax jne 0x1968c movq -0x10(%rbp), %rdi callq 0xb280 movq %rax, -0x28(%rbp) movq 0xa59b3(%rip), %rdi # 0xbeff0 leaq 0x6719a(%rip), %rsi # 0x807de callq 0xb680 movq %rax, -0x40(%rbp) jmp 0x1964f movq -0x28(%rbp), %rdi movq (%rdi), %rax movq 0x10(%rax), %rax callq *%rax movq -0x40(%rbp), %rdi movq %rax, %rsi callq 0xb680 movq %rax, -0x48(%rbp) jmp 0x1966e movq -0x48(%rbp), %rdi movl $0xa, %esi callq 0xb840 jmp 0x1967e callq 0xbbf0 jmp 0x19685 jmp 0x19687 jmp 0x19715 movl -0x34(%rbp), %eax movl $0x2, %ecx cmpl %ecx, %eax jne 0x196f2 movq -0x10(%rbp), %rdi callq 0xb280 movq %rax, -0x20(%rbp) movq 0xa5944(%rip), %rdi # 0xbeff0 leaq 0x670f9(%rip), %rsi # 0x807ac callq 0xb680 movq %rax, -0x50(%rbp) jmp 0x196be movq -0x20(%rbp), %rdi movq (%rdi), %rax movq 0x10(%rax), %rax callq *%rax movq -0x50(%rbp), %rdi movq %rax, %rsi callq 0xb680 movq %rax, -0x58(%rbp) jmp 0x196dd movq -0x58(%rbp), %rdi movl $0xa, %esi callq 0xb840 jmp 0x196ed callq 0xb3d0 movq -0x10(%rbp), %rdi callq 0xb280 movq 0xa58ee(%rip), %rdi # 0xbeff0 leaq 0x67073(%rip), %rsi # 0x8077c callq 0xb680 jmp 0x19710 callq 0xb3d0 movq -0x30(%rbp), %rdi addq $0x60, %rdi callq 0x19780 movq -0x30(%rbp), %rdi addq $0x38, %rdi callq 0x16f50 movq -0x30(%rbp), %rdi addq $0x20, %rdi callq 0x16f50 movq -0x30(%rbp), %rdi addq $0x8, %rdi callq 0x16a90 movq -0x30(%rbp), %rdi callq 0x16a90 addq $0x60, %rsp popq %rbp retq movq %rax, %rdi callq 0xf8e0
/laurynas-biveinis[P]unodb/./qsbr.hpp
testing::internal::DeathTestImpl::Abort(testing::internal::DeathTest::AbortReason)
void DeathTestImpl::Abort(AbortReason reason) { // The parent process considers the death test to be a failure if // it finds any data in our pipe. So, here we write a single flag byte // to the pipe, then exit. const char status_ch = reason == TEST_DID_NOT_DIE ? kDeathTestLived : reason == TEST_THREW_EXCEPTION ? kDeathTestThrew : kDeathTestReturned; GTEST_DEATH_TEST_CHECK_SYSCALL_(posix::Write(write_fd(), &status_ch, 1)); // We are leaking the descriptor here because on some platforms (i.e., // when built as Windows DLL), destructors of global objects will still // run after calling _Exit(). On such systems, write_fd_ will be // indirectly closed from the destructor of UnitTestImpl, causing double // close if it is also closed here. On debug configurations, double close // may assert. As there are no in-process buffers to flush here, we are // relying on the OS to close the descriptor after the process terminates // when the destructors are not run. _Exit(1); // Exits w/o any normal exit hooks (we were supposed to crash) }
pushq %rbp movq %rsp, %rbp subq $0x150, %rsp # imm = 0x150 movq %rdi, -0x8(%rbp) movl %esi, -0xc(%rbp) movq -0x8(%rbp), %rax movq %rax, -0x140(%rbp) cmpl $0x2, -0xc(%rbp) jne 0x2a1dd movb $0x4c, %al movb %al, -0x141(%rbp) jmp 0x2a20d movl -0xc(%rbp), %ecx movb $0x54, %al movb $0x52, %dl movb %dl, -0x143(%rbp) cmpl $0x1, %ecx movb %al, -0x142(%rbp) je 0x2a201 movb -0x143(%rbp), %al movb %al, -0x142(%rbp) movb -0x142(%rbp), %al movb %al, -0x141(%rbp) movb -0x141(%rbp), %al movb %al, -0xd(%rbp) jmp 0x2a218 movq -0x140(%rbp), %rdi callq 0x567f0 movl %eax, %edi leaq -0xd(%rbp), %rsi movl $0x1, %edx callq 0x567c0 movl %eax, -0x14(%rbp) xorl %eax, %eax cmpl $-0x1, -0x14(%rbp) movb %al, -0x144(%rbp) jne 0x2a256 callq 0xb070 cmpl $0x4, (%rax) sete %al movb %al, -0x144(%rbp) movb -0x144(%rbp), %al testb $0x1, %al jne 0x2a218 cmpl $-0x1, -0x14(%rbp) jne 0x2a47f leaq -0xf9(%rbp), %rdi movq %rdi, -0x150(%rbp) callq 0xbcd0 movq -0x150(%rbp), %rdx leaq 0x59923(%rip), %rsi # 0x83bae leaq -0xf8(%rbp), %rdi callq 0xf3b0 jmp 0x2a299 leaq 0x59822(%rip), %rdx # 0x83ac2 leaq -0xd8(%rbp), %rdi leaq -0xf8(%rbp), %rsi callq 0x565f0 jmp 0x2a2b5 leaq 0x59906(%rip), %rdx # 0x83bc2 leaq -0xb8(%rbp), %rdi leaq -0xd8(%rbp), %rsi callq 0x565f0 jmp 0x2a2d1 movl $0x20d, -0x134(%rbp) # imm = 0x20D leaq -0x130(%rbp), %rdi leaq -0x134(%rbp), %rsi callq 0x56710 jmp 0x2a2f0 leaq -0x98(%rbp), %rdi leaq -0xb8(%rbp), %rsi leaq -0x130(%rbp), %rdx callq 0x56640 jmp 0x2a30c leaq 0x5af05(%rip), %rdx # 0x85218 leaq -0x78(%rbp), %rdi leaq -0x98(%rbp), %rsi callq 0x565f0 jmp 0x2a325 leaq 0x598b6(%rip), %rdx # 0x83be2 leaq -0x58(%rbp), %rdi leaq -0x78(%rbp), %rsi callq 0x565f0 jmp 0x2a33b leaq 0x59a9d(%rip), %rdx # 0x83ddf leaq -0x38(%rbp), %rdi leaq -0x58(%rbp), %rsi callq 0x565f0 jmp 0x2a351 leaq -0x38(%rbp), %rdi callq 0x297b0 jmp 0x2a35c movq %rax, %rcx movl %edx, %eax movq %rcx, -0x108(%rbp) movl %eax, -0x10c(%rbp) jmp 0x2a471 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x108(%rbp) movl %eax, -0x10c(%rbp) jmp 0x2a465 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x108(%rbp) movl %eax, -0x10c(%rbp) jmp 0x2a459 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x108(%rbp) movl %eax, -0x10c(%rbp) jmp 0x2a44d movq %rax, %rcx movl %edx, %eax movq %rcx, -0x108(%rbp) movl %eax, -0x10c(%rbp) jmp 0x2a441 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x108(%rbp) movl %eax, -0x10c(%rbp) jmp 0x2a435 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x108(%rbp) movl %eax, -0x10c(%rbp) jmp 0x2a42c movq %rax, %rcx movl %edx, %eax movq %rcx, -0x108(%rbp) movl %eax, -0x10c(%rbp) jmp 0x2a423 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x108(%rbp) movl %eax, -0x10c(%rbp) leaq -0x38(%rbp), %rdi callq 0xbe38 leaq -0x58(%rbp), %rdi callq 0xbe38 leaq -0x78(%rbp), %rdi callq 0xbe38 leaq -0x98(%rbp), %rdi callq 0xbe38 leaq -0x130(%rbp), %rdi callq 0xbe38 leaq -0xb8(%rbp), %rdi callq 0xbe38 leaq -0xd8(%rbp), %rdi callq 0xbe38 leaq -0xf8(%rbp), %rdi callq 0xbe38 leaq -0xf9(%rbp), %rdi callq 0xb750 jmp 0x2a498 jmp 0x2a481 callq 0x56790 testb $0x1, %al jne 0x2a216 movl $0x1, %edi callq 0xbc30 movq -0x108(%rbp), %rdi callq 0xbcc0 nopw %cs:(%rax,%rax)
/laurynas-biveinis[P]unodb/3rd_party/googletest/googletest/src/gtest-death-test.cc
testing::internal::FormatDeathTestOutput(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
static ::std::string FormatDeathTestOutput(const ::std::string& output) { ::std::string ret; for (size_t at = 0;;) { const size_t line_end = output.find('\n', at); ret += "[ DEATH ] "; if (line_end == ::std::string::npos) { ret += output.substr(at); break; } ret += output.substr(at, line_end + 1 - at); at = line_end + 1; } return ret; }
pushq %rbp movq %rsp, %rbp subq $0x90, %rsp movq %rdi, -0x88(%rbp) movq %rdi, %rax movq %rax, -0x80(%rbp) movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movb $0x0, -0x11(%rbp) callq 0xba20 movq $0x0, -0x20(%rbp) movq -0x10(%rbp), %rdi movq -0x20(%rbp), %rdx movl $0xa, %esi callq 0xb980 movq -0x88(%rbp), %rdi movq %rax, -0x28(%rbp) leaq 0x5ab14(%rip), %rsi # 0x8569a callq 0x167f0 jmp 0x2ab8d cmpq $-0x1, -0x28(%rbp) jne 0x2abf9 movq -0x10(%rbp), %rsi movq -0x20(%rbp), %rdx leaq -0x58(%rbp), %rdi movq $-0x1, %rcx callq 0xb6e0 jmp 0x2abae movq -0x88(%rbp), %rdi leaq -0x58(%rbp), %rsi callq 0x167c0 jmp 0x2abc0 leaq -0x58(%rbp), %rdi callq 0xbe38 jmp 0x2ac59 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x30(%rbp) movl %eax, -0x34(%rbp) jmp 0x2ac7c movq %rax, %rcx movl %edx, %eax movq %rcx, -0x30(%rbp) movl %eax, -0x34(%rbp) leaq -0x58(%rbp), %rdi callq 0xbe38 jmp 0x2ac7c movq -0x10(%rbp), %rsi movq -0x20(%rbp), %rdx movq -0x28(%rbp), %rcx subq %rdx, %rcx incq %rcx leaq -0x78(%rbp), %rdi callq 0xb6e0 jmp 0x2ac16 movq -0x88(%rbp), %rdi leaq -0x78(%rbp), %rsi callq 0x167c0 jmp 0x2ac28 leaq -0x78(%rbp), %rdi callq 0xbe38 movq -0x28(%rbp), %rax addq $0x1, %rax movq %rax, -0x20(%rbp) jmp 0x2ab62 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x30(%rbp) movl %eax, -0x34(%rbp) leaq -0x78(%rbp), %rdi callq 0xbe38 jmp 0x2ac7c movb $0x1, -0x11(%rbp) testb $0x1, -0x11(%rbp) jne 0x2ac6f movq -0x88(%rbp), %rdi callq 0xbe38 movq -0x80(%rbp), %rax addq $0x90, %rsp popq %rbp retq movq -0x88(%rbp), %rdi callq 0xbe38 movq -0x30(%rbp), %rdi callq 0xbcc0 nopw %cs:(%rax,%rax)
/laurynas-biveinis[P]unodb/3rd_party/googletest/googletest/src/gtest-death-test.cc
testing::internal::DeathTestThreadWarning[abi:cxx11](unsigned long)
static std::string DeathTestThreadWarning(size_t thread_count) { Message msg; msg << "Death tests use fork(), which is unsafe particularly" << " in a threaded context. For this test, " << GTEST_NAME_ << " "; if (thread_count == 0) { msg << "couldn't detect the number of threads."; } else { msg << "detected " << thread_count << " threads."; } msg << " See " "https://github.com/google/googletest/blob/main/docs/" "advanced.md#death-tests-and-threads" << " for more explanation and suggested solutions, especially if" << " this is the last message you see before your test times out."; return msg.GetString(); }
pushq %rbp movq %rsp, %rbp subq $0x80, %rsp movq %rdi, -0x48(%rbp) movq %rdi, %rax movq %rax, -0x40(%rbp) movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) leaq -0x18(%rbp), %rdi movq %rdi, -0x38(%rbp) callq 0x37a40 movq -0x38(%rbp), %rdi leaq 0x599e0(%rip), %rsi # 0x856e6 callq 0x611d0 movq %rax, -0x30(%rbp) jmp 0x2bd11 movq -0x30(%rbp), %rdi leaq 0x599ff(%rip), %rsi # 0x8571b callq 0x61210 movq %rax, -0x50(%rbp) jmp 0x2bd27 movq -0x50(%rbp), %rdi leaq 0x58ff3(%rip), %rsi # 0x84d25 callq 0x21c70 movq %rax, -0x58(%rbp) jmp 0x2bd3d movq -0x58(%rbp), %rdi leaq 0x58960(%rip), %rsi # 0x846a8 callq 0x56890 jmp 0x2bd4f cmpq $0x0, -0x10(%rbp) jne 0x2bd84 leaq 0x599e6(%rip), %rsi # 0x85743 leaq -0x18(%rbp), %rdi callq 0x5bb70 jmp 0x2bd68 jmp 0x2bdc1 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x20(%rbp) movl %eax, -0x24(%rbp) leaq -0x18(%rbp), %rdi callq 0xfe20 jmp 0x2be24 leaq 0x599df(%rip), %rsi # 0x8576a leaq -0x18(%rbp), %rdi callq 0x580f0 movq %rax, -0x60(%rbp) jmp 0x2bd9a movq -0x60(%rbp), %rdi leaq -0x10(%rbp), %rsi callq 0x61250 movq %rax, -0x68(%rbp) jmp 0x2bdad movq -0x68(%rbp), %rdi leaq 0x599a8(%rip), %rsi # 0x85760 callq 0x580f0 jmp 0x2bdbf jmp 0x2bdc1 leaq 0x599ac(%rip), %rsi # 0x85774 leaq -0x18(%rbp), %rdi callq 0x61290 movq %rax, -0x70(%rbp) jmp 0x2bdd7 movq -0x70(%rbp), %rdi leaq 0x599ef(%rip), %rsi # 0x857d1 callq 0x612d0 movq %rax, -0x78(%rbp) jmp 0x2bded movq -0x78(%rbp), %rdi leaq 0x59a16(%rip), %rsi # 0x8580e callq 0x5bbb0 jmp 0x2bdff movq -0x48(%rbp), %rdi leaq -0x18(%rbp), %rsi callq 0x2adb0 jmp 0x2be0e leaq -0x18(%rbp), %rdi callq 0xfe20 movq -0x40(%rbp), %rax addq $0x80, %rsp popq %rbp retq movq -0x20(%rbp), %rdi callq 0xbcc0 nopl (%rax)
/laurynas-biveinis[P]unodb/3rd_party/googletest/googletest/src/gtest-death-test.cc
testing::internal::DefaultDeathTestFactory::Create(char const*, testing::Matcher<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&>, char const*, int, testing::internal::DeathTest**)
bool DefaultDeathTestFactory::Create(const char* statement, Matcher<const std::string&> matcher, const char* file, int line, DeathTest** test) { UnitTestImpl* const impl = GetUnitTestImpl(); const InternalRunDeathTestFlag* const flag = impl->internal_run_death_test_flag(); const int death_test_index = impl->current_test_info()->increment_death_test_count(); if (flag != nullptr) { if (death_test_index > flag->index()) { DeathTest::set_last_death_test_message( "Death test count (" + StreamableToString(death_test_index) + ") somehow exceeded expected maximum (" + StreamableToString(flag->index()) + ")"); return false; } if (!(flag->file() == file && flag->line() == line && flag->index() == death_test_index)) { *test = nullptr; return true; } } #ifdef GTEST_OS_WINDOWS if (GTEST_FLAG_GET(death_test_style) == "threadsafe" || GTEST_FLAG_GET(death_test_style) == "fast") { *test = new WindowsDeathTest(statement, std::move(matcher), file, line); } #elif defined(GTEST_OS_FUCHSIA) if (GTEST_FLAG_GET(death_test_style) == "threadsafe" || GTEST_FLAG_GET(death_test_style) == "fast") { *test = new FuchsiaDeathTest(statement, std::move(matcher), file, line); } #else if (GTEST_FLAG_GET(death_test_style) == "threadsafe") { *test = new ExecDeathTest(statement, std::move(matcher), file, line); } else if (GTEST_FLAG_GET(death_test_style) == "fast") { *test = new NoExecDeathTest(statement, std::move(matcher)); } #endif // GTEST_OS_WINDOWS else { // NOLINT - this is more readable than unbalanced brackets inside #if. DeathTest::set_last_death_test_message("Unknown death test style \"" + GTEST_FLAG_GET(death_test_style) + "\" encountered"); return false; }
pushq %rbp movq %rsp, %rbp subq $0x1f0, %rsp # imm = 0x1F0 movq %rdx, -0x1b0(%rbp) movq %rdi, -0x10(%rbp) movq %rsi, -0x18(%rbp) movq %rdx, -0x20(%rbp) movq %rcx, -0x28(%rbp) movl %r8d, -0x2c(%rbp) movq %r9, -0x38(%rbp) callq 0x56490 movq %rax, -0x40(%rbp) movq -0x40(%rbp), %rdi callq 0x56c90 movq %rax, -0x48(%rbp) movq -0x40(%rbp), %rdi callq 0x564b0 movq %rax, %rdi callq 0x56f10 movl %eax, -0x4c(%rbp) cmpq $0x0, -0x48(%rbp) je 0x2e160 movl -0x4c(%rbp), %eax movl %eax, -0x1b4(%rbp) movq -0x48(%rbp), %rdi callq 0x56f40 movl %eax, %ecx movl -0x1b4(%rbp), %eax cmpl %ecx, %eax jle 0x2e113 leaq -0xf0(%rbp), %rdi movq %rdi, -0x1c0(%rbp) leaq -0x4c(%rbp), %rsi callq 0x56710 movq -0x1c0(%rbp), %rdx leaq 0x55eaa(%rip), %rsi # 0x83e10 leaq -0xd0(%rbp), %rdi callq 0x56f60 jmp 0x2df74 leaq 0x55ea8(%rip), %rdx # 0x83e23 leaq -0xb0(%rbp), %rdi leaq -0xd0(%rbp), %rsi callq 0x565f0 jmp 0x2df90 movq -0x48(%rbp), %rdi callq 0x56f40 movl %eax, -0x1c4(%rbp) jmp 0x2dfa1 movl -0x1c4(%rbp), %eax movl %eax, -0x124(%rbp) leaq -0x120(%rbp), %rdi leaq -0x124(%rbp), %rsi callq 0x56710 jmp 0x2dfc2 leaq -0x90(%rbp), %rdi leaq -0xb0(%rbp), %rsi leaq -0x120(%rbp), %rdx callq 0x56640 jmp 0x2dfde leaq 0x537c1(%rip), %rdx # 0x817a6 leaq -0x70(%rbp), %rdi leaq -0x90(%rbp), %rsi callq 0x565f0 jmp 0x2dff7 leaq -0x70(%rbp), %rdi callq 0x29950 jmp 0x2e002 leaq -0x70(%rbp), %rdi callq 0xbe38 leaq -0x90(%rbp), %rdi callq 0xbe38 leaq -0x120(%rbp), %rdi callq 0xbe38 leaq -0xb0(%rbp), %rdi callq 0xbe38 leaq -0xd0(%rbp), %rdi callq 0xbe38 leaq -0xf0(%rbp), %rdi callq 0xbe38 movb $0x0, -0x1(%rbp) jmp 0x2e3e9 movq %rax, %rcx movl %edx, %eax movq %rcx, -0xf8(%rbp) movl %eax, -0xfc(%rbp) jmp 0x2e102 movq %rax, %rcx movl %edx, %eax movq %rcx, -0xf8(%rbp) movl %eax, -0xfc(%rbp) jmp 0x2e0f6 movq %rax, %rcx movl %edx, %eax movq %rcx, -0xf8(%rbp) movl %eax, -0xfc(%rbp) jmp 0x2e0ea movq %rax, %rcx movl %edx, %eax movq %rcx, -0xf8(%rbp) movl %eax, -0xfc(%rbp) jmp 0x2e0de movq %rax, %rcx movl %edx, %eax movq %rcx, -0xf8(%rbp) movl %eax, -0xfc(%rbp) jmp 0x2e0d2 movq %rax, %rcx movl %edx, %eax movq %rcx, -0xf8(%rbp) movl %eax, -0xfc(%rbp) leaq -0x70(%rbp), %rdi callq 0xbe38 leaq -0x90(%rbp), %rdi callq 0xbe38 leaq -0x120(%rbp), %rdi callq 0xbe38 leaq -0xb0(%rbp), %rdi callq 0xbe38 leaq -0xd0(%rbp), %rdi callq 0xbe38 leaq -0xf0(%rbp), %rdi callq 0xbe38 jmp 0x2e3f7 movq -0x48(%rbp), %rdi callq 0x56fb0 movq %rax, %rdi movq -0x28(%rbp), %rsi callq 0x56440 testb $0x1, %al jne 0x2e12e jmp 0x2e14a movq -0x48(%rbp), %rdi callq 0x56fc0 cmpl -0x2c(%rbp), %eax jne 0x2e14a movq -0x48(%rbp), %rdi callq 0x56f40 cmpl -0x4c(%rbp), %eax je 0x2e15e movq -0x38(%rbp), %rax movq $0x0, (%rax) movb $0x1, -0x1(%rbp) jmp 0x2e3e9 jmp 0x2e160 leaq 0x91be9(%rip), %rdi # 0xbfd50 leaq 0x5590b(%rip), %rsi # 0x83a79 callq 0x56440 testb $0x1, %al jne 0x2e17c jmp 0x2e251 movl $0x50, %edi callq 0x28680 movq -0x1b0(%rbp), %rsi movq %rax, -0x1d8(%rbp) movb $0x1, -0x141(%rbp) movq -0x18(%rbp), %rax movq %rax, -0x1d0(%rbp) leaq -0x140(%rbp), %rdi callq 0x56500 jmp 0x2e1b4 movq -0x1d0(%rbp), %rsi movq -0x1d8(%rbp), %rdi movq -0x28(%rbp), %rcx movl -0x2c(%rbp), %r8d leaq -0x140(%rbp), %rdx callq 0x56fe0 jmp 0x2e1d8 movq -0x1d8(%rbp), %rcx movb $0x0, -0x141(%rbp) movq -0x38(%rbp), %rax movq %rcx, (%rax) leaq -0x140(%rbp), %rdi callq 0x56540 jmp 0x2e3e5 movq %rax, %rcx movl %edx, %eax movq %rcx, -0xf8(%rbp) movl %eax, -0xfc(%rbp) jmp 0x2e230 movq %rax, %rcx movl %edx, %eax movq %rcx, -0xf8(%rbp) movl %eax, -0xfc(%rbp) leaq -0x140(%rbp), %rdi callq 0x56540 testb $0x1, -0x141(%rbp) jne 0x2e23b jmp 0x2e24c movq -0x1d8(%rbp), %rdi movl $0x50, %esi callq 0x28720 jmp 0x2e3f7 leaq 0x91af8(%rip), %rdi # 0xbfd50 leaq 0x55eea(%rip), %rsi # 0x84149 callq 0x56440 testb $0x1, %al jne 0x2e26d jmp 0x2e33a movl $0x40, %edi callq 0x28680 movq -0x1b0(%rbp), %rsi movq %rax, -0x1e8(%rbp) movb $0x1, -0x161(%rbp) movq -0x18(%rbp), %rax movq %rax, -0x1e0(%rbp) leaq -0x160(%rbp), %rdi callq 0x56500 jmp 0x2e2a5 movq -0x1e0(%rbp), %rsi movq -0x1e8(%rbp), %rdi leaq -0x160(%rbp), %rdx callq 0x57090 jmp 0x2e2c1 movq -0x1e8(%rbp), %rcx movb $0x0, -0x161(%rbp) movq -0x38(%rbp), %rax movq %rcx, (%rax) leaq -0x160(%rbp), %rdi callq 0x56540 jmp 0x2e3e3 movq %rax, %rcx movl %edx, %eax movq %rcx, -0xf8(%rbp) movl %eax, -0xfc(%rbp) jmp 0x2e319 movq %rax, %rcx movl %edx, %eax movq %rcx, -0xf8(%rbp) movl %eax, -0xfc(%rbp) leaq -0x160(%rbp), %rdi callq 0x56540 testb $0x1, -0x161(%rbp) jne 0x2e324 jmp 0x2e335 movq -0x1e8(%rbp), %rdi movl $0x40, %esi callq 0x28720 jmp 0x2e3f7 leaq 0x55b08(%rip), %rsi # 0x83e49 leaq 0x91a08(%rip), %rdx # 0xbfd50 leaq -0x1a8(%rbp), %rdi movq %rdi, -0x1f0(%rbp) callq 0x57120 movq -0x1f0(%rbp), %rsi leaq 0x55afb(%rip), %rdx # 0x83e64 leaq -0x188(%rbp), %rdi callq 0x565f0 jmp 0x2e377 leaq -0x188(%rbp), %rdi callq 0x29950 jmp 0x2e385 leaq -0x188(%rbp), %rdi callq 0xbe38 leaq -0x1a8(%rbp), %rdi callq 0xbe38 movb $0x0, -0x1(%rbp) jmp 0x2e3e9 movq %rax, %rcx movl %edx, %eax movq %rcx, -0xf8(%rbp) movl %eax, -0xfc(%rbp) jmp 0x2e3d5 movq %rax, %rcx movl %edx, %eax movq %rcx, -0xf8(%rbp) movl %eax, -0xfc(%rbp) leaq -0x188(%rbp), %rdi callq 0xbe38 leaq -0x1a8(%rbp), %rdi callq 0xbe38 jmp 0x2e3f7 jmp 0x2e3e5 movb $0x1, -0x1(%rbp) movb -0x1(%rbp), %al andb $0x1, %al addq $0x1f0, %rsp # imm = 0x1F0 popq %rbp retq movq -0xf8(%rbp), %rdi callq 0xbcc0 nopw %cs:(%rax,%rax)
/laurynas-biveinis[P]unodb/3rd_party/googletest/googletest/src/gtest-death-test.cc
testing::internal::FilePath::RemoveExtension(char const*) const
FilePath FilePath::RemoveExtension(const char* extension) const { const std::string dot_extension = std::string(".") + extension; if (String::EndsWithCaseInsensitive(pathname_, dot_extension)) { return FilePath( pathname_.substr(0, pathname_.length() - dot_extension.length())); } return *this; }
pushq %rbp movq %rsp, %rbp subq $0xd0, %rsp movq %rdi, -0xb8(%rbp) movq %rdi, %rax movq %rax, -0xb0(%rbp) movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movq %rdx, -0x18(%rbp) movq -0x10(%rbp), %rax movq %rax, -0xa8(%rbp) leaq -0x59(%rbp), %rdi movq %rdi, -0xa0(%rbp) callq 0xbcd0 movq -0xa0(%rbp), %rdx leaq 0x51d3d(%rip), %rsi # 0x805ee leaq -0x58(%rbp), %rdi callq 0xf3b0 jmp 0x2e8bc movq -0x18(%rbp), %rdx leaq -0x38(%rbp), %rdi leaq -0x58(%rbp), %rsi callq 0x565f0 jmp 0x2e8cf leaq -0x58(%rbp), %rdi callq 0xbe38 leaq -0x59(%rbp), %rdi callq 0xb750 movq -0xa8(%rbp), %rdi leaq -0x38(%rbp), %rsi callq 0x2ea20 movb %al, -0xb9(%rbp) jmp 0x2e8f9 movb -0xb9(%rbp), %al testb $0x1, %al jne 0x2e908 jmp 0x2e9ca movq -0xa8(%rbp), %rdi callq 0xfc30 movq %rax, -0xc8(%rbp) leaq -0x38(%rbp), %rdi callq 0xfc30 movq -0xc8(%rbp), %rcx movq -0xa8(%rbp), %rsi subq %rax, %rcx xorl %eax, %eax movl %eax, %edx leaq -0x90(%rbp), %rdi callq 0xb6e0 jmp 0x2e947 movq -0xb8(%rbp), %rdi leaq -0x90(%rbp), %rsi callq 0x57420 jmp 0x2e95c leaq -0x90(%rbp), %rdi callq 0xbe38 movl $0x1, -0x94(%rbp) jmp 0x2e9e9 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x68(%rbp) movl %eax, -0x6c(%rbp) jmp 0x2e997 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x68(%rbp) movl %eax, -0x6c(%rbp) leaq -0x58(%rbp), %rdi callq 0xbe38 leaq -0x59(%rbp), %rdi callq 0xb750 jmp 0x2ea0b movq %rax, %rcx movl %edx, %eax movq %rcx, -0x68(%rbp) movl %eax, -0x6c(%rbp) jmp 0x2ea02 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x68(%rbp) movl %eax, -0x6c(%rbp) leaq -0x90(%rbp), %rdi callq 0xbe38 jmp 0x2ea02 movq -0xa8(%rbp), %rsi movq -0xb8(%rbp), %rdi callq 0x57470 jmp 0x2e9df movl $0x1, -0x94(%rbp) leaq -0x38(%rbp), %rdi callq 0xbe38 movq -0xb0(%rbp), %rax addq $0xd0, %rsp popq %rbp retq leaq -0x38(%rbp), %rdi callq 0xbe38 movq -0x68(%rbp), %rdi callq 0xbcc0 nopw %cs:(%rax,%rax)
/laurynas-biveinis[P]unodb/3rd_party/googletest/googletest/src/gtest-filepath.cc
testing::internal::FilePath::FindLastPathSeparator() const
const char* FilePath::FindLastPathSeparator() const { const char* const last_sep = strrchr(c_str(), kPathSeparator); #if GTEST_HAS_ALT_PATH_SEP_ const char* const last_alt_sep = strrchr(c_str(), kAlternatePathSeparator); // Comparing two pointers of which only one is NULL is undefined. if (last_alt_sep != nullptr && (last_sep == nullptr || last_alt_sep > last_sep)) { return last_alt_sep; } #endif return last_sep; }
pushq %rbp movq %rsp, %rbp subq $0x10, %rsp movq %rdi, -0x8(%rbp) movq -0x8(%rbp), %rdi callq 0x574a0 movq %rax, %rdi movl $0x2f, %esi callq 0xb790 movq %rax, -0x10(%rbp) movq -0x10(%rbp), %rax addq $0x10, %rsp popq %rbp retq
/laurynas-biveinis[P]unodb/3rd_party/googletest/googletest/src/gtest-filepath.cc
testing::Matcher<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::Matcher(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
Matcher<std::string>::Matcher(const std::string& s) { *this = Eq(s); }
pushq %rbp movq %rsp, %rbp subq $0x80, %rsp movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movq -0x8(%rbp), %rdi movq %rdi, -0x80(%rbp) callq 0x57a80 movq -0x80(%rbp), %rax leaq 0x8e92d(%rip), %rcx # 0xbe488 movq %rcx, (%rax) movq -0x10(%rbp), %rsi leaq -0x68(%rbp), %rdi callq 0xb2b0 jmp 0x2fb6d leaq -0x48(%rbp), %rdi leaq -0x68(%rbp), %rsi callq 0x579c0 jmp 0x2fb7c leaq -0x28(%rbp), %rdi leaq -0x48(%rbp), %rsi callq 0x57ad0 jmp 0x2fb8b movq -0x80(%rbp), %rdi leaq -0x28(%rbp), %rsi callq 0x57b10 jmp 0x2fb9a leaq -0x28(%rbp), %rdi callq 0x57b40 leaq -0x48(%rbp), %rdi callq 0x57a60 leaq -0x68(%rbp), %rdi callq 0xbe38 addq $0x80, %rsp popq %rbp retq movq %rax, %rcx movl %edx, %eax movq %rcx, -0x70(%rbp) movl %eax, -0x74(%rbp) jmp 0x2fc0f movq %rax, %rcx movl %edx, %eax movq %rcx, -0x70(%rbp) movl %eax, -0x74(%rbp) jmp 0x2fc06 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x70(%rbp) movl %eax, -0x74(%rbp) jmp 0x2fbfd movq %rax, %rcx movl %edx, %eax movq %rcx, -0x70(%rbp) movl %eax, -0x74(%rbp) leaq -0x28(%rbp), %rdi callq 0x57b40 leaq -0x48(%rbp), %rdi callq 0x57a60 leaq -0x68(%rbp), %rdi callq 0xbe38 movq -0x80(%rbp), %rdi callq 0x6dc00 movq -0x70(%rbp), %rdi callq 0xbcc0 nopw %cs:(%rax,%rax)
/laurynas-biveinis[P]unodb/3rd_party/googletest/googletest/src/gtest-matchers.cc
testing::Matcher<std::basic_string_view<char, std::char_traits<char>>>::Matcher(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
Matcher<internal::StringView>::Matcher(const std::string& s) { *this = Eq(s); }
pushq %rbp movq %rsp, %rbp subq $0x80, %rsp movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movq -0x8(%rbp), %rdi movq %rdi, -0x80(%rbp) callq 0x57cb0 movq -0x80(%rbp), %rax leaq 0x8e3cd(%rip), %rcx # 0xbe4e8 movq %rcx, (%rax) movq -0x10(%rbp), %rsi leaq -0x68(%rbp), %rdi callq 0xb2b0 jmp 0x3012d leaq -0x48(%rbp), %rdi leaq -0x68(%rbp), %rsi callq 0x579c0 jmp 0x3013c leaq -0x28(%rbp), %rdi leaq -0x48(%rbp), %rsi callq 0x57d00 jmp 0x3014b movq -0x80(%rbp), %rdi leaq -0x28(%rbp), %rsi callq 0x57d40 jmp 0x3015a leaq -0x28(%rbp), %rdi callq 0x57d70 leaq -0x48(%rbp), %rdi callq 0x57a60 leaq -0x68(%rbp), %rdi callq 0xbe38 addq $0x80, %rsp popq %rbp retq movq %rax, %rcx movl %edx, %eax movq %rcx, -0x70(%rbp) movl %eax, -0x74(%rbp) jmp 0x301cf movq %rax, %rcx movl %edx, %eax movq %rcx, -0x70(%rbp) movl %eax, -0x74(%rbp) jmp 0x301c6 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x70(%rbp) movl %eax, -0x74(%rbp) jmp 0x301bd movq %rax, %rcx movl %edx, %eax movq %rcx, -0x70(%rbp) movl %eax, -0x74(%rbp) leaq -0x28(%rbp), %rdi callq 0x57d70 leaq -0x48(%rbp), %rdi callq 0x57a60 leaq -0x68(%rbp), %rdi callq 0xbe38 movq -0x80(%rbp), %rdi callq 0x6dce0 movq -0x70(%rbp), %rdi callq 0xbcc0 nopw %cs:(%rax,%rax)
/laurynas-biveinis[P]unodb/3rd_party/googletest/googletest/src/gtest-matchers.cc
testing::internal::RE::Init(char const*)
void RE::Init(const char* regex) { pattern_ = regex; // NetBSD (and Android, which takes its regex implemntation from NetBSD) does // not include the GNU regex extensions (such as Perl style character classes // like \w) in REG_EXTENDED. REG_EXTENDED is only specified to include the // [[:alpha:]] style character classes. Enable REG_GNU wherever it is defined // so users can use those extensions. #if defined(REG_GNU) constexpr int reg_flags = REG_EXTENDED | REG_GNU; #else constexpr int reg_flags = REG_EXTENDED; #endif // Reserves enough bytes to hold the regular expression used for a // full match. const size_t full_regex_len = strlen(regex) + 10; char* const full_pattern = new char[full_regex_len]; snprintf(full_pattern, full_regex_len, "^(%s)$", regex); is_valid_ = regcomp(&full_regex_, full_pattern, reg_flags) == 0; // We want to call regcomp(&partial_regex_, ...) even if the // previous expression returns false. Otherwise partial_regex_ may // not be properly initialized can may cause trouble when it's // freed. // // Some implementation of POSIX regex (e.g. on at least some // versions of Cygwin) doesn't accept the empty string as a valid // regex. We change it to an equivalent form "()" to be safe. if (is_valid_) { const char* const partial_regex = (*regex == '\0') ? "()" : regex; is_valid_ = regcomp(&partial_regex_, partial_regex, reg_flags) == 0; } EXPECT_TRUE(is_valid_) << "Regular expression \"" << regex << "\" is not a valid POSIX Extended regular expression."; delete[] full_pattern; }
pushq %rbp movq %rsp, %rbp subq $0xc0, %rsp movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movq -0x8(%rbp), %rdi movq %rdi, -0x88(%rbp) movq -0x10(%rbp), %rsi callq 0x16640 movl $0x1, -0x14(%rbp) movq -0x10(%rbp), %rdi callq 0xb2c0 addq $0xa, %rax movq %rax, -0x20(%rbp) movq -0x20(%rbp), %rdi callq 0xb040 movq %rax, -0x28(%rbp) movq -0x28(%rbp), %rdi movq -0x20(%rbp), %rsi movq -0x10(%rbp), %rcx leaq 0x537bb(%rip), %rdx # 0x83eaa movb $0x0, %al callq 0xbbc0 movq -0x88(%rbp), %rdi addq $0x28, %rdi movq -0x28(%rbp), %rsi movl $0x1, %edx callq 0xb800 movl %eax, %ecx movq -0x88(%rbp), %rax cmpl $0x0, %ecx sete %cl andb $0x1, %cl movb %cl, 0x20(%rax) testb $0x1, 0x20(%rax) je 0x3078a movq -0x10(%rbp), %rax movsbl (%rax), %eax cmpl $0x0, %eax jne 0x30746 leaq 0x4fa6b(%rip), %rax # 0x801a8 movq %rax, -0x90(%rbp) jmp 0x30751 movq -0x10(%rbp), %rax movq %rax, -0x90(%rbp) movq -0x88(%rbp), %rdi movq -0x90(%rbp), %rax movq %rax, -0x30(%rbp) addq $0x68, %rdi movq -0x30(%rbp), %rsi movl $0x1, %edx callq 0xb800 movl %eax, %ecx movq -0x88(%rbp), %rax cmpl $0x0, %ecx sete %cl andb $0x1, %cl movb %cl, 0x20(%rax) movq -0x88(%rbp), %rsi addq $0x20, %rsi xorl %eax, %eax movl %eax, %edx leaq -0x40(%rbp), %rdi movq %rdi, -0xa0(%rbp) callq 0x1ab60 movq -0xa0(%rbp), %rdi callq 0xfde0 movb %al, -0x91(%rbp) jmp 0x307bd movb -0x91(%rbp), %al testb $0x1, %al jne 0x307c9 jmp 0x307df jmp 0x308f8 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x48(%rbp) movl %eax, -0x4c(%rbp) jmp 0x30927 leaq -0x58(%rbp), %rdi callq 0x37a40 jmp 0x307ea leaq 0x536c0(%rip), %rsi # 0x83eb1 leaq -0x58(%rbp), %rdi callq 0x57e50 movq %rax, -0xa8(%rbp) jmp 0x30803 movq -0xa8(%rbp), %rdi leaq -0x10(%rbp), %rsi callq 0x21fe0 movq %rax, -0xb0(%rbp) jmp 0x3081c movq -0xb0(%rbp), %rdi leaq 0x5369c(%rip), %rsi # 0x83ec6 callq 0x57e90 movq %rax, -0xb8(%rbp) jmp 0x30838 leaq 0x53739(%rip), %rdx # 0x83f78 leaq 0x50184(%rip), %rcx # 0x809ca leaq 0x50183(%rip), %r8 # 0x809d0 leaq -0x80(%rbp), %rdi leaq -0x40(%rbp), %rsi callq 0x30940 jmp 0x3085c leaq -0x80(%rbp), %rdi callq 0x16110 movq %rax, %r8 leaq 0x5368b(%rip), %rdx # 0x83efa leaq -0x60(%rbp), %rdi movl $0x1, %esi movl $0x2e9, %ecx # imm = 0x2E9 callq 0x33cb0 jmp 0x30884 movq -0xb8(%rbp), %rsi leaq -0x60(%rbp), %rdi callq 0x30aa0 jmp 0x30896 leaq -0x60(%rbp), %rdi callq 0x33d30 leaq -0x80(%rbp), %rdi callq 0xbe38 leaq -0x58(%rbp), %rdi callq 0xfe20 jmp 0x308f8 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x48(%rbp) movl %eax, -0x4c(%rbp) jmp 0x308ed movq %rax, %rcx movl %edx, %eax movq %rcx, -0x48(%rbp) movl %eax, -0x4c(%rbp) jmp 0x308e4 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x48(%rbp) movl %eax, -0x4c(%rbp) leaq -0x60(%rbp), %rdi callq 0x33d30 leaq -0x80(%rbp), %rdi callq 0xbe38 leaq -0x58(%rbp), %rdi callq 0xfe20 jmp 0x30927 leaq -0x40(%rbp), %rdi callq 0xfe40 movq -0x28(%rbp), %rax movq %rax, -0xc0(%rbp) cmpq $0x0, %rax je 0x3091e movq -0xc0(%rbp), %rdi callq 0xb960 addq $0xc0, %rsp popq %rbp retq leaq -0x40(%rbp), %rdi callq 0xfe40 movq -0x48(%rbp), %rdi callq 0xbcc0 nopl (%rax)
/laurynas-biveinis[P]unodb/3rd_party/googletest/googletest/src/gtest-port.cc
testing::internal::FormatCompilerIndependentFileLocation[abi:cxx11](char const*, int)
GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file, int line) { const std::string file_name(file == nullptr ? kUnknownFile : file); if (line < 0) return file_name; else return file_name + ":" + StreamableToString(line); }
pushq %rbp movq %rsp, %rbp subq $0xc0, %rsp movq %rdi, -0xa0(%rbp) movq %rdi, %rax movq %rax, -0x98(%rbp) movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movl %edx, -0x14(%rbp) cmpq $0x0, -0x10(%rbp) jne 0x30e4e leaq 0x51b4b(%rip), %rax # 0x82990 movq %rax, -0xa8(%rbp) jmp 0x30e59 movq -0x10(%rbp), %rax movq %rax, -0xa8(%rbp) movq -0xa8(%rbp), %rax movq %rax, -0xb8(%rbp) leaq -0x39(%rbp), %rdi movq %rdi, -0xb0(%rbp) callq 0xbcd0 movq -0xb8(%rbp), %rsi movq -0xb0(%rbp), %rdx leaq -0x38(%rbp), %rdi callq 0xf3b0 jmp 0x30e90 leaq -0x39(%rbp), %rdi callq 0xb750 cmpl $0x0, -0x14(%rbp) jge 0x30ee8 movq -0xa0(%rbp), %rdi leaq -0x38(%rbp), %rsi callq 0xb2b0 jmp 0x30eb1 movl $0x1, -0x50(%rbp) jmp 0x30f78 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x48(%rbp) movl %eax, -0x4c(%rbp) leaq -0x39(%rbp), %rdi callq 0xb750 jmp 0x30f9a movq %rax, %rcx movl %edx, %eax movq %rcx, -0x48(%rbp) movl %eax, -0x4c(%rbp) jmp 0x30f91 leaq 0x4f7b8(%rip), %rdx # 0x806a7 leaq -0x70(%rbp), %rdi leaq -0x38(%rbp), %rsi callq 0x57580 jmp 0x30efe leaq -0x90(%rbp), %rdi leaq -0x14(%rbp), %rsi callq 0x56710 jmp 0x30f10 movq -0xa0(%rbp), %rdi leaq -0x70(%rbp), %rsi leaq -0x90(%rbp), %rdx callq 0x56640 jmp 0x30f29 leaq -0x90(%rbp), %rdi callq 0xbe38 leaq -0x70(%rbp), %rdi callq 0xbe38 movl $0x1, -0x50(%rbp) jmp 0x30f78 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x48(%rbp) movl %eax, -0x4c(%rbp) jmp 0x30f6d movq %rax, %rcx movl %edx, %eax movq %rcx, -0x48(%rbp) movl %eax, -0x4c(%rbp) leaq -0x90(%rbp), %rdi callq 0xbe38 leaq -0x70(%rbp), %rdi callq 0xbe38 jmp 0x30f91 leaq -0x38(%rbp), %rdi callq 0xbe38 movq -0x98(%rbp), %rax addq $0xc0, %rsp popq %rbp retq leaq -0x38(%rbp), %rdi callq 0xbe38 movq -0x48(%rbp), %rdi callq 0xbcc0 nopw %cs:(%rax,%rax)
/laurynas-biveinis[P]unodb/3rd_party/googletest/googletest/src/gtest-port.cc
testing::internal::GTestLog::~GTestLog()
GTestLog::~GTestLog() { GetStream() << ::std::endl; if (severity_ == GTEST_FATAL) { fflush(stderr); posix::Abort(); } }
pushq %rbp movq %rsp, %rbp subq $0x20, %rsp movq %rdi, -0x8(%rbp) movq -0x8(%rbp), %rdi movq %rdi, -0x18(%rbp) callq 0x223c0 movq %rax, -0x10(%rbp) jmp 0x3110f movq -0x10(%rbp), %rdi movq 0x8de6e(%rip), %rsi # 0xbef88 callq 0xb700 jmp 0x31121 movq -0x18(%rbp), %rax cmpl $0x3, (%rax) jne 0x31142 movq 0x8de9f(%rip), %rax # 0xbefd0 movq (%rax), %rdi callq 0xb860 jmp 0x3113b callq 0x57ed0 jmp 0x31142 addq $0x20, %rsp popq %rbp retq movq %rax, %rdi callq 0xf8e0
/laurynas-biveinis[P]unodb/3rd_party/googletest/googletest/src/gtest-port.cc
testing::internal::ParseInt32(testing::Message const&, char const*, int*)
bool ParseInt32(const Message& src_text, const char* str, int32_t* value) { // Parses the environment variable as a decimal integer. char* end = nullptr; const long long_value = strtol(str, &end, 10); // NOLINT // Has strtol() consumed all characters in the string? if (*end != '\0') { // No - an invalid character was encountered. Message msg; msg << "WARNING: " << src_text << " is expected to be a 32-bit integer, but actually" << " has value \"" << str << "\".\n"; printf("%s", msg.GetString().c_str()); fflush(stdout); return false; } // Is the parsed value in the range of an int32_t? const auto result = static_cast<int32_t>(long_value); if (long_value == LONG_MAX || long_value == LONG_MIN || // The parsed value overflows as a long. (strtol() returns // LONG_MAX or LONG_MIN when the input overflows.) result != long_value // The parsed value overflows as an int32_t. ) { Message msg; msg << "WARNING: " << src_text << " is expected to be a 32-bit integer, but actually" << " has value " << str << ", which overflows.\n"; printf("%s", msg.GetString().c_str()); fflush(stdout); return false; } *value = result; return true; }
pushq %rbp movq %rsp, %rbp subq $0x100, %rsp # imm = 0x100 movq %rdi, -0x10(%rbp) movq %rsi, -0x18(%rbp) movq %rdx, -0x20(%rbp) movq $0x0, -0x28(%rbp) movq -0x18(%rbp), %rdi leaq -0x28(%rbp), %rsi movl $0xa, %edx callq 0xba60 movq %rax, -0x30(%rbp) movq -0x28(%rbp), %rax movsbl (%rax), %eax cmpl $0x0, %eax je 0x317f8 leaq -0x38(%rbp), %rdi movq %rdi, -0xa8(%rbp) callq 0x37a40 movq -0xa8(%rbp), %rdi leaq 0x528d5(%rip), %rsi # 0x83fb8 callq 0x580f0 movq %rax, -0xa0(%rbp) jmp 0x316f1 movq -0xa0(%rbp), %rdi movq -0x10(%rbp), %rsi callq 0x58130 movq %rax, -0xb0(%rbp) jmp 0x3170a movq -0xb0(%rbp), %rdi leaq 0x528aa(%rip), %rsi # 0x83fc2 callq 0x58170 movq %rax, -0xb8(%rbp) jmp 0x31726 movq -0xb8(%rbp), %rdi leaq 0x528c0(%rip), %rsi # 0x83ff4 callq 0x56830 movq %rax, -0xc0(%rbp) jmp 0x31742 movq -0xc0(%rbp), %rdi leaq -0x18(%rbp), %rsi callq 0x21fe0 movq %rax, -0xc8(%rbp) jmp 0x3175b movq -0xc8(%rbp), %rdi leaq 0x52898(%rip), %rsi # 0x84001 callq 0x581b0 jmp 0x31770 leaq -0x68(%rbp), %rdi leaq -0x38(%rbp), %rsi callq 0x2adb0 jmp 0x3177f leaq -0x68(%rbp), %rdi callq 0x16110 movq %rax, %rsi leaq 0x53e9c(%rip), %rdi # 0x8562e xorl %eax, %eax callq 0xb080 jmp 0x3179b leaq -0x68(%rbp), %rdi callq 0xbe38 movq 0x8d7c5(%rip), %rax # 0xbef70 movq (%rax), %rdi callq 0xb860 jmp 0x317b5 movb $0x0, -0x1(%rbp) leaq -0x38(%rbp), %rdi callq 0xfe20 jmp 0x31973 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) jmp 0x317ea movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) leaq -0x68(%rbp), %rdi callq 0xbe38 leaq -0x38(%rbp), %rdi callq 0xfe20 jmp 0x31981 movq -0x30(%rbp), %rax movl %eax, -0x6c(%rbp) movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF cmpq %rax, -0x30(%rbp) je 0x3182d movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000 cmpq %rax, -0x30(%rbp) je 0x3182d movslq -0x6c(%rbp), %rax cmpq -0x30(%rbp), %rax je 0x31966 leaq -0x78(%rbp), %rdi movq %rdi, -0xd8(%rbp) callq 0x37a40 movq -0xd8(%rbp), %rdi leaq 0x5276d(%rip), %rsi # 0x83fb8 callq 0x580f0 movq %rax, -0xd0(%rbp) jmp 0x31859 movq -0xd0(%rbp), %rdi movq -0x10(%rbp), %rsi callq 0x58130 movq %rax, -0xe0(%rbp) jmp 0x31872 movq -0xe0(%rbp), %rdi leaq 0x52742(%rip), %rsi # 0x83fc2 callq 0x58170 movq %rax, -0xe8(%rbp) jmp 0x3188e movq -0xe8(%rbp), %rdi leaq 0x52769(%rip), %rsi # 0x84005 callq 0x21c70 movq %rax, -0xf0(%rbp) jmp 0x318aa movq -0xf0(%rbp), %rdi leaq -0x18(%rbp), %rsi callq 0x21fe0 movq %rax, -0xf8(%rbp) jmp 0x318c3 movq -0xf8(%rbp), %rdi leaq 0x52740(%rip), %rsi # 0x84011 callq 0x581f0 jmp 0x318d8 leaq -0x98(%rbp), %rdi leaq -0x78(%rbp), %rsi callq 0x2adb0 jmp 0x318ea leaq -0x98(%rbp), %rdi callq 0x16110 movq %rax, %rsi leaq 0x53d2e(%rip), %rdi # 0x8562e xorl %eax, %eax callq 0xb080 jmp 0x31909 leaq -0x98(%rbp), %rdi callq 0xbe38 movq 0x8d654(%rip), %rax # 0xbef70 movq (%rax), %rdi callq 0xb860 jmp 0x31926 movb $0x0, -0x1(%rbp) leaq -0x78(%rbp), %rdi callq 0xfe20 jmp 0x31973 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) jmp 0x3195b movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) leaq -0x98(%rbp), %rdi callq 0xbe38 leaq -0x78(%rbp), %rdi callq 0xfe20 jmp 0x31981 movl -0x6c(%rbp), %ecx movq -0x20(%rbp), %rax movl %ecx, (%rax) movb $0x1, -0x1(%rbp) movb -0x1(%rbp), %al andb $0x1, %al addq $0x100, %rsp # imm = 0x100 popq %rbp retq movq -0x40(%rbp), %rdi callq 0xbcc0 nopw (%rax,%rax)
/laurynas-biveinis[P]unodb/3rd_party/googletest/googletest/src/gtest-port.cc
testing::internal::HasNewFatalFailureHelper::HasNewFatalFailureHelper()
HasNewFatalFailureHelper::HasNewFatalFailureHelper() : has_new_fatal_failure_(false), original_reporter_( GetUnitTestImpl()->GetTestPartResultReporterForCurrentThread()) { GetUnitTestImpl()->SetTestPartResultReporterForCurrentThread(this); }
pushq %rbp movq %rsp, %rbp subq $0x40, %rsp movq %rdi, -0x8(%rbp) movq -0x8(%rbp), %rdi movq %rdi, -0x30(%rbp) callq 0x588f0 movq -0x30(%rbp), %rax leaq 0x8a9b4(%rip), %rcx # 0xbdb18 movq %rcx, (%rax) movb $0x0, 0x8(%rax) addq $0x10, %rax movq %rax, -0x28(%rbp) callq 0x56490 movq %rax, -0x20(%rbp) jmp 0x3317e movq -0x20(%rbp), %rdi callq 0x331e0 movq %rax, -0x38(%rbp) jmp 0x3318d movq -0x28(%rbp), %rax movq -0x38(%rbp), %rcx movq %rcx, (%rax) callq 0x56490 movq %rax, -0x40(%rbp) jmp 0x331a3 movq -0x30(%rbp), %rsi movq -0x40(%rbp), %rdi callq 0x33210 jmp 0x331b2 addq $0x40, %rsp popq %rbp retq movq -0x30(%rbp), %rdi movq %rax, %rcx movl %edx, %eax movq %rcx, -0x10(%rbp) movl %eax, -0x14(%rbp) callq 0x62a50 movq -0x10(%rbp), %rdi callq 0xbcc0 nopw %cs:(%rax,%rax)
/laurynas-biveinis[P]unodb/3rd_party/googletest/googletest/src/gtest-test-part.cc
testing::UnitTest::GetInstance()
UnitTest* UnitTest::GetInstance() { // CodeGear C++Builder insists on a public destructor for the // default implementation. Use this implementation to keep good OO // design with private destructor. #if defined(__BORLANDC__) static UnitTest* const instance = new UnitTest; return instance; #else static UnitTest instance; return &instance; #endif // defined(__BORLANDC__) }
pushq %rbp movq %rsp, %rbp subq $0x10, %rsp cmpb $0x0, 0x8c191(%rip) # 0xbff10 jne 0x33dc6 leaq 0x8c188(%rip), %rdi # 0xbff10 callq 0xbd20 cmpl $0x0, %eax je 0x33dc6 leaq 0x8c12f(%rip), %rdi # 0xbfec8 callq 0x4e670 jmp 0x33da0 leaq 0x1a969(%rip), %rdi # 0x4e710 leaq 0x8c11a(%rip), %rsi # 0xbfec8 leaq 0x8b96b(%rip), %rdx # 0xbf720 callq 0xb5d0 leaq 0x8c14f(%rip), %rdi # 0xbff10 callq 0xb460 leaq 0x8c0fb(%rip), %rax # 0xbfec8 addq $0x10, %rsp popq %rbp retq movq %rax, %rcx movl %edx, %eax movq %rcx, -0x8(%rbp) movl %eax, -0xc(%rbp) leaq 0x8c12a(%rip), %rdi # 0xbff10 callq 0xb450 movq -0x8(%rbp), %rdi callq 0xbcc0 nopw %cs:(%rax,%rax)
/laurynas-biveinis[P]unodb/3rd_party/googletest/googletest/src/gtest.cc
testing::internal::AppendUserMessage(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, testing::Message const&)
std::string AppendUserMessage(const std::string& gtest_msg, const Message& user_msg) { // Appends the user message if it's non-empty. const std::string user_msg_string = user_msg.GetString(); if (user_msg_string.empty()) { return gtest_msg; } if (gtest_msg.empty()) { return user_msg_string; } return gtest_msg + "\n" + user_msg_string; }
pushq %rbp movq %rsp, %rbp subq $0x80, %rsp movq %rdi, -0x78(%rbp) movq %rdi, %rax movq %rax, -0x70(%rbp) movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movq %rdx, -0x18(%rbp) movq -0x18(%rbp), %rsi leaq -0x38(%rbp), %rdi callq 0x2adb0 leaq -0x38(%rbp), %rdi callq 0xbc20 testb $0x1, %al jne 0x3425e jmp 0x3428a movq -0x78(%rbp), %rdi movq -0x10(%rbp), %rsi callq 0xb2b0 jmp 0x3426d movl $0x1, -0x48(%rbp) jmp 0x34303 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) jmp 0x34319 movq -0x10(%rbp), %rdi callq 0xbc20 testb $0x1, %al jne 0x34299 jmp 0x342b1 movq -0x78(%rbp), %rdi leaq -0x38(%rbp), %rsi callq 0xb2b0 jmp 0x342a8 movl $0x1, -0x48(%rbp) jmp 0x34303 movq -0x10(%rbp), %rsi leaq 0x50ba5(%rip), %rdx # 0x84e61 leaq -0x68(%rbp), %rdi callq 0x57580 jmp 0x342c7 movq -0x78(%rbp), %rdi leaq -0x68(%rbp), %rsi leaq -0x38(%rbp), %rdx callq 0x57650 jmp 0x342da leaq -0x68(%rbp), %rdi callq 0xbe38 movl $0x1, -0x48(%rbp) jmp 0x34303 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) leaq -0x68(%rbp), %rdi callq 0xbe38 jmp 0x34319 leaq -0x38(%rbp), %rdi callq 0xbe38 movq -0x70(%rbp), %rax addq $0x80, %rsp popq %rbp retq leaq -0x38(%rbp), %rdi callq 0xbe38 movq -0x40(%rbp), %rdi callq 0xbcc0 nopl (%rax,%rax)
/laurynas-biveinis[P]unodb/3rd_party/googletest/googletest/src/gtest.cc
testing::TestInfo* testing::RegisterTest<testing::internal::InsertSyntheticTestCase(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, testing::internal::CodeLocation, bool)::$_0>(char const*, char const*, char const*, char const*, char const*, int, testing::internal::InsertSyntheticTestCase(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, testing::internal::CodeLocation, bool)::$_0)
TestInfo* RegisterTest(const char* test_suite_name, const char* test_name, const char* type_param, const char* value_param, const char* file, int line, Factory factory) { using TestT = typename std::remove_pointer<decltype(factory())>::type; class FactoryImpl : public internal::TestFactoryBase { public: explicit FactoryImpl(Factory f) : factory_(std::move(f)) {} Test* CreateTest() override { return factory_(); } private: Factory factory_; }; return internal::MakeAndRegisterTestInfo( test_suite_name, test_name, type_param, value_param, internal::CodeLocation(file, line), internal::GetTypeId<TestT>(), internal::SuiteApiResolver<TestT>::GetSetUpCaseOrSuite(file, line), internal::SuiteApiResolver<TestT>::GetTearDownCaseOrSuite(file, line), new FactoryImpl{std::move(factory)}); }
pushq %rbp movq %rsp, %rbp subq $0x190, %rsp # imm = 0x190 movq 0x10(%rbp), %rax movq %rax, -0x120(%rbp) movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movq %rdx, -0x18(%rbp) movq %rcx, -0x20(%rbp) movq %r8, -0x28(%rbp) movl %r9d, -0x2c(%rbp) movq -0x8(%rbp), %rax movq %rax, -0x118(%rbp) leaq -0x51(%rbp), %rdi movq %rdi, -0x110(%rbp) callq 0xbcd0 movq -0x118(%rbp), %rsi movq -0x110(%rbp), %rdx leaq -0x50(%rbp), %rdi callq 0xf3b0 jmp 0x348a2 movq -0x10(%rbp), %rax movq %rax, -0x148(%rbp) movq -0x18(%rbp), %rax movq %rax, -0x140(%rbp) movq -0x20(%rbp), %rax movq %rax, -0x138(%rbp) movq -0x28(%rbp), %rax movq %rax, -0x130(%rbp) leaq -0xb1(%rbp), %rdi movq %rdi, -0x128(%rbp) callq 0xbcd0 movq -0x130(%rbp), %rsi movq -0x128(%rbp), %rdx leaq -0xb0(%rbp), %rdi callq 0xf3b0 jmp 0x348fd movl -0x2c(%rbp), %edx leaq -0x90(%rbp), %rdi leaq -0xb0(%rbp), %rsi callq 0xf460 jmp 0x34915 callq 0x531c0 movq %rax, -0x150(%rbp) jmp 0x34923 movq -0x28(%rbp), %rdi movl -0x2c(%rbp), %esi callq 0x531d0 movq %rax, -0x158(%rbp) jmp 0x34938 movq -0x28(%rbp), %rdi movl -0x2c(%rbp), %esi callq 0x53310 movq %rax, -0x160(%rbp) jmp 0x3494d movl $0x50, %edi callq 0x28680 movq %rax, -0x168(%rbp) jmp 0x34960 movq -0x120(%rbp), %rsi movb $0x1, -0x101(%rbp) leaq -0x100(%rbp), %rdi movq %rdi, -0x170(%rbp) callq 0x53450 movq -0x168(%rbp), %rdi movq -0x170(%rbp), %rsi callq 0x53490 jmp 0x34996 movq -0x150(%rbp), %r9 movq -0x138(%rbp), %rcx movq -0x140(%rbp), %rdx movq -0x148(%rbp), %rsi movq -0x158(%rbp), %rdi movq -0x160(%rbp), %r8 movq -0x168(%rbp), %r10 movb $0x0, -0x101(%rbp) movq %rsp, %rax movq %r10, 0x10(%rax) movq %r8, 0x8(%rax) movq %rdi, (%rax) leaq -0x50(%rbp), %rdi leaq -0x90(%rbp), %r8 callq 0x3d670 movq %rax, -0x178(%rbp) jmp 0x349f5 leaq -0x100(%rbp), %rdi callq 0x34b00 leaq -0x90(%rbp), %rdi callq 0xf730 leaq -0xb0(%rbp), %rdi callq 0xbe38 leaq -0xb1(%rbp), %rdi callq 0xb750 leaq -0x50(%rbp), %rdi callq 0xbe38 leaq -0x51(%rbp), %rdi callq 0xb750 movq -0x178(%rbp), %rax addq $0x190, %rsp # imm = 0x190 popq %rbp retq movq %rax, %rcx movl %edx, %eax movq %rcx, -0x60(%rbp) movl %eax, -0x64(%rbp) jmp 0x34ae5 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x60(%rbp) movl %eax, -0x64(%rbp) jmp 0x34ad0 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x60(%rbp) movl %eax, -0x64(%rbp) jmp 0x34ac4 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x60(%rbp) movl %eax, -0x64(%rbp) jmp 0x34ab8 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x60(%rbp) movl %eax, -0x64(%rbp) leaq -0x100(%rbp), %rdi callq 0x34b00 testb $0x1, -0x101(%rbp) jne 0x34aa5 jmp 0x34ab6 movq -0x168(%rbp), %rdi movl $0x50, %esi callq 0x28720 jmp 0x34ab8 leaq -0x90(%rbp), %rdi callq 0xf730 leaq -0xb0(%rbp), %rdi callq 0xbe38 leaq -0xb1(%rbp), %rdi callq 0xb750 leaq -0x50(%rbp), %rdi callq 0xbe38 leaq -0x51(%rbp), %rdi callq 0xb750 movq -0x60(%rbp), %rdi callq 0xbcc0 nopw (%rax,%rax)
/laurynas-biveinis[P]unodb/3rd_party/googletest/googletest/include/gtest/gtest.h
testing::internal::(anonymous namespace)::PositiveAndNegativeUnitTestFilter::PositiveAndNegativeUnitTestFilter(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
explicit PositiveAndNegativeUnitTestFilter(const std::string& filter) { std::vector<std::string> positive_and_negative_filters; // NOTE: `SplitString` always returns a non-empty container. SplitString(filter, '-', &positive_and_negative_filters); const auto& positive_filter = positive_and_negative_filters.front(); if (positive_and_negative_filters.size() > 1) { positive_filter_ = UnitTestFilter( positive_filter.empty() ? kUniversalFilter : positive_filter); // TODO(b/214626361): Fail on multiple '-' characters // For the moment to preserve old behavior we concatenate the rest of the // string parts with `-` as separator to generate the negative filter. auto negative_filter_string = positive_and_negative_filters[1]; for (std::size_t i = 2; i < positive_and_negative_filters.size(); i++) negative_filter_string = negative_filter_string + '-' + positive_and_negative_filters[i]; negative_filter_ = UnitTestFilter(negative_filter_string); } else { // In case we don't have a negative filter and positive filter is "" // we do not use kUniversalFilter by design as opposed to when we have a // negative filter. positive_filter_ = UnitTestFilter(positive_filter); } }
pushq %rbp movq %rsp, %rbp subq $0x1f0, %rsp # imm = 0x1F0 movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movq -0x8(%rbp), %rdi movq %rdi, -0x1d8(%rbp) movq %rdi, %rax movq %rax, -0x1e0(%rbp) callq 0x52430 movq -0x1d8(%rbp), %rdi addq $0x50, %rdi movq %rdi, -0x1d0(%rbp) callq 0x52430 leaq -0x28(%rbp), %rdi movq %rdi, -0x1c8(%rbp) callq 0x57230 movq -0x1c8(%rbp), %rdx movq -0x10(%rbp), %rdi movl $0x2d, %esi callq 0x2e5c0 jmp 0x3648b leaq -0x28(%rbp), %rdi callq 0x66210 movq %rax, -0x40(%rbp) leaq -0x28(%rbp), %rdi callq 0x57250 cmpq $0x1, %rax jbe 0x3670b movq -0x40(%rbp), %rdi callq 0xbc20 movb $0x0, -0xb2(%rbp) testb $0x1, %al jne 0x364c1 jmp 0x364f9 leaq -0xb1(%rbp), %rdi movq %rdi, -0x1e8(%rbp) callq 0xbcd0 movq -0x1e8(%rbp), %rdx movb $0x1, -0xb2(%rbp) leaq 0x4c4d7(%rip), %rsi # 0x829c0 leaq -0xb0(%rbp), %rdi callq 0xf3b0 jmp 0x364f7 jmp 0x3650d movq -0x40(%rbp), %rsi leaq -0xb0(%rbp), %rdi callq 0xb2b0 jmp 0x3650b jmp 0x3650d leaq -0x90(%rbp), %rdi leaq -0xb0(%rbp), %rsi callq 0x36000 jmp 0x36522 movq -0x1e0(%rbp), %rdi leaq -0x90(%rbp), %rsi callq 0x52460 leaq -0x90(%rbp), %rdi callq 0x36360 leaq -0xb0(%rbp), %rdi callq 0xbe38 testb $0x1, -0xb2(%rbp) jne 0x36558 jmp 0x36564 leaq -0xb1(%rbp), %rdi callq 0xb750 leaq -0x28(%rbp), %rdi movl $0x1, %esi callq 0x573b0 movq %rax, %rsi leaq -0xd8(%rbp), %rdi callq 0xb2b0 jmp 0x36583 movq $0x2, -0xe0(%rbp) movq -0xe0(%rbp), %rax movq %rax, -0x1f0(%rbp) leaq -0x28(%rbp), %rdi callq 0x57250 movq %rax, %rcx movq -0x1f0(%rbp), %rax cmpq %rcx, %rax jae 0x366b7 leaq -0x120(%rbp), %rdi leaq -0xd8(%rbp), %rsi movl $0x2d, %edx callq 0x576a0 jmp 0x365d2 movq -0xe0(%rbp), %rsi leaq -0x28(%rbp), %rdi callq 0x573b0 movq %rax, %rdx leaq -0x100(%rbp), %rdi leaq -0x120(%rbp), %rsi callq 0x57650 jmp 0x365fa leaq -0xd8(%rbp), %rdi leaq -0x100(%rbp), %rsi callq 0xb8d0 leaq -0x100(%rbp), %rdi callq 0xbe38 leaq -0x120(%rbp), %rdi callq 0xbe38 movq -0xe0(%rbp), %rax addq $0x1, %rax movq %rax, -0xe0(%rbp) jmp 0x3658e movq %rax, %rcx movl %edx, %eax movq %rcx, -0x30(%rbp) movl %eax, -0x34(%rbp) jmp 0x3674e movq %rax, %rcx movl %edx, %eax movq %rcx, -0x30(%rbp) movl %eax, -0x34(%rbp) jmp 0x36673 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x30(%rbp) movl %eax, -0x34(%rbp) leaq -0xb0(%rbp), %rdi callq 0xbe38 testb $0x1, -0xb2(%rbp) jne 0x3667e jmp 0x3668a leaq -0xb1(%rbp), %rdi callq 0xb750 jmp 0x3674e movq %rax, %rcx movl %edx, %eax movq %rcx, -0x30(%rbp) movl %eax, -0x34(%rbp) jmp 0x366fd movq %rax, %rcx movl %edx, %eax movq %rcx, -0x30(%rbp) movl %eax, -0x34(%rbp) leaq -0x120(%rbp), %rdi callq 0xbe38 jmp 0x366fd leaq -0x170(%rbp), %rdi leaq -0xd8(%rbp), %rsi callq 0x36000 jmp 0x366cc movq -0x1e0(%rbp), %rdi addq $0x50, %rdi leaq -0x170(%rbp), %rsi callq 0x52460 leaq -0x170(%rbp), %rdi callq 0x36360 leaq -0xd8(%rbp), %rdi callq 0xbe38 jmp 0x3673c leaq -0xd8(%rbp), %rdi callq 0xbe38 jmp 0x3674e movq -0x40(%rbp), %rsi leaq -0x1c0(%rbp), %rdi callq 0x36000 jmp 0x3671d movq -0x1e0(%rbp), %rdi leaq -0x1c0(%rbp), %rsi callq 0x52460 leaq -0x1c0(%rbp), %rdi callq 0x36360 leaq -0x28(%rbp), %rdi callq 0x56eb0 addq $0x1f0, %rsp # imm = 0x1F0 popq %rbp retq leaq -0x28(%rbp), %rdi callq 0x56eb0 movq -0x1d0(%rbp), %rdi callq 0x36360 movq -0x1d8(%rbp), %rdi callq 0x36360 movq -0x30(%rbp), %rdi callq 0xbcc0 nopl (%rax,%rax)
/laurynas-biveinis[P]unodb/3rd_party/googletest/googletest/src/gtest.cc
testing::ScopedFakeTestPartResultReporter::~ScopedFakeTestPartResultReporter()
ScopedFakeTestPartResultReporter::~ScopedFakeTestPartResultReporter() { internal::UnitTestImpl* const impl = internal::GetUnitTestImpl(); if (intercept_mode_ == INTERCEPT_ALL_THREADS) { impl->SetGlobalTestPartResultReporter(old_reporter_); } else { impl->SetTestPartResultReporterForCurrentThread(old_reporter_); } }
pushq %rbp movq %rsp, %rbp subq $0x20, %rsp movq %rdi, -0x8(%rbp) movq -0x8(%rbp), %rax movq %rax, -0x20(%rbp) leaq 0x870e5(%rip), %rcx # 0xbdb40 movq %rcx, (%rax) callq 0x56490 movq %rax, -0x18(%rbp) jmp 0x36a69 movq -0x20(%rbp), %rax movq -0x18(%rbp), %rcx movq %rcx, -0x10(%rbp) cmpl $0x1, 0x8(%rax) jne 0x36a90 movq -0x20(%rbp), %rax movq -0x10(%rbp), %rdi movq 0x10(%rax), %rsi callq 0x36a00 jmp 0x36a8e jmp 0x36aa5 movq -0x20(%rbp), %rax movq -0x10(%rbp), %rdi movq 0x10(%rax), %rsi callq 0x33210 jmp 0x36aa3 jmp 0x36aa5 movq -0x20(%rbp), %rdi callq 0x62a50 addq $0x20, %rsp popq %rbp retq movq %rax, %rdi callq 0xf8e0 nopl (%rax)
/laurynas-biveinis[P]unodb/3rd_party/googletest/googletest/src/gtest.cc
testing::internal::edit_distance::(anonymous namespace)::Hunk::Hunk(unsigned long, unsigned long)
Hunk(size_t left_start, size_t right_start) : left_start_(left_start), right_start_(right_start), adds_(), removes_(), common_() {}
pushq %rbp movq %rsp, %rbp subq $0x20, %rsp movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movq %rdx, -0x18(%rbp) movq -0x8(%rbp), %rdi movq %rdi, -0x20(%rbp) movq -0x10(%rbp), %rax movq %rax, (%rdi) movq -0x18(%rbp), %rax movq %rax, 0x8(%rdi) movq $0x0, 0x10(%rdi) movq $0x0, 0x18(%rdi) movq $0x0, 0x20(%rdi) addq $0x28, %rdi callq 0x68510 movq -0x20(%rbp), %rdi addq $0x40, %rdi callq 0x68510 movq -0x20(%rbp), %rdi addq $0x58, %rdi callq 0x68510 addq $0x20, %rsp popq %rbp retq nopl (%rax)
/laurynas-biveinis[P]unodb/3rd_party/googletest/googletest/src/gtest.cc
testing::internal::edit_distance::(anonymous namespace)::Hunk::PrintTo(std::ostream*)
void PrintTo(std::ostream* os) { PrintHeader(os); FlushEdits(); for (std::list<std::pair<char, const char*> >::const_iterator it = hunk_.begin(); it != hunk_.end(); ++it) { *os << it->first << it->second << "\n"; } }
pushq %rbp movq %rsp, %rbp subq $0x50, %rsp movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movq -0x8(%rbp), %rdi movq %rdi, -0x38(%rbp) movq -0x10(%rbp), %rsi callq 0x52590 movq -0x38(%rbp), %rdi callq 0x524f0 movq -0x38(%rbp), %rdi addq $0x28, %rdi callq 0x68890 movq %rax, -0x20(%rbp) leaq -0x18(%rbp), %rdi leaq -0x20(%rbp), %rsi callq 0x686d0 movq -0x38(%rbp), %rdi addq $0x28, %rdi callq 0x686a0 movq %rax, -0x30(%rbp) leaq -0x28(%rbp), %rdi leaq -0x30(%rbp), %rsi callq 0x686d0 leaq -0x18(%rbp), %rdi leaq -0x28(%rbp), %rsi callq 0x68d20 testb $0x1, %al jne 0x39269 jmp 0x392bd movq -0x10(%rbp), %rax movq %rax, -0x48(%rbp) leaq -0x18(%rbp), %rdi callq 0x68d50 movq -0x48(%rbp), %rdi movsbl (%rax), %esi callq 0xb840 movq %rax, -0x40(%rbp) leaq -0x18(%rbp), %rdi callq 0x68d50 movq -0x40(%rbp), %rdi movq 0x8(%rax), %rsi callq 0xb680 movq %rax, %rdi leaq 0x4bbb7(%rip), %rsi # 0x84e61 callq 0xb680 leaq -0x18(%rbp), %rdi callq 0x68d80 jmp 0x39238 addq $0x50, %rsp popq %rbp retq nopw %cs:(%rax,%rax)
/laurynas-biveinis[P]unodb/3rd_party/googletest/googletest/src/gtest.cc
testing::internal::CmpHelperSTREQ(char const*, char const*, char const*, char const*)
AssertionResult CmpHelperSTREQ(const char* lhs_expression, const char* rhs_expression, const char* lhs, const char* rhs) { if (String::CStringEquals(lhs, rhs)) { return AssertionSuccess(); } return EqFailure(lhs_expression, rhs_expression, PrintToString(lhs), PrintToString(rhs), false); }
pushq %rbp movq %rsp, %rbp subq $0xa0, %rsp movq %rdi, -0x88(%rbp) movq %rdi, %rax movq %rax, -0x80(%rbp) movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movq %rdx, -0x18(%rbp) movq %rcx, -0x20(%rbp) movq %r8, -0x28(%rbp) movq -0x20(%rbp), %rdi movq -0x28(%rbp), %rsi callq 0x379a0 testb $0x1, %al jne 0x39fe0 jmp 0x39ff1 movq -0x88(%rbp), %rdi callq 0x292d0 jmp 0x3a08c movq -0x10(%rbp), %rax movq %rax, -0x98(%rbp) movq -0x18(%rbp), %rax movq %rax, -0x90(%rbp) leaq -0x48(%rbp), %rdi leaq -0x20(%rbp), %rsi callq 0x5ad40 leaq -0x68(%rbp), %rdi leaq -0x28(%rbp), %rsi callq 0x5ad40 jmp 0x3a023 movq -0x90(%rbp), %rdx movq -0x98(%rbp), %rsi movq -0x88(%rbp), %rdi leaq -0x48(%rbp), %rcx leaq -0x68(%rbp), %r8 xorl %r9d, %r9d callq 0x39310 jmp 0x3a04a leaq -0x68(%rbp), %rdi callq 0xbe38 leaq -0x48(%rbp), %rdi callq 0xbe38 jmp 0x3a08c movq %rax, %rcx movl %edx, %eax movq %rcx, -0x70(%rbp) movl %eax, -0x74(%rbp) jmp 0x3a081 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x70(%rbp) movl %eax, -0x74(%rbp) leaq -0x68(%rbp), %rdi callq 0xbe38 leaq -0x48(%rbp), %rdi callq 0xbe38 jmp 0x3a099 movq -0x80(%rbp), %rax addq $0xa0, %rsp popq %rbp retq movq -0x70(%rbp), %rdi callq 0xbcc0 nopw %cs:(%rax,%rax)
/laurynas-biveinis[P]unodb/3rd_party/googletest/googletest/src/gtest.cc
testing::internal::JsonUnitTestResultPrinter::PrintJsonUnitTest(std::ostream*, testing::UnitTest const&)
void JsonUnitTestResultPrinter::PrintJsonUnitTest(std::ostream* stream, const UnitTest& unit_test) { const std::string kTestsuites = "testsuites"; const std::string kIndent = Indent(2); *stream << "{\n"; OutputJsonKey(stream, kTestsuites, "tests", unit_test.reportable_test_count(), kIndent); OutputJsonKey(stream, kTestsuites, "failures", unit_test.failed_test_count(), kIndent); OutputJsonKey(stream, kTestsuites, "disabled", unit_test.reportable_disabled_test_count(), kIndent); OutputJsonKey(stream, kTestsuites, "errors", 0, kIndent); if (GTEST_FLAG_GET(shuffle)) { OutputJsonKey(stream, kTestsuites, "random_seed", unit_test.random_seed(), kIndent); } OutputJsonKey(stream, kTestsuites, "timestamp", FormatEpochTimeInMillisAsRFC3339(unit_test.start_timestamp()), kIndent); OutputJsonKey(stream, kTestsuites, "time", FormatTimeInMillisAsDuration(unit_test.elapsed_time()), kIndent, false); *stream << TestPropertiesAsJson(unit_test.ad_hoc_test_result(), kIndent) << ",\n"; OutputJsonKey(stream, kTestsuites, "name", "AllTests", kIndent); *stream << kIndent << "\"" << kTestsuites << "\": [\n"; bool comma = false; for (int i = 0; i < unit_test.total_test_suite_count(); ++i) { if (unit_test.GetTestSuite(i)->reportable_test_count() > 0) { if (comma) { *stream << ",\n"; } else { comma = true; } PrintJsonTestSuite(stream, *unit_test.GetTestSuite(i)); } } // If there was a test failure outside of one of the test suites (like in a // test environment) include that in the output. if (unit_test.ad_hoc_test_result().Failed()) { if (comma) { *stream << ",\n"; } OutputJsonTestSuiteForTestResult(stream, unit_test.ad_hoc_test_result()); } *stream << "\n" << kIndent << "]\n" << "}\n"; }
pushq %rbp movq %rsp, %rbp subq $0x380, %rsp # imm = 0x380 movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) leaq -0x31(%rbp), %rdi movq %rdi, -0x238(%rbp) callq 0xbcd0 movq -0x238(%rbp), %rdx leaq 0x3d96d(%rip), %rsi # 0x8515e leaq -0x30(%rbp), %rdi callq 0xf3b0 jmp 0x477fc leaq -0x31(%rbp), %rdi callq 0xb750 leaq -0x68(%rbp), %rdi movl $0x2, %esi callq 0x49830 jmp 0x47815 movq -0x8(%rbp), %rdi leaq 0x3da34(%rip), %rsi # 0x85254 callq 0xb680 jmp 0x47827 movq -0x8(%rbp), %rax movq %rax, -0x248(%rbp) leaq -0x89(%rbp), %rdi movq %rdi, -0x240(%rbp) callq 0xbcd0 movq -0x240(%rbp), %rdx leaq 0x3c90d(%rip), %rsi # 0x84160 leaq -0x88(%rbp), %rdi callq 0xf3b0 jmp 0x47861 movq -0x10(%rbp), %rdi callq 0x47500 movl %eax, -0x24c(%rbp) jmp 0x47872 movl -0x24c(%rbp), %ecx movq -0x248(%rbp), %rdi leaq -0x30(%rbp), %rsi leaq -0x88(%rbp), %rdx leaq -0x68(%rbp), %r8 movl $0x1, %r9d callq 0x48770 jmp 0x4789b leaq -0x88(%rbp), %rdi callq 0xbe38 leaq -0x89(%rbp), %rdi callq 0xb750 movq -0x8(%rbp), %rax movq %rax, -0x260(%rbp) leaq -0xb1(%rbp), %rdi movq %rdi, -0x258(%rbp) callq 0xbcd0 movq -0x258(%rbp), %rdx leaq 0x3e22d(%rip), %rsi # 0x85b0c leaq -0xb0(%rbp), %rdi callq 0xf3b0 jmp 0x478ed movq -0x10(%rbp), %rdi callq 0x401e0 movl %eax, -0x264(%rbp) jmp 0x478fe movl -0x264(%rbp), %ecx movq -0x260(%rbp), %rdi leaq -0x30(%rbp), %rsi leaq -0xb0(%rbp), %rdx leaq -0x68(%rbp), %r8 movl $0x1, %r9d callq 0x48770 jmp 0x47927 leaq -0xb0(%rbp), %rdi callq 0xbe38 leaq -0xb1(%rbp), %rdi callq 0xb750 movq -0x8(%rbp), %rax movq %rax, -0x278(%rbp) leaq -0xd9(%rbp), %rdi movq %rdi, -0x270(%rbp) callq 0xbcd0 movq -0x270(%rbp), %rdx leaq 0x3d6ef(%rip), %rsi # 0x8505a leaq -0xd8(%rbp), %rdi callq 0xf3b0 jmp 0x47979 movq -0x10(%rbp), %rdi callq 0x408c0 movl %eax, -0x27c(%rbp) jmp 0x4798a movl -0x27c(%rbp), %ecx movq -0x278(%rbp), %rdi leaq -0x30(%rbp), %rsi leaq -0xd8(%rbp), %rdx leaq -0x68(%rbp), %r8 movl $0x1, %r9d callq 0x48770 jmp 0x479b3 leaq -0xd8(%rbp), %rdi callq 0xbe38 leaq -0xd9(%rbp), %rdi callq 0xb750 movq -0x8(%rbp), %rax movq %rax, -0x290(%rbp) leaq -0x101(%rbp), %rdi movq %rdi, -0x288(%rbp) callq 0xbcd0 movq -0x288(%rbp), %rdx leaq 0x3d674(%rip), %rsi # 0x8506b leaq -0x100(%rbp), %rdi callq 0xf3b0 jmp 0x47a05 movq -0x290(%rbp), %rdi leaq -0x30(%rbp), %rsi leaq -0x100(%rbp), %rdx xorl %ecx, %ecx leaq -0x68(%rbp), %r8 movl $0x1, %r9d callq 0x48770 jmp 0x47a2a leaq -0x100(%rbp), %rdi callq 0xbe38 leaq -0x101(%rbp), %rdi callq 0xb750 testb $0x1, 0x7840d(%rip) # 0xbfe56 je 0x47c2f movq -0x8(%rbp), %rax movq %rax, -0x2a0(%rbp) leaq -0x129(%rbp), %rdi movq %rdi, -0x298(%rbp) callq 0xbcd0 movq -0x298(%rbp), %rdx leaq 0x3c75b(%rip), %rsi # 0x841d6 leaq -0x128(%rbp), %rdi callq 0xf3b0 jmp 0x47a89 movq -0x10(%rbp), %rdi callq 0x3f790 movl %eax, -0x2a4(%rbp) jmp 0x47a9a movl -0x2a4(%rbp), %ecx movq -0x2a0(%rbp), %rdi leaq -0x30(%rbp), %rsi leaq -0x128(%rbp), %rdx leaq -0x68(%rbp), %r8 movl $0x1, %r9d callq 0x48770 jmp 0x47ac3 leaq -0x128(%rbp), %rdi callq 0xbe38 leaq -0x129(%rbp), %rdi callq 0xb750 jmp 0x47c2f movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) leaq -0x31(%rbp), %rdi callq 0xb750 jmp 0x48247 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) jmp 0x4823e movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) jmp 0x48235 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) jmp 0x47b42 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) leaq -0x88(%rbp), %rdi callq 0xbe38 leaq -0x89(%rbp), %rdi callq 0xb750 jmp 0x48235 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) jmp 0x47b79 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) leaq -0xb0(%rbp), %rdi callq 0xbe38 leaq -0xb1(%rbp), %rdi callq 0xb750 jmp 0x48235 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) jmp 0x47bb0 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) leaq -0xd8(%rbp), %rdi callq 0xbe38 leaq -0xd9(%rbp), %rdi callq 0xb750 jmp 0x48235 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) jmp 0x47be7 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) leaq -0x100(%rbp), %rdi callq 0xbe38 leaq -0x101(%rbp), %rdi callq 0xb750 jmp 0x48235 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) jmp 0x47c1e movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) leaq -0x128(%rbp), %rdi callq 0xbe38 leaq -0x129(%rbp), %rdi callq 0xb750 jmp 0x48235 movq -0x8(%rbp), %rax movq %rax, -0x2b8(%rbp) leaq -0x151(%rbp), %rdi movq %rdi, -0x2b0(%rbp) callq 0xbcd0 movq -0x2b0(%rbp), %rdx leaq 0x3d417(%rip), %rsi # 0x85072 leaq -0x150(%rbp), %rdi callq 0xf3b0 jmp 0x47c69 movq -0x10(%rbp), %rdi callq 0x47530 movq %rax, -0x2c0(%rbp) jmp 0x47c7b movq -0x2c0(%rbp), %rsi leaq -0x178(%rbp), %rdi callq 0x49980 jmp 0x47c90 movq -0x2b8(%rbp), %rdi leaq -0x30(%rbp), %rsi leaq -0x150(%rbp), %rdx leaq -0x178(%rbp), %rcx leaq -0x68(%rbp), %r8 movl $0x1, %r9d callq 0x48490 jmp 0x47cba leaq -0x178(%rbp), %rdi callq 0xbe38 leaq -0x150(%rbp), %rdi callq 0xbe38 leaq -0x151(%rbp), %rdi callq 0xb750 movq -0x8(%rbp), %rax movq %rax, -0x2d0(%rbp) leaq -0x199(%rbp), %rdi movq %rdi, -0x2c8(%rbp) callq 0xbcd0 movq -0x2c8(%rbp), %rdx leaq 0x3c4bc(%rip), %rsi # 0x841c6 leaq -0x198(%rbp), %rdi callq 0xf3b0 jmp 0x47d18 movq -0x10(%rbp), %rdi callq 0x40830 movq %rax, -0x2d8(%rbp) jmp 0x47d2a movq -0x2d8(%rbp), %rsi leaq -0x1c0(%rbp), %rdi callq 0x498b0 jmp 0x47d3f movq -0x2d0(%rbp), %rdi leaq -0x30(%rbp), %rsi leaq -0x198(%rbp), %rdx leaq -0x1c0(%rbp), %rcx leaq -0x68(%rbp), %r8 xorl %r9d, %r9d callq 0x48490 jmp 0x47d66 leaq -0x1c0(%rbp), %rdi callq 0xbe38 leaq -0x198(%rbp), %rdi callq 0xbe38 leaq -0x199(%rbp), %rdi callq 0xb750 movq -0x8(%rbp), %rax movq %rax, -0x2e8(%rbp) movq -0x10(%rbp), %rdi callq 0x47560 movq %rax, -0x2e0(%rbp) jmp 0x47da7 movq -0x2e0(%rbp), %rsi leaq -0x1e0(%rbp), %rdi leaq -0x68(%rbp), %rdx callq 0x4aa20 jmp 0x47dc0 movq -0x2e8(%rbp), %rdi leaq -0x1e0(%rbp), %rsi callq 0xb5e0 movq %rax, -0x2f0(%rbp) jmp 0x47ddc movq -0x2f0(%rbp), %rdi leaq 0x3d47f(%rip), %rsi # 0x85269 callq 0xb680 jmp 0x47df1 leaq -0x1e0(%rbp), %rdi callq 0xbe38 movq -0x8(%rbp), %rax movq %rax, -0x300(%rbp) leaq -0x201(%rbp), %rdi movq %rdi, -0x2f8(%rbp) callq 0xbcd0 movq -0x2f8(%rbp), %rdx leaq 0x3d28e(%rip), %rsi # 0x850b7 leaq -0x200(%rbp), %rdi callq 0xf3b0 jmp 0x47e37 leaq -0x229(%rbp), %rdi movq %rdi, -0x308(%rbp) callq 0xbcd0 movq -0x308(%rbp), %rdx leaq 0x3d339(%rip), %rsi # 0x85191 leaq -0x228(%rbp), %rdi callq 0xf3b0 jmp 0x47e66 movq -0x300(%rbp), %rdi leaq -0x30(%rbp), %rsi leaq -0x200(%rbp), %rdx leaq -0x228(%rbp), %rcx leaq -0x68(%rbp), %r8 movl $0x1, %r9d callq 0x48490 jmp 0x47e90 leaq -0x228(%rbp), %rdi callq 0xbe38 leaq -0x229(%rbp), %rdi callq 0xb750 leaq -0x200(%rbp), %rdi callq 0xbe38 leaq -0x201(%rbp), %rdi callq 0xb750 movq -0x8(%rbp), %rdi leaq -0x68(%rbp), %rsi callq 0xb5e0 movq %rax, -0x310(%rbp) jmp 0x47ed6 movq -0x310(%rbp), %rdi leaq 0x3d3ab(%rip), %rsi # 0x8528f callq 0xb680 movq %rax, -0x318(%rbp) jmp 0x47ef2 movq -0x318(%rbp), %rdi leaq -0x30(%rbp), %rsi callq 0xb5e0 movq %rax, -0x320(%rbp) jmp 0x47f0b movq -0x320(%rbp), %rdi leaq 0x3d30c(%rip), %rsi # 0x85225 callq 0xb680 jmp 0x47f20 movb $0x0, -0x22a(%rbp) movl $0x0, -0x230(%rbp) movl -0x230(%rbp), %eax movl %eax, -0x328(%rbp) movq -0x10(%rbp), %rdi callq 0x40210 movl %eax, -0x324(%rbp) jmp 0x47f4e movl -0x328(%rbp), %eax movl -0x324(%rbp), %ecx cmpl %ecx, %eax jge 0x48134 movq -0x10(%rbp), %rdi movl -0x230(%rbp), %esi callq 0x40240 movq %rax, -0x330(%rbp) jmp 0x47f7a movq -0x330(%rbp), %rdi callq 0x377f0 movl %eax, -0x334(%rbp) jmp 0x47f8e movl -0x334(%rbp), %eax cmpl $0x0, %eax jle 0x4811e testb $0x1, -0x22a(%rbp) je 0x480dd movq -0x8(%rbp), %rdi leaq 0x3d2b4(%rip), %rsi # 0x85269 callq 0xb680 jmp 0x47fbc jmp 0x480e4 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) jmp 0x48001 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) jmp 0x47ff5 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) leaq -0x178(%rbp), %rdi callq 0xbe38 leaq -0x150(%rbp), %rdi callq 0xbe38 leaq -0x151(%rbp), %rdi callq 0xb750 jmp 0x48235 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) jmp 0x48052 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) jmp 0x48046 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) leaq -0x1c0(%rbp), %rdi callq 0xbe38 leaq -0x198(%rbp), %rdi callq 0xbe38 leaq -0x199(%rbp), %rdi callq 0xb750 jmp 0x48235 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) leaq -0x1e0(%rbp), %rdi callq 0xbe38 jmp 0x48235 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) jmp 0x480cc movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) jmp 0x480b4 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) leaq -0x228(%rbp), %rdi callq 0xbe38 leaq -0x229(%rbp), %rdi callq 0xb750 leaq -0x200(%rbp), %rdi callq 0xbe38 leaq -0x201(%rbp), %rdi callq 0xb750 jmp 0x48235 movb $0x1, -0x22a(%rbp) movq -0x8(%rbp), %rax movq %rax, -0x348(%rbp) movq -0x10(%rbp), %rdi movl -0x230(%rbp), %esi callq 0x40240 movq %rax, -0x340(%rbp) jmp 0x48107 movq -0x340(%rbp), %rsi movq -0x348(%rbp), %rdi callq 0x4c330 jmp 0x4811c jmp 0x4811e jmp 0x48120 movl -0x230(%rbp), %eax addl $0x1, %eax movl %eax, -0x230(%rbp) jmp 0x47f31 movq -0x10(%rbp), %rdi callq 0x47560 movq %rax, -0x350(%rbp) jmp 0x48146 movq -0x350(%rbp), %rdi callq 0x3c690 movb %al, -0x351(%rbp) jmp 0x4815a movb -0x351(%rbp), %al testb $0x1, %al jne 0x48166 jmp 0x481b7 testb $0x1, -0x22a(%rbp) je 0x48183 movq -0x8(%rbp), %rdi leaq 0x3d0ef(%rip), %rsi # 0x85269 callq 0xb680 jmp 0x48181 jmp 0x48183 movq -0x8(%rbp), %rax movq %rax, -0x368(%rbp) movq -0x10(%rbp), %rdi callq 0x47560 movq %rax, -0x360(%rbp) jmp 0x481a0 movq -0x360(%rbp), %rsi movq -0x368(%rbp), %rdi callq 0x48a30 jmp 0x481b5 jmp 0x481b7 movq -0x8(%rbp), %rdi leaq 0x3cc9f(%rip), %rsi # 0x84e61 callq 0xb680 movq %rax, -0x370(%rbp) jmp 0x481d0 movq -0x370(%rbp), %rdi leaq -0x68(%rbp), %rsi callq 0xb5e0 movq %rax, -0x378(%rbp) jmp 0x481e9 movq -0x378(%rbp), %rdi leaq 0x3d034(%rip), %rsi # 0x8522b callq 0xb680 movq %rax, -0x380(%rbp) jmp 0x48205 movq -0x380(%rbp), %rdi leaq 0x3d07e(%rip), %rsi # 0x85291 callq 0xb680 jmp 0x4821a leaq -0x68(%rbp), %rdi callq 0xbe38 leaq -0x30(%rbp), %rdi callq 0xbe38 addq $0x380, %rsp # imm = 0x380 popq %rbp retq leaq -0x68(%rbp), %rdi callq 0xbe38 leaq -0x30(%rbp), %rdi callq 0xbe38 movq -0x40(%rbp), %rdi callq 0xbcc0
/laurynas-biveinis[P]unodb/3rd_party/googletest/googletest/src/gtest.cc
void CCEXP::AddTable<int>(CCEXP::CCEXP&, char const*, char const*, unsigned long)
inline void AddTable ( CCEXP &obj, const char* matname, const char* typeName, size_t MaxRows = 0 ) { obj.ErrorId = 0; if (!obj.isActive) return; CECS_ERR(CCEXPECS,obj.Status != CCEXPORTMAT_READY,"[%s]: AddTable():: CCEXP object has wrong status." , obj.SavingFile ); obj.Status = CCEXPORTMAT_ACTIVE; size_t rd = obj.checkDuplicatedNames(matname); CECS_ERR(CCEXPECS,rd > 0,"[%s]: AddTable():: Table with name [%s] already exist!", obj.SavingFile, matname); obj.M.push_back(shared_ptr<CCEXPBase>((CCEXPBase*) new CCEXPMat<T>)); CCEXPMat<T>* U = static_cast<CCEXPMat<T>*>(obj.M[obj.M.size()-1].get()); int ret = U->Initialize(matname, typeName, MaxRows, &obj); CECS_ERR(CCEXPECS,ret != 0,"[%s]: AddTable():: Internal error occured during initialization()!", obj.SavingFile); obj.Status = CCEXPORTMAT_READY; }
pushq %rbp movq %rsp, %rbp subq $0xc0, %rsp movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movq %rdx, -0x18(%rbp) movq %rcx, -0x20(%rbp) movq -0x8(%rbp), %rax movl $0x0, 0x14(%rax) movq -0x8(%rbp), %rax testb $0x1, 0x10(%rax) jne 0x2e015 jmp 0x2e376 movq -0x8(%rbp), %rax cmpl $0x1, 0x8(%rax) je 0x2e0d6 leaq 0x27509(%rip), %rdi # 0x55533 movl $0x2f, %esi callq 0x211c0 cmpq $0x0, %rax je 0x2e055 leaq 0x274f2(%rip), %rdi # 0x55533 movl $0x2f, %esi callq 0x211c0 addq $0x1, %rax movq %rax, -0x60(%rbp) jmp 0x2e09c leaq 0x274d7(%rip), %rdi # 0x55533 movl $0x5c, %esi callq 0x211c0 cmpq $0x0, %rax je 0x2e087 leaq 0x274c0(%rip), %rdi # 0x55533 movl $0x5c, %esi callq 0x211c0 addq $0x1, %rax movq %rax, -0x68(%rbp) jmp 0x2e094 leaq 0x274a5(%rip), %rax # 0x55533 movq %rax, -0x68(%rbp) jmp 0x2e094 movq -0x68(%rbp), %rax movq %rax, -0x60(%rbp) movq -0x60(%rbp), %rcx movq -0x8(%rbp), %rax addq $0x70, %rax leaq 0x38181(%rip), %rdi # 0x66230 movl $0xffffd8f1, %esi # imm = 0xFFFFD8F1 movl $0x1, %edx movl $0x1f4, %r8d # imm = 0x1F4 leaq 0x274dc(%rip), %r9 # 0x555a2 movq %rax, (%rsp) movb $0x0, %al callq 0x53360 jmp 0x2e376 movq -0x8(%rbp), %rax movl $0x2, 0x8(%rax) movq -0x8(%rbp), %rdi movq -0x10(%rbp), %rsi callq 0x21de0 movq %rax, -0x28(%rbp) cmpq $0x0, -0x28(%rbp) jbe 0x2e1b9 leaq 0x2742f(%rip), %rdi # 0x55533 movl $0x2f, %esi callq 0x211c0 cmpq $0x0, %rax je 0x2e12f leaq 0x27418(%rip), %rdi # 0x55533 movl $0x2f, %esi callq 0x211c0 addq $0x1, %rax movq %rax, -0x70(%rbp) jmp 0x2e176 leaq 0x273fd(%rip), %rdi # 0x55533 movl $0x5c, %esi callq 0x211c0 cmpq $0x0, %rax je 0x2e161 leaq 0x273e6(%rip), %rdi # 0x55533 movl $0x5c, %esi callq 0x211c0 addq $0x1, %rax movq %rax, -0x78(%rbp) jmp 0x2e16e leaq 0x273cb(%rip), %rax # 0x55533 movq %rax, -0x78(%rbp) jmp 0x2e16e movq -0x78(%rbp), %rax movq %rax, -0x70(%rbp) movq -0x70(%rbp), %rcx movq -0x8(%rbp), %r10 addq $0x70, %r10 movq -0x10(%rbp), %rax leaq 0x380a3(%rip), %rdi # 0x66230 movl $0xffffd8f1, %esi # imm = 0xFFFFD8F1 movl $0x1, %edx movl $0x1f7, %r8d # imm = 0x1F7 leaq 0x27430(%rip), %r9 # 0x555d4 movq %r10, (%rsp) movq %rax, 0x8(%rsp) movb $0x0, %al callq 0x53360 jmp 0x2e376 movq -0x8(%rbp), %rax addq $0x30, %rax movq %rax, -0x88(%rbp) movl $0xb8, %edi callq 0x21190 movq %rax, %rdi movq %rdi, %rax movq %rax, -0x80(%rbp) callq 0x365b0 jmp 0x2e1e3 movq -0x80(%rbp), %rsi leaq -0x38(%rbp), %rdi movq %rdi, -0x90(%rbp) callq 0x2f710 movq -0x88(%rbp), %rdi movq -0x90(%rbp), %rsi callq 0x2f640 jmp 0x2e20c leaq -0x38(%rbp), %rdi callq 0x2f740 movq -0x8(%rbp), %rax addq $0x30, %rax movq %rax, -0x98(%rbp) movq -0x8(%rbp), %rdi addq $0x30, %rdi callq 0x260b0 movq -0x98(%rbp), %rdi movq %rax, %rsi subq $0x1, %rsi callq 0x260d0 movq %rax, %rdi callq 0x26c40 movq %rax, -0x50(%rbp) movq -0x50(%rbp), %rdi movq -0x10(%rbp), %rsi movq -0x18(%rbp), %rdx movq -0x20(%rbp), %rcx movq -0x8(%rbp), %r8 callq 0x36610 movl %eax, -0x54(%rbp) cmpl $0x0, -0x54(%rbp) je 0x2e36b leaq 0x272b6(%rip), %rdi # 0x55533 movl $0x2f, %esi callq 0x211c0 cmpq $0x0, %rax je 0x2e2ab leaq 0x2729f(%rip), %rdi # 0x55533 movl $0x2f, %esi callq 0x211c0 addq $0x1, %rax movq %rax, -0xa0(%rbp) jmp 0x2e2fe leaq 0x27281(%rip), %rdi # 0x55533 movl $0x5c, %esi callq 0x211c0 cmpq $0x0, %rax je 0x2e2e0 leaq 0x2726a(%rip), %rdi # 0x55533 movl $0x5c, %esi callq 0x211c0 addq $0x1, %rax movq %rax, -0xa8(%rbp) jmp 0x2e2f0 leaq 0x2724c(%rip), %rax # 0x55533 movq %rax, -0xa8(%rbp) jmp 0x2e2f0 movq -0xa8(%rbp), %rax movq %rax, -0xa0(%rbp) movq -0xa0(%rbp), %rcx movq -0x8(%rbp), %rax addq $0x70, %rax leaq 0x37f1c(%rip), %rdi # 0x66230 movl $0xffffd8f1, %esi # imm = 0xFFFFD8F1 movl $0x1, %edx movl $0x1fb, %r8d # imm = 0x1FB leaq 0x272e1(%rip), %r9 # 0x5560c movq %rax, (%rsp) movb $0x0, %al callq 0x53360 jmp 0x2e376 movq -0x80(%rbp), %rdi movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) movl $0xb8, %esi callq 0x211a0 jmp 0x2e37f movq %rax, %rcx movl %edx, %eax movq %rcx, -0x40(%rbp) movl %eax, -0x44(%rbp) leaq -0x38(%rbp), %rdi callq 0x2f740 jmp 0x2e37f movq -0x8(%rbp), %rax movl $0x1, 0x8(%rax) addq $0xc0, %rsp popq %rbp retq movq -0x40(%rbp), %rdi callq 0x212a0 nopl (%rax,%rax)
/terablade2001[P]CCEXP/C++/test/../src/include/CCEXP.hpp
CCEXP::CCEXPMat<int>::CCEXPMat()
MVECTOR<T>* CCEXPMat<T>::getDataRowPtr(size_t row) { const size_t N = data.size(); CECS_ERRN(CCEXPECS,row >= N,"CCEXPMat::getDataRowPtr():: Requested Row is not exist yet! (row(=" __ZU__ ") >= N(=" __ZU__ "))", row, N); MVECTOR<T>* pRow = nullptr; #ifdef __CCEXP__USE_VECTOR_INSTEAD_OF_LIST pRow = &data[row]; #else auto it = std::next(data.begin(), row); pRow = &(*it); #endif CECS_ERRN(CCEXPECS, pRow == nullptr, "CCEXPMat::AppendRow():: pRow is nullptr"); return pRow; }
pushq %rbp movq %rsp, %rbp subq $0x10, %rsp movq %rdi, -0x8(%rbp) movq -0x8(%rbp), %rdi movq %rdi, -0x10(%rbp) callq 0x30620 movq -0x10(%rbp), %rdi leaq 0x2f464(%rip), %rax # 0x65a38 addq $0x10, %rax movq %rax, (%rdi) movb $0x0, 0x8a(%rdi) movb $0x1, 0x8b(%rdi) addq $0x90, %rdi callq 0x36850 callq 0x260a0 movq %rax, %rcx movq -0x10(%rbp), %rax movq %rcx, 0xa8(%rax) addq $0x10, %rsp popq %rbp retq nop
/terablade2001[P]CCEXP/C++/test/../src/include/CCEXP.hpp
CCEXP::CCEXPMat<int>::NewRow(int)
int CCEXPMat<T>::NewRow(int empty) { if (IgnoreM) return 0; const size_t N = data.size(); CECS_ERRI(CCEXPECS,N >= _maxRows,"CCEXPMat::NewRow():: Maximum Rows (=" __ZU__ ") already Reached!", _maxRows); newRowFlag=true; if (empty == 1) { MVECTOR<T> dl; dl.clear(); data.push_back(dl); } return 0; }
pushq %rbp movq %rsp, %rbp subq $0xa0, %rsp movq %rdi, -0x10(%rbp) movl %esi, -0x14(%rbp) movq -0x10(%rbp), %rax movq %rax, -0x78(%rbp) testb $0x1, 0x8a(%rax) je 0x3698f movl $0x0, -0x4(%rbp) jmp 0x36ae9 movq -0x78(%rbp), %rdi addq $0x90, %rdi callq 0x37b00 movq -0x78(%rbp), %rcx movq %rax, -0x20(%rbp) movq -0x20(%rbp), %rax cmpq 0xa8(%rcx), %rax jb 0x36a7b leaq 0x1eb74(%rip), %rdi # 0x55533 movl $0x2f, %esi callq 0x211c0 cmpq $0x0, %rax je 0x369ea leaq 0x1eb5d(%rip), %rdi # 0x55533 movl $0x2f, %esi callq 0x211c0 addq $0x1, %rax movq %rax, -0x80(%rbp) jmp 0x36a3a leaq 0x1eb42(%rip), %rdi # 0x55533 movl $0x5c, %esi callq 0x211c0 cmpq $0x0, %rax je 0x36a1f leaq 0x1eb2b(%rip), %rdi # 0x55533 movl $0x5c, %esi callq 0x211c0 addq $0x1, %rax movq %rax, -0x88(%rbp) jmp 0x36a2f leaq 0x1eb0d(%rip), %rax # 0x55533 movq %rax, -0x88(%rbp) jmp 0x36a2f movq -0x88(%rbp), %rax movq %rax, -0x80(%rbp) movq -0x78(%rbp), %rax movq -0x80(%rbp), %rcx movq 0xa8(%rax), %rax leaq 0x2f7e0(%rip), %rdi # 0x66230 movl $0xffffd8f1, %esi # imm = 0xFFFFD8F1 movl $0x1, %edx movl $0x161, %r8d # imm = 0x161 leaq 0x1ebe8(%rip), %r9 # 0x5564f movq %rax, (%rsp) movb $0x0, %al callq 0x53360 movl $0xffffd8f1, -0x4(%rbp) # imm = 0xFFFFD8F1 jmp 0x36ae9 movq -0x78(%rbp), %rax movb $0x1, 0x8b(%rax) cmpl $0x1, -0x14(%rbp) jne 0x36ae2 leaq -0x60(%rbp), %rdi movq %rdi, -0x90(%rbp) callq 0x37b20 movq -0x90(%rbp), %rdi callq 0x37820 jmp 0x36aaa movq -0x78(%rbp), %rdi addq $0x90, %rdi leaq -0x60(%rbp), %rsi callq 0x37b80 jmp 0x36ac0 leaq -0x60(%rbp), %rdi callq 0x377e0 jmp 0x36ae2 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x68(%rbp) movl %eax, -0x6c(%rbp) leaq -0x60(%rbp), %rdi callq 0x377e0 jmp 0x36af5 movl $0x0, -0x4(%rbp) movl -0x4(%rbp), %eax addq $0xa0, %rsp popq %rbp retq movq -0x68(%rbp), %rdi callq 0x212a0 nop
/terablade2001[P]CCEXP/C++/test/../src/include/CCEXP.hpp
CCEXP::CCEXPMat<int>::AppendRow(unsigned long, int*, unsigned long)
int CCEXPMat<T>::AppendRow(size_t row, T* ptr, size_t n) { if (IgnoreM) return 0; MVECTOR<T>* it = getDataRowPtr(row); CECS_ERRI(CCEXPECS, it == nullptr, "CCEXPMat::AppendRow():: 'it' is nullptr"); const size_t currentData = (*it).size(); (*it).resize(currentData + n); T* Dptr = (*it).data(); memcpy(&Dptr[currentData], ptr, sizeof(T) * n); return 0; }
pushq %rbp movq %rsp, %rbp subq $0x60, %rsp movq %rdi, -0x10(%rbp) movq %rsi, -0x18(%rbp) movq %rdx, -0x20(%rbp) movq %rcx, -0x28(%rbp) movq -0x10(%rbp), %rax movq %rax, -0x48(%rbp) testb $0x1, 0x8a(%rax) je 0x3f4f5 movl $0x0, -0x4(%rbp) jmp 0x3f60e movq -0x48(%rbp), %rdi movq -0x18(%rbp), %rsi callq 0x38e50 movq %rax, -0x30(%rbp) cmpq $0x0, -0x30(%rbp) jne 0x3f5bc leaq 0x1601b(%rip), %rdi # 0x55533 movl $0x2f, %esi callq 0x211c0 cmpq $0x0, %rax je 0x3f543 leaq 0x16004(%rip), %rdi # 0x55533 movl $0x2f, %esi callq 0x211c0 addq $0x1, %rax movq %rax, -0x50(%rbp) jmp 0x3f58a leaq 0x15fe9(%rip), %rdi # 0x55533 movl $0x5c, %esi callq 0x211c0 cmpq $0x0, %rax je 0x3f575 leaq 0x15fd2(%rip), %rdi # 0x55533 movl $0x5c, %esi callq 0x211c0 addq $0x1, %rax movq %rax, -0x58(%rbp) jmp 0x3f582 leaq 0x15fb7(%rip), %rax # 0x55533 movq %rax, -0x58(%rbp) jmp 0x3f582 movq -0x58(%rbp), %rax movq %rax, -0x50(%rbp) movq -0x50(%rbp), %rcx leaq 0x26c9b(%rip), %rdi # 0x66230 movl $0xffffd8f1, %esi # imm = 0xFFFFD8F1 movl $0x1, %edx movl $0x11b, %r8d # imm = 0x11B leaq 0x1659e(%rip), %r9 # 0x55b4a movb $0x0, %al callq 0x53360 movl $0xffffd8f1, -0x4(%rbp) # imm = 0xFFFFD8F1 jmp 0x3f60e movq -0x30(%rbp), %rdi callq 0x39030 movq %rax, -0x38(%rbp) movq -0x30(%rbp), %rdi movq -0x38(%rbp), %rsi addq -0x28(%rbp), %rsi callq 0x39120 movq -0x30(%rbp), %rdi callq 0x39460 movq %rax, -0x40(%rbp) movq -0x40(%rbp), %rdi movq -0x38(%rbp), %rax shlq $0x2, %rax addq %rax, %rdi movq -0x20(%rbp), %rsi movq -0x28(%rbp), %rdx shlq $0x2, %rdx callq 0x21150 movl $0x0, -0x4(%rbp) movl -0x4(%rbp), %eax addq $0x60, %rsp popq %rbp retq nopw (%rax,%rax)
/terablade2001[P]CCEXP/C++/test/../src/include/CCEXP.hpp
CCEXP::CCEXPMat<unsigned long>::AddValue(unsigned long)
int CCEXPMat<T>::AddValue(T val) { if (IgnoreM) return 0; // This is not an error - We just ignore the Table... const size_t N = data.size(); if ((N == 0) || (newRowFlag==true)) { MVECTOR<T> dl; dl.clear(); data.push_back(dl); newRowFlag = false; } data.back().push_back(val); return 0; }
pushq %rbp movq %rsp, %rbp subq $0x80, %rsp movq %rdi, -0x10(%rbp) movq %rsi, -0x18(%rbp) movq -0x10(%rbp), %rax movq %rax, -0x78(%rbp) testb $0x1, 0x8a(%rax) je 0x407f0 movl $0x0, -0x4(%rbp) jmp 0x4089b movq -0x78(%rbp), %rdi addq $0x90, %rdi callq 0x3a850 movq %rax, -0x20(%rbp) cmpq $0x0, -0x20(%rbp) je 0x4081f movq -0x78(%rbp), %rax movb 0x8b(%rax), %al andb $0x1, %al movzbl %al, %eax cmpl $0x1, %eax jne 0x40878 leaq -0x60(%rbp), %rdi movq %rdi, -0x80(%rbp) callq 0x266c0 movq -0x80(%rbp), %rdi callq 0x28300 movq -0x78(%rbp), %rdi movq -0x80(%rbp), %rsi addq $0x90, %rdi callq 0x3a870 jmp 0x4084b movq -0x78(%rbp), %rax movb $0x0, 0x8b(%rax) leaq -0x60(%rbp), %rdi callq 0x26a00 jmp 0x40878 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x68(%rbp) movl %eax, -0x6c(%rbp) leaq -0x60(%rbp), %rdi callq 0x26a00 jmp 0x408a7 movq -0x78(%rbp), %rdi addq $0x90, %rdi callq 0x408b0 movq %rax, %rdi movq -0x18(%rbp), %rsi callq 0x408f0 movl $0x0, -0x4(%rbp) movl -0x4(%rbp), %eax addq $0x80, %rsp popq %rbp retq movq -0x68(%rbp), %rdi callq 0x212a0
/terablade2001[P]CCEXP/C++/test/../src/include/CCEXP.hpp
void CCEXP::LoadTable<float>(CCEXP::CCEXP&, char const*, char const*)
inline void LoadTable(CCEXP &obj, const char* name, const char* type) { obj.ErrorId = 0; if (!obj.isActive) return; int prevStatus = obj.Status; // If any error occurs, then it should be critical error! obj.Status = CCEXPORTMAT_ACTIVE; CECS_ERR(CCEXPECS,(prevStatus != CCEXPORTMAT_INIT) && (prevStatus != CCEXPORTMAT_READY),"[%s]: LoadTable():: CCEXP object has wrong status!", obj.SavingFile); FILE* lfp = obj.lfp; CECS_ERR(CCEXPECS,lfp == NULL,"[%s]: LoadTable():: File pointer is NULL. Use CCEXP::Open() first!", obj.SavingFile); char loadName[64]={0}; char loadType[64]={0}; uint64_t typeSize=0; uint64_t N=0; uint64_t LastTablePosByte = 0; uint64_t MaxRows=0; bool TableFound = false; // Search from current LoadTableIndex to the Total Tables of files. for (uint64_t i = obj.LoadTableIndex; i < obj.LoadTotalTables; i++) { LastTablePosByte = ftell(lfp); fread(loadName,sizeof(char),64,lfp); fread(loadType,sizeof(char),64,lfp); fread(&typeSize,sizeof(uint64_t),1,lfp); fread(&N,sizeof(uint64_t),1,lfp); fread(&MaxRows,sizeof(uint64_t),1,lfp); if (N > MaxRows) N = MaxRows; if (strcmp(loadName,name)==0) { TableFound = true; obj.LoadTableIndex = i+1; break; } MVECTOR<uint64_t> DPL; DPL.resize(N); fread(DPL.data(), sizeof(uint64_t), N, lfp); uint64_t TableBytes = 0; for (uint64_t c = 0; c < N; c++) TableBytes += DPL[c]*typeSize; fseek(lfp, (long)TableBytes, SEEK_CUR); } if (!TableFound) { // If the Table has not been found in the file, search again from the start fseek(lfp, sizeof(uint32_t) + sizeof(uint64_t), SEEK_SET); for (uint64_t i = 0; i < obj.LoadTableIndex; i++) { LastTablePosByte = ftell(lfp); fread(loadName,sizeof(char),64,lfp); fread(loadType,sizeof(char),64,lfp); fread(&typeSize,sizeof(uint64_t),1,lfp); fread(&N,sizeof(uint64_t),1,lfp); fread(&MaxRows,sizeof(uint64_t),1,lfp); if (N > MaxRows) N = MaxRows; if (strcmp(loadName,name)==0) { TableFound = true; obj.LoadTableIndex = i+1; break; } MVECTOR<uint64_t> DPL; DPL.resize(N); fread(DPL.data(), sizeof(uint64_t), N, lfp); uint64_t TableBytes = 0; for (uint64_t c = 0; c < N; c++) TableBytes += DPL[c]*typeSize; fseek(lfp, (long)TableBytes, SEEK_CUR); } } // If the Table hot not been found, then abort with error. if(!TableFound) { fseek(lfp, (long)LastTablePosByte, SEEK_SET); CECS_ERR(CCEXPECS,1, "[%s]: LoadTable():: Failed to find table [%s] into the last opened file!", obj.SavingFile, name); } // At this point the table has been found, and we have to reload it! if (strcmp(loadType, type) != 0) { fseek(lfp, (long)LastTablePosByte, SEEK_SET); CECS_ERR(CCEXPECS,1,"[%s]: LoadTable():: Table [%s] is of \"%s\" type, while requested LoadTable is of \"%s\" type!", obj.SavingFile, name, loadType, type); } CCEXPMat<T> *U; if (obj.checkDuplicatedNames(name) > 0) { // If the table already exist! size_t idx = obj.getTableIndexByName(name); U = static_cast<CCEXPMat<T>*>(obj.M[idx].get()); U->Reset(); } else {// If the table does not exist create a new Table... obj.M.push_back(shared_ptr<CCEXPBase>((CCEXPBase*) new CCEXPMat<T>)); U = static_cast<CCEXPMat<T>*>(obj.M[obj.M.size()-1].get()); } int ret = U->Initialize(loadName, loadType, MaxRows, &obj); CECS_ERR(CCEXPECS,ret != 0,"[%s]: LoadTable():: Internal error occured while copying Table [%s] from an opened file!", obj.SavingFile, name); // Copy data from file to the new table. MVECTOR<uint64_t> DPL; DPL.resize(N); fread(DPL.data(), sizeof(uint64_t), N, lfp); MVECTOR<T> rowData; uint64_t maxCols=0; for (uint64_t row = 0; row < N; row++) { const uint64_t columns = DPL[row]; if (columns > maxCols) { maxCols = columns; rowData.resize(maxCols); } fread(rowData.data(), sizeof(T), columns, lfp); ret = U->AddRow(rowData.data(), columns); CECS_ERR(CCEXPECS,ret != 0,"[%s]: LoadTable():: Internal error occured while copying Table's [%s], row [" __ZU__ "] from an opened file!", obj.SavingFile, name, (size_t)row); } // Warning: newRowFlag should be set to false, thus use to be able // add data directly to the end of the last row if he want. U->NoNewRow(); if (obj.LoadTableIndex >= obj.LoadTotalTables) { obj.LoadTableIndex = 0; fseek(lfp, sizeof(uint32_t) + sizeof(uint64_t), SEEK_SET); } obj.Status = CCEXPORTMAT_READY; }
pushq %rbp movq %rsp, %rbp pushq %rbx subq $0x328, %rsp # imm = 0x328 movq %rdi, -0x10(%rbp) movq %rsi, -0x18(%rbp) movq %rdx, -0x20(%rbp) movq -0x10(%rbp), %rax movl $0x0, 0x14(%rax) movq -0x10(%rbp), %rax testb $0x1, 0x10(%rax) jne 0x45892 jmp 0x46636 movq -0x10(%rbp), %rax movl 0x8(%rax), %eax movl %eax, -0x24(%rbp) movq -0x10(%rbp), %rax movl $0x2, 0x8(%rax) cmpl $0x0, -0x24(%rbp) je 0x45980 cmpl $0x1, -0x24(%rbp) je 0x45980 leaq 0xfc71(%rip), %rdi # 0x55533 movl $0x2f, %esi callq 0x211c0 cmpq $0x0, %rax je 0x458f0 leaq 0xfc5a(%rip), %rdi # 0x55533 movl $0x2f, %esi callq 0x211c0 addq $0x1, %rax movq %rax, -0x268(%rbp) jmp 0x45943 leaq 0xfc3c(%rip), %rdi # 0x55533 movl $0x5c, %esi callq 0x211c0 cmpq $0x0, %rax je 0x45925 leaq 0xfc25(%rip), %rdi # 0x55533 movl $0x5c, %esi callq 0x211c0 addq $0x1, %rax movq %rax, -0x270(%rbp) jmp 0x45935 leaq 0xfc07(%rip), %rax # 0x55533 movq %rax, -0x270(%rbp) jmp 0x45935 movq -0x270(%rbp), %rax movq %rax, -0x268(%rbp) movq -0x268(%rbp), %rcx movq -0x10(%rbp), %rax addq $0x70, %rax leaq 0x208d7(%rip), %rdi # 0x66230 movl $0xffffd8f1, %esi # imm = 0xFFFFD8F1 movl $0x1, %edx movl $0x21a, %r8d # imm = 0x21A leaq 0x10c7f(%rip), %r9 # 0x565ef movq %rax, (%rsp) movb $0x0, %al callq 0x53360 jmp 0x46636 movq -0x10(%rbp), %rax movq 0x18(%rax), %rax movq %rax, -0x30(%rbp) cmpq $0x0, -0x30(%rbp) jne 0x45a5c leaq 0xfb95(%rip), %rdi # 0x55533 movl $0x2f, %esi callq 0x211c0 cmpq $0x0, %rax je 0x459cc leaq 0xfb7e(%rip), %rdi # 0x55533 movl $0x2f, %esi callq 0x211c0 addq $0x1, %rax movq %rax, -0x278(%rbp) jmp 0x45a1f leaq 0xfb60(%rip), %rdi # 0x55533 movl $0x5c, %esi callq 0x211c0 cmpq $0x0, %rax je 0x45a01 leaq 0xfb49(%rip), %rdi # 0x55533 movl $0x5c, %esi callq 0x211c0 addq $0x1, %rax movq %rax, -0x280(%rbp) jmp 0x45a11 leaq 0xfb2b(%rip), %rax # 0x55533 movq %rax, -0x280(%rbp) jmp 0x45a11 movq -0x280(%rbp), %rax movq %rax, -0x278(%rbp) movq -0x278(%rbp), %rcx movq -0x10(%rbp), %rax addq $0x70, %rax leaq 0x207fb(%rip), %rdi # 0x66230 movl $0xffffd8f1, %esi # imm = 0xFFFFD8F1 movl $0x1, %edx movl $0x21c, %r8d # imm = 0x21C leaq 0x10bd6(%rip), %r9 # 0x56622 movq %rax, (%rsp) movb $0x0, %al callq 0x53360 jmp 0x46636 leaq -0x70(%rbp), %rdi xorl %esi, %esi movl $0x40, %edx callq 0x210e0 leaq -0xb0(%rbp), %rdi xorl %esi, %esi movl $0x40, %edx callq 0x210e0 movq $0x0, -0xb8(%rbp) movq $0x0, -0xc0(%rbp) movq $0x0, -0xc8(%rbp) movq $0x0, -0xd0(%rbp) movb $0x0, -0xd1(%rbp) movq -0x10(%rbp), %rax movq 0x28(%rax), %rax movq %rax, -0xe0(%rbp) movq -0xe0(%rbp), %rax movq -0x10(%rbp), %rcx cmpq 0x20(%rcx), %rax jae 0x45cc5 movq -0x30(%rbp), %rdi callq 0x21030 movq %rax, -0xc8(%rbp) leaq -0x70(%rbp), %rdi movq -0x30(%rbp), %rcx movl $0x1, %esi movl $0x40, %edx callq 0x21240 leaq -0xb0(%rbp), %rdi movq -0x30(%rbp), %rcx movl $0x1, %esi movl $0x40, %edx callq 0x21240 movq -0x30(%rbp), %rcx leaq -0xb8(%rbp), %rdi movl $0x8, %esi movl $0x1, %edx callq 0x21240 movq -0x30(%rbp), %rcx leaq -0xc0(%rbp), %rdi movl $0x8, %esi movl $0x1, %edx callq 0x21240 movq -0x30(%rbp), %rcx leaq -0xd0(%rbp), %rdi movl $0x8, %esi movl $0x1, %edx callq 0x21240 movq -0xc0(%rbp), %rax cmpq -0xd0(%rbp), %rax jbe 0x45b83 movq -0xd0(%rbp), %rax movq %rax, -0xc0(%rbp) leaq -0x70(%rbp), %rdi movq -0x18(%rbp), %rsi callq 0x21220 cmpl $0x0, %eax jne 0x45bb4 movb $0x1, -0xd1(%rbp) movq -0xe0(%rbp), %rcx addq $0x1, %rcx movq -0x10(%rbp), %rax movq %rcx, 0x28(%rax) jmp 0x45cc5 leaq -0x120(%rbp), %rdi movq %rdi, -0x288(%rbp) callq 0x266c0 movq -0x288(%rbp), %rdi movq -0xc0(%rbp), %rsi callq 0x26760 jmp 0x45bdc leaq -0x120(%rbp), %rdi callq 0x269b0 movq %rax, %rdi movq -0xc0(%rbp), %rdx movq -0x30(%rbp), %rcx movl $0x8, %esi callq 0x21240 jmp 0x45c02 movq $0x0, -0x138(%rbp) movq $0x0, -0x140(%rbp) movq -0x140(%rbp), %rax cmpq -0xc0(%rbp), %rax jae 0x45c8b movq -0x140(%rbp), %rsi leaq -0x120(%rbp), %rdi callq 0x269d0 movq (%rax), %rax imulq -0xb8(%rbp), %rax addq -0x138(%rbp), %rax movq %rax, -0x138(%rbp) movq -0x140(%rbp), %rax addq $0x1, %rax movq %rax, -0x140(%rbp) jmp 0x45c18 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x128(%rbp) movl %eax, -0x12c(%rbp) leaq -0x120(%rbp), %rdi callq 0x26a00 jmp 0x4664c movq -0x30(%rbp), %rdi movq -0x138(%rbp), %rsi movl $0x1, %edx callq 0x211d0 jmp 0x45ca2 leaq -0x120(%rbp), %rdi callq 0x26a00 movq -0xe0(%rbp), %rax addq $0x1, %rax movq %rax, -0xe0(%rbp) jmp 0x45ac1 testb $0x1, -0xd1(%rbp) jne 0x45ef3 movq -0x30(%rbp), %rdi movl $0xc, %esi xorl %edx, %edx callq 0x211d0 movq $0x0, -0x148(%rbp) movq -0x148(%rbp), %rax movq -0x10(%rbp), %rcx cmpq 0x28(%rcx), %rax jae 0x45ef1 movq -0x30(%rbp), %rdi callq 0x21030 movq %rax, -0xc8(%rbp) leaq -0x70(%rbp), %rdi movq -0x30(%rbp), %rcx movl $0x1, %esi movl $0x40, %edx callq 0x21240 leaq -0xb0(%rbp), %rdi movq -0x30(%rbp), %rcx movl $0x1, %esi movl $0x40, %edx callq 0x21240 movq -0x30(%rbp), %rcx leaq -0xb8(%rbp), %rdi movl $0x8, %esi movl $0x1, %edx callq 0x21240 movq -0x30(%rbp), %rcx leaq -0xc0(%rbp), %rdi movl $0x8, %esi movl $0x1, %edx callq 0x21240 movq -0x30(%rbp), %rcx leaq -0xd0(%rbp), %rdi movl $0x8, %esi movl $0x1, %edx callq 0x21240 movq -0xc0(%rbp), %rax cmpq -0xd0(%rbp), %rax jbe 0x45daf movq -0xd0(%rbp), %rax movq %rax, -0xc0(%rbp) leaq -0x70(%rbp), %rdi movq -0x18(%rbp), %rsi callq 0x21220 cmpl $0x0, %eax jne 0x45de0 movb $0x1, -0xd1(%rbp) movq -0x148(%rbp), %rcx addq $0x1, %rcx movq -0x10(%rbp), %rax movq %rcx, 0x28(%rax) jmp 0x45ef1 leaq -0x188(%rbp), %rdi movq %rdi, -0x290(%rbp) callq 0x266c0 movq -0x290(%rbp), %rdi movq -0xc0(%rbp), %rsi callq 0x26760 jmp 0x45e08 leaq -0x188(%rbp), %rdi callq 0x269b0 movq %rax, %rdi movq -0xc0(%rbp), %rdx movq -0x30(%rbp), %rcx movl $0x8, %esi callq 0x21240 jmp 0x45e2e movq $0x0, -0x190(%rbp) movq $0x0, -0x198(%rbp) movq -0x198(%rbp), %rax cmpq -0xc0(%rbp), %rax jae 0x45eb7 movq -0x198(%rbp), %rsi leaq -0x188(%rbp), %rdi callq 0x269d0 movq (%rax), %rax imulq -0xb8(%rbp), %rax addq -0x190(%rbp), %rax movq %rax, -0x190(%rbp) movq -0x198(%rbp), %rax addq $0x1, %rax movq %rax, -0x198(%rbp) jmp 0x45e44 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x128(%rbp) movl %eax, -0x12c(%rbp) leaq -0x188(%rbp), %rdi callq 0x26a00 jmp 0x4664c movq -0x30(%rbp), %rdi movq -0x190(%rbp), %rsi movl $0x1, %edx callq 0x211d0 jmp 0x45ece leaq -0x188(%rbp), %rdi callq 0x26a00 movq -0x148(%rbp), %rax addq $0x1, %rax movq %rax, -0x148(%rbp) jmp 0x45ced jmp 0x45ef3 testb $0x1, -0xd1(%rbp) jne 0x45fe0 movq -0x30(%rbp), %rdi movq -0xc8(%rbp), %rsi xorl %edx, %edx callq 0x211d0 leaq 0xf61a(%rip), %rdi # 0x55533 movl $0x2f, %esi callq 0x211c0 cmpq $0x0, %rax je 0x45f47 leaq 0xf603(%rip), %rdi # 0x55533 movl $0x2f, %esi callq 0x211c0 addq $0x1, %rax movq %rax, -0x298(%rbp) jmp 0x45f9a leaq 0xf5e5(%rip), %rdi # 0x55533 movl $0x5c, %esi callq 0x211c0 cmpq $0x0, %rax je 0x45f7c leaq 0xf5ce(%rip), %rdi # 0x55533 movl $0x5c, %esi callq 0x211c0 addq $0x1, %rax movq %rax, -0x2a0(%rbp) jmp 0x45f8c leaq 0xf5b0(%rip), %rax # 0x55533 movq %rax, -0x2a0(%rbp) jmp 0x45f8c movq -0x2a0(%rbp), %rax movq %rax, -0x298(%rbp) movq -0x298(%rbp), %rcx movq -0x10(%rbp), %r10 addq $0x70, %r10 movq -0x18(%rbp), %rax leaq 0x2027c(%rip), %rdi # 0x66230 movl $0xffffd8f1, %esi # imm = 0xFFFFD8F1 movl $0x1, %edx movl $0x252, %r8d # imm = 0x252 leaq 0x1069a(%rip), %r9 # 0x56665 movq %r10, (%rsp) movq %rax, 0x8(%rsp) movb $0x0, %al callq 0x53360 jmp 0x46636 leaq -0xb0(%rbp), %rdi movq -0x20(%rbp), %rsi callq 0x21220 cmpl $0x0, %eax je 0x460ee movq -0x30(%rbp), %rdi movq -0xc8(%rbp), %rsi xorl %edx, %edx callq 0x211d0 leaq 0xf521(%rip), %rdi # 0x55533 movl $0x2f, %esi callq 0x211c0 cmpq $0x0, %rax je 0x46040 leaq 0xf50a(%rip), %rdi # 0x55533 movl $0x2f, %esi callq 0x211c0 addq $0x1, %rax movq %rax, -0x2a8(%rbp) jmp 0x46093 leaq 0xf4ec(%rip), %rdi # 0x55533 movl $0x5c, %esi callq 0x211c0 cmpq $0x0, %rax je 0x46075 leaq 0xf4d5(%rip), %rdi # 0x55533 movl $0x5c, %esi callq 0x211c0 addq $0x1, %rax movq %rax, -0x2b0(%rbp) jmp 0x46085 leaq 0xf4b7(%rip), %rax # 0x55533 movq %rax, -0x2b0(%rbp) jmp 0x46085 movq -0x2b0(%rbp), %rax movq %rax, -0x2a8(%rbp) movq -0x2a8(%rbp), %rcx movq -0x10(%rbp), %rbx addq $0x70, %rbx movq -0x18(%rbp), %r11 leaq -0xb0(%rbp), %r10 movq -0x20(%rbp), %rax leaq 0x20178(%rip), %rdi # 0x66230 movl $0xffffd8f1, %esi # imm = 0xFFFFD8F1 movl $0x1, %edx movl $0x258, %r8d # imm = 0x258 leaq 0x105df(%rip), %r9 # 0x566ae movq %rbx, (%rsp) movq %r11, 0x8(%rsp) movq %r10, 0x10(%rsp) movq %rax, 0x18(%rsp) movb $0x0, %al callq 0x53360 jmp 0x46636 movq -0x10(%rbp), %rdi movq -0x18(%rbp), %rsi callq 0x21de0 cmpq $0x0, %rax jbe 0x4614a movq -0x10(%rbp), %rdi movq -0x18(%rbp), %rsi callq 0x21d40 movq %rax, -0x1a8(%rbp) movq -0x10(%rbp), %rdi addq $0x30, %rdi movq -0x1a8(%rbp), %rsi callq 0x260d0 movq %rax, %rdi callq 0x26c40 movq %rax, -0x1a0(%rbp) movq -0x1a0(%rbp), %rdi movq (%rdi), %rax callq *0x78(%rax) jmp 0x4623d movq -0x10(%rbp), %rax addq $0x30, %rax movq %rax, -0x2c0(%rbp) movl $0xb8, %edi callq 0x21190 movq %rax, %rdi movq %rdi, %rax movq %rax, -0x2b8(%rbp) callq 0x33630 jmp 0x46177 movq -0x2b8(%rbp), %rsi leaq -0x1b8(%rbp), %rdi movq %rdi, -0x2c8(%rbp) callq 0x2f710 movq -0x2c0(%rbp), %rdi movq -0x2c8(%rbp), %rsi callq 0x2f640 jmp 0x461a6 leaq -0x1b8(%rbp), %rdi callq 0x2f740 movq -0x10(%rbp), %rax addq $0x30, %rax movq %rax, -0x2d0(%rbp) movq -0x10(%rbp), %rdi addq $0x30, %rdi callq 0x260b0 movq -0x2d0(%rbp), %rdi movq %rax, %rsi subq $0x1, %rsi callq 0x260d0 movq %rax, %rdi callq 0x26c40 movq %rax, -0x1a0(%rbp) jmp 0x4623d movq -0x2b8(%rbp), %rdi movq %rax, %rcx movl %edx, %eax movq %rcx, -0x128(%rbp) movl %eax, -0x12c(%rbp) movl $0xb8, %esi callq 0x211a0 jmp 0x4664c movq %rax, %rcx movl %edx, %eax movq %rcx, -0x128(%rbp) movl %eax, -0x12c(%rbp) leaq -0x1b8(%rbp), %rdi callq 0x2f740 jmp 0x4664c movq -0x1a0(%rbp), %rdi leaq -0x70(%rbp), %rsi leaq -0xb0(%rbp), %rdx movq -0xd0(%rbp), %rcx movq -0x10(%rbp), %r8 callq 0x33690 movl %eax, -0x1bc(%rbp) cmpl $0x0, -0x1bc(%rbp) je 0x46340 leaq 0xf2ba(%rip), %rdi # 0x55533 movl $0x2f, %esi callq 0x211c0 cmpq $0x0, %rax je 0x462a7 leaq 0xf2a3(%rip), %rdi # 0x55533 movl $0x2f, %esi callq 0x211c0 addq $0x1, %rax movq %rax, -0x2d8(%rbp) jmp 0x462fa leaq 0xf285(%rip), %rdi # 0x55533 movl $0x5c, %esi callq 0x211c0 cmpq $0x0, %rax je 0x462dc leaq 0xf26e(%rip), %rdi # 0x55533 movl $0x5c, %esi callq 0x211c0 addq $0x1, %rax movq %rax, -0x2e0(%rbp) jmp 0x462ec leaq 0xf250(%rip), %rax # 0x55533 movq %rax, -0x2e0(%rbp) jmp 0x462ec movq -0x2e0(%rbp), %rax movq %rax, -0x2d8(%rbp) movq -0x2d8(%rbp), %rcx movq -0x10(%rbp), %r10 addq $0x70, %r10 movq -0x18(%rbp), %rax leaq 0x1ff1c(%rip), %rdi # 0x66230 movl $0xffffd8f1, %esi # imm = 0xFFFFD8F1 movl $0x1, %edx movl $0x268, %r8d # imm = 0x268 leaq 0x103de(%rip), %r9 # 0x56709 movq %r10, (%rsp) movq %rax, 0x8(%rsp) movb $0x0, %al callq 0x53360 jmp 0x46636 leaq -0x200(%rbp), %rdi movq %rdi, -0x2e8(%rbp) callq 0x266c0 movq -0x2e8(%rbp), %rdi movq -0xc0(%rbp), %rsi callq 0x26760 jmp 0x46368 leaq -0x200(%rbp), %rdi callq 0x269b0 movq %rax, %rdi movq -0xc0(%rbp), %rdx movq -0x30(%rbp), %rcx movl $0x8, %esi callq 0x21240 jmp 0x4638e leaq -0x240(%rbp), %rdi callq 0x34ba0 jmp 0x4639c movq $0x0, -0x248(%rbp) movq $0x0, -0x250(%rbp) movq -0x250(%rbp), %rax cmpq -0xc0(%rbp), %rax jae 0x465c5 movq -0x250(%rbp), %rsi leaq -0x200(%rbp), %rdi callq 0x269d0 movq (%rax), %rax movq %rax, -0x258(%rbp) movq -0x258(%rbp), %rax cmpq -0x248(%rbp), %rax jbe 0x46452 movq -0x258(%rbp), %rax movq %rax, -0x248(%rbp) movq -0x248(%rbp), %rsi leaq -0x240(%rbp), %rdi callq 0x361a0 jmp 0x46416 jmp 0x46452 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x128(%rbp) movl %eax, -0x12c(%rbp) jmp 0x46640 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x128(%rbp) movl %eax, -0x12c(%rbp) leaq -0x240(%rbp), %rdi callq 0x34860 jmp 0x46640 leaq -0x240(%rbp), %rdi callq 0x364f0 movq %rax, %rdi movq -0x258(%rbp), %rdx movq -0x30(%rbp), %rcx movl $0x4, %esi callq 0x21240 jmp 0x46478 movq -0x1a0(%rbp), %rax movq %rax, -0x2f8(%rbp) leaq -0x240(%rbp), %rdi callq 0x364f0 movq -0x2f8(%rbp), %rdi movq %rax, %rsi movq -0x258(%rbp), %rdx callq 0x3ea40 movl %eax, -0x2ec(%rbp) jmp 0x464b0 movl -0x2ec(%rbp), %eax movl %eax, -0x1bc(%rbp) cmpl $0x0, -0x1bc(%rbp) je 0x465ac leaq 0xf063(%rip), %rdi # 0x55533 movl $0x2f, %esi callq 0x211c0 cmpq $0x0, %rax je 0x464fe leaq 0xf04c(%rip), %rdi # 0x55533 movl $0x2f, %esi callq 0x211c0 addq $0x1, %rax movq %rax, -0x300(%rbp) jmp 0x46551 leaq 0xf02e(%rip), %rdi # 0x55533 movl $0x5c, %esi callq 0x211c0 cmpq $0x0, %rax je 0x46533 leaq 0xf017(%rip), %rdi # 0x55533 movl $0x5c, %esi callq 0x211c0 addq $0x1, %rax movq %rax, -0x308(%rbp) jmp 0x46543 leaq 0xeff9(%rip), %rax # 0x55533 movq %rax, -0x308(%rbp) jmp 0x46543 movq -0x308(%rbp), %rax movq %rax, -0x300(%rbp) movq -0x300(%rbp), %rcx movq -0x10(%rbp), %rdx addq $0x70, %rdx movq -0x18(%rbp), %rsi movq -0x250(%rbp), %rdi movq %rsp, %rax movq %rdi, 0x10(%rax) movq %rsi, 0x8(%rax) movq %rdx, (%rax) leaq 0x1fcb0(%rip), %rdi # 0x66230 leaq 0x101db(%rip), %r9 # 0x56762 xorl %eax, %eax movl $0xffffd8f1, %esi # imm = 0xFFFFD8F1 movl $0x1, %edx movl $0x273, %r8d # imm = 0x273 callq 0x53360 jmp 0x465a0 movl $0x1, -0x25c(%rbp) jmp 0x4661e jmp 0x465ae movq -0x250(%rbp), %rax addq $0x1, %rax movq %rax, -0x250(%rbp) jmp 0x463b2 movq -0x1a0(%rbp), %rdi movq (%rdi), %rax movq 0x30(%rax), %rax callq *%rax jmp 0x465d7 movq -0x10(%rbp), %rax movq 0x28(%rax), %rax movq -0x10(%rbp), %rcx cmpq 0x20(%rcx), %rax jb 0x46609 movq -0x10(%rbp), %rax movq $0x0, 0x28(%rax) movq -0x30(%rbp), %rdi movl $0xc, %esi xorl %edx, %edx callq 0x211d0 jmp 0x46607 jmp 0x46609 movq -0x10(%rbp), %rax movl $0x1, 0x8(%rax) movl $0x0, -0x25c(%rbp) leaq -0x240(%rbp), %rdi callq 0x34860 leaq -0x200(%rbp), %rdi callq 0x26a00 addq $0x328, %rsp # imm = 0x328 popq %rbx popq %rbp retq leaq -0x200(%rbp), %rdi callq 0x26a00 movq -0x128(%rbp), %rdi callq 0x212a0 nopl (%rax,%rax)
/terablade2001[P]CCEXP/C++/test/../src/include/CCEXP.hpp
ns_MVECTOR::MVECTOR<float>* CCEXP::getRow<float>(CCEXP::CCEXP&, char const*, unsigned long)
inline MVECTOR<T>* getRow( CCEXP &obj, const char* matname, size_t row ) { obj.ErrorId = 0; size_t sel = obj.getTableIndexByName(matname); CECS_ERRN(CCEXPECS,sel == MAXSIZE_T,"[%s]: getRow():: Failed to find table with name [%s]!", obj.SavingFile, matname); MVECTOR<T>* vret = getRow<T>(obj, sel, row); return vret; }
pushq %rbp movq %rsp, %rbp subq $0x60, %rsp movq %rdi, -0x10(%rbp) movq %rsi, -0x18(%rbp) movq %rdx, -0x20(%rbp) movq -0x10(%rbp), %rax movl $0x0, 0x14(%rax) movq -0x10(%rbp), %rdi movq -0x18(%rbp), %rsi callq 0x21d40 movq %rax, -0x28(%rbp) movq -0x28(%rbp), %rax movq %rax, -0x38(%rbp) callq 0x260a0 movq %rax, %rcx movq -0x38(%rbp), %rax cmpq %rcx, %rax jne 0x4836e leaq 0xd27f(%rip), %rdi # 0x55533 movl $0x2f, %esi callq 0x211c0 cmpq $0x0, %rax je 0x482df leaq 0xd268(%rip), %rdi # 0x55533 movl $0x2f, %esi callq 0x211c0 addq $0x1, %rax movq %rax, -0x40(%rbp) jmp 0x48326 leaq 0xd24d(%rip), %rdi # 0x55533 movl $0x5c, %esi callq 0x211c0 cmpq $0x0, %rax je 0x48311 leaq 0xd236(%rip), %rdi # 0x55533 movl $0x5c, %esi callq 0x211c0 addq $0x1, %rax movq %rax, -0x48(%rbp) jmp 0x4831e leaq 0xd21b(%rip), %rax # 0x55533 movq %rax, -0x48(%rbp) jmp 0x4831e movq -0x48(%rbp), %rax movq %rax, -0x40(%rbp) movq -0x40(%rbp), %rcx movq -0x10(%rbp), %r10 addq $0x70, %r10 movq -0x18(%rbp), %rax leaq 0x1def3(%rip), %rdi # 0x66230 movl $0xffffd8f1, %esi # imm = 0xFFFFD8F1 movl $0x1, %edx movl $0x33d, %r8d # imm = 0x33D leaq 0xe474(%rip), %r9 # 0x567c8 movq %r10, (%rsp) movq %rax, 0x8(%rsp) movb $0x0, %al callq 0x53360 movq $0x0, -0x8(%rbp) jmp 0x4838b movq -0x10(%rbp), %rdi movq -0x28(%rbp), %rsi movq -0x20(%rbp), %rdx callq 0x4c7b0 movq %rax, -0x30(%rbp) movq -0x30(%rbp), %rax movq %rax, -0x8(%rbp) movq -0x8(%rbp), %rax addq $0x60, %rsp popq %rbp retq nopw %cs:(%rax,%rax) nop
/terablade2001[P]CCEXP/C++/test/../src/include/CCEXP.hpp
float* CCEXP::getRow<float>(CCEXP::CCEXP&, char const*, unsigned long, unsigned long&)
inline T* getRow( CCEXP &obj, const char* matname, size_t row, size_t &cols ) { obj.ErrorId = 0; size_t sel = obj.getTableIndexByName(matname); CECS_ERRN(CCEXPECS,sel == MAXSIZE_T,"[%s]:: getRow():: Failed to find table with name [%s]!", obj.SavingFile, matname); T* vret = getRow<T>(obj, sel, row, cols); return vret; }
pushq %rbp movq %rsp, %rbp subq $0x60, %rsp movq %rdi, -0x10(%rbp) movq %rsi, -0x18(%rbp) movq %rdx, -0x20(%rbp) movq %rcx, -0x28(%rbp) movq -0x10(%rbp), %rax movl $0x0, 0x14(%rax) movq -0x10(%rbp), %rdi movq -0x18(%rbp), %rsi callq 0x21d40 movq %rax, -0x30(%rbp) movq -0x30(%rbp), %rax movq %rax, -0x40(%rbp) callq 0x260a0 movq %rax, %rcx movq -0x40(%rbp), %rax cmpq %rcx, %rax jne 0x48622 leaq 0xcfcb(%rip), %rdi # 0x55533 movl $0x2f, %esi callq 0x211c0 cmpq $0x0, %rax je 0x48593 leaq 0xcfb4(%rip), %rdi # 0x55533 movl $0x2f, %esi callq 0x211c0 addq $0x1, %rax movq %rax, -0x48(%rbp) jmp 0x485da leaq 0xcf99(%rip), %rdi # 0x55533 movl $0x5c, %esi callq 0x211c0 cmpq $0x0, %rax je 0x485c5 leaq 0xcf82(%rip), %rdi # 0x55533 movl $0x5c, %esi callq 0x211c0 addq $0x1, %rax movq %rax, -0x50(%rbp) jmp 0x485d2 leaq 0xcf67(%rip), %rax # 0x55533 movq %rax, -0x50(%rbp) jmp 0x485d2 movq -0x50(%rbp), %rax movq %rax, -0x48(%rbp) movq -0x48(%rbp), %rcx movq -0x10(%rbp), %r10 addq $0x70, %r10 movq -0x18(%rbp), %rax leaq 0x1dc3f(%rip), %rdi # 0x66230 movl $0xffffd8f1, %esi # imm = 0xFFFFD8F1 movl $0x1, %edx movl $0x350, %r8d # imm = 0x350 leaq 0xe3ea(%rip), %r9 # 0x569f2 movq %r10, (%rsp) movq %rax, 0x8(%rsp) movb $0x0, %al callq 0x53360 movq $0x0, -0x8(%rbp) jmp 0x48643 movq -0x10(%rbp), %rdi movq -0x30(%rbp), %rsi movq -0x20(%rbp), %rdx movq -0x28(%rbp), %rcx callq 0x4d020 movq %rax, -0x38(%rbp) movq -0x38(%rbp), %rax movq %rax, -0x8(%rbp) movq -0x8(%rbp), %rax addq $0x60, %rsp popq %rbp retq nopl (%rax)
/terablade2001[P]CCEXP/C++/test/../src/include/CCEXP.hpp
CECS::Shutdown()
void CECS::Shutdown(void) { if (pCECS != NULL) { CECS_Shutdown(pCECS); pCECS = NULL; } if (EcsName != NULL) { free(EcsName); EcsName = NULL; } if (ModName != NULL) { free(ModName); ModName = NULL; } }
pushq %rbp movq %rsp, %rbp subq $0x10, %rsp movq %rdi, -0x8(%rbp) movq -0x8(%rbp), %rax movq %rax, -0x10(%rbp) cmpq $0x0, 0x10(%rax) je 0x531f4 movq -0x10(%rbp), %rax movq 0x10(%rax), %rdi callq 0x51310 movq -0x10(%rbp), %rax movq $0x0, 0x10(%rax) movq -0x10(%rbp), %rax cmpq $0x0, (%rax) je 0x53215 movq -0x10(%rbp), %rax movq (%rax), %rdi callq 0x211f0 movq -0x10(%rbp), %rax movq $0x0, (%rax) movq -0x10(%rbp), %rax cmpq $0x0, 0x8(%rax) je 0x53239 movq -0x10(%rbp), %rax movq 0x8(%rax), %rdi callq 0x211f0 movq -0x10(%rbp), %rax movq $0x0, 0x8(%rax) addq $0x10, %rsp popq %rbp retq nop
/terablade2001[P]CCEXP/sub_modules/CECS/C++/src/CECS.cpp
aGLTextureUpdate
void aGLTextureUpdate(AGLTexture *tex, const AGLTextureData *data) { ATTO_ASSERT(data->type == tex->type); struct A__GLTextureFormat tf = getTextureFormat(data->format); a__gl_texture_upload_func *upload_func = NULL; GLenum binding = 0; switch (data->type) { case AGLTT_1D: upload_func = &a__GLTexureUpload1D; binding = GL_TEXTURE_1D; break; case AGLTT_2D: upload_func = &a__GLTexureUpload2D; binding = GL_TEXTURE_2D; break; case AGLTT_3D: upload_func = &a__GLTexureUpload3D; binding = GL_TEXTURE_3D; break; case AGLTT_2DArray: upload_func = &a__GLTexureUpload3D; binding = GL_TEXTURE_2D_ARRAY; break; case AGLTT_NULL: ATTO_ASSERT(!"Invalid texture type"); } ATTO_ASSERT(upload_func); // TODO track bindings properly AGL__CALL(glBindTexture(binding, tex->_.name)); upload_func(tex, data, binding, tf); if (data->pixels && (data->flags & AGLTUF_GenerateMipmaps)) AGL__CALL(glGenerateMipmap(binding)); tex->format = data->format; }
pushq %rbp movq %rsp, %rbp subq $0x60, %rsp movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movq -0x10(%rbp), %rax movl (%rax), %eax movq -0x8(%rbp), %rcx cmpl (%rcx), %eax je 0x3d49 leaq 0x45d4(%rip), %rdi # 0x82f9 leaq 0x45e8(%rip), %rsi # 0x8314 movl $0x42d, %edx # imm = 0x42D leaq 0x462b(%rip), %rcx # 0x8363 movb $0x0, %al callq 0x6810 movl $0xffffffff, %edi # imm = 0xFFFFFFFF callq 0x68f0 movq -0x10(%rbp), %rax movl 0x4(%rax), %edi callq 0x3ec0 movl %edx, -0x28(%rbp) movq %rax, -0x30(%rbp) movl -0x28(%rbp), %eax movl %eax, -0x18(%rbp) movq -0x30(%rbp), %rax movq %rax, -0x20(%rbp) movq $0x0, -0x38(%rbp) movl $0x0, -0x3c(%rbp) movq -0x10(%rbp), %rax movl (%rax), %eax movq %rax, -0x58(%rbp) subq $0x4, %rax ja 0x3e1c movq -0x58(%rbp), %rax leaq 0x4278(%rip), %rcx # 0x8010 movslq (%rcx,%rax,4), %rax addq %rcx, %rax jmpq *%rax leaq 0x2b8(%rip), %rax # 0x4060 movq %rax, -0x38(%rbp) movl $0xde0, -0x3c(%rbp) # imm = 0xDE0 jmp 0x3e1c leaq 0x424(%rip), %rax # 0x41e0 movq %rax, -0x38(%rbp) movl $0xde1, -0x3c(%rbp) # imm = 0xDE1 jmp 0x3e1c leaq 0x600(%rip), %rax # 0x43d0 movq %rax, -0x38(%rbp) movl $0x806f, -0x3c(%rbp) # imm = 0x806F jmp 0x3e1c leaq 0x5ec(%rip), %rax # 0x43d0 movq %rax, -0x38(%rbp) movl $0x8c1a, -0x3c(%rbp) # imm = 0x8C1A jmp 0x3e1c leaq 0x4501(%rip), %rdi # 0x82f9 leaq 0x4515(%rip), %rsi # 0x8314 movl $0x445, %edx # imm = 0x445 leaq 0x4570(%rip), %rcx # 0x837b movb $0x0, %al callq 0x6810 movl $0xffffffff, %edi # imm = 0xFFFFFFFF callq 0x68f0 cmpq $0x0, -0x38(%rbp) jne 0x3e4e leaq 0x44cf(%rip), %rdi # 0x82f9 leaq 0x44e3(%rip), %rsi # 0x8314 movl $0x447, %edx # imm = 0x447 leaq 0x4556(%rip), %rcx # 0x8393 movb $0x0, %al callq 0x6810 movl $0xffffffff, %edi # imm = 0xFFFFFFFF callq 0x68f0 movl -0x3c(%rbp), %edi movq -0x8(%rbp), %rax movl 0x24(%rax), %esi callq 0x3360 movq -0x38(%rbp), %rax movq -0x8(%rbp), %rdi movq -0x10(%rbp), %rsi movl -0x3c(%rbp), %edx movq -0x20(%rbp), %rcx movq %rcx, -0x4c(%rbp) movl -0x18(%rbp), %ecx movl %ecx, -0x44(%rbp) movq -0x4c(%rbp), %rcx movl -0x44(%rbp), %r8d callq *%rax movq -0x10(%rbp), %rax cmpq $0x0, 0x28(%rax) je 0x3ea6 movq -0x10(%rbp), %rax movl 0x20(%rax), %eax andl $0x1, %eax cmpl $0x0, %eax je 0x3ea6 movl -0x3c(%rbp), %edi callq 0x33e0 movq -0x10(%rbp), %rax movl 0x4(%rax), %ecx movq -0x8(%rbp), %rax movl %ecx, 0x4(%rax) addq $0x60, %rsp popq %rbp retq nopw (%rax,%rax)
/w23[P]atto/include/atto/gl.h
getTextureFormat
static struct A__GLTextureFormat getTextureFormat(AGLTextureFormat aformat) { struct A__GLTextureFormat tf = {0}; switch (aformat) { case AGLTF_U8_R: tf.internal = tf.format = GL_LUMINANCE; tf.type = GL_UNSIGNED_BYTE; break; case AGLTF_U8_RA: tf.internal = tf.format = GL_LUMINANCE_ALPHA; tf.type = GL_UNSIGNED_BYTE; break; case AGLTF_U8_RGB: tf.internal = tf.format = GL_RGB; tf.type = GL_UNSIGNED_BYTE; break; case AGLTF_U8_RGBA: tf.internal = tf.format = GL_RGBA; tf.type = GL_UNSIGNED_BYTE; break; case AGLTF_U565_RGB: tf.internal = tf.format = GL_RGB; tf.type = GL_UNSIGNED_SHORT_5_6_5; break; case AGLTF_U5551_RGBA: tf.internal = tf.format = GL_RGBA; tf.type = GL_UNSIGNED_SHORT_5_5_5_1; break; case AGLTF_U4444_RGBA: tf.internal = tf.format = GL_RGBA; tf.type = GL_UNSIGNED_SHORT_4_4_4_4; break; case AGLTF_F32_R: #ifdef GL_R32F tf.internal = GL_R32F; tf.format = GL_RED; tf.type = GL_FLOAT; #else ATTO_ASSERT(!"Unknown format"); #endif break; case AGLTF_F32_RGBA: #ifdef GL_RGBA32F tf.internal = GL_RGBA32F; tf.format = GL_RGBA; tf.type = GL_FLOAT; #else ATTO_ASSERT(!"Unknown format"); #endif break; case AGLTF_Unknown: ATTO_ASSERT(!"Unknown format"); } ATTO_ASSERT(tf.internal != 0); return tf; }
pushq %rbp movq %rsp, %rbp subq $0x30, %rsp movl %edi, -0x14(%rbp) movl $0x0, -0x8(%rbp) movq $0x0, -0x10(%rbp) movl -0x14(%rbp), %eax movq %rax, -0x30(%rbp) subq $0x9, %rax ja 0x4008 movq -0x30(%rbp), %rax leaq 0x412e(%rip), %rcx # 0x8024 movslq (%rcx,%rax,4), %rax addq %rcx, %rax jmpq *%rax movl $0x1909, -0xc(%rbp) # imm = 0x1909 movl $0x1909, -0x10(%rbp) # imm = 0x1909 movl $0x1401, -0x8(%rbp) # imm = 0x1401 jmp 0x4008 movl $0x190a, -0xc(%rbp) # imm = 0x190A movl $0x190a, -0x10(%rbp) # imm = 0x190A movl $0x1401, -0x8(%rbp) # imm = 0x1401 jmp 0x4008 movl $0x1907, -0xc(%rbp) # imm = 0x1907 movl $0x1907, -0x10(%rbp) # imm = 0x1907 movl $0x1401, -0x8(%rbp) # imm = 0x1401 jmp 0x4008 movl $0x1908, -0xc(%rbp) # imm = 0x1908 movl $0x1908, -0x10(%rbp) # imm = 0x1908 movl $0x1401, -0x8(%rbp) # imm = 0x1401 jmp 0x4008 movl $0x1907, -0xc(%rbp) # imm = 0x1907 movl $0x1907, -0x10(%rbp) # imm = 0x1907 movl $0x8363, -0x8(%rbp) # imm = 0x8363 jmp 0x4008 movl $0x1908, -0xc(%rbp) # imm = 0x1908 movl $0x1908, -0x10(%rbp) # imm = 0x1908 movl $0x8034, -0x8(%rbp) # imm = 0x8034 jmp 0x4008 movl $0x1908, -0xc(%rbp) # imm = 0x1908 movl $0x1908, -0x10(%rbp) # imm = 0x1908 movl $0x8033, -0x8(%rbp) # imm = 0x8033 jmp 0x4008 movl $0x822e, -0x10(%rbp) # imm = 0x822E movl $0x1903, -0xc(%rbp) # imm = 0x1903 movl $0x1406, -0x8(%rbp) # imm = 0x1406 jmp 0x4008 movl $0x8814, -0x10(%rbp) # imm = 0x8814 movl $0x1908, -0xc(%rbp) # imm = 0x1908 movl $0x1406, -0x8(%rbp) # imm = 0x1406 jmp 0x4008 leaq 0x4315(%rip), %rdi # 0x82f9 leaq 0x4329(%rip), %rsi # 0x8314 movl $0x3d5, %edx # imm = 0x3D5 leaq 0x43d7(%rip), %rcx # 0x83ce movb $0x0, %al callq 0x6810 movl $0xffffffff, %edi # imm = 0xFFFFFFFF callq 0x68f0 cmpl $0x0, -0x10(%rbp) jne 0x4039 leaq 0x42e4(%rip), %rdi # 0x82f9 leaq 0x42f8(%rip), %rsi # 0x8314 movl $0x3d7, %edx # imm = 0x3D7 leaq 0x43b8(%rip), %rcx # 0x83e0 movb $0x0, %al callq 0x6810 movl $0xffffffff, %edi # imm = 0xFFFFFFFF callq 0x68f0 movl -0x8(%rbp), %eax movl %eax, -0x20(%rbp) movq -0x10(%rbp), %rax movq %rax, -0x28(%rbp) movq -0x28(%rbp), %rax movl -0x20(%rbp), %edx addq $0x30, %rsp popq %rbp retq nopw %cs:(%rax,%rax)
/w23[P]atto/include/atto/gl.h
aGLDraw
void aGLDraw(const AGLDrawSource *src, const AGLDrawMerge *merge, const AGLDrawTarget *target) { ATTO_GL_PROFILE_PREAMBLE a__GLTargetBind(target); a__GLDepthBind(merge->depth); a__GLBlendBind(&merge->blend); a__GLProgramBind(src->program, src->uniforms.p, src->uniforms.n); a__GLAttribsBind(src->attribs.p, src->attribs.n); a__GLCullingBind(src->primitive.cull_mode, src->primitive.front_face); if (src->primitive.index.buffer || src->primitive.index.data.ptr) { if (src->primitive.index.buffer) { /* FIXME store binding in state */ AGL__CALL(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, src->primitive.index.buffer->name)); } else { AGL__CALL(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0)); } AGL__CALL(glDrawElements( src->primitive.mode, src->primitive.count, src->primitive.index.type, src->primitive.index.data.ptr)); } else AGL__CALL(glDrawArrays(src->primitive.mode, src->primitive.first, src->primitive.count)); ATTO_GL_PROFILE_FUNC("aGLDraw", aAppTime() - start); }
pushq %rbp movq %rsp, %rbp subq $0x20, %rsp movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movq %rdx, -0x18(%rbp) movq -0x18(%rbp), %rdi callq 0x47b0 movq -0x10(%rbp), %rax movq 0x2c(%rax), %rdi callq 0x4860 movq -0x10(%rbp), %rdi callq 0x48f0 movq -0x8(%rbp), %rax movl (%rax), %edi movq -0x8(%rbp), %rax movq 0x8(%rax), %rsi movq -0x8(%rbp), %rax movl 0x10(%rax), %edx callq 0x4b10 movq -0x8(%rbp), %rax movq 0x18(%rax), %rdi movq -0x8(%rbp), %rax movl 0x20(%rax), %esi callq 0x4e10 movq -0x8(%rbp), %rax movl 0x50(%rax), %edi movq -0x8(%rbp), %rax movl 0x54(%rax), %esi callq 0x50c0 movq -0x8(%rbp), %rax cmpq $0x0, 0x48(%rax) jne 0x473a movq -0x8(%rbp), %rax cmpq $0x0, 0x40(%rax) je 0x478b movq -0x8(%rbp), %rax cmpq $0x0, 0x48(%rax) je 0x475b movq -0x8(%rbp), %rax movq 0x48(%rax), %rax movl (%rax), %esi movl $0x8893, %edi # imm = 0x8893 callq 0x3580 jmp 0x4767 movl $0x8893, %edi # imm = 0x8893 xorl %esi, %esi callq 0x3580 movq -0x8(%rbp), %rax movl 0x28(%rax), %edi movq -0x8(%rbp), %rax movl 0x2c(%rax), %esi movq -0x8(%rbp), %rax movl 0x38(%rax), %edx movq -0x8(%rbp), %rax movq 0x40(%rax), %rcx callq 0x3470 jmp 0x47a5 movq -0x8(%rbp), %rax movl 0x28(%rax), %edi movq -0x8(%rbp), %rax movl 0x30(%rax), %esi movq -0x8(%rbp), %rax movl 0x2c(%rax), %edx callq 0x3510 addq $0x20, %rsp popq %rbp retq nopl (%rax,%rax)
/w23[P]atto/include/atto/gl.h
a__GLTargetBind
static void a__GLTargetBind(const AGLDrawTarget *target) { ATTO_GL_PROFILE_PREAMBLE a__GLFramebufferBind(target->framebuffer); if (target->viewport.x != a__gl_state.viewport.x || target->viewport.y != a__gl_state.viewport.y || target->viewport.w != a__gl_state.viewport.w || target->viewport.h != a__gl_state.viewport.h) { a__gl_state.viewport.x = target->viewport.x; a__gl_state.viewport.y = target->viewport.y; a__gl_state.viewport.w = target->viewport.w; a__gl_state.viewport.h = target->viewport.h; AGL__CALL(glViewport(target->viewport.x, target->viewport.y, target->viewport.w, target->viewport.h)); } ATTO_GL_PROFILE_FUNC(__FUNCTION__, aAppTime() - start); }
pushq %rbp movq %rsp, %rbp subq $0x10, %rsp movq %rdi, -0x8(%rbp) movq -0x8(%rbp), %rax movq 0x10(%rax), %rdi callq 0x5b10 movq -0x8(%rbp), %rax movl (%rax), %eax cmpl 0x6e37(%rip), %eax # 0xb60c jne 0x4804 movq -0x8(%rbp), %rax movl 0x4(%rax), %eax cmpl 0x6e2c(%rip), %eax # 0xb610 jne 0x4804 movq -0x8(%rbp), %rax movl 0x8(%rax), %eax cmpl 0x6e21(%rip), %eax # 0xb614 jne 0x4804 movq -0x8(%rbp), %rax movl 0xc(%rax), %eax cmpl 0x6e16(%rip), %eax # 0xb618 je 0x4857 movq -0x8(%rbp), %rax movl (%rax), %eax movl %eax, 0x6dfc(%rip) # 0xb60c movq -0x8(%rbp), %rax movl 0x4(%rax), %eax movl %eax, 0x6df3(%rip) # 0xb610 movq -0x8(%rbp), %rax movl 0x8(%rax), %eax movl %eax, 0x6dea(%rip) # 0xb614 movq -0x8(%rbp), %rax movl 0xc(%rax), %eax movl %eax, 0x6de1(%rip) # 0xb618 movq -0x8(%rbp), %rax movl (%rax), %edi movq -0x8(%rbp), %rax movl 0x4(%rax), %esi movq -0x8(%rbp), %rax movl 0x8(%rax), %edx movq -0x8(%rbp), %rax movl 0xc(%rax), %ecx callq 0x3630 addq $0x10, %rsp popq %rbp retq nopl (%rax)
/w23[P]atto/include/atto/gl.h
a__GLDepthBind
static void a__GLDepthBind(AGLDepthParams depth) { AGLDepthParams *cur = &a__gl_state.depth; if (depth.mode != cur->mode) { if (depth.mode == AGLDM_Disabled) { AGL__CALL(glDisable(GL_DEPTH_TEST)); } else { AGL__CALL(glEnable(GL_DEPTH_TEST)); AGL__CALL(glDepthMask(depth.mode == AGLDM_TestAndWrite)); } cur->mode = depth.mode; } if (cur->mode == AGLDM_Disabled) return; if (depth.func != cur->func) AGL__CALL(glDepthFunc(cur->func = depth.func)); }
pushq %rbp movq %rsp, %rbp subq $0x10, %rsp movq %rdi, -0x8(%rbp) leaq 0x6b4d(%rip), %rax # 0xb3c0 addq $0x38, %rax movq %rax, -0x10(%rbp) movl -0x8(%rbp), %eax movq -0x10(%rbp), %rcx cmpl (%rcx), %eax je 0x48bf cmpl $0x0, -0x8(%rbp) jne 0x4898 movl $0xb71, %edi # imm = 0xB71 callq 0x30e0 jmp 0x48b6 movl $0xb71, %edi # imm = 0xB71 callq 0x3050 cmpl $0x3, -0x8(%rbp) sete %al andb $0x1, %al movzbl %al, %eax movzbl %al, %edi callq 0x33b0 movl -0x8(%rbp), %ecx movq -0x10(%rbp), %rax movl %ecx, (%rax) movq -0x10(%rbp), %rax cmpl $0x0, (%rax) jne 0x48ca jmp 0x48e5 movl -0x4(%rbp), %eax movq -0x10(%rbp), %rcx cmpl 0x4(%rcx), %eax je 0x48e5 movl -0x4(%rbp), %edi movq -0x10(%rbp), %rax movl %edi, 0x4(%rax) callq 0x3500 addq $0x10, %rsp popq %rbp retq nopl (%rax,%rax)
/w23[P]atto/include/atto/gl.h
a__GLBlendBind
static void a__GLBlendBind(const AGLBlendParams *blend) { AGLBlendParams *cur = &a__gl_state.blend; if (blend->enable != cur->enable) { cur->enable = blend->enable; if (!blend->enable) AGL__CALL(glDisable(GL_BLEND)); else AGL__CALL(glEnable(GL_BLEND)); } if (!cur->enable) return; if (blend->color.r != cur->color.r || blend->color.g != cur->color.g || blend->color.b != cur->color.b || blend->color.a != cur->color.a) { cur->color = blend->color; AGL__CALL(glBlendColor(cur->color.r, cur->color.g, cur->color.b, cur->color.a)); } if (blend->equation.rgb != cur->equation.rgb || blend->equation.a != cur->equation.a) { cur->equation = blend->equation; if (cur->equation.rgb == cur->equation.a) AGL__CALL(glBlendEquation(cur->equation.rgb)); else AGL__CALL(glBlendEquationSeparate(cur->equation.rgb, cur->equation.a)); } if (blend->func.src_rgb != cur->func.src_rgb || blend->func.dst_rgb != cur->func.dst_rgb || blend->func.src_a != cur->func.src_a || blend->func.dst_a != cur->func.dst_a) { cur->func = blend->func; if (cur->func.src_rgb == cur->func.src_a && cur->func.dst_rgb == cur->func.dst_a) AGL__CALL(glBlendFunc(cur->func.src_rgb, cur->func.dst_rgb)); else AGL__CALL(glBlendFuncSeparate(cur->func.src_rgb, cur->func.dst_rgb, cur->func.src_a, cur->func.dst_a)); } }
pushq %rbp movq %rsp, %rbp subq $0x10, %rsp movq %rdi, -0x8(%rbp) leaq 0x6abd(%rip), %rax # 0xb3c0 addq $0xc, %rax movq %rax, -0x10(%rbp) movq -0x8(%rbp), %rax movl (%rax), %eax movq -0x10(%rbp), %rcx cmpl (%rcx), %eax je 0x4946 movq -0x8(%rbp), %rax movl (%rax), %ecx movq -0x10(%rbp), %rax movl %ecx, (%rax) movq -0x8(%rbp), %rax cmpl $0x0, (%rax) jne 0x493a movl $0xbe2, %edi # imm = 0xBE2 callq 0x30e0 jmp 0x4944 movl $0xbe2, %edi # imm = 0xBE2 callq 0x3050 jmp 0x4946 movq -0x10(%rbp), %rax cmpl $0x0, (%rax) jne 0x4954 jmp 0x4afe movq -0x8(%rbp), %rax movss 0x4(%rax), %xmm0 movq -0x10(%rbp), %rax ucomiss 0x4(%rax), %xmm0 jne 0x49aa jp 0x49aa movq -0x8(%rbp), %rax movss 0x8(%rax), %xmm0 movq -0x10(%rbp), %rax ucomiss 0x8(%rax), %xmm0 jne 0x49aa jp 0x49aa movq -0x8(%rbp), %rax movss 0xc(%rax), %xmm0 movq -0x10(%rbp), %rax ucomiss 0xc(%rax), %xmm0 jne 0x49aa jp 0x49aa movq -0x8(%rbp), %rax movss 0x10(%rax), %xmm0 movq -0x10(%rbp), %rax ucomiss 0x10(%rax), %xmm0 jne 0x49aa jp 0x49aa jmp 0x49eb movq -0x10(%rbp), %rax movq -0x8(%rbp), %rcx movq 0x4(%rcx), %rdx movq %rdx, 0x4(%rax) movq 0xc(%rcx), %rcx movq %rcx, 0xc(%rax) movq -0x10(%rbp), %rax movss 0x4(%rax), %xmm0 movq -0x10(%rbp), %rax movss 0x8(%rax), %xmm1 movq -0x10(%rbp), %rax movss 0xc(%rax), %xmm2 movq -0x10(%rbp), %rax movss 0x10(%rax), %xmm3 callq 0x32b0 movq -0x8(%rbp), %rax movl 0x14(%rax), %eax movq -0x10(%rbp), %rcx cmpl 0x14(%rcx), %eax jne 0x4a0b movq -0x8(%rbp), %rax movl 0x18(%rax), %eax movq -0x10(%rbp), %rcx cmpl 0x18(%rcx), %eax je 0x4a4e movq -0x10(%rbp), %rax movq -0x8(%rbp), %rcx movq 0x14(%rcx), %rcx movq %rcx, 0x14(%rax) movq -0x10(%rbp), %rax movl 0x14(%rax), %eax movq -0x10(%rbp), %rcx cmpl 0x18(%rcx), %eax jne 0x4a39 movq -0x10(%rbp), %rax movl 0x14(%rax), %edi callq 0x3400 jmp 0x4a4c movq -0x10(%rbp), %rax movl 0x14(%rax), %edi movq -0x10(%rbp), %rax movl 0x18(%rax), %esi callq 0x3170 jmp 0x4a4e movq -0x8(%rbp), %rax movl 0x1c(%rax), %eax movq -0x10(%rbp), %rcx cmpl 0x1c(%rcx), %eax jne 0x4a8e movq -0x8(%rbp), %rax movl 0x24(%rax), %eax movq -0x10(%rbp), %rcx cmpl 0x24(%rcx), %eax jne 0x4a8e movq -0x8(%rbp), %rax movl 0x20(%rax), %eax movq -0x10(%rbp), %rcx cmpl 0x20(%rcx), %eax jne 0x4a8e movq -0x8(%rbp), %rax movl 0x28(%rax), %eax movq -0x10(%rbp), %rcx cmpl 0x28(%rcx), %eax je 0x4afe movq -0x10(%rbp), %rax movq -0x8(%rbp), %rcx movq 0x1c(%rcx), %rdx movq %rdx, 0x1c(%rax) movq 0x24(%rcx), %rcx movq %rcx, 0x24(%rax) movq -0x10(%rbp), %rax movl 0x1c(%rax), %eax movq -0x10(%rbp), %rcx cmpl 0x20(%rcx), %eax jne 0x4adb movq -0x10(%rbp), %rax movl 0x24(%rax), %eax movq -0x10(%rbp), %rcx cmpl 0x28(%rcx), %eax jne 0x4adb movq -0x10(%rbp), %rax movl 0x1c(%rax), %edi movq -0x10(%rbp), %rax movl 0x24(%rax), %esi callq 0x3330 jmp 0x4afc movq -0x10(%rbp), %rax movl 0x1c(%rax), %edi movq -0x10(%rbp), %rax movl 0x24(%rax), %esi movq -0x10(%rbp), %rax movl 0x20(%rax), %edx movq -0x10(%rbp), %rax movl 0x28(%rax), %ecx callq 0x3090 jmp 0x4afe addq $0x10, %rsp popq %rbp retq nopw %cs:(%rax,%rax)
/w23[P]atto/include/atto/gl.h
a__GLProgramBind
void a__GLProgramBind(AGLProgram program, const AGLProgramUniform *uniforms, int nuniforms) { ATTO_GL_PROFILE_START int i, texture_unit = 0; AGL__CALL(glUseProgram(program)); for (i = 0; i < nuniforms; ++i) { ATTO_GL_PROFILE_START const int loc = uniforms[i]._.location; if (loc == -1) { /*AGL_PRINTFLN("Skipping %s", uniforms[i].name);*/ continue; } switch (uniforms[i].type) { case AGLAT_Float: AGL__CALL(glUniform1fv(loc, uniforms[i].count, uniforms[i].value.pf)); break; case AGLAT_Vec2: AGL__CALL(glUniform2fv(loc, uniforms[i].count, uniforms[i].value.pf)); break; case AGLAT_Vec3: AGL__CALL(glUniform3fv(loc, uniforms[i].count, uniforms[i].value.pf)); break; case AGLAT_Vec4: AGL__CALL(glUniform4fv(loc, uniforms[i].count, uniforms[i].value.pf)); break; case AGLAT_Mat2: AGL__CALL(glUniformMatrix2fv(loc, uniforms[i].count, GL_FALSE, uniforms[i].value.pf)); break; case AGLAT_Mat3: AGL__CALL(glUniformMatrix3fv(loc, uniforms[i].count, GL_FALSE, uniforms[i].value.pf)); break; case AGLAT_Mat4: AGL__CALL(glUniformMatrix4fv(loc, uniforms[i].count, GL_FALSE, uniforms[i].value.pf)); break; case AGLAT_Int: AGL__CALL(glUniform1iv(loc, uniforms[i].count, uniforms[i].value.pi)); break; case AGLAT_IVec2: AGL__CALL(glUniform2iv(loc, uniforms[i].count, uniforms[i].value.pi)); break; case AGLAT_IVec3: AGL__CALL(glUniform3iv(loc, uniforms[i].count, uniforms[i].value.pi)); break; case AGLAT_IVec4: AGL__CALL(glUniform4iv(loc, uniforms[i].count, uniforms[i].value.pi)); break; case AGLAT_Texture: a__GLTextureBind(uniforms[i].value.texture, texture_unit); AGL__CALL(glUniform1i(loc, texture_unit)); ++texture_unit; } ATTO_GL_PROFILE_END_NAME("per uniform") } ATTO_GL_PROFILE_END }
pushq %rbp movq %rsp, %rbp subq $0x30, %rsp movl %edi, -0x4(%rbp) movq %rsi, -0x10(%rbp) movl %edx, -0x14(%rbp) movl $0x0, -0x1c(%rbp) movl -0x4(%rbp), %edi callq 0x31f0 movl $0x0, -0x18(%rbp) movl -0x18(%rbp), %eax cmpl -0x14(%rbp), %eax jge 0x4dfb movq -0x10(%rbp), %rax movslq -0x18(%rbp), %rcx shlq $0x5, %rcx addq %rcx, %rax movl 0x18(%rax), %eax movl %eax, -0x20(%rbp) cmpl $-0x1, -0x20(%rbp) jne 0x4b64 jmp 0x4ded movq -0x10(%rbp), %rax movslq -0x18(%rbp), %rcx shlq $0x5, %rcx movl 0x8(%rax,%rcx), %eax movq %rax, -0x28(%rbp) subq $0xb, %rax ja 0x4deb movq -0x28(%rbp), %rax leaq 0x34bf(%rip), %rcx # 0x804c movslq (%rcx,%rax,4), %rax addq %rcx, %rax jmpq *%rax movl -0x20(%rbp), %edi movq -0x10(%rbp), %rax movslq -0x18(%rbp), %rcx shlq $0x5, %rcx addq %rcx, %rax movl 0xc(%rax), %esi movq -0x10(%rbp), %rax movslq -0x18(%rbp), %rcx shlq $0x5, %rcx addq %rcx, %rax movq 0x10(%rax), %rdx callq 0x35d0 jmp 0x4deb movl -0x20(%rbp), %edi movq -0x10(%rbp), %rax movslq -0x18(%rbp), %rcx shlq $0x5, %rcx addq %rcx, %rax movl 0xc(%rax), %esi movq -0x10(%rbp), %rax movslq -0x18(%rbp), %rcx shlq $0x5, %rcx addq %rcx, %rax movq 0x10(%rax), %rdx callq 0x3600 jmp 0x4deb movl -0x20(%rbp), %edi movq -0x10(%rbp), %rax movslq -0x18(%rbp), %rcx shlq $0x5, %rcx addq %rcx, %rax movl 0xc(%rax), %esi movq -0x10(%rbp), %rax movslq -0x18(%rbp), %rcx shlq $0x5, %rcx addq %rcx, %rax movq 0x10(%rax), %rdx callq 0x3640 jmp 0x4deb movl -0x20(%rbp), %edi movq -0x10(%rbp), %rax movslq -0x18(%rbp), %rcx shlq $0x5, %rcx addq %rcx, %rax movl 0xc(%rax), %esi movq -0x10(%rbp), %rax movslq -0x18(%rbp), %rcx shlq $0x5, %rcx addq %rcx, %rax movq 0x10(%rax), %rdx callq 0x3660 jmp 0x4deb movl -0x20(%rbp), %edi movq -0x10(%rbp), %rax movslq -0x18(%rbp), %rcx shlq $0x5, %rcx addq %rcx, %rax movl 0xc(%rax), %esi movq -0x10(%rbp), %rax movslq -0x18(%rbp), %rcx shlq $0x5, %rcx addq %rcx, %rax movq 0x10(%rax), %rcx xorl %edx, %edx callq 0x34b0 jmp 0x4deb movl -0x20(%rbp), %edi movq -0x10(%rbp), %rax movslq -0x18(%rbp), %rcx shlq $0x5, %rcx addq %rcx, %rax movl 0xc(%rax), %esi movq -0x10(%rbp), %rax movslq -0x18(%rbp), %rcx shlq $0x5, %rcx addq %rcx, %rax movq 0x10(%rax), %rcx xorl %edx, %edx callq 0x3210 jmp 0x4deb movl -0x20(%rbp), %edi movq -0x10(%rbp), %rax movslq -0x18(%rbp), %rcx shlq $0x5, %rcx addq %rcx, %rax movl 0xc(%rax), %esi movq -0x10(%rbp), %rax movslq -0x18(%rbp), %rcx shlq $0x5, %rcx addq %rcx, %rax movq 0x10(%rax), %rcx xorl %edx, %edx callq 0x31d0 jmp 0x4deb movl -0x20(%rbp), %edi movq -0x10(%rbp), %rax movslq -0x18(%rbp), %rcx shlq $0x5, %rcx addq %rcx, %rax movl 0xc(%rax), %esi movq -0x10(%rbp), %rax movslq -0x18(%rbp), %rcx shlq $0x5, %rcx addq %rcx, %rax movq 0x10(%rax), %rdx callq 0x3220 jmp 0x4deb movl -0x20(%rbp), %edi movq -0x10(%rbp), %rax movslq -0x18(%rbp), %rcx shlq $0x5, %rcx addq %rcx, %rax movl 0xc(%rax), %esi movq -0x10(%rbp), %rax movslq -0x18(%rbp), %rcx shlq $0x5, %rcx addq %rcx, %rax movq 0x10(%rax), %rdx callq 0x34e0 jmp 0x4deb movl -0x20(%rbp), %edi movq -0x10(%rbp), %rax movslq -0x18(%rbp), %rcx shlq $0x5, %rcx addq %rcx, %rax movl 0xc(%rax), %esi movq -0x10(%rbp), %rax movslq -0x18(%rbp), %rcx shlq $0x5, %rcx addq %rcx, %rax movq 0x10(%rax), %rdx callq 0x35c0 jmp 0x4deb movl -0x20(%rbp), %edi movq -0x10(%rbp), %rax movslq -0x18(%rbp), %rcx shlq $0x5, %rcx addq %rcx, %rax movl 0xc(%rax), %esi movq -0x10(%rbp), %rax movslq -0x18(%rbp), %rcx shlq $0x5, %rcx addq %rcx, %rax movq 0x10(%rax), %rdx callq 0x3140 jmp 0x4deb movq -0x10(%rbp), %rax movslq -0x18(%rbp), %rcx shlq $0x5, %rcx addq %rcx, %rax movq 0x10(%rax), %rdi movl -0x1c(%rbp), %esi callq 0x5a00 movl -0x20(%rbp), %edi movl -0x1c(%rbp), %esi callq 0x3460 movl -0x1c(%rbp), %eax addl $0x1, %eax movl %eax, -0x1c(%rbp) jmp 0x4ded movl -0x18(%rbp), %eax addl $0x1, %eax movl %eax, -0x18(%rbp) jmp 0x4b38 addq $0x30, %rsp popq %rbp retq nopw %cs:(%rax,%rax)
/w23[P]atto/include/atto/gl.h
a__GLAttribsBind
static void a__GLAttribsBind(const AGLAttribute *attribs, int nattribs) { ATTO_GL_PROFILE_START int i; ++a__gl_state.attribs_serial; for (i = 0; i < nattribs; ++i) { const AGLAttribute *a = attribs + i; const GLint loc = a->_.location; GLint buffer = a->buffer ? a->buffer->name : 0; if (loc < 0) { /*AGL_PRINTFLN("Skipping %s", a->name);*/ continue; } if (loc >= ATTO_GL_MAX_ATTRIBS) { ATTO_ASSERT("Attrib location is too large"); } if (a__gl_state.attribs[loc].buffer < 0) AGL__CALL(glEnableVertexAttribArray(loc)); if (a__gl_state.attribs[loc].buffer != buffer) { AGL__CALL(glBindBuffer(GL_ARRAY_BUFFER, buffer)); a__gl_state.attribs[loc].buffer = buffer; } a__gl_state.attribs[loc].serial = a__gl_state.attribs_serial; if (a__gl_state.attribs[loc].attrib.size != a->size || a__gl_state.attribs[loc].attrib.type != a->type || a__gl_state.attribs[loc].attrib.normalized != a->normalized || a__gl_state.attribs[loc].attrib.stride != a->stride || a__gl_state.attribs[loc].attrib.ptr != a->ptr) { AGL__CALL(glVertexAttribPointer(loc, a->size, a->type, a->normalized, a->stride, a->ptr)); a__gl_state.attribs[loc].attrib = *a; } } for (i = 0; i < ATTO_GL_MAX_ATTRIBS; ++i) { if (a__gl_state.attribs[i].buffer >= 0 && a__gl_state.attribs[i].serial != a__gl_state.attribs_serial) { AGL__CALL(glDisableVertexAttribArray(i)); a__gl_state.attribs[i].buffer = -1; } } ATTO_GL_PROFILE_END }
pushq %rbp movq %rsp, %rbp subq $0x30, %rsp movq %rdi, -0x8(%rbp) movl %esi, -0xc(%rbp) movl 0x65db(%rip), %eax # 0xb400 addl $0x1, %eax movl %eax, 0x65d2(%rip) # 0xb400 movl $0x0, -0x10(%rbp) movl -0x10(%rbp), %eax cmpl -0xc(%rbp), %eax jge 0x503b movq -0x8(%rbp), %rax movslq -0x10(%rbp), %rcx imulq $0x30, %rcx, %rcx addq %rcx, %rax movq %rax, -0x18(%rbp) movq -0x18(%rbp), %rax movl 0x28(%rax), %eax movl %eax, -0x1c(%rbp) movq -0x18(%rbp), %rax cmpq $0x0, 0x8(%rax) je 0x4e78 movq -0x18(%rbp), %rax movq 0x8(%rax), %rax movl (%rax), %eax movl %eax, -0x24(%rbp) jmp 0x4e7f xorl %eax, %eax movl %eax, -0x24(%rbp) jmp 0x4e7f movl -0x24(%rbp), %eax movl %eax, -0x20(%rbp) cmpl $0x0, -0x1c(%rbp) jge 0x4e90 jmp 0x502d cmpl $0x8, -0x1c(%rbp) jl 0x4e98 jmp 0x4e98 movslq -0x1c(%rbp), %rcx leaq 0x651d(%rip), %rax # 0xb3c0 addq $0x48, %rax shlq $0x6, %rcx addq %rcx, %rax cmpl $0x0, (%rax) jge 0x4ebb movl -0x1c(%rbp), %edi callq 0x32c0 movslq -0x1c(%rbp), %rcx leaq 0x64fa(%rip), %rax # 0xb3c0 addq $0x48, %rax shlq $0x6, %rcx addq %rcx, %rax movl (%rax), %eax cmpl -0x20(%rbp), %eax je 0x4f00 movl -0x20(%rbp), %esi movl $0x8892, %edi # imm = 0x8892 callq 0x3580 movl -0x20(%rbp), %ecx movslq -0x1c(%rbp), %rdx leaq 0x64cd(%rip), %rax # 0xb3c0 addq $0x48, %rax shlq $0x6, %rdx addq %rdx, %rax movl %ecx, (%rax) movl 0x64fa(%rip), %ecx # 0xb400 movslq -0x1c(%rbp), %rdx leaq 0x64af(%rip), %rax # 0xb3c0 addq $0x48, %rax shlq $0x6, %rdx addq %rdx, %rax movl %ecx, 0x38(%rax) movslq -0x1c(%rbp), %rcx leaq 0x6496(%rip), %rax # 0xb3c0 addq $0x48, %rax shlq $0x6, %rcx addq %rcx, %rax movl 0x18(%rax), %eax movq -0x18(%rbp), %rcx cmpl 0x10(%rcx), %eax jne 0x4fd3 movslq -0x1c(%rbp), %rcx leaq 0x6470(%rip), %rax # 0xb3c0 addq $0x48, %rax shlq $0x6, %rcx addq %rcx, %rax movl 0x1c(%rax), %eax movq -0x18(%rbp), %rcx cmpl 0x14(%rcx), %eax jne 0x4fd3 movslq -0x1c(%rbp), %rcx leaq 0x644e(%rip), %rax # 0xb3c0 addq $0x48, %rax shlq $0x6, %rcx addq %rcx, %rax movzbl 0x20(%rax), %eax movq -0x18(%rbp), %rcx movzbl 0x18(%rcx), %ecx cmpl %ecx, %eax jne 0x4fd3 movslq -0x1c(%rbp), %rcx leaq 0x6428(%rip), %rax # 0xb3c0 addq $0x48, %rax shlq $0x6, %rcx addq %rcx, %rax movl 0x24(%rax), %eax movq -0x18(%rbp), %rcx cmpl 0x1c(%rcx), %eax jne 0x4fd3 movslq -0x1c(%rbp), %rcx leaq 0x6406(%rip), %rax # 0xb3c0 addq $0x48, %rax shlq $0x6, %rcx addq %rcx, %rax movq 0x28(%rax), %rax movq -0x18(%rbp), %rcx cmpq 0x20(%rcx), %rax je 0x502b movl -0x1c(%rbp), %edi movq -0x18(%rbp), %rax movl 0x10(%rax), %esi movq -0x18(%rbp), %rax movl 0x14(%rax), %edx movq -0x18(%rbp), %rax movb 0x18(%rax), %al movq -0x18(%rbp), %rcx movl 0x1c(%rcx), %r8d movq -0x18(%rbp), %rcx movq 0x20(%rcx), %r9 movzbl %al, %ecx callq 0x3550 movslq -0x1c(%rbp), %rax leaq 0x63b2(%rip), %rdi # 0xb3c0 addq $0x48, %rdi shlq $0x6, %rax addq %rax, %rdi addq $0x8, %rdi movq -0x18(%rbp), %rsi movl $0x30, %edx callq 0x36c0 jmp 0x502d movl -0x10(%rbp), %eax addl $0x1, %eax movl %eax, -0x10(%rbp) jmp 0x4e35 movl $0x0, -0x10(%rbp) cmpl $0x8, -0x10(%rbp) jge 0x50b5 movslq -0x10(%rbp), %rcx leaq 0x636d(%rip), %rax # 0xb3c0 addq $0x48, %rax shlq $0x6, %rcx addq %rcx, %rax cmpl $0x0, (%rax) jl 0x50a8 movslq -0x10(%rbp), %rcx leaq 0x6352(%rip), %rax # 0xb3c0 addq $0x48, %rax shlq $0x6, %rcx addq %rcx, %rax movl 0x38(%rax), %eax cmpl 0x637e(%rip), %eax # 0xb400 je 0x50a8 movl -0x10(%rbp), %edi callq 0x3190 movslq -0x10(%rbp), %rcx leaq 0x6329(%rip), %rax # 0xb3c0 addq $0x48, %rax shlq $0x6, %rcx addq %rcx, %rax movl $0xffffffff, (%rax) # imm = 0xFFFFFFFF jmp 0x50aa movl -0x10(%rbp), %eax addl $0x1, %eax movl %eax, -0x10(%rbp) jmp 0x5042 addq $0x30, %rsp popq %rbp retq nopl (%rax,%rax)
/w23[P]atto/include/atto/gl.h
a__appProcessXButton
static void a__appProcessXButton(const XEvent *e) { unsigned int button = 0; ATimeUs timestamp = aAppTime(); int dx, dy; unsigned int buttons_changed_bits; const unsigned int pressed = e->xbutton.type == ButtonPress; switch (e->xbutton.button) { case Button1: button = AB_Left; break; case Button2: button = AB_Middle; break; case Button3: button = AB_Right; break; case Button4: button = AB_WheelUp; break; case Button5: button = AB_WheelDown; break; } if (pressed) buttons_changed_bits = a__app_state.pointer.buttons ^ button; else buttons_changed_bits = a__app_state.pointer.buttons & button; a__app_state.pointer.buttons ^= buttons_changed_bits; dx = e->xbutton.x - a__app_state.pointer.x; dy = e->xbutton.y - a__app_state.pointer.y; a__app_state.pointer.x = e->xbutton.x; a__app_state.pointer.y = e->xbutton.y; if (a__app_proctable.pointer) a__app_proctable.pointer(timestamp, dx, dy, buttons_changed_bits); }
pushq %rbp movq %rsp, %rbp subq $0x30, %rsp movq %rdi, -0x8(%rbp) movl $0x0, -0xc(%rbp) callq 0x6790 movl %eax, -0x10(%rbp) movq -0x8(%rbp), %rax movl (%rax), %eax subl $0x4, %eax sete %al movzbl %al, %eax movl %eax, -0x20(%rbp) movq -0x8(%rbp), %rax movl 0x54(%rax), %eax decl %eax movl %eax, %ecx movq %rcx, -0x28(%rbp) subl $0x4, %eax ja 0x7210 movq -0x28(%rbp), %rax leaq 0x1344(%rip), %rcx # 0x8520 movslq (%rcx,%rax,4), %rax addq %rcx, %rax jmpq *%rax movl $0x1, -0xc(%rbp) jmp 0x7210 movl $0x4, -0xc(%rbp) jmp 0x7210 movl $0x2, -0xc(%rbp) jmp 0x7210 movl $0x8, -0xc(%rbp) jmp 0x7210 movl $0x10, -0xc(%rbp) cmpl $0x0, -0x20(%rbp) je 0x7224 movl 0x4de0(%rip), %eax # 0xbffc xorl -0xc(%rbp), %eax movl %eax, -0x1c(%rbp) jmp 0x7230 movl 0x4dd2(%rip), %eax # 0xbffc andl -0xc(%rbp), %eax movl %eax, -0x1c(%rbp) movl -0x1c(%rbp), %eax xorl 0x4dc3(%rip), %eax # 0xbffc movl %eax, 0x4dbd(%rip) # 0xbffc movq -0x8(%rbp), %rax movl 0x40(%rax), %eax subl 0x4da8(%rip), %eax # 0xbff4 movl %eax, -0x14(%rbp) movq -0x8(%rbp), %rax movl 0x44(%rax), %eax subl 0x4d9c(%rip), %eax # 0xbff8 movl %eax, -0x18(%rbp) movq -0x8(%rbp), %rax movl 0x40(%rax), %eax movl %eax, 0x4d88(%rip) # 0xbff4 movq -0x8(%rbp), %rax movl 0x44(%rax), %eax movl %eax, 0x4d7f(%rip) # 0xbff8 cmpq $0x0, 0x4dc7(%rip) # 0xc048 je 0x7298 movq 0x4dbe(%rip), %rax # 0xc048 movl -0x10(%rbp), %edi movl -0x14(%rbp), %esi movl -0x18(%rbp), %edx movl -0x1c(%rbp), %ecx callq *%rax addq $0x30, %rsp popq %rbp retq nop
/w23[P]atto/src/app_x11.c
a__appProcessXMotion
static void a__appProcessXMotion(const XEvent *e) { ATimeUs timestamp = aAppTime(); int dx = e->xmotion.x - a__app_state.pointer.x, dy = e->xmotion.y - a__app_state.pointer.y; a__app_state.pointer.x = e->xmotion.x; a__app_state.pointer.y = e->xmotion.y; if (a__app_state.grabbed) { if (e->xmotion.x == (int)a__app_state.width / 2 && e->xmotion.y == (int)a__app_state.height / 2) return; XWarpPointer(a__x11.display, None, a__x11.window, 0, 0, 0, 0, a__app_state.width / 2, a__app_state.height / 2); } if (a__app_proctable.pointer) a__app_proctable.pointer(timestamp, dx, dy, 0); }
pushq %rbp movq %rsp, %rbp subq $0x40, %rsp movq %rdi, -0x8(%rbp) callq 0x6790 movl %eax, -0xc(%rbp) movq -0x8(%rbp), %rax movl 0x40(%rax), %eax subl 0x4d33(%rip), %eax # 0xbff4 movl %eax, -0x10(%rbp) movq -0x8(%rbp), %rax movl 0x44(%rax), %eax subl 0x4d27(%rip), %eax # 0xbff8 movl %eax, -0x14(%rbp) movq -0x8(%rbp), %rax movl 0x40(%rax), %eax movl %eax, 0x4d13(%rip) # 0xbff4 movq -0x8(%rbp), %rax movl 0x44(%rax), %eax movl %eax, 0x4d0a(%rip) # 0xbff8 cmpl $0x0, 0x4d0b(%rip) # 0xc000 je 0x7381 movq -0x8(%rbp), %rax movl 0x40(%rax), %eax movl %eax, -0x18(%rbp) movl 0x48e1(%rip), %eax # 0xbbec movl $0x2, %ecx cltd idivl %ecx movl %eax, %ecx movl -0x18(%rbp), %eax cmpl %ecx, %eax jne 0x733f movq -0x8(%rbp), %rax movl 0x44(%rax), %eax movl %eax, -0x1c(%rbp) movl 0x48c4(%rip), %eax # 0xbbf0 movl $0x2, %ecx cltd idivl %ecx movl %eax, %ecx movl -0x1c(%rbp), %eax cmpl %ecx, %eax jne 0x733f jmp 0x739f movq 0x4cc2(%rip), %rdi # 0xc008 movq 0x4cc3(%rip), %rdx # 0xc010 movl 0x4898(%rip), %r10d # 0xbbec shrl %r10d movl 0x4893(%rip), %eax # 0xbbf0 shrl %eax xorl %ecx, %ecx movl %ecx, %esi xorl %r9d, %r9d movl %r9d, %ecx movl %r9d, %r8d movl $0x0, (%rsp) movl %r10d, 0x8(%rsp) movl %eax, 0x10(%rsp) callq 0x34d0 cmpq $0x0, 0x4cbf(%rip) # 0xc048 je 0x739f movq 0x4cb6(%rip), %rax # 0xc048 movl -0xc(%rbp), %edi movl -0x10(%rbp), %esi movl -0x14(%rbp), %edx xorl %ecx, %ecx callq *%rax addq $0x40, %rsp popq %rbp retq nopw %cs:(%rax,%rax)
/w23[P]atto/src/app_x11.c
a__appProcessXKeyEvent
static void a__appProcessXKeyEvent(XEvent *e) { ATimeUs timestamp = aAppTime(); AKey key = AK_Unknown; int down = KeyPress == e->type; switch (XLookupKeysym(&e->xkey, 0)) { #define ATTOMAPK__(x, a) \ case XK_##x: key = AK_##a; break; ATTOMAPK__(BackSpace, Backspace) ATTOMAPK__(Tab, Tab) ATTOMAPK__(Return, Enter) ATTOMAPK__(space, Space) ATTOMAPK__(Escape, Esc) ATTOMAPK__(Page_Up, PageUp) ATTOMAPK__(Page_Down, PageDown) ATTOMAPK__(Left, Left) ATTOMAPK__(Up, Up) ATTOMAPK__(Right, Right) ATTOMAPK__(Down, Down) ATTOMAPK__(comma, Comma) ATTOMAPK__(minus, Minus) ATTOMAPK__(period, Dot) ATTOMAPK__(slash, Slash) ATTOMAPK__(equal, Equal) ATTOMAPK__(Delete, Del) ATTOMAPK__(Insert, Ins) ATTOMAPK__(Home, Home) ATTOMAPK__(End, End) ATTOMAPK__(asterisk, KeypadAsterisk) ATTOMAPK__(0, 0) ATTOMAPK__(1, 1) ATTOMAPK__(2, 2) ATTOMAPK__(3, 3) ATTOMAPK__(4, 4) ATTOMAPK__(5, 5) ATTOMAPK__(6, 6) ATTOMAPK__(7, 7) ATTOMAPK__(8, 8) ATTOMAPK__(9, 9) ATTOMAPK__(a, A) ATTOMAPK__(b, B) ATTOMAPK__(c, C) ATTOMAPK__(d, D) ATTOMAPK__(e, E) ATTOMAPK__(f, F) ATTOMAPK__(g, G) ATTOMAPK__(h, H) ATTOMAPK__(i, I) ATTOMAPK__(j, J) ATTOMAPK__(k, K) ATTOMAPK__(l, L) ATTOMAPK__(m, M) ATTOMAPK__(n, N) ATTOMAPK__(o, O) ATTOMAPK__(p, P) ATTOMAPK__(q, Q) ATTOMAPK__(r, R) ATTOMAPK__(s, S) ATTOMAPK__(t, T) ATTOMAPK__(u, U) ATTOMAPK__(v, V) ATTOMAPK__(w, W) ATTOMAPK__(x, X) ATTOMAPK__(y, Y) ATTOMAPK__(z, Z) ATTOMAPK__(KP_Add, KeypadPlus) ATTOMAPK__(KP_Subtract, KeypadMinus) ATTOMAPK__(F1, F1) ATTOMAPK__(F2, F2) ATTOMAPK__(F3, F3) ATTOMAPK__(F4, F4) ATTOMAPK__(F5, F5) ATTOMAPK__(F6, F6) ATTOMAPK__(F7, F7) ATTOMAPK__(F8, F8) ATTOMAPK__(F9, F9) ATTOMAPK__(F10, F10) ATTOMAPK__(F11, F11) ATTOMAPK__(F12, F12) ATTOMAPK__(Alt_L, LeftAlt) ATTOMAPK__(Control_L, LeftCtrl) ATTOMAPK__(Meta_L, LeftMeta) ATTOMAPK__(Super_L, LeftSuper) ATTOMAPK__(Shift_L, LeftShift) ATTOMAPK__(Alt_R, RightAlt) ATTOMAPK__(Control_R, RightCtrl) ATTOMAPK__(Meta_R, RightMeta) ATTOMAPK__(Super_R, RightSuper) ATTOMAPK__(Shift_R, RightShift) ATTOMAPK__(Caps_Lock, Capslock); #undef ATTOMAPK_ default: return; } if (a__app_state.keys[key] == down) return; a__app_state.keys[key] = down; if (a__app_proctable.key) a__app_proctable.key(timestamp, key, down); }
pushq %rbp movq %rsp, %rbp subq $0x20, %rsp movq %rdi, -0x8(%rbp) callq 0x6790 movl %eax, -0xc(%rbp) movl $0x0, -0x10(%rbp) movq -0x8(%rbp), %rax movl (%rax), %eax subl $0x2, %eax sete %al movzbl %al, %eax movl %eax, -0x14(%rbp) movq -0x8(%rbp), %rdi xorl %esi, %esi callq 0x3030 movq %rax, %rcx movq %rcx, -0x20(%rbp) subq $0x20, %rax je 0x7980 jmp 0x73fb movq -0x20(%rbp), %rax subq $0x2a, %rax je 0x7a4c jmp 0x740b movq -0x20(%rbp), %rax subq $0x2c, %rax je 0x79e0 jmp 0x741b movq -0x20(%rbp), %rax subq $0x2d, %rax je 0x79ec jmp 0x742b movq -0x20(%rbp), %rax subq $0x2e, %rax je 0x79f8 jmp 0x743b movq -0x20(%rbp), %rax subq $0x2f, %rax je 0x7a04 jmp 0x744b movq -0x20(%rbp), %rax subq $0x30, %rax je 0x7a58 jmp 0x745b movq -0x20(%rbp), %rax subq $0x31, %rax je 0x7a64 jmp 0x746b movq -0x20(%rbp), %rax subq $0x32, %rax je 0x7a70 jmp 0x747b movq -0x20(%rbp), %rax subq $0x33, %rax je 0x7a7c jmp 0x748b movq -0x20(%rbp), %rax subq $0x34, %rax je 0x7a88 jmp 0x749b movq -0x20(%rbp), %rax subq $0x35, %rax je 0x7a94 jmp 0x74ab movq -0x20(%rbp), %rax subq $0x36, %rax je 0x7aa0 jmp 0x74bb movq -0x20(%rbp), %rax subq $0x37, %rax je 0x7aac jmp 0x74cb movq -0x20(%rbp), %rax subq $0x38, %rax je 0x7ab8 jmp 0x74db movq -0x20(%rbp), %rax subq $0x39, %rax je 0x7ac4 jmp 0x74eb movq -0x20(%rbp), %rax subq $0x3d, %rax je 0x7a10 jmp 0x74fb movq -0x20(%rbp), %rax subq $0x61, %rax je 0x7ad0 jmp 0x750b movq -0x20(%rbp), %rax subq $0x62, %rax je 0x7adc jmp 0x751b movq -0x20(%rbp), %rax subq $0x63, %rax je 0x7ae8 jmp 0x752b movq -0x20(%rbp), %rax subq $0x64, %rax je 0x7af4 jmp 0x753b movq -0x20(%rbp), %rax subq $0x65, %rax je 0x7b00 jmp 0x754b movq -0x20(%rbp), %rax subq $0x66, %rax je 0x7b0c jmp 0x755b movq -0x20(%rbp), %rax subq $0x67, %rax je 0x7b18 jmp 0x756b movq -0x20(%rbp), %rax subq $0x68, %rax je 0x7b24 jmp 0x757b movq -0x20(%rbp), %rax subq $0x69, %rax je 0x7b30 jmp 0x758b movq -0x20(%rbp), %rax subq $0x6a, %rax je 0x7b3c jmp 0x759b movq -0x20(%rbp), %rax subq $0x6b, %rax je 0x7b48 jmp 0x75ab movq -0x20(%rbp), %rax subq $0x6c, %rax je 0x7b54 jmp 0x75bb movq -0x20(%rbp), %rax subq $0x6d, %rax je 0x7b60 jmp 0x75cb movq -0x20(%rbp), %rax subq $0x6e, %rax je 0x7b6c jmp 0x75db movq -0x20(%rbp), %rax subq $0x6f, %rax je 0x7b78 jmp 0x75eb movq -0x20(%rbp), %rax subq $0x70, %rax je 0x7b84 jmp 0x75fb movq -0x20(%rbp), %rax subq $0x71, %rax je 0x7b90 jmp 0x760b movq -0x20(%rbp), %rax subq $0x72, %rax je 0x7b9c jmp 0x761b movq -0x20(%rbp), %rax subq $0x73, %rax je 0x7ba8 jmp 0x762b movq -0x20(%rbp), %rax subq $0x74, %rax je 0x7bb4 jmp 0x763b movq -0x20(%rbp), %rax subq $0x75, %rax je 0x7bc0 jmp 0x764b movq -0x20(%rbp), %rax subq $0x76, %rax je 0x7bcc jmp 0x765b movq -0x20(%rbp), %rax subq $0x77, %rax je 0x7bd8 jmp 0x766b movq -0x20(%rbp), %rax subq $0x78, %rax je 0x7be4 jmp 0x767b movq -0x20(%rbp), %rax subq $0x79, %rax je 0x7bf0 jmp 0x768b movq -0x20(%rbp), %rax subq $0x7a, %rax je 0x7bfc jmp 0x769b movq -0x20(%rbp), %rax subq $0xff08, %rax # imm = 0xFF08 je 0x795c jmp 0x76ad movq -0x20(%rbp), %rax subq $0xff09, %rax # imm = 0xFF09 je 0x7968 jmp 0x76bf movq -0x20(%rbp), %rax subq $0xff0d, %rax # imm = 0xFF0D je 0x7974 jmp 0x76d1 movq -0x20(%rbp), %rax subq $0xff1b, %rax # imm = 0xFF1B je 0x798c jmp 0x76e3 movq -0x20(%rbp), %rax subq $0xff50, %rax # imm = 0xFF50 je 0x7a34 jmp 0x76f5 movq -0x20(%rbp), %rax subq $0xff51, %rax # imm = 0xFF51 je 0x79b0 jmp 0x7707 movq -0x20(%rbp), %rax subq $0xff52, %rax # imm = 0xFF52 je 0x79bc jmp 0x7719 movq -0x20(%rbp), %rax subq $0xff53, %rax # imm = 0xFF53 je 0x79c8 jmp 0x772b movq -0x20(%rbp), %rax subq $0xff54, %rax # imm = 0xFF54 je 0x79d4 jmp 0x773d movq -0x20(%rbp), %rax subq $0xff55, %rax # imm = 0xFF55 je 0x7998 jmp 0x774f movq -0x20(%rbp), %rax subq $0xff56, %rax # imm = 0xFF56 je 0x79a4 jmp 0x7761 movq -0x20(%rbp), %rax subq $0xff57, %rax # imm = 0xFF57 je 0x7a40 jmp 0x7773 movq -0x20(%rbp), %rax subq $0xff63, %rax # imm = 0xFF63 je 0x7a28 jmp 0x7785 movq -0x20(%rbp), %rax subq $0xffab, %rax # imm = 0xFFAB je 0x7c08 jmp 0x7797 movq -0x20(%rbp), %rax subq $0xffad, %rax # imm = 0xFFAD je 0x7c14 jmp 0x77a9 movq -0x20(%rbp), %rax subq $0xffbe, %rax # imm = 0xFFBE je 0x7c20 jmp 0x77bb movq -0x20(%rbp), %rax subq $0xffbf, %rax # imm = 0xFFBF je 0x7c2c jmp 0x77cd movq -0x20(%rbp), %rax subq $0xffc0, %rax # imm = 0xFFC0 je 0x7c38 jmp 0x77df movq -0x20(%rbp), %rax subq $0xffc1, %rax # imm = 0xFFC1 je 0x7c44 jmp 0x77f1 movq -0x20(%rbp), %rax subq $0xffc2, %rax # imm = 0xFFC2 je 0x7c50 jmp 0x7803 movq -0x20(%rbp), %rax subq $0xffc3, %rax # imm = 0xFFC3 je 0x7c5c jmp 0x7815 movq -0x20(%rbp), %rax subq $0xffc4, %rax # imm = 0xFFC4 je 0x7c68 jmp 0x7827 movq -0x20(%rbp), %rax subq $0xffc5, %rax # imm = 0xFFC5 je 0x7c74 jmp 0x7839 movq -0x20(%rbp), %rax subq $0xffc6, %rax # imm = 0xFFC6 je 0x7c80 jmp 0x784b movq -0x20(%rbp), %rax subq $0xffc7, %rax # imm = 0xFFC7 je 0x7c8c jmp 0x785d movq -0x20(%rbp), %rax subq $0xffc8, %rax # imm = 0xFFC8 je 0x7c95 jmp 0x786f movq -0x20(%rbp), %rax subq $0xffc9, %rax # imm = 0xFFC9 je 0x7c9e jmp 0x7881 movq -0x20(%rbp), %rax subq $0xffe1, %rax # imm = 0xFFE1 je 0x7ccb jmp 0x7893 movq -0x20(%rbp), %rax subq $0xffe2, %rax # imm = 0xFFE2 je 0x7cf8 jmp 0x78a5 movq -0x20(%rbp), %rax subq $0xffe3, %rax # imm = 0xFFE3 je 0x7cb0 jmp 0x78b7 movq -0x20(%rbp), %rax subq $0xffe4, %rax # imm = 0xFFE4 je 0x7cdd jmp 0x78c9 movq -0x20(%rbp), %rax subq $0xffe5, %rax # imm = 0xFFE5 je 0x7d01 jmp 0x78db movq -0x20(%rbp), %rax subq $0xffe7, %rax # imm = 0xFFE7 je 0x7cb9 jmp 0x78ed movq -0x20(%rbp), %rax subq $0xffe8, %rax # imm = 0xFFE8 je 0x7ce6 jmp 0x78ff movq -0x20(%rbp), %rax subq $0xffe9, %rax # imm = 0xFFE9 je 0x7ca7 jmp 0x7911 movq -0x20(%rbp), %rax subq $0xffea, %rax # imm = 0xFFEA je 0x7cd4 jmp 0x7923 movq -0x20(%rbp), %rax subq $0xffeb, %rax # imm = 0xFFEB je 0x7cc2 jmp 0x7935 movq -0x20(%rbp), %rax subq $0xffec, %rax # imm = 0xFFEC je 0x7cef jmp 0x7947 movq -0x20(%rbp), %rax subq $0xffff, %rax # imm = 0xFFFF je 0x7a1c jmp 0x7d0a movl $0x8, -0x10(%rbp) jmp 0x7d0c movl $0x9, -0x10(%rbp) jmp 0x7d0c movl $0xd, -0x10(%rbp) jmp 0x7d0c movl $0x20, -0x10(%rbp) jmp 0x7d0c movl $0x1b, -0x10(%rbp) jmp 0x7d0c movl $0x21, -0x10(%rbp) jmp 0x7d0c movl $0x22, -0x10(%rbp) jmp 0x7d0c movl $0x25, -0x10(%rbp) jmp 0x7d0c movl $0x26, -0x10(%rbp) jmp 0x7d0c movl $0x27, -0x10(%rbp) jmp 0x7d0c movl $0x28, -0x10(%rbp) jmp 0x7d0c movl $0x2c, -0x10(%rbp) jmp 0x7d0c movl $0x2d, -0x10(%rbp) jmp 0x7d0c movl $0x2e, -0x10(%rbp) jmp 0x7d0c movl $0x2f, -0x10(%rbp) jmp 0x7d0c movl $0x3d, -0x10(%rbp) jmp 0x7d0c movl $0x7f, -0x10(%rbp) jmp 0x7d0c movl $0x80, -0x10(%rbp) jmp 0x7d0c movl $0x9a, -0x10(%rbp) jmp 0x7d0c movl $0x9b, -0x10(%rbp) jmp 0x7d0c movl $0x97, -0x10(%rbp) jmp 0x7d0c movl $0x30, -0x10(%rbp) jmp 0x7d0c movl $0x31, -0x10(%rbp) jmp 0x7d0c movl $0x32, -0x10(%rbp) jmp 0x7d0c movl $0x33, -0x10(%rbp) jmp 0x7d0c movl $0x34, -0x10(%rbp) jmp 0x7d0c movl $0x35, -0x10(%rbp) jmp 0x7d0c movl $0x36, -0x10(%rbp) jmp 0x7d0c movl $0x37, -0x10(%rbp) jmp 0x7d0c movl $0x38, -0x10(%rbp) jmp 0x7d0c movl $0x39, -0x10(%rbp) jmp 0x7d0c movl $0x61, -0x10(%rbp) jmp 0x7d0c movl $0x62, -0x10(%rbp) jmp 0x7d0c movl $0x63, -0x10(%rbp) jmp 0x7d0c movl $0x64, -0x10(%rbp) jmp 0x7d0c movl $0x65, -0x10(%rbp) jmp 0x7d0c movl $0x66, -0x10(%rbp) jmp 0x7d0c movl $0x67, -0x10(%rbp) jmp 0x7d0c movl $0x68, -0x10(%rbp) jmp 0x7d0c movl $0x69, -0x10(%rbp) jmp 0x7d0c movl $0x6a, -0x10(%rbp) jmp 0x7d0c movl $0x6b, -0x10(%rbp) jmp 0x7d0c movl $0x6c, -0x10(%rbp) jmp 0x7d0c movl $0x6d, -0x10(%rbp) jmp 0x7d0c movl $0x6e, -0x10(%rbp) jmp 0x7d0c movl $0x6f, -0x10(%rbp) jmp 0x7d0c movl $0x70, -0x10(%rbp) jmp 0x7d0c movl $0x71, -0x10(%rbp) jmp 0x7d0c movl $0x72, -0x10(%rbp) jmp 0x7d0c movl $0x73, -0x10(%rbp) jmp 0x7d0c movl $0x74, -0x10(%rbp) jmp 0x7d0c movl $0x75, -0x10(%rbp) jmp 0x7d0c movl $0x76, -0x10(%rbp) jmp 0x7d0c movl $0x77, -0x10(%rbp) jmp 0x7d0c movl $0x78, -0x10(%rbp) jmp 0x7d0c movl $0x79, -0x10(%rbp) jmp 0x7d0c movl $0x7a, -0x10(%rbp) jmp 0x7d0c movl $0x98, -0x10(%rbp) jmp 0x7d0c movl $0x99, -0x10(%rbp) jmp 0x7d0c movl $0x8b, -0x10(%rbp) jmp 0x7d0c movl $0x8c, -0x10(%rbp) jmp 0x7d0c movl $0x8d, -0x10(%rbp) jmp 0x7d0c movl $0x8e, -0x10(%rbp) jmp 0x7d0c movl $0x8f, -0x10(%rbp) jmp 0x7d0c movl $0x90, -0x10(%rbp) jmp 0x7d0c movl $0x91, -0x10(%rbp) jmp 0x7d0c movl $0x92, -0x10(%rbp) jmp 0x7d0c movl $0x93, -0x10(%rbp) jmp 0x7d0c movl $0x94, -0x10(%rbp) jmp 0x7d0c movl $0x95, -0x10(%rbp) jmp 0x7d0c movl $0x96, -0x10(%rbp) jmp 0x7d0c movl $0x81, -0x10(%rbp) jmp 0x7d0c movl $0x82, -0x10(%rbp) jmp 0x7d0c movl $0x83, -0x10(%rbp) jmp 0x7d0c movl $0x84, -0x10(%rbp) jmp 0x7d0c movl $0x85, -0x10(%rbp) jmp 0x7d0c movl $0x86, -0x10(%rbp) jmp 0x7d0c movl $0x87, -0x10(%rbp) jmp 0x7d0c movl $0x88, -0x10(%rbp) jmp 0x7d0c movl $0x89, -0x10(%rbp) jmp 0x7d0c movl $0x8a, -0x10(%rbp) jmp 0x7d0c movl $0x9c, -0x10(%rbp) jmp 0x7d0c jmp 0x7d52 movl -0x10(%rbp), %eax movl %eax, %ecx leaq 0x3ec0(%rip), %rax # 0xbbd8 movl 0x1c(%rax,%rcx,4), %eax cmpl -0x14(%rbp), %eax jne 0x7d23 jmp 0x7d52 movl -0x14(%rbp), %edx movl -0x10(%rbp), %eax movl %eax, %ecx leaq 0x3ea6(%rip), %rax # 0xbbd8 movl %edx, 0x1c(%rax,%rcx,4) cmpq $0x0, 0x4302(%rip) # 0xc040 je 0x7d52 movq 0x42f9(%rip), %rax # 0xc040 movl -0xc(%rbp), %edi movl -0x10(%rbp), %esi movl -0x14(%rbp), %edx callq *%rax addq $0x20, %rsp popq %rbp retq nopl (%rax,%rax)
/w23[P]atto/src/app_x11.c
aAppGrabInput
void aAppGrabInput(int grab) { if (grab == a_app_state->grabbed) return; if (grab) { XGrabPointer( a__x11.display, a__x11.window, True, 0, GrabModeAsync, GrabModeAsync, a__x11.window, None, CurrentTime); XFixesHideCursor(a__x11.display, a__x11.window); XWarpPointer(a__x11.display, None, a__x11.window, 0, 0, 0, 0, a__app_state.width / 2, a__app_state.height / 2); } else { XFixesShowCursor(a__x11.display, a__x11.window); XUngrabPointer(a__x11.display, CurrentTime); } a__app_state.grabbed = grab; }
pushq %rbp movq %rsp, %rbp subq $0x20, %rsp movl %edi, -0x4(%rbp) movl -0x4(%rbp), %eax movq 0x3633(%rip), %rcx # 0xb3a8 cmpl 0x428(%rcx), %eax jne 0x7d82 jmp 0x7e4f cmpl $0x0, -0x4(%rbp) je 0x7e23 movq 0x4275(%rip), %rdi # 0xc008 movq 0x4276(%rip), %rsi # 0xc010 movq 0x426f(%rip), %rax # 0xc010 movl $0x1, %r9d xorl %ecx, %ecx xorl %edx, %edx movl %r9d, %edx movl %r9d, %r8d movq %rax, (%rsp) movq $0x0, 0x8(%rsp) movq $0x0, 0x10(%rsp) callq 0x3180 movq 0x4235(%rip), %rdi # 0xc008 movq 0x4236(%rip), %rsi # 0xc010 callq 0x3270 movq 0x4222(%rip), %rdi # 0xc008 movq 0x4223(%rip), %rdx # 0xc010 movl 0x3df8(%rip), %r10d # 0xbbec shrl %r10d movl 0x3df3(%rip), %eax # 0xbbf0 shrl %eax xorl %ecx, %ecx movl %ecx, %esi xorl %r9d, %r9d movl %r9d, %ecx movl %r9d, %r8d movl $0x0, (%rsp) movl %r10d, 0x8(%rsp) movl %eax, 0x10(%rsp) callq 0x34d0 jmp 0x7e46 movq 0x41de(%rip), %rdi # 0xc008 movq 0x41df(%rip), %rsi # 0xc010 callq 0x3160 movq 0x41cb(%rip), %rdi # 0xc008 xorl %eax, %eax movl %eax, %esi callq 0x3130 movl -0x4(%rbp), %eax movl %eax, 0x41b1(%rip) # 0xc000 addq $0x20, %rsp popq %rbp retq
/w23[P]atto/src/app_x11.c
archs_enable
static void archs_enable(void) { static bool initialized = false; if (initialized) return; #ifdef CAPSTONE_HAS_ARM ARM_enable(); #endif #ifdef CAPSTONE_HAS_ARM64 AArch64_enable(); #endif #ifdef CAPSTONE_HAS_MIPS Mips_enable(); #endif #ifdef CAPSTONE_HAS_POWERPC PPC_enable(); #endif #ifdef CAPSTONE_HAS_SPARC Sparc_enable(); #endif #ifdef CAPSTONE_HAS_SYSZ SystemZ_enable(); #endif #ifdef CAPSTONE_HAS_X86 X86_enable(); #endif #ifdef CAPSTONE_HAS_XCORE XCore_enable(); #endif initialized = true; }
cmpb $0x0, 0x24c678(%rip) # 0x290f64 jne 0x44922 pushq %rax callq 0x44200 callq 0x44380 callq 0x44270 callq 0x44780 callq 0x446b0 callq 0x442a0 callq 0x44110 callq 0x44340 movb $0x1, 0x24c646(%rip) # 0x290f64 addq $0x8, %rsp retq
/bughoho[P]capstone/cs.c
cs_close
CAPSTONE_EXPORT cs_err cs_close(csh *handle) { struct cs_struct *ud; if (*handle == 0) // invalid handle return CS_ERR_CSH; ud = (struct cs_struct *)(*handle); if (ud->printer_info) cs_mem_free(ud->printer_info); cs_mem_free(ud->insn_cache); memset(ud, 0, sizeof(*ud)); cs_mem_free(ud); // invalidate this handle by ZERO out its value. // this is to make sure it is unusable after cs_close() *handle = 0; return CS_ERR_OK; }
pushq %rbp pushq %r15 pushq %r14 pushq %rbx pushq %rax movq (%rdi), %r14 testq %r14, %r14 je 0x44af4 movq %rdi, %rbx movq 0x10(%r14), %rdi testq %rdi, %rdi je 0x44ac6 movq 0x158344(%rip), %rax # 0x19ce08 callq *(%rax) movq 0x15833b(%rip), %r15 # 0x19ce08 movq 0x78(%r14), %rdi callq *(%r15) xorl %ebp, %ebp movl $0xb0, %edx movq %r14, %rdi xorl %esi, %esi callq 0x442f0 movq %r14, %rdi callq *(%r15) movq $0x0, (%rbx) jmp 0x44af9 movl $0x4, %ebp movl %ebp, %eax addq $0x8, %rsp popq %rbx popq %r14 popq %r15 popq %rbp retq
/bughoho[P]capstone/cs.c
cs_reg_read
CAPSTONE_EXPORT bool cs_reg_read(csh ud, const cs_insn *insn, unsigned int reg_id) { struct cs_struct *handle; if (!ud) return false; handle = (struct cs_struct *)(uintptr_t)ud; if (!handle->detail) { handle->errnum = CS_ERR_DETAIL; return false; } if(!insn->id) { handle->errnum = CS_ERR_SKIPDATA; return false; } if(!insn->detail) { handle->errnum = CS_ERR_DETAIL; return false; } return arr_exist(insn->detail->regs_read, insn->detail->regs_read_count, reg_id); }
testq %rdi, %rdi je 0x45590 movl $0x7, %eax cmpl $0x0, 0x68(%rdi) je 0x4558d cmpl $0x0, (%rsi) je 0x45588 movq 0xe8(%rsi), %rcx testq %rcx, %rcx je 0x4558d movzbl 0xc(%rcx), %esi testq %rsi, %rsi setne %al je 0x45587 movzbl (%rcx), %edi movb $0x1, %al cmpl %edx, %edi je 0x45587 movl $0x1, %edi movq %rdi, %rax cmpq %rdi, %rsi je 0x45581 movzbl (%rcx,%rax), %r8d leaq 0x1(%rax), %rdi cmpl %edx, %r8d jne 0x4556b cmpq %rsi, %rax setb %al retq movl $0xb, %eax movl %eax, 0x58(%rdi) xorl %eax, %eax retq
/bughoho[P]capstone/cs.c
cs_op_count
CAPSTONE_EXPORT int cs_op_count(csh ud, const cs_insn *insn, unsigned int op_type) { struct cs_struct *handle; unsigned int count = 0, i; if (!ud) return -1; handle = (struct cs_struct *)(uintptr_t)ud; if (!handle->detail) { handle->errnum = CS_ERR_DETAIL; return -1; } if(!insn->id) { handle->errnum = CS_ERR_SKIPDATA; return -1; } if(!insn->detail) { handle->errnum = CS_ERR_DETAIL; return -1; } handle->errnum = CS_ERR_OK; switch (handle->arch) { default: handle->errnum = CS_ERR_HANDLE; return -1; case CS_ARCH_ARM: for (i = 0; i < insn->detail->arm.op_count; i++) if (insn->detail->arm.operands[i].type == (arm_op_type)op_type) count++; break; case CS_ARCH_ARM64: for (i = 0; i < insn->detail->arm64.op_count; i++) if (insn->detail->arm64.operands[i].type == (arm64_op_type)op_type) count++; break; case CS_ARCH_X86: for (i = 0; i < insn->detail->x86.op_count; i++) if (insn->detail->x86.operands[i].type == (x86_op_type)op_type) count++; break; case CS_ARCH_MIPS: for (i = 0; i < insn->detail->mips.op_count; i++) if (insn->detail->mips.operands[i].type == (mips_op_type)op_type) count++; break; case CS_ARCH_PPC: for (i = 0; i < insn->detail->ppc.op_count; i++) if (insn->detail->ppc.operands[i].type == (ppc_op_type)op_type) count++; break; case CS_ARCH_SPARC: for (i = 0; i < insn->detail->sparc.op_count; i++) if (insn->detail->sparc.operands[i].type == (sparc_op_type)op_type) count++; break; case CS_ARCH_SYSZ: for (i = 0; i < insn->detail->sysz.op_count; i++) if (insn->detail->sysz.operands[i].type == (sysz_op_type)op_type) count++; break; case CS_ARCH_XCORE: for (i = 0; i < insn->detail->xcore.op_count; i++) if (insn->detail->xcore.operands[i].type == (xcore_op_type)op_type) count++; break; } return count; }
movl $0xffffffff, %eax # imm = 0xFFFFFFFF testq %rdi, %rdi je 0x457de cmpl $0x0, 0x68(%rdi) je 0x45679 cmpl $0x0, (%rsi) je 0x45681 movq 0xe8(%rsi), %rcx testq %rcx, %rcx je 0x45679 movl $0x0, 0x58(%rdi) movl (%rdi), %esi cmpq $0x7, %rsi ja 0x457d7 leaq 0x849e4(%rip), %rax # 0xca020 movslq (%rax,%rsi,4), %rsi addq %rax, %rsi jmpq *%rsi movzbl 0x50(%rcx), %eax testq %rax, %rax je 0x457d4 shll $0x3, %eax leaq (%rax,%rax,4), %rsi xorl %edi, %edi xorl %eax, %eax xorl %r8d, %r8d cmpl %edx, 0x64(%rcx,%rdi) sete %r8b addl %r8d, %eax addq $0x28, %rdi cmpq %rdi, %rsi jne 0x4565d jmp 0x457de movl $0x7, 0x58(%rdi) retq movl $0xb, 0x58(%rdi) retq movzbl 0x39(%rcx), %esi testq %rsi, %rsi je 0x457d4 shll $0x4, %esi xorl %edi, %edi xorl %eax, %eax xorl %r8d, %r8d cmpl %edx, 0x3c(%rcx,%rdi) sete %r8b addl %r8d, %eax addq $0x10, %rdi cmpq %rdi, %rsi jne 0x4569d jmp 0x457de movzbl 0x30(%rcx), %eax testq %rax, %rax je 0x457d4 shll $0x3, %eax leaq (%rax,%rax,2), %rsi xorl %edi, %edi xorl %eax, %eax xorl %r8d, %r8d cmpl %edx, 0x38(%rcx,%rdi) sete %r8b addl %r8d, %eax addq $0x18, %rdi cmpq %rdi, %rsi jne 0x456d1 jmp 0x457de movzbl 0x5c(%rcx), %eax testq %rax, %rax je 0x457d4 shll $0x4, %eax leaq (%rax,%rax,2), %rsi xorl %edi, %edi xorl %eax, %eax xorl %r8d, %r8d cmpl %edx, 0x60(%rcx,%rdi) sete %r8b addl %r8d, %eax addq $0x30, %rdi cmpq %rdi, %rsi jne 0x45705 jmp 0x457de movzbl 0x30(%rcx), %esi testq %rsi, %rsi je 0x457d4 shll $0x4, %esi xorl %edi, %edi xorl %eax, %eax xorl %r8d, %r8d cmpl %edx, 0x34(%rcx,%rdi) sete %r8b addl %r8d, %eax addq $0x10, %rdi cmpq %rdi, %rsi jne 0x45735 jmp 0x457de movzbl 0x36(%rcx), %eax testq %rax, %rax je 0x457d4 shll $0x4, %eax leaq (%rax,%rax,2), %rsi xorl %edi, %edi xorl %eax, %eax xorl %r8d, %r8d cmpl %edx, 0x50(%rcx,%rdi) sete %r8b addl %r8d, %eax addq $0x30, %rdi cmpq %rdi, %rsi jne 0x45765 jmp 0x457de movzbl 0x38(%rcx), %eax testq %rax, %rax je 0x457d4 shll $0x2, %eax leaq (%rax,%rax,2), %rsi xorl %edi, %edi xorl %eax, %eax xorl %r8d, %r8d cmpl %edx, 0x3c(%rcx,%rdi) sete %r8b addl %r8d, %eax addq $0xc, %rdi cmpq %rdi, %rsi jne 0x45792 jmp 0x457de movzbl 0x34(%rcx), %esi testq %rsi, %rsi je 0x457d4 shll $0x5, %esi xorl %edi, %edi xorl %eax, %eax xorl %r8d, %r8d cmpl %edx, 0x38(%rcx,%rdi) sete %r8b addl %r8d, %eax addq $0x20, %rdi cmpq %rdi, %rsi jne 0x457bb jmp 0x457de xorl %eax, %eax retq movl $0x3, 0x58(%rdi) retq
/bughoho[P]capstone/cs.c
SStream_concat0
void SStream_concat0(SStream *ss, char *s) { #ifndef CAPSTONE_DIET unsigned int len = (unsigned int) strlen(s); memcpy(ss->buffer + ss->index, s, len); ss->index += len; ss->buffer[ss->index] = '\0'; #endif }
pushq %r15 pushq %r14 pushq %rbx movq %rsi, %rbx movq %rdi, %r14 movq %rsi, %rdi callq 0x441d0 movq %rax, %r15 movslq 0x200(%r14), %rdi addq %r14, %rdi movl %r15d, %edx movq %rbx, %rsi callq 0x44420 addl 0x200(%r14), %r15d movl %r15d, 0x200(%r14) movslq %r15d, %rax movb $0x0, (%r14,%rax) popq %rbx popq %r14 popq %r15 retq
/bughoho[P]capstone/SStream.c
SStream_concat
void SStream_concat(SStream *ss, const char *fmt, ...) { #ifndef CAPSTONE_DIET va_list ap; int ret; va_start(ap, fmt); ret = cs_vsnprintf(ss->buffer + ss->index, sizeof(ss->buffer) - (ss->index + 1), fmt, ap); va_end(ap); ss->index += ret; #endif }
pushq %rbx subq $0xd0, %rsp movq %rsi, %r10 movq %rdi, %rbx leaq 0x20(%rsp), %rsi movq %rdx, 0x10(%rsi) movq %rcx, 0x18(%rsi) movq %r8, 0x20(%rsi) movq %r9, 0x28(%rsi) testb %al, %al je 0x45df3 movaps %xmm0, 0x50(%rsp) movaps %xmm1, 0x60(%rsp) movaps %xmm2, 0x70(%rsp) movaps %xmm3, 0x80(%rsp) movaps %xmm4, 0x90(%rsp) movaps %xmm5, 0xa0(%rsp) movaps %xmm6, 0xb0(%rsp) movaps %xmm7, 0xc0(%rsp) movq %rsp, %rcx movq %rsi, 0x10(%rcx) leaq 0xe0(%rsp), %rax movq %rax, 0x8(%rcx) movabsq $0x3000000010, %rax # imm = 0x3000000010 movq %rax, (%rcx) movq 0x15715e(%rip), %rax # 0x19cf78 movslq 0x200(%rdi), %rdx addq %rdx, %rdi movl $0x1ff, %esi # imm = 0x1FF subq %rdx, %rsi movq %r10, %rdx callq *(%rax) addl %eax, 0x200(%rbx) addq $0xd0, %rsp popq %rbx retq
/bughoho[P]capstone/SStream.c
printInt64Bang
void printInt64Bang(SStream *O, int64_t val) { if (val >= 0) { if (val > HEX_THRESHOLD) SStream_concat(O, "#0x%"PRIx64, val); else SStream_concat(O, "#%"PRIu64, val); } else { if (val <- HEX_THRESHOLD) SStream_concat(O, "#-0x%"PRIx64, -val); else SStream_concat(O, "#-%"PRIu64, -val); } }
movq %rsi, %rax testq %rsi, %rsi js 0x45e57 cmpq $0xa, %rax jl 0x45e6c leaq 0x84441(%rip), %rsi # 0xca296 jmp 0x45e73 movq %rax, %rdx negq %rdx cmpq $-0xa, %rax jg 0x45e78 leaq 0x84438(%rip), %rsi # 0xca2a2 jmp 0x45e7f leaq 0x8442a(%rip), %rsi # 0xca29d movq %rax, %rdx jmp 0x45e7f leaq 0x8442b(%rip), %rsi # 0xca2aa xorl %eax, %eax jmp 0x44540
/bughoho[P]capstone/SStream.c
printInt64
void printInt64(SStream *O, int64_t val) { if (val >= 0) { if (val > HEX_THRESHOLD) SStream_concat(O, "0x%"PRIx64, val); else SStream_concat(O, "%"PRIu64, val); } else { if (val <- HEX_THRESHOLD) SStream_concat(O, "-0x%"PRIx64, -val); else SStream_concat(O, "-%"PRIu64, -val); } }
movq %rsi, %rax testq %rsi, %rsi js 0x45ebd cmpq $0xa, %rax jl 0x45ed2 leaq 0x101fdf(%rip), %rsi # 0x147e9a jmp 0x45ed9 movq %rax, %rdx negq %rdx cmpq $-0xa, %rax jg 0x45ede leaq 0x843d3(%rip), %rsi # 0xca2a3 jmp 0x45ee5 leaq 0x101fca(%rip), %rsi # 0x147ea3 movq %rax, %rdx jmp 0x45ee5 leaq 0x843c6(%rip), %rsi # 0xca2ab xorl %eax, %eax jmp 0x44540
/bughoho[P]capstone/SStream.c
Thumb_getInstruction
static DecodeStatus _Thumb_getInstruction(cs_struct *ud, MCInst *MI, const uint8_t *code, size_t code_len, uint16_t *Size, uint64_t Address) { uint8_t bytes[4]; uint16_t insn16; DecodeStatus result; bool InITBlock; unsigned Firstcond, Mask; uint32_t NEONLdStInsn, insn32, NEONDataInsn, NEONCryptoInsn, NEONv8Insn; size_t i; // We want to read exactly 2 bytes of data. if (code_len < 2) // not enough data return MCDisassembler_Fail; if (MI->flat_insn->detail) { memset(&MI->flat_insn->detail->arm, 0, sizeof(cs_arm)); for (i = 0; i < ARR_SIZE(MI->flat_insn->detail->arm.operands); i++) MI->flat_insn->detail->arm.operands[i].vector_index = -1; } memcpy(bytes, code, 2); if (ud->big_endian) insn16 = (bytes[0] << 8) | bytes[1]; else insn16 = (bytes[1] << 8) | bytes[0]; result = decodeInstruction_2(DecoderTableThumb16, MI, insn16, Address, NULL, ud->mode); if (result != MCDisassembler_Fail) { *Size = 2; Check(&result, AddThumbPredicate(ud, MI)); return result; } MCInst_clear(MI); result = decodeInstruction_2(DecoderTableThumbSBit16, MI, insn16, Address, NULL, ud->mode); if (result) { *Size = 2; InITBlock = ITStatus_instrInITBlock(&(ud->ITBlock)); Check(&result, AddThumbPredicate(ud, MI)); AddThumb1SBit(MI, InITBlock); return result; } MCInst_clear(MI); result = decodeInstruction_2(DecoderTableThumb216, MI, insn16, Address, NULL, ud->mode); if (result != MCDisassembler_Fail) { *Size = 2; // Nested IT blocks are UNPREDICTABLE. Must be checked before we add // the Thumb predicate. if (MCInst_getOpcode(MI) == ARM_t2IT && ITStatus_instrInITBlock(&(ud->ITBlock))) return MCDisassembler_SoftFail; Check(&result, AddThumbPredicate(ud, MI)); // If we find an IT instruction, we need to parse its condition // code and mask operands so that we can apply them correctly // to the subsequent instructions. if (MCInst_getOpcode(MI) == ARM_t2IT) { Firstcond = (unsigned int)MCOperand_getImm(MCInst_getOperand(MI, 0)); Mask = (unsigned int)MCOperand_getImm(MCInst_getOperand(MI, 1)); ITStatus_setITState(&(ud->ITBlock), (char)Firstcond, (char)Mask); } return result; } // We want to read exactly 4 bytes of data. if (code_len < 4) // not enough data return MCDisassembler_Fail; memcpy(bytes, code, 4); if (ud->big_endian) insn32 = (bytes[3] << 24) | (bytes[2] << 16) | (bytes[1] << 8) | (bytes[0] << 0); else insn32 = (bytes[3] << 8) | (bytes[2] << 0) | (bytes[1] << 24) | (bytes[0] << 16); MCInst_clear(MI); result = decodeInstruction_4(DecoderTableThumb32, MI, insn32, Address, NULL, ud->mode); if (result != MCDisassembler_Fail) { *Size = 4; InITBlock = ITStatus_instrInITBlock(&(ud->ITBlock)); Check(&result, AddThumbPredicate(ud, MI)); AddThumb1SBit(MI, InITBlock); return result; } MCInst_clear(MI); result = decodeInstruction_4(DecoderTableThumb232, MI, insn32, Address, NULL, ud->mode); if (result != MCDisassembler_Fail) { *Size = 4; Check(&result, AddThumbPredicate(ud, MI)); return result; } MCInst_clear(MI); result = decodeInstruction_4(DecoderTableVFP32, MI, insn32, Address, NULL, ud->mode); if (result != MCDisassembler_Fail) { *Size = 4; UpdateThumbVFPPredicate(ud, MI); return result; } if (fieldFromInstruction_4(insn32, 28, 4) == 0xE) { MCInst_clear(MI); result = decodeInstruction_4(DecoderTableVFP32, MI, insn32, Address, NULL, ud->mode); if (result != MCDisassembler_Fail) { *Size = 4; UpdateThumbVFPPredicate(ud, MI); return result; } } MCInst_clear(MI); result = decodeInstruction_4(DecoderTableVFPV832, MI, insn32, Address, NULL, ud->mode); if (result != MCDisassembler_Fail) { *Size = 4; return result; } if (fieldFromInstruction_4(insn32, 28, 4) == 0xE) { MCInst_clear(MI); result = decodeInstruction_4(DecoderTableNEONDup32, MI, insn32, Address, NULL, ud->mode); if (result != MCDisassembler_Fail) { *Size = 4; Check(&result, AddThumbPredicate(ud, MI)); return result; } } if (fieldFromInstruction_4(insn32, 24, 8) == 0xF9) { MCInst_clear(MI); NEONLdStInsn = insn32; NEONLdStInsn &= 0xF0FFFFFF; NEONLdStInsn |= 0x04000000; result = decodeInstruction_4(DecoderTableNEONLoadStore32, MI, NEONLdStInsn, Address, NULL, ud->mode); if (result != MCDisassembler_Fail) { *Size = 4; Check(&result, AddThumbPredicate(ud, MI)); return result; } } if (fieldFromInstruction_4(insn32, 24, 4) == 0xF) { MCInst_clear(MI); NEONDataInsn = insn32; NEONDataInsn &= 0xF0FFFFFF; // Clear bits 27-24 NEONDataInsn |= (NEONDataInsn & 0x10000000) >> 4; // Move bit 28 to bit 24 NEONDataInsn |= 0x12000000; // Set bits 28 and 25 result = decodeInstruction_4(DecoderTableNEONData32, MI, NEONDataInsn, Address, NULL, ud->mode); if (result != MCDisassembler_Fail) { *Size = 4; Check(&result, AddThumbPredicate(ud, MI)); return result; } } MCInst_clear(MI); NEONCryptoInsn = insn32; NEONCryptoInsn &= 0xF0FFFFFF; // Clear bits 27-24 NEONCryptoInsn |= (NEONCryptoInsn & 0x10000000) >> 4; // Move bit 28 to bit 24 NEONCryptoInsn |= 0x12000000; // Set bits 28 and 25 result = decodeInstruction_4(DecoderTablev8Crypto32, MI, NEONCryptoInsn, Address, NULL, ud->mode); if (result != MCDisassembler_Fail) { *Size = 4; return result; } MCInst_clear(MI); NEONv8Insn = insn32; NEONv8Insn &= 0xF3FFFFFF; // Clear bits 27-26 result = decodeInstruction_4(DecoderTablev8NEON32, MI, NEONv8Insn, Address, NULL, ud->mode); if (result != MCDisassembler_Fail) { *Size = 4; return result; } MCInst_clear(MI); *Size = 0; return MCDisassembler_Fail; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax cmpq $0x2, %rdx jae 0x46209 xorl %ebp, %ebp jmp 0x462ed movq %r8, %r15 movq %rcx, %rbx movq %rdx, %r13 movq %rsi, %r12 movq %rdi, %r14 movq 0x310(%rcx), %rax movq 0xe8(%rax), %rdi testq %rdi, %rdi je 0x46261 addq $0x30, %rdi movl $0x5c8, %edx # imm = 0x5C8 xorl %esi, %esi callq 0x442f0 movl $0x58, %eax movq 0x310(%rbx), %rcx movq 0xe8(%rcx), %rcx movl $0xffffffff, (%rcx,%rax) # imm = 0xFFFFFFFF addq $0x28, %rax cmpq $0x5f8, %rax # imm = 0x5F8 jne 0x46240 movzwl (%r12), %eax movl %eax, %edx rolw $0x8, %dx cmpb $0x0, 0x28(%r14) cmovel %eax, %edx movl 0x4(%r14), %ecx movzwl %dx, %ebp leaq 0x15d0ae(%rip), %rdi # 0x1a3330 movq %rbx, %rsi movl %ebp, %edx callq 0x46812 testl %eax, %eax je 0x462a3 movw $0x2, (%r15) movq %r14, %rdi movq %rbx, %rsi callq 0x46ad9 jmp 0x462ea movq %rbx, %rdi callq 0x44640 movl 0x4(%r14), %ecx leaq 0x15d45a(%rip), %rdi # 0x1a3710 movq %rbx, %rsi movl %ebp, %edx callq 0x46812 testl %eax, %eax je 0x462fe movw $0x2, (%r15) xorl %ebp, %ebp cmpl $0x0, 0x64(%r14) setne %bpl movq %r14, %rdi movq %rbx, %rsi callq 0x46ad9 movq %rbx, %rdi movl %ebp, %esi callq 0x46c19 movb $0x1, %bpl movl %ebp, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rbx, %rdi callq 0x44640 movl 0x4(%r14), %ecx leaq 0x15d53f(%rip), %rdi # 0x1a3850 movq %rbx, %rsi movl %ebp, %edx callq 0x46812 testl %eax, %eax je 0x4639d movw $0x2, (%r15) movq %rbx, %rdi callq 0x44490 cmpl $0x923, %eax # imm = 0x923 jne 0x4633e movb $0x1, %bpl cmpl $0x0, 0x64(%r14) jne 0x462ed movq %r14, %rdi movq %rbx, %rsi callq 0x46ad9 movq %rbx, %rdi callq 0x44490 movb $0x1, %bpl cmpl $0x923, %eax # imm = 0x923 jne 0x462ed movq %rbx, %rdi xorl %esi, %esi callq 0x444e0 movq %rax, %rdi callq 0x443b0 movq %rax, %r15 movq %rbx, %rdi movl $0x1, %esi callq 0x444e0 movq %rax, %rdi callq 0x443b0 addq $0x5c, %r14 movsbl %r15b, %esi movsbl %al, %edx movq %r14, %rdi callq 0x46cd8 jmp 0x462ed cmpq $0x4, %r13 jb 0x46202 movzbl (%r12), %eax movzbl 0x1(%r12), %ebp movzbl 0x2(%r12), %ecx movzbl 0x3(%r12), %edx cmpb $0x1, 0x28(%r14) jne 0x463d6 shll $0x18, %edx shll $0x10, %ecx shll $0x8, %ebp orl %eax, %ebp orl %ecx, %ebp orl %edx, %ebp jmp 0x463e7 shll $0x8, %edx shll $0x18, %ebp shll $0x10, %eax orl %ebp, %eax orl %edx, %eax orl %ecx, %eax movl %eax, %ebp movq %rbx, %rdi callq 0x44640 movl 0x4(%r14), %ecx leaq 0x15d476(%rip), %rdi # 0x1a3870 movq %rbx, %rsi movl %ebp, %edx callq 0x46d52 testl %eax, %eax je 0x46413 movw $0x4, (%r15) jmp 0x462ca movq %rbx, %rdi callq 0x44640 movl 0x4(%r14), %ecx leaq 0x15d48a(%rip), %rdi # 0x1a38b0 movq %rbx, %rsi movl %ebp, %edx callq 0x46d52 testl %eax, %eax je 0x4643f movw $0x4, (%r15) jmp 0x46296 movq %rbx, %rdi callq 0x44640 movl 0x4(%r14), %ecx leaq 0x15efce(%rip), %rdi # 0x1a5420 movq %rbx, %rsi movl %ebp, %edx callq 0x46d52 testl %eax, %eax je 0x46476 movw $0x4, (%r15) movq %r14, %rdi movq %rbx, %rsi callq 0x47012 jmp 0x462ea movl %ebp, %r12d andl $0xf0000000, %r12d # imm = 0xF0000000 cmpl $0xe0000000, %r12d # imm = 0xE0000000 jne 0x464aa movq %rbx, %rdi callq 0x44640 movl 0x4(%r14), %ecx leaq 0x15ef84(%rip), %rdi # 0x1a5420 movq %rbx, %rsi movl %ebp, %edx callq 0x46d52 testl %eax, %eax jne 0x46460 movq %rbx, %rdi callq 0x44640 movl 0x4(%r14), %ecx leaq 0x15fa63(%rip), %rdi # 0x1a5f20 movq %rbx, %rsi movl %ebp, %edx callq 0x46d52 testl %eax, %eax je 0x464d6 movw $0x4, (%r15) jmp 0x462ea cmpl $0xe0000000, %r12d # imm = 0xE0000000 jne 0x46504 movq %rbx, %rdi callq 0x44640 movl 0x4(%r14), %ecx leaq 0x15fe5e(%rip), %rdi # 0x1a6350 movq %rbx, %rsi movl %ebp, %edx callq 0x46d52 testl %eax, %eax jne 0x46434 movl %ebp, %eax andl $0xff000000, %eax # imm = 0xFF000000 cmpl $0xf9000000, %eax # imm = 0xF9000000 jne 0x46543 movq %rbx, %rdi callq 0x44640 movl %ebp, %edx andl $0xf0ffffff, %edx # imm = 0xF0FFFFFF orl $0x4000000, %edx # imm = 0x4000000 movl 0x4(%r14), %ecx leaq 0x15ffbd(%rip), %rdi # 0x1a64f0 movq %rbx, %rsi callq 0x46d52 testl %eax, %eax jne 0x46434 movl %ebp, %eax notl %eax testl $0xf000000, %eax # imm = 0xF000000 jne 0x4658c movq %rbx, %rdi callq 0x44640 movl %ebp, %eax andl $0xe0ffffff, %eax # imm = 0xE0FFFFFF movl %ebp, %ecx shrl $0x4, %ecx andl $0x1000000, %ecx # imm = 0x1000000 leal (%rax,%rcx), %edx addl $0x12000000, %edx # imm = 0x12000000 movl 0x4(%r14), %ecx leaq 0x161674(%rip), %rdi # 0x1a7bf0 movq %rbx, %rsi callq 0x46d52 testl %eax, %eax jne 0x46434 movq %rbx, %rdi callq 0x44640 movl %ebp, %eax andl $0xe0ffffff, %eax # imm = 0xE0FFFFFF movl %ebp, %ecx shrl $0x4, %ecx andl $0x1000000, %ecx # imm = 0x1000000 leal (%rax,%rcx), %edx addl $0x12000000, %edx # imm = 0x12000000 movl 0x4(%r14), %ecx leaq 0x164f16(%rip), %rdi # 0x1ab4d0 movq %rbx, %rsi callq 0x46d52 testl %eax, %eax jne 0x464cb movq %rbx, %rdi callq 0x44640 andl $0xf3ffffff, %ebp # imm = 0xF3FFFFFF movl 0x4(%r14), %ecx leaq 0x1650cd(%rip), %rdi # 0x1ab6b0 movq %rbx, %rsi movl %ebp, %edx callq 0x46d52 testl %eax, %eax jne 0x464cb movq %rbx, %rdi callq 0x44640 movw $0x0, (%r15) jmp 0x46202
/bughoho[P]capstone/arch/ARM/ARMDisassembler.c
DecodeDoubleRegLoad
static DecodeStatus DecodeDoubleRegLoad(MCInst *Inst, unsigned Insn, uint64_t Address, const void *Decoder) { DecodeStatus S = MCDisassembler_Success; unsigned Rt = fieldFromInstruction_4(Insn, 12, 4); unsigned Rn = fieldFromInstruction_4(Insn, 16, 4); unsigned pred = fieldFromInstruction_4(Insn, 28, 4); if (Rn == 0xF) S = MCDisassembler_SoftFail; if (!Check(&S, DecodeGPRPairRegisterClass(Inst, Rt, Address, Decoder))) return MCDisassembler_Fail; if (!Check(&S, DecodeGPRRegisterClass(Inst, Rn, Address, Decoder))) return MCDisassembler_Fail; if (!Check(&S, DecodePredicateOperand(Inst, pred, Address, Decoder))) return MCDisassembler_Fail; return S; }
pushq %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx movl %esi, %ebx movq %rdi, %r14 movl %esi, %eax shrl $0xc, %eax andl $0xf, %eax movl %esi, %r15d shrl $0x10, %r15d andl $0xf, %r15d xorl %r12d, %r12d cmpl $0xf, %r15d setne %r12b xorl %ebp, %ebp cmpl $0xd, %eax ja 0x4ff45 xorl %ecx, %ecx btl $0xc, %ebx setae %cl leal 0x1(,%rcx,2), %ebp andl $-0x2, %eax leaq 0x7d04b(%rip), %rcx # 0xccf84 movzwl (%rax,%rcx), %esi movq %r14, %rdi callq 0x44520 leal 0x1(,%r12,2), %ecx movb $0x1, %al movl %ebp, %edx leaq 0x7b724(%rip), %rsi # 0xcb67c movslq (%rsi,%rdx,4), %rdx addq %rsi, %rdx jmpq *%rdx xorl %eax, %eax jmp 0x4ff69 xorl %eax, %eax movl %ecx, %ebp testb %al, %al je 0x4ffa6 shrl $0x1c, %ebx movl %r15d, %eax leaq 0x7da86(%rip), %rcx # 0xcda00 movzwl (%rcx,%rax,2), %esi movq %r14, %rdi callq 0x44520 movq %r14, %rdi movl %ebx, %esi callq 0x4f229 movl %eax, %ecx leaq 0x7b6f3(%rip), %rdx # 0xcb68c movslq (%rdx,%rcx,4), %rcx addq %rdx, %rcx jmpq *%rcx movl %eax, %ebp jmp 0x4ffa8 xorl %ebp, %ebp movl %ebp, %eax popq %rbx popq %r12 popq %r14 popq %r15 popq %rbp retq
/bughoho[P]capstone/arch/ARM/ARMDisassembler.c
DecodePostIdxReg
static DecodeStatus DecodePostIdxReg(MCInst *Inst, unsigned Insn, uint64_t Address, const void *Decoder) { DecodeStatus S = MCDisassembler_Success; unsigned Rm = fieldFromInstruction_4(Insn, 0, 4); unsigned add = fieldFromInstruction_4(Insn, 4, 1); if (!Check(&S, DecodeGPRnopcRegisterClass(Inst, Rm, Address, Decoder))) return MCDisassembler_Fail; MCOperand_CreateImm0(Inst, add); return S; }
pushq %rbp pushq %r14 pushq %rbx movl %esi, %ebp movq %rdi, %rbx andl $0xf, %esi callq 0x4f3a3 movl %eax, %r14d movb $0x1, %cl cmpl $0x3, %eax je 0x4ffe1 cmpl $0x1, %r14d je 0x4ffe1 testl %r14d, %r14d je 0x4ffdf movl $0x3, %r14d xorl %ecx, %ecx xorl %eax, %eax testb %cl, %cl je 0x4fffa shrl $0x4, %ebp andl $0x1, %ebp movl %ebp, %esi movq %rbx, %rdi callq 0x44040 movl %r14d, %eax popq %rbx popq %r14 popq %rbp retq
/bughoho[P]capstone/arch/ARM/ARMDisassembler.c
DecodeLDR
static DecodeStatus DecodeLDR(MCInst *Inst, unsigned Val, uint64_t Address, const void *Decoder) { DecodeStatus S = MCDisassembler_Success; unsigned Cond; unsigned Rn = fieldFromInstruction_4(Val, 16, 4); unsigned Rt = fieldFromInstruction_4(Val, 12, 4); unsigned Rm = fieldFromInstruction_4(Val, 0, 4); Rm |= (fieldFromInstruction_4(Val, 23, 1) << 4); Cond = fieldFromInstruction_4(Val, 28, 4); if (fieldFromInstruction_4(Val, 8, 4) != 0 || Rn == Rt) S = MCDisassembler_SoftFail; if (!Check(&S, DecodeGPRnopcRegisterClass(Inst, Rt, Address, Decoder))) return MCDisassembler_Fail; if (!Check(&S, DecodeGPRnopcRegisterClass(Inst, Rn, Address, Decoder))) return MCDisassembler_Fail; if (!Check(&S, DecodeAddrMode7Operand(Inst, Rn, Address, Decoder))) return MCDisassembler_Fail; if (!Check(&S, DecodePostIdxReg(Inst, Rm, Address, Decoder))) return MCDisassembler_Fail; if (!Check(&S, DecodePredicateOperand(Inst, Cond, Address, Decoder))) return MCDisassembler_Fail; return S; }
pushq %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx movl %esi, %ebx movq %rdi, %r14 movl %esi, %ebp shrl $0x10, %ebp andl $0xf, %ebp shrl $0xc, %esi andl $0xf, %esi xorl %eax, %eax cmpl %esi, %ebp setne %al testl $0xf00, %ebx # imm = 0xF00 leal 0x1(%rax,%rax), %eax movl $0x1, %r15d cmovel %eax, %r15d callq 0x4f3a3 movl %eax, %r12d testl %eax, %eax je 0x50056 movb $0x1, %al cmpl $0x3, %r12d je 0x50051 cmpl $0x1, %r12d je 0x50058 xorl %eax, %eax movl %r15d, %r12d jmp 0x50058 xorl %eax, %eax testb %al, %al je 0x50101 movq %r14, %rdi movl %ebp, %esi callq 0x4f3a3 movl %eax, %r15d testl %eax, %eax je 0x50086 movb $0x1, %al cmpl $0x3, %r15d je 0x50081 cmpl $0x1, %r15d je 0x50088 xorl %eax, %eax movl %r12d, %r15d jmp 0x50088 xorl %eax, %eax testb %al, %al je 0x50101 movl %ebx, %r12d shrl $0x13, %r12d movl %ebx, %eax andl $0xf, %eax andl $0x10, %r12d orl %eax, %r12d movl %ebp, %eax leaq 0x7d958(%rip), %rcx # 0xcda00 movzwl (%rcx,%rax,2), %esi movq %r14, %rdi callq 0x44520 movq %r14, %rdi movl %r12d, %esi callq 0x4ffb3 movl %eax, %ebp testl %eax, %eax je 0x500d8 movb $0x1, %al cmpl $0x3, %ebp je 0x500d3 cmpl $0x1, %ebp je 0x500da xorl %eax, %eax movl %r15d, %ebp jmp 0x500da xorl %eax, %eax testb %al, %al je 0x50101 shrl $0x1c, %ebx movq %r14, %rdi movl %ebx, %esi callq 0x4f229 movl %eax, %ecx leaq 0x7b5a8(%rip), %rdx # 0xcb69c movslq (%rdx,%rcx,4), %rcx addq %rdx, %rcx jmpq *%rcx movl %eax, %ebp jmp 0x50103 xorl %ebp, %ebp movl %ebp, %eax popq %rbx popq %r12 popq %r14 popq %r15 popq %rbp retq
/bughoho[P]capstone/arch/ARM/ARMDisassembler.c
DecodeArmMOVTWInstruction
static DecodeStatus DecodeArmMOVTWInstruction(MCInst *Inst, unsigned Insn, uint64_t Address, const void *Decoder) { DecodeStatus S = MCDisassembler_Success; unsigned Rd = fieldFromInstruction_4(Insn, 12, 4); unsigned pred = fieldFromInstruction_4(Insn, 28, 4); unsigned imm = 0; imm |= (fieldFromInstruction_4(Insn, 0, 12) << 0); imm |= (fieldFromInstruction_4(Insn, 16, 4) << 12); if (MCInst_getOpcode(Inst) == ARM_MOVTi16) if (!Check(&S, DecodeGPRnopcRegisterClass(Inst, Rd, Address, Decoder))) return MCDisassembler_Fail; if (!Check(&S, DecodeGPRnopcRegisterClass(Inst, Rd, Address, Decoder))) return MCDisassembler_Fail; MCOperand_CreateImm0(Inst, imm); if (!Check(&S, DecodePredicateOperand(Inst, pred, Address, Decoder))) return MCDisassembler_Fail; return S; }
pushq %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx movl %esi, %ebx movq %rdi, %r14 movl %esi, %r12d shrl $0xc, %r12d andl $0xf, %r12d callq 0x44490 movl $0x3, %r15d cmpl $0xd8, %eax jne 0x50167 movq %r14, %rdi movl %r12d, %esi callq 0x4f3a3 movl %eax, %r15d movb $0x1, %al cmpl $0x3, %r15d je 0x50161 cmpl $0x1, %r15d je 0x50161 testl %r15d, %r15d je 0x5015f movl $0x3, %r15d xorl %eax, %eax xorl %ebp, %ebp testb %al, %al je 0x501d4 movq %r14, %rdi movl %r12d, %esi callq 0x4f3a3 movl %eax, %ebp testl %eax, %eax je 0x5018b movb $0x1, %al cmpl $0x3, %ebp je 0x50186 cmpl $0x1, %ebp je 0x5018d xorl %eax, %eax movl %r15d, %ebp jmp 0x5018d xorl %eax, %eax testb %al, %al je 0x501d2 movl %ebx, %eax shrl $0x4, %eax movl %ebx, %ecx andl $0xfff, %ecx # imm = 0xFFF andl $0xf000, %eax # imm = 0xF000 orl %ecx, %eax shrl $0x1c, %ebx movl %eax, %esi movq %r14, %rdi callq 0x44040 movq %r14, %rdi movl %ebx, %esi callq 0x4f229 movl %eax, %ecx leaq 0x7b4e7(%rip), %rdx # 0xcb6ac movslq (%rdx,%rcx,4), %rcx addq %rdx, %rcx jmpq *%rcx movl %eax, %ebp jmp 0x501d4 xorl %ebp, %ebp movl %ebp, %eax popq %rbx popq %r12 popq %r14 popq %r15 popq %rbp retq
/bughoho[P]capstone/arch/ARM/ARMDisassembler.c
DecodeAddrMode2IdxInstruction
static DecodeStatus DecodeAddrMode2IdxInstruction(MCInst *Inst, unsigned Insn, uint64_t Address, const void *Decoder) { DecodeStatus S = MCDisassembler_Success; ARM_AM_AddrOpc Op; ARM_AM_ShiftOpc Opc; bool writeback; unsigned Rn = fieldFromInstruction_4(Insn, 16, 4); unsigned Rt = fieldFromInstruction_4(Insn, 12, 4); unsigned Rm = fieldFromInstruction_4(Insn, 0, 4); unsigned imm = fieldFromInstruction_4(Insn, 0, 12); unsigned pred = fieldFromInstruction_4(Insn, 28, 4); unsigned reg = fieldFromInstruction_4(Insn, 25, 1); unsigned P = fieldFromInstruction_4(Insn, 24, 1); unsigned W = fieldFromInstruction_4(Insn, 21, 1); unsigned idx_mode = 0, amt, tmp; // On stores, the writeback operand precedes Rt. switch (MCInst_getOpcode(Inst)) { case ARM_STR_POST_IMM: case ARM_STR_POST_REG: case ARM_STRB_POST_IMM: case ARM_STRB_POST_REG: case ARM_STRT_POST_REG: case ARM_STRT_POST_IMM: case ARM_STRBT_POST_REG: case ARM_STRBT_POST_IMM: if (!Check(&S, DecodeGPRRegisterClass(Inst, Rn, Address, Decoder))) return MCDisassembler_Fail; break; default: break; } if (!Check(&S, DecodeGPRRegisterClass(Inst, Rt, Address, Decoder))) return MCDisassembler_Fail; // On loads, the writeback operand comes after Rt. switch (MCInst_getOpcode(Inst)) { case ARM_LDR_POST_IMM: case ARM_LDR_POST_REG: case ARM_LDRB_POST_IMM: case ARM_LDRB_POST_REG: case ARM_LDRBT_POST_REG: case ARM_LDRBT_POST_IMM: case ARM_LDRT_POST_REG: case ARM_LDRT_POST_IMM: if (!Check(&S, DecodeGPRRegisterClass(Inst, Rn, Address, Decoder))) return MCDisassembler_Fail; break; default: break; } if (!Check(&S, DecodeGPRRegisterClass(Inst, Rn, Address, Decoder))) return MCDisassembler_Fail; Op = ARM_AM_add; if (!fieldFromInstruction_4(Insn, 23, 1)) Op = ARM_AM_sub; writeback = (P == 0) || (W == 1); if (P && writeback) idx_mode = ARMII_IndexModePre; else if (!P && writeback) idx_mode = ARMII_IndexModePost; if (writeback && (Rn == 15 || Rn == Rt)) S = MCDisassembler_SoftFail; // UNPREDICTABLE if (reg) { if (!Check(&S, DecodeGPRnopcRegisterClass(Inst, Rm, Address, Decoder))) return MCDisassembler_Fail; Opc = ARM_AM_lsl; switch( fieldFromInstruction_4(Insn, 5, 2)) { case 0: Opc = ARM_AM_lsl; break; case 1: Opc = ARM_AM_lsr; break; case 2: Opc = ARM_AM_asr; break; case 3: Opc = ARM_AM_ror; break; default: return MCDisassembler_Fail; } amt = fieldFromInstruction_4(Insn, 7, 5); if (Opc == ARM_AM_ror && amt == 0) Opc = ARM_AM_rrx; imm = ARM_AM_getAM2Opc(Op, amt, Opc, idx_mode); MCOperand_CreateImm0(Inst, imm); } else { MCOperand_CreateReg0(Inst, 0); tmp = ARM_AM_getAM2Opc(Op, imm, ARM_AM_lsl, idx_mode); MCOperand_CreateImm0(Inst, tmp); } if (!Check(&S, DecodePredicateOperand(Inst, pred, Address, Decoder))) return MCDisassembler_Fail; return S; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl %esi, %ebx movq %rdi, %r14 movl %esi, %ebp shrl $0x10, %ebp andl $0xf, %ebp movl %esi, %r12d shrl $0xc, %r12d andl $0xf, %r12d callq 0x44490 addl $0xfffffe62, %eax # imm = 0xFFFFFE62 movl %ebp, %r15d cmpl $0x1b, %eax ja 0x50232 movl $0xf00000f, %ecx # imm = 0xF00000F btl %eax, %ecx jae 0x50232 leaq 0x7d7db(%rip), %rax # 0xcda00 movzwl (%rax,%r15,2), %esi movq %r14, %rdi callq 0x44520 movl %r12d, %eax leaq 0x7d7c4(%rip), %r13 # 0xcda00 movzwl (%r13,%rax,2), %esi movq %r14, %rdi callq 0x44520 movq %r14, %rdi callq 0x44490 addl $0xffffff68, %eax # imm = 0xFFFFFF68 cmpl $0x25, %eax ja 0x5027a movabsq $0x3c0000000f, %rcx # imm = 0x3C0000000F btq %rax, %rcx jae 0x5027a movzwl (%r13,%r15,2), %esi movq %r14, %rdi callq 0x44520 movzwl (%r13,%r15,2), %esi movq %r14, %rdi callq 0x44520 movl %ebx, %r15d andl $0x800000, %r15d # imm = 0x800000 movl %ebx, %eax shrl $0x18, %eax andl $0x1, %eax movl %ebx, %ecx andl $0x1200000, %ecx # imm = 0x1200000 xorl %edx, %edx cmpl %r12d, %ebp setne %dl cmpl $0xf, %ebp leal 0x1(%rdx,%rdx), %edx movl $0x1, %esi cmovnel %edx, %esi cmpl $0x1000000, %ecx # imm = 0x1000000 movl $0x3, %r13d cmovnel %esi, %r13d setne %cl andb %al, %cl movzbl %cl, %ecx testl %eax, %eax movl $0x2, %r12d cmovnel %ecx, %r12d btl $0x19, %ebx jb 0x50312 movl %ebx, %ebp andl $0xfff, %ebp # imm = 0xFFF movq %r14, %rdi xorl %esi, %esi callq 0x44520 shrl $0xb, %r15d orl %ebp, %r15d shll $0x10, %r12d orl %r15d, %r12d xorl $0x5000, %r12d # imm = 0x5000 movl %r13d, %ebp jmp 0x503a9 movl %ebx, %esi andl $0xf, %esi movq %r14, %rdi callq 0x4f3a3 movl %eax, %ebp testl %eax, %eax je 0x50338 movb $0x1, %cl cmpl $0x3, %ebp je 0x50333 cmpl $0x1, %ebp je 0x5033a xorl %ecx, %ecx movl %r13d, %ebp jmp 0x5033a xorl %ecx, %ecx xorl %eax, %eax testb %cl, %cl je 0x503dd movl %ebx, %eax shrl $0x5, %eax andl $0x3, %eax leaq 0x7b369(%rip), %rcx # 0xcb6bc movslq (%rcx,%rax,4), %rax addq %rcx, %rax jmpq *%rax movl $0x4000, %eax # imm = 0x4000 jmp 0x50378 movl $0x2000, %eax # imm = 0x2000 jmp 0x50378 movl $0x8000, %eax # imm = 0x8000 movb $0x1, %cl jmp 0x5037a movl $0x6000, %eax # imm = 0x6000 xorl %ecx, %ecx movl %ebx, %edx shrl $0x7, %edx andl $0x1f, %edx testb %cl, %cl movl $0xa000, %ecx # imm = 0xA000 cmovel %eax, %ecx testl %edx, %edx cmovnel %eax, %ecx shrl $0xb, %r15d orl %ecx, %r15d shll $0x10, %r12d orl %r15d, %r12d orl %edx, %r12d xorl $0x1000, %r12d # imm = 0x1000 shrl $0x1c, %ebx movl %r12d, %esi movq %r14, %rdi callq 0x44040 movq %r14, %rdi movl %ebx, %esi callq 0x4f229 movl %eax, %ecx movl %eax, %eax leaq 0x7b300(%rip), %rdx # 0xcb6cc movslq (%rdx,%rax,4), %rsi addq %rdx, %rsi movl %ebp, %eax jmpq *%rsi movl %ecx, %eax jmp 0x503dd xorl %eax, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/bughoho[P]capstone/arch/ARM/ARMDisassembler.c
DecodeAddrModeImm12Operand
static DecodeStatus DecodeAddrModeImm12Operand(MCInst *Inst, unsigned Val, uint64_t Address, const void *Decoder) { DecodeStatus S = MCDisassembler_Success; unsigned add = fieldFromInstruction_4(Val, 12, 1); unsigned imm = fieldFromInstruction_4(Val, 0, 12); unsigned Rn = fieldFromInstruction_4(Val, 13, 4); if (!Check(&S, DecodeGPRRegisterClass(Inst, Rn, Address, Decoder))) return MCDisassembler_Fail; if (!add) imm *= (unsigned int)-1; if (imm == 0 && !add) imm = (unsigned int)INT32_MIN; MCOperand_CreateImm0(Inst, imm); //if (Rn == 15) // tryAddingPcLoadReferenceComment(Address, Address + imm + 8, Decoder); return S; }
pushq %rbp pushq %r14 pushq %rbx movl %esi, %ebx movq %rdi, %r14 movl %esi, %eax shrl $0xc, %eax movl %eax, %ebp andl $0x1, %ebp andl $0xfff, %ebx # imm = 0xFFF andl $0x1e, %eax leaq 0x7d5f1(%rip), %rcx # 0xcda00 movzwl (%rax,%rcx), %esi callq 0x44520 movl %ebx, %eax negl %eax testl %ebp, %ebp cmovnel %ebx, %eax orl %eax, %ebp movl $0x80000000, %esi # imm = 0x80000000 cmovnel %eax, %esi movq %r14, %rdi callq 0x44040 movl $0x3, %eax popq %rbx popq %r14 popq %rbp retq
/bughoho[P]capstone/arch/ARM/ARMDisassembler.c
DecodeLDRPreImm
static DecodeStatus DecodeLDRPreImm(MCInst *Inst, unsigned Insn, uint64_t Address, const void *Decoder) { DecodeStatus S = MCDisassembler_Success; unsigned pred; unsigned Rn = fieldFromInstruction_4(Insn, 16, 4); unsigned Rt = fieldFromInstruction_4(Insn, 12, 4); unsigned imm = fieldFromInstruction_4(Insn, 0, 12); imm |= fieldFromInstruction_4(Insn, 16, 4) << 13; imm |= fieldFromInstruction_4(Insn, 23, 1) << 12; pred = fieldFromInstruction_4(Insn, 28, 4); if (Rn == 0xF || Rn == Rt) S = MCDisassembler_SoftFail; if (!Check(&S, DecodeGPRRegisterClass(Inst, Rt, Address, Decoder))) return MCDisassembler_Fail; if (!Check(&S, DecodeGPRRegisterClass(Inst, Rn, Address, Decoder))) return MCDisassembler_Fail; if (!Check(&S, DecodeAddrModeImm12Operand(Inst, imm, Address, Decoder))) return MCDisassembler_Fail; if (!Check(&S, DecodePredicateOperand(Inst, pred, Address, Decoder))) return MCDisassembler_Fail; return S; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl %esi, %ebx movq %rdi, %r14 movl %esi, %r12d shrl $0x10, %r12d andl $0xf, %r12d movl %esi, %eax shrl $0xc, %eax andl $0xf, %eax movl %esi, %ecx andl $0xfff, %ecx # imm = 0xFFF movl %r12d, %edx shll $0xd, %edx orl %ecx, %edx movl %esi, %ebp shrl $0xb, %ebp andl $0x1000, %ebp # imm = 0x1000 orl %edx, %ebp xorl %ecx, %ecx cmpl %eax, %r12d setne %cl cmpl $0xf, %r12d leal 0x1(%rcx,%rcx), %ecx movl $0x1, %r15d cmovnel %ecx, %r15d leaq 0x7d48b(%rip), %r13 # 0xcda00 movzwl (%r13,%rax,2), %esi callq 0x44520 movzwl (%r13,%r12,2), %esi movq %r14, %rdi callq 0x44520 movq %r14, %rdi movl %ebp, %esi callq 0x503ec movl %eax, %ebp testl %eax, %eax je 0x505b1 movb $0x1, %al cmpl $0x3, %ebp je 0x505ac cmpl $0x1, %ebp je 0x505b3 xorl %eax, %eax movl %r15d, %ebp jmp 0x505b3 xorl %eax, %eax testb %al, %al je 0x505da shrl $0x1c, %ebx movq %r14, %rdi movl %ebx, %esi callq 0x4f229 movl %eax, %ecx leaq 0x7b11f(%rip), %rdx # 0xcb6ec movslq (%rdx,%rcx,4), %rcx addq %rdx, %rcx jmpq *%rcx movl %eax, %ebp jmp 0x505dc xorl %ebp, %ebp movl %ebp, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/bughoho[P]capstone/arch/ARM/ARMDisassembler.c
DecodeSORegMemOperand
static DecodeStatus DecodeSORegMemOperand(MCInst *Inst, unsigned Val, uint64_t Address, const void *Decoder) { DecodeStatus S = MCDisassembler_Success; ARM_AM_ShiftOpc ShOp; unsigned shift; unsigned Rn = fieldFromInstruction_4(Val, 13, 4); unsigned Rm = fieldFromInstruction_4(Val, 0, 4); unsigned type = fieldFromInstruction_4(Val, 5, 2); unsigned imm = fieldFromInstruction_4(Val, 7, 5); unsigned U = fieldFromInstruction_4(Val, 12, 1); ShOp = ARM_AM_lsl; switch (type) { case 0: ShOp = ARM_AM_lsl; break; case 1: ShOp = ARM_AM_lsr; break; case 2: ShOp = ARM_AM_asr; break; case 3: ShOp = ARM_AM_ror; break; } if (ShOp == ARM_AM_ror && imm == 0) ShOp = ARM_AM_rrx; if (!Check(&S, DecodeGPRRegisterClass(Inst, Rn, Address, Decoder))) return MCDisassembler_Fail; if (!Check(&S, DecodeGPRRegisterClass(Inst, Rm, Address, Decoder))) return MCDisassembler_Fail; if (U) shift = ARM_AM_getAM2Opc(ARM_AM_add, imm, ShOp, 0); else shift = ARM_AM_getAM2Opc(ARM_AM_sub, imm, ShOp, 0); MCOperand_CreateImm0(Inst, shift); return S; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl %esi, %ebx movq %rdi, %r14 movl %esi, %eax shrl $0x5, %eax andl $0x3, %eax leaq 0x7b0f0(%rip), %rcx # 0xcb6fc movslq (%rcx,%rax,4), %rax addq %rcx, %rax jmpq *%rax movl $0x4000, %eax # imm = 0x4000 jmp 0x50631 movl $0x2000, %eax # imm = 0x2000 jmp 0x50631 movl $0x8000, %eax # imm = 0x8000 movb $0x1, %cl jmp 0x50633 movl $0x6000, %eax # imm = 0x6000 xorl %ecx, %ecx movl %ebx, %ebp shrl $0x7, %ebp andl $0x1f, %ebp movl %ebx, %r12d andl $0xf, %r12d testb %cl, %cl movl $0xa000, %r15d # imm = 0xA000 cmovel %eax, %r15d testl %ebp, %ebp cmovnel %eax, %r15d movl %ebx, %eax shrl $0xc, %eax andl $0x1e, %eax leaq 0x7d39d(%rip), %r13 # 0xcda00 movzwl (%rax,%r13), %esi movq %r14, %rdi callq 0x44520 movzwl (%r13,%r12,2), %esi movq %r14, %rdi callq 0x44520 movl $0x1000, %eax # imm = 0x1000 andl %eax, %ebx orl %ebp, %ebx orl %r15d, %ebx xorl %eax, %ebx movq %r14, %rdi movq %rbx, %rsi callq 0x44040 movl $0x3, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/bughoho[P]capstone/arch/ARM/ARMDisassembler.c
DecodeSTRPreReg
static DecodeStatus DecodeSTRPreReg(MCInst *Inst, unsigned Insn, uint64_t Address, const void *Decoder) { DecodeStatus S = MCDisassembler_Success; unsigned pred; unsigned Rn = fieldFromInstruction_4(Insn, 16, 4); unsigned Rt = fieldFromInstruction_4(Insn, 12, 4); unsigned imm = fieldFromInstruction_4(Insn, 0, 12); imm |= fieldFromInstruction_4(Insn, 16, 4) << 13; imm |= fieldFromInstruction_4(Insn, 23, 1) << 12; pred = fieldFromInstruction_4(Insn, 28, 4); if (Rn == 0xF || Rn == Rt) S = MCDisassembler_SoftFail; if (!Check(&S, DecodeGPRRegisterClass(Inst, Rn, Address, Decoder))) return MCDisassembler_Fail; if (!Check(&S, DecodeGPRRegisterClass(Inst, Rt, Address, Decoder))) return MCDisassembler_Fail; if (!Check(&S, DecodeSORegMemOperand(Inst, imm, Address, Decoder))) return MCDisassembler_Fail; if (!Check(&S, DecodePredicateOperand(Inst, pred, Address, Decoder))) return MCDisassembler_Fail; return S; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl %esi, %ebx movq %rdi, %r14 movl %esi, %eax shrl $0x10, %eax andl $0xf, %eax movl %esi, %r12d shrl $0xc, %r12d andl $0xf, %r12d movl %esi, %ecx andl $0xfff, %ecx # imm = 0xFFF movl %eax, %edx shll $0xd, %edx orl %ecx, %edx movl %esi, %ebp shrl $0xb, %ebp andl $0x1000, %ebp # imm = 0x1000 orl %edx, %ebp xorl %ecx, %ecx cmpl %r12d, %eax setne %cl cmpl $0xf, %eax leal 0x1(%rcx,%rcx), %ecx movl $0x1, %r15d cmovnel %ecx, %r15d leaq 0x7d2f6(%rip), %r13 # 0xcda00 movzwl (%r13,%rax,2), %esi callq 0x44520 movzwl (%r13,%r12,2), %esi movq %r14, %rdi callq 0x44520 movq %r14, %rdi movl %ebp, %esi callq 0x505ed movl %eax, %ebp testl %eax, %eax je 0x50746 movb $0x1, %al cmpl $0x3, %ebp je 0x50741 cmpl $0x1, %ebp je 0x50748 xorl %eax, %eax movl %r15d, %ebp jmp 0x50748 xorl %eax, %eax testb %al, %al je 0x5076f shrl $0x1c, %ebx movq %r14, %rdi movl %ebx, %esi callq 0x4f229 movl %eax, %ecx leaq 0x7afaa(%rip), %rdx # 0xcb70c movslq (%rdx,%rcx,4), %rcx addq %rdx, %rcx jmpq *%rcx movl %eax, %ebp jmp 0x50771 xorl %ebp, %ebp movl %ebp, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/bughoho[P]capstone/arch/ARM/ARMDisassembler.c
DecodeLDRPreReg
static DecodeStatus DecodeLDRPreReg(MCInst *Inst, unsigned Insn, uint64_t Address, const void *Decoder) { DecodeStatus S = MCDisassembler_Success; unsigned pred, Rm; unsigned Rn = fieldFromInstruction_4(Insn, 16, 4); unsigned Rt = fieldFromInstruction_4(Insn, 12, 4); unsigned imm = fieldFromInstruction_4(Insn, 0, 12); imm |= fieldFromInstruction_4(Insn, 16, 4) << 13; imm |= fieldFromInstruction_4(Insn, 23, 1) << 12; pred = fieldFromInstruction_4(Insn, 28, 4); Rm = fieldFromInstruction_4(Insn, 0, 4); if (Rn == 0xF || Rn == Rt) S = MCDisassembler_SoftFail; if (Rm == 0xF) S = MCDisassembler_SoftFail; if (!Check(&S, DecodeGPRRegisterClass(Inst, Rt, Address, Decoder))) return MCDisassembler_Fail; if (!Check(&S, DecodeGPRRegisterClass(Inst, Rn, Address, Decoder))) return MCDisassembler_Fail; if (!Check(&S, DecodeSORegMemOperand(Inst, imm, Address, Decoder))) return MCDisassembler_Fail; if (!Check(&S, DecodePredicateOperand(Inst, pred, Address, Decoder))) return MCDisassembler_Fail; return S; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl %esi, %ebx movq %rdi, %r14 movl %esi, %r12d shrl $0x10, %r12d andl $0xf, %r12d movl %esi, %eax shrl $0xc, %eax andl $0xf, %eax movl %esi, %ecx andl $0xfff, %ecx # imm = 0xFFF movl %r12d, %edx shll $0xd, %edx orl %ecx, %edx movl %esi, %ebp shrl $0xb, %ebp andl $0x1000, %ebp # imm = 0x1000 orl %edx, %ebp xorl %r15d, %r15d cmpl %eax, %r12d setne %r15b addl %r15d, %r15d movl $0x1, %ecx orl %ecx, %r15d cmpl $0xf, %r12d movl %esi, %edx notl %edx cmovel %ecx, %r15d testb $0xf, %dl cmovel %ecx, %r15d leaq 0x7d20f(%rip), %r13 # 0xcda00 movzwl (%r13,%rax,2), %esi callq 0x44520 movzwl (%r13,%r12,2), %esi movq %r14, %rdi callq 0x44520 movq %r14, %rdi movl %ebp, %esi callq 0x505ed movl %eax, %ebp testl %eax, %eax je 0x5082d movb $0x1, %al cmpl $0x3, %ebp je 0x50828 cmpl $0x1, %ebp je 0x5082f xorl %eax, %eax movl %r15d, %ebp jmp 0x5082f xorl %eax, %eax testb %al, %al je 0x50856 shrl $0x1c, %ebx movq %r14, %rdi movl %ebx, %esi callq 0x4f229 movl %eax, %ecx leaq 0x7aed3(%rip), %rdx # 0xcb71c movslq (%rdx,%rcx,4), %rcx addq %rdx, %rcx jmpq *%rcx movl %eax, %ebp jmp 0x50858 xorl %ebp, %ebp movl %ebp, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/bughoho[P]capstone/arch/ARM/ARMDisassembler.c
DecodeBitfieldMaskOperand
static DecodeStatus DecodeBitfieldMaskOperand(MCInst *Inst, unsigned Val, uint64_t Address, const void *Decoder) { // This operand encodes a mask of contiguous zeros between a specified MSB // and LSB. To decode it, we create the mask of all bits MSB-and-lower, // the mask of all bits LSB-and-lower, and then xor them to create // the mask of that's all ones on [msb, lsb]. Finally we not it to // create the final mask. unsigned msb = fieldFromInstruction_4(Val, 5, 5); unsigned lsb = fieldFromInstruction_4(Val, 0, 5); uint32_t lsb_mask, msb_mask; DecodeStatus S = MCDisassembler_Success; if (lsb > msb) { Check(&S, MCDisassembler_SoftFail); // The check above will cause the warning for the "potentially undefined // instruction encoding" but we can't build a bad MCOperand value here // with a lsb > msb or else printing the MCInst will cause a crash. lsb = msb; } msb_mask = 0xFFFFFFFF; if (msb != 31) msb_mask = (1U << (msb+1)) - 1; lsb_mask = (1U << lsb) - 1; MCOperand_CreateImm0(Inst, ~(msb_mask ^ lsb_mask)); return S; }
pushq %rbx movl %esi, %edx movl %esi, %eax shrl $0x5, %eax andl $0x1f, %eax andl $0x1f, %edx xorl %r8d, %r8d cmpl %eax, %edx setbe %r8b cmovael %eax, %edx movl $0xfffffffe, %esi # imm = 0xFFFFFFFE movl %eax, %ecx shll %cl, %esi leal 0x1(,%r8,2), %ebx movl $0xffffffff, %r8d # imm = 0xFFFFFFFF xorl %r8d, %esi movl $0xffffffff, %r9d # imm = 0xFFFFFFFF movl %edx, %ecx shll %cl, %r9d cmpl $0x1f, %eax cmovel %r8d, %esi xorl %r9d, %esi callq 0x44040 movl %ebx, %eax popq %rbx retq
/bughoho[P]capstone/arch/ARM/ARMDisassembler.c
DecodeMemMultipleWritebackInstruction
static DecodeStatus DecodeMemMultipleWritebackInstruction(MCInst *Inst, unsigned Insn, uint64_t Address, const void *Decoder) { DecodeStatus S = MCDisassembler_Success; unsigned Rn = fieldFromInstruction_4(Insn, 16, 4); unsigned pred = fieldFromInstruction_4(Insn, 28, 4); unsigned reglist = fieldFromInstruction_4(Insn, 0, 16); if (pred == 0xF) { // Ambiguous with RFE and SRS switch (MCInst_getOpcode(Inst)) { case ARM_LDMDA: MCInst_setOpcode(Inst, ARM_RFEDA); break; case ARM_LDMDA_UPD: MCInst_setOpcode(Inst, ARM_RFEDA_UPD); break; case ARM_LDMDB: MCInst_setOpcode(Inst, ARM_RFEDB); break; case ARM_LDMDB_UPD: MCInst_setOpcode(Inst, ARM_RFEDB_UPD); break; case ARM_LDMIA: MCInst_setOpcode(Inst, ARM_RFEIA); break; case ARM_LDMIA_UPD: MCInst_setOpcode(Inst, ARM_RFEIA_UPD); break; case ARM_LDMIB: MCInst_setOpcode(Inst, ARM_RFEIB); break; case ARM_LDMIB_UPD: MCInst_setOpcode(Inst, ARM_RFEIB_UPD); break; case ARM_STMDA: MCInst_setOpcode(Inst, ARM_SRSDA); break; case ARM_STMDA_UPD: MCInst_setOpcode(Inst, ARM_SRSDA_UPD); break; case ARM_STMDB: MCInst_setOpcode(Inst, ARM_SRSDB); break; case ARM_STMDB_UPD: MCInst_setOpcode(Inst, ARM_SRSDB_UPD); break; case ARM_STMIA: MCInst_setOpcode(Inst, ARM_SRSIA); break; case ARM_STMIA_UPD: MCInst_setOpcode(Inst, ARM_SRSIA_UPD); break; case ARM_STMIB: MCInst_setOpcode(Inst, ARM_SRSIB); break; case ARM_STMIB_UPD: MCInst_setOpcode(Inst, ARM_SRSIB_UPD); break; default: return MCDisassembler_Fail; } // For stores (which become SRS's, the only operand is the mode. if (fieldFromInstruction_4(Insn, 20, 1) == 0) { // Check SRS encoding constraints if (!(fieldFromInstruction_4(Insn, 22, 1) == 1 && fieldFromInstruction_4(Insn, 20, 1) == 0)) return MCDisassembler_Fail; MCOperand_CreateImm0(Inst, fieldFromInstruction_4(Insn, 0, 4)); return S; } return DecodeRFEInstruction(Inst, Insn, Address, Decoder); } if (!Check(&S, DecodeGPRRegisterClass(Inst, Rn, Address, Decoder))) return MCDisassembler_Fail; if (!Check(&S, DecodeGPRRegisterClass(Inst, Rn, Address, Decoder))) return MCDisassembler_Fail; // Tied if (!Check(&S, DecodePredicateOperand(Inst, pred, Address, Decoder))) return MCDisassembler_Fail; if (!Check(&S, DecodeRegListOperand(Inst, reglist, Address, Decoder))) return MCDisassembler_Fail; return S; }
pushq %rbp pushq %r15 pushq %r14 pushq %rbx pushq %rax movl %esi, %r14d movq %rdi, %rbx movl %esi, %ebp shrl $0x1c, %ebp cmpl $0xf, %ebp jne 0x50a44 movq %rbx, %rdi callq 0x44490 xorl %ebp, %ebp leal -0x8e(%rax), %ecx cmpl $0x8, %ecx ja 0x50ac5 leaq 0x7ad0b(%rip), %rax # 0xcb73c movslq (%rax,%rcx,4), %rcx addq %rax, %rcx jmpq *%rcx movl $0x118, %esi # imm = 0x118 jmp 0x50b51 movl %r14d, %eax shrl $0xf, %eax andl $0x1e, %eax leaq 0x7cfac(%rip), %rcx # 0xcda00 movzwl (%rax,%rcx), %r15d movq %rbx, %rdi movl %r15d, %esi callq 0x44520 movq %rbx, %rdi movl %r15d, %esi callq 0x44520 movq %rbx, %rdi movl %ebp, %esi callq 0x4f229 movl %eax, %ebp movb $0x1, %al movl %ebp, %ecx leaq 0x7aca6(%rip), %rdx # 0xcb72c movslq (%rdx,%rcx,4), %rcx addq %rdx, %rcx jmpq *%rcx movl $0x3, %ebp xorl %eax, %eax testb %al, %al je 0x50abe movzwl %r14w, %esi movq %rbx, %rdi callq 0x508bb testl %eax, %eax je 0x50aea cmpl $0x3, %eax je 0x50bb5 movl %eax, %ebp cmpl $0x1, %eax je 0x50bb5 xorl %ebp, %ebp jmp 0x50bb5 addl $0xfffffe6b, %eax # imm = 0xFFFFFE6B cmpl $0x7, %eax ja 0x50bb5 leaq 0x7ac86(%rip), %rcx # 0xcb760 movslq (%rcx,%rax,4), %rax addq %rcx, %rax jmpq *%rax movl $0x171, %esi # imm = 0x171 jmp 0x50b51 movl %eax, %ebp jmp 0x50bb5 movl $0x11e, %esi # imm = 0x11E jmp 0x50b51 movl $0x11b, %esi # imm = 0x11B jmp 0x50b51 movl $0x11c, %esi # imm = 0x11C jmp 0x50b51 movl $0x119, %esi # imm = 0x119 jmp 0x50b51 movl $0x11d, %esi # imm = 0x11D jmp 0x50b51 movl $0x11a, %esi # imm = 0x11A jmp 0x50b51 movl $0x11f, %esi # imm = 0x11F jmp 0x50b51 movl $0x175, %esi # imm = 0x175 jmp 0x50b51 movl $0x173, %esi # imm = 0x173 jmp 0x50b51 movl $0x174, %esi # imm = 0x174 jmp 0x50b51 movl $0x178, %esi # imm = 0x178 jmp 0x50b51 movl $0x172, %esi # imm = 0x172 jmp 0x50b51 movl $0x176, %esi # imm = 0x176 jmp 0x50b51 movl $0x177, %esi # imm = 0x177 movq %rbx, %rdi callq 0x44180 btl $0x14, %r14d jb 0x50b78 btl $0x16, %r14d jae 0x50bb5 andl $0xf, %r14d movq %rbx, %rdi movq %r14, %rsi callq 0x44040 jmp 0x50bb0 movl %r14d, %eax shrl $0x14, %eax andl $0x18, %eax leaq 0x7ced8(%rip), %rcx # 0xcda60 movq (%rax,%rcx), %rsi movq %rbx, %rdi callq 0x44040 shrl $0xf, %r14d andl $0x1e, %r14d leaq 0x7ce5d(%rip), %rax # 0xcda00 movzwl (%r14,%rax), %esi movq %rbx, %rdi callq 0x44520 movl $0x3, %ebp movl %ebp, %eax addq $0x8, %rsp popq %rbx popq %r14 popq %r15 popq %rbp retq
/bughoho[P]capstone/arch/ARM/ARMDisassembler.c
DecodeBranchImmInstruction
static DecodeStatus DecodeBranchImmInstruction(MCInst *Inst, unsigned Insn, uint64_t Address, const void *Decoder) { DecodeStatus S = MCDisassembler_Success; unsigned pred = fieldFromInstruction_4(Insn, 28, 4); unsigned imm = fieldFromInstruction_4(Insn, 0, 24) << 2; if (pred == 0xF) { MCInst_setOpcode(Inst, ARM_BLXi); imm |= fieldFromInstruction_4(Insn, 24, 1) << 1; MCOperand_CreateImm0(Inst, SignExtend32(imm, 26)); return S; } MCOperand_CreateImm0(Inst, SignExtend32(imm, 26)); if (!Check(&S, DecodePredicateOperand(Inst, pred, Address, Decoder))) return MCDisassembler_Fail; return S; }
pushq %rbp pushq %r14 pushq %rbx movl %esi, %ebp movq %rdi, %rbx movl %esi, %r14d shrl $0x1c, %r14d cmpl $0xf, %r14d jne 0x50c0a movq %rbx, %rdi movl $0x3b, %esi callq 0x44180 movl %ebp, %eax shll $0x8, %eax shrl $0x11, %ebp andl $0x80, %ebp orl %eax, %ebp sarl $0x6, %ebp movslq %ebp, %rsi movq %rbx, %rdi callq 0x44040 movl $0x3, %eax jmp 0x50c32 shll $0x8, %ebp sarl $0x6, %ebp movslq %ebp, %rsi movq %rbx, %rdi callq 0x44040 movq %rbx, %rdi movl %r14d, %esi callq 0x4f229 movl %eax, %eax leaq 0x7ce61(%rip), %rcx # 0xcda90 movl (%rcx,%rax,4), %eax popq %rbx popq %r14 popq %rbp retq
/bughoho[P]capstone/arch/ARM/ARMDisassembler.c
DecodeCopMemInstruction
static DecodeStatus DecodeCopMemInstruction(MCInst *Inst, unsigned Insn, uint64_t Address, const void *Decoder) { DecodeStatus S = MCDisassembler_Success; unsigned pred = fieldFromInstruction_4(Insn, 28, 4); unsigned CRd = fieldFromInstruction_4(Insn, 12, 4); unsigned coproc = fieldFromInstruction_4(Insn, 8, 4); unsigned imm = fieldFromInstruction_4(Insn, 0, 8); unsigned Rn = fieldFromInstruction_4(Insn, 16, 4); unsigned U = fieldFromInstruction_4(Insn, 23, 1); switch (MCInst_getOpcode(Inst)) { case ARM_LDC_OFFSET: case ARM_LDC_PRE: case ARM_LDC_POST: case ARM_LDC_OPTION: case ARM_LDCL_OFFSET: case ARM_LDCL_PRE: case ARM_LDCL_POST: case ARM_LDCL_OPTION: case ARM_STC_OFFSET: case ARM_STC_PRE: case ARM_STC_POST: case ARM_STC_OPTION: case ARM_STCL_OFFSET: case ARM_STCL_PRE: case ARM_STCL_POST: case ARM_STCL_OPTION: case ARM_t2LDC_OFFSET: case ARM_t2LDC_PRE: case ARM_t2LDC_POST: case ARM_t2LDC_OPTION: case ARM_t2LDCL_OFFSET: case ARM_t2LDCL_PRE: case ARM_t2LDCL_POST: case ARM_t2LDCL_OPTION: case ARM_t2STC_OFFSET: case ARM_t2STC_PRE: case ARM_t2STC_POST: case ARM_t2STC_OPTION: case ARM_t2STCL_OFFSET: case ARM_t2STCL_PRE: case ARM_t2STCL_POST: case ARM_t2STCL_OPTION: if (coproc == 0xA || coproc == 0xB) return MCDisassembler_Fail; break; default: break; } MCOperand_CreateImm0(Inst, coproc); MCOperand_CreateImm0(Inst, CRd); if (!Check(&S, DecodeGPRRegisterClass(Inst, Rn, Address, Decoder))) return MCDisassembler_Fail; switch (MCInst_getOpcode(Inst)) { case ARM_t2LDC2_OFFSET: case ARM_t2LDC2L_OFFSET: case ARM_t2LDC2_PRE: case ARM_t2LDC2L_PRE: case ARM_t2STC2_OFFSET: case ARM_t2STC2L_OFFSET: case ARM_t2STC2_PRE: case ARM_t2STC2L_PRE: case ARM_LDC2_OFFSET: case ARM_LDC2L_OFFSET: case ARM_LDC2_PRE: case ARM_LDC2L_PRE: case ARM_STC2_OFFSET: case ARM_STC2L_OFFSET: case ARM_STC2_PRE: case ARM_STC2L_PRE: case ARM_t2LDC_OFFSET: case ARM_t2LDCL_OFFSET: case ARM_t2LDC_PRE: case ARM_t2LDCL_PRE: case ARM_t2STC_OFFSET: case ARM_t2STCL_OFFSET: case ARM_t2STC_PRE: case ARM_t2STCL_PRE: case ARM_LDC_OFFSET: case ARM_LDCL_OFFSET: case ARM_LDC_PRE: case ARM_LDCL_PRE: case ARM_STC_OFFSET: case ARM_STCL_OFFSET: case ARM_STC_PRE: case ARM_STCL_PRE: imm = ARM_AM_getAM5Opc(U ? ARM_AM_add : ARM_AM_sub, (unsigned char)imm); MCOperand_CreateImm0(Inst, imm); break; case ARM_t2LDC2_POST: case ARM_t2LDC2L_POST: case ARM_t2STC2_POST: case ARM_t2STC2L_POST: case ARM_LDC2_POST: case ARM_LDC2L_POST: case ARM_STC2_POST: case ARM_STC2L_POST: case ARM_t2LDC_POST: case ARM_t2LDCL_POST: case ARM_t2STC_POST: case ARM_t2STCL_POST: case ARM_LDC_POST: case ARM_LDCL_POST: case ARM_STC_POST: case ARM_STCL_POST: imm |= U << 8; // fall through. default: // The 'option' variant doesn't encode 'U' in the immediate since // the immediate is unsigned [0,255]. MCOperand_CreateImm0(Inst, imm); break; } switch (MCInst_getOpcode(Inst)) { case ARM_LDC_OFFSET: case ARM_LDC_PRE: case ARM_LDC_POST: case ARM_LDC_OPTION: case ARM_LDCL_OFFSET: case ARM_LDCL_PRE: case ARM_LDCL_POST: case ARM_LDCL_OPTION: case ARM_STC_OFFSET: case ARM_STC_PRE: case ARM_STC_POST: case ARM_STC_OPTION: case ARM_STCL_OFFSET: case ARM_STCL_PRE: case ARM_STCL_POST: case ARM_STCL_OPTION: if (!Check(&S, DecodePredicateOperand(Inst, pred, Address, Decoder))) return MCDisassembler_Fail; break; default: break; } return S; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl %esi, %ebx movq %rdi, %r14 callq 0x44490 cmpl $0x934, %eax # imm = 0x934 jg 0x50c6a leal -0x86(%rax), %ecx cmpl $0x8, %ecx jb 0x50c7f addl $0xfffffe7a, %eax # imm = 0xFFFFFE7A cmpl $0x8, %eax jb 0x50c7f jmp 0x50c95 leal -0xa14(%rax), %ecx cmpl $0x8, %ecx jb 0x50c7f addl $0xfffff6cb, %eax # imm = 0xFFFFF6CB cmpl $0x7, %eax ja 0x50c95 movl %ebx, %ecx andl $0xe00, %ecx # imm = 0xE00 xorl %eax, %eax cmpl $0xa00, %ecx # imm = 0xA00 je 0x50db8 movl %ebx, %r12d shrl $0xc, %r12d andl $0xf, %r12d movl %ebx, %eax shrl $0x8, %eax andl $0xf, %eax movzbl %bl, %ebp movl %ebx, %r13d shrl $0x10, %r13d andl $0xf, %r13d movl %ebx, %r15d shrl $0x17, %r15d andl $0x1, %r15d movl %eax, %esi movq %r14, %rdi callq 0x44040 movl %r12d, %esi movq %r14, %rdi callq 0x44040 movl %r13d, %eax leaq 0x7cd20(%rip), %rcx # 0xcda00 movzwl (%rcx,%rax,2), %esi movq %r14, %rdi callq 0x44520 movq %r14, %rdi callq 0x44490 cmpl $0x92c, %eax # imm = 0x92C jg 0x50d0a leal -0x7e(%rax), %ecx cmpl $0xf, %ecx jbe 0x50d35 addl $0xfffffe82, %eax # imm = 0xFFFFFE82 jmp 0x50d1a leal -0x92d(%rax), %ecx cmpl $0xf, %ecx jbe 0x50d4b addl $0xfffff5f4, %eax # imm = 0xFFFFF5F4 cmpl $0xf, %eax ja 0x50d78 movl $0x9999, %ecx # imm = 0x9999 btl %eax, %ecx jb 0x50d55 movl $0x4444, %ecx # imm = 0x4444 btl %eax, %ecx jb 0x50d71 jmp 0x50d78 movl $0x9999, %edx # imm = 0x9999 btl %ecx, %edx jb 0x50d55 movl $0x4444, %edx # imm = 0x4444 btl %ecx, %edx jb 0x50d71 jmp 0x50d03 movl $0x9999, %edx # imm = 0x9999 btl %ecx, %edx jae 0x50d67 shll $0x8, %r15d movzbl %bl, %ebp orl %r15d, %ebp xorl $0x100, %ebp # imm = 0x100 jmp 0x50d78 movl $0x4444, %edx # imm = 0x4444 btl %ecx, %edx jae 0x50d15 shll $0x8, %r15d orl %r15d, %ebp movl %ebp, %esi movq %r14, %rdi callq 0x44040 movq %r14, %rdi callq 0x44490 leal -0x186(%rax), %ecx cmpl $0x8, %ecx jb 0x50d9f addl $0xffffff7a, %eax # imm = 0xFFFFFF7A cmpl $0x7, %eax ja 0x50dc7 shrl $0x1c, %ebx movq %r14, %rdi movl %ebx, %esi callq 0x4f229 movl %eax, %eax leaq 0x7ccdb(%rip), %rcx # 0xcda90 movl (%rcx,%rax,4), %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movl $0x3, %eax jmp 0x50db8
/bughoho[P]capstone/arch/ARM/ARMDisassembler.c
DecodeMRRC2
static DecodeStatus DecodeMRRC2(MCInst *Inst, unsigned Val, uint64_t Address, const void *Decoder) { DecodeStatus S = MCDisassembler_Success; unsigned CRm = fieldFromInstruction_4(Val, 0, 4); unsigned opc1 = fieldFromInstruction_4(Val, 4, 4); unsigned cop = fieldFromInstruction_4(Val, 8, 4); unsigned Rt = fieldFromInstruction_4(Val, 12, 4); unsigned Rt2 = fieldFromInstruction_4(Val, 16, 4); if ((cop & ~0x1) == 0xa) return MCDisassembler_Fail; if (Rt == Rt2) S = MCDisassembler_SoftFail; MCOperand_CreateImm0(Inst, cop); MCOperand_CreateImm0(Inst, opc1); if (!Check(&S, DecodeGPRnopcRegisterClass(Inst, Rt, Address, Decoder))) return MCDisassembler_Fail; if (!Check(&S, DecodeGPRnopcRegisterClass(Inst, Rt2, Address, Decoder))) return MCDisassembler_Fail; MCOperand_CreateImm0(Inst, CRm); return S; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl %esi, %eax andl $0xe00, %eax # imm = 0xE00 xorl %ebp, %ebp cmpl $0xa00, %eax # imm = 0xA00 je 0x50eba movl %esi, %r14d movq %rdi, %rbx movl %esi, %r15d shrl $0x10, %r15d andl $0xf, %r15d shrl $0x8, %esi andl $0xf, %esi movl %r14d, %r12d shrl $0xc, %r12d andl $0xf, %r12d movl %r14d, %r13d shrl $0x4, %r13d andl $0xf, %r13d xorl %ebp, %ebp cmpl %r15d, %r12d setne 0x7(%rsp) callq 0x44040 movq %rbx, %rdi movq %r13, %rsi callq 0x44040 movq %rbx, %rdi movl %r12d, %esi callq 0x4f3a3 movl %eax, %r12d testl %eax, %eax je 0x50e73 movb 0x7(%rsp), %al movb %al, %bpl leal 0x1(,%rbp,2), %ecx movb $0x1, %al cmpl $0x3, %r12d je 0x50e6e cmpl $0x1, %r12d movl $0x0, %ebp je 0x50e77 xorl %eax, %eax movl %ecx, %r12d jmp 0x50e77 movl %ecx, %r12d jmp 0x50e75 xorl %eax, %eax xorl %ebp, %ebp testb %al, %al je 0x50eba movq %rbx, %rdi movl %r15d, %esi callq 0x4f3a3 movl %eax, %r15d testl %eax, %eax je 0x50ea2 movb $0x1, %al cmpl $0x3, %r15d je 0x50e9d cmpl $0x1, %r15d je 0x50ea4 xorl %eax, %eax movl %r12d, %r15d jmp 0x50ea4 xorl %eax, %eax testb %al, %al je 0x50eba andl $0xf, %r14d movl %r14d, %esi movq %rbx, %rdi callq 0x44040 movl %r15d, %ebp movl %ebp, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/bughoho[P]capstone/arch/ARM/ARMDisassembler.c
DecodeGPRwithAPSRRegisterClass
static DecodeStatus DecodeGPRwithAPSRRegisterClass(MCInst *Inst, unsigned RegNo, uint64_t Address, const void *Decoder) { DecodeStatus S = MCDisassembler_Success; if (RegNo == 15) { MCOperand_CreateReg0(Inst, ARM_APSR_NZCV); return MCDisassembler_Success; } Check(&S, DecodeGPRRegisterClass(Inst, RegNo, Address, Decoder)); return S; }
pushq %rax cmpl $0xf, %esi jne 0x50ee2 movl $0x2, %esi callq 0x44520 movl $0x3, %eax jmp 0x50f09 jbe 0x50ee8 xorl %eax, %eax jmp 0x50eff movl %esi, %eax leaq 0x7cb0f(%rip), %rcx # 0xcda00 movzwl (%rcx,%rax,2), %esi callq 0x44520 movl $0x3, %eax leaq 0x7cb7a(%rip), %rcx # 0xcda80 movl (%rcx,%rax,4), %eax popq %rcx retq
/bughoho[P]capstone/arch/ARM/ARMDisassembler.c
DecodeVSHLMaxInstruction
static DecodeStatus DecodeVSHLMaxInstruction(MCInst *Inst, unsigned Insn, uint64_t Address, const void *Decoder) { DecodeStatus S = MCDisassembler_Success; unsigned Rm, size; unsigned Rd = fieldFromInstruction_4(Insn, 12, 4); Rd |= fieldFromInstruction_4(Insn, 22, 1) << 4; Rm = fieldFromInstruction_4(Insn, 0, 4); Rm |= fieldFromInstruction_4(Insn, 5, 1) << 4; size = fieldFromInstruction_4(Insn, 18, 2); if (!Check(&S, DecodeQPRRegisterClass(Inst, Rd, Address, Decoder))) return MCDisassembler_Fail; if (!Check(&S, DecodeDPRRegisterClass(Inst, Rm, Address, Decoder))) return MCDisassembler_Fail; MCOperand_CreateImm0(Inst, 8 << size); return S; }
pushq %rbp pushq %r15 pushq %r14 pushq %rbx pushq %rax movl %esi, %r14d movq %rdi, %rbx xorl %r15d, %r15d btl $0xc, %esi jb 0x50f4e movl %r14d, %eax shrl $0xd, %eax andl $0x7, %eax movl %r14d, %ecx shrl $0x13, %ecx andl $0x8, %ecx orl %eax, %ecx leaq 0x7cae4(%rip), %rax # 0xcda20 movzwl (%rax,%rcx,2), %esi movq %rbx, %rdi callq 0x44520 movl $0x3, %r15d movb $0x1, %cl movl %r15d, %eax leaq 0x7a826(%rip), %rdx # 0xcb780 movslq (%rdx,%rax,4), %rax addq %rdx, %rax jmpq *%rax movl $0x3, %r15d xorl %ecx, %ecx xorl %eax, %eax testb %cl, %cl je 0x50fb2 movl %r14d, %ebp shrl $0x12, %ebp movl %r14d, %eax andl $0xf, %eax andl $0x3, %ebp shrl %r14d andl $0x10, %r14d orl %eax, %r14d leaq 0x7c00f(%rip), %rax # 0xccfa0 movzwl (%rax,%r14,2), %esi movq %rbx, %rdi callq 0x44520 movl $0x8, %esi movl %ebp, %ecx shll %cl, %esi movq %rbx, %rdi callq 0x44040 movl %r15d, %eax addq $0x8, %rsp popq %rbx popq %r14 popq %r15 popq %rbp retq
/bughoho[P]capstone/arch/ARM/ARMDisassembler.c
DecodeNEONModImmInstruction
static DecodeStatus DecodeNEONModImmInstruction(MCInst *Inst, unsigned Insn, uint64_t Address, const void *Decoder) { DecodeStatus S = MCDisassembler_Success; unsigned imm, Q; unsigned Rd = fieldFromInstruction_4(Insn, 12, 4); Rd |= fieldFromInstruction_4(Insn, 22, 1) << 4; imm = fieldFromInstruction_4(Insn, 0, 4); imm |= fieldFromInstruction_4(Insn, 16, 3) << 4; imm |= fieldFromInstruction_4(Insn, 24, 1) << 7; imm |= fieldFromInstruction_4(Insn, 8, 4) << 8; imm |= fieldFromInstruction_4(Insn, 5, 1) << 12; Q = fieldFromInstruction_4(Insn, 6, 1); if (Q) { if (!Check(&S, DecodeQPRRegisterClass(Inst, Rd, Address, Decoder))) return MCDisassembler_Fail; } else { if (!Check(&S, DecodeDPRRegisterClass(Inst, Rd, Address, Decoder))) return MCDisassembler_Fail; } MCOperand_CreateImm0(Inst, imm); switch (MCInst_getOpcode(Inst)) { case ARM_VORRiv4i16: case ARM_VORRiv2i32: case ARM_VBICiv4i16: case ARM_VBICiv2i32: if (!Check(&S, DecodeDPRRegisterClass(Inst, Rd, Address, Decoder))) return MCDisassembler_Fail; break; case ARM_VORRiv8i16: case ARM_VORRiv4i32: case ARM_VBICiv8i16: case ARM_VBICiv4i32: if (!Check(&S, DecodeQPRRegisterClass(Inst, Rd, Address, Decoder))) return MCDisassembler_Fail; break; default: break; } return S; }
pushq %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx movl %esi, %ebp movq %rdi, %rbx movl %esi, %r12d shrl $0xc, %r12d movl %r12d, %eax andl $0xf, %eax movl %esi, %r15d shrl $0x12, %r15d andl $0x10, %r15d orl %eax, %r15d testb $0x40, %bpl jne 0x51111 movl %r15d, %eax leaq 0x7bea2(%rip), %rcx # 0xccfa0 movzwl (%rcx,%rax,2), %esi movq %rbx, %rdi callq 0x44520 movl $0x3, %eax jmp 0x5115a xorl %eax, %eax btl $0xc, %ebp jb 0x51134 movl %r15d, %eax leaq 0x7c8fd(%rip), %rcx # 0xcda20 movzwl (%rax,%rcx), %esi movq %rbx, %rdi callq 0x44520 movl $0x3, %eax movb $0x1, %cl movl %eax, %edx leaq 0x7a661(%rip), %rsi # 0xcb7a0 movslq (%rsi,%rdx,4), %rdx addq %rsi, %rdx jmpq *%rdx movl $0x3, %eax xorl %ecx, %ecx xorl %r14d, %r14d testb %cl, %cl je 0x5121c movl %eax, %r14d andl $0x70, %r12d movl %ebp, %eax shrl $0x11, %eax andl $0x80, %eax movl %ebp, %ecx andl $0x20, %ecx shll $0x7, %ecx movl %ebp, %edx andl $0xf0f, %edx # imm = 0xF0F orl %r12d, %edx orl %eax, %edx orl %ecx, %edx movl %edx, %esi movq %rbx, %rdi callq 0x44040 movq %rbx, %rdi callq 0x44490 cmpl $0x5a1, %eax # imm = 0x5A1 jg 0x511b2 leal -0x257(%rax), %ecx cmpl $0x2, %ecx jb 0x511c7 addl $0xfffffda7, %eax # imm = 0xFFFFFDA7 cmpl $0x2, %eax jb 0x511df jmp 0x5121c leal -0x5a4(%rax), %ecx cmpl $0x2, %ecx jb 0x511df addl $0xfffffa5e, %eax # imm = 0xFFFFFA5E cmpl $0x1, %eax ja 0x5121c movl %r15d, %eax leaq 0x7bdcf(%rip), %rcx # 0xccfa0 movzwl (%rcx,%rax,2), %esi movq %rbx, %rdi callq 0x44520 jmp 0x5121c xorl %eax, %eax btl $0xc, %ebp jb 0x51202 movl %r15d, %eax leaq 0x7c82f(%rip), %rcx # 0xcda20 movzwl (%rax,%rcx), %esi movq %rbx, %rdi callq 0x44520 movl $0x3, %eax movl %eax, %ecx leaq 0x7a5a5(%rip), %rdx # 0xcb7b0 movslq (%rdx,%rcx,4), %rcx addq %rdx, %rcx jmpq *%rcx movl %eax, %r14d jmp 0x5121c xorl %r14d, %r14d movl %r14d, %eax popq %rbx popq %r12 popq %r14 popq %r15 popq %rbp retq
/bughoho[P]capstone/arch/ARM/ARMDisassembler.c
DecodeVCVTD
static DecodeStatus DecodeVCVTD(MCInst *Inst, unsigned Insn, uint64_t Address, const void *Decoder) { DecodeStatus S = MCDisassembler_Success; unsigned Vm, imm, cmode, op; unsigned Vd = (fieldFromInstruction_4(Insn, 12, 4) << 0); Vd |= (fieldFromInstruction_4(Insn, 22, 1) << 4); Vm = (fieldFromInstruction_4(Insn, 0, 4) << 0); Vm |= (fieldFromInstruction_4(Insn, 5, 1) << 4); imm = fieldFromInstruction_4(Insn, 16, 6); cmode = fieldFromInstruction_4(Insn, 8, 4); op = fieldFromInstruction_4(Insn, 5, 1); // VMOVv2f32 is ambiguous with these decodings. if (!(imm & 0x38) && cmode == 0xF) { if (op == 1) return MCDisassembler_Fail; MCInst_setOpcode(Inst, ARM_VMOVv2f32); return DecodeNEONModImmInstruction(Inst, Insn, Address, Decoder); } if (!(imm & 0x20)) return MCDisassembler_Fail; if (!Check(&S, DecodeDPRRegisterClass(Inst, Vd, Address, Decoder))) return MCDisassembler_Fail; if (!Check(&S, DecodeDPRRegisterClass(Inst, Vm, Address, Decoder))) return MCDisassembler_Fail; MCOperand_CreateImm0(Inst, 64 - imm); return S; }
pushq %rbp pushq %r15 pushq %r14 pushq %rbx pushq %rax movl %esi, %ebp movq %rdi, %rbx movl %esi, %r14d shrl $0x5, %r14d andl $0x1, %r14d movl %esi, %eax andl $0x380f00, %eax # imm = 0x380F00 cmpl $0xf00, %eax # imm = 0xF00 jne 0x51273 testl %r14d, %r14d jne 0x51279 movq %rbx, %rdi movl $0x556, %esi # imm = 0x556 callq 0x44180 movq %rbx, %rdi movl %ebp, %esi addq $0x8, %rsp popq %rbx popq %r14 popq %r15 popq %rbp jmp 0x510c6 btl $0x15, %ebp jb 0x5127d xorl %eax, %eax jmp 0x512db movl %ebp, %eax shrl $0xc, %eax andl $0xf, %eax movl %ebp, %ecx shrl $0x12, %ecx andl $0x10, %ecx orl %eax, %ecx movl %ebp, %eax andl $0xf, %eax shll $0x4, %r14d orl %eax, %r14d shrl $0x10, %ebp andl $0x3f, %ebp movl %ecx, %eax leaq 0x7bcf6(%rip), %r15 # 0xccfa0 movzwl (%r15,%rax,2), %esi movq %rbx, %rdi callq 0x44520 movl %r14d, %eax movzwl (%r15,%rax,2), %esi movq %rbx, %rdi callq 0x44520 movl $0x40, %esi subl %ebp, %esi movq %rbx, %rdi callq 0x44040 movl $0x3, %eax addq $0x8, %rsp popq %rbx popq %r14 popq %r15 popq %rbp retq
/bughoho[P]capstone/arch/ARM/ARMDisassembler.c
DecodeVLDST4Instruction
static DecodeStatus DecodeVLDST4Instruction(MCInst *Inst, unsigned Insn, uint64_t Address, const void *Decoder) { unsigned load; unsigned size = fieldFromInstruction_4(Insn, 6, 2); if (size == 3) return MCDisassembler_Fail; load = fieldFromInstruction_4(Insn, 21, 1); return load ? DecodeVLDInstruction(Inst, Insn, Address, Decoder) : DecodeVSTInstruction(Inst, Insn, Address, Decoder); }
movl %esi, %eax notl %eax testb $-0x40, %al jne 0x51419 xorl %eax, %eax retq btl $0x15, %esi jb 0x54125 jmp 0x544c1
/bughoho[P]capstone/arch/ARM/ARMDisassembler.c
DecodeVST1LN
static DecodeStatus DecodeVST1LN(MCInst *Inst, unsigned Insn, uint64_t Address, const void *Decoder) { DecodeStatus S = MCDisassembler_Success; unsigned size, align = 0, index = 0; unsigned Rn = fieldFromInstruction_4(Insn, 16, 4); unsigned Rm = fieldFromInstruction_4(Insn, 0, 4); unsigned Rd = fieldFromInstruction_4(Insn, 12, 4); Rd |= fieldFromInstruction_4(Insn, 22, 1) << 4; size = fieldFromInstruction_4(Insn, 10, 2); switch (size) { default: return MCDisassembler_Fail; case 0: if (fieldFromInstruction_4(Insn, 4, 1)) return MCDisassembler_Fail; // UNDEFINED index = fieldFromInstruction_4(Insn, 5, 3); break; case 1: if (fieldFromInstruction_4(Insn, 5, 1)) return MCDisassembler_Fail; // UNDEFINED index = fieldFromInstruction_4(Insn, 6, 2); if (fieldFromInstruction_4(Insn, 4, 1)) align = 2; break; case 2: if (fieldFromInstruction_4(Insn, 6, 1)) return MCDisassembler_Fail; // UNDEFINED index = fieldFromInstruction_4(Insn, 7, 1); switch (fieldFromInstruction_4(Insn, 4, 2)) { case 0: align = 0; break; case 3: align = 4; break; default: return MCDisassembler_Fail; } break; } if (Rm != 0xF) { // Writeback if (!Check(&S, DecodeGPRRegisterClass(Inst, Rn, Address, Decoder))) return MCDisassembler_Fail; } if (!Check(&S, DecodeGPRRegisterClass(Inst, Rn, Address, Decoder))) return MCDisassembler_Fail; MCOperand_CreateImm0(Inst, align); if (Rm != 0xF) { if (Rm != 0xD) { if (!Check(&S, DecodeGPRRegisterClass(Inst, Rm, Address, Decoder))) return MCDisassembler_Fail; } else MCOperand_CreateReg0(Inst, 0); } if (!Check(&S, DecodeDPRRegisterClass(Inst, Rd, Address, Decoder))) return MCDisassembler_Fail; MCOperand_CreateImm0(Inst, index); return S; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl %esi, %ebp movq %rdi, %rbx movl %esi, %ecx shrl $0xa, %ecx andl $0x3, %ecx xorl %eax, %eax leaq 0x7a397(%rip), %rdx # 0xcb7e0 movslq (%rdx,%rcx,4), %rcx addq %rdx, %rcx jmpq *%rcx testb $0x10, %bpl jne 0x5156e movl %ebp, %r15d shrl $0x5, %r15d andl $0x7, %r15d xorl %r14d, %r14d jmp 0x514c0 testb $0x20, %bpl jne 0x5156e movl %ebp, %r15d shrl $0x6, %r15d andl $0x3, %r15d movl %ebp, %r14d shrl $0x3, %r14d andl $0x2, %r14d jmp 0x514c0 testb $0x40, %bpl jne 0x5156e movl %ebp, %r15d shrl $0x7, %r15d andl $0x1, %r15d movl %ebp, %r14d shrl $0x4, %r14d andl $0x3, %r14d je 0x514c0 cmpl $0x3, %r14d jne 0x5156e movl $0x4, %r14d movl %ebp, %eax shrl $0x10, %eax andl $0xf, %eax movl %ebp, %r12d andl $0xf, %r12d movl %ebp, %ecx shrl $0xc, %ecx andl $0xf, %ecx shrl $0x12, %ebp andl $0x10, %ebp orl %ecx, %ebp movl %eax, %r13d leaq 0x7c517(%rip), %rax # 0xcda00 movzwl (%rax,%r13,2), %esi movq %rbx, %rdi callq 0x44520 cmpl $0xf, %r12d jne 0x51509 movq %rbx, %rdi movq %r14, %rsi callq 0x44040 jmp 0x51549 leaq 0x7c4f0(%rip), %rax # 0xcda00 movzwl (%rax,%r13,2), %esi movq %rax, %r13 movq %rbx, %rdi callq 0x44520 movq %rbx, %rdi movq %r14, %rsi callq 0x44040 cmpl $0xd, %r12d jne 0x51538 movq %rbx, %rdi xorl %esi, %esi jmp 0x51544 movl %r12d, %eax movzwl (%r13,%rax,2), %esi movq %rbx, %rdi callq 0x44520 movl %ebp, %eax leaq 0x7ba4e(%rip), %rcx # 0xccfa0 movzwl (%rcx,%rax,2), %esi movq %rbx, %rdi callq 0x44520 movl %r15d, %esi movq %rbx, %rdi callq 0x44040 movl $0x3, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/bughoho[P]capstone/arch/ARM/ARMDisassembler.c
DecodeVLD3DupInstruction
static DecodeStatus DecodeVLD3DupInstruction(MCInst *Inst, unsigned Insn, uint64_t Address, const void *Decoder) { DecodeStatus S = MCDisassembler_Success; unsigned Rn, Rm, inc; unsigned Rd = fieldFromInstruction_4(Insn, 12, 4); Rd |= fieldFromInstruction_4(Insn, 22, 1) << 4; Rn = fieldFromInstruction_4(Insn, 16, 4); Rm = fieldFromInstruction_4(Insn, 0, 4); inc = fieldFromInstruction_4(Insn, 5, 1) + 1; if (!Check(&S, DecodeDPRRegisterClass(Inst, Rd, Address, Decoder))) return MCDisassembler_Fail; if (!Check(&S, DecodeDPRRegisterClass(Inst, (Rd+inc)%32, Address, Decoder))) return MCDisassembler_Fail; if (!Check(&S, DecodeDPRRegisterClass(Inst, (Rd+2*inc)%32, Address, Decoder))) return MCDisassembler_Fail; if (Rm != 0xF) { if (!Check(&S, DecodeGPRRegisterClass(Inst, Rn, Address, Decoder))) return MCDisassembler_Fail; } if (!Check(&S, DecodeGPRRegisterClass(Inst, Rn, Address, Decoder))) return MCDisassembler_Fail; MCOperand_CreateImm0(Inst, 0); if (Rm == 0xD) MCOperand_CreateReg0(Inst, 0); else if (Rm != 0xF) { if (!Check(&S, DecodeGPRRegisterClass(Inst, Rm, Address, Decoder))) return MCDisassembler_Fail; } return S; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movq %rdi, %rbx movl %esi, %eax shrl $0xc, %eax andl $0xf, %eax movl %esi, %r12d shrl $0x12, %r12d andl $0x10, %r12d orl %eax, %r12d movl %esi, %r15d shrl $0x10, %r15d andl $0xf, %r15d movl %esi, %ebp andl $0xf, %ebp movq $0x0, (%rsp) btl $0x5, %esi movl $0x0, %r13d adcl $0x1, %r13d leaq 0x7a786(%rip), %r14 # 0xccfa0 movzwl (%r14,%r12,2), %esi callq 0x44520 leal (%r12,%r13), %eax andl $0x1f, %eax movzwl (%r14,%rax,2), %esi movq %rbx, %rdi callq 0x44520 leal (%r12,%r13,2), %eax andl $0x1f, %eax movzwl (%r14,%rax,2), %esi movq %rbx, %rdi callq 0x44520 movl %r15d, %r12d cmpl $0xf, %ebp je 0x52868 leaq 0x7b1a5(%rip), %rax # 0xcda00 movzwl (%rax,%r12,2), %esi movq %rbx, %rdi callq 0x44520 leaq 0x7b191(%rip), %r15 # 0xcda00 movzwl (%r15,%r12,2), %esi movq %rbx, %rdi callq 0x44520 movq %rbx, %rdi xorl %esi, %esi callq 0x44040 cmpl $0xd, %ebp je 0x5289b cmpl $0xf, %ebp je 0x528a7 movl %ebp, %eax movzwl (%r15,%rax,2), %eax movq %rax, (%rsp) movq %rbx, %rdi movq (%rsp), %rsi callq 0x44520 movl $0x3, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/bughoho[P]capstone/arch/ARM/ARMDisassembler.c
DecodeT2SOImm
static DecodeStatus DecodeT2SOImm(MCInst *Inst, unsigned Val, uint64_t Address, const void *Decoder) { unsigned ctrl = fieldFromInstruction_4(Val, 10, 2); if (ctrl == 0) { unsigned byte = fieldFromInstruction_4(Val, 8, 2); unsigned imm = fieldFromInstruction_4(Val, 0, 8); switch (byte) { case 0: MCOperand_CreateImm0(Inst, imm); break; case 1: MCOperand_CreateImm0(Inst, (imm << 16) | imm); break; case 2: MCOperand_CreateImm0(Inst, (imm << 24) | (imm << 8)); break; case 3: MCOperand_CreateImm0(Inst, (imm << 24) | (imm << 16) | (imm << 8) | imm); break; } } else { unsigned unrot = fieldFromInstruction_4(Val, 0, 7) | 0x80; unsigned rot = fieldFromInstruction_4(Val, 7, 5); unsigned imm = (unrot >> rot) | (unrot << ((32-rot)&31)); MCOperand_CreateImm0(Inst, imm); } return MCDisassembler_Success; }
testl $0xc00, %esi # imm = 0xC00 je 0x5306e movl %esi, %eax orl $0x80, %eax movzbl %al, %eax shrl $0x7, %esi movl %esi, %ecx rorl %cl, %eax movl %eax, %esi jmp 0x44040 movl %esi, %ecx shrl $0x8, %ecx andl $0x3, %ecx movzbl %sil, %eax leaq 0x7892f(%rip), %rdx # 0xcb9b0 movslq (%rdx,%rcx,4), %rcx addq %rdx, %rcx jmpq *%rcx movl %eax, %ecx shll $0x10, %ecx orl %ecx, %eax jmp 0x53067 shll $0x18, %esi shll $0x8, %eax orl %esi, %eax jmp 0x53067 shll $0x18, %esi movl %eax, %ecx shll $0x10, %ecx orl %esi, %ecx movl %eax, %edx shll $0x8, %edx orl %ecx, %edx orl %edx, %eax jmp 0x53067
/bughoho[P]capstone/arch/ARM/ARMDisassembler.c
DecodeVLDInstruction
static DecodeStatus DecodeVLDInstruction(MCInst *Inst, unsigned Insn, uint64_t Address, const void *Decoder) { DecodeStatus S = MCDisassembler_Success; unsigned wb, Rn, Rm; unsigned Rd = fieldFromInstruction_4(Insn, 12, 4); Rd |= fieldFromInstruction_4(Insn, 22, 1) << 4; wb = fieldFromInstruction_4(Insn, 16, 4); Rn = fieldFromInstruction_4(Insn, 16, 4); Rn |= fieldFromInstruction_4(Insn, 4, 2) << 4; Rm = fieldFromInstruction_4(Insn, 0, 4); // First output register switch (MCInst_getOpcode(Inst)) { case ARM_VLD1q16: case ARM_VLD1q32: case ARM_VLD1q64: case ARM_VLD1q8: case ARM_VLD1q16wb_fixed: case ARM_VLD1q16wb_register: case ARM_VLD1q32wb_fixed: case ARM_VLD1q32wb_register: case ARM_VLD1q64wb_fixed: case ARM_VLD1q64wb_register: case ARM_VLD1q8wb_fixed: case ARM_VLD1q8wb_register: case ARM_VLD2d16: case ARM_VLD2d32: case ARM_VLD2d8: case ARM_VLD2d16wb_fixed: case ARM_VLD2d16wb_register: case ARM_VLD2d32wb_fixed: case ARM_VLD2d32wb_register: case ARM_VLD2d8wb_fixed: case ARM_VLD2d8wb_register: if (!Check(&S, DecodeDPairRegisterClass(Inst, Rd, Address, Decoder))) return MCDisassembler_Fail; break; case ARM_VLD2b16: case ARM_VLD2b32: case ARM_VLD2b8: case ARM_VLD2b16wb_fixed: case ARM_VLD2b16wb_register: case ARM_VLD2b32wb_fixed: case ARM_VLD2b32wb_register: case ARM_VLD2b8wb_fixed: case ARM_VLD2b8wb_register: if (!Check(&S, DecodeDPairSpacedRegisterClass(Inst, Rd, Address, Decoder))) return MCDisassembler_Fail; break; default: if (!Check(&S, DecodeDPRRegisterClass(Inst, Rd, Address, Decoder))) return MCDisassembler_Fail; } // Second output register switch (MCInst_getOpcode(Inst)) { case ARM_VLD3d8: case ARM_VLD3d16: case ARM_VLD3d32: case ARM_VLD3d8_UPD: case ARM_VLD3d16_UPD: case ARM_VLD3d32_UPD: case ARM_VLD4d8: case ARM_VLD4d16: case ARM_VLD4d32: case ARM_VLD4d8_UPD: case ARM_VLD4d16_UPD: case ARM_VLD4d32_UPD: if (!Check(&S, DecodeDPRRegisterClass(Inst, (Rd+1)%32, Address, Decoder))) return MCDisassembler_Fail; break; case ARM_VLD3q8: case ARM_VLD3q16: case ARM_VLD3q32: case ARM_VLD3q8_UPD: case ARM_VLD3q16_UPD: case ARM_VLD3q32_UPD: case ARM_VLD4q8: case ARM_VLD4q16: case ARM_VLD4q32: case ARM_VLD4q8_UPD: case ARM_VLD4q16_UPD: case ARM_VLD4q32_UPD: if (!Check(&S, DecodeDPRRegisterClass(Inst, (Rd+2)%32, Address, Decoder))) return MCDisassembler_Fail; default: break; } // Third output register switch(MCInst_getOpcode(Inst)) { case ARM_VLD3d8: case ARM_VLD3d16: case ARM_VLD3d32: case ARM_VLD3d8_UPD: case ARM_VLD3d16_UPD: case ARM_VLD3d32_UPD: case ARM_VLD4d8: case ARM_VLD4d16: case ARM_VLD4d32: case ARM_VLD4d8_UPD: case ARM_VLD4d16_UPD: case ARM_VLD4d32_UPD: if (!Check(&S, DecodeDPRRegisterClass(Inst, (Rd+2)%32, Address, Decoder))) return MCDisassembler_Fail; break; case ARM_VLD3q8: case ARM_VLD3q16: case ARM_VLD3q32: case ARM_VLD3q8_UPD: case ARM_VLD3q16_UPD: case ARM_VLD3q32_UPD: case ARM_VLD4q8: case ARM_VLD4q16: case ARM_VLD4q32: case ARM_VLD4q8_UPD: case ARM_VLD4q16_UPD: case ARM_VLD4q32_UPD: if (!Check(&S, DecodeDPRRegisterClass(Inst, (Rd+4)%32, Address, Decoder))) return MCDisassembler_Fail; break; default: break; } // Fourth output register switch (MCInst_getOpcode(Inst)) { case ARM_VLD4d8: case ARM_VLD4d16: case ARM_VLD4d32: case ARM_VLD4d8_UPD: case ARM_VLD4d16_UPD: case ARM_VLD4d32_UPD: if (!Check(&S, DecodeDPRRegisterClass(Inst, (Rd+3)%32, Address, Decoder))) return MCDisassembler_Fail; break; case ARM_VLD4q8: case ARM_VLD4q16: case ARM_VLD4q32: case ARM_VLD4q8_UPD: case ARM_VLD4q16_UPD: case ARM_VLD4q32_UPD: if (!Check(&S, DecodeDPRRegisterClass(Inst, (Rd+6)%32, Address, Decoder))) return MCDisassembler_Fail; break; default: break; } // Writeback operand switch (MCInst_getOpcode(Inst)) { case ARM_VLD1d8wb_fixed: case ARM_VLD1d16wb_fixed: case ARM_VLD1d32wb_fixed: case ARM_VLD1d64wb_fixed: case ARM_VLD1d8wb_register: case ARM_VLD1d16wb_register: case ARM_VLD1d32wb_register: case ARM_VLD1d64wb_register: case ARM_VLD1q8wb_fixed: case ARM_VLD1q16wb_fixed: case ARM_VLD1q32wb_fixed: case ARM_VLD1q64wb_fixed: case ARM_VLD1q8wb_register: case ARM_VLD1q16wb_register: case ARM_VLD1q32wb_register: case ARM_VLD1q64wb_register: case ARM_VLD1d8Twb_fixed: case ARM_VLD1d8Twb_register: case ARM_VLD1d16Twb_fixed: case ARM_VLD1d16Twb_register: case ARM_VLD1d32Twb_fixed: case ARM_VLD1d32Twb_register: case ARM_VLD1d64Twb_fixed: case ARM_VLD1d64Twb_register: case ARM_VLD1d8Qwb_fixed: case ARM_VLD1d8Qwb_register: case ARM_VLD1d16Qwb_fixed: case ARM_VLD1d16Qwb_register: case ARM_VLD1d32Qwb_fixed: case ARM_VLD1d32Qwb_register: case ARM_VLD1d64Qwb_fixed: case ARM_VLD1d64Qwb_register: case ARM_VLD2d8wb_fixed: case ARM_VLD2d16wb_fixed: case ARM_VLD2d32wb_fixed: case ARM_VLD2q8wb_fixed: case ARM_VLD2q16wb_fixed: case ARM_VLD2q32wb_fixed: case ARM_VLD2d8wb_register: case ARM_VLD2d16wb_register: case ARM_VLD2d32wb_register: case ARM_VLD2q8wb_register: case ARM_VLD2q16wb_register: case ARM_VLD2q32wb_register: case ARM_VLD2b8wb_fixed: case ARM_VLD2b16wb_fixed: case ARM_VLD2b32wb_fixed: case ARM_VLD2b8wb_register: case ARM_VLD2b16wb_register: case ARM_VLD2b32wb_register: MCOperand_CreateImm0(Inst, 0); break; case ARM_VLD3d8_UPD: case ARM_VLD3d16_UPD: case ARM_VLD3d32_UPD: case ARM_VLD3q8_UPD: case ARM_VLD3q16_UPD: case ARM_VLD3q32_UPD: case ARM_VLD4d8_UPD: case ARM_VLD4d16_UPD: case ARM_VLD4d32_UPD: case ARM_VLD4q8_UPD: case ARM_VLD4q16_UPD: case ARM_VLD4q32_UPD: if (!Check(&S, DecodeGPRRegisterClass(Inst, wb, Address, Decoder))) return MCDisassembler_Fail; break; default: break; } // AddrMode6 Base (register+alignment) if (!Check(&S, DecodeAddrMode6Operand(Inst, Rn, Address, Decoder))) return MCDisassembler_Fail; // AddrMode6 Offset (register) switch (MCInst_getOpcode(Inst)) { default: // The below have been updated to have explicit am6offset split // between fixed and register offset. For those instructions not // yet updated, we need to add an additional reg0 operand for the // fixed variant. // // The fixed offset encodes as Rm == 0xd, so we check for that. if (Rm == 0xd) { MCOperand_CreateReg0(Inst, 0); break; } // Fall through to handle the register offset variant. case ARM_VLD1d8wb_fixed: case ARM_VLD1d16wb_fixed: case ARM_VLD1d32wb_fixed: case ARM_VLD1d64wb_fixed: case ARM_VLD1d8Twb_fixed: case ARM_VLD1d16Twb_fixed: case ARM_VLD1d32Twb_fixed: case ARM_VLD1d64Twb_fixed: case ARM_VLD1d8Qwb_fixed: case ARM_VLD1d16Qwb_fixed: case ARM_VLD1d32Qwb_fixed: case ARM_VLD1d64Qwb_fixed: case ARM_VLD1d8wb_register: case ARM_VLD1d16wb_register: case ARM_VLD1d32wb_register: case ARM_VLD1d64wb_register: case ARM_VLD1q8wb_fixed: case ARM_VLD1q16wb_fixed: case ARM_VLD1q32wb_fixed: case ARM_VLD1q64wb_fixed: case ARM_VLD1q8wb_register: case ARM_VLD1q16wb_register: case ARM_VLD1q32wb_register: case ARM_VLD1q64wb_register: // The fixed offset post-increment encodes Rm == 0xd. The no-writeback // variant encodes Rm == 0xf. Anything else is a register offset post- // increment and we need to add the register operand to the instruction. if (Rm != 0xD && Rm != 0xF && !Check(&S, DecodeGPRRegisterClass(Inst, Rm, Address, Decoder))) return MCDisassembler_Fail; break; case ARM_VLD2d8wb_fixed: case ARM_VLD2d16wb_fixed: case ARM_VLD2d32wb_fixed: case ARM_VLD2b8wb_fixed: case ARM_VLD2b16wb_fixed: case ARM_VLD2b32wb_fixed: case ARM_VLD2q8wb_fixed: case ARM_VLD2q16wb_fixed: case ARM_VLD2q32wb_fixed: break; } return S; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl %esi, %ebp movq %rdi, %rbx movl %esi, %eax shrl $0xc, %eax andl $0xf, %eax movl %esi, %r12d shrl $0x12, %r12d andl $0x10, %r12d orl %eax, %r12d callq 0x44490 leal -0x391(%rax), %ecx cmpl $0xc, %ecx jb 0x54174 leal -0x3d2(%rax), %ecx cmpl $0x9, %ecx jb 0x541ae addl $0xfffffc25, %eax # imm = 0xFFFFFC25 cmpl $0x8, %eax ja 0x544a0 xorl %r15d, %r15d cmpl $0x1f, %r12d je 0x54199 movl %r12d, %eax leaq 0x78e59(%rip), %rcx # 0xccfe0 movzwl (%rcx,%rax,2), %esi movq %rbx, %rdi callq 0x44520 movl $0x3, %r15d movb $0x1, %al movl %r15d, %ecx leaq 0x7788b(%rip), %rdx # 0xcba30 movslq (%rdx,%rcx,4), %rcx addq %rdx, %rcx jmpq *%rcx xorl %r15d, %r15d cmpl $0x1d, %r12d ja 0x541d3 movl %r12d, %eax leaq 0x78e5f(%rip), %rcx # 0xcd020 movzwl (%rcx,%rax,2), %esi movq %rbx, %rdi callq 0x44520 movl $0x3, %r15d movb $0x1, %al movl %r15d, %ecx leaq 0x77841(%rip), %rdx # 0xcba20 movslq (%rdx,%rcx,4), %rcx addq %rdx, %rcx jmpq *%rcx movl $0x3, %r15d xorl %eax, %eax testb %al, %al je 0x5441a movq %rbx, %rdi callq 0x44490 movl $0x1, %ecx leal -0x43d(%rax), %edx cmpl $0x21, %edx ja 0x5422b movl $0x999, %esi # imm = 0x999 btq %rdx, %rsi jb 0x54255 movabsq $0x294a00000, %rsi # imm = 0x294A00000 btq %rdx, %rsi jb 0x54250 addl $0xfffffb4f, %eax # imm = 0xFFFFFB4F cmpl $0x21, %eax ja 0x5426e movl $0x999, %edx # imm = 0x999 btq %rax, %rdx jb 0x54255 movabsq $0x294a00000, %rcx # imm = 0x294A00000 btq %rax, %rcx jae 0x5426e movl $0x2, %ecx addl %r12d, %ecx andl $0x1f, %ecx leaq 0x78d3e(%rip), %rax # 0xccfa0 movzwl (%rax,%rcx,2), %esi movq %rbx, %rdi callq 0x44520 movl %ebp, %r13d shrl $0x10, %r13d movq %rbx, %rdi callq 0x44490 movl $0x2, %ecx leal -0x43d(%rax), %edx cmpl $0x21, %edx ja 0x542a8 movl $0x999, %esi # imm = 0x999 btq %rdx, %rsi jb 0x542d2 movabsq $0x294a00000, %rsi # imm = 0x294A00000 btq %rdx, %rsi jb 0x542cd addl $0xfffffb4f, %eax # imm = 0xFFFFFB4F cmpl $0x21, %eax ja 0x542eb movl $0x999, %edx # imm = 0x999 btq %rax, %rdx jb 0x542d2 movabsq $0x294a00000, %rcx # imm = 0x294A00000 btq %rax, %rcx jae 0x542eb movl $0x4, %ecx addl %r12d, %ecx andl $0x1f, %ecx leaq 0x78cc1(%rip), %rax # 0xccfa0 movzwl (%rax,%rcx,2), %esi movq %rbx, %rdi callq 0x44520 andl $0xf, %r13d movl %ebp, %r14d andl $0x30, %r14d movq %rbx, %rdi callq 0x44490 addl $0xfffffb4f, %eax # imm = 0xFFFFFB4F cmpl $0x21, %eax ja 0x54348 movl $0x3, %ecx movl $0x999, %edx # imm = 0x999 btq %rax, %rdx jb 0x5432d movabsq $0x294a00000, %rcx # imm = 0x294A00000 btq %rax, %rcx jae 0x54348 movl $0x6, %ecx addl %ecx, %r12d andl $0x1f, %r12d leaq 0x78c65(%rip), %rax # 0xccfa0 movzwl (%rax,%r12,2), %esi movq %rbx, %rdi callq 0x44520 orl %r13d, %r14d movq %rbx, %rdi callq 0x44490 cmpl $0x3d2, %eax # imm = 0x3D2 jg 0x54376 addl $0xfffffc97, %eax # imm = 0xFFFFFC97 cmpl $0x33, %eax ja 0x543a3 movabsq $0xdb6f67860f67b, %rcx # imm = 0xDB6F67860F67B btq %rax, %rcx jb 0x54399 jmp 0x543a3 leal -0x3d3(%rax), %ecx cmpl $0x22, %ecx ja 0x5442f movabsq $0x61861b6db, %rdx # imm = 0x61861B6DB btq %rcx, %rdx jae 0x5442f movq %rbx, %rdi xorl %esi, %esi callq 0x44040 movq %rbx, %rdi movl %r14d, %esi callq 0x54825 movl %eax, %r14d testl %eax, %eax je 0x543ca movb $0x1, %al cmpl $0x3, %r14d je 0x543c5 cmpl $0x1, %r14d je 0x543cc xorl %eax, %eax movl %r15d, %r14d jmp 0x543cc xorl %eax, %eax testb %al, %al je 0x5441a movl %ebp, %r15d andl $0xf, %r15d movq %rbx, %rdi callq 0x44490 leal -0x369(%rax), %ecx cmpl $0x33, %ecx ja 0x54457 movabsq $0xdb6d26820d269, %rdx # imm = 0xDB6D26820D269 btq %rcx, %rdx jae 0x54457 notl %ebp testb $0xd, %bpl je 0x5441d movl %r15d, %eax leaq 0x795f4(%rip), %rcx # 0xcda00 movzwl (%rcx,%rax,2), %esi movq %rbx, %rdi callq 0x44520 jmp 0x5441d xorl %r14d, %r14d movl %r14d, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leal -0x440(%rax), %ecx cmpl $0x1e, %ecx jbe 0x5447b addl $0xfffffb4c, %eax # imm = 0xFFFFFB4C cmpl $0x1e, %eax ja 0x543a3 movl $0x42100111, %ecx # imm = 0x42100111 btl %eax, %ecx jb 0x54485 jmp 0x543a3 addl $0xfffffc2d, %eax # imm = 0xFFFFFC2D cmpl $0x21, %eax ja 0x54471 movabsq $0x208209249, %rcx # imm = 0x208209249 btq %rax, %rcx jb 0x5441d xorl %esi, %esi cmpl $0xd, %r15d jne 0x543fa jmp 0x54410 movl $0x42100111, %edx # imm = 0x42100111 btl %ecx, %edx jae 0x5443a movl %r13d, %eax leaq 0x79571(%rip), %rcx # 0xcda00 movzwl (%rcx,%rax,2), %esi movq %rbx, %rdi callq 0x44520 jmp 0x543a3 movl %r12d, %eax leaq 0x78af6(%rip), %rcx # 0xccfa0 movzwl (%rcx,%rax,2), %esi movq %rbx, %rdi callq 0x44520 movl $0x3, %r15d jmp 0x541f8
/bughoho[P]capstone/arch/ARM/ARMDisassembler.c
printSBitModifierOperand
static void printSBitModifierOperand(MCInst *MI, unsigned OpNum, SStream *O) { if (MCOperand_getReg(MCInst_getOperand(MI, OpNum))) { //assert(MCOperand_getReg(MCInst_getOperand(MI, OpNum)) == ARM_CPSR && // "Expect ARM CPSR register!"); SStream_concat0(O, "s"); if (MI->csh->detail) MI->flat_insn->detail->arm.update_flags = true; } }
pushq %r14 pushq %rbx pushq %rax movq %rdx, %r14 movq %rdi, %rbx callq 0x444e0 movq %rax, %rdi callq 0x44310 testl %eax, %eax je 0x61a59 leaq 0x7cee3(%rip), %rsi # 0xde915 movq %r14, %rdi callq 0x441c0 movq 0x320(%rbx), %rax cmpl $0x0, 0x68(%rax) je 0x61a59 movq 0x310(%rbx), %rax movq 0xe8(%rax), %rax movb $0x1, 0x48(%rax) addq $0x8, %rsp popq %rbx popq %r14 retq
/bughoho[P]capstone/arch/ARM/ARMInstPrinter.c
printOperand
static void printOperand(MCInst *MI, unsigned OpNo, SStream *O) { int32_t imm; MCOperand *Op = MCInst_getOperand(MI, OpNo); if (MCOperand_isReg(Op)) { unsigned Reg = MCOperand_getReg(Op); printRegName(MI->csh, O, Reg); if (MI->csh->detail) { if (MI->csh->doing_mem) { if (MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].mem.base == ARM_REG_INVALID) MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].mem.base = Reg; else MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].mem.index = Reg; } else { MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].type = ARM_OP_REG; MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].reg = Reg; MI->flat_insn->detail->arm.op_count++; } } } else if (MCOperand_isImm(Op)) { unsigned int opc = MCInst_getOpcode(MI); imm = (int32_t)MCOperand_getImm(Op); // relative branch only has relative offset, so we have to update it // to reflect absolute address. // Note: in ARM, PC is always 2 instructions ahead, so we have to // add 8 in ARM mode, or 4 in Thumb mode // printf(">> opcode: %u\n", MCInst_getOpcode(MI)); if (ARM_rel_branch(MI->csh, opc)) { // only do this for relative branch if (MI->csh->mode & CS_MODE_THUMB) { imm += (int32_t)MI->address + 4; if (ARM_blx_to_arm_mode(MI->csh, opc)) { // here need to align down to the nearest 4-byte address #define _ALIGN_DOWN(v, align_width) ((v/align_width)*align_width) imm = _ALIGN_DOWN(imm, 4); #undef _ALIGN_DOWN } } else { imm += (int32_t)MI->address + 8; } if (imm >= 0) { if (imm > HEX_THRESHOLD) SStream_concat(O, "#0x%x", imm); else SStream_concat(O, "#%u", imm); } else { SStream_concat(O, "#0x%x", imm); } } else { switch(MI->flat_insn->id) { default: if (imm >= 0) { if (imm > HEX_THRESHOLD) SStream_concat(O, "#0x%x", imm); else SStream_concat(O, "#%u", imm); } else { if (imm < -HEX_THRESHOLD) SStream_concat(O, "#-0x%x", -imm); else SStream_concat(O, "#-%u", -imm); } break; case ARM_INS_AND: case ARM_INS_ORR: case ARM_INS_EOR: case ARM_INS_BIC: case ARM_INS_MVN: // do not print number in negative form if (imm >= 0 && imm <= HEX_THRESHOLD) SStream_concat(O, "#%u", imm); else SStream_concat(O, "#0x%x", imm); break; } } if (MI->csh->detail) { if (MI->csh->doing_mem) MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].mem.disp = imm; else { MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].type = ARM_OP_IMM; MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].imm = imm; MI->flat_insn->detail->arm.op_count++; } } } }
pushq %rbp pushq %r15 pushq %r14 pushq %rbx pushq %rax movq %rdx, %r15 movq %rdi, %rbx callq 0x444e0 movq %rax, %r14 movq %rax, %rdi callq 0x445c0 testb %al, %al je 0x61d15 movq %r14, %rdi callq 0x44310 movl %eax, %ebp movq 0x320(%rbx), %rax movl %ebp, %edi callq *0x80(%rax) movq %r15, %rdi movq %rax, %rsi callq 0x441c0 movq 0x320(%rbx), %rcx cmpl $0x0, 0x68(%rcx) je 0x61e80 movq 0x310(%rbx), %rax movq 0xe8(%rax), %rax movzbl 0x50(%rax), %edx addq $0x58, %rax cmpb $0x1, 0x70(%rcx) jne 0x61d6b leaq (%rdx,%rdx,4), %rcx leaq (%rax,%rcx,8), %rax addq $0x10, %rax cmpl $0x0, (%rax) je 0x61e8b movl %ebp, 0x4(%rax) jmp 0x61e80 movq %r14, %rdi callq 0x44500 testb %al, %al je 0x61e80 movq %rbx, %rdi callq 0x44490 movl %eax, %ebp movq %r14, %rdi callq 0x443b0 movq %rax, %r14 movq 0x320(%rbx), %rdi movl %ebp, %esi callq 0x440d0 testb %al, %al je 0x61d96 movq 0x320(%rbx), %rdi testb $0x10, 0x4(%rdi) movl 0x318(%rbx), %eax jne 0x61dc9 addl %eax, %r14d addl $0x8, %r14d jmp 0x61dec leaq (%rdx,%rdx,4), %rcx movl $0x1, 0xc(%rax,%rcx,8) movq 0x310(%rbx), %rax movq 0xe8(%rax), %rax movzbl 0x50(%rax), %ecx leaq (%rcx,%rcx,4), %rcx movl %ebp, 0x68(%rax,%rcx,8) jmp 0x61e6f movq 0x310(%rbx), %rax movl (%rax), %eax cmpq $0x22, %rax ja 0x61db5 movabsq $0x400000900, %rcx # imm = 0x400000900 btq %rax, %rcx jb 0x61dc1 addl $-0x5a, %eax cmpl $0x2, %eax jae 0x61e8f cmpl $0x9, %r14d ja 0x61df7 jmp 0x61e00 addl %eax, %r14d addl $0x4, %r14d movl %ebp, %esi callq 0x44750 testb %al, %al je 0x61dec leal 0x3(%r14), %eax testl %r14d, %r14d cmovnsl %r14d, %eax andl $-0x4, %eax movl %eax, %r14d testl %r14d, %r14d js 0x61df7 cmpl $0xa, %r14d jl 0x61e00 leaq 0x726c8(%rip), %rsi # 0xd44c6 jmp 0x61e07 leaq 0x726c7(%rip), %rsi # 0xd44ce movq %r15, %rdi movl %r14d, %edx xorl %eax, %eax callq 0x44540 movq 0x320(%rbx), %rcx cmpl $0x0, 0x68(%rcx) je 0x61e80 movq 0x310(%rbx), %rax movq 0xe8(%rax), %rax movzbl 0x50(%rax), %edx addq $0x58, %rax cmpb $0x1, 0x70(%rcx) jne 0x61e48 leaq (%rdx,%rdx,4), %rcx movl %r14d, 0x1c(%rax,%rcx,8) jmp 0x61e80 leaq (%rdx,%rdx,4), %rcx movl $0x2, 0xc(%rax,%rcx,8) movq 0x310(%rbx), %rax movq 0xe8(%rax), %rax movzbl 0x50(%rax), %ecx leaq (%rcx,%rcx,4), %rcx movl %r14d, 0x68(%rax,%rcx,8) movq 0x310(%rbx), %rax movq 0xe8(%rax), %rax incb 0x50(%rax) addq $0x8, %rsp popq %rbx popq %r14 popq %r15 popq %rbp retq movl %ebp, (%rax) jmp 0x61e80 testl %r14d, %r14d jns 0x61df1 movl %r14d, %edx negl %edx cmpl $-0xa, %r14d jg 0x61eac leaq 0x7260c(%rip), %rsi # 0xd44b6 jmp 0x61eb3 leaq 0x7260c(%rip), %rsi # 0xd44bf movq %r15, %rdi jmp 0x61e0d
/bughoho[P]capstone/arch/ARM/ARMInstPrinter.c
printPImmediate
static void printPImmediate(MCInst *MI, unsigned OpNum, SStream *O) { unsigned imm = (unsigned int)MCOperand_getImm(MCInst_getOperand(MI, OpNum)); SStream_concat(O, "p%u", imm); if (MI->csh->detail) { MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].type = ARM_OP_PIMM; MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].imm = imm; MI->flat_insn->detail->arm.op_count++; } }
pushq %r15 pushq %r14 pushq %rbx movq %rdx, %r15 movq %rdi, %rbx callq 0x444e0 movq %rax, %rdi callq 0x443b0 movq %rax, %r14 leaq 0x723b6(%rip), %rsi # 0xd4436 movq %r15, %rdi movl %r14d, %edx xorl %eax, %eax callq 0x44540 movq 0x320(%rbx), %rax cmpl $0x0, 0x68(%rax) je 0x620e4 movq 0x310(%rbx), %rax movq 0xe8(%rax), %rax movzbl 0x50(%rax), %ecx leaq (%rcx,%rcx,4), %rcx movl $0x41, 0x64(%rax,%rcx,8) movq 0x310(%rbx), %rax movq 0xe8(%rax), %rax movzbl 0x50(%rax), %ecx leaq (%rcx,%rcx,4), %rcx movl %r14d, 0x68(%rax,%rcx,8) movq 0x310(%rbx), %rax movq 0xe8(%rax), %rax incb 0x50(%rax) popq %rbx popq %r14 popq %r15 retq
/bughoho[P]capstone/arch/ARM/ARMInstPrinter.c
printAddrModeImm12Operand
static void printAddrModeImm12Operand(MCInst *MI, unsigned OpNum, SStream *O, bool AlwaysPrintImm0) { MCOperand *MO1 = MCInst_getOperand(MI, OpNum); MCOperand *MO2 = MCInst_getOperand(MI, OpNum+1); int32_t OffImm; bool isSub; if (!MCOperand_isReg(MO1)) { // FIXME: This is for CP entries, but isn't right. printOperand(MI, OpNum, O); return; } SStream_concat0(O, "["); set_mem_access(MI, true); printRegName(MI->csh, O, MCOperand_getReg(MO1)); if (MI->csh->detail) MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].mem.base = MCOperand_getReg(MO1); OffImm = (int32_t)MCOperand_getImm(MO2); isSub = OffImm < 0; // Special value for #-0. All others are normal. if (OffImm == INT32_MIN) OffImm = 0; if (isSub) { if (OffImm < -HEX_THRESHOLD) SStream_concat(O, ", #-0x%x", -OffImm); else SStream_concat(O, ", #-%u", -OffImm); } else if (AlwaysPrintImm0 || OffImm > 0) { if (OffImm >= 0) { if (OffImm > HEX_THRESHOLD) SStream_concat(O, ", #0x%x", OffImm); else SStream_concat(O, ", #%u", OffImm); } else { if (OffImm < -HEX_THRESHOLD) SStream_concat(O, ", #-0x%x", -OffImm); else SStream_concat(O, ", #-%u", -OffImm); } } if (MI->csh->detail) MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].mem.disp = OffImm; SStream_concat0(O, "]"); set_mem_access(MI, false); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl %ecx, %ebp movq %rdx, %r14 movl %esi, %r13d movq %rdi, %rbx callq 0x444e0 movq %rax, %r12 leal 0x1(%r13), %esi movq %rbx, %rdi callq 0x444e0 movq %rax, %r15 movq %r12, %rdi callq 0x445c0 testb %al, %al je 0x623e2 leaq 0x7c86d(%rip), %rsi # 0xdebb3 movq %r14, %rdi callq 0x441c0 movq %rbx, %rdi movl $0x1, %esi callq 0x658ba movq 0x320(%rbx), %r13 movq %r12, %rdi callq 0x44310 movl %eax, %edi callq *0x80(%r13) movq %r14, %rdi movq %rax, %rsi callq 0x441c0 movq 0x320(%rbx), %rax cmpl $0x0, 0x68(%rax) je 0x623ad movq %r12, %rdi callq 0x44310 movq 0x310(%rbx), %rcx movq 0xe8(%rcx), %rcx movzbl 0x50(%rcx), %edx leaq (%rdx,%rdx,4), %rdx movl %eax, 0x68(%rcx,%rdx,8) movq %r15, %rdi callq 0x443b0 xorl %r15d, %r15d movl %eax, %ecx negl %ecx cmovnol %eax, %r15d testl %eax, %eax js 0x623fe testl %r15d, %r15d setle %al xorb $0x1, %bpl testb %bpl, %al jne 0x62432 cmpl $0xa, %r15d jl 0x6241e leaq 0x720e4(%rip), %rsi # 0xd44c4 jmp 0x62425 movq %rbx, %rdi movl %r13d, %esi movq %r14, %rdx addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp jmp 0x61c86 movl %r15d, %edx negl %edx cmpl $-0xa, %r15d jg 0x62412 leaq 0x720a4(%rip), %rsi # 0xd44b4 jmp 0x62419 leaq 0x720a4(%rip), %rsi # 0xd44bd movq %r14, %rdi jmp 0x6242b leaq 0x720a7(%rip), %rsi # 0xd44cc movq %r14, %rdi movl %r15d, %edx xorl %eax, %eax callq 0x44540 movq 0x320(%rbx), %rax cmpl $0x0, 0x68(%rax) je 0x6245a movq 0x310(%rbx), %rax movq 0xe8(%rax), %rax movzbl 0x50(%rax), %ecx leaq (%rcx,%rcx,4), %rcx movl %r15d, 0x74(%rax,%rcx,8) leaq 0x7d349(%rip), %rsi # 0xdf7aa movq %r14, %rdi callq 0x441c0 movq 0x320(%rbx), %rax cmpl $0x3, 0x68(%rax) jne 0x6248b movb $0x0, 0x70(%rax) movq 0x310(%rbx), %rax movq 0xe8(%rax), %rax incb 0x50(%rax) addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/bughoho[P]capstone/arch/ARM/ARMInstPrinter.c
printAddrMode2Operand
static void printAddrMode2Operand(MCInst *MI, unsigned Op, SStream *O) { MCOperand *MO1 = MCInst_getOperand(MI, Op); if (!MCOperand_isReg(MO1)) { // FIXME: This is for CP entries, but isn't right. printOperand(MI, Op, O); return; } printAM2PreOrOffsetIndexOp(MI, Op, O); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movq %rdx, %r14 movl %esi, %r15d movq %rdi, %rbx callq 0x444e0 movq %rax, %rdi callq 0x445c0 testb %al, %al je 0x62691 movq %rbx, %rdi movl %r15d, %esi callq 0x444e0 movq %rax, %rbp leal 0x1(%r15), %esi movq %rbx, %rdi callq 0x444e0 movq %rax, %r13 addl $0x2, %r15d movq %rbx, %rdi movl %r15d, %esi callq 0x444e0 movq %rax, (%rsp) movq %rax, %rdi callq 0x443b0 movq %rax, %r12 leaq 0x7c6ae(%rip), %rsi # 0xdebb3 movq %r14, %rdi callq 0x441c0 movq %rbx, %rdi movl $0x1, %esi callq 0x658ba movq 0x320(%rbx), %r15 movq %rbp, %rdi callq 0x44310 movl %eax, %edi callq *0x80(%r15) movq %r14, %rdi movq %rax, %rsi callq 0x441c0 movq 0x320(%rbx), %rax cmpl $0x0, 0x68(%rax) je 0x6256c movq %rbp, %rdi callq 0x44310 movq 0x310(%rbx), %rcx movq 0xe8(%rcx), %rcx movzbl 0x50(%rcx), %edx leaq (%rdx,%rdx,4), %rdx movl %eax, 0x68(%rcx,%rdx,8) movq %r13, %rdi callq 0x44310 testl %eax, %eax je 0x626ad shrl $0xc, %r12d andl $0x1, %r12d leaq 0x71e47(%rip), %rsi # 0xd43d2 movq %r14, %rdi callq 0x441c0 testl %r12d, %r12d leaq 0xe59fa(%rip), %rax # 0x147f97 leaq 0xf814c(%rip), %rsi # 0x15a6f0 cmoveq %rax, %rsi movq %r14, %rdi callq 0x441c0 movq 0x320(%rbx), %r15 movq %r13, %rdi callq 0x44310 movl %eax, %edi callq *0x80(%r15) movq %r14, %rdi movq %rax, %rsi callq 0x441c0 movq 0x320(%rbx), %rax cmpl $0x0, 0x68(%rax) je 0x6261d movq %r13, %rdi callq 0x44310 movq 0x310(%rbx), %rcx movq 0xe8(%rcx), %rcx movzbl 0x50(%rcx), %edx leaq (%rdx,%rdx,4), %rdx movl %eax, 0x6c(%rcx,%rdx,8) movq 0x310(%rbx), %rax movq 0xe8(%rax), %rax movzbl 0x50(%rax), %ecx leaq (%rcx,%rcx,4), %rcx movb %r12b, 0x78(%rax,%rcx,8) movq (%rsp), %r15 movq %r15, %rdi callq 0x443b0 movq %rax, %r12 shrl $0xd, %r12d andl $0x7, %r12d movq %r15, %rdi callq 0x443b0 andl $0xfff, %eax # imm = 0xFFF movq %rbx, %rdi movq %r14, %rsi movl %r12d, %edx movl %eax, %ecx callq 0x672a9 leaq 0x7d152(%rip), %rsi # 0xdf7aa movq %r14, %rdi callq 0x441c0 movq 0x320(%rbx), %rax cmpl $0x3, 0x68(%rax) jne 0x62682 movb $0x0, 0x70(%rax) movq 0x310(%rbx), %rax movq 0xe8(%rax), %rax incb 0x50(%rax) addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rbx, %rdi movl %r15d, %esi movq %r14, %rdx addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp jmp 0x61c86 movq (%rsp), %r15 movq %r15, %rdi callq 0x443b0 movq %rax, %r12 andl $0xfff, %r12d # imm = 0xFFF je 0x62651 movq %r15, %rdi callq 0x443b0 movq %rax, %r13 shrl $0xc, %r13d leaq 0x71cf7(%rip), %rsi # 0xd43d2 movq %r14, %rdi callq 0x441c0 andl $0x1, %r13d leaq 0xe58a9(%rip), %rax # 0x147f97 leaq 0xf7ffb(%rip), %rdx # 0x15a6f0 cmoveq %rax, %rdx cmpl $0xa, %r12d leaq 0x71dd5(%rip), %rax # 0xd44d9 leaq 0x71dd8(%rip), %rsi # 0xd44e3 cmovaeq %rax, %rsi movq %r14, %rdi movl %r12d, %ecx xorl %eax, %eax callq 0x44540 movq 0x320(%rbx), %rax cmpl $0x0, 0x68(%rax) je 0x62651 movq %r15, %rdi callq 0x443b0 xorl %ecx, %ecx btl $0xc, %eax setae %cl movq 0x310(%rbx), %rax movq 0xe8(%rax), %rax movzbl 0x50(%rax), %edx leaq (%rdx,%rdx,4), %rdx movl %ecx, 0x5c(%rax,%rdx,8) movq 0x310(%rbx), %rax movq 0xe8(%rax), %rax movzbl 0x50(%rax), %ecx leaq (%rcx,%rcx,4), %rcx movl %r12d, 0x60(%rax,%rcx,8) movq 0x310(%rbx), %rax movq 0xe8(%rax), %rax movzbl 0x50(%rax), %ecx leaq (%rcx,%rcx,4), %rcx movb %r13b, 0x78(%rax,%rcx,8) jmp 0x62651
/bughoho[P]capstone/arch/ARM/ARMInstPrinter.c
printFBits16
static void printFBits16(MCInst *MI, unsigned OpNum, SStream *O) { unsigned tmp; tmp = 16 - (unsigned int)MCOperand_getImm(MCInst_getOperand(MI, OpNum)); if (tmp > HEX_THRESHOLD) SStream_concat(O, "#0x%x", tmp); else SStream_concat(O, "#%u", tmp); if (MI->csh->detail) { MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].type = ARM_OP_IMM; MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].imm = tmp; MI->flat_insn->detail->arm.op_count++; } }
pushq %rbp pushq %r14 pushq %rbx movq %rsi, %r14 movq %rdi, %rbx movl $0x2, %esi callq 0x444e0 movq %rax, %rdi callq 0x443b0 movl $0x10, %ebp subl %eax, %ebp cmpl $0xa, %ebp leaq 0x71d06(%rip), %rax # 0xd44c6 leaq 0x71d07(%rip), %rsi # 0xd44ce cmovaeq %rax, %rsi movq %r14, %rdi movl %ebp, %edx xorl %eax, %eax callq 0x44540 movq 0x320(%rbx), %rax cmpl $0x0, 0x68(%rax) je 0x6282d movq 0x310(%rbx), %rax movq 0xe8(%rax), %rax movzbl 0x50(%rax), %ecx leaq (%rcx,%rcx,4), %rcx movl $0x2, 0x64(%rax,%rcx,8) movq 0x310(%rbx), %rax movq 0xe8(%rax), %rax movzbl 0x50(%rax), %ecx leaq (%rcx,%rcx,4), %rcx movl %ebp, 0x68(%rax,%rcx,8) movq 0x310(%rbx), %rax movq 0xe8(%rax), %rax incb 0x50(%rax) popq %rbx popq %r14 popq %rbp retq
/bughoho[P]capstone/arch/ARM/ARMInstPrinter.c
printGPRPairOperand
static void printGPRPairOperand(MCInst *MI, unsigned OpNum, SStream *O, MCRegisterInfo *MRI) { unsigned Reg = MCOperand_getReg(MCInst_getOperand(MI, OpNum)); printRegName(MI->csh, O, MCRegisterInfo_getSubReg(MRI, Reg, ARM_gsub_0)); if (MI->csh->detail) { MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].type = ARM_OP_REG; MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].reg = MCRegisterInfo_getSubReg(MRI, Reg, ARM_gsub_0); MI->flat_insn->detail->arm.op_count++; } SStream_concat0(O, ", "); printRegName(MI->csh, O, MCRegisterInfo_getSubReg(MRI, Reg, ARM_gsub_1)); if (MI->csh->detail) { MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].type = ARM_OP_REG; MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].reg = MCRegisterInfo_getSubReg(MRI, Reg, ARM_gsub_1); MI->flat_insn->detail->arm.op_count++; } }
pushq %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx movq %rcx, %r14 movq %rdx, %r15 movq %rdi, %rbx callq 0x444e0 movq %rax, %rdi callq 0x44310 movl %eax, %ebp movq 0x320(%rbx), %r12 movq %r14, %rdi movl %eax, %esi movl $0x9, %edx callq 0x443a0 movl %eax, %edi callq *0x80(%r12) movq %r15, %rdi movq %rax, %rsi callq 0x441c0 movq 0x320(%rbx), %rax cmpl $0x0, 0x68(%rax) je 0x62a01 movq 0x310(%rbx), %rax movq 0xe8(%rax), %rax movzbl 0x50(%rax), %ecx leaq (%rcx,%rcx,4), %rcx movl $0x1, 0x64(%rax,%rcx,8) movq %r14, %rdi movl %ebp, %esi movl $0x9, %edx callq 0x443a0 movq 0x310(%rbx), %rcx movq 0xe8(%rcx), %rcx movzbl 0x50(%rcx), %edx leaq (%rdx,%rdx,4), %rdx movl %eax, 0x68(%rcx,%rdx,8) movq 0x310(%rbx), %rax movq 0xe8(%rax), %rax incb 0x50(%rax) leaq 0x719ca(%rip), %rsi # 0xd43d2 movq %r15, %rdi callq 0x441c0 movq 0x320(%rbx), %r12 movq %r14, %rdi movl %ebp, %esi movl $0xa, %edx callq 0x443a0 movl %eax, %edi callq *0x80(%r12) movq %r15, %rdi movq %rax, %rsi callq 0x441c0 movq 0x320(%rbx), %rax cmpl $0x0, 0x68(%rax) je 0x62aa0 movq 0x310(%rbx), %rax movq 0xe8(%rax), %rax movzbl 0x50(%rax), %ecx leaq (%rcx,%rcx,4), %rcx movl $0x1, 0x64(%rax,%rcx,8) movq %r14, %rdi movl %ebp, %esi movl $0xa, %edx callq 0x443a0 movq 0x310(%rbx), %rcx movq 0xe8(%rcx), %rcx movzbl 0x50(%rcx), %edx leaq (%rdx,%rdx,4), %rdx movl %eax, 0x68(%rcx,%rdx,8) movq 0x310(%rbx), %rax movq 0xe8(%rax), %rax incb 0x50(%rax) popq %rbx popq %r12 popq %r14 popq %r15 popq %rbp retq
/bughoho[P]capstone/arch/ARM/ARMInstPrinter.c
printVectorListThreeSpacedAllLanes
static void printVectorListThreeSpacedAllLanes(MCInst *MI, unsigned OpNum, SStream *O) { // Normally, it's not safe to use register enum values directly with // addition to get the next register, but for VFP registers, the // sort order is guaranteed because they're all of the form D<n>. SStream_concat0(O, "{"); printRegName(MI->csh, O, MCOperand_getReg(MCInst_getOperand(MI, OpNum))); if (MI->csh->detail) { MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].type = ARM_OP_REG; MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].reg = MCOperand_getReg(MCInst_getOperand(MI, OpNum)); MI->flat_insn->detail->arm.op_count++; } SStream_concat0(O, "[], "); printRegName(MI->csh, O, MCOperand_getReg(MCInst_getOperand(MI, OpNum)) + 2); if (MI->csh->detail) { MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].type = ARM_OP_REG; MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].reg = MCOperand_getReg(MCInst_getOperand(MI, OpNum)) + 2; MI->flat_insn->detail->arm.op_count++; } SStream_concat0(O, "[], "); printRegName(MI->csh, O, MCOperand_getReg(MCInst_getOperand(MI, OpNum)) + 4); if (MI->csh->detail) { MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].type = ARM_OP_REG; MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].reg = MCOperand_getReg(MCInst_getOperand(MI, OpNum)) + 4; MI->flat_insn->detail->arm.op_count++; } SStream_concat0(O, "[]}"); }
pushq %r15 pushq %r14 pushq %rbx movq %rsi, %rbx movq %rdi, %r14 leaq 0x6ffed(%rip), %rsi # 0xd4304 movq %rbx, %rdi callq 0x441c0 movq 0x320(%r14), %r15 movq %r14, %rdi xorl %esi, %esi callq 0x444e0 movq %rax, %rdi callq 0x44310 movl %eax, %edi callq *0x80(%r15) movq %rbx, %rdi movq %rax, %rsi callq 0x441c0 movq 0x320(%r14), %rax cmpl $0x0, 0x68(%rax) je 0x643b4 movq 0x310(%r14), %rax movq 0xe8(%rax), %rax movzbl 0x50(%rax), %ecx leaq (%rcx,%rcx,4), %rcx movl $0x1, 0x64(%rax,%rcx,8) movq %r14, %rdi xorl %esi, %esi callq 0x444e0 movq %rax, %rdi callq 0x44310 movq 0x310(%r14), %rcx movq 0xe8(%rcx), %rcx movzbl 0x50(%rcx), %edx leaq (%rdx,%rdx,4), %rdx movl %eax, 0x68(%rcx,%rdx,8) movq 0x310(%r14), %rax movq 0xe8(%rax), %rax incb 0x50(%rax) leaq 0x70032(%rip), %rsi # 0xd43ed movq %rbx, %rdi callq 0x441c0 movq 0x320(%r14), %r15 movq %r14, %rdi xorl %esi, %esi callq 0x444e0 movq %rax, %rdi callq 0x44310 leal 0x2(%rax), %edi callq *0x80(%r15) movq %rbx, %rdi movq %rax, %rsi callq 0x441c0 movq 0x320(%r14), %rax cmpl $0x0, 0x68(%rax) je 0x6445c movq 0x310(%r14), %rax movq 0xe8(%rax), %rax movzbl 0x50(%rax), %ecx leaq (%rcx,%rcx,4), %rcx movl $0x1, 0x64(%rax,%rcx,8) movq %r14, %rdi xorl %esi, %esi callq 0x444e0 movq %rax, %rdi callq 0x44310 addl $0x2, %eax movq 0x310(%r14), %rcx movq 0xe8(%rcx), %rcx movzbl 0x50(%rcx), %edx leaq (%rdx,%rdx,4), %rdx movl %eax, 0x68(%rcx,%rdx,8) movq 0x310(%r14), %rax movq 0xe8(%rax), %rax incb 0x50(%rax) leaq 0x6ff8a(%rip), %rsi # 0xd43ed movq %rbx, %rdi callq 0x441c0 movq 0x320(%r14), %r15 movq %r14, %rdi xorl %esi, %esi callq 0x444e0 movq %rax, %rdi callq 0x44310 leal 0x4(%rax), %edi callq *0x80(%r15) movq %rbx, %rdi movq %rax, %rsi callq 0x441c0 movq 0x320(%r14), %rax cmpl $0x0, 0x68(%rax) je 0x64504 movq 0x310(%r14), %rax movq 0xe8(%rax), %rax movzbl 0x50(%rax), %ecx leaq (%rcx,%rcx,4), %rcx movl $0x1, 0x64(%rax,%rcx,8) movq %r14, %rdi xorl %esi, %esi callq 0x444e0 movq %rax, %rdi callq 0x44310 addl $0x4, %eax movq 0x310(%r14), %rcx movq 0xe8(%rcx), %rcx movzbl 0x50(%rcx), %edx leaq (%rdx,%rdx,4), %rdx movl %eax, 0x68(%rcx,%rdx,8) movq 0x310(%r14), %rax movq 0xe8(%rax), %rax incb 0x50(%rax) leaq 0x70076(%rip), %rsi # 0xd4581 movq %rbx, %rdi popq %rbx popq %r14 popq %r15 jmp 0x441c0
/bughoho[P]capstone/arch/ARM/ARMInstPrinter.c
X86_insn_reg_intel2
bool X86_insn_reg_intel2(unsigned int id, x86_reg *reg1, x86_reg *reg2) { unsigned int i; for (i = 0; i < ARR_SIZE(insn_regs_intel2); i++) { if (insn_regs_intel2[i].insn == id) { *reg1 = insn_regs_intel2[i].reg1; *reg2 = insn_regs_intel2[i].reg2; return true; } } // not found return false; }
cmpl $0x37f, %edi # imm = 0x37F jne 0xa9485 leaq 0x9f1ff(%rip), %rcx # 0x148680 movb $0x1, %al jmp 0xa94b1 movq $-0x1, %rax leaq 0x9f1ed(%rip), %rcx # 0x148680 cmpq $0x4, %rax je 0xa94bc movzwl 0xc(%rcx), %r8d addq $0xc, %rcx incq %rax cmpl %edi, %r8d jne 0xa9493 cmpq $0x5, %rax setb %al movl 0x4(%rcx), %edi movl 0x8(%rcx), %ecx movl %edi, (%rsi) movl %ecx, (%rdx) retq incq %rax cmpq $0x5, %rax setb %al retq
/bughoho[P]capstone/arch/X86/X86Mapping.c
DecodeL2OpInstructionFail
static DecodeStatus DecodeL2OpInstructionFail(MCInst *Inst, unsigned Insn, uint64_t Address, void *Decoder) { // Try and decode as a L3R / L2RUS instruction. unsigned Opcode = fieldFromInstruction_4(Insn, 16, 4) | fieldFromInstruction_4(Insn, 27, 5) << 4; switch (Opcode) { case 0x0c: MCInst_setOpcode(Inst, XCore_STW_l3r); return DecodeL3RInstruction(Inst, Insn, Address, Decoder); case 0x1c: MCInst_setOpcode(Inst, XCore_XOR_l3r); return DecodeL3RInstruction(Inst, Insn, Address, Decoder); case 0x2c: MCInst_setOpcode(Inst, XCore_ASHR_l3r); return DecodeL3RInstruction(Inst, Insn, Address, Decoder); case 0x3c: MCInst_setOpcode(Inst, XCore_LDAWF_l3r); return DecodeL3RInstruction(Inst, Insn, Address, Decoder); case 0x4c: MCInst_setOpcode(Inst, XCore_LDAWB_l3r); return DecodeL3RInstruction(Inst, Insn, Address, Decoder); case 0x5c: MCInst_setOpcode(Inst, XCore_LDA16F_l3r); return DecodeL3RInstruction(Inst, Insn, Address, Decoder); case 0x6c: MCInst_setOpcode(Inst, XCore_LDA16B_l3r); return DecodeL3RInstruction(Inst, Insn, Address, Decoder); case 0x7c: MCInst_setOpcode(Inst, XCore_MUL_l3r); return DecodeL3RInstruction(Inst, Insn, Address, Decoder); case 0x8c: MCInst_setOpcode(Inst, XCore_DIVS_l3r); return DecodeL3RInstruction(Inst, Insn, Address, Decoder); case 0x9c: MCInst_setOpcode(Inst, XCore_DIVU_l3r); return DecodeL3RInstruction(Inst, Insn, Address, Decoder); case 0x10c: MCInst_setOpcode(Inst, XCore_ST16_l3r); return DecodeL3RInstruction(Inst, Insn, Address, Decoder); case 0x11c: MCInst_setOpcode(Inst, XCore_ST8_l3r); return DecodeL3RInstruction(Inst, Insn, Address, Decoder); case 0x12c: MCInst_setOpcode(Inst, XCore_ASHR_l2rus); return DecodeL2RUSBitpInstruction(Inst, Insn, Address, Decoder); case 0x12d: MCInst_setOpcode(Inst, XCore_OUTPW_l2rus); return DecodeL2RUSBitpInstruction(Inst, Insn, Address, Decoder); case 0x12e: MCInst_setOpcode(Inst, XCore_INPW_l2rus); return DecodeL2RUSBitpInstruction(Inst, Insn, Address, Decoder); case 0x13c: MCInst_setOpcode(Inst, XCore_LDAWF_l2rus); return DecodeL2RUSInstruction(Inst, Insn, Address, Decoder); case 0x14c: MCInst_setOpcode(Inst, XCore_LDAWB_l2rus); return DecodeL2RUSInstruction(Inst, Insn, Address, Decoder); case 0x15c: MCInst_setOpcode(Inst, XCore_CRC_l3r); return DecodeL3RSrcDstInstruction(Inst, Insn, Address, Decoder); case 0x18c: MCInst_setOpcode(Inst, XCore_REMS_l3r); return DecodeL3RInstruction(Inst, Insn, Address, Decoder); case 0x19c: MCInst_setOpcode(Inst, XCore_REMU_l3r); return DecodeL3RInstruction(Inst, Insn, Address, Decoder); } return MCDisassembler_Fail; }
pushq %rbp pushq %r14 pushq %rbx movq %rdx, %rbx movl %esi, %ebp movq %rdi, %r14 movl %esi, %ecx shrl $0x10, %ecx andl $0xf, %ecx movl %esi, %eax shrl $0x17, %eax andl $-0x10, %eax orl %ecx, %eax cmpl $0x10b, %eax # imm = 0x10B jg 0xc8ac4 cmpl $0x5b, %eax jg 0xc8b04 cmpl $0x2b, %eax jle 0xc8b72 cmpl $0x2c, %eax je 0xc8c21 cmpl $0x3c, %eax je 0xc8bf6 cmpl $0x4c, %eax jne 0xc8cc1 movq %r14, %rdi movl $0x87, %esi jmp 0xc8c8d cmpl $0x13b, %eax # imm = 0x13B jg 0xc8b39 cmpl $0x12b, %eax # imm = 0x12B jle 0xc8b91 cmpl $0x12c, %eax # imm = 0x12C je 0xc8c2b cmpl $0x12d, %eax # imm = 0x12D je 0xc8c03 cmpl $0x12e, %eax # imm = 0x12E jne 0xc8cc1 movq %r14, %rdi movl $0x6f, %esi jmp 0xc8c33 cmpl $0x7b, %eax jle 0xc8bb4 cmpl $0x7c, %eax je 0xc8c49 cmpl $0x8c, %eax je 0xc8c0d cmpl $0x9c, %eax jne 0xc8cc1 movq %r14, %rdi movl $0x46, %esi jmp 0xc8c8d cmpl $0x15b, %eax # imm = 0x15B jle 0xc8bd3 cmpl $0x15c, %eax # imm = 0x15C je 0xc8c53 cmpl $0x18c, %eax # imm = 0x18C je 0xc8c17 cmpl $0x19c, %eax # imm = 0x19C jne 0xc8cc1 movq %r14, %rdi movl $0xb9, %esi jmp 0xc8c8d cmpl $0xc, %eax je 0xc8c71 cmpl $0x1c, %eax jne 0xc8cc1 movq %r14, %rdi movl $0xf2, %esi jmp 0xc8c8d cmpl $0x10c, %eax # imm = 0x10C je 0xc8c7b cmpl $0x11c, %eax # imm = 0x11C jne 0xc8cc1 movq %r14, %rdi movl $0xda, %esi jmp 0xc8c8d cmpl $0x5c, %eax je 0xc8c85 cmpl $0x6c, %eax jne 0xc8cc1 movq %r14, %rdi movl $0x7f, %esi jmp 0xc8c8d cmpl $0x13c, %eax # imm = 0x13C je 0xc8ca3 cmpl $0x14c, %eax # imm = 0x14C jne 0xc8cc1 movq %r14, %rdi movl $0x86, %esi jmp 0xc8cab movq %r14, %rdi movl $0x8e, %esi jmp 0xc8c8d movq %r14, %rdi movl $0xb3, %esi jmp 0xc8c33 movq %r14, %rdi movl $0x45, %esi jmp 0xc8c8d movq %r14, %rdi movl $0xb8, %esi jmp 0xc8c8d movq %r14, %rdi movl $0x1b, %esi jmp 0xc8c8d movq %r14, %rdi movl $0x1a, %esi callq 0x44180 movq %r14, %rdi movl %ebp, %esi movq %rbx, %rdx popq %rbx popq %r14 popq %rbp jmp 0xc867d movq %r14, %rdi movl $0xad, %esi jmp 0xc8c8d movq %r14, %rdi movl $0x41, %esi callq 0x44180 movq %r14, %rdi movl %ebp, %esi movq %rbx, %rdx popq %rbx popq %r14 popq %rbp jmp 0xc87ea movq %r14, %rdi movl $0xe5, %esi jmp 0xc8c8d movq %r14, %rdi movl $0xd9, %esi jmp 0xc8c8d movq %r14, %rdi movl $0x80, %esi callq 0x44180 movq %r14, %rdi movl %ebp, %esi movq %rbx, %rdx popq %rbx popq %r14 popq %rbp jmp 0xc8121 movq %r14, %rdi movl $0x8d, %esi callq 0x44180 movq %r14, %rdi movl %ebp, %esi movq %rbx, %rdx popq %rbx popq %r14 popq %rbp jmp 0xc873a xorl %eax, %eax popq %rbx popq %r14 popq %rbp retq
/bughoho[P]capstone/arch/XCore/XCoreDisassembler.c
DecodeL5RInstructionFail
static DecodeStatus DecodeL5RInstructionFail(MCInst *Inst, unsigned Insn, uint64_t Address, void *Decoder) { unsigned Opcode; // Try and decode as a L6R instruction. MCInst_clear(Inst); Opcode = fieldFromInstruction_4(Insn, 27, 5); switch (Opcode) { default: break; case 0x00: MCInst_setOpcode(Inst, XCore_LMUL_l6r); return DecodeL6RInstruction(Inst, Insn, Address, Decoder); } return MCDisassembler_Fail; }
pushq %rbp pushq %r14 pushq %rbx movq %rdx, %rbx movl %esi, %ebp movq %rdi, %r14 callq 0x44640 cmpl $0x7ffffff, %ebp # imm = 0x7FFFFFF ja 0xc8cff movq %r14, %rdi movl $0xa3, %esi callq 0x44180 movq %r14, %rdi movl %ebp, %esi movq %rbx, %rdx popq %rbx popq %r14 popq %rbp jmp 0xc84b1 xorl %eax, %eax popq %rbx popq %r14 popq %rbp retq nop
/bughoho[P]capstone/arch/XCore/XCoreDisassembler.c
bool sptk::ReadStream<long>(bool, int, int, int, std::vector<long, std::allocator<long>>*, std::istream*, int*)
bool ReadStream(bool zero_padding, int stream_skip, int read_point, int read_size, std::vector<T>* sequence_to_read, std::istream* input_stream, int* actual_read_size) { if (stream_skip < 0 || read_point < 0 || read_size <= 0 || NULL == sequence_to_read || NULL == input_stream || input_stream->eof()) { return false; } const int type_byte(sizeof((*sequence_to_read)[0])); if (0 < stream_skip) { input_stream->ignore(type_byte * stream_skip); if (input_stream->eof()) return false; } const int end(read_point + read_size); if (sequence_to_read->size() < static_cast<std::size_t>(end)) { sequence_to_read->resize(end); } const int num_read_bytes(type_byte * read_size); input_stream->read( reinterpret_cast<char*>(&((*sequence_to_read)[0]) + read_point), num_read_bytes); const int gcount(static_cast<int>(input_stream->gcount())); if (NULL != actual_read_size) { *actual_read_size = gcount / type_byte; } if (num_read_bytes == gcount) { return !input_stream->fail(); } else if (zero_padding && 0 < gcount) { // Use std::ceil to zero incomplete data // as gcount may not be a multiple of sizeof(double). const int num_zeros(static_cast<int>( std::ceil(static_cast<double>(num_read_bytes - gcount) / type_byte))); if (num_zeros < 0) { return false; // Something wrong! } std::fill_n(sequence_to_read->begin() + end - num_zeros, num_zeros, static_cast<T>(0)); return !input_stream->bad(); } return false; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl %ecx, %r15d movl %edx, %r13d movl %edx, %eax orl %esi, %eax sets %al testl %ecx, %ecx setle %cl orb %al, %cl testq %r8, %r8 sete %al testq %r9, %r9 sete %dl orb %al, %dl orb %cl, %dl jne 0x76ef movq %r9, %rbx movq (%r9), %rax movq -0x18(%rax), %rax testb $0x2, 0x20(%r9,%rax) jne 0x76ef movq %r8, %r14 movl %edi, %ebp testl %esi, %esi jle 0x7632 shll $0x3, %esi movq %rbx, %rdi callq 0x3050 movq (%rbx), %rax movq -0x18(%rax), %rax testb $0x2, 0x20(%rbx,%rax) jne 0x76ef leal (%r15,%r13), %r12d movq (%r14), %rax movq 0x8(%r14), %rcx subq %rax, %rcx sarq $0x3, %rcx cmpq %r12, %rcx jae 0x7657 movq %r14, %rdi movq %r12, %rsi callq 0x7700 movq (%r14), %rax shll $0x3, %r15d movl %r13d, %ecx leaq (%rax,%rcx,8), %rsi movq %rbx, %rdi movq %r15, %rdx callq 0x32d0 movl 0x8(%rbx), %eax movq 0x40(%rsp), %rdx testq %rdx, %rdx je 0x7687 leal 0x7(%rax), %ecx testl %eax, %eax cmovnsl %eax, %ecx sarl $0x3, %ecx movl %ecx, (%rdx) movl $0x5, %r13d subl %eax, %r15d jne 0x76a3 movq (%rbx), %rax movq -0x18(%rax), %rax testl %r13d, 0x20(%rbx,%rax) sete %al jmp 0x76f1 testl %eax, %eax setle %al xorb $0x1, %bpl orb %al, %bpl jne 0x76ef cvtsi2sd %r15d, %xmm0 mulsd 0x4cea(%rip), %xmm0 # 0xc3a8 callq 0x3080 cvttsd2si %xmm0, %eax testl %eax, %eax js 0x76ef movl $0x1, %r13d je 0x7692 shlq $0x3, %r12 addq (%r14), %r12 movl %eax, %edx shlq $0x3, %rdx subq %rdx, %r12 movq %r12, %rdi xorl %esi, %esi callq 0x3180 jmp 0x7692 xorl %eax, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/sp-nitech[P]SPTK/src/utils/sptk_utils.cc
bool sptk::ReadStream<unsigned char>(bool, int, int, int, std::vector<unsigned char, std::allocator<unsigned char>>*, std::istream*, int*)
bool ReadStream(bool zero_padding, int stream_skip, int read_point, int read_size, std::vector<T>* sequence_to_read, std::istream* input_stream, int* actual_read_size) { if (stream_skip < 0 || read_point < 0 || read_size <= 0 || NULL == sequence_to_read || NULL == input_stream || input_stream->eof()) { return false; } const int type_byte(sizeof((*sequence_to_read)[0])); if (0 < stream_skip) { input_stream->ignore(type_byte * stream_skip); if (input_stream->eof()) return false; } const int end(read_point + read_size); if (sequence_to_read->size() < static_cast<std::size_t>(end)) { sequence_to_read->resize(end); } const int num_read_bytes(type_byte * read_size); input_stream->read( reinterpret_cast<char*>(&((*sequence_to_read)[0]) + read_point), num_read_bytes); const int gcount(static_cast<int>(input_stream->gcount())); if (NULL != actual_read_size) { *actual_read_size = gcount / type_byte; } if (num_read_bytes == gcount) { return !input_stream->fail(); } else if (zero_padding && 0 < gcount) { // Use std::ceil to zero incomplete data // as gcount may not be a multiple of sizeof(double). const int num_zeros(static_cast<int>( std::ceil(static_cast<double>(num_read_bytes - gcount) / type_byte))); if (num_zeros < 0) { return false; // Something wrong! } std::fill_n(sequence_to_read->begin() + end - num_zeros, num_zeros, static_cast<T>(0)); return !input_stream->bad(); } return false; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl %ecx, %r15d movl %edx, %r13d movl %edx, %eax orl %esi, %eax sets %al testl %ecx, %ecx setle %cl orb %al, %cl testq %r8, %r8 sete %al testq %r9, %r9 sete %dl orb %al, %dl orb %cl, %dl jne 0x7827 movq %r9, %rbx movq (%r9), %rax movq -0x18(%rax), %rax testb $0x2, 0x20(%r9,%rax) jne 0x7827 movq %r8, %r14 movl %edi, %ebp testl %esi, %esi jle 0x77a1 movl %esi, %esi movq %rbx, %rdi callq 0x3050 movq (%rbx), %rax movq -0x18(%rax), %rax testb $0x2, 0x20(%rbx,%rax) jne 0x7827 leal (%r15,%r13), %r12d movq (%r14), %rax movq 0x8(%r14), %rcx subq %rax, %rcx cmpq %r12, %rcx jae 0x77c2 movq %r14, %rdi movq %r12, %rsi callq 0x7838 movq (%r14), %rax movl %r13d, %esi addq %rax, %rsi movl %r15d, %edx movq %rbx, %rdi callq 0x32d0 movl 0x8(%rbx), %eax movq 0x40(%rsp), %rcx testq %rcx, %rcx je 0x77e2 movl %eax, (%rcx) movl $0x5, %ecx cmpl %eax, %r15d je 0x7817 testl %eax, %eax setle %cl xorb $0x1, %bpl orb %cl, %bpl jne 0x7827 subl %eax, %r15d js 0x7827 addq (%r14), %r12 movl %r15d, %edx subq %rdx, %r12 movq %r12, %rdi xorl %esi, %esi callq 0x3180 movl $0x1, %ecx movq (%rbx), %rax movq -0x18(%rax), %rax testl %ecx, 0x20(%rbx,%rax) sete %al jmp 0x7829 xorl %eax, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/sp-nitech[P]SPTK/src/utils/sptk_utils.cc
bool sptk::ReadStream<unsigned short>(bool, int, int, int, std::vector<unsigned short, std::allocator<unsigned short>>*, std::istream*, int*)
bool ReadStream(bool zero_padding, int stream_skip, int read_point, int read_size, std::vector<T>* sequence_to_read, std::istream* input_stream, int* actual_read_size) { if (stream_skip < 0 || read_point < 0 || read_size <= 0 || NULL == sequence_to_read || NULL == input_stream || input_stream->eof()) { return false; } const int type_byte(sizeof((*sequence_to_read)[0])); if (0 < stream_skip) { input_stream->ignore(type_byte * stream_skip); if (input_stream->eof()) return false; } const int end(read_point + read_size); if (sequence_to_read->size() < static_cast<std::size_t>(end)) { sequence_to_read->resize(end); } const int num_read_bytes(type_byte * read_size); input_stream->read( reinterpret_cast<char*>(&((*sequence_to_read)[0]) + read_point), num_read_bytes); const int gcount(static_cast<int>(input_stream->gcount())); if (NULL != actual_read_size) { *actual_read_size = gcount / type_byte; } if (num_read_bytes == gcount) { return !input_stream->fail(); } else if (zero_padding && 0 < gcount) { // Use std::ceil to zero incomplete data // as gcount may not be a multiple of sizeof(double). const int num_zeros(static_cast<int>( std::ceil(static_cast<double>(num_read_bytes - gcount) / type_byte))); if (num_zeros < 0) { return false; // Something wrong! } std::fill_n(sequence_to_read->begin() + end - num_zeros, num_zeros, static_cast<T>(0)); return !input_stream->bad(); } return false; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl %ecx, %r15d movl %edx, %r13d movl %edx, %eax orl %esi, %eax sets %al testl %ecx, %ecx setle %cl orb %al, %cl testq %r8, %r8 sete %al testq %r9, %r9 sete %dl orb %al, %dl orb %cl, %dl jne 0x798b movq %r9, %rbx movq (%r9), %rax movq -0x18(%rax), %rax testb $0x2, 0x20(%r9,%rax) jne 0x798b movq %r8, %r14 movl %edi, %ebp testl %esi, %esi jle 0x78d4 addl %esi, %esi movq %rbx, %rdi callq 0x3050 movq (%rbx), %rax movq -0x18(%rax), %rax testb $0x2, 0x20(%rbx,%rax) jne 0x798b leal (%r15,%r13), %r12d movq (%r14), %rax movq 0x8(%r14), %rcx subq %rax, %rcx sarq %rcx cmpq %r12, %rcx jae 0x78f8 movq %r14, %rdi movq %r12, %rsi callq 0x799c movq (%r14), %rax addl %r15d, %r15d movl %r13d, %ecx leaq (%rax,%rcx,2), %rsi movq %rbx, %rdi movq %r15, %rdx callq 0x32d0 movl 0x8(%rbx), %eax movq 0x40(%rsp), %rdx testq %rdx, %rdx je 0x7925 movl %eax, %ecx shrl $0x1f, %ecx addl %eax, %ecx sarl %ecx movl %ecx, (%rdx) movl $0x5, %r13d subl %eax, %r15d jne 0x7941 movq (%rbx), %rax movq -0x18(%rax), %rax testl %r13d, 0x20(%rbx,%rax) sete %al jmp 0x798d testl %eax, %eax setle %al xorb $0x1, %bpl orb %al, %bpl jne 0x798b cvtsi2sd %r15d, %xmm0 mulsd 0x4a34(%rip), %xmm0 # 0xc390 callq 0x3080 cvttsd2si %xmm0, %eax testl %eax, %eax js 0x798b movl $0x1, %r13d je 0x7930 addq %r12, %r12 addq (%r14), %r12 movl %eax, %edx addq %rdx, %rdx subq %rdx, %r12 movq %r12, %rdi xorl %esi, %esi callq 0x3180 jmp 0x7930 xorl %eax, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/sp-nitech[P]SPTK/src/utils/sptk_utils.cc
bool sptk::ReadStream<sptk::uint24_t>(bool, int, int, int, std::vector<sptk::uint24_t, std::allocator<sptk::uint24_t>>*, std::istream*, int*)
bool ReadStream(bool zero_padding, int stream_skip, int read_point, int read_size, std::vector<T>* sequence_to_read, std::istream* input_stream, int* actual_read_size) { if (stream_skip < 0 || read_point < 0 || read_size <= 0 || NULL == sequence_to_read || NULL == input_stream || input_stream->eof()) { return false; } const int type_byte(sizeof((*sequence_to_read)[0])); if (0 < stream_skip) { input_stream->ignore(type_byte * stream_skip); if (input_stream->eof()) return false; } const int end(read_point + read_size); if (sequence_to_read->size() < static_cast<std::size_t>(end)) { sequence_to_read->resize(end); } const int num_read_bytes(type_byte * read_size); input_stream->read( reinterpret_cast<char*>(&((*sequence_to_read)[0]) + read_point), num_read_bytes); const int gcount(static_cast<int>(input_stream->gcount())); if (NULL != actual_read_size) { *actual_read_size = gcount / type_byte; } if (num_read_bytes == gcount) { return !input_stream->fail(); } else if (zero_padding && 0 < gcount) { // Use std::ceil to zero incomplete data // as gcount may not be a multiple of sizeof(double). const int num_zeros(static_cast<int>( std::ceil(static_cast<double>(num_read_bytes - gcount) / type_byte))); if (num_zeros < 0) { return false; // Something wrong! } std::fill_n(sequence_to_read->begin() + end - num_zeros, num_zeros, static_cast<T>(0)); return !input_stream->bad(); } return false; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl %ecx, %r12d movl %edx, %r13d movl %edx, %eax orl %esi, %eax sets %al testl %ecx, %ecx setle %cl orb %al, %cl testq %r8, %r8 sete %al testq %r9, %r9 sete %dl orb %al, %dl orb %cl, %dl jne 0x7b33 movq %r9, %rbx movq (%r9), %rax movq -0x18(%rax), %rax testb $0x2, 0x20(%r9,%rax) jne 0x7b33 movq %r8, %r14 movl %edi, %ebp testl %esi, %esi jle 0x7a3d leal (%rsi,%rsi,2), %esi movq %rbx, %rdi callq 0x3050 movq (%rbx), %rax movq -0x18(%rax), %rax testb $0x2, 0x20(%rbx,%rax) jne 0x7b33 leal (%r12,%r13), %r15d movq (%r14), %rax movq 0x8(%r14), %rcx subq %rax, %rcx movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB imulq %rdx, %rcx cmpq %r15, %rcx jae 0x7a6c movq %r14, %rdi movq %r15, %rsi callq 0x7b44 movq (%r14), %rax leal (%r12,%r12,2), %r12d movl %r13d, %ecx leaq (%rcx,%rcx,2), %rsi addq %rax, %rsi movq %rbx, %rdi movq %r12, %rdx callq 0x32d0 movl 0x8(%rbx), %eax movq 0x40(%rsp), %rsi testq %rsi, %rsi je 0x7aab movslq %eax, %rcx imulq $0x55555556, %rcx, %rcx # imm = 0x55555556 movq %rcx, %rdx shrq $0x3f, %rdx shrq $0x20, %rcx addl %edx, %ecx movl %ecx, (%rsi) movl $0x5, %r13d subl %eax, %r12d jne 0x7ac7 movq (%rbx), %rax movq -0x18(%rax), %rax testl %r13d, 0x20(%rbx,%rax) sete %al jmp 0x7b35 testl %eax, %eax setle %al xorb $0x1, %bpl orb %al, %bpl jne 0x7b33 cvtsi2sd %r12d, %xmm0 divsd 0x48b6(%rip), %xmm0 # 0xc398 callq 0x3080 cvttsd2si %xmm0, %eax testl %eax, %eax js 0x7b33 movl $0x1, %r13d je 0x7ab6 leaq (%r15,%r15,2), %rcx addq (%r14), %rcx movl %eax, %edx leaq (%rdx,%rdx,2), %rax addq $-0x3, %rax negq %rdx leaq (%rdx,%rdx,2), %rdi movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB mulq %rdx addq %rcx, %rdi shrq %rdx leaq (%rdx,%rdx,2), %rdx addq $0x3, %rdx xorl %esi, %esi callq 0x3180 jmp 0x7ab6 xorl %eax, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/sp-nitech[P]SPTK/src/utils/sptk_utils.cc
bool sptk::ReadStream<unsigned long>(bool, int, int, int, std::vector<unsigned long, std::allocator<unsigned long>>*, std::istream*, int*)
bool ReadStream(bool zero_padding, int stream_skip, int read_point, int read_size, std::vector<T>* sequence_to_read, std::istream* input_stream, int* actual_read_size) { if (stream_skip < 0 || read_point < 0 || read_size <= 0 || NULL == sequence_to_read || NULL == input_stream || input_stream->eof()) { return false; } const int type_byte(sizeof((*sequence_to_read)[0])); if (0 < stream_skip) { input_stream->ignore(type_byte * stream_skip); if (input_stream->eof()) return false; } const int end(read_point + read_size); if (sequence_to_read->size() < static_cast<std::size_t>(end)) { sequence_to_read->resize(end); } const int num_read_bytes(type_byte * read_size); input_stream->read( reinterpret_cast<char*>(&((*sequence_to_read)[0]) + read_point), num_read_bytes); const int gcount(static_cast<int>(input_stream->gcount())); if (NULL != actual_read_size) { *actual_read_size = gcount / type_byte; } if (num_read_bytes == gcount) { return !input_stream->fail(); } else if (zero_padding && 0 < gcount) { // Use std::ceil to zero incomplete data // as gcount may not be a multiple of sizeof(double). const int num_zeros(static_cast<int>( std::ceil(static_cast<double>(num_read_bytes - gcount) / type_byte))); if (num_zeros < 0) { return false; // Something wrong! } std::fill_n(sequence_to_read->begin() + end - num_zeros, num_zeros, static_cast<T>(0)); return !input_stream->bad(); } return false; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl %ecx, %r15d movl %edx, %r13d movl %edx, %eax orl %esi, %eax sets %al testl %ecx, %ecx setle %cl orb %al, %cl testq %r8, %r8 sete %al testq %r9, %r9 sete %dl orb %al, %dl orb %cl, %dl jne 0x7e21 movq %r9, %rbx movq (%r9), %rax movq -0x18(%rax), %rax testb $0x2, 0x20(%r9,%rax) jne 0x7e21 movq %r8, %r14 movl %edi, %ebp testl %esi, %esi jle 0x7d64 shll $0x3, %esi movq %rbx, %rdi callq 0x3050 movq (%rbx), %rax movq -0x18(%rax), %rax testb $0x2, 0x20(%rbx,%rax) jne 0x7e21 leal (%r15,%r13), %r12d movq (%r14), %rax movq 0x8(%r14), %rcx subq %rax, %rcx sarq $0x3, %rcx cmpq %r12, %rcx jae 0x7d89 movq %r14, %rdi movq %r12, %rsi callq 0x7e32 movq (%r14), %rax shll $0x3, %r15d movl %r13d, %ecx leaq (%rax,%rcx,8), %rsi movq %rbx, %rdi movq %r15, %rdx callq 0x32d0 movl 0x8(%rbx), %eax movq 0x40(%rsp), %rdx testq %rdx, %rdx je 0x7db9 leal 0x7(%rax), %ecx testl %eax, %eax cmovnsl %eax, %ecx sarl $0x3, %ecx movl %ecx, (%rdx) movl $0x5, %r13d subl %eax, %r15d jne 0x7dd5 movq (%rbx), %rax movq -0x18(%rax), %rax testl %r13d, 0x20(%rbx,%rax) sete %al jmp 0x7e23 testl %eax, %eax setle %al xorb $0x1, %bpl orb %al, %bpl jne 0x7e21 cvtsi2sd %r15d, %xmm0 mulsd 0x45b8(%rip), %xmm0 # 0xc3a8 callq 0x3080 cvttsd2si %xmm0, %eax testl %eax, %eax js 0x7e21 movl $0x1, %r13d je 0x7dc4 shlq $0x3, %r12 addq (%r14), %r12 movl %eax, %edx shlq $0x3, %rdx subq %rdx, %r12 movq %r12, %rdi xorl %esi, %esi callq 0x3180 jmp 0x7dc4 xorl %eax, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/sp-nitech[P]SPTK/src/utils/sptk_utils.cc
bool sptk::ReadStream<float>(bool, int, int, int, std::vector<float, std::allocator<float>>*, std::istream*, int*)
bool ReadStream(bool zero_padding, int stream_skip, int read_point, int read_size, std::vector<T>* sequence_to_read, std::istream* input_stream, int* actual_read_size) { if (stream_skip < 0 || read_point < 0 || read_size <= 0 || NULL == sequence_to_read || NULL == input_stream || input_stream->eof()) { return false; } const int type_byte(sizeof((*sequence_to_read)[0])); if (0 < stream_skip) { input_stream->ignore(type_byte * stream_skip); if (input_stream->eof()) return false; } const int end(read_point + read_size); if (sequence_to_read->size() < static_cast<std::size_t>(end)) { sequence_to_read->resize(end); } const int num_read_bytes(type_byte * read_size); input_stream->read( reinterpret_cast<char*>(&((*sequence_to_read)[0]) + read_point), num_read_bytes); const int gcount(static_cast<int>(input_stream->gcount())); if (NULL != actual_read_size) { *actual_read_size = gcount / type_byte; } if (num_read_bytes == gcount) { return !input_stream->fail(); } else if (zero_padding && 0 < gcount) { // Use std::ceil to zero incomplete data // as gcount may not be a multiple of sizeof(double). const int num_zeros(static_cast<int>( std::ceil(static_cast<double>(num_read_bytes - gcount) / type_byte))); if (num_zeros < 0) { return false; // Something wrong! } std::fill_n(sequence_to_read->begin() + end - num_zeros, num_zeros, static_cast<T>(0)); return !input_stream->bad(); } return false; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl %ecx, %r15d movl %edx, %r13d movl %edx, %eax orl %esi, %eax sets %al testl %ecx, %ecx setle %cl orb %al, %cl testq %r8, %r8 sete %al testq %r9, %r9 sete %dl orb %al, %dl orb %cl, %dl jne 0x7f91 movq %r9, %rbx movq (%r9), %rax movq -0x18(%rax), %rax testb $0x2, 0x20(%r9,%rax) jne 0x7f91 movq %r8, %r14 movl %edi, %ebp testl %esi, %esi jle 0x7ed4 shll $0x2, %esi movq %rbx, %rdi callq 0x3050 movq (%rbx), %rax movq -0x18(%rax), %rax testb $0x2, 0x20(%rbx,%rax) jne 0x7f91 leal (%r15,%r13), %r12d movq (%r14), %rax movq 0x8(%r14), %rcx subq %rax, %rcx sarq $0x2, %rcx cmpq %r12, %rcx jae 0x7ef9 movq %r14, %rdi movq %r12, %rsi callq 0x7fa2 movq (%r14), %rax shll $0x2, %r15d movl %r13d, %ecx leaq (%rax,%rcx,4), %rsi movq %rbx, %rdi movq %r15, %rdx callq 0x32d0 movl 0x8(%rbx), %eax movq 0x40(%rsp), %rdx testq %rdx, %rdx je 0x7f29 leal 0x3(%rax), %ecx testl %eax, %eax cmovnsl %eax, %ecx sarl $0x2, %ecx movl %ecx, (%rdx) movl $0x5, %r13d subl %eax, %r15d jne 0x7f45 movq (%rbx), %rax movq -0x18(%rax), %rax testl %r13d, 0x20(%rbx,%rax) sete %al jmp 0x7f93 testl %eax, %eax setle %al xorb $0x1, %bpl orb %al, %bpl jne 0x7f91 cvtsi2sd %r15d, %xmm0 mulsd 0x4440(%rip), %xmm0 # 0xc3a0 callq 0x3080 cvttsd2si %xmm0, %eax testl %eax, %eax js 0x7f91 movl $0x1, %r13d je 0x7f34 shlq $0x2, %r12 addq (%r14), %r12 movl %eax, %edx shlq $0x2, %rdx subq %rdx, %r12 movq %r12, %rdi xorl %esi, %esi callq 0x3180 jmp 0x7f34 xorl %eax, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/sp-nitech[P]SPTK/src/utils/sptk_utils.cc