	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mptsas_expander_refresh
_mptsas_expander_refresh:               ## @mptsas_expander_refresh
	.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	%rsi, %r15
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	8(%rsi), %rsi
	movq	24(%rsi), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	cmpl	$0, (%r15)
	jle	LBB0_5
## %bb.1:
	movq	56(%rsi), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	xorl	%r12d, %r12d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %r15
	incq	%r12
	movslq	(%r14), %rax
	addl	$65536, %r13d                   ## imm = 0x10000
	addq	$64, %rbx
	cmpq	%rax, %r12
	jge	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_MPI_SAS_EXPAND_PGAD_FORM_HANDLE_PHY_NUM@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_MPI_SAS_EXPAND_PGAD_FORM_SHIFT@GOTPCREL(%rip), %rax
	movzbl	(%rax), %ecx
	shll	%cl, %edx
	addq	%rbx, %rsi
	movslq	%r13d, %rcx
	addq	-56(%rbp), %rcx                 ## 8-byte Folded Reload
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_mptsas_sas_expander_pg1
	movq	8(%r15), %rax
	leaq	(%rax,%rbx), %rsi
	addq	$24, %rsi
	movq	%r14, %rdi
	movq	_MPI_SAS_DEVICE_PGAD_FORM_HANDLE@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	movq	_MPI_SAS_DEVICE_PGAD_FORM_SHIFT@GOTPCREL(%rip), %r14
	movzbl	(%r14), %ecx
	shll	%cl, %edx
	movq	40(%rax,%rbx), %rcx
	callq	_mptsas_sas_device_pg0
	movq	%r15, %r14
	movq	8(%r15), %rsi
	movl	48(%rsi,%rbx), %eax
	movl	%eax, 36(%rsi,%rbx)
	movq	16(%rsi,%rbx), %rax
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	addq	%rbx, %rsi
	movq	_MPI_SAS_DEVICE_PGAD_FORM_HANDLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_MPI_SAS_DEVICE_PGAD_FORM_SHIFT@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %ecx
	shll	%cl, %edx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%rax, %rcx
	callq	_mptsas_sas_device_pg0
	movq	8(%r14), %rsi
	movl	48(%rsi,%rbx), %eax
	movl	%eax, 12(%rsi,%rbx)
	jmp	LBB0_4
LBB0_5:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	leaq	4(%rbx), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	8(%r15), %rax
	movl	32(%rax), %esi
	movq	%rbx, %rdi
	callq	_mptsas_find_portinfo_by_handle
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:
	movq	%rax, %rdx
	movl	(%rax), %eax
	testl	%eax, %eax
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	jle	LBB0_7
## %bb.9:
	movl	$1, %ebx
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%rdx), %rdi
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	cmpq	%rcx, (%rdi,%r13)
	jne	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=1
	addq	%r13, %rdi
	movq	%rdx, %r12
	callq	_mptsas_get_rphy
	movq	%r12, %rdx
	movq	%rax, %r12
	movl	(%rdx), %eax
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_10 Depth=1
	xorl	%r12d, %r12d
LBB0_13:                                ##   in Loop: Header=BB0_10 Depth=1
	movslq	%eax, %rcx
	cmpq	%rcx, %rbx
	jge	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_10 Depth=1
	addq	$64, %r13
	incq	%rbx
	testq	%r12, %r12
	je	LBB0_10
	jmp	LBB0_15
LBB0_8:
	movq	%r14, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
LBB0_7:
	xorl	%r12d, %r12d
LBB0_15:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	callq	_mptsas_setup_wide_ports
	cmpl	$0, (%r15)
	jle	LBB0_18
## %bb.16:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	xorl	%r13d, %r13d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rsi
	addq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%ecx, %ecx
	callq	_mptsas_probe_one_phy
	incq	%rbx
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	incl	%edx
	movl	%edx, (%rax)
	movslq	(%r15), %rax
	addq	$64, %r13
	cmpq	%rax, %rbx
	jl	LBB0_17
