	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hl_pci_set_dram_bar_base       ## -- Begin function hl_pci_set_dram_bar_base
	.p2align	4, 0x90
_hl_pci_set_dram_bar_base:              ## @hl_pci_set_dram_bar_base
	.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
	movl	%esi, %ebx
	movq	%rdi, %r15
	cmpl	$3, %esi
	jae	LBB0_1
## %bb.3:
	movl	%edx, %r12d
	cmpl	$4, %edx
	ja	LBB0_5
## %bb.4:
	movl	$21, %eax
	btl	%r12d, %eax
	jae	LBB0_5
## %bb.6:
	shll	$9, %ebx
	leal	256(%rbx), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	leal	276(%rbx), %r13d
	movl	%ecx, %edi
	movl	%ecx, %r14d
	callq	_lower_32_bits
	movq	%r15, %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	callq	_hl_pci_iatu_write
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	leal	280(%rbx), %r13d
	movl	%r14d, -48(%rbp)                ## 4-byte Spill
	movl	%r14d, %edi
	callq	_upper_32_bits
	movq	%r15, %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	callq	_hl_pci_iatu_write
	movl	%eax, %r14d
	orl	-52(%rbp), %r14d                ## 4-byte Folded Reload
	xorl	%r13d, %r13d
	movq	%r15, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	xorl	%edx, %edx
	callq	_hl_pci_iatu_write
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	orl	$260, %ebx                      ## imm = 0x104
	shll	$8, %r12d
	orl	$-1073217536, %r12d             ## imm = 0xC0080000
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%r12d, %edx
	callq	_hl_pci_iatu_write
	movl	%eax, %ebx
	orl	-44(%rbp), %ebx                 ## 4-byte Folded Reload
	orl	%r14d, %ebx
	movq	8(%r15), %rsi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_hl_pci_elbi_write
	movl	%eax, %r14d
	orl	%ebx, %r14d
	movq	8(%r15), %rsi
	addq	$4, %rsi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_hl_pci_elbi_write
	movl	%eax, %ebx
	orl	%r14d, %ebx
	je	LBB0_8
## %bb.7:
	movl	(%r15), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	callq	_dev_err
	movl	%ebx, %r13d
	jmp	LBB0_8
LBB0_1:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	jmp	LBB0_2
LBB0_5:
	movl	(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%r12d, %edx
LBB0_2:
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_8:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid inbound region %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Invalid PCI BAR %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"failed to map DRAM bar to 0x%08llx\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hl_pci_set_dram_bar_base       ; -- Begin function hl_pci_set_dram_bar_base
	.p2align	2
_hl_pci_set_dram_bar_base:              ; @hl_pci_set_dram_bar_base
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x22, x1
	mov	x20, x0
	cmp	w1, #3
	b.hs	LBB0_5
; %bb.1:
	mov	x21, x2
	cmp	w2, #4
	b.hi	LBB0_6
; %bb.2:
	mov	w8, #1
	lsl	w8, w8, w21
	mov	w9, #21
	tst	w8, w9
	b.eq	LBB0_6
; %bb.3:
	mov	x19, x3
	mov	w23, #256
	bfi	w23, w22, #9, #23
	mov	w24, #276
	bfi	w24, w22, #9, #23
	mov	x0, x3
	bl	_lower_32_bits
	mov	x2, x0
	mov	x0, x20
	mov	x1, x24
	bl	_hl_pci_iatu_write
	mov	x24, x0
	mov	w25, #280
	bfi	w25, w22, #9, #23
	mov	x0, x19
	bl	_upper_32_bits
	mov	x2, x0
	mov	x0, x20
	mov	x1, x25
	bl	_hl_pci_iatu_write
	orr	w24, w0, w24
	mov	x0, x20
	mov	x1, x23
	mov	w2, #0
	bl	_hl_pci_iatu_write
	orr	w23, w24, w0
	mov	w1, #260
	bfi	w1, w22, #9, #23
	mov	w8, #-1073217536
	orr	w2, w8, w21, lsl #8
	mov	x0, x20
	bl	_hl_pci_iatu_write
	orr	w21, w23, w0
	ldr	x1, [x20, #8]
	mov	x0, x20
	mov	w2, #0
	bl	_hl_pci_elbi_write
	orr	w21, w21, w0
	ldr	x8, [x20, #8]
	add	x1, x8, #4
	mov	x0, x20
	mov	w2, #0
	bl	_hl_pci_elbi_write
	orr	w21, w21, w0
	cbz	w21, LBB0_8
; %bb.4:
	ldr	w0, [x20]
Lloh0:
	adrp	x1, l_.str.2@PAGE
Lloh1:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x19
	bl	_dev_err
	b	LBB0_8
LBB0_5:
	ldr	w0, [x20]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x22
	b	LBB0_7
LBB0_6:
	ldr	w0, [x20]
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x21
LBB0_7:
	bl	_dev_err
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_8:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid inbound region %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Invalid PCI BAR %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"failed to map DRAM bar to 0x%08llx\n"

.subsections_via_symbols
