	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	(%rdi), %eax
	cmpl	$-1, %eax
	je	LBB0_27
## %bb.1:
	movq	%rdi, %r13
	movl	4(%rdi), %r12d
	cmpl	$-1, %r12d
	je	LBB0_27
## %bb.2:
	movq	%rsi, %r14
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	16(%r13), %r15
	cmpl	$16, %r12d
	movl	$16, %ebx
	cmovll	%r12d, %ebx
	cmpl	$4, %ebx
	jl	LBB0_5
## %bb.3:
	shrl	$2, %ebx
	andl	$63, %ebx
	incq	%rbx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	leal	-2(%rbx), %eax
	leaq	(%r15,%rax,4), %rdi
	callq	_cpu_to_be32s
	decq	%rbx
	cmpq	$1, %rbx
	ja	LBB0_4
LBB0_5:
	xorl	%eax, %eax
	cmpl	$0, 8(%r13)
	jne	LBB0_7
## %bb.6:
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_generate_own_selfid
LBB0_7:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, %ecx
	andl	$2, %ecx
	movl	%ecx, -60(%rbp)                 ## 4-byte Spill
	shrl	%ecx
	movl	%eax, %ebx
	sarl	$2, %ebx
	movq	_KERN_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	12(%r13), %esi
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str.2(%rip), %r8
	movl	%ecx, -56(%rbp)                 ## 4-byte Spill
	testl	%ecx, %ecx
	cmovneq	%rax, %r8
	leaq	L_.str(%rip), %rdx
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_PRINT
	movq	_LINK_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movl	%ebx, %edx
	orl	$-64, %edx
	shll	$16, %edx
	movq	%r13, %rdi
	callq	_reg_write
	movl	8(%r13), %eax
	orl	%r12d, %eax
	je	LBB0_8
## %bb.9:
	testl	%r12d, %r12d
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	jle	LBB0_19
## %bb.10:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	incl	%eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	addl	$8, %r12d
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_11 Depth=1
	movq	_KERN_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	12(%r13), %esi
	leaq	L_.str.4(%rip), %rdx
	xorl	%eax, %eax
	callq	_PRINT
LBB0_18:                                ##   in Loop: Header=BB0_11 Depth=1
	addq	$8, %r15
	addl	$-8, %r12d
	cmpl	$8, %r12d
	jle	LBB0_19
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	cmpl	$0, 8(%r13)
	jne	LBB0_15
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	cmpl	$0, 4(%r15)
	jne	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=1
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	cmpl	%eax, (%r15)
	jne	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_hpsb_selfid_received
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_11 Depth=1
	movl	(%r15), %ecx
	movl	4(%r15), %r8d
	movl	%r8d, %eax
	notl	%eax
	cmpl	%eax, %ecx
	jne	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	_KERN_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	12(%r13), %esi
	leaq	L_.str.3(%rip), %rdx
	xorl	%eax, %eax
	callq	_PRINT
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_hpsb_selfid_received
	jmp	LBB0_18
LBB0_8:
	movq	%r14, %rdi
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %esi
	callq	_hpsb_selfid_received
LBB0_19:
	movl	%ebx, %esi
	cmpl	$0, 8(%r13)
	movl	-60(%rbp), %ebx                 ## 4-byte Reload
	jne	LBB0_23
## %bb.20:
	testl	%ebx, %ebx
	je	LBB0_23
## %bb.21:
	cmpl	$4, -48(%rbp)                   ## 4-byte Folded Reload
	jb	LBB0_23
## %bb.22:
	movq	%r14, %rdi
	callq	_hpsb_selfid_received
LBB0_23:
	movq	%r14, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	movl	-56(%rbp), %edx                 ## 4-byte Reload
	callq	_hpsb_selfid_complete
	cmpq	$0, (%r14)
	je	LBB0_24
LBB0_27:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_24:
	testl	%ebx, %ebx
	je	LBB0_26
## %bb.25:
	movq	_LINK_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_LINK_CONTROL_CYCMASTER@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_reg_set_bits
LBB0_26:
	movq	_LINK_CONTROL_RCV_CMP_VALID@GOTPCREL(%rip), %rax
	movq	_LINK_CONTROL_TX_ASYNC_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_LINK_CONTROL@GOTPCREL(%rip), %rax
	movq	_LINK_CONTROL_RX_ASYNC_EN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	movl	(%rax), %esi
	movq	_LINK_CONTROL_CYCTIMEREN@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%r13, %rdi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_reg_set_bits                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_KERN_INFO,4,2                  ## @KERN_INFO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SelfID process finished (phyid %d, %s)"

L_.str.1:                               ## @.str.1
	.asciz	"root"