LBB0_18:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MPI_SAS_EXPAND_PGAD_FORM_HANDLE_PHY_NUM,4,2 ## @MPI_SAS_EXPAND_PGAD_FORM_HANDLE_PHY_NUM
	.comm	_MPI_SAS_EXPAND_PGAD_FORM_SHIFT,4,2 ## @MPI_SAS_EXPAND_PGAD_FORM_SHIFT
	.comm	_MPI_SAS_DEVICE_PGAD_FORM_HANDLE,4,2 ## @MPI_SAS_DEVICE_PGAD_FORM_HANDLE
	.comm	_MPI_SAS_DEVICE_PGAD_FORM_SHIFT,4,2 ## @MPI_SAS_DEVICE_PGAD_FORM_SHIFT
	.no_dead_strip	_mptsas_expander_refresh
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mptsas_expander_refresh
_mptsas_expander_refresh:               ; @mptsas_expander_refresh
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x19, x1
	mov	x20, x0
	ldr	x8, [x1, #8]
	ldr	x9, [x8, #24]
	str	x9, [sp, #8]                    ; 8-byte Folded Spill
	ldr	w9, [x1]
	cmp	w9, #1
	b.lt	LBB0_5
; %bb.1:
	mov	x21, #0
	mov	w22, #0
	mov	x23, #0
	ldr	x25, [x8, #56]
Lloh0:
	adrp	x26, _MPI_SAS_EXPAND_PGAD_FORM_HANDLE_PHY_NUM@GOTPAGE
Lloh1:
	ldr	x26, [x26, _MPI_SAS_EXPAND_PGAD_FORM_HANDLE_PHY_NUM@GOTPAGEOFF]
Lloh2:
	adrp	x27, _MPI_SAS_EXPAND_PGAD_FORM_SHIFT@GOTPAGE
Lloh3:
	ldr	x27, [x27, _MPI_SAS_EXPAND_PGAD_FORM_SHIFT@GOTPAGEOFF]
Lloh4:
	adrp	x28, _MPI_SAS_DEVICE_PGAD_FORM_HANDLE@GOTPAGE
Lloh5:
	ldr	x28, [x28, _MPI_SAS_DEVICE_PGAD_FORM_HANDLE@GOTPAGEOFF]
Lloh6:
	adrp	x24, _MPI_SAS_DEVICE_PGAD_FORM_SHIFT@GOTPAGE
Lloh7:
	ldr	x24, [x24, _MPI_SAS_DEVICE_PGAD_FORM_SHIFT@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x23, x23, #1
	ldrsw	x9, [x19]
	add	w22, w22, #16, lsl #12          ; =65536
	add	x21, x21, #64
	cmp	x23, x9
	b.ge	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	add	x1, x8, x21
	ldr	w8, [x26]
	ldr	w9, [x27]
	lsl	w2, w8, w9
	add	x3, x25, w22, sxtw
	mov	x0, x20
	bl	_mptsas_sas_expander_pg1
	ldr	x8, [x19, #8]
	add	x8, x8, x21
	add	x1, x8, #24
	ldr	w9, [x28]
	ldr	w10, [x24]
	lsl	w2, w9, w10
	ldr	x3, [x8, #40]
	mov	x0, x20
	bl	_mptsas_sas_device_pg0
	ldr	x8, [x19, #8]
	add	x1, x8, x21
	ldr	w9, [x1, #48]
	str	w9, [x1, #36]
	ldr	x3, [x1, #16]
	cbz	x3, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x28]
	ldr	w9, [x24]
	lsl	w2, w8, w9
	mov	x0, x20
	bl	_mptsas_sas_device_pg0
	ldr	x8, [x19, #8]
	add	x9, x8, x21
	ldr	w10, [x9, #48]
	str	w10, [x9, #12]
	b	LBB0_2
LBB0_5:
	add	x21, x20, #4
	mov	x0, x21
	bl	_mutex_lock
	ldr	x8, [x19, #8]
	ldr	w1, [x8, #32]
	mov	x0, x20
	bl	_mptsas_find_portinfo_by_handle
	cbz	x0, LBB0_12
; %bb.6:
	mov	x23, x0
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.7:
	mov	x24, #0
	mov	w25, #1
	ldr	x26, [sp, #8]                   ; 8-byte Folded Reload
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x23, #8]
	add	x0, x9, x24
	ldr	x9, [x0]
	cmp	x9, x26
	b.ne	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	bl	_mptsas_get_rphy
	mov	x22, x0
	ldr	w8, [x23]
	cmp	x25, w8, sxtw
	b.lt	LBB0_11
	b	LBB0_14
LBB0_10:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x22, #0
	cmp	x25, w8, sxtw
	b.ge	LBB0_14
LBB0_11:                                ;   in Loop: Header=BB0_8 Depth=1
	add	x24, x24, #64
	add	x25, x25, #1
	cbz	x22, LBB0_8
	b	LBB0_14
LBB0_12:
	mov	x0, x21
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_mutex_unlock
LBB0_13:
	mov	x22, #0
LBB0_14:
	mov	x0, x21
	bl	_mutex_unlock
	mov	x0, x20
	mov	x1, x19
	bl	_mptsas_setup_wide_ports
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_17
; %bb.15:
	mov	x21, #0
	mov	x23, #0
	ldr	w2, [x20]
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	add	x1, x8, x21
	mov	x0, x22
	mov	w3, #0
	bl	_mptsas_probe_one_phy
	add	x23, x23, #1
	ldr	w8, [x20]
	add	w2, w8, #1
	str	w2, [x20]
	ldrsw	x8, [x19]
	add	x21, x21, #64
	cmp	x23, x8
	b.lt	LBB0_16
LBB0_17:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_MPI_SAS_EXPAND_PGAD_FORM_HANDLE_PHY_NUM,4,2 ; @MPI_SAS_EXPAND_PGAD_FORM_HANDLE_PHY_NUM
	.comm	_MPI_SAS_EXPAND_PGAD_FORM_SHIFT,4,2 ; @MPI_SAS_EXPAND_PGAD_FORM_SHIFT
	.comm	_MPI_SAS_DEVICE_PGAD_FORM_HANDLE,4,2 ; @MPI_SAS_DEVICE_PGAD_FORM_HANDLE
	.comm	_MPI_SAS_DEVICE_PGAD_FORM_SHIFT,4,2 ; @MPI_SAS_DEVICE_PGAD_FORM_SHIFT
	.no_dead_strip	_mptsas_expander_refresh
.subsections_via_symbols
