	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function handle_selfid
_handle_selfid:                         ## @handle_selfid
	.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
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	movq	(%rdi), %r15
	movq	_OHCI1394_SelfIDCount@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_reg_read
	movl	%eax, %r14d
	cmpq	$0, 8(%rbx)
	movl	(%r15), %ecx
	je	LBB0_2
## %bb.1:
	movl	%ecx, %edi
	callq	_le32_to_cpu
	movl	%eax, %ecx
LBB0_2:
	testl	%r14d, %r14d
	js	LBB0_4
## %bb.3:
	movl	%ecx, %eax
	xorl	%r14d, %eax
	testl	$16711680, %eax                 ## imm = 0xFF0000
	je	LBB0_6
LBB0_4:
	movq	_KERN_ERR@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movl	16(%rbx), %r8d
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_PRINT
	movl	16(%rbx), %eax
	movq	_OHCI1394_MAX_SELF_ID_ERRORS@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jge	LBB0_5
## %bb.17:
	movq	%rbx, %rdi
	movl	$1, %esi
	movl	$64, %edx
	callq	_set_phy_reg_mask
	incl	16(%rbx)
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PRINT                          ## TAILCALL
LBB0_6:
	movl	$0, 16(%rbx)
	shrl	$2, %r14d
	movl	%r14d, %eax
	andl	$2047, %eax                     ## imm = 0x7FF
	cmpl	$1, %eax
	je	LBB0_16
## %bb.7:
	andl	$2047, %r14d                    ## imm = 0x7FF
	movl	$1, %r12d
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	_KERN_ERR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	leaq	L_.str.4(%rip), %rsi
	movl	%r13d, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_PRINT
LBB0_15:                                ##   in Loop: Header=BB0_8 Depth=1
	addq	$2, %r12
	cmpq	%r12, %r14
	je	LBB0_16
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, 8(%rbx)
	movl	(%r15,%r12,4), %r13d
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movl	%r13d, %edi
	callq	_le32_to_cpu
	movl	%eax, %r13d
	movl	4(%r15,%r12,4), %edi
	callq	_le32_to_cpu
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	4(%r15,%r12,4), %eax
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	%eax, %ecx
	notl	%ecx
	cmpl	%ecx, %r13d
	jne	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_8 Depth=1
	leaq	L_.str.2(%rip), %rdi
	movl	%r13d, %esi
	xorl	%eax, %eax
	callq	_DBGMSG
	movl	%r13d, %edi
	callq	_cpu_to_be32
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	callq	_hpsb_selfid_received
	movl	%r13d, %eax
	shrl	$24, %eax
	andl	$63, %eax
	cmpl	-44(%rbp), %eax                 ## 4-byte Folded Reload
	jne	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_8 Depth=1
	leaq	L_.str.3(%rip), %rdi
	movl	%r13d, %esi
	xorl	%eax, %eax
	callq	_DBGMSG
	jmp	LBB0_15
LBB0_16:
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_DBGMSG                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_OHCI1394_SelfIDCount,4,2       ## @OHCI1394_SelfIDCount
	.comm	_KERN_ERR,4,2                   ## @KERN_ERR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error in reception of SelfID packets [0x%08x/0x%08x] (count: %d)"

	.comm	_OHCI1394_MAX_SELF_ID_ERRORS,4,2 ## @OHCI1394_MAX_SELF_ID_ERRORS
L_.str.1:                               ## @.str.1
	.asciz	"Too many errors on SelfID error reception, giving up!"

L_.str.2:                               ## @.str.2
	.asciz	"SelfID packet 0x%x received"

L_.str.3:                               ## @.str.3
	.asciz	"SelfID for this node is 0x%08x"

L_.str.4:                               ## @.str.4
	.asciz	"SelfID is inconsistent [0x%08x/0x%08x]"

L_.str.5:                               ## @.str.5
	.asciz	"SelfID complete"

	.no_dead_strip	_handle_selfid
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function handle_selfid
_handle_selfid:                         ; @handle_selfid
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldr	x23, [x0]
Lloh0:
	adrp	x8, _OHCI1394_SelfIDCount@GOTPAGE
