; Listing generated by Microsoft (R) Optimizing Compiler Version 19.15.26729.0 

include listing.inc

INCLUDELIB LIBCMT
INCLUDELIB OLDNAMES

PUBLIC	?g@@3Usafetls@@A				; g
PUBLIC	?h@@3HA						; h
_TLS	SEGMENT
?h@@3HA	DD	012345H					; h
	ORG $+4
?g@@3Usafetls@@A DD 098765H				; g
	ORG $+8
_TLS	ENDS
PUBLIC	?value@safetls@@QEAAHXZ				; safetls::value
PUBLIC	?func@@YAHXZ					; func
PUBLIC	?func2@@YAHXZ					; func2
PUBLIC	main
EXTRN	_tls_index:DWORD
;	COMDAT pdata
pdata	SEGMENT
$pdata$?func@@YAHXZ DD imagerel $LN3
	DD	imagerel $LN3+43
	DD	imagerel $unwind$?func@@YAHXZ
pdata	ENDS
pdata	SEGMENT
$pdata$main DD	imagerel $LN3
	DD	imagerel $LN3+31
	DD	imagerel $unwind$main
pdata	ENDS
xdata	SEGMENT
$unwind$main DD	010401H
	DD	06204H
xdata	ENDS
;	COMDAT xdata
xdata	SEGMENT
$unwind$?func@@YAHXZ DD 010401H
	DD	04204H
xdata	ENDS
; Function compile flags: /Odtp
_TEXT	SEGMENT
tv64 = 32
main	PROC
; File c:\users\quist\appdata\local\temp\compiler-explorer-compiler118927-25960-1r4bdyh.ql7u\example.cpp
; Line 26
$LN3:
	sub	rsp, 56					; 00000038H
; Line 27
	call	?func@@YAHXZ				; func
	mov	DWORD PTR tv64[rsp], eax
	call	?func2@@YAHXZ				; func2
	mov	ecx, DWORD PTR tv64[rsp]
	add	ecx, eax
	mov	eax, ecx
; Line 28
	add	rsp, 56					; 00000038H
	ret	0
main	ENDP
_TEXT	ENDS
; Function compile flags: /Odtp
;	COMDAT ?func2@@YAHXZ
_TEXT	SEGMENT
?func2@@YAHXZ PROC					; func2, COMDAT
; File c:\users\quist\appdata\local\temp\compiler-explorer-compiler118927-25960-1r4bdyh.ql7u\example.cpp
; Line 22
	mov	eax, OFFSET FLAT:?h@@3HA		; h
	mov	eax, eax
	mov	ecx, DWORD PTR _tls_index
	mov	rdx, QWORD PTR gs:88
	mov	rcx, QWORD PTR [rdx+rcx*8]
	mov	eax, DWORD PTR [rax+rcx]
; Line 23
	ret	0
?func2@@YAHXZ ENDP					; func2
_TEXT	ENDS
; Function compile flags: /Odtp
;	COMDAT ?func@@YAHXZ
_TEXT	SEGMENT
?func@@YAHXZ PROC					; func, COMDAT
; File c:\users\quist\appdata\local\temp\compiler-explorer-compiler118927-25960-1r4bdyh.ql7u\example.cpp
; Line 16
$LN3:
	sub	rsp, 40					; 00000028H
; Line 17
	mov	eax, OFFSET FLAT:?g@@3Usafetls@@A	; g
	mov	eax, eax
	mov	ecx, DWORD PTR _tls_index
	mov	rdx, QWORD PTR gs:88
	add	rax, QWORD PTR [rdx+rcx*8]
	mov	rcx, rax
	call	?value@safetls@@QEAAHXZ			; safetls::value
; Line 18
	add	rsp, 40					; 00000028H
	ret	0
?func@@YAHXZ ENDP					; func
_TEXT	ENDS
; Function compile flags: /Odtp
;	COMDAT ?value@safetls@@QEAAHXZ
_TEXT	SEGMENT
this$ = 8
?value@safetls@@QEAAHXZ PROC				; safetls::value, COMDAT
; File c:\users\quist\appdata\local\temp\compiler-explorer-compiler118927-25960-1r4bdyh.ql7u\example.cpp
; Line 9
	mov	QWORD PTR [rsp+8], rcx
	mov	rax, QWORD PTR this$[rsp]
	mov	rcx, QWORD PTR this$[rsp]
	mov	ecx, DWORD PTR [rcx+4]
	mov	eax, DWORD PTR [rax]
	sub	eax, ecx
	mov	rcx, QWORD PTR this$[rsp]
	add	eax, DWORD PTR [rcx+8]
	ret	0
?value@safetls@@QEAAHXZ ENDP				; safetls::value
_TEXT	ENDS
END
