	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function HomebrewCopyMemory
_HomebrewCopyMemory:                    ## @HomebrewCopyMemory
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r14
	addl	$7, %edx
	andl	$-8, %edx
	cmpl	$65536, %edx                    ## imm = 0x10000
	movl	$65536, %ebx                    ## imm = 0x10000
	cmovll	%edx, %ebx
	movl	%ebx, %edi
	callq	_memoryInitAreaTable
	movq	_RPX_MAX_SIZE@GOTPCREL(%rip), %rax
	movl	$1073741824, (%rax)             ## imm = 0x40000000
	movq	_RPX_MAX_CODE_SIZE@GOTPCREL(%rip), %rax
	movl	$50331648, (%rax)               ## imm = 0x3000000
	cmpl	$51966, 28(%r14)                ## imm = 0xCAFE
	jne	LBB0_1
## %bb.2:
	leaq	L_str(%rip), %rdi
	callq	_puts
	movq	_MEM_AREA_TABLE@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movl	(%rax), %ebx
	movq	_ELF_DATA_ADDR@GOTPCREL(%rip), %rax
	movl	%ebx, (%rax)
	cmpl	$16777215, %ebx                 ## imm = 0xFFFFFF
	jle	LBB0_3
## %bb.5:
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_DCFlushRange
	movq	%r14, %rdi
	callq	_OSEffectiveToPhysical
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	testl	%r15d, %r15d
	jle	LBB0_13
## %bb.6:
	movq	(%r12), %r12
	testq	%r12, %r12
	je	LBB0_13
## %bb.7:
	xorl	%r13d, %r13d
	xorl	%r14d, %r14d
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	%r15d, %ecx
	subl	%r14d, %ecx
	leal	(%rcx,%r13), %edx
	movl	%eax, %ebx
	subl	%r13d, %ebx
	cmpl	%eax, %edx
	cmovlel	%ecx, %ebx
	movl	(%r12), %edi
	addl	%r13d, %edi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leal	(%r14,%rax), %esi
	movl	%ebx, %edx
	callq	_SC0x25_KernelCopyData
	addl	%ebx, %r13d
	addl	%r14d, %ebx
	movl	%ebx, %r14d
	cmpl	%r15d, %ebx
	jge	LBB0_13
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	4(%r12), %eax
	cmpl	%eax, %r13d
	jl	LBB0_12
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	8(%r12), %r12
	testq	%r12, %r12
	je	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	4(%r12), %eax
	xorl	%r13d, %r13d
	jmp	LBB0_12
LBB0_1:
	leaq	L_str.2(%rip), %rdi
	callq	_puts
	xorl	%eax, %eax
	callq	_getApplicationEndAddr
	addl	%eax, %ebx
	movq	_ELF_DATA_ADDR@GOTPCREL(%rip), %rax
	movl	%ebx, (%rax)
	movl	$-1, %eax
	cmpl	$16777215, %ebx                 ## imm = 0xFFFFFF
	jg	LBB0_14
LBB0_3:
	leal	(%rbx,%r15), %ecx
	movl	$-1, %eax
	cmpl	$16777216, %ecx                 ## imm = 0x1000000
	jg	LBB0_14
## %bb.4:
	movslq	%ebx, %rdi
	movq	%r14, %rsi
	movl	%r15d, %edx
	callq	_memcpy
	movl	%r15d, %ebx
LBB0_13:
	movq	_ELF_DATA_SIZE@GOTPCREL(%rip), %rax
	movl	%ebx, (%rax)
	movl	%r15d, %eax
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	$-1, %eax
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_RPX_MAX_SIZE,4,2               ## @RPX_MAX_SIZE
	.comm	_RPX_MAX_CODE_SIZE,4,2          ## @RPX_MAX_CODE_SIZE
	.comm	_ELF_DATA_ADDR,4,2              ## @ELF_DATA_ADDR
	.comm	_MEM_AREA_TABLE,8,3             ## @MEM_AREA_TABLE
	.comm	_ELF_DATA_SIZE,4,2              ## @ELF_DATA_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_str:                                  ## @str
	.asciz	"loading RPX file "

L_str.2:                                ## @str.2
	.asciz	"loading ELF file "

	.no_dead_strip	_HomebrewCopyMemory
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function HomebrewCopyMemory
_HomebrewCopyMemory:                    ; @HomebrewCopyMemory
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x1
	mov	x20, x0
	add	w8, w2, #7
	and	w8, w8, #0xfffffff8
	mov	w9, #65536
	cmp	w8, #16, lsl #12                ; =65536
	csel	w21, w8, w9, lt
	mov	x0, x21
	bl	_memoryInitAreaTable