Lloh1:
	ldr	x8, [x8, _OHCI1394_SelfIDCount@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_reg_read
	mov	x22, x0
	ldr	x8, [x19, #8]
	ldr	w0, [x23]
	cbz	x8, LBB0_2
; %bb.1:
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_le32_to_cpu
                                        ; kill: def $w0 killed $w0 def $x0
LBB0_2:
	tbnz	w22, #31, LBB0_4
; %bb.3:
	eor	w8, w0, w22
	tst	w8, #0xff0000
	b.eq	LBB0_7
LBB0_4:
Lloh3:
	adrp	x20, _KERN_ERR@GOTPAGE
Lloh4:
	ldr	x20, [x20, _KERN_ERR@GOTPAGEOFF]
	ldr	w8, [x20]
	ldr	w9, [x19, #16]
	stp	x0, x9, [sp, #8]
	str	x22, [sp]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x8
	bl	_PRINT
	ldr	w8, [x19, #16]
Lloh7:
	adrp	x9, _OHCI1394_MAX_SELF_ID_ERRORS@GOTPAGE
Lloh8:
	ldr	x9, [x9, _OHCI1394_MAX_SELF_ID_ERRORS@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ge	LBB0_6
; %bb.5:
	mov	x0, x19
	mov	w1, #1
	mov	w2, #64
	bl	_set_phy_reg_mask
	ldr	w8, [x19, #16]
	add	w8, w8, #1
	str	w8, [x19, #16]
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_6:
	ldr	w0, [x20]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_PRINT
LBB0_7:
	str	wzr, [x19, #16]
	ubfx	w8, w22, #2, #11
	subs	w8, w8, #1
	b.eq	LBB0_17
; %bb.8:
	sxtw	x26, w8
	add	x27, x23, #8
Lloh12:
	adrp	x22, l_.str.2@PAGE
Lloh13:
	add	x22, x22, l_.str.2@PAGEOFF
Lloh14:
	adrp	x23, l_.str.3@PAGE
Lloh15:
	add	x23, x23, l_.str.3@PAGEOFF
Lloh16:
	adrp	x28, _KERN_ERR@GOTPAGE
Lloh17:
	ldr	x28, [x28, _KERN_ERR@GOTPAGEOFF]
Lloh18:
	adrp	x24, l_.str.4@PAGE
Lloh19:
	add	x24, x24, l_.str.4@PAGEOFF
	b	LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_11 Depth=1
	ldr	w8, [x28]
                                        ; kill: def $w25 killed $w25 killed $x25 def $x25
	stp	x25, x0, [sp]
	mov	x0, x8
	mov	x1, x24
	bl	_PRINT
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	add	x27, x27, #8
	subs	x26, x26, #2
	b.eq	LBB0_17
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldur	w25, [x27, #-4]
	cbz	x8, LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x25
	bl	_le32_to_cpu
	mov	x25, x0
	ldr	w0, [x27]
	bl	_le32_to_cpu
                                        ; kill: def $w0 killed $w0 def $x0
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_11 Depth=1
	ldr	w0, [x27]
LBB0_14:                                ;   in Loop: Header=BB0_11 Depth=1
	mvn	w8, w0
	cmp	w25, w8
	b.ne	LBB0_9
; %bb.15:                               ;   in Loop: Header=BB0_11 Depth=1
	str	x25, [sp]
	mov	x0, x22
	bl	_DBGMSG
	mov	x0, x25
	bl	_cpu_to_be32
	mov	x1, x0
	mov	x0, x21
	bl	_hpsb_selfid_received
	ubfx	w8, w25, #24, #6
	cmp	w8, w20
	b.ne	LBB0_10
; %bb.16:                               ;   in Loop: Header=BB0_11 Depth=1
                                        ; kill: def $w25 killed $w25 killed $x25 def $x25
	str	x25, [sp]
	mov	x0, x23
	bl	_DBGMSG
	b	LBB0_10
LBB0_17:
Lloh20:
	adrp	x0, l_.str.5@PAGE
Lloh21:
	add	x0, x0, l_.str.5@PAGEOFF
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_DBGMSG
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_OHCI1394_SelfIDCount,4,2       ; @OHCI1394_SelfIDCount
	.comm	_KERN_ERR,4,2                   ; @KERN_ERR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error in reception of SelfID packets [0x%08x/0x%08x] (count: %d)"

	.comm	_OHCI1394_MAX_SELF_ID_ERRORS,4,2 ; @OHCI1394_MAX_SELF_ID_ERRORS
l_.str.1:                               ; @.str.1
	.asciz	"Too many errors on SelfID error reception, giving up!"

l_.str.2:                               ; @.str.2
	.asciz	"SelfID packet 0x%x received"

l_.str.3:                               ; @.str.3
	.asciz	"SelfID for this node is 0x%08x"

l_.str.4:                               ; @.str.4
	.asciz	"SelfID is inconsistent [0x%08x/0x%08x]"

l_.str.5:                               ; @.str.5
	.asciz	"SelfID complete"

	.no_dead_strip	_handle_selfid
.subsections_via_symbols
