	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qib_6120_setup_setextled
_qib_6120_setup_setextled:              ## @qib_6120_setup_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	%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	8(%rdi), %r12
	cmpq	$0, 8(%r12)
	je	LBB0_1
## %bb.18:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	(%rdi), %ecx
	testl	%ecx, %ecx
	je	LBB0_9
## %bb.2:
	movq	_QIB_LED_PHYS@GOTPCREL(%rip), %rax
	testl	%ecx, (%rax)
	jne	LBB0_3
## %bb.4:
	movq	_IB_PHYSPORTSTATE_DISABLED@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_9:
	testq	%rsi, %rsi
	je	LBB0_10
## %bb.11:
	movq	_kr_ibcstatus@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_qib_read_kreg64
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_qib_6120_phys_portstate
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_qib_6120_iblink_state
	jmp	LBB0_12
LBB0_3:
	movq	_IB_PHYSPORTSTATE_LINKUP@GOTPCREL(%rip), %rax
LBB0_5:
	movq	_QIB_LED_LOG@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	jne	LBB0_6
## %bb.7:
	movq	_IB_PORT_DOWN@GOTPCREL(%rip), %rcx
	jmp	LBB0_8
LBB0_6:
	movq	_IB_PORT_ACTIVE@GOTPCREL(%rip), %rcx
LBB0_8:
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	(%rcx), %rax
LBB0_12:
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
LBB0_13:
	movq	(%r12), %rdi
	addq	$8, %rdi
	callq	_spin_lock_irqsave
	movq	(%r12), %rax
	movq	(%rax), %r14
	movq	_EXTCtrl@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movq	_LEDPriPortGreenOn@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_SYM_MASK
	movq	%rax, %r13
	movl	(%r15), %edi
	movq	_LEDPriPortYellowOn@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_SYM_MASK
	movq	%rax, %rbx
	orq	%r13, %rbx
	notq	%rbx
	andq	%r14, %rbx
	movq	_IB_PHYSPORTSTATE_LINKUP@GOTPCREL(%rip), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	cmpq	(%rax), %rcx
	jne	LBB0_15
## %bb.14:
	movl	(%r15), %edi
	movq	_LEDPriPortYellowOn@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_SYM_MASK
	orq	%rax, %rbx
LBB0_15:
	movq	_IB_PORT_ACTIVE@GOTPCREL(%rip), %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	cmpq	(%rax), %rcx
	jne	LBB0_17
## %bb.16:
	movl	(%r15), %edi
	movq	_LEDPriPortGreenOn@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_SYM_MASK
	orq	%rax, %rbx
LBB0_17:
	movq	(%r12), %rax
	movq	%rbx, (%rax)
	movq	_kr_extctrl@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movq	%rbx, %rdx
	callq	_qib_write_kreg
	movq	(%r12), %rdi
	addq	$8, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
