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

	TITLE	quicklz.c
	.386P
include listing.inc
if @Version gt 510
.model FLAT
else
_TEXT	SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT	ENDS
_DATA	SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA	ENDS
CONST	SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST	ENDS
_BSS	SEGMENT DWORD USE32 PUBLIC 'BSS'
_BSS	ENDS
$$SYMBOLS	SEGMENT BYTE USE32 'DEBSYM'
$$SYMBOLS	ENDS
_TLS	SEGMENT DWORD USE32 PUBLIC 'TLS'
_TLS	ENDS
FLAT	GROUP _DATA, CONST, _BSS
	ASSUME	CS: FLAT, DS: FLAT, SS: FLAT
endif

INCLUDELIB LIBC
INCLUDELIB OLDNAMES

PUBLIC	_qlz_get_setting
; Function compile flags: /Ogty
_TEXT	SEGMENT
_setting$ = 8						; size = 4
_qlz_get_setting PROC NEAR
; File c:\worktemp\_kaze_kazuya_r17++_lasse-ariya-oberhumer-okumura_(on_osho)_32_bit_64_bit\kazuya17++\quicklz.c
; Line 30
	mov	eax, DWORD PTR _setting$[esp-4]
	cmp	eax, 9
	ja	SHORT $L837
	jmp	DWORD PTR $L1112[eax*4]
$L840:
; Line 32
	mov	eax, 3
; Line 46
	ret	0
$L841:
; Line 33
	mov	eax, 266256				; 00041010H
; Line 46
	ret	0
$L843:
; Line 34
	mov	eax, 16					; 00000010H
; Line 46
	ret	0
$L846:
; Line 41
	mov	eax, 1
; Line 46
	ret	0
$L847:
; Line 42
	mov	eax, 4
; Line 46
	ret	0
$L848:
; Line 43
	xor	eax, eax
; Line 46
	ret	0
$L837:
; Line 45
	or	eax, -1
; Line 46
	ret	0
	npad	3
$L1112:
	DD	$L840
	DD	$L841
	DD	$L843
	DD	$L848
	DD	$L837
	DD	$L837
	DD	$L848
	DD	$L846
	DD	$L847
	DD	$L848
_qlz_get_setting ENDP
; Function compile flags: /Ogty
_reset_state PROC NEAR
; _hash_counter$ = edx
; Line 49
	push	edi
; Line 50
	mov	ecx, 1024				; 00000400H
	xor	eax, eax
	mov	edi, edx
	rep stosd
	pop	edi
; Line 51
	ret	0
_reset_state ENDP
; Function compile flags: /Ogty
_hash_func PROC NEAR
; _i$ = ecx
; Line 58
	mov	eax, ecx
	shr	eax, 12					; 0000000cH
	xor	eax, ecx
	and	eax, 4095				; 00000fffH
; Line 60
	ret	0
_hash_func ENDP
; Function compile flags: /Ogty
_src$ = 8						; size = 4
_fast_read PROC NEAR
; _bytes$ = eax
; Line 79
	cmp	eax, 1
	jb	SHORT $L863
	cmp	eax, 4
	ja	SHORT $L863
; Line 80
	mov	eax, DWORD PTR _src$[esp-4]
	mov	eax, DWORD PTR [eax]
; Line 84
	ret	0
$L863:
; Line 82
	xor	eax, eax
; Line 84
	ret	0
_fast_read ENDP
; Function compile flags: /Ogty
_fast_write PROC NEAR
; _f$ = edx
; _dst$ = ecx
; _bytes$ = eax
; Line 113
	dec	eax
	cmp	eax, 3
	ja	SHORT $L875
	jmp	DWORD PTR $L1117[eax*4]
$L878:
; Line 116
	mov	DWORD PTR [ecx], edx
; Line 129
	ret	0
$L882:
; Line 122
	mov	WORD PTR [ecx], dx
; Line 129
	ret	0
$L885:
; Line 125
	mov	BYTE PTR [ecx], dl
$L875:
; Line 129
	ret	0
	npad	1
$L1117:
	DD	$L885
	DD	$L882
	DD	$L878
	DD	$L878
_fast_write ENDP
; Function compile flags: /Ogty
_memcpy_up PROC NEAR
; _dst$ = eax
; _src$ = edx
; _n$ = esi
; Line 143
	xor	ecx, ecx
; Line 149
	sub	edx, eax
	push	edi
