	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_be_cmd_get_acpi_wol_cap        ## -- Begin function be_cmd_get_acpi_wol_cap
	.p2align	4, 0x90
_be_cmd_get_acpi_wol_cap:               ## @be_cmd_get_acpi_wol_cap
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	_OPCODE_ETH_ACPI_WOL_MAGIC_CONFIG@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_CMD_SUBSYSTEM_ETH@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	callq	_be_cmd_allowed
	testl	%eax, %eax
	je	LBB0_7
## %bb.1:
	leaq	8(%r15), %r14
	movq	%r14, %rdi
	callq	_mutex_lock_interruptible
	movl	$-1, %ebx
	testq	%rax, %rax
	jne	LBB0_13
## %bb.2:
	leaq	-56(%rbp), %rdi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	movl	$8, -56(%rbp)
	movq	(%r15), %rdi
	leaq	-52(%rbp), %rdx
	movl	$8, %esi
	callq	_pci_alloc_consistent
	movq	%rax, -48(%rbp)
	testq	%rax, %rax
	je	LBB0_8
## %bb.3:
	movq	%r15, %rdi
	callq	_wrb_from_mbox
	testq	%rax, %rax
	je	LBB0_9
## %bb.4:
	movq	-48(%rbp), %rbx
	leaq	4(%rbx), %rdi
	movl	(%r13), %esi
	movl	(%r12), %edx
	leaq	-56(%rbp), %r9
	movl	$8, %ecx
	movq	%rax, %r8
	callq	_be_wrb_cmd_hdr_prepare
	movl	$1, 4(%rbx)
	movq	_BE_GET_WOL_CAP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	movq	%r15, %rdi
	callq	_be_mbox_notify_wait
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_11
## %bb.5:
	movq	-48(%rbp), %rax
	movl	$-1, %ebx
	cmpl	$8, 4(%rax)
	jl	LBB0_11
## %bb.6:
	movl	(%rax), %eax
	movl	%eax, 12(%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_7:
	movq	_EPERM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_8:
	movq	(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_9:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_10:
	subl	(%rax), %ebx
LBB0_11:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	-48(%rbp), %rdx
	testq	%rdx, %rdx
	je	LBB0_13
## %bb.12:
	movq	(%r15), %rdi
	movl	-56(%rbp), %esi
	movl	-52(%rbp), %ecx
	callq	_pci_free_consistent
LBB0_13:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_OPCODE_ETH_ACPI_WOL_MAGIC_CONFIG,4,2 ## @OPCODE_ETH_ACPI_WOL_MAGIC_CONFIG
	.comm	_CMD_SUBSYSTEM_ETH,4,2          ## @CMD_SUBSYSTEM_ETH
	.comm	_EPERM,4,2                      ## @EPERM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Memory allocation failure\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_BE_GET_WOL_CAP,4,2             ## @BE_GET_WOL_CAP
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_be_cmd_get_acpi_wol_cap        ; -- Begin function be_cmd_get_acpi_wol_cap
	.p2align	2
_be_cmd_get_acpi_wol_cap:               ; @be_cmd_get_acpi_wol_cap
	.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	x19, x0
Lloh0:
	adrp	x21, _OPCODE_ETH_ACPI_WOL_MAGIC_CONFIG@GOTPAGE
Lloh1:
	ldr	x21, [x21, _OPCODE_ETH_ACPI_WOL_MAGIC_CONFIG@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh2:
	adrp	x22, _CMD_SUBSYSTEM_ETH@GOTPAGE
Lloh3:
	ldr	x22, [x22, _CMD_SUBSYSTEM_ETH@GOTPAGEOFF]
	ldr	w2, [x22]
	bl	_be_cmd_allowed
	cbz	w0, LBB0_3
; %bb.1:
	add	x20, x19, #8
	mov	x0, x20
	bl	_mutex_lock_interruptible
	cbz	x0, LBB0_4
; %bb.2:
	mov	w21, #-1
	b	LBB0_14
LBB0_3:
Lloh4:
	adrp	x8, _EPERM@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_14
LBB0_4:
	mov	x23, sp
	mov	x0, sp
	mov	w1, #0
	mov	w2, #16
	bl	_memset
	mov	w8, #8
	str	w8, [sp]
	ldr	x0, [x19]
	orr	x2, x23, #0x4
	mov	w1, #8
	bl	_pci_alloc_consistent
	str	x0, [sp, #8]
	cbz	x0, LBB0_9
; %bb.5:
	mov	x0, x19
	bl	_wrb_from_mbox
	cbz	x0, LBB0_10
; %bb.6:
	mov	x4, x0
	ldr	x23, [sp, #8]
	add	x0, x23, #4
	ldr	w1, [x22]
	ldr	w2, [x21]
	mov	x5, sp
	mov	w3, #8
	bl	_be_wrb_cmd_hdr_prepare
	mov	w8, #1
Lloh7:
	adrp	x9, _BE_GET_WOL_CAP@GOTPAGE
Lloh8:
	ldr	x9, [x9, _BE_GET_WOL_CAP@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	stp	w9, w8, [x23]
	mov	x0, x19
	bl	_be_mbox_notify_wait
	mov	x21, x0
	cbnz	w0, LBB0_12
; %bb.7:
	ldr	x8, [sp, #8]
	ldr	w9, [x8, #4]
	cmp	w9, #8
	b.ge	LBB0_15
; %bb.8:
	mov	w21, #-1
	b	LBB0_12
LBB0_9:
	ldr	x0, [x19]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
Lloh14:
	adrp	x8, _EBUSY@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_12:
	mov	x0, x20
	bl	_mutex_unlock
	ldr	x2, [sp, #8]
	cbz	x2, LBB0_14
; %bb.13:
	ldr	x0, [x19]
	ldp	w1, w3, [sp]
	bl	_pci_free_consistent
LBB0_14:
	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
LBB0_15:
	mov	w21, #0
	ldr	w8, [x8]
	str	w8, [x19, #12]
	b	LBB0_12
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_OPCODE_ETH_ACPI_WOL_MAGIC_CONFIG,4,2 ; @OPCODE_ETH_ACPI_WOL_MAGIC_CONFIG
	.comm	_CMD_SUBSYSTEM_ETH,4,2          ; @CMD_SUBSYSTEM_ETH
	.comm	_EPERM,4,2                      ; @EPERM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Memory allocation failure\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_BE_GET_WOL_CAP,4,2             ; @BE_GET_WOL_CAP
.subsections_via_symbols
