	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qib_setup_7322_setextled
_qib_setup_7322_setextled:              ## @qib_setup_7322_setextled
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	8(%rdi), %r15
	cmpq	$0, 8(%r15)
	je	LBB0_1
LBB0_21:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%rdi, %r14
	movl	(%rdi), %ebx
	testl	%ebx, %ebx
	je	LBB0_3
## %bb.2:
	movq	_QIB_LED_PHYS@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	andl	%ebx, %r12d
	movq	_QIB_LED_LOG@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	jmp	LBB0_6
LBB0_3:
	testq	%rsi, %rsi
	je	LBB0_4
## %bb.5:
	movq	_krp_ibcstatus_a@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_qib_read_kreg_port
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_qib_7322_phys_portstate
	movq	_IB_PHYSPORTSTATE_LINKUP@GOTPCREL(%rip), %rcx
	xorl	%r12d, %r12d
	cmpq	(%rcx), %rax
	sete	%r12b
	movl	%ebx, %edi
	callq	_qib_7322_iblink_state
	movq	_IB_PORT_ACTIVE@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpq	(%rcx), %rax
	sete	%bl
	jmp	LBB0_6
LBB0_4:
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
LBB0_6:
	movq	(%r15), %rdi
	addq	$4, %rdi
	callq	_spin_lock_irqsave
	movq	(%r15), %rax
	movl	4(%r14), %esi
	cmpl	$1, %esi
	jne	LBB0_7
## %bb.8:
	movq	_ExtLED_IB1_MASK@GOTPCREL(%rip), %rcx
	jmp	LBB0_9
LBB0_7:
	movq	_ExtLED_IB2_MASK@GOTPCREL(%rip), %rcx
LBB0_9:
	movl	(%rcx), %edx
	notl	%edx
	andl	(%rax), %edx
	testl	%r12d, %r12d
	je	LBB0_10
## %bb.11:
	cmpl	$1, %esi
	jne	LBB0_12
## %bb.13:
	movq	_ExtLED_IB1_GRN@GOTPCREL(%rip), %rcx
	jmp	LBB0_14
LBB0_10:
	xorl	%r12d, %r12d
	cmpl	$1, %esi
	je	LBB0_17
LBB0_16:
	movq	_ExtLED_IB2_YEL@GOTPCREL(%rip), %rcx
	testl	%ebx, %ebx
	jne	LBB0_19
	jmp	LBB0_20
LBB0_12:
	movq	_ExtLED_IB2_GRN@GOTPCREL(%rip), %rcx
LBB0_14:
	orl	(%rcx), %edx
	movq	_IBA7322_LEDBLINK_ON_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	$16650000, %edi                 ## imm = 0xFE0F10
	shlq	%cl, %rdi
	movq	_IBA7322_LEDBLINK_OFF_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	$46875000, %r12d                ## imm = 0x2CB4178
	shlq	%cl, %r12
	orl	%edi, %r12d
	cmpl	$1, %esi
	jne	LBB0_16
LBB0_17:
	movq	_ExtLED_IB1_YEL@GOTPCREL(%rip), %rcx
	testl	%ebx, %ebx
	je	LBB0_20
LBB0_19:
	movl	(%rcx), %ebx
LBB0_20:
	orl	%edx, %ebx
	movl	%ebx, (%rax)
	movq	_kr_extctrl@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_qib_write_kreg
	movq	(%r15), %rdi
	addq	$4, %rdi
	callq	_spin_unlock_irqrestore
	testl	%r12d, %r12d
	je	LBB0_21
