	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vmu_connect
_vmu_connect:                           ## @vmu_connect
	.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
	movq	%rdi, %r14
	movl	$0, -44(%rbp)
	movl	32(%rdi), %edi
	callq	_be32_to_cpu
	movq	%rax, %rdi
	callq	_hweight_long
	movq	24(%r14), %rcx
	cltq
	movl	-4(%rcx,%rax,4), %edi
	callq	_be32_to_cpu
	movq	%rax, %rbx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movl	$64, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movl	%ebx, %edi
	shrl	$24, %edi
	incq	%rdi
	movq	%rdi, (%rax)
	movq	%rbx, %rax
	shrq	$11, %rax
	andl	$8160, %eax                     ## imm = 0x1FE0
	addq	$32, %rax
	movq	%rax, 8(%r12)
	movl	%ebx, %eax
	shrl	$12, %eax
	andl	$15, %eax
	movq	%rax, 16(%r12)
	movl	%ebx, %eax
	shrl	$8, %eax
	andl	$15, %eax
	movq	%rax, 24(%r12)
	shrl	$7, %ebx
	andl	$1, %ebx
	movq	%rbx, 32(%r12)
	movq	$0, 56(%r12)
	movl	(%r15), %edx
	movl	$4, %esi
	callq	_kmalloc_array
	movq	%rax, 40(%r12)
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	(%r12), %rdi
	movl	(%r15), %edx
	movl	$4, %esi
	callq	_kmalloc_array
	movq	%rax, 48(%r12)
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_maple_set_drvdata
	movq	_vmu_queryblocks@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MAPLE_FUNC_MEMCARD@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ecx
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_maple_getcond_callback
	leaq	12(%r14), %r13
	movq	%r13, %rdi
	callq	_atomic_read
	cmpl	$1, %eax
	jne	LBB0_9
## %bb.7:
	movl	16(%r14), %ebx
	movq	%r13, %rdi
	callq	_atomic_read
	xorl	%esi, %esi
	testl	%eax, %eax
	sete	%sil
	movq	_HZ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%ebx, %edi
	movq	_MAPLE_FUNC_MEMCARD@GOTPCREL(%rip), %rbx
	callq	_wait_event_interruptible_timeout
	movq	%r13, %rdi
	callq	_atomic_read
	cmpl	$1, %eax
	jne	LBB0_9
## %bb.8:
	leaq	8(%r14), %rdi
	movl	(%r14), %ecx
	movl	4(%r14), %edx
	leaq	L_.str(%rip), %rsi
	callq	_dev_notice
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	movq	48(%r12), %rdi
	callq	_kfree
	jmp	LBB0_11
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_13
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_12
LBB0_9:
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_atomic_set
	movl	(%rbx), %esi
	movq	_MAPLE_COMMAND_GETMINFO@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-44(%rbp), %r8
	movq	%r14, %rdi
	movl	$2, %ecx
	callq	_maple_add_packet
	testl	%eax, %eax
	je	LBB0_13
## %bb.10:
	movl	%eax, %ebx
	leaq	8(%r14), %rdi
	movl	(%r14), %ecx
	movl	4(%r14), %edx
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %r8d
	callq	_dev_err
	movl	%ebx, %r15d
	jmp	LBB0_11
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_11:
	movq	40(%r12), %rdi
	callq	_kfree
LBB0_12:
	movq	%r12, %rdi
	callq	_kfree
LBB0_13:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_vmu_queryblocks,4,2            ## @vmu_queryblocks
	.comm	_MAPLE_FUNC_MEMCARD,4,2         ## @MAPLE_FUNC_MEMCARD
	.comm	_HZ,4,2                         ## @HZ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"VMU at (%d, %d) is busy\n"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_MAPLE_COMMAND_GETMINFO,4,2     ## @MAPLE_COMMAND_GETMINFO
L_.str.1:                               ## @.str.1
	.asciz	"Could not lock VMU at (%d, %d) error is 0x%X\n"

	.no_dead_strip	_vmu_connect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ; -- Begin function vmu_connect
lCPI0_0:
	.quad	-24                             ; 0xffffffffffffffe8
	.quad	-11                             ; 0xfffffffffffffff5
lCPI0_1:
	.quad	255                             ; 0xff
	.quad	8160                            ; 0x1fe0
lCPI0_2:
	.quad	1                               ; 0x1
	.quad	32                              ; 0x20