Lloh0:
	adrp	x8, _RPX_MAX_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RPX_MAX_SIZE@GOTPAGEOFF]
	mov	w9, #1073741824
Lloh2:
	adrp	x10, _RPX_MAX_CODE_SIZE@GOTPAGE
Lloh3:
	ldr	x10, [x10, _RPX_MAX_CODE_SIZE@GOTPAGEOFF]
Lloh4:
	str	w9, [x8]
	mov	w8, #50331648
Lloh5:
	str	w8, [x10]
	ldr	w8, [x20, #28]
	mov	w9, #51966
	cmp	w8, w9
	b.ne	LBB0_9
; %bb.1:
Lloh6:
	adrp	x0, l_str@PAGE
Lloh7:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
Lloh8:
	adrp	x21, _MEM_AREA_TABLE@GOTPAGE
Lloh9:
	ldr	x21, [x21, _MEM_AREA_TABLE@GOTPAGEOFF]
	ldr	x8, [x21]
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _ELF_DATA_ADDR@GOTPAGE
Lloh11:
	ldr	x9, [x9, _ELF_DATA_ADDR@GOTPAGEOFF]
Lloh12:
	str	w8, [x9]
	mov	w9, #16777215
	cmp	w8, w9
	b.le	LBB0_10
; %bb.2:
	mov	x0, x20
	mov	x1, x19
	bl	_DCFlushRange
	mov	x0, x20
	bl	_OSEffectiveToPhysical
	mov	w22, #0
	cmp	w19, #1
	b.lt	LBB0_13
; %bb.3:
	ldr	x23, [x21]
	cbz	x23, LBB0_13
; %bb.4:
	mov	x20, x0
	mov	w24, #0
	mov	w22, #0
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	sub	w9, w19, w22
	add	w10, w24, w9
	sub	w11, w8, w24
	cmp	w10, w8
	csel	w21, w11, w9, gt
	ldr	w8, [x23]
	add	w0, w8, w24
	add	w1, w22, w20
	mov	x2, x21
	bl	_SC0x25_KernelCopyData
	add	w24, w21, w24
	add	w22, w21, w22
	cmp	w22, w19
	b.ge	LBB0_13
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x23, #4]
	cmp	w24, w8
	b.lt	LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x23, [x23, #8]
	cbz	x23, LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w24, #0
	ldr	w8, [x23, #4]
	b	LBB0_5
LBB0_9:
Lloh13:
	adrp	x0, l_str.2@PAGE
Lloh14:
	add	x0, x0, l_str.2@PAGEOFF
	bl	_puts
	bl	_getApplicationEndAddr
Lloh15:
	adrp	x9, _ELF_DATA_ADDR@GOTPAGE
Lloh16:
	ldr	x9, [x9, _ELF_DATA_ADDR@GOTPAGEOFF]
	mov	w10, #16777215
	add	w8, w21, w0
	cmp	w8, w10
Lloh17:
	str	w8, [x9]
	b.gt	LBB0_11
LBB0_10:
	mov	w9, #16777216
	add	w10, w8, w19
	cmp	w10, w9
	b.le	LBB0_12
LBB0_11:
	mov	w19, #-1
	b	LBB0_14
LBB0_12:
	sxtw	x0, w8
	mov	x1, x20
	mov	x2, x19
	bl	_memcpy
	mov	x22, x19
LBB0_13:
Lloh18:
	adrp	x8, _ELF_DATA_SIZE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ELF_DATA_SIZE@GOTPAGEOFF]
Lloh20:
	str	w22, [x8]
LBB0_14:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotStr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotStr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGotStr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotStr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotStr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_RPX_MAX_SIZE,4,2               ; @RPX_MAX_SIZE
	.comm	_RPX_MAX_CODE_SIZE,4,2          ; @RPX_MAX_CODE_SIZE
	.comm	_ELF_DATA_ADDR,4,2              ; @ELF_DATA_ADDR
	.comm	_MEM_AREA_TABLE,8,3             ; @MEM_AREA_TABLE
	.comm	_ELF_DATA_SIZE,4,2              ; @ELF_DATA_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_str:                                  ; @str
	.asciz	"loading RPX file "

l_str.2:                                ; @str.2
	.asciz	"loading ELF file "

	.no_dead_strip	_HomebrewCopyMemory
.subsections_via_symbols
