	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qsfp_read
_qsfp_read:                             ## @qsfp_read
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	movl	%esi, %r12d
	movq	%rdi, %r14
	movq	16(%rdi), %r15
	leaq	8(%r15), %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock_interruptible
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_28
## %bb.1:
	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	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_27
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), %edx
	orl	%esi, %edx
	xorl	%ecx, %ecx
	cmpq	$0, 8(%r14)
	je	LBB0_5
## %bb.4:
	movq	_QSFP_GPIO_PORT2_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_5:
	shll	%cl, %esi
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %edx
	movq	%r15, %rdi
	movl	%edx, -56(%rbp)                 ## 4-byte Spill
	movl	%edx, %ecx
	callq	*16(%r15)
	movl	$20, %edi
	callq	_msleep
	movq	%r15, %rdi
	callq	_qib_twsi_reset
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	je	LBB0_6
## %bb.8:
	movl	(%r14), %esi
	leaq	L_.str(%rip), %rdx
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_qib_dev_porterr
LBB0_13:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_19:
	movl	$10, %edi
	callq	_udelay
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movl	-56(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, %esi
	movl	%ecx, %edx
	callq	*16(%r14)
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_21
## %bb.20:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_qib_dev_err
LBB0_21:
	movq	_QSFP_MAX_RETRY@GOTPCREL(%rip), %rax
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	cmpl	(%rax), %ecx
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	jl	LBB0_24
## %bb.22:
	testl	%r13d, %r13d
	je	LBB0_24
## %bb.23:
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_qib_dev_porterr
	jmp	LBB0_26
LBB0_24:
	testl	%ecx, %ecx
	je	LBB0_26
## %bb.25:
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rdx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_qib_dev_porterr
LBB0_26:
	movl	$20, %edi
	callq	_msleep
LBB0_27:
	movq	%rbx, %rdi
	callq	_mutex_unlock
LBB0_28:
	movl	%r13d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	testl	%ecx, %ecx
	jle	LBB0_7
## %bb.9:
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	xorl	%r15d, %r15d
	movl	%r12d, %ebx
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	%r13d, %r15d
LBB0_18:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	cmpl	%ecx, %r13d
	jge	LBB0_19
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	subl	%r15d, %ecx
	movq	_QSFP_PAGESIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %eax
	cltd
	idivl	%esi
	movl	%esi, %r14d
	subl	%edx, %r14d
	addl	%ecx, %edx
	cmpl	%esi, %edx
	cmovbel	%ecx, %r14d
	movq	_QSFP_DEV@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movslq	%r15d, %rax
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rax,4), %rcx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %r12d
	movl	%ebx, %edx
	movl	%r14d, %r8d
	callq	_qib_twsi_blk_rd
	testl	%eax, %eax
	je	LBB0_11
## %bb.14:                              ##   in Loop: Header=BB0_10 Depth=1
	testl	%r15d, %r15d
	jne	LBB0_11
## %bb.15:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	incl	%ecx
	xorl	%r13d, %r13d
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	_QSFP_MAX_RETRY@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	movl	%r12d, %ebx
	jl	LBB0_16
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	%r12d, %ebx
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=1
	testl	%eax, %eax
	jne	LBB0_13
## %bb.17:                              ##   in Loop: Header=BB0_10 Depth=1
	addl	%r14d, %ebx
	addl	%r14d, %r15d
	movl	%r15d, %r13d
	jmp	LBB0_18
LBB0_7:
	xorl	%r13d, %r13d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_19
	.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 read failed\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_QSFP_PAGESIZE,4,2              ## @QSFP_PAGESIZE
	.comm	_QSFP_DEV,4,2                   ## @QSFP_DEV
	.comm	_QSFP_MAX_RETRY,4,2             ## @QSFP_MAX_RETRY
L_.str.1:                               ## @.str.1
	.asciz	"QSFP interface bus stuck non-idle\n"

L_.str.2:                               ## @.str.2
	.asciz	"QSFP failed even retrying\n"

L_.str.3:                               ## @.str.3
	.asciz	"QSFP retries: %d\n"

	.no_dead_strip	_qsfp_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qsfp_read
