	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function d40_residue
_d40_residue:                           ## @d40_residue
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_chan_is_logical
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	8(%rbx), %rdi
	movq	_D40_MEM_LCSP2_ECNT_POS@GOTPCREL(%rip), %r14
	movq	_D40_MEM_LCSP2_ECNT_MASK@GOTPCREL(%rip), %r15
	jmp	LBB0_3
LBB0_2:
	movq	%rbx, %rdi
	callq	_chan_base
	movq	_D40_CHAN_REG_SDELT@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	leaq	(%rax,%rcx,4), %rdi
	movq	_D40_SREG_ELEM_PHY_ECNT_POS@GOTPCREL(%rip), %r14
	movq	_D40_SREG_ELEM_PHY_ECNT_MASK@GOTPCREL(%rip), %r15
LBB0_3:
	callq	_readl
	andl	(%r15), %eax
	movb	(%r14), %cl
	sarl	%cl, %eax
	imull	(%rbx), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_D40_MEM_LCSP2_ECNT_MASK,4,2    ## @D40_MEM_LCSP2_ECNT_MASK
	.comm	_D40_MEM_LCSP2_ECNT_POS,4,2     ## @D40_MEM_LCSP2_ECNT_POS
	.comm	_D40_CHAN_REG_SDELT,4,2         ## @D40_CHAN_REG_SDELT
	.comm	_D40_SREG_ELEM_PHY_ECNT_MASK,4,2 ## @D40_SREG_ELEM_PHY_ECNT_MASK
	.comm	_D40_SREG_ELEM_PHY_ECNT_POS,4,2 ## @D40_SREG_ELEM_PHY_ECNT_POS
	.no_dead_strip	_d40_residue
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function d40_residue
_d40_residue:                           ; @d40_residue
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	bl	_chan_is_logical
	cbz	x0, LBB0_2
; %bb.1:
	ldr	x0, [x19, #8]
Lloh0:
	adrp	x20, _D40_MEM_LCSP2_ECNT_POS@GOTPAGE
Lloh1:
	ldr	x20, [x20, _D40_MEM_LCSP2_ECNT_POS@GOTPAGEOFF]
Lloh2:
	adrp	x21, _D40_MEM_LCSP2_ECNT_MASK@GOTPAGE
Lloh3:
	ldr	x21, [x21, _D40_MEM_LCSP2_ECNT_MASK@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:
	mov	x0, x19
	bl	_chan_base
Lloh4:
	adrp	x8, _D40_CHAN_REG_SDELT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _D40_CHAN_REG_SDELT@GOTPAGEOFF]
Lloh6:
	ldrsw	x8, [x8]
	add	x0, x0, x8, lsl #2
Lloh7:
	adrp	x20, _D40_SREG_ELEM_PHY_ECNT_POS@GOTPAGE
Lloh8:
	ldr	x20, [x20, _D40_SREG_ELEM_PHY_ECNT_POS@GOTPAGEOFF]
Lloh9:
	adrp	x21, _D40_SREG_ELEM_PHY_ECNT_MASK@GOTPAGE
Lloh10:
	ldr	x21, [x21, _D40_SREG_ELEM_PHY_ECNT_MASK@GOTPAGEOFF]
LBB0_3:
	bl	_readl
	ldr	w8, [x21]
	and	w8, w8, w0
	ldr	w9, [x20]
	asr	w8, w8, w9
	ldr	w9, [x19]
	mul	w0, w9, w8
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_D40_MEM_LCSP2_ECNT_MASK,4,2    ; @D40_MEM_LCSP2_ECNT_MASK
	.comm	_D40_MEM_LCSP2_ECNT_POS,4,2     ; @D40_MEM_LCSP2_ECNT_POS
	.comm	_D40_CHAN_REG_SDELT,4,2         ; @D40_CHAN_REG_SDELT
	.comm	_D40_SREG_ELEM_PHY_ECNT_MASK,4,2 ; @D40_SREG_ELEM_PHY_ECNT_MASK
	.comm	_D40_SREG_ELEM_PHY_ECNT_POS,4,2 ; @D40_SREG_ELEM_PHY_ECNT_POS
	.no_dead_strip	_d40_residue
.subsections_via_symbols
