	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function HLPFILE_ReadFileToBuffer
_HLPFILE_ReadFileToBuffer:              ## @HLPFILE_ReadFileToBuffer
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	leaq	-48(%rbp), %rsi
	movl	%r15d, %edi
	movl	$16, %edx
	callq	__hread
	cmpl	$16, %eax
	jne	LBB0_1
## %bb.3:
	leaq	-48(%rbp), %rdi
	xorl	%esi, %esi
	callq	_GET_UINT
	cmpl	$220991, %eax                   ## imm = 0x35F3F
	jne	LBB0_4
## %bb.5:
	leaq	-48(%rbp), %rdi
	movl	$12, %esi
	callq	_GET_UINT
	movl	%eax, (%r14)
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	(%r14), %edx
	incl	%edx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_HeapAlloc
	movq	%rax, 8(%r14)
	movq	_FALSE@GOTPCREL(%rip), %rbx
	testq	%rax, %rax
	je	LBB0_11
## %bb.6:
	leaq	-48(%rbp), %rsi
	movq	%rax, %rdi
	movl	$16, %edx
	callq	_memcpy
	movq	8(%r14), %rsi
	addq	$16, %rsi
	movl	(%r14), %edx
	addl	$-16, %edx
	movl	%r15d, %edi
	callq	__hread
	movl	(%r14), %ecx
	addl	$-16, %ecx
	cmpl	%ecx, %eax
	jne	LBB0_7
## %bb.8:
	leaq	-49(%rbp), %rsi
	movl	%r15d, %edi
	movl	$1, %edx
	callq	__hread
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	leaq	L_.str.3(%rip), %rdi
	callq	_WINE_WARN
LBB0_10:
	movq	8(%r14), %rax
	movslq	(%r14), %rcx
	movb	$0, (%rax,%rcx)
	movq	_TRUE@GOTPCREL(%rip), %rbx
	jmp	LBB0_11
LBB0_1:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_2
LBB0_4:
	leaq	L_.str.1(%rip), %rdi
LBB0_2:
	callq	_WINE_WARN
	movq	_FALSE@GOTPCREL(%rip), %rbx
LBB0_11:
	movl	(%rbx), %eax
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-32(%rbp), %rcx
	jne	LBB0_13
## %bb.12:
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	leaq	L_.str.2(%rip), %rdi
	callq	_WINE_WARN
	jmp	LBB0_11
LBB0_13:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"header\n"

	.comm	_FALSE,4,2                      ## @FALSE
L_.str.1:                               ## @.str.1
	.asciz	"wrong header\n"

L_.str.2:                               ## @.str.2
	.asciz	"filesize1\n"

L_.str.3:                               ## @.str.3
	.asciz	"filesize2\n"

	.comm	_TRUE,4,2                       ## @TRUE
	.no_dead_strip	_HLPFILE_ReadFileToBuffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function HLPFILE_ReadFileToBuffer
_HLPFILE_ReadFileToBuffer:              ; @HLPFILE_ReadFileToBuffer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	add	x1, sp, #8
	mov	x0, x20
	mov	w2, #16
	bl	__hread
	cmp	w0, #16
	b.ne	LBB0_7
; %bb.1:
	add	x0, sp, #8
	mov	w1, #0
	bl	_GET_UINT
	sub	w8, w0, #53, lsl #12            ; =217088
	cmp	w8, #3903
	b.ne	LBB0_8
; %bb.2:
	add	x0, sp, #8
	mov	w1, #12
	bl	_GET_UINT
	str	w0, [x19]
	bl	_GetProcessHeap
	ldr	w8, [x19]
	add	w2, w8, #1
	mov	w1, #0
	bl	_HeapAlloc
	str	x0, [x19, #8]
	cbz	x0, LBB0_11
; %bb.3:
	add	x1, sp, #8
	mov	w2, #16
	bl	_memcpy
	ldr	x8, [x19, #8]
	add	x1, x8, #16
	ldr	w8, [x19]
	sub	w2, w8, #16
	mov	x0, x20
	bl	__hread
	ldr	w8, [x19]
	sub	w8, w8, #16
	cmp	w0, w8
	b.ne	LBB0_9
; %bb.4:
	add	x1, sp, #7
	mov	x0, x20
	mov	w2, #1
	bl	__hread
	cbz	w0, LBB0_6
; %bb.5:
Lloh3:
	adrp	x0, l_.str.3@PAGE
Lloh4:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_WINE_WARN
LBB0_6:
	ldr	x8, [x19, #8]
	ldrsw	x9, [x19]
	strb	wzr, [x8, x9]
Lloh5:
	adrp	x8, _TRUE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
	b	LBB0_12
LBB0_7:
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_10
LBB0_8:
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_10
LBB0_9:
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_10:
	bl	_WINE_WARN
LBB0_11:
Lloh13:
	adrp	x8, _FALSE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
LBB0_12:
	ldr	w0, [x8]
	ldr	x8, [sp, #24]
Lloh15:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_14
; %bb.13:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_14:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"header\n"

	.comm	_FALSE,4,2                      ; @FALSE
l_.str.1:                               ; @.str.1
	.asciz	"wrong header\n"

l_.str.2:                               ; @.str.2
	.asciz	"filesize1\n"

l_.str.3:                               ; @.str.3
	.asciz	"filesize2\n"

	.comm	_TRUE,4,2                       ; @TRUE
	.no_dead_strip	_HLPFILE_ReadFileToBuffer
.subsections_via_symbols