LBB0_10:
	xorl	%eax, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_QIB_LED_PHYS,4,2               ## @QIB_LED_PHYS
	.comm	_IB_PHYSPORTSTATE_LINKUP,8,3    ## @IB_PHYSPORTSTATE_LINKUP
	.comm	_IB_PHYSPORTSTATE_DISABLED,8,3  ## @IB_PHYSPORTSTATE_DISABLED
	.comm	_QIB_LED_LOG,4,2                ## @QIB_LED_LOG
	.comm	_IB_PORT_ACTIVE,8,3             ## @IB_PORT_ACTIVE
	.comm	_IB_PORT_DOWN,8,3               ## @IB_PORT_DOWN
	.comm	_kr_ibcstatus,4,2               ## @kr_ibcstatus
	.comm	_EXTCtrl,4,2                    ## @EXTCtrl
	.comm	_LEDPriPortGreenOn,4,2          ## @LEDPriPortGreenOn
	.comm	_LEDPriPortYellowOn,4,2         ## @LEDPriPortYellowOn
	.comm	_kr_extctrl,4,2                 ## @kr_extctrl
	.no_dead_strip	_qib_6120_setup_setextled
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qib_6120_setup_setextled
_qib_6120_setup_setextled:              ; @qib_6120_setup_setextled
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, [x0, #8]
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_2
; %bb.1:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_2:
	ldr	w8, [x0]
Lloh0:
	adrp	x24, _IB_PHYSPORTSTATE_LINKUP@GOTPAGE
Lloh1:
	ldr	x24, [x24, _IB_PHYSPORTSTATE_LINKUP@GOTPAGEOFF]
Lloh2:
	adrp	x23, _IB_PORT_ACTIVE@GOTPAGE
Lloh3:
	ldr	x23, [x23, _IB_PORT_ACTIVE@GOTPAGEOFF]
	cbz	w8, LBB0_4
; %bb.3:
Lloh4:
	adrp	x9, _QIB_LED_PHYS@GOTPAGE
Lloh5:
	ldr	x9, [x9, _QIB_LED_PHYS@GOTPAGEOFF]
Lloh6:
	adrp	x10, _IB_PHYSPORTSTATE_DISABLED@GOTPAGE
Lloh7:
	ldr	x10, [x10, _IB_PHYSPORTSTATE_DISABLED@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	csel	x9, x10, x24, eq
	ldr	x21, [x9]
Lloh9:
	adrp	x9, _QIB_LED_LOG@GOTPAGE
Lloh10:
	ldr	x9, [x9, _QIB_LED_LOG@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
Lloh12:
	adrp	x10, _IB_PORT_DOWN@GOTPAGE
Lloh13:
	ldr	x10, [x10, _IB_PORT_DOWN@GOTPAGEOFF]
	tst	w9, w8
	csel	x8, x10, x23, eq
	ldr	x20, [x8]
	b	LBB0_7
LBB0_4:
	cbz	x1, LBB0_6
; %bb.5:
Lloh14:
	adrp	x8, _kr_ibcstatus@GOTPAGE
Lloh15:
	ldr	x8, [x8, _kr_ibcstatus@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_qib_read_kreg64
	mov	x20, x0
	bl	_qib_6120_phys_portstate
	mov	x21, x0
	mov	x0, x20
	bl	_qib_6120_iblink_state
	mov	x20, x0
	b	LBB0_7
LBB0_6:
	mov	x20, #0
	mov	x21, #0
LBB0_7:
	ldr	x8, [x19]
	add	x0, x8, #8
	bl	_spin_lock_irqsave
	ldr	x8, [x19]
	ldr	x28, [x8]
Lloh17:
	adrp	x25, _EXTCtrl@GOTPAGE
Lloh18:
	ldr	x25, [x25, _EXTCtrl@GOTPAGEOFF]
	ldr	w0, [x25]
Lloh19:
	adrp	x26, _LEDPriPortGreenOn@GOTPAGE
Lloh20:
	ldr	x26, [x26, _LEDPriPortGreenOn@GOTPAGEOFF]
	ldr	w1, [x26]
	bl	_SYM_MASK
	mov	x22, x0
	ldr	w0, [x25]
Lloh21:
	adrp	x27, _LEDPriPortYellowOn@GOTPAGE
Lloh22:
	ldr	x27, [x27, _LEDPriPortYellowOn@GOTPAGEOFF]
	ldr	w1, [x27]
	bl	_SYM_MASK
	orr	x8, x0, x22
	bic	x22, x28, x8
	ldr	x8, [x24]
	cmp	x21, x8
	b.ne	LBB0_9
; %bb.8:
	ldr	w0, [x25]
	ldr	w1, [x27]
	bl	_SYM_MASK
	orr	x22, x0, x22
LBB0_9:
	ldr	x8, [x23]
	cmp	x20, x8
	b.ne	LBB0_11
; %bb.10:
	ldr	w0, [x25]
	ldr	w1, [x26]
	bl	_SYM_MASK
	orr	x22, x0, x22
LBB0_11:
	ldr	x8, [x19]
	str	x22, [x8]
Lloh23:
	adrp	x8, _kr_extctrl@GOTPAGE
Lloh24:
	ldr	x8, [x8, _kr_extctrl@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x22
	bl	_qib_write_kreg
	ldr	x8, [x19]
	add	x0, x8, #8
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_spin_unlock_irqrestore
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh8
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_QIB_LED_PHYS,4,2               ; @QIB_LED_PHYS
	.comm	_IB_PHYSPORTSTATE_LINKUP,8,3    ; @IB_PHYSPORTSTATE_LINKUP
	.comm	_IB_PHYSPORTSTATE_DISABLED,8,3  ; @IB_PHYSPORTSTATE_DISABLED
	.comm	_QIB_LED_LOG,4,2                ; @QIB_LED_LOG
	.comm	_IB_PORT_ACTIVE,8,3             ; @IB_PORT_ACTIVE
	.comm	_IB_PORT_DOWN,8,3               ; @IB_PORT_DOWN
	.comm	_kr_ibcstatus,4,2               ; @kr_ibcstatus
	.comm	_EXTCtrl,4,2                    ; @EXTCtrl
	.comm	_LEDPriPortGreenOn,4,2          ; @LEDPriPortGreenOn
	.comm	_LEDPriPortYellowOn,4,2         ; @LEDPriPortYellowOn
	.comm	_kr_extctrl,4,2                 ; @kr_extctrl
	.no_dead_strip	_qib_6120_setup_setextled
.subsections_via_symbols
