	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qib_r_shift
_qib_r_shift:                           ## @qib_r_shift
	.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	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	%esi, %r14d
	movq	_BISTEN_LSB@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	shll	%cl, %r14d
	movq	_SJA_EN@GOTPCREL(%rip), %rax
	orl	(%rax), %r14d
	movq	%r8, %r13
	movl	%edx, %r15d
	movq	%rdi, %rbx
	movq	_R_OP_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	_R_OPCODE_LSB@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %r12d
	callq	_qib_r_wait_for_rdy
	testl	%eax, %eax
	js	LBB0_12
## %bb.1:
	testl	%r15d, %r15d
	jle	LBB0_2
## %bb.3:
	orl	%r12d, %r14d
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	testq	%r13, %r13
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%r12d, %ecx
	andb	$7, %cl
	movl	%r12d, %edx
	shrl	$3, %edx
	shll	%cl, %eax
	movl	(%r13,%rdx,4), %esi
	btrl	%ecx, %esi
	orl	%esi, %eax
	movl	%eax, (%r13,%rdx,4)
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	%r14d, %edx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	testq	%rcx, %rcx
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%r12d, %eax
	shrl	$3, %eax
	movl	(%rcx,%rax,4), %eax
	movl	%r12d, %ecx
	andb	$7, %cl
	movzbl	%cl, %ecx
	xorl	%edx, %edx
	btl	%ecx, %eax
	setb	%dl
	movq	_R_TDI_LSB@GOTPCREL(%rip), %rax
	movzbl	(%rax), %ecx
	shll	%cl, %edx
	orl	%r14d, %edx
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	_kr_r_access@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_qib_write_kreg
	movq	_kr_scratch@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_qib_read_kreg32
	movq	%rbx, %rdi
	callq	_qib_r_wait_for_rdy
	testl	%eax, %eax
	js	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=1
	incl	%r12d
	cmpl	%r12d, %r15d
	jne	LBB0_4
## %bb.10:
	movl	%r15d, %r12d
	jmp	LBB0_11
LBB0_2:
	xorl	%r12d, %r12d
LBB0_11:
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movq	_SJA_EN@GOTPCREL(%rip), %rax
	movq	_BISTEN_LSB@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	orl	(%rax), %edx
	movq	_kr_r_access@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_qib_write_kreg
	movq	_kr_scratch@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_qib_read_kreg32
	movq	%rbx, %rdi
	callq	_qib_r_wait_for_rdy
	testl	%eax, %eax
	cmovsl	%eax, %r12d
	movl	%r12d, %eax
LBB0_12:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SJA_EN,4,2                     ## @SJA_EN
	.comm	_BISTEN_LSB,4,2                 ## @BISTEN_LSB
	.comm	_R_OP_SHIFT,4,2                 ## @R_OP_SHIFT
	.comm	_R_OPCODE_LSB,4,2               ## @R_OPCODE_LSB
	.comm	_R_TDI_LSB,4,2                  ## @R_TDI_LSB
	.comm	_kr_r_access,4,2                ## @kr_r_access
	.comm	_kr_scratch,4,2                 ## @kr_scratch
	.no_dead_strip	_qib_r_shift
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qib_r_shift
_qib_r_shift:                           ; @qib_r_shift
	.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	x21, x4
	mov	x23, x3
	mov	x22, x2
	str	w1, [sp, #12]                   ; 4-byte Folded Spill
	mov	x19, x0
Lloh0:
	adrp	x8, _SJA_EN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SJA_EN@GOTPAGEOFF]
Lloh2:
	ldr	w24, [x8]
Lloh3:
	adrp	x8, _BISTEN_LSB@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BISTEN_LSB@GOTPAGEOFF]
Lloh5:
	ldr	w26, [x8]
Lloh6:
	adrp	x8, _R_OP_SHIFT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _R_OP_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w25, [x8]
Lloh9:
	adrp	x8, _R_OPCODE_LSB@GOTPAGE
Lloh10:
	ldr	x8, [x8, _R_OPCODE_LSB@GOTPAGEOFF]
Lloh11:
	ldr	w20, [x8]
	bl	_qib_r_wait_for_rdy
	tbnz	w0, #31, LBB0_12
; %bb.1:
Lloh12:
	adrp	x28, _kr_r_access@GOTPAGE
Lloh13:
	ldr	x28, [x28, _kr_r_access@GOTPAGEOFF]
Lloh14:
	adrp	x27, _kr_scratch@GOTPAGE
Lloh15:
	ldr	x27, [x27, _kr_scratch@GOTPAGEOFF]
	cmp	w22, #1
	b.lt	LBB0_10
; %bb.2:
	mov	x9, x24
	mov	w24, #0
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	lsl	w8, w8, w26
	orr	w8, w8, w9
	lsl	w9, w25, w20
	orr	w25, w8, w9
Lloh16:
	adrp	x26, _R_TDI_LSB@GOTPAGE
Lloh17:
	ldr	x26, [x26, _R_TDI_LSB@GOTPAGEOFF]
	mov	w20, #1
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	lsr	w8, w24, #3
	cbz	x21, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	and	w9, w24, #0x7
	lsl	x10, x8, #2
	ldr	w11, [x21, x10]
	lsl	w12, w20, w9
	bic	w11, w11, w12
	lsl	w9, w0, w9
	orr	w9, w11, w9
	str	w9, [x21, x10]
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x2, x25
	cbz	x23, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x23, w8, uxtw #2]
	and	w9, w24, #0x7
	lsr	w8, w8, w9
	and	w8, w8, #0x1
	ldr	w9, [x26]
	lsl	w8, w8, w9
	orr	w2, w8, w25
LBB0_7:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w1, [x28]
	mov	x0, x19
	bl	_qib_write_kreg
	ldr	w1, [x27]
	mov	x0, x19
	bl	_qib_read_kreg32
	mov	x0, x19
	bl	_qib_r_wait_for_rdy
	tbnz	w0, #31, LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w24, w24, #1
	cmp	w22, w24
	b.ne	LBB0_3
; %bb.9:
	mov	x24, x22
	b	LBB0_11
LBB0_10:
	mov	w24, #0
LBB0_11:
Lloh18:
	adrp	x8, _SJA_EN@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SJA_EN@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
Lloh21:
	adrp	x9, _BISTEN_LSB@GOTPAGE
Lloh22:
	ldr	x9, [x9, _BISTEN_LSB@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	ldr	w10, [sp, #12]                  ; 4-byte Folded Reload
	lsl	w9, w10, w9
	orr	w2, w9, w8
	ldr	w1, [x28]
	mov	x0, x19
	bl	_qib_write_kreg
	ldr	w1, [x27]
	mov	x0, x19
	bl	_qib_read_kreg32
	mov	x0, x19
	bl	_qib_r_wait_for_rdy
	cmp	w0, #0
	csel	w0, w0, w24, lt
LBB0_12:
	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 AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_SJA_EN,4,2                     ; @SJA_EN
	.comm	_BISTEN_LSB,4,2                 ; @BISTEN_LSB
	.comm	_R_OP_SHIFT,4,2                 ; @R_OP_SHIFT
	.comm	_R_OPCODE_LSB,4,2               ; @R_OPCODE_LSB
	.comm	_R_TDI_LSB,4,2                  ; @R_TDI_LSB
	.comm	_kr_r_access,4,2                ; @kr_r_access
	.comm	_kr_scratch,4,2                 ; @kr_scratch
	.no_dead_strip	_qib_r_shift
.subsections_via_symbols