$L897:
	mov	edi, DWORD PTR [edx+eax]
	mov	DWORD PTR [eax], edi
	add	ecx, 3
	add	eax, 3
	cmp	ecx, esi
	jb	SHORT $L897
	pop	edi
; Line 151
	ret	0
_memcpy_up ENDP
; Function compile flags: /Ogty
_c$934 = -41						; size = 1
tv877 = -40						; size = 4
_matchlen$930 = -36					; size = 4
_dst$ = -32						; size = 4
_cword_val$ = -28					; size = 4
_cword_ptr$ = -24					; size = 4
_remaining$935 = -20					; size = 4
_offset2$928 = -16					; size = 4
_k$931 = -12						; size = 4
tv508 = -8						; size = 4
tv129 = -8						; size = 4
_last_byte$ = -4					; size = 4
_source$ = 8						; size = 4
_destination$ = 12					; size = 4
_size$ = 16						; size = 4
_hashtable$ = 20					; size = 4
_hash_counter$ = 24					; size = 4
_qlz_compress_core PROC NEAR
; Line 186
	sub	esp, 44					; 0000002cH
; Line 187
	mov	edx, DWORD PTR _source$[esp+40]
	mov	eax, DWORD PTR _size$[esp+40]
	push	ebx
	push	ebp
	push	esi
	lea	esi, DWORD PTR [edx+eax-1]
	push	edi
; Line 189
	mov	edi, DWORD PTR _destination$[esp+56]
; Line 192
	lea	eax, DWORD PTR [esi-10]
; Line 198
	cmp	edx, eax
	lea	ebx, DWORD PTR [edi+4]
	mov	ecx, -2147483648			; 80000000H
	mov	DWORD PTR _last_byte$[esp+60], esi
	mov	ebp, edx
	mov	DWORD PTR _cword_ptr$[esp+60], edi
	mov	DWORD PTR _dst$[esp+60], ebx
	mov	DWORD PTR _cword_val$[esp+60], ecx
	ja	$L1234
	mov	eax, ebx
	sub	eax, edi
	mov	DWORD PTR tv877[esp+60], eax
	jmp	SHORT $L923
$L1256:
; Line 187
	mov	edx, DWORD PTR _source$[esp+56]
	npad	6
$L923:
; Line 200
	test	cl, 1
	je	SHORT $L1245
; Line 203
	mov	eax, DWORD PTR _size$[esp+56]
	shr	eax, 2
	lea	edi, DWORD PTR [edx+eax*2]
	add	edi, eax
	cmp	ebp, edi
	jbe	SHORT $L1263
	mov	eax, ebp
	sub	eax, edx
	sar	eax, 5
	mov	edi, ebp
	sub	edi, eax
	mov	eax, DWORD PTR tv877[esp+60]
	sub	edi, edx
	cmp	eax, edi
	jg	$L1236
$L1263:
; Line 206
	mov	edx, DWORD PTR _cword_ptr$[esp+60]
; Line 209
	mov	eax, DWORD PTR tv877[esp+60]
	shr	ecx, 1
	or	ecx, -2147483648			; 80000000H
	mov	DWORD PTR _cword_ptr$[esp+60], ebx
	add	ebx, 4
	add	eax, 4
	mov	DWORD PTR [edx], ecx
	mov	DWORD PTR _dst$[esp+60], ebx
	mov	DWORD PTR tv877[esp+60], eax
; Line 210
	mov	DWORD PTR _cword_val$[esp+60], -2147483648 ; 80000000H
$L1245:
; Line 293
	mov	eax, esi
	sub	eax, ebp
	sub	eax, 3
	cmp	eax, 255				; 000000ffH
	jle	SHORT $L1121
	mov	DWORD PTR _remaining$935[esp+60], 255	; 000000ffH
	jmp	SHORT $L1122
$L1121:
	mov	eax, esi
	sub	eax, ebp
	sub	eax, 3
	mov	DWORD PTR _remaining$935[esp+60], eax
$L1122:
; Line 295
	mov	eax, DWORD PTR [ebp]
; Line 298
	mov	ecx, DWORD PTR _hash_counter$[esp+56]
; Line 301
	mov	edi, DWORD PTR _hashtable$[esp+56]
	mov	esi, eax
	shr	esi, 12					; 0000000cH
	xor	esi, eax
	and	esi, 4095				; 00000fffH
	mov	dl, BYTE PTR [esi+ecx]
	mov	ecx, esi
	shl	ecx, 6
	mov	edi, DWORD PTR [ecx+edi]
