	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qib_qsfp_write
_qib_qsfp_write:                        ## @qib_qsfp_write
	.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	%ecx, -56(%rbp)                 ## 4-byte Spill
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movl	%esi, %r13d
	movq	%rdi, %r12
	movq	16(%rdi), %r15
	leaq	8(%r15), %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock_interruptible
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_13
## %bb.1:
	movq	%r12, %rdi
	movl	-56(%rbp), %r12d                ## 4-byte Reload
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	(%r15), %rax
	movq	_QIB_TWSI_NO_DEV@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.2:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_12
LBB0_3:
	movq	_QSFP_GPIO_MOD_SEL_N@GOTPCREL(%rip), %rax
	movq	_QSFP_GPIO_MOD_RST_N@GOTPCREL(%rip), %rcx
	movq	_QSFP_GPIO_LP_MODE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	orl	(%rcx), %esi
	movl	(%rax), %r14d
	orl	%esi, %r14d
	xorl	%ecx, %ecx
	movq	%rdi, %r15
	cmpq	$0, 8(%rdi)
	je	LBB0_5
## %bb.4:
	movq	_QSFP_GPIO_PORT2_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_5:
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	shll	%cl, %esi
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %r14d
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	%r14d, %edx
	movl	%r14d, %ecx
	callq	*16(%rbx)
	movl	$20, %edi
	callq	_msleep
	movq	%rbx, %rdi
	callq	_qib_twsi_reset
	testl	%eax, %eax
	movl	%r14d, -52(%rbp)                ## 4-byte Spill
	je	LBB0_6
## %bb.14:
	movl	(%r15), %esi
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	callq	_qib_dev_porterr
LBB0_9:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_11:
	movl	$10, %edi
	callq	_udelay
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, %esi
	movl	%ecx, %edx
	callq	*16(%rdi)
	movl	$20, %edi
	callq	_msleep
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
LBB0_12:
	movq	%rbx, %rdi
	callq	_mutex_unlock
LBB0_13:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	xorl	%r14d, %r14d
	testl	%r12d, %r12d
	jle	LBB0_11
## %bb.7:
	movq	_QSFP_DEV@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r12d, %ecx
	subl	%r14d, %ecx
	movq	_QSFP_PAGESIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %eax
	cltd
	idivl	%esi
	movl	%esi, %ebx
	subl	%edx, %ebx
	addl	%ecx, %edx
	cmpl	%esi, %edx
	cmovbel	%ecx, %ebx
	movl	(%r15), %esi
	movslq	%r14d, %rax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rax,4), %rcx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %edx
	movl	%ebx, %r8d
	callq	_qib_twsi_blk_wr
	testl	%eax, %eax
	jne	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	addl	%ebx, %r13d
	addl	%ebx, %r14d
	cmpl	%r12d, %r14d
	jl	LBB0_8
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_QIB_TWSI_NO_DEV,8,3            ## @QIB_TWSI_NO_DEV
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_QSFP_GPIO_MOD_SEL_N,4,2        ## @QSFP_GPIO_MOD_SEL_N
	.comm	_QSFP_GPIO_MOD_RST_N,4,2        ## @QSFP_GPIO_MOD_RST_N
	.comm	_QSFP_GPIO_LP_MODE,4,2          ## @QSFP_GPIO_LP_MODE
	.comm	_QSFP_GPIO_PORT2_SHIFT,4,2      ## @QSFP_GPIO_PORT2_SHIFT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"QSFP interface Reset for write failed\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_QSFP_PAGESIZE,4,2              ## @QSFP_PAGESIZE
	.comm	_QSFP_DEV,4,2                   ## @QSFP_DEV
	.no_dead_strip	_qib_qsfp_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qib_qsfp_write
