	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function init_PCI8604PW
_init_PCI8604PW:                        ## @init_PCI8604PW
	.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, %rbx
	movq	(%rdi), %rax
	movl	(%rax), %edi
	callq	_PCI_SLOT
	andl	$-4, %eax
	cmpl	$12, %eax
	jne	LBB0_15
## %bb.1:
	movq	(%rbx), %rax
	movl	(%rax), %edi
	callq	_PCI_SLOT
	cmpl	$13, %eax
	jne	LBB0_14
## %bb.2:
	movq	_BT848_GPIO_OUT_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$524290, %edi                   ## imm = 0x80002
	callq	_btwrite
	movq	_BT848_GPIO_DATA@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_btread
	movl	%eax, %ecx
	shrl	$21, %ecx
	leaq	L_.str.1(%rip), %r14
	movl	$536903681, %r12d               ## imm = 0x20008001
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	movl	%r13d, %esi
	callq	_pr_debug
	movl	(%r15), %esi
	movl	$524288, %edi                   ## imm = 0x80000
	callq	_btwrite
	movl	$1, %edi
	callq	_msleep
	movl	(%r15), %esi
	xorl	%edi, %edi
	callq	_btwrite
	movl	$1, %edi
	callq	_msleep
	movl	%r13d, %ebx
	shll	$4, %ebx
	movl	(%r15), %edi
	callq	_btread
                                        ## kill: def $eax killed $eax def $rax
	shrl	$21, %eax
	andl	$7, %eax
	leal	(%rax,%rbx), %ecx
	leal	(%rax,%rbx), %edx
	addl	$-71, %edx
	cmpl	$29, %edx
	ja	LBB0_9
## %bb.11:                              ##   in Loop: Header=BB0_3 Depth=1
	btl	%edx, %r12d
	jae	LBB0_9
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ecx, %r13d
	andl	$7, %r13d
	leal	-4(%r13), %eax
	cmpl	$3, %eax
	jb	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$1, %r13d
	je	LBB0_8
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$21, %ecx
	je	LBB0_3
## %bb.10:
	leaq	L_.str.5(%rip), %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pr_err                         ## TAILCALL
LBB0_15:
	leaq	L_.str(%rip), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pr_warn                        ## TAILCALL
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	testl	%r13d, %r13d
	je	LBB0_12
## %bb.6:
	cmpl	$7, %r13d
	jne	LBB0_13
## %bb.7:
	leaq	L_.str.2(%rip), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pr_info                        ## TAILCALL
LBB0_12:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pr_err                         ## TAILCALL
LBB0_13:
	leaq	L_.str.4(%rip), %rdi
	movl	%r13d, %esi
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pr_err                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"This is not a PCI-8604PW\n"

	.comm	_BT848_GPIO_OUT_EN,4,2          ## @BT848_GPIO_OUT_EN
	.comm	_BT848_GPIO_DATA,4,2            ## @BT848_GPIO_DATA
L_.str.1:                               ## @.str.1
	.asciz	"PCI-8604PW in state %i, toggling pin\n"

L_.str.2:                               ## @.str.2
	.asciz	"PCI-8604PW unlocked\n"

L_.str.3:                               ## @.str.3
	.asciz	"PCI-8604PW locked until reset\n"

L_.str.4:                               ## @.str.4
	.asciz	"PCI-8604PW in unknown state %i\n"

L_.str.5:                               ## @.str.5
	.asciz	"PCI-8604PW invalid transition %i -> %i\n"

	.no_dead_strip	_init_PCI8604PW
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function init_PCI8604PW
_init_PCI8604PW:                        ; @init_PCI8604PW
	.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
	ldr	x8, [x0]
	ldr	w0, [x8]
	bl	_PCI_SLOT
	and	w8, w0, #0xfffffffc
	cmp	w8, #12
	b.ne	LBB0_6
; %bb.1:
	ldr	x8, [x19]
	ldr	w0, [x8]
	bl	_PCI_SLOT
	cmp	w0, #13
	b.ne	LBB0_13
; %bb.2:
Lloh0:
	adrp	x8, _BT848_GPIO_OUT_EN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BT848_GPIO_OUT_EN@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #2
	movk	w0, #8, lsl #16
	bl	_btwrite
Lloh3:
	adrp	x21, _BT848_GPIO_DATA@GOTPAGE
Lloh4:
	ldr	x21, [x21, _BT848_GPIO_DATA@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_btread
	lsr	w24, w0, #21
Lloh5:
	adrp	x20, l_.str.1@PAGE
Lloh6:
	add	x20, x20, l_.str.1@PAGEOFF
	mov	w22, #1
	mov	w23, #32769
	movk	w23, #8192, lsl #16
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	and	w19, w24, #0x7
	sub	w8, w19, #4
	cmp	w8, #3
	ccmp	w19, #1, #4, hs
	b.ne	LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x20
	mov	x1, x19
	bl	_pr_debug
	ldr	w1, [x21]
	mov	w0, #524288
	bl	_btwrite
	mov	w0, #1
	bl	_msleep
	ldr	w1, [x21]
	mov	w0, #0
	bl	_btwrite
	mov	w0, #1
	bl	_msleep
	lsl	w24, w19, #4
	ldr	w0, [x21]
	bl	_btread
	bfxil	w24, w0, #21, #3
	sub	w8, w24, #71
	cmp	w8, #29
	lsl	w8, w22, w8
	and	w8, w8, w23
	ccmp	w8, #0, #4, ls
	ccmp	w24, #21, #4, eq
	b.eq	LBB0_3
; %bb.5:
	ubfx	w8, w0, #21, #3
                                        ; kill: def $w19 killed $w19 killed $x19 def $x19
	stp	x19, x8, [sp]
Lloh7:
	adrp	x0, l_.str.5@PAGE
Lloh8:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_12
LBB0_6:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	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
	b	_pr_warn
LBB0_7:
	cbz	w19, LBB0_10
; %bb.8:
	cmp	w19, #7
	b.ne	LBB0_11
; %bb.9:
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
	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
	b	_pr_info
LBB0_10:
Lloh13:
	adrp	x0, l_.str.3@PAGE
Lloh14:
	add	x0, x0, l_.str.3@PAGEOFF
	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
	b	_pr_err
LBB0_11:
	str	x19, [sp]
Lloh15:
	adrp	x0, l_.str.4@PAGE
Lloh16:
	add	x0, x0, l_.str.4@PAGEOFF
LBB0_12:
	bl	_pr_err
LBB0_13:
	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 AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"This is not a PCI-8604PW\n"

	.comm	_BT848_GPIO_OUT_EN,4,2          ; @BT848_GPIO_OUT_EN
	.comm	_BT848_GPIO_DATA,4,2            ; @BT848_GPIO_DATA
l_.str.1:                               ; @.str.1
	.asciz	"PCI-8604PW in state %i, toggling pin\n"

l_.str.2:                               ; @.str.2
	.asciz	"PCI-8604PW unlocked\n"

l_.str.3:                               ; @.str.3
	.asciz	"PCI-8604PW locked until reset\n"

l_.str.4:                               ; @.str.4
	.asciz	"PCI-8604PW in unknown state %i\n"

l_.str.5:                               ; @.str.5
	.asciz	"PCI-8604PW invalid transition %i -> %i\n"

	.no_dead_strip	_init_PCI8604PW
.subsections_via_symbols
