	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ql_write_cfg                   ## -- Begin function ql_write_cfg
	.p2align	4, 0x90
_ql_write_cfg:                          ## @ql_write_cfg
	.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	%ecx, %r12d
	movl	%edx, %r14d
	movq	%rdi, %r15
	movq	_CFG_LRQ@GOTPCREL(%rip), %rax
	movq	_CFG_LR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_CFG_LCQ@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	testl	%r12d, %ecx
	movl	%r8d, -52(%rbp)                 ## 4-byte Spill
	jne	LBB0_1
## %bb.2:
	movq	_PCI_DMA_FROMDEVICE@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_PCI_DMA_TODEVICE@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %ebx
	movl	(%r15), %edi
	movl	%r14d, %edx
	movl	%ebx, %ecx
	callq	_pci_map_single
	movl	%eax, %r13d
	movl	(%r15), %edi
	movl	%eax, %esi
	callq	_pci_dma_mapping_error
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_ifup@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%r15), %edx
	leaq	L_.str(%rip), %rcx
	movq	%r15, %rdi
	callq	_netif_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_10
LBB0_5:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movl	%r14d, -48(%rbp)                ## 4-byte Spill
	movq	_SEM_ICB_MASK@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_ql_sem_spinlock
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_10
## %bb.6:
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_ql_wait_cfg
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %r14d
	movq	_ifup@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%r15), %edx
	leaq	L_.str.1(%rip), %rcx
	movq	%r15, %rdi
	callq	_netif_err
	jmp	LBB0_9
LBB0_8:
	movq	_ICB_L@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r13d, %edx
	callq	_ql_write32
	movq	_ICB_H@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_ql_write32
	movq	_CFG_Q_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	shll	%cl, %edi
	movq	_CFG_Q_MASK@GOTPCREL(%rip), %rax
	movl	%r12d, %edx
	shll	$16, %edx
	movq	_CFG@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	%r12d, %edx
	orl	(%rax), %edx
	orl	%edi, %edx
	movq	%r15, %rdi
	callq	_ql_write32
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_ql_wait_cfg
	movl	%eax, %r14d
LBB0_9:
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_ql_sem_unlock
	movl	(%r15), %edi
	movl	%r13d, %esi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	callq	_pci_unmap_single
LBB0_10:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CFG_LRQ,4,2                    ## @CFG_LRQ
	.comm	_CFG_LR,4,2                     ## @CFG_LR
	.comm	_CFG_LCQ,4,2                    ## @CFG_LCQ
	.comm	_PCI_DMA_TODEVICE,4,2           ## @PCI_DMA_TODEVICE
	.comm	_PCI_DMA_FROMDEVICE,4,2         ## @PCI_DMA_FROMDEVICE
	.comm	_ifup,4,2                       ## @ifup
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Couldn't map DMA area.\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_SEM_ICB_MASK,4,2               ## @SEM_ICB_MASK
L_.str.1:                               ## @.str.1
	.asciz	"Timed out waiting for CFG to come ready.\n"

	.comm	_ICB_L,4,2                      ## @ICB_L
	.comm	_ICB_H,4,2                      ## @ICB_H
	.comm	_CFG_Q_MASK,4,2                 ## @CFG_Q_MASK
	.comm	_CFG_Q_SHIFT,4,2                ## @CFG_Q_SHIFT
	.comm	_CFG,4,2                        ## @CFG
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ql_write_cfg                   ; -- Begin function ql_write_cfg
	.p2align	2
_ql_write_cfg:                          ; @ql_write_cfg
	.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	x24, x4
	mov	x23, x3
	mov	x20, x2
	mov	x19, x0
	ldr	w0, [x0]
Lloh0:
	adrp	x8, _CFG_LRQ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CFG_LRQ@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _CFG_LR@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CFG_LR@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh6:
	adrp	x9, _CFG_LCQ@GOTPAGE
