	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function flexcop_pci_dma_init
_flexcop_pci_dma_init:                  ## @flexcop_pci_dma_init
	.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
	movq	%rdi, %r14
	movl	16(%rdi), %edi
	movq	8(%r14), %rsi
	movq	_FC_DEFAULT_DMA1_BUFSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_flexcop_dma_allocate
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_4
## %bb.1:
	movl	16(%r14), %edi
	movq	8(%r14), %rsi
	addq	$4, %rsi
	movq	_FC_DEFAULT_DMA2_BUFSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_flexcop_dma_allocate
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movl	%eax, %ebx
	movq	8(%r14), %rdi
	callq	_flexcop_dma_free
	jmp	LBB0_4
LBB0_3:
	movl	4(%r14), %edi
	movq	_FC_SRAM_DEST_MEDIA@GOTPCREL(%rip), %rax
	movq	_FC_SRAM_DEST_NET@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	_FC_SRAM_DEST_TARGET_DMA1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_flexcop_sram_set_dest
	movl	4(%r14), %edi
	movq	_FC_SRAM_DEST_CAO@GOTPCREL(%rip), %rax
	movq	_FC_SRAM_DEST_CAI@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	_FC_SRAM_DEST_TARGET_DMA2@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_flexcop_sram_set_dest
	movq	_FC_PCI_DMA_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r14)
	xorl	%ebx, %ebx
LBB0_4:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FC_DEFAULT_DMA1_BUFSIZE,4,2    ## @FC_DEFAULT_DMA1_BUFSIZE
	.comm	_FC_DEFAULT_DMA2_BUFSIZE,4,2    ## @FC_DEFAULT_DMA2_BUFSIZE
	.comm	_FC_SRAM_DEST_MEDIA,4,2         ## @FC_SRAM_DEST_MEDIA
	.comm	_FC_SRAM_DEST_NET,4,2           ## @FC_SRAM_DEST_NET
	.comm	_FC_SRAM_DEST_TARGET_DMA1,4,2   ## @FC_SRAM_DEST_TARGET_DMA1
	.comm	_FC_SRAM_DEST_CAO,4,2           ## @FC_SRAM_DEST_CAO
	.comm	_FC_SRAM_DEST_CAI,4,2           ## @FC_SRAM_DEST_CAI
	.comm	_FC_SRAM_DEST_TARGET_DMA2,4,2   ## @FC_SRAM_DEST_TARGET_DMA2
	.comm	_FC_PCI_DMA_INIT,4,2            ## @FC_PCI_DMA_INIT
	.no_dead_strip	_flexcop_pci_dma_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function flexcop_pci_dma_init
_flexcop_pci_dma_init:                  ; @flexcop_pci_dma_init
	.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, x0
	ldr	w0, [x0, #16]
	ldr	x1, [x19, #8]
Lloh0:
	adrp	x8, _FC_DEFAULT_DMA1_BUFSIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FC_DEFAULT_DMA1_BUFSIZE@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	bl	_flexcop_dma_allocate
	mov	x20, x0
	cbnz	w0, LBB0_4
; %bb.1:
	ldr	w0, [x19, #16]
	ldr	x8, [x19, #8]
	add	x1, x8, #4
Lloh3:
	adrp	x8, _FC_DEFAULT_DMA2_BUFSIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FC_DEFAULT_DMA2_BUFSIZE@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	bl	_flexcop_dma_allocate
	mov	x20, x0
	cbz	w0, LBB0_3
; %bb.2:
	ldr	x0, [x19, #8]
	bl	_flexcop_dma_free
	b	LBB0_4
LBB0_3:
	ldr	w0, [x19, #4]
Lloh6:
	adrp	x8, _FC_SRAM_DEST_MEDIA@GOTPAGE
Lloh7:
	ldr	x8, [x8, _FC_SRAM_DEST_MEDIA@GOTPAGEOFF]
Lloh8:
	adrp	x9, _FC_SRAM_DEST_NET@GOTPAGE
Lloh9:
	ldr	x9, [x9, _FC_SRAM_DEST_NET@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	ldr	w9, [x9]
	orr	w1, w9, w8
Lloh12:
	adrp	x8, _FC_SRAM_DEST_TARGET_DMA1@GOTPAGE
Lloh13:
	ldr	x8, [x8, _FC_SRAM_DEST_TARGET_DMA1@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	bl	_flexcop_sram_set_dest
	ldr	w0, [x19, #4]
Lloh15:
	adrp	x8, _FC_SRAM_DEST_CAO@GOTPAGE
Lloh16:
	ldr	x8, [x8, _FC_SRAM_DEST_CAO@GOTPAGEOFF]
Lloh17:
	adrp	x9, _FC_SRAM_DEST_CAI@GOTPAGE
Lloh18:
	ldr	x9, [x9, _FC_SRAM_DEST_CAI@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
Lloh20:
	ldr	w9, [x9]
	orr	w1, w9, w8
Lloh21:
	adrp	x8, _FC_SRAM_DEST_TARGET_DMA2@GOTPAGE
Lloh22:
	ldr	x8, [x8, _FC_SRAM_DEST_TARGET_DMA2@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
	bl	_flexcop_sram_set_dest
Lloh24:
	adrp	x8, _FC_PCI_DMA_INIT@GOTPAGE
Lloh25:
	ldr	x8, [x8, _FC_PCI_DMA_INIT@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
LBB0_4:
	mov	x0, x20
	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	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh19
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_FC_DEFAULT_DMA1_BUFSIZE,4,2    ; @FC_DEFAULT_DMA1_BUFSIZE
	.comm	_FC_DEFAULT_DMA2_BUFSIZE,4,2    ; @FC_DEFAULT_DMA2_BUFSIZE
	.comm	_FC_SRAM_DEST_MEDIA,4,2         ; @FC_SRAM_DEST_MEDIA
	.comm	_FC_SRAM_DEST_NET,4,2           ; @FC_SRAM_DEST_NET
	.comm	_FC_SRAM_DEST_TARGET_DMA1,4,2   ; @FC_SRAM_DEST_TARGET_DMA1
	.comm	_FC_SRAM_DEST_CAO,4,2           ; @FC_SRAM_DEST_CAO
	.comm	_FC_SRAM_DEST_CAI,4,2           ; @FC_SRAM_DEST_CAI
	.comm	_FC_SRAM_DEST_TARGET_DMA2,4,2   ; @FC_SRAM_DEST_TARGET_DMA2
	.comm	_FC_PCI_DMA_INIT,4,2            ; @FC_PCI_DMA_INIT
	.no_dead_strip	_flexcop_pci_dma_init
.subsections_via_symbols