lCPI0_3:
	.quad	-12                             ; 0xfffffffffffffff4
	.quad	-8                              ; 0xfffffffffffffff8
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_vmu_connect:                           ; @vmu_connect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x20, x0
	str	wzr, [sp, #12]
	ldr	w0, [x0, #32]
	bl	_be32_to_cpu
	bl	_hweight_long
	ldr	x8, [x20, #24]
	sub	w9, w0, #1
	ldr	w0, [x8, w9, sxtw #2]
	bl	_be32_to_cpu
	mov	x21, x0
Lloh0:
	adrp	x22, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x22, [x22, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	w0, #64
	bl	_kmalloc
	cbz	x0, LBB0_6
; %bb.1:
	mov	x19, x0
	dup.2d	v0, x21
Lloh2:
	adrp	x8, lCPI0_0@PAGE
Lloh3:
	ldr	q1, [x8, lCPI0_0@PAGEOFF]
	ushl.2d	v1, v0, v1
Lloh4:
	adrp	x8, lCPI0_1@PAGE
Lloh5:
	ldr	q2, [x8, lCPI0_1@PAGEOFF]
	and.16b	v1, v1, v2
Lloh6:
	adrp	x8, lCPI0_2@PAGE
Lloh7:
	ldr	q2, [x8, lCPI0_2@PAGEOFF]
	add.2d	v1, v1, v2
Lloh8:
	adrp	x8, lCPI0_3@PAGE
Lloh9:
	ldr	q2, [x8, lCPI0_3@PAGEOFF]
	ushl.2d	v0, v0, v2
	mov	w8, #15
	dup.2d	v2, x8
	and.16b	v0, v0, v2
	stp	q1, q0, [x0]
	ubfx	x8, x21, #7, #1
	str	x8, [x0, #32]
	str	xzr, [x0, #56]
	ldr	w2, [x22]
	fmov	x0, d1
	mov	w1, #4
	bl	_kmalloc_array
	str	x0, [x19, #40]
	cbz	x0, LBB0_7
; %bb.2:
	ldr	x0, [x19]
	ldr	w2, [x22]
	mov	w1, #4
	bl	_kmalloc_array
	str	x0, [x19, #48]
	cbz	x0, LBB0_10
; %bb.3:
	mov	x0, x20
	mov	x1, x19
	bl	_maple_set_drvdata
Lloh10:
	adrp	x8, _vmu_queryblocks@GOTPAGE
Lloh11:
	ldr	x8, [x8, _vmu_queryblocks@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
Lloh13:
	adrp	x23, _MAPLE_FUNC_MEMCARD@GOTPAGE
Lloh14:
	ldr	x23, [x23, _MAPLE_FUNC_MEMCARD@GOTPAGEOFF]
	ldr	w3, [x23]
	mov	x0, x20
	mov	w2, #0
	bl	_maple_getcond_callback
	add	x21, x20, #12
	mov	x0, x21
	bl	_atomic_read
	cmp	w0, #1
	b.ne	LBB0_8
; %bb.4:
	ldr	w22, [x20, #16]
	mov	x0, x21
	bl	_atomic_read
	cmp	w0, #0
	cset	w1, eq
Lloh15:
	adrp	x8, _HZ@GOTPAGE
Lloh16:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	mov	x0, x22
	bl	_wait_event_interruptible_timeout
	mov	x0, x21
	bl	_atomic_read
	cmp	w0, #1
	b.ne	LBB0_8
; %bb.5:
	add	x0, x20, #8
	ldp	w3, w2, [x20]
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_notice
Lloh20:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w21, w8
	ldr	x0, [x19, #48]
	bl	_kfree
	b	LBB0_11
LBB0_6:
Lloh23:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_13
LBB0_7:
Lloh26:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_12
LBB0_8:
	mov	x0, x21
	mov	w1, #1
	bl	_atomic_set
	ldr	w1, [x23]
Lloh29:
	adrp	x8, _MAPLE_COMMAND_GETMINFO@GOTPAGE
Lloh30:
	ldr	x8, [x8, _MAPLE_COMMAND_GETMINFO@GOTPAGEOFF]
Lloh31:
	ldr	w2, [x8]
	add	x4, sp, #12
	mov	x0, x20
	mov	w3, #2
	bl	_maple_add_packet
	mov	x21, x0
	cbz	w0, LBB0_13
; %bb.9:
	add	x0, x20, #8
	ldp	w3, w2, [x20]
Lloh32:
	adrp	x1, l_.str.1@PAGE
Lloh33:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x4, x21
	bl	_dev_err
	b	LBB0_11
LBB0_10:
Lloh34:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh35:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_11:
	ldr	x0, [x19, #40]
	bl	_kfree
LBB0_12:
	mov	x0, x19
	bl	_kfree
LBB0_13:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdr	Lloh8, Lloh9
	.loh AdrpAdrp	Lloh6, Lloh8
	.loh AdrpLdr	Lloh6, Lloh7
	.loh AdrpAdrp	Lloh4, Lloh6
	.loh AdrpLdr	Lloh4, Lloh5
	.loh AdrpAdrp	Lloh2, Lloh4
	.loh AdrpLdr	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_vmu_queryblocks,4,2            ; @vmu_queryblocks
	.comm	_MAPLE_FUNC_MEMCARD,4,2         ; @MAPLE_FUNC_MEMCARD
	.comm	_HZ,4,2                         ; @HZ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"VMU at (%d, %d) is busy\n"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_MAPLE_COMMAND_GETMINFO,4,2     ; @MAPLE_COMMAND_GETMINFO
l_.str.1:                               ; @.str.1
	.asciz	"Could not lock VMU at (%d, %d) error is 0x%X\n"

	.no_dead_strip	_vmu_connect
.subsections_via_symbols