_qib_qsfp_write:                        ; @qib_qsfp_write
	.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
	mov	x22, x3
	mov	x23, x2
	mov	x24, x1
	mov	x26, x0
	ldr	x20, [x0, #16]
	add	x19, x20, #8
	mov	x0, x19
	bl	_mutex_lock_interruptible
	mov	x25, x0
	cbnz	w0, LBB0_8
; %bb.1:
	ldr	x8, [x20]
Lloh0:
	adrp	x9, _QIB_TWSI_NO_DEV@GOTPAGE
Lloh1:
	ldr	x9, [x9, _QIB_TWSI_NO_DEV@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.2:
Lloh3:
	adrp	x8, _ENXIO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w25, w8
	b	LBB0_7
LBB0_3:
Lloh6:
	adrp	x8, _QSFP_GPIO_MOD_SEL_N@GOTPAGE
Lloh7:
	ldr	x8, [x8, _QSFP_GPIO_MOD_SEL_N@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _QSFP_GPIO_MOD_RST_N@GOTPAGE
Lloh10:
	ldr	x9, [x9, _QSFP_GPIO_MOD_RST_N@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
Lloh12:
	adrp	x10, _QSFP_GPIO_LP_MODE@GOTPAGE
Lloh13:
	ldr	x10, [x10, _QSFP_GPIO_LP_MODE@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
	orr	w9, w10, w9
	orr	w8, w9, w8
	ldr	x10, [x26, #8]
Lloh15:
	adrp	x11, _QSFP_GPIO_PORT2_SHIFT@GOTPAGE
Lloh16:
	ldr	x11, [x11, _QSFP_GPIO_PORT2_SHIFT@GOTPAGEOFF]
Lloh17:
	ldr	w11, [x11]
	cmp	x10, #0
	csel	w10, wzr, w11, eq
	lsl	w1, w9, w10
	lsl	w21, w8, w10
	ldr	x8, [x20, #16]
	mov	x0, x20
	mov	x2, x21
	mov	x3, x21
	blr	x8
	mov	w0, #20
	bl	_msleep
	mov	x0, x20
	bl	_qib_twsi_reset
	cbz	w0, LBB0_9
; %bb.4:
	ldr	w1, [x26]
Lloh18:
	adrp	x2, l_.str@PAGE
Lloh19:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	bl	_qib_dev_porterr
LBB0_5:
Lloh20:
	adrp	x8, _EIO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w25, w8
LBB0_6:
	mov	w0, #10
	bl	_udelay
	ldr	x8, [x20, #16]
	mov	x0, x20
	mov	x1, x21
	mov	x2, x21
	mov	x3, x21
	blr	x8
	mov	w0, #20
	bl	_msleep
LBB0_7:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_8:
	mov	x0, x25
	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_9:
	cmp	w22, #1
	b.lt	LBB0_13
; %bb.10:
	mov	w25, #0
Lloh23:
	adrp	x27, _QSFP_PAGESIZE@GOTPAGE
Lloh24:
	ldr	x27, [x27, _QSFP_PAGESIZE@GOTPAGEOFF]
Lloh25:
	adrp	x28, _QSFP_DEV@GOTPAGE
Lloh26:
	ldr	x28, [x28, _QSFP_DEV@GOTPAGEOFF]
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x27]
	sdiv	w9, w24, w8
	msub	w9, w9, w8, w24
	sub	w10, w22, w25
	add	w11, w9, w10
	sub	w9, w8, w9
	cmp	w11, w8
	csel	w26, w9, w10, hi
	ldr	w1, [x28]
	add	x3, x23, w25, sxtw #2
	mov	x0, x20
	mov	x2, x24
	mov	x4, x26
	bl	_qib_twsi_blk_wr
	cbnz	w0, LBB0_5
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	add	w24, w26, w24
	add	w25, w26, w25
	cmp	w25, w22
	b.lt	LBB0_11
	b	LBB0_6
LBB0_13:
	mov	w25, #0
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_QIB_TWSI_NO_DEV,8,3            ; @QIB_TWSI_NO_DEV
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_QSFP_GPIO_MOD_SEL_N,4,2        ; @QSFP_GPIO_MOD_SEL_N
	.comm	_QSFP_GPIO_MOD_RST_N,4,2        ; @QSFP_GPIO_MOD_RST_N
	.comm	_QSFP_GPIO_LP_MODE,4,2          ; @QSFP_GPIO_LP_MODE
	.comm	_QSFP_GPIO_PORT2_SHIFT,4,2      ; @QSFP_GPIO_PORT2_SHIFT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"QSFP interface Reset for write failed\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_QSFP_PAGESIZE,4,2              ; @QSFP_PAGESIZE
	.comm	_QSFP_DEV,4,2                   ; @QSFP_DEV
	.no_dead_strip	_qib_qsfp_write
.subsections_via_symbols
