	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s3cmci_dma_setup
_s3cmci_dma_setup:                      ## @s3cmci_dma_setup
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	cmpl	%esi, _s3cmci_dma_setup.last_source(%rip)
	je	LBB0_3
## %bb.1:
	movq	%rdi, %rbx
	movl	%esi, _s3cmci_dma_setup.last_source(%rip)
	movl	(%rdi), %edi
	movq	16(%rbx), %rax
	movq	8(%rbx), %rdx
	addq	(%rax), %rdx
	callq	_s3c2410_dma_devconfig
	cmpb	$0, _s3cmci_dma_setup.setup_ok(%rip)
	jne	LBB0_3
## %bb.2:
	movl	(%rbx), %edi
	movl	$4, %esi
	callq	_s3c2410_dma_config
	movl	(%rbx), %edi
	movq	_s3cmci_dma_done_callback@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_s3c2410_dma_set_buffdone_fn
	movl	(%rbx), %edi
	movq	_S3C2410_DMAF_AUTOSTART@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_s3c2410_dma_setflags
	movb	$1, _s3cmci_dma_setup.setup_ok(%rip)
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__DATA,__data
	.p2align	2                               ## @s3cmci_dma_setup.last_source
_s3cmci_dma_setup.last_source:
	.long	4294967295                      ## 0xffffffff

.zerofill __DATA,__bss,_s3cmci_dma_setup.setup_ok,1,2 ## @s3cmci_dma_setup.setup_ok
	.comm	_s3cmci_dma_done_callback,4,2   ## @s3cmci_dma_done_callback
	.comm	_S3C2410_DMAF_AUTOSTART,4,2     ## @S3C2410_DMAF_AUTOSTART
	.no_dead_strip	_s3cmci_dma_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function s3cmci_dma_setup
_s3cmci_dma_setup:                      ; @s3cmci_dma_setup
	.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
	adrp	x8, _s3cmci_dma_setup.last_source@PAGE
	ldr	w9, [x8, _s3cmci_dma_setup.last_source@PAGEOFF]
	cmp	w9, w1
	b.eq	LBB0_3
; %bb.1:
	mov	x19, x0
	str	w1, [x8, _s3cmci_dma_setup.last_source@PAGEOFF]
	ldr	w0, [x0]
	ldp	x9, x8, [x19, #8]
	ldr	x8, [x8]
	add	x2, x9, x8
	bl	_s3c2410_dma_devconfig
	adrp	x20, _s3cmci_dma_setup.setup_ok@PAGE
	ldrb	w8, [x20, _s3cmci_dma_setup.setup_ok@PAGEOFF]
	tbnz	w8, #0, LBB0_3
; %bb.2:
	ldr	w0, [x19]
	mov	w1, #4
	bl	_s3c2410_dma_config
	ldr	w0, [x19]
Lloh0:
	adrp	x8, _s3cmci_dma_done_callback@GOTPAGE
Lloh1:
	ldr	x8, [x8, _s3cmci_dma_done_callback@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_s3c2410_dma_set_buffdone_fn
	ldr	w0, [x19]
Lloh3:
	adrp	x8, _S3C2410_DMAF_AUTOSTART@GOTPAGE
Lloh4:
	ldr	x8, [x8, _S3C2410_DMAF_AUTOSTART@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_s3c2410_dma_setflags
	mov	w8, #1
	strb	w8, [x20, _s3cmci_dma_setup.setup_ok@PAGEOFF]
LBB0_3:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.section	__DATA,__data
	.p2align	2                               ; @s3cmci_dma_setup.last_source
_s3cmci_dma_setup.last_source:
	.long	4294967295                      ; 0xffffffff

.zerofill __DATA,__bss,_s3cmci_dma_setup.setup_ok,1,2 ; @s3cmci_dma_setup.setup_ok
	.comm	_s3cmci_dma_done_callback,4,2   ; @s3cmci_dma_done_callback
	.comm	_S3C2410_DMAF_AUTOSTART,4,2     ; @S3C2410_DMAF_AUTOSTART
	.no_dead_strip	_s3cmci_dma_setup
.subsections_via_symbols