_qsfp_read:                             ; @qsfp_read
	.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	x24, x3
	mov	x25, x2
	mov	x26, x1
	mov	x21, x0
	ldr	x20, [x0, #16]
	add	x19, x20, #8
	mov	x0, x19
	bl	_mutex_lock_interruptible
	mov	x22, x0
	cbnz	w0, LBB0_15
; %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	w22, w8
	b	LBB0_14
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, [x21, #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	w23, w8, w10
	ldr	x8, [x20, #16]
	mov	x0, x20
	mov	x2, x23
	mov	x3, x23
	blr	x8
	mov	w0, #20
	bl	_msleep
	mov	x0, x20
	bl	_qib_twsi_reset
	str	w0, [sp, #12]                   ; 4-byte Folded Spill
	cbz	w0, LBB0_16
; %bb.4:
	ldr	w1, [x21]
Lloh18:
	adrp	x2, l_.str@PAGE
Lloh19:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	bl	_qib_dev_porterr
	mov	w27, #0
LBB0_5:
Lloh20:
	adrp	x8, _EIO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_6:
	mov	w0, #10
	bl	_udelay
	ldr	x8, [x20, #16]
	mov	x0, x20
	mov	x1, x23
	mov	x2, x23
	mov	x3, x23
	blr	x8
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	cbz	w8, LBB0_8
; %bb.7:
Lloh23:
	adrp	x1, l_.str.1@PAGE
Lloh24:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_qib_dev_err
LBB0_8:
Lloh25:
	adrp	x8, _QSFP_MAX_RETRY@GOTPAGE
Lloh26:
	ldr	x8, [x8, _QSFP_MAX_RETRY@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	cmp	w27, w8
	ccmp	w22, #0, #4, ge
	b.ne	LBB0_11
; %bb.9:
	cbz	w27, LBB0_13
; %bb.10:
	ldr	w1, [x21]
	str	x27, [sp]
Lloh28:
	adrp	x2, l_.str.3@PAGE
Lloh29:
	add	x2, x2, l_.str.3@PAGEOFF
	b	LBB0_12
LBB0_11:
	ldr	w1, [x21]
Lloh30:
	adrp	x2, l_.str.2@PAGE
Lloh31:
	add	x2, x2, l_.str.2@PAGEOFF
LBB0_12:
	mov	x0, x20
	bl	_qib_dev_porterr
LBB0_13:
	mov	w0, #20
	bl	_msleep
LBB0_14:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_15:
	mov	x0, x22
	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
LBB0_16:
	cmp	w24, #1
	b.lt	LBB0_23
; %bb.17:
	mov	w27, #0
	mov	w22, #0
	b	LBB0_19
LBB0_18:                                ;   in Loop: Header=BB0_19 Depth=1
	mov	w22, #0
	cmp	w22, w24
	b.ge	LBB0_6
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
Lloh32:
	adrp	x8, _QSFP_PAGESIZE@GOTPAGE
Lloh33:
	ldr	x8, [x8, _QSFP_PAGESIZE@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	sdiv	w9, w26, w8
	msub	w9, w9, w8, w26
	sub	w10, w24, w22
	add	w11, w9, w10
	sub	w9, w8, w9
	cmp	w11, w8
	csel	w28, w9, w10, hi
Lloh35:
	adrp	x8, _QSFP_DEV@GOTPAGE
Lloh36:
	ldr	x8, [x8, _QSFP_DEV@GOTPAGEOFF]
Lloh37:
	ldr	w1, [x8]
	add	x3, x25, w22, sxtw #2
	mov	x0, x20
	mov	x2, x26
	mov	x4, x28
	bl	_qib_twsi_blk_rd
	cmp	w0, #0
	ccmp	w22, #0, #0, ne
	b.ne	LBB0_21
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=1
	add	w27, w27, #1
Lloh38:
	adrp	x8, _QSFP_MAX_RETRY@GOTPAGE
Lloh39:
	ldr	x8, [x8, _QSFP_MAX_RETRY@GOTPAGEOFF]
Lloh40:
	ldr	w8, [x8]
	cmp	w27, w8
	b.lt	LBB0_18
LBB0_21:                                ;   in Loop: Header=BB0_19 Depth=1
	cbnz	w0, LBB0_5
; %bb.22:                               ;   in Loop: Header=BB0_19 Depth=1
	add	w26, w28, w26
	add	w22, w28, w22
	cmp	w22, w24
	b.lt	LBB0_19
	b	LBB0_6
LBB0_23:
	mov	w22, #0
	mov	w27, #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 AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.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 read failed\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_QSFP_PAGESIZE,4,2              ; @QSFP_PAGESIZE
	.comm	_QSFP_DEV,4,2                   ; @QSFP_DEV
	.comm	_QSFP_MAX_RETRY,4,2             ; @QSFP_MAX_RETRY
l_.str.1:                               ; @.str.1
	.asciz	"QSFP interface bus stuck non-idle\n"

l_.str.2:                               ; @.str.2
	.asciz	"QSFP failed even retrying\n"

l_.str.3:                               ; @.str.3
	.asciz	"QSFP retries: %d\n"

	.no_dead_strip	_qsfp_read
.subsections_via_symbols