L_.str.2:                               ## @.str.2
	.asciz	"not root"

	.comm	_LINK_ID,4,2                    ## @LINK_ID
	.comm	_KERN_DEBUG,4,2                 ## @KERN_DEBUG
L_.str.3:                               ## @.str.3
	.asciz	"SelfID packet 0x%x rcvd"

L_.str.4:                               ## @.str.4
	.asciz	"inconsistent selfid 0x%x/0x%x"

	.comm	_LINK_CONTROL,4,2               ## @LINK_CONTROL
	.comm	_LINK_CONTROL_CYCMASTER,4,2     ## @LINK_CONTROL_CYCMASTER
	.comm	_LINK_CONTROL_RCV_CMP_VALID,4,2 ## @LINK_CONTROL_RCV_CMP_VALID
	.comm	_LINK_CONTROL_TX_ASYNC_EN,4,2   ## @LINK_CONTROL_TX_ASYNC_EN
	.comm	_LINK_CONTROL_RX_ASYNC_EN,4,2   ## @LINK_CONTROL_RX_ASYNC_EN
	.comm	_LINK_CONTROL_CYCTIMEREN,4,2    ## @LINK_CONTROL_CYCTIMEREN
	.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
	ldr	w26, [x0]
	cmn	w26, #1
	b.eq	LBB0_25
