	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function k8_dbam_to_chip_select
_k8_dbam_to_chip_select:                ## @k8_dbam_to_chip_select
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%edx, %r14d
	movq	8(%rdi), %rax
	movq	_K8_REV_F@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_5
## %bb.1:
	movq	_K8_REV_D@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_2
## %bb.3:
	xorl	%edi, %edi
	cmpl	$7, %r14d
	setae	%dil
	callq	_WARN_ON
	jmp	LBB0_4
LBB0_5:
	xorl	%eax, %eax
	testq	%rsi, %rsi
	sete	%al
	movl	(%rdi,%rax,4), %ebx
	xorl	%edi, %edi
	cmpl	$12, %r14d
	setae	%dil
	callq	_WARN_ON
	movq	_WIDTH_128@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	movl	%r14d, %edi
	movl	%ebx, %esi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_ddr2_cs_size                   ## TAILCALL
LBB0_2:
	xorl	%edi, %edi
	cmpl	$11, %r14d
	setae	%dil
	callq	_WARN_ON
	movl	%r14d, %eax
	movl	$2863311531, %ecx               ## imm = 0xAAAAAAAB
	imulq	%rax, %rcx
	shrq	$33, %rcx
	xorl	%eax, %eax
	cmpl	$6, %r14d
	setae	%al
	subl	%ecx, %r14d
	subl	%eax, %r14d
LBB0_4:
	movl	$32, %eax
	movl	%r14d, %ecx
	shll	%cl, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_K8_REV_F,8,3                   ## @K8_REV_F
	.comm	_WIDTH_128,4,2                  ## @WIDTH_128
	.comm	_K8_REV_D,8,3                   ## @K8_REV_D
	.no_dead_strip	_k8_dbam_to_chip_select
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function k8_dbam_to_chip_select
_k8_dbam_to_chip_select:                ; @k8_dbam_to_chip_select
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x2
	ldr	x8, [x0, #8]
Lloh0:
	adrp	x9, _K8_REV_F@GOTPAGE
Lloh1:
	ldr	x9, [x9, _K8_REV_F@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_3
; %bb.1:
Lloh3:
	adrp	x9, _K8_REV_D@GOTPAGE
Lloh4:
	ldr	x9, [x9, _K8_REV_D@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_4
; %bb.2:
	cmp	w19, #6
	cset	w0, hi
	bl	_WARN_ON
	mov	w8, #32
	lsl	w0, w8, w19
	b	LBB0_5
LBB0_3:
	cmp	x1, #0
	cset	w8, eq
	ldr	w20, [x0, w8, uxtw #2]
	cmp	w19, #11
	cset	w0, hi
	bl	_WARN_ON
Lloh6:
	adrp	x8, _WIDTH_128@GOTPAGE
Lloh7:
	ldr	x8, [x8, _WIDTH_128@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	and	w1, w8, w20
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_ddr2_cs_size
LBB0_4:
	cmp	w19, #10
	cset	w0, hi
	bl	_WARN_ON
	mov	w8, #43691
	movk	w8, #43690, lsl #16
	umull	x8, w19, w8
	lsr	x8, x8, #33
	cmp	w19, #5
	cset	w9, hi
	sub	w8, w19, w8
	sub	w8, w8, w9
	mov	w9, #32
	lsl	w0, w9, w8
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_K8_REV_F,8,3                   ; @K8_REV_F
	.comm	_WIDTH_128,4,2                  ; @WIDTH_128
	.comm	_K8_REV_D,8,3                   ; @K8_REV_D
	.no_dead_strip	_k8_dbam_to_chip_select
.subsections_via_symbols