Lloh7:
	ldr	x9, [x9, _CFG_LCQ@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
Lloh9:
	adrp	x10, _PCI_DMA_TODEVICE@GOTPAGE
Lloh10:
	ldr	x10, [x10, _PCI_DMA_TODEVICE@GOTPAGEOFF]
	orr	w8, w8, w9
	tst	w8, w3
Lloh11:
	adrp	x8, _PCI_DMA_FROMDEVICE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PCI_DMA_FROMDEVICE@GOTPAGEOFF]
	csel	x8, x8, x10, eq
	ldr	w21, [x8]
	mov	x3, x21
	bl	_pci_map_single
	mov	x22, x0
	ldr	w0, [x19]
	mov	x1, x22
	bl	_pci_dma_mapping_error
	cbz	x0, LBB0_2
; %bb.1:
Lloh13:
	adrp	x8, _ifup@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ifup@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	ldr	w2, [x19, #4]
Lloh16:
	adrp	x3, l_.str@PAGE
Lloh17:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x19
	bl	_netif_err
Lloh18:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w25, w8
	b	LBB0_7
LBB0_2:
Lloh21:
	adrp	x26, _SEM_ICB_MASK@GOTPAGE
Lloh22:
	ldr	x26, [x26, _SEM_ICB_MASK@GOTPAGEOFF]
	ldr	w1, [x26]
	mov	x0, x19
	bl	_ql_sem_spinlock
	mov	x25, x0
	cbnz	w0, LBB0_7
; %bb.3:
	mov	x0, x19
	mov	x1, x23
	bl	_ql_wait_cfg
	cbz	w0, LBB0_5
; %bb.4:
	mov	x25, x0
Lloh23:
	adrp	x8, _ifup@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ifup@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	ldr	w2, [x19, #4]
Lloh26:
	adrp	x3, l_.str.1@PAGE
Lloh27:
	add	x3, x3, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_netif_err
	b	LBB0_6
LBB0_5:
Lloh28:
	adrp	x8, _ICB_L@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ICB_L@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x22
	bl	_ql_write32
Lloh31:
	adrp	x8, _ICB_H@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ICB_H@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ql_write32
Lloh34:
	adrp	x8, _CFG_Q_MASK@GOTPAGE
Lloh35:
	ldr	x8, [x8, _CFG_Q_MASK@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
Lloh37:
	adrp	x9, _CFG_Q_SHIFT@GOTPAGE
Lloh38:
	ldr	x9, [x9, _CFG_Q_SHIFT@GOTPAGEOFF]
Lloh39:
	ldr	w9, [x9]
	lsl	w9, w24, w9
Lloh40:
	adrp	x10, _CFG@GOTPAGE
Lloh41:
	ldr	x10, [x10, _CFG@GOTPAGEOFF]
Lloh42:
	ldr	w1, [x10]
	orr	w10, w23, w23, lsl #16
	orr	w8, w10, w8
	orr	w2, w8, w9
	mov	x0, x19
	bl	_ql_write32
	mov	x0, x19
	mov	x1, x23
	bl	_ql_wait_cfg
	mov	x25, x0
LBB0_6:
	ldr	w1, [x26]
	mov	x0, x19
	bl	_ql_sem_unlock
	ldr	w0, [x19]
	mov	x1, x22
	mov	x2, x20
	mov	x3, x21
	bl	_pci_unmap_single
LBB0_7:
	mov	x0, x25
	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 AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_CFG_LRQ,4,2                    ; @CFG_LRQ
	.comm	_CFG_LR,4,2                     ; @CFG_LR
	.comm	_CFG_LCQ,4,2                    ; @CFG_LCQ
	.comm	_PCI_DMA_TODEVICE,4,2           ; @PCI_DMA_TODEVICE
	.comm	_PCI_DMA_FROMDEVICE,4,2         ; @PCI_DMA_FROMDEVICE
	.comm	_ifup,4,2                       ; @ifup
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Couldn't map DMA area.\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_SEM_ICB_MASK,4,2               ; @SEM_ICB_MASK
l_.str.1:                               ; @.str.1
	.asciz	"Timed out waiting for CFG to come ready.\n"

	.comm	_ICB_L,4,2                      ; @ICB_L
	.comm	_ICB_H,4,2                      ; @ICB_H
	.comm	_CFG_Q_MASK,4,2                 ; @CFG_Q_MASK
	.comm	_CFG_Q_SHIFT,4,2                ; @CFG_Q_SHIFT
	.comm	_CFG,4,2                        ; @CFG
.subsections_via_symbols
