{"id":307016,"date":"2020-07-16T03:00:27","date_gmt":"2020-07-16T03:00:27","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=307016"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=307016","title":{"rendered":"\u0414\u0435\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 gcc \u0438 clang"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/511174\/\">\n<h4>\u0427\u0442\u043e \u044d\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0442\u0430\u043a\u043e\u0435<\/h4>\n<p>\u0414\u0435\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f (devirtualization) \u2014 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0415\u0441\u043b\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0442\u043e\u0447\u043d\u043e \u0437\u043d\u0430\u0435\u0442 \u0442\u0438\u043f \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439.<br \/>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0441 \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b gcc \u0438 clang.<\/p>\n<h4>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/h4>\n<p>\u0412\u0441\u0435 \u0442\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u043d\u0430 Arch Linux x86-64. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c gcc 4.8.2 \u0438 clang 3.3.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0432\u044b\u0432\u043e\u0434 gcc -v<\/b>                         <\/p>\n<div class=\"spoiler_text\">Using built-in specs.<br \/>  COLLECT_GCC=gcc<br \/>  COLLECT_LTO_WRAPPER=\/usr\/lib\/gcc\/x86_64-unknown-linux-gnu\/4.8.2\/lto-wrapper<br \/>  Target: x86_64-unknown-linux-gnu<br \/>  Configured with: \/build\/gcc-multilib\/src\/gcc-4.8.2\/configure &#8212;prefix=\/usr &#8212;libdir=\/usr\/lib &#8212;libexecdir=\/usr\/lib &#8212;mandir=\/usr\/share\/man &#8212;infodir=\/usr\/share\/info &#8212;with-bugurl=https:\/\/bugs.archlinux.org\/ &#8212;enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ &#8212;enable-shared &#8212;enable-threads=posix &#8212;with-system-zlib &#8212;enable-__cxa_atexit &#8212;disable-libunwind-exceptions &#8212;enable-clocale=gnu &#8212;disable-libstdcxx-pch &#8212;disable-libssp &#8212;enable-gnu-unique-object &#8212;enable-linker-build-id &#8212;enable-cloog-backend=isl &#8212;disable-cloog-version-check &#8212;enable-lto &#8212;enable-plugin &#8212;with-linker-hash-style=gnu &#8212;enable-multilib &#8212;disable-werror &#8212;enable-checking=release<br \/>  Thread model: posix<br \/>  gcc version 4.8.2 (GCC)<\/div>\n<\/p><\/div>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0432\u044b\u0432\u043e\u0434 clang -v<\/b>                         <\/p>\n<div class=\"spoiler_text\">clang version 3.3 (tags\/RELEASE_33\/final)<br \/>  Target: x86_64-unknown-linux-gnu<br \/>  Thread model: posix<\/div>\n<\/p><\/div>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0449\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0434\u0438\u0437\u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u043a\u043e\u0434\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0444\u043b\u0430\u0433 <code>-nostartfiles<\/code>. \u0415\u0441\u043b\u0438 \u0435\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434, \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>main<\/code> \u0441 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438. \u0424\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0432\u043e\u0439, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code>_start<\/code>.<\/p>\n<p>  \u0412 \u043a\u043e\u0434\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0434\u0432\u0430 \u043a\u043b\u0430\u0441\u0441\u0430:<\/p>\n<ul>\n<li>\u043a\u043b\u0430\u0441\u0441 A \u2014 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0441 \u0442\u0440\u0451\u043c\u044f \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438: increment(), decrement() \u0438 get()\n<pre><code class=\"plaintext\">class A { public: \tvirtual ~A() { \t} \tvirtual void increment() = 0; \tvirtual void decrement() = 0; \tvirtual int get() = 0; };<\/code><\/pre>\n<\/li>\n<li>\u043a\u043b\u0430\u0441\u0441 B \u2014 \u043a\u043b\u0430\u0441\u0441 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439\u0441\u044f \u043e\u0442 \u0410 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439 \u0432\u0441\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b\n<pre><code class=\"plaintext\">class B : public A { public: \tB() : x(0) { \t} \tvirtual void increment() { \t\tx++; \t} \tvirtual void decrement() { \t\tx--; \t} \tvirtual int get() { \t\treturn x; \t} private: \tint x; };<\/code><\/pre>\n<\/li>\n<\/ul>\n<h5>\u0412\u0435\u0440\u0441\u0438\u044f 1<\/h5>\n<p>\u0412\u0441\u0451 \u0432 \u043e\u0434\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u043a\u043e\u0434<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">class A { public: \tvirtual ~A() { \t} \tvirtual void increment() = 0; \tvirtual void decrement() = 0; \tvirtual int get() = 0; };  class B : public A { public: \tB() : x(0) { \t} \tvirtual void increment() { \t\tx++; \t} \tvirtual void decrement() { \t\tx--; \t} \tvirtual int get() { \t\treturn x; \t} private: \tint x; };   extern &quot;C&quot; {  int printf(const char * format, ...); void exit(int status);  void _start() { \tB b; \tb.increment(); \tb.increment(); \tb.decrement(); \tprintf(&quot;%d\\n&quot;, b.get()); \texit(0); }  } <\/code><\/pre>\n<\/div><\/div>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: gcc \u0441 \u0444\u043b\u0430\u0433\u0430\u043c\u0438 -O1, -O2, -O3, -Os \u0438 clang \u0441 \u0444\u043b\u0430\u0433\u0430\u043c\u0438 -O2, -O3, -Os \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u043b\u0438 \u0434\u0435\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0438 \u043f\u043e\u043d\u044f\u043b\u0438, \u0447\u0442\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 printf \u0432\u0441\u0435\u0433\u0434\u0430 \u0440\u0430\u0432\u0435\u043d 1. \u041a\u043e\u0434, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e gcc -O1:  <\/p>\n<pre><code class=\"plaintext\">&lt;_start&gt;:     sub    rsp,0x8      ; \u0432\u044b\u0437\u043e\u0432 printf     mov    esi,0x1       ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 b.get() \u0432 ESI     mov    edi,0x4003a2  ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441 \u0441\u0442\u0440\u043e\u043a\u0438 &quot;%s\\n&quot; \u0432 EDI     mov    eax,0x0     call   400360 &lt;printf@plt&gt;  ; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c printf      ; \u0432\u044b\u0437\u043e\u0432 exit     mov    edi,0x0            ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u0434 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 EDI     call   400370 &lt;exit@plt&gt;  ; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c exit<\/code><\/pre>\n<p>  <\/p>\n<h5>\u0412\u0435\u0440\u0441\u0438\u044f 2<\/h5>\n<p>\u0412\u0441\u0451 \u0432 \u043e\u0434\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0447\u0435\u0440\u0435\u0437 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u043a\u043e\u0434<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">class A { public: \tvirtual ~A() { \t} \tvirtual void increment() = 0; \tvirtual void decrement() = 0; \tvirtual int get() = 0; };  class B : public A { public: \tB() : x(0) { \t} \tvirtual void increment() { \t\tx++; \t} \tvirtual void decrement() { \t\tx--; \t} \tvirtual int get() { \t\treturn x; \t} private: \tint x; };   extern &quot;C&quot; {  int printf(const char * format, ...); void exit(int status);  void _start() { \tA * a = new B; \ta-&gt;increment(); \ta-&gt;increment(); \ta-&gt;decrement(); \tprintf(&quot;%d\\n&quot;, a-&gt;get()); \texit(0); }  } <\/code><\/pre>\n<\/div><\/div>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: clang \u0441 \u0444\u043b\u0430\u0433\u0430\u043c\u0438 -O2, -O3, -Os \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u043a\u043e\u0434, \u0447\u0442\u043e \u0438 \u0432 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 1. gcc \u0432\u0435\u0434\u0451\u0442 \u0441\u0435\u0431\u044f \u0441\u0442\u0440\u0430\u043d\u043d\u043e: \u0441 \u0444\u043b\u0430\u0433\u0430\u043c\u0438 -O1, -O2, -O3, -Os \u043e\u043d \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"plaintext\">&lt;_start&gt;:     push   rbx      ; \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438     mov    edi,0x10            ; \u043a\u043e\u043b-\u0432\u043e \u0431\u0430\u0439\u0442 (16)     call   400560 &lt;_Znwm@plt&gt;  ; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0432\u044b\u0434\u0435\u043b\u044f\u044e\u0449\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c (\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0432 RAX)     mov    rbx,rax             ; \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 RBX      ; \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440     mov    QWORD PTR [rax],0x4006d0  ; \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439     mov    DWORD PTR [rax+0x8],0x1   ; \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u043e\u043b\u0435 x \u0435\u0434\u0438\u043d\u0438\u0446\u0435\u0439 (\u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 increment \u0437\u0430\u0438\u043d\u043b\u0430\u0439\u043d\u0438\u043b\u0441\u044f)      ; \u0432\u0442\u043e\u0440\u043e\u0439 \u0432\u044b\u0437\u043e\u0432 increment     mov    rdi,rax                     ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 RDI     call   4005ca &lt;_ZN1B9incrementEv&gt;  ; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c increment      ; \u0432\u044b\u0437\u043e\u0432 decrement     mov    rax,QWORD PTR [rbx]   ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 RAX     mov    rdi,rbx               ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 RDI     call   QWORD PTR [rax+0x18]  ; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c decrement \u0447\u0435\u0440\u0435\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439      ; \u0432\u044b\u0437\u043e\u0432 get     mov    rax,QWORD PTR [rbx]   ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 RAX     mov    rdi,rbx               ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 RDI     call   QWORD PTR [rax+0x20]  ; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c get \u0447\u0435\u0440\u0435\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 (\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 EAX)      ; \u0432\u044b\u0437\u043e\u0432 printf     mov    esi,eax              ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 b.get() \u0432 ESI     mov    edi,0x400620         ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441 \u0441\u0442\u0440\u043e\u043a\u0438 &quot;%s\\n&quot; \u0432 EDI     mov    eax,0x0     call   400520 &lt;printf@plt&gt;  ; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c printf      ; \u0432\u044b\u0437\u043e\u0432 exit     mov    edi,0x0            ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u0434 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 EDI     call   400370 &lt;exit@plt&gt;  ; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c exit<\/code><\/pre>\n<p>  <\/p>\n<h5>\u0412\u0435\u0440\u0441\u0438\u044f 3<\/h5>\n<p>\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 .hpp \u0438 .cpp \u0444\u0430\u0439\u043b<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u043a\u043e\u0434<\/b>                         <\/p>\n<div class=\"spoiler_text\"><b>a.hpp<\/b><\/p>\n<pre><code class=\"plaintext\">#pragma once  class A { public: \tvirtual ~A();  \tvirtual void increment() = 0; \tvirtual void decrement() = 0; \tvirtual int get() = 0; }; <\/code><\/pre>\n<p>  <b>a.cpp<\/b><\/p>\n<pre><code class=\"plaintext\">#include &quot;a.hpp&quot;  A::~A() { } <\/code><\/pre>\n<p>  <b>b.hpp<\/b><\/p>\n<pre><code class=\"plaintext\">#pragma once  #include &quot;a.hpp&quot;  class B : public A { public: \tB(); \tvirtual void increment(); \tvirtual void decrement(); \tvirtual int get(); private: \tint x; }; <\/code><\/pre>\n<p>  <b>b.cpp<\/b><\/p>\n<pre><code class=\"plaintext\">#include &quot;b.hpp&quot;  B::B() : x(0) { }  void B::increment() { \tx++; }  void B::decrement() { \tx--; }  int B::get() { \treturn x; } <\/code><\/pre>\n<p>  <b>test.cpp<\/b><\/p>\n<pre><code class=\"plaintext\">#include &quot;b.hpp&quot;  extern &quot;C&quot; {  int printf(const char * format, ...); void exit(int status);  void _start() { \tB b; \tb.increment(); \tb.increment(); \tb.decrement(); \tprintf(&quot;%d\\n&quot;, b.get()); \texit(0); }  } <\/code><\/pre>\n<\/div><\/div>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: \u043e\u0431\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0434\u0435\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u043e \u043d\u0435 \u0441\u043c\u043e\u0433\u043b\u0438 \u0438\u0445 \u0437\u0430\u0438\u043d\u043b\u0430\u0439\u043d\u0438\u0442\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u0445 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438:  <\/p>\n<pre><code class=\"plaintext\">&lt;_start&gt;:     push   rbx     sub    rsp,0x10     ; \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c \u043f\u044f\u043c\u044f\u0442\u044c \u043d\u0430 \u0441\u0442\u0435\u043a\u0435      ; \u0432\u044b\u0437\u043e\u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430     lea    rbx,[rsp]           ; \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 RBX     mov    rdi,rbx             ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 RDI     call   400720 &lt;_ZN1BC1Ev&gt;  ; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440      ; \u0432\u044b\u0437\u043e\u0432 increment     mov    rdi,rbx                     ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 RDI     call   400740 &lt;_ZN1B9incrementEv&gt;  ; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c increment      ; \u0432\u044b\u0437\u043e\u0432 increment     lea    rdi,[rsp]                   ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 RDI     call   400740 &lt;_ZN1B9incrementEv&gt;  ; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c increment      ; \u0432\u044b\u0437\u043e\u0432 decrement     lea    rdi,[rsp]                   ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 RDI     call   400750 &lt;_ZN1B9decrementEv&gt;  ; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c decrement      ; \u0432\u044b\u0437\u043e\u0432 get     lea    rdi,[rsp]             ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 RDI     call   400760 &lt;_ZN1B3getEv&gt;  ; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c get      ; \u0432\u044b\u0437\u043e\u0432 printf     mov    edi,0x400820         ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441 \u0441\u0442\u0440\u043e\u043a\u0438 &quot;%s\\n&quot; \u0432 EDI     mov    esi,eax              ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 b.get() \u0432 ESI     xor    al,al     call   4005d0 &lt;printf@plt&gt;  ; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c printf      ; \u0432\u044b\u0437\u043e\u0432 exit     xor    edi,edi            ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u0434 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 EDI     call   4005e0 &lt;exit@plt&gt;  ; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c exit<\/code><\/pre>\n<p>  <\/p>\n<h5>\u0412\u0435\u0440\u0441\u0438\u044f 4<\/h5>\n<p>\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 .hpp \u0438 .cpp \u0444\u0430\u0439\u043b, <a href=\"http:\/\/ru.wikipedia.org\/wiki\/%D0%9C%D0%B5%D0%B6%D0%BF%D1%80%D0%BE%D1%86%D0%B5%D0%B4%D1%83%D1%80%D0%BD%D0%B0%D1%8F_%D0%BE%D0%BF%D1%82%D0%B8%D0%BC%D0%B8%D0%B7%D0%B0%D1%86%D0%B8%D1%8F\" rel=\"nofollow\">LTO<\/a> (Link Time Optimization, \u043e\u043d\u0430 \u0436\u0435 Interprocedural optimization, \u0444\u043b\u0430\u0433 <code>-flto<\/code>)<br \/>  \u041a\u043e\u0434 \u0442\u043e\u0442 \u0436\u0435, \u0447\u0442\u043e \u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435<br \/>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: clang \u0434\u0435\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b \u0438 \u0437\u0430\u0438\u043d\u043b\u0430\u0439\u043d\u0438\u043b \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b (\u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0439 \u043a\u043e\u0434 \u043a\u0430\u043a \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 1), gcc \u043f\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u0437\u0430\u0438\u043d\u043b\u0430\u0439\u043d\u0438\u043b \u0432\u0441\u0451 \u043a\u0440\u043e\u043c\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430:  <\/p>\n<pre><code class=\"plaintext\">&lt;_start&gt;:     push   rbx     sub    rsp,0x10  ; \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c \u043f\u044f\u043c\u044f\u0442\u044c \u043d\u0430 \u0441\u0442\u0435\u043a\u0435      ; \u0432\u044b\u0437\u043e\u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430     mov    rdi,rsp                  ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 RDI     call   400660 &lt;_ZN1BC1Ev.2444&gt;  ; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440      ; \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044f x     mov    eax,DWORD PTR [rsp+0x8]  ; \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0441\u0442\u0430\u0440\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044f x (0)     lea    esi,[rax+0x1]            ; \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u043d\u0435 1     mov    DWORD PTR [rsp+0x8],esi  ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442      ; \u0432\u044b\u0437\u043e\u0432 printf     mov    edi,0x400700         ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441 \u0441\u0442\u0440\u043e\u043a\u0438 &quot;%s\\n&quot; \u0432 EDI     mov    eax,0x0              ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 b.get() \u0432 ESI     call   4005f0 &lt;printf@plt&gt;  ; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c printf      ; \u0432\u044b\u0437\u043e\u0432 exit     mov    edi,0x0            ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u0434 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 EDI     call   400620 &lt;exit@plt&gt;  ; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c exit<\/code><\/pre>\n<h5>\u0412\u0435\u0440\u0441\u0438\u044f 5<\/h5>\n<p>\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 .hpp \u0438 .cpp \u0444\u0430\u0439\u043b, LTO, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0447\u0435\u0440\u0435\u0437 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u043a\u043e\u0434<\/b>                         <\/p>\n<div class=\"spoiler_text\"><b>a.hpp<\/b><\/p>\n<pre><code class=\"plaintext\">#pragma once  class A { public: \tvirtual ~A();  \tvirtual void increment() = 0; \tvirtual void decrement() = 0; \tvirtual int get() = 0; }; <\/code><\/pre>\n<p>  <b>a.cpp<\/b><\/p>\n<pre><code class=\"plaintext\">#include &quot;a.hpp&quot;  A::~A() { } <\/code><\/pre>\n<p>  <b>b.hpp<\/b><\/p>\n<pre><code class=\"plaintext\">#pragma once  #include &quot;a.hpp&quot;  class B : public A { public: \tB(); \tvirtual void increment(); \tvirtual void decrement(); \tvirtual int get(); private: \tint x; }; <\/code><\/pre>\n<p>  <b>b.cpp<\/b><\/p>\n<pre><code class=\"plaintext\">#include &quot;b.hpp&quot;  B::B() : x(0) { }  void B::increment() { \tx++; }  void B::decrement() { \tx--; }  int B::get() { \treturn x; } <\/code><\/pre>\n<p>  <b>test.cpp<\/b><\/p>\n<pre><code class=\"plaintext\">#include &quot;b.hpp&quot;  extern &quot;C&quot; {  int printf(const char * format, ...); void exit(int status);  void _start() { \tA * a = new B; \ta-&gt;increment(); \ta-&gt;increment(); \ta-&gt;decrement(); \tprintf(&quot;%d\\n&quot;, a-&gt;get()); \texit(0); }  } <\/code><\/pre>\n<\/div><\/div>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: \u0438 gcc, \u0438 clang \u0441\u043c\u043e\u0433\u043b\u0438 \u0434\u0435\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 increment:  <\/p>\n<pre><code class=\"plaintext\">&lt;_start&gt;:     push   rbx      ; \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438     mov    edi,0x10            ; \u043a\u043e\u043b-\u0432\u043e \u0431\u0430\u0439\u0442 (16)     call   400480 &lt;_Znwm@plt&gt;  ; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0432\u044b\u0434\u0435\u043b\u044f\u044e\u0449\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c (\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0432 RAX)     mov    rbx,rax             ; \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 RBX      ; \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440     mov    QWORD PTR [rbx],0x4005b0  ; \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439     mov    DWORD PTR [rbx+0x8],0x0   ; \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u043e\u043b\u0435 x      ; \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 increment     mov    rdi,rbx                     ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 RDI     call   400520 &lt;_ZN1B9incrementEv&gt;  ; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c increment      ; \u0432\u0442\u043e\u0440\u043e\u0439 \u0432\u044b\u0437\u043e\u0432 increment     mov    rax,QWORD PTR [rbx]   ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 RAX     mov    rdi,rbx               ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 RDI     call   QWORD PTR [rax+0x10]  ; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c increment      ; \u0432\u044b\u0437\u043e\u0432 decrement     mov    rax,QWORD PTR [rbx]   ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 RAX     mov    rdi,rbx               ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 RDI     call   QWORD PTR [rax+0x18]  ; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c decrement      ; \u0432\u044b\u0437\u043e\u0432 get     mov    rax,QWORD PTR [rbx]   ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 RAX     mov    rdi,rbx               ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 RDI     call   QWORD PTR [rax+0x20]  ; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c get      ; \u0432\u044b\u0437\u043e\u0432 printf     mov    edi,0x400570         ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441 \u0441\u0442\u0440\u043e\u043a\u0438 &quot;%s\\n&quot; \u0432 EDI     mov    esi,eax              ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 b.get() \u0432 ESI     xor    al,al     call   400490 &lt;printf@plt&gt;  ; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c printf      ; \u0432\u044b\u0437\u043e\u0432 exit     xor    edi,edi            ; \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u0434 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 EDI     pop    rbx     jmp    4004a0 &lt;exit@plt&gt;  ; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c exit<\/code><\/pre>\n<p>  <\/p>\n<h4>\u0412\u044b\u0432\u043e\u0434\u044b<\/h4>\n<ul>\n<li>\u041d\u0430\u0438\u043b\u0443\u0447\u0448\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0432 \u043e\u0434\u043d\u043e\u0439 \u0435\u0434\u0438\u043d\u0438\u0446\u0435 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438<\/li>\n<li>\u0412\u043e \u0432\u0441\u0435\u0445 \u0442\u0435\u0441\u0442\u0430\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b clang \u043d\u0435 \u0445\u0443\u0436\u0435 \u0438\u043b\u0438 \u043b\u0443\u0447\u0448\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 gcc<\/li>\n<\/ul>\n<p>  \u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438: <a href=\"https:\/\/github.com\/alkedr\/devirtualize-test\" rel=\"nofollow\">github.com\/alkedr\/devirtualize-test<\/a><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/511174\/\"> https:\/\/habr.com\/ru\/post\/511174\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/511174\/\">\n<h4>\u0427\u0442\u043e \u044d\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0442\u0430\u043a\u043e\u0435<\/h4>\n<p>\u0414\u0435\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f (devirtualization) \u2014 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0415\u0441\u043b\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0442\u043e\u0447\u043d\u043e \u0437\u043d\u0430\u0435\u0442 \u0442\u0438\u043f \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439.<br \/>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0441 \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b gcc \u0438 clang.<\/p>\n<h4>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/h4>\n<p>\u0412\u0441\u0435 \u0442\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u043d\u0430 Arch Linux x86-64. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c gcc 4.8.2 \u0438 clang 3.3.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-307016","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/307016","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=307016"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/307016\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=307016"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=307016"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=307016"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}