; Line 302
	lea	ecx, DWORD PTR [ebp-2]
	cmp	edi, ecx
	mov	BYTE PTR _c$934[esp+60], dl
	mov	DWORD PTR _offset2$928[esp+60], edi
	jae	SHORT $L1246
	test	dl, dl
	jbe	SHORT $L1246
	mov	edx, DWORD PTR [edi]
	xor	edx, eax
	test	edx, 16777215				; 00ffffffH
	jne	SHORT $L1246
; Line 305
	mov	al, BYTE PTR [edi+3]
	cmp	al, BYTE PTR [ebp+3]
	mov	edx, 3
	mov	DWORD PTR _matchlen$930[esp+60], edx
	jne	SHORT $L1260
; Line 308
	mov	cl, BYTE PTR [edi+4]
	mov	dl, BYTE PTR [ebp+4]
	cmp	cl, dl
	lea	eax, DWORD PTR [ebp+4]
	mov	DWORD PTR _matchlen$930[esp+60], 4
	jne	SHORT $L1257
	sub	edi, ebp
	npad	9
$L939:
	mov	edx, DWORD PTR _remaining$935[esp+60]
	mov	ecx, DWORD PTR _matchlen$930[esp+60]
	cmp	ecx, edx
	jae	SHORT $L1257
; Line 309
	mov	edx, ecx
	mov	cl, BYTE PTR [edi+eax+1]
	inc	edx
	inc	eax
	mov	DWORD PTR _matchlen$930[esp+60], edx
	cmp	cl, BYTE PTR [eax]
	je	SHORT $L939
; Line 312
	jmp	SHORT $L1257
$L1246:
; Line 313
	mov	DWORD PTR _matchlen$930[esp+60], 0
$L1257:
; Line 312
	mov	edx, DWORD PTR _matchlen$930[esp+60]
$L1260:
; Line 314
	movzx	eax, BYTE PTR _c$934[esp+60]
	mov	edi, 1
	mov	DWORD PTR _k$931[esp+60], edi
	mov	DWORD PTR tv508[esp+60], eax
	npad	4
$L942:
	cmp	eax, edi
	jbe	SHORT $L944
; Line 316
	mov	ecx, DWORD PTR _hashtable$[esp+56]
	mov	eax, esi
	shl	eax, 4
	add	eax, edi
	mov	eax, DWORD PTR [ecx+eax*4]
; Line 318
	mov	ecx, DWORD PTR [eax]
	xor	ecx, DWORD PTR [ebp]
	test	ecx, 16777215				; 00ffffffH
	jne	SHORT $L943
	lea	ecx, DWORD PTR [ebp-2]
	cmp	eax, ecx
	jae	SHORT $L943
; Line 324
	mov	bl, BYTE PTR [eax+3]
	cmp	bl, BYTE PTR [ebp+3]
	lea	ecx, DWORD PTR [ebp+3]
	mov	edi, 3
	jne	SHORT $L1252
	mov	edx, eax
	sub	edx, ebp
	npad	6
$L947:
	cmp	edi, DWORD PTR _remaining$935[esp+60]
	jae	SHORT $L1251
	mov	bl, BYTE PTR [edx+ecx+1]
; Line 325
	inc	edi
	inc	ecx
	cmp	bl, BYTE PTR [ecx]
	je	SHORT $L947
$L1251:
; Line 324
	mov	edx, DWORD PTR _matchlen$930[esp+60]
$L1252:
; Line 327
	cmp	edi, edx
	mov	ebx, DWORD PTR _dst$[esp+60]
	ja	SHORT $L950
	jne	SHORT $L943
	cmp	eax, DWORD PTR _offset2$928[esp+60]
	jbe	SHORT $L943
$L950:
; Line 332
	mov	DWORD PTR _offset2$928[esp+60], eax
; Line 333
	mov	DWORD PTR _matchlen$930[esp+60], edi
	mov	edx, edi
$L943:
	mov	edi, DWORD PTR _k$931[esp+60]
	mov	eax, DWORD PTR tv508[esp+60]
	inc	edi
	cmp	edi, 16					; 00000010H
	mov	DWORD PTR _k$931[esp+60], edi
	jb	SHORT $L942