; %bb.1:
	mov	x19, x0
	ldr	w24, [x0, #4]
	cmn	w24, #1
	b.eq	LBB0_25
; %bb.2:
	mov	x20, x1
	ldr	x27, [x19, #16]
	mov	w8, #16
	cmp	w24, #16
	csel	w8, w24, w8, lt
	cmp	w8, #4
	b.lt	LBB0_5
; %bb.3:
	ubfx	w8, w8, #2, #6
	add	x21, x8, #1
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	sub	w8, w21, #2
	add	x0, x27, w8, uxtw #2
	bl	_cpu_to_be32s
	sub	x21, x21, #1
	cmp	x21, #1
	b.hi	LBB0_4
LBB0_5:
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_7
; %bb.6:
	str	wzr, [sp, #28]                  ; 4-byte Folded Spill
	b	LBB0_8
LBB0_7:
	mov	x0, x19
	mov	x1, x20
	bl	_generate_own_selfid
	str	w0, [sp, #28]                   ; 4-byte Folded Spill
LBB0_8:
	ands	w8, w26, #0x2
	str	w8, [sp, #24]                   ; 4-byte Folded Spill
	lsr	w8, w8, #1
	str	w8, [sp, #20]                   ; 4-byte Folded Spill
	asr	w23, w26, #2
Lloh0:
	adrp	x22, _KERN_INFO@GOTPAGE
Lloh1:
	ldr	x22, [x22, _KERN_INFO@GOTPAGEOFF]
	ldr	w0, [x22]
	ldr	w1, [x19, #12]
Lloh2:
	adrp	x8, l_.str.2@PAGE
Lloh3:
	add	x8, x8, l_.str.2@PAGEOFF
Lloh4:
	adrp	x9, l_.str.1@PAGE
Lloh5:
	add	x9, x9, l_.str.1@PAGEOFF
	csel	x8, x9, x8, ne
	str	x8, [sp]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	x3, x23
	bl	_PRINT
Lloh8:
	adrp	x8, _LINK_ID@GOTPAGE
Lloh9:
	ldr	x8, [x8, _LINK_ID@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	lsl	w8, w23, #16
	orr	w2, w8, #0xffc00000
	mov	x0, x19
	bl	_reg_write
	ldr	w8, [x19, #8]
	orr	w8, w8, w24
	cbz	w8, LBB0_19
; %bb.9:
	cmp	w24, #1
	b.lt	LBB0_20
; %bb.10:
	add	w8, w23, #1
	str	w8, [sp, #16]                   ; 4-byte Folded Spill
	add	w21, w24, #8
Lloh11:
	adrp	x28, _KERN_DEBUG@GOTPAGE
Lloh12:
	ldr	x28, [x28, _KERN_DEBUG@GOTPAGEOFF]
Lloh13:
	adrp	x24, l_.str.3@PAGE
Lloh14:
	add	x24, x24, l_.str.3@PAGEOFF
Lloh15:
	adrp	x25, l_.str.4@PAGE
Lloh16:
	add	x25, x25, l_.str.4@PAGEOFF
	b	LBB0_13
LBB0_11:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	w0, [x22]
	ldr	w1, [x19, #12]
	str	x8, [sp]
	mov	x2, x25
	bl	_PRINT
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	add	x27, x27, #8
	sub	w21, w21, #8
	cmp	w21, #8
	b.le	LBB0_20
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x19, #8]
	cbnz	w8, LBB0_17
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w8, [x27, #4]
	cbnz	w8, LBB0_17
; %bb.15:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w8, [x27]
	ldr	w9, [sp, #16]                   ; 4-byte Folded Reload
	cmp	w8, w9
	b.ne	LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	x0, x20
	ldr	w1, [sp, #28]                   ; 4-byte Folded Reload
	bl	_hpsb_selfid_received
LBB0_17:                                ;   in Loop: Header=BB0_13 Depth=1
	ldp	w3, w8, [x27]
	mvn	w9, w8
	cmp	w3, w9
	b.ne	LBB0_11
; %bb.18:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w0, [x28]
	ldr	w1, [x19, #12]
	mov	x2, x24
	bl	_PRINT
	ldr	w1, [x27]
	mov	x0, x20
	bl	_hpsb_selfid_received
	b	LBB0_12
LBB0_19:
	mov	x0, x20
	ldr	w1, [sp, #28]                   ; 4-byte Folded Reload
	bl	_hpsb_selfid_received
LBB0_20:
	ldr	w8, [x19, #8]
	ldr	w21, [sp, #24]                  ; 4-byte Folded Reload
	cbnz	w8, LBB0_24
; %bb.21:
	cbz	w21, LBB0_24
; %bb.22:
	cmp	w26, #4
	b.lo	LBB0_24
; %bb.23:
	mov	x0, x20
	ldr	w1, [sp, #28]                   ; 4-byte Folded Reload
	bl	_hpsb_selfid_received
LBB0_24:
	mov	x0, x20
	mov	x1, x23
	ldr	w2, [sp, #20]                   ; 4-byte Folded Reload
	bl	_hpsb_selfid_complete
	ldr	x8, [x20]
	cbz	x8, LBB0_26
LBB0_25:
	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_26:
Lloh17:
	adrp	x20, _LINK_CONTROL@GOTPAGE
Lloh18:
	ldr	x20, [x20, _LINK_CONTROL@GOTPAGEOFF]
	cbz	w21, LBB0_28
; %bb.27:
	ldr	w1, [x20]
Lloh19:
	adrp	x8, _LINK_CONTROL_CYCMASTER@GOTPAGE
Lloh20:
	ldr	x8, [x8, _LINK_CONTROL_CYCMASTER@GOTPAGEOFF]
Lloh21:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_reg_set_bits
LBB0_28:
Lloh22:
	adrp	x8, _LINK_CONTROL_RCV_CMP_VALID@GOTPAGE
Lloh23:
	ldr	x8, [x8, _LINK_CONTROL_RCV_CMP_VALID@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
Lloh25:
	adrp	x9, _LINK_CONTROL_TX_ASYNC_EN@GOTPAGE
Lloh26:
	ldr	x9, [x9, _LINK_CONTROL_TX_ASYNC_EN@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh28:
	adrp	x9, _LINK_CONTROL_RX_ASYNC_EN@GOTPAGE
Lloh29:
	ldr	x9, [x9, _LINK_CONTROL_RX_ASYNC_EN@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh31:
	adrp	x9, _LINK_CONTROL_CYCTIMEREN@GOTPAGE
Lloh32:
	ldr	x9, [x9, _LINK_CONTROL_CYCTIMEREN@GOTPAGEOFF]
	ldr	w1, [x20]
Lloh33:
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	x0, x19
	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	_reg_set_bits
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_KERN_INFO,4,2                  ; @KERN_INFO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SelfID process finished (phyid %d, %s)"

l_.str.1:                               ; @.str.1
	.asciz	"root"

l_.str.2:                               ; @.str.2
	.asciz	"not root"

	.comm	_LINK_ID,4,2                    ; @LINK_ID
	.comm	_KERN_DEBUG,4,2                 ; @KERN_DEBUG
l_.str.3:                               ; @.str.3
	.asciz	"SelfID packet 0x%x rcvd"

l_.str.4:                               ; @.str.4
	.asciz	"inconsistent selfid 0x%x/0x%x"

	.comm	_LINK_CONTROL,4,2               ; @LINK_CONTROL
	.comm	_LINK_CONTROL_CYCMASTER,4,2     ; @LINK_CONTROL_CYCMASTER
	.comm	_LINK_CONTROL_RCV_CMP_VALID,4,2 ; @LINK_CONTROL_RCV_CMP_VALID
	.comm	_LINK_CONTROL_TX_ASYNC_EN,4,2   ; @LINK_CONTROL_TX_ASYNC_EN
	.comm	_LINK_CONTROL_RX_ASYNC_EN,4,2   ; @LINK_CONTROL_RX_ASYNC_EN
	.comm	_LINK_CONTROL_CYCTIMEREN,4,2    ; @LINK_CONTROL_CYCTIMEREN
	.no_dead_strip	_handle_selfid
.subsections_via_symbols