## %bb.22:
	movq	_krp_rcvpktledcnt@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r12d, %edx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_qib_write_kreg_port            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_QIB_LED_PHYS,4,2               ## @QIB_LED_PHYS
	.comm	_QIB_LED_LOG,4,2                ## @QIB_LED_LOG
	.comm	_krp_ibcstatus_a,4,2            ## @krp_ibcstatus_a
	.comm	_IB_PHYSPORTSTATE_LINKUP,8,3    ## @IB_PHYSPORTSTATE_LINKUP
	.comm	_IB_PORT_ACTIVE,8,3             ## @IB_PORT_ACTIVE
	.comm	_ExtLED_IB1_MASK,4,2            ## @ExtLED_IB1_MASK
	.comm	_ExtLED_IB2_MASK,4,2            ## @ExtLED_IB2_MASK
	.comm	_ExtLED_IB1_GRN,4,2             ## @ExtLED_IB1_GRN
	.comm	_ExtLED_IB2_GRN,4,2             ## @ExtLED_IB2_GRN
	.comm	_IBA7322_LEDBLINK_ON_SHIFT,4,2  ## @IBA7322_LEDBLINK_ON_SHIFT
	.comm	_IBA7322_LEDBLINK_OFF_SHIFT,4,2 ## @IBA7322_LEDBLINK_OFF_SHIFT
	.comm	_ExtLED_IB1_YEL,4,2             ## @ExtLED_IB1_YEL
	.comm	_ExtLED_IB2_YEL,4,2             ## @ExtLED_IB2_YEL
	.comm	_kr_extctrl,4,2                 ## @kr_extctrl
	.comm	_krp_rcvpktledcnt,4,2           ## @krp_rcvpktledcnt
	.no_dead_strip	_qib_setup_7322_setextled
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qib_setup_7322_setextled
_qib_setup_7322_setextled:              ; @qib_setup_7322_setextled
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	x20, [x0, #8]
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_2
LBB0_1:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_2:
	mov	x19, x0
	ldr	w8, [x0]
	cbz	w8, LBB0_4
; %bb.3:
Lloh0:
	adrp	x9, _QIB_LED_PHYS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _QIB_LED_PHYS@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	and	w23, w9, w8
Lloh3:
	adrp	x9, _QIB_LED_LOG@GOTPAGE
Lloh4:
	ldr	x9, [x9, _QIB_LED_LOG@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	and	w22, w9, w8
	b	LBB0_7
LBB0_4:
	cbz	x1, LBB0_6
; %bb.5:
Lloh6:
	adrp	x8, _krp_ibcstatus_a@GOTPAGE
Lloh7:
	ldr	x8, [x8, _krp_ibcstatus_a@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_qib_read_kreg_port
	mov	x21, x0
	bl	_qib_7322_phys_portstate
Lloh9:
	adrp	x8, _IB_PHYSPORTSTATE_LINKUP@GOTPAGE
Lloh10:
	ldr	x8, [x8, _IB_PHYSPORTSTATE_LINKUP@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cmp	x0, x8
	cset	w23, eq
	mov	x0, x21
	bl	_qib_7322_iblink_state
Lloh12:
	adrp	x8, _IB_PORT_ACTIVE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _IB_PORT_ACTIVE@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	cmp	x0, x8
	cset	w22, eq
	b	LBB0_7
LBB0_6:
	mov	w22, #0
	mov	w23, #0
LBB0_7:
	ldr	x8, [x20]
	add	x0, x8, #4
	bl	_spin_lock_irqsave
	ldr	x8, [x20]
	ldr	w10, [x8]
	ldr	w9, [x19, #4]
Lloh15:
	adrp	x11, _ExtLED_IB1_MASK@GOTPAGE
Lloh16:
	ldr	x11, [x11, _ExtLED_IB1_MASK@GOTPAGEOFF]
Lloh17:
	adrp	x12, _ExtLED_IB2_MASK@GOTPAGE
Lloh18:
	ldr	x12, [x12, _ExtLED_IB2_MASK@GOTPAGEOFF]
	cmp	w9, #1
	csel	x11, x11, x12, eq
	ldr	w11, [x11]
	bic	w10, w10, w11
	cbz	w23, LBB0_9
; %bb.8:
Lloh19:
	adrp	x11, _ExtLED_IB1_GRN@GOTPAGE
Lloh20:
	ldr	x11, [x11, _ExtLED_IB1_GRN@GOTPAGEOFF]
Lloh21:
	adrp	x12, _ExtLED_IB2_GRN@GOTPAGE
Lloh22:
	ldr	x12, [x12, _ExtLED_IB2_GRN@GOTPAGEOFF]
	cmp	w9, #1
	csel	x11, x11, x12, eq
	ldr	w11, [x11]
	orr	w10, w11, w10
Lloh23:
	adrp	x11, _IBA7322_LEDBLINK_ON_SHIFT@GOTPAGE
Lloh24:
	ldr	x11, [x11, _IBA7322_LEDBLINK_ON_SHIFT@GOTPAGEOFF]
Lloh25:
	ldr	w11, [x11]
	mov	w12, #3856
	movk	w12, #254, lsl #16
	lsl	x11, x12, x11
Lloh26:
	adrp	x12, _IBA7322_LEDBLINK_OFF_SHIFT@GOTPAGE
Lloh27:
	ldr	x12, [x12, _IBA7322_LEDBLINK_OFF_SHIFT@GOTPAGEOFF]
Lloh28:
	ldr	w12, [x12]
	mov	w13, #16760
	movk	w13, #715, lsl #16
	lsl	x12, x13, x12
	orr	w21, w12, w11
	b	LBB0_10
LBB0_9:
	mov	w21, #0
LBB0_10:
Lloh29:
	adrp	x11, _ExtLED_IB1_YEL@GOTPAGE
Lloh30:
	ldr	x11, [x11, _ExtLED_IB1_YEL@GOTPAGEOFF]
Lloh31:
	adrp	x12, _ExtLED_IB2_YEL@GOTPAGE
Lloh32:
	ldr	x12, [x12, _ExtLED_IB2_YEL@GOTPAGEOFF]
	cmp	w9, #1
	csel	x9, x11, x12, eq
	ldr	w9, [x9]
	cmp	w22, #0
	csel	w9, wzr, w9, eq
	orr	w2, w9, w10
	str	w2, [x8]
Lloh33:
	adrp	x8, _kr_extctrl@GOTPAGE
Lloh34:
	ldr	x8, [x8, _kr_extctrl@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_qib_write_kreg
	ldr	x8, [x20]
	add	x0, x8, #4
	bl	_spin_unlock_irqrestore
	cbz	w21, LBB0_1
; %bb.11:
Lloh36:
	adrp	x8, _krp_rcvpktledcnt@GOTPAGE
Lloh37:
	ldr	x8, [x8, _krp_rcvpktledcnt@GOTPAGEOFF]
Lloh38:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_qib_write_kreg_port
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_QIB_LED_PHYS,4,2               ; @QIB_LED_PHYS
	.comm	_QIB_LED_LOG,4,2                ; @QIB_LED_LOG
	.comm	_krp_ibcstatus_a,4,2            ; @krp_ibcstatus_a
	.comm	_IB_PHYSPORTSTATE_LINKUP,8,3    ; @IB_PHYSPORTSTATE_LINKUP
	.comm	_IB_PORT_ACTIVE,8,3             ; @IB_PORT_ACTIVE
	.comm	_ExtLED_IB1_MASK,4,2            ; @ExtLED_IB1_MASK
	.comm	_ExtLED_IB2_MASK,4,2            ; @ExtLED_IB2_MASK
	.comm	_ExtLED_IB1_GRN,4,2             ; @ExtLED_IB1_GRN
	.comm	_ExtLED_IB2_GRN,4,2             ; @ExtLED_IB2_GRN
	.comm	_IBA7322_LEDBLINK_ON_SHIFT,4,2  ; @IBA7322_LEDBLINK_ON_SHIFT
	.comm	_IBA7322_LEDBLINK_OFF_SHIFT,4,2 ; @IBA7322_LEDBLINK_OFF_SHIFT
	.comm	_ExtLED_IB1_YEL,4,2             ; @ExtLED_IB1_YEL
	.comm	_ExtLED_IB2_YEL,4,2             ; @ExtLED_IB2_YEL
	.comm	_kr_extctrl,4,2                 ; @kr_extctrl
	.comm	_krp_rcvpktledcnt,4,2           ; @krp_rcvpktledcnt
	.no_dead_strip	_qib_setup_7322_setextled
.subsections_via_symbols