$L944:
; Line 339
	and	eax, 15					; 0000000fH
	mov	ecx, esi
	shl	ecx, 4
	add	eax, ecx
	mov	ecx, DWORD PTR _hashtable$[esp+56]
	mov	DWORD PTR [ecx+eax*4], ebp
; Line 340
	mov	al, BYTE PTR _c$934[esp+60]
; Line 341
	mov	ecx, DWORD PTR _hash_counter$[esp+56]
	inc	al
; Line 344
	cmp	edx, 2
	mov	BYTE PTR [esi+ecx], al
	jbe	$L1255
	mov	esi, DWORD PTR _offset2$928[esp+60]
	mov	ecx, ebp
	sub	ecx, esi
	cmp	ecx, 131071				; 0001ffffH
	jge	$L1255
; Line 349
	cmp	edx, 1
	jbe	SHORT $L956
	dec	edx
	lea	esi, DWORD PTR [ebp+1]
	mov	DWORD PTR tv129[esp+60], edx
$L1248:
; Line 351
	mov	edx, DWORD PTR [esi]
; Line 353
	mov	edi, DWORD PTR _hash_counter$[esp+56]
	mov	eax, edx
	shr	eax, 12					; 0000000cH
	xor	eax, edx
	mov	edx, DWORD PTR _hash_counter$[esp+56]
	and	eax, 4095				; 00000fffH
	movzx	edx, BYTE PTR [eax+edx]
	mov	bl, dl
	inc	bl
	mov	BYTE PTR [eax+edi], bl
; Line 354
	shl	eax, 4
	and	edx, 15					; 0000000fH
	add	edx, eax
	mov	eax, DWORD PTR _hashtable$[esp+56]
	mov	DWORD PTR [eax+edx*4], esi
	mov	eax, DWORD PTR tv129[esp+60]
	inc	esi
	dec	eax
	mov	DWORD PTR tv129[esp+60], eax
	jne	SHORT $L1248
	mov	ebx, DWORD PTR _dst$[esp+60]
	mov	edx, DWORD PTR _matchlen$930[esp+60]
$L956:
; Line 357
	mov	eax, DWORD PTR _cword_val$[esp+60]
	shr	eax, 1
	or	eax, -2147483648			; 80000000H
; Line 358
	add	ebp, edx
; Line 360
	cmp	edx, 3
	mov	DWORD PTR _cword_val$[esp+60], eax
	jne	SHORT $L960
	cmp	ecx, 63					; 0000003fH
	ja	SHORT $L1243
; Line 363
	mov	eax, DWORD PTR tv877[esp+60]
	shl	cl, 2
	mov	BYTE PTR [ebx], cl
	inc	ebx
	inc	eax
	mov	DWORD PTR tv877[esp+60], eax
; Line 365
	jmp	$L1264
$L1243:
	cmp	ecx, 16383				; 00003fffH
	ja	SHORT $L1244
; Line 369
	mov	eax, DWORD PTR tv877[esp+60]
	shl	ecx, 2
	or	ecx, 1
	mov	WORD PTR [ebx], cx
	add	ebx, 2
	add	eax, 2
	mov	DWORD PTR tv877[esp+60], eax
; Line 371
	jmp	$L1264
$L960:
	cmp	edx, 18					; 00000012H
	ja	SHORT $L964
$L1244:
	cmp	ecx, 1023				; 000003ffH
	ja	SHORT $L964
; Line 375
	mov	eax, DWORD PTR tv877[esp+60]
	shl	ecx, 4
	add	edx, -3					; fffffffdH
	or	ecx, edx
	shl	ecx, 2
	or	ecx, 2
	mov	WORD PTR [ebx], cx
	add	ebx, 2
	add	eax, 2
	mov	DWORD PTR tv877[esp+60], eax
; Line 378
	jmp	SHORT $L1264
$L964:
	cmp	edx, 33					; 00000021H
; Line 382
	mov	eax, DWORD PTR tv877[esp+60]
	ja	SHORT $L967
	shl	ecx, 5
	add	edx, -2					; fffffffeH
	or	ecx, edx
	shl	ecx, 2
	or	ecx, 3
	mov	DWORD PTR [ebx], ecx
	add	ebx, 3
	add	eax, 3
	mov	DWORD PTR tv877[esp+60], eax
; Line 384
	jmp	SHORT $L1264
$L967:
; Line 387
	shl	ecx, 8
	add	edx, -3					; fffffffdH
	or	ecx, edx
	shl	ecx, 7
	or	ecx, 3
	mov	DWORD PTR [ebx], ecx
; Line 388
	add	ebx, 4
	add	eax, 4
	mov	DWORD PTR tv877[esp+60], eax
; Line 391
	jmp	SHORT $L1264
$L1255:
; Line 393
	mov	cl, BYTE PTR [ebp]
; Line 396
	mov	eax, DWORD PTR _cword_val$[esp+60]
	mov	BYTE PTR [ebx], cl
	mov	ecx, DWORD PTR tv877[esp+60]
	inc	ebp
	inc	ebx
	inc	ecx
	shr	eax, 1
	mov	DWORD PTR tv877[esp+60], ecx
	mov	DWORD PTR _cword_val$[esp+60], eax
$L1264:
	mov	esi, DWORD PTR _last_byte$[esp+60]
	mov	ecx, DWORD PTR _cword_val$[esp+60]
	lea	eax, DWORD PTR [esi-10]
	cmp	ebp, eax
	mov	DWORD PTR _dst$[esp+60], ebx
	jbe	$L1256
; Line 203
	mov	edi, DWORD PTR _destination$[esp+56]
$L1234:
; Line 433
	cmp	ebp, esi
	ja	SHORT $L1235
$L973:
; Line 435
	test	cl, 1
	je	SHORT $L975
; Line 437
	mov	edx, DWORD PTR _cword_ptr$[esp+60]
	shr	ecx, 1
	or	ecx, -2147483648			; 80000000H
; Line 440
	mov	DWORD PTR _cword_val$[esp+60], -2147483648 ; 80000000H
	mov	DWORD PTR [edx], ecx
	mov	ecx, DWORD PTR _cword_val$[esp+60]
	mov	DWORD PTR _cword_ptr$[esp+60], ebx
	add	ebx, 4
$L975:
; Line 464
	mov	al, BYTE PTR [ebp]
; Line 465
	inc	ebp
	mov	BYTE PTR [ebx], al
; Line 466
	inc	ebx
; Line 468
	shr	ecx, 1
	cmp	ebp, esi
	jbe	SHORT $L973
$L1235:
; Line 471
	test	cl, 1
	jne	SHORT $L978
	npad	1
$L977:
; Line 472
	shr	ecx, 1
	test	cl, 1
	je	SHORT $L977
$L978:
; Line 474
	mov	edx, DWORD PTR _cword_ptr$[esp+60]
	shr	ecx, 1
	or	ecx, -2147483648			; 80000000H
; Line 477
	sub	ebx, edi
	cmp	ebx, 9
	mov	DWORD PTR [edx], ecx
	mov	eax, 9
	jl	SHORT $L913
	mov	eax, ebx
$L913:
	pop	edi
	pop	esi
	pop	ebp
	pop	ebx
; Line 478
	add	esp, 44					; 0000002cH
	ret	0
$L1236:
	pop	edi
	pop	esi
	pop	ebp
; Line 204
	xor	eax, eax
	pop	ebx
; Line 478
	add	esp, 44					; 0000002cH
	ret	0
_qlz_compress_core ENDP
_TEXT	ENDS
PUBLIC	_qlz_size_decompressed
; Function compile flags: /Ogty
_TEXT	SEGMENT
_source$ = 8						; size = 4
_qlz_size_decompressed PROC NEAR
; Line 661
	mov	ecx, DWORD PTR _source$[esp-4]
	mov	al, BYTE PTR [ecx]
	and	al, 2
	sub	al, 2
	neg	al
	sbb	eax, eax
	and	eax, -3					; fffffffdH
	add	eax, 4
; Line 662
	cmp	eax, 1
	jb	SHORT $L1269
	cmp	eax, 4
	ja	SHORT $L1269
	mov	edx, DWORD PTR [eax+ecx+1]
; Line 664
	mov	ecx, 4
	sub	ecx, eax
	shl	ecx, 3
	or	eax, -1
	shr	eax, cl
	and	eax, edx
; Line 665
	ret	0
; Line 662
$L1269:
; Line 664
	mov	ecx, 4
	sub	ecx, eax
	or	eax, -1
	shl	ecx, 3
	shr	eax, cl
	xor	edx, edx
	and	eax, edx
; Line 665
	ret	0
_qlz_size_decompressed ENDP
_TEXT	ENDS
PUBLIC	_qlz_size_compressed
; Function compile flags: /Ogty
_TEXT	SEGMENT
_source$ = 8						; size = 4
_qlz_size_compressed PROC NEAR
; Line 670
	mov	ecx, DWORD PTR _source$[esp-4]
	mov	al, BYTE PTR [ecx]
	and	al, 2
	sub	al, 2
	neg	al
	sbb	eax, eax
	and	eax, -3					; fffffffdH
	add	eax, 4
; Line 671
	cmp	eax, 1
	jb	SHORT $L1275
	cmp	eax, 4
	ja	SHORT $L1275
	mov	edx, DWORD PTR [ecx+1]
; Line 673
	mov	ecx, 4
	sub	ecx, eax
	shl	ecx, 3
	or	eax, -1
	shr	eax, cl
	and	eax, edx
; Line 674
	ret	0
; Line 671
$L1275:
; Line 673
	mov	ecx, 4
	sub	ecx, eax
	or	eax, -1
	shl	ecx, 3
	shr	eax, cl
	xor	edx, edx
	and	eax, edx
; Line 674
	ret	0
_qlz_size_compressed ENDP
_TEXT	ENDS
PUBLIC	_qlz_compress
; Function compile flags: /Ogty
_TEXT	SEGMENT
_scratch_aligned$ = -4					; size = 4
_source$ = 8						; size = 4
_destination$ = 12					; size = 4
_size$ = 16						; size = 4
_hashtable$ = 20					; size = 4
_scratch_compress$ = 20					; size = 4
_qlz_compress PROC NEAR
; Line 677
	push	ecx
; Line 678
	mov	eax, DWORD PTR _scratch_compress$[esp]
	mov	ecx, eax
	and	ecx, 7
	sub	eax, ecx
	add	eax, 8
; Line 680
	lea	edx, DWORD PTR [eax+8]
	push	ebx
; Line 689
	mov	ebx, DWORD PTR _size$[esp+4]
	mov	DWORD PTR _hashtable$[esp+4], edx
	add	edx, 262144				; 00040000H
	test	ebx, ebx
	mov	DWORD PTR _scratch_aligned$[esp+8], eax
	je	$L1068
	cmp	ebx, -401				; fffffe6fH
	ja	$L1068
	push	ebp
	push	esi
; Line 702
	mov	esi, DWORD PTR _destination$[esp+12]
	push	edi
	push	edx
	cmp	ebx, 216				; 000000d8H
	sbb	ebp, ebp
	mov	edi, edx
	mov	edx, DWORD PTR _hashtable$[esp+20]
	xor	eax, eax
	push	edx
	and	ebp, -6					; fffffffaH
	mov	ecx, 1024				; 00000400H
	rep stosd
	mov	eax, DWORD PTR _source$[esp+24]
	add	ebp, 9
	push	ebx
	lea	edi, DWORD PTR [esi+ebp]
	push	edi
	push	eax
	call	_qlz_compress_core
	add	eax, ebp
	add	esp, 20					; 00000014H
; Line 706
	cmp	eax, ebp
	jne	SHORT $L1073
; Line 708
	mov	esi, DWORD PTR _source$[esp+16]
	mov	ecx, ebx
	mov	edx, ecx
	shr	ecx, 2
	rep movsd
	mov	ecx, edx
	and	ecx, 3
	rep movsb
; Line 712
	mov	esi, DWORD PTR _destination$[esp+16]
	lea	eax, DWORD PTR [ebx+ebp]
	xor	ecx, ecx
	jmp	SHORT $L1074
$L1073:
; Line 714
	mov	ecx, 1
$L1074:
; Line 738
	cmp	ebp, 3
	mov	edx, DWORD PTR _scratch_aligned$[esp+20]
	mov	DWORD PTR [edx], 0
	jne	SHORT $L1075
; Line 740
	mov	BYTE PTR [esi], cl
	pop	edi
; Line 752
	or	cl, 76					; 0000004cH
	mov	BYTE PTR [esi+2], bl
	mov	BYTE PTR [esi+1], al
	mov	BYTE PTR [esi], cl
	pop	esi
	pop	ebp
	pop	ebx
; Line 759
	pop	ecx
	ret	0
$L1075:
; Line 746
	or	cl, 2
	mov	BYTE PTR [esi], cl
; Line 747
	mov	DWORD PTR [esi+1], eax
; Line 748
	mov	DWORD PTR [esi+5], ebx
; Line 752
	mov	cl, BYTE PTR [esi]
	pop	edi
	or	cl, 76					; 0000004cH
	mov	BYTE PTR [esi], cl
	pop	esi
	pop	ebp
	pop	ebx
; Line 759
	pop	ecx
	ret	0
$L1068:
; Line 690
	xor	eax, eax
	pop	ebx
; Line 759
	pop	ecx
	ret	0
_qlz_compress ENDP
; Function compile flags: /Ogty
_last_destination_byte$ = -68				; size = 4
_bitlut$ = -64						; size = 64
_cword_val$ = 8						; size = 4
_destination$ = 8					; size = 4
_size$ = 12						; size = 4
_qlz_decompress_core PROC NEAR
; _source$ = eax
; Line 481
	sub	esp, 68					; 00000044H
	push	ebx
	push	ebp
	mov	ebp, DWORD PTR _destination$[esp+72]
; Line 486
	xor	ecx, ecx
	push	esi
	mov	esi, eax
	mov	eax, DWORD PTR _size$[esp+76]
	mov	ebx, 1
	push	edi
	lea	edi, DWORD PTR [eax+ebp-1]
	mov	edx, 2
	mov	DWORD PTR _last_destination_byte$[esp+84], edi
	mov	eax, ebx
	mov	DWORD PTR _bitlut$[esp+84], 4
	mov	DWORD PTR _bitlut$[esp+88], ecx
	mov	DWORD PTR _bitlut$[esp+92], ebx
	mov	DWORD PTR _bitlut$[esp+96], ecx
	mov	DWORD PTR _bitlut$[esp+100], edx
	mov	DWORD PTR _bitlut$[esp+104], ecx
	mov	DWORD PTR _bitlut$[esp+108], ebx
	mov	DWORD PTR _bitlut$[esp+112], ecx
	mov	DWORD PTR _bitlut$[esp+116], 3
	mov	DWORD PTR _bitlut$[esp+120], ecx
	mov	DWORD PTR _bitlut$[esp+124], ebx
	mov	DWORD PTR _bitlut$[esp+128], ecx
	mov	DWORD PTR _bitlut$[esp+132], edx
	mov	DWORD PTR _bitlut$[esp+136], ecx
	mov	DWORD PTR _bitlut$[esp+140], ebx
	mov	DWORD PTR _bitlut$[esp+144], ecx
	npad	1
$L1010:
; Line 501
	cmp	eax, ebx
	jne	SHORT $L1013
; Line 507
	mov	eax, DWORD PTR [esi]
; Line 508
	add	esi, 4
$L1013:
; Line 518
	test	al, bl
	mov	ecx, DWORD PTR [esi]
	je	$L1014
; Line 562
	shr	eax, 1
; Line 563
	test	cl, 3
	mov	DWORD PTR _cword_val$[esp+80], eax
	jne	SHORT $L1018
; Line 565
	shr	ecx, 2
	and	ecx, 63					; 0000003fH
	mov	edx, ecx
; Line 566
	mov	ecx, 3
; Line 567
	inc	esi
; Line 569
	jmp	SHORT $L1025
$L1018:
	test	cl, 2
	jne	SHORT $L1020
; Line 571
	shr	ecx, 2
	and	ecx, 16383				; 00003fffH
	mov	edx, ecx
; Line 572
	mov	ecx, 3
; Line 573
	add	esi, 2
; Line 575
	jmp	SHORT $L1025
$L1020:
	test	cl, bl
; Line 577
	mov	edx, ecx
	jne	SHORT $L1022
; Line 578
	shr	ecx, 2
	shr	edx, 6
	and	ecx, 15					; 0000000fH
	and	edx, 1023				; 000003ffH
	add	ecx, 3
; Line 579
	add	esi, 2
; Line 581
	jmp	SHORT $L1025
$L1022:
	and	edx, 127				; 0000007fH
	cmp	dl, 3
; Line 583
	mov	edx, ecx
	je	SHORT $L1024
; Line 584
	shr	ecx, 2
	shr	edx, 7
	and	ecx, 31					; 0000001fH
	and	edx, 131071				; 0001ffffH
	add	ecx, 2
; Line 585
	add	esi, 3
; Line 587
	jmp	SHORT $L1025
$L1024:
; Line 590
	shr	ecx, 7
	and	ecx, 255				; 000000ffH
	shr	edx, 15					; 0000000fH
	add	ecx, 3
; Line 591
	add	esi, 4
$L1025:
; Line 594
	mov	edi, ebp
	sub	edi, edx
; Line 604
	xor	ebx, ebx
	mov	edx, ebp
	sub	edi, ebp
$L1330:
	mov	eax, DWORD PTR [edi+edx]
	mov	DWORD PTR [edx], eax
	add	ebx, 3
	add	edx, 3
	cmp	ebx, ecx
	jb	SHORT $L1330
; Line 613
	mov	eax, DWORD PTR _cword_val$[esp+80]
	mov	edi, DWORD PTR _last_destination_byte$[esp+84]
	add	ebp, ecx
	mov	ebx, 1
	jmp	$L1010
$L1014:
; Line 615
	lea	edx, DWORD PTR [edi-10]
	cmp	ebp, edx
	jae	SHORT $L1335
; Line 618
	mov	DWORD PTR [ebp], ecx
; Line 622
	mov	ecx, eax
	and	ecx, 15					; 0000000fH
	mov	edx, DWORD PTR _bitlut$[esp+ecx*4+84]
	lea	ecx, DWORD PTR _bitlut$[esp+ecx*4+84]
; Line 624
	mov	ecx, edx
	add	ebp, edx
	add	esi, edx
	shr	eax, cl
; Line 655
	jmp	$L1010
$L1335:
; Line 631
	cmp	ebp, edi
	ja	SHORT $L1340
	npad	3
$L1032:
; Line 633
	cmp	eax, ebx
	jne	SHORT $L1034
; Line 635
	add	esi, 4
; Line 636
	mov	eax, -2147483648			; 80000000H
$L1034:
; Line 642
	mov	dl, BYTE PTR [esi]
	mov	BYTE PTR [ebp], dl
; Line 643
	inc	ebp
; Line 644
	inc	esi
; Line 645
	shr	eax, 1
	cmp	ebp, edi
	jbe	SHORT $L1032
$L1340:
; Line 651
	mov	eax, DWORD PTR _size$[esp+80]
	pop	edi
	pop	esi
	pop	ebp
	pop	ebx
; Line 656
	add	esp, 68					; 00000044H
	ret	0
_qlz_decompress_core ENDP
_TEXT	ENDS
PUBLIC	_qlz_decompress
; Function compile flags: /Ogty
_TEXT	SEGMENT
_source$ = 8						; size = 4
_destination$ = 12					; size = 4
_scratch_compress$ = 16					; size = 4
_qlz_decompress PROC NEAR
; Line 763
	mov	eax, DWORD PTR _scratch_compress$[esp-4]
	push	ebx
	push	ebp
	push	esi
; Line 778
	mov	esi, DWORD PTR _source$[esp+8]
	mov	bl, BYTE PTR [esi]
	mov	ecx, eax
	and	ecx, 7
	mov	dl, bl
	and	dl, 2
	sub	dl, 2
	sub	eax, ecx
	add	eax, 8
	neg	dl
	push	edi
	mov	ebp, eax
	sbb	edx, edx
	and	edx, -3					; fffffffdH
	add	edx, 4
; Line 779
	cmp	edx, 1
	jb	SHORT $L1354
	cmp	edx, 4
	ja	SHORT $L1354
	mov	edi, DWORD PTR [edx+esi+1]
	jmp	SHORT $L1355
$L1354:
	xor	edi, edi
$L1355:
	mov	ecx, 4
	sub	ecx, edx
	or	eax, -1
	shl	ecx, 3
	shr	eax, cl
	and	eax, edi
; Line 785
	test	bl, 1
	je	SHORT $L1099
; Line 790
	push	eax
	mov	eax, DWORD PTR _destination$[esp+16]
	push	eax
	lea	eax, DWORD PTR [esi+edx*2+1]
	call	_qlz_decompress_core
	add	esp, 8
	pop	edi
	pop	esi
; Line 796
	mov	DWORD PTR [ebp], 0
	pop	ebp
	pop	ebx
; Line 820
	ret	0
$L1099:
; Line 794
	mov	edi, DWORD PTR _destination$[esp+12]
	lea	esi, DWORD PTR [esi+edx*2+1]
	mov	ecx, eax
	mov	edx, ecx
	shr	ecx, 2
	rep movsd
	mov	ecx, edx
	and	ecx, 3
	rep movsb
	pop	edi
	pop	esi
; Line 796
	mov	DWORD PTR [ebp], 0
	pop	ebp
	pop	ebx
; Line 820
	ret	0
_qlz_decompress ENDP
_TEXT	ENDS
END
