Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save senyai/3e4b6a9118418d1536476218459cd12d to your computer and use it in GitHub Desktop.
Save senyai/3e4b6a9118418d1536476218459cd12d to your computer and use it in GitHub Desktop.
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.00.24215.1
TITLE c:\users\senyai\documents\visual studio 2015\projects\cpp_test_2016\cpp_test_2016\cpp_test_2016.cpp
.686P
.XMM
include listing.inc
.model flat
INCLUDELIB OLDNAMES
PUBLIC ??_C@_02GIPFHKNO@OK?$AA@ ; `string'
PUBLIC ??_C@_07PFIMAAAI@WTF?$DP?$DP?$CB?$CB?$AA@ ; `string'
PUBLIC ??_C@_03OFAPEBGM@?$CFs?6?$AA@ ; `string'
PUBLIC ??_C@_0BA@IANMDBIN@magic?5?$DN?5?$CF0?410f?6?$AA@ ; `string'
PUBLIC ?_OptionsStorage@?1??__local_stdio_printf_options@@9@4_KA ; `__local_stdio_printf_options'::`2'::_OptionsStorage
EXTRN __imp____stdio_common_vfprintf:PROC
EXTRN __imp____acrt_iob_func:PROC
EXTRN @__security_check_cookie@4:PROC
; COMDAT ?_OptionsStorage@?1??__local_stdio_printf_options@@9@4_KA
_BSS SEGMENT
?_OptionsStorage@?1??__local_stdio_printf_options@@9@4_KA DQ 01H DUP (?) ; `__local_stdio_printf_options'::`2'::_OptionsStorage
_BSS ENDS
; COMDAT ??_C@_0BA@IANMDBIN@magic?5?$DN?5?$CF0?410f?6?$AA@
CONST SEGMENT
??_C@_0BA@IANMDBIN@magic?5?$DN?5?$CF0?410f?6?$AA@ DB 'magic = %0.10f', 0aH
DB 00H ; `string'
CONST ENDS
; COMDAT ??_C@_03OFAPEBGM@?$CFs?6?$AA@
CONST SEGMENT
??_C@_03OFAPEBGM@?$CFs?6?$AA@ DB '%s', 0aH, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_07PFIMAAAI@WTF?$DP?$DP?$CB?$CB?$AA@
CONST SEGMENT
??_C@_07PFIMAAAI@WTF?$DP?$DP?$CB?$CB?$AA@ DB 'WTF??!!', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_02GIPFHKNO@OK?$AA@
CONST SEGMENT
??_C@_02GIPFHKNO@OK?$AA@ DB 'OK', 00H ; `string'
CONST ENDS
PUBLIC ??$__vcrt_va_start_verify_argument_type@QBD@@YAXXZ ; __vcrt_va_start_verify_argument_type<char const * const>
PUBLIC _main
PUBLIC _printf
PUBLIC __vfprintf_l
PUBLIC ___local_stdio_printf_options
PUBLIC __xmm@41f00000000000000000000000000000
PUBLIC __xmm@4f8000004f8000004f8000004f800000
EXTRN __fltused:DWORD
; COMDAT __xmm@4f8000004f8000004f8000004f800000
CONST SEGMENT
__xmm@4f8000004f8000004f8000004f800000 DB 00H, 00H, 080H, 'O', 00H, 00H, 080H
DB 'O', 00H, 00H, 080H, 'O', 00H, 00H, 080H, 'O'
CONST ENDS
; COMDAT __xmm@41f00000000000000000000000000000
CONST SEGMENT
__xmm@41f00000000000000000000000000000 DB 00H, 00H, 00H, 00H, 00H, 00H, 00H
DB 00H, 00H, 00H, 00H, 00H, 00H, 00H, 0f0H, 'A'
CONST ENDS
; Function compile flags: /Ogtp
; File c:\users\senyai\documents\visual studio 2015\projects\cpp_test_2016\cpp_test_2016\cpp_test_2016.cpp
; COMDAT _main
_TEXT SEGMENT
_arr_dst$ = -1040 ; size = 516
_arr$ = -520 ; size = 516
_main PROC ; COMDAT
; 7 : {
00000 55 push ebp
00001 8b ec mov ebp, esp
00003 83 e4 c0 and esp, -64 ; ffffffc0H
00006 0f 28 1d 00 00
00 00 movaps xmm3, XMMWORD PTR __xmm@4f8000004f8000004f8000004f800000
0000d 81 ec 3c 04 00
00 sub esp, 1084 ; 0000043cH
; 8 : uint32_t value = 2570980487;
; 9 :
; 10 : uint32_t arr[ARR_SIZE];
; 11 : for (int x = 0; x < ARR_SIZE; ++x)
; 12 : arr[x] = value;
00013 ba 81 00 00 00 mov edx, 129 ; 00000081H
00018 b8 87 0c 3e 99 mov eax, -1723986809 ; 993e0c87H
0001d 8b ca mov ecx, edx
0001f 0f 57 d2 xorps xmm2, xmm2
00022 57 push edi
00023 8d bc 24 38 02
00 00 lea edi, DWORD PTR _arr$[esp+1088]
0002a f3 ab rep stosd
; 13 :
; 14 : float arr_dst[ARR_SIZE];
; 15 : for (int x = 0; x < ARR_SIZE; ++x)
0002c 33 c9 xor ecx, ecx
0002e 66 90 npad 2
$LL7@main:
; 16 : {
; 17 : arr_dst[x] = static_cast<float>(arr[x]);
00030 0f 10 84 8c 38
02 00 00 movups xmm0, XMMWORD PTR _arr$[esp+ecx*4+1088]
00038 0f 5b c8 cvtdq2ps xmm1, xmm0
0003b 0f 28 c1 movaps xmm0, xmm1
0003e 0f c2 c2 01 cmpltps xmm0, xmm2
00042 0f 54 c3 andps xmm0, xmm3
00045 0f 58 c1 addps xmm0, xmm1
00048 0f 11 44 8c 30 movups XMMWORD PTR _arr_dst$[esp+ecx*4+1088], xmm0
0004d 0f 10 84 8c 48
02 00 00 movups xmm0, XMMWORD PTR _arr$[esp+ecx*4+1104]
00055 0f 5b c8 cvtdq2ps xmm1, xmm0
00058 0f 28 c1 movaps xmm0, xmm1
0005b 0f c2 c2 01 cmpltps xmm0, xmm2
0005f 0f 54 c3 andps xmm0, xmm3
00062 0f 58 c1 addps xmm0, xmm1
00065 0f 11 44 8c 40 movups XMMWORD PTR _arr_dst$[esp+ecx*4+1104], xmm0
0006a 83 c1 08 add ecx, 8
0006d 81 f9 80 00 00
00 cmp ecx, 128 ; 00000080H
00073 72 bb jb SHORT $LL7@main
00075 3b ca cmp ecx, edx
00077 0f 83 f1 00 00
00 jae $LN21@main
0007d 2b d1 sub edx, ecx
; 13 :
; 14 : float arr_dst[ARR_SIZE];
; 15 : for (int x = 0; x < ARR_SIZE; ++x)
0007f 83 fa 04 cmp edx, 4
00082 0f 82 a8 00 00
00 jb $LC22@main
00088 0f 1f 84 00 00
00 00 00 npad 8
$LL23@main:
; 16 : {
; 17 : arr_dst[x] = static_cast<float>(arr[x]);
00090 8b 84 8c 38 02
00 00 mov eax, DWORD PTR _arr$[esp+ecx*4+1088]
00097 66 0f 6e c0 movd xmm0, eax
0009b f3 0f e6 c0 cvtdq2pd xmm0, xmm0
0009f c1 e8 1f shr eax, 31 ; 0000001fH
000a2 f2 0f 58 04 c5
00 00 00 00 addsd xmm0, QWORD PTR __xmm@41f00000000000000000000000000000[eax*8]
000ab 8b 84 8c 3c 02
00 00 mov eax, DWORD PTR _arr$[esp+ecx*4+1092]
000b2 66 0f 5a c0 cvtpd2ps xmm0, xmm0
000b6 f3 0f 11 44 8c
30 movss DWORD PTR _arr_dst$[esp+ecx*4+1088], xmm0
000bc 66 0f 6e c0 movd xmm0, eax
000c0 f3 0f e6 c0 cvtdq2pd xmm0, xmm0
000c4 c1 e8 1f shr eax, 31 ; 0000001fH
000c7 f2 0f 58 04 c5
00 00 00 00 addsd xmm0, QWORD PTR __xmm@41f00000000000000000000000000000[eax*8]
000d0 8b 84 8c 40 02
00 00 mov eax, DWORD PTR _arr$[esp+ecx*4+1096]
000d7 66 0f 5a c0 cvtpd2ps xmm0, xmm0
000db f3 0f 11 44 8c
34 movss DWORD PTR _arr_dst$[esp+ecx*4+1092], xmm0
000e1 66 0f 6e c0 movd xmm0, eax
000e5 f3 0f e6 c0 cvtdq2pd xmm0, xmm0
000e9 c1 e8 1f shr eax, 31 ; 0000001fH
000ec f2 0f 58 04 c5
00 00 00 00 addsd xmm0, QWORD PTR __xmm@41f00000000000000000000000000000[eax*8]
000f5 8b 84 8c 44 02
00 00 mov eax, DWORD PTR _arr$[esp+ecx*4+1100]
000fc 66 0f 5a c0 cvtpd2ps xmm0, xmm0
00100 f3 0f 11 44 8c
38 movss DWORD PTR _arr_dst$[esp+ecx*4+1096], xmm0
00106 66 0f 6e c0 movd xmm0, eax
0010a f3 0f e6 c0 cvtdq2pd xmm0, xmm0
0010e c1 e8 1f shr eax, 31 ; 0000001fH
00111 f2 0f 58 04 c5
00 00 00 00 addsd xmm0, QWORD PTR __xmm@41f00000000000000000000000000000[eax*8]
0011a 66 0f 5a c0 cvtpd2ps xmm0, xmm0
0011e f3 0f 11 44 8c
3c movss DWORD PTR _arr_dst$[esp+ecx*4+1100], xmm0
00124 83 c1 04 add ecx, 4
00127 83 f9 7e cmp ecx, 126 ; 0000007eH
0012a 0f 82 60 ff ff
ff jb $LL23@main
$LC22@main:
; 13 :
; 14 : float arr_dst[ARR_SIZE];
; 15 : for (int x = 0; x < ARR_SIZE; ++x)
00130 81 f9 81 00 00
00 cmp ecx, 129 ; 00000081H
00136 73 36 jae SHORT $LN21@main
00138 0f 1f 84 00 00
00 00 00 npad 8
$LC15@main:
; 16 : {
; 17 : arr_dst[x] = static_cast<float>(arr[x]);
00140 8b 84 8c 38 02
00 00 mov eax, DWORD PTR _arr$[esp+ecx*4+1088]
00147 66 0f 6e c0 movd xmm0, eax
0014b f3 0f e6 c0 cvtdq2pd xmm0, xmm0
0014f c1 e8 1f shr eax, 31 ; 0000001fH
00152 f2 0f 58 04 c5
00 00 00 00 addsd xmm0, QWORD PTR __xmm@41f00000000000000000000000000000[eax*8]
0015b 66 0f 5a c0 cvtpd2ps xmm0, xmm0
0015f f3 0f 11 44 8c
30 movss DWORD PTR _arr_dst$[esp+ecx*4+1088], xmm0
00165 41 inc ecx
00166 81 f9 81 00 00
00 cmp ecx, 129 ; 00000081H
0016c 72 d2 jb SHORT $LC15@main
$LN21@main:
; 18 : }
; 19 :
; 20 : printf("%s\n", arr_dst[ARR_SIZE - 1] == arr_dst[ARR_SIZE - 2] ? "OK" : "WTF??!!");
0016e f3 0f 10 84 24
30 02 00 00 movss xmm0, DWORD PTR _arr_dst$[esp+1600]
00177 0f 2e 84 24 2c
02 00 00 ucomiss xmm0, DWORD PTR _arr_dst$[esp+1596]
0017f 9f lahf
00180 f6 c4 44 test ah, 68 ; 00000044H
00183 b8 00 00 00 00 mov eax, OFFSET ??_C@_02GIPFHKNO@OK?$AA@
00188 7b 05 jnp SHORT $LN10@main
0018a b8 00 00 00 00 mov eax, OFFSET ??_C@_07PFIMAAAI@WTF?$DP?$DP?$CB?$CB?$AA@
$LN10@main:
0018f 50 push eax
00190 68 00 00 00 00 push OFFSET ??_C@_03OFAPEBGM@?$CFs?6?$AA@
00195 e8 00 00 00 00 call _printf
0019a f3 0f 10 84 24
34 02 00 00 movss xmm0, DWORD PTR _arr_dst$[esp+1604]
; 21 :
; 22 : printf("magic = %0.10f\n", arr_dst[ARR_SIZE - 2]);
001a3 0f 5a c0 cvtps2pd xmm0, xmm0
001a6 f2 0f 11 04 24 movsd QWORD PTR [esp], xmm0
001ab 68 00 00 00 00 push OFFSET ??_C@_0BA@IANMDBIN@magic?5?$DN?5?$CF0?410f?6?$AA@
001b0 e8 00 00 00 00 call _printf
001b5 f3 0f 10 84 24
3c 02 00 00 movss xmm0, DWORD PTR _arr_dst$[esp+1612]
; 23 : printf("magic = %0.10f\n", arr_dst[ARR_SIZE - 1]);
001be 83 c4 04 add esp, 4
001c1 0f 5a c0 cvtps2pd xmm0, xmm0
001c4 f2 0f 11 04 24 movsd QWORD PTR [esp], xmm0
001c9 68 00 00 00 00 push OFFSET ??_C@_0BA@IANMDBIN@magic?5?$DN?5?$CF0?410f?6?$AA@
001ce e8 00 00 00 00 call _printf
001d3 83 c4 0c add esp, 12 ; 0000000cH
; 24 : return 0;
001d6 33 c0 xor eax, eax
; 25 : }
001d8 5f pop edi
001d9 8b e5 mov esp, ebp
001db 5d pop ebp
001dc c3 ret 0
_main ENDP
_TEXT ENDS
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment