	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hist_buf_dma
_hist_buf_dma:                          ## @hist_buf_dma
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	16(%rdi), %rax
	movl	(%rax), %r14d
	xorl	%edi, %edi
	testl	%r14d, %r14d
	sete	%dil
	callq	_unlikely
	movq	8(%rbx), %rdi
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	(%rdi), %edi
	leaq	L_.str(%rip), %rsi
LBB0_8:
	callq	_dev_dbg
	movq	%rbx, %rdi
	callq	_hist_reset_mem
	movq	_STAT_NO_BUF@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	_OMAP3_ISP_IOMEM_HIST@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movq	_ISPHIST_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%esi, %esi
	callq	_isp_reg_writel
	movq	8(%rbx), %rdi
	movl	(%r15), %esi
	movq	_ISPHIST_CNT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_ISPHIST_CNT_CLEAR@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_isp_reg_set
	movq	8(%rbx), %rdi
	callq	_omap3isp_flush
	leaq	-40(%rbp), %r15
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	movq	8(%rbx), %rax
	movq	_ISPHIST_DATA@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	addq	8(%rax), %rcx
	movq	%rcx, -32(%rbp)
	movq	_DMA_SLAVE_BUSWIDTH_4_BYTES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -36(%rbp)
	movl	(%rbx), %eax
	leal	3(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$2, %ecx
	movl	%ecx, -40(%rbp)
	movl	4(%rbx), %edi
	movq	%r15, %rsi
	callq	_dmaengine_slave_config
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movl	(%rbx), %edx
	movl	4(%rbx), %edi
	movq	_DMA_DEV_TO_MEM@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_DMA_CTRL_ACK@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	%r14d, %esi
	callq	_dmaengine_prep_slave_single
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	_hist_dma_cb@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 16(%rax)
	movq	%rbx, 8(%rax)
	movq	%rax, %rdi
	callq	*(%rax)
	movl	%eax, %edi
	callq	_dma_submit_error
	testq	%rax, %rax
	je	LBB0_10
## %bb.7:
	movq	8(%rbx), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_8
LBB0_3:
	movq	8(%rbx), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_8
LBB0_5:
	movq	8(%rbx), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_8
LBB0_10:
	movl	4(%rbx), %edi
	callq	_dma_async_issue_pending
	movq	_STAT_BUF_WAITING_DMA@GOTPCREL(%rip), %rax
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"hist: invalid DMA buffer address\n"

	.comm	_OMAP3_ISP_IOMEM_HIST,4,2       ## @OMAP3_ISP_IOMEM_HIST
	.comm	_ISPHIST_ADDR,4,2               ## @ISPHIST_ADDR
	.comm	_ISPHIST_CNT,4,2                ## @ISPHIST_CNT
	.comm	_ISPHIST_CNT_CLEAR,4,2          ## @ISPHIST_CNT_CLEAR
	.comm	_ISPHIST_DATA,8,3               ## @ISPHIST_DATA
	.comm	_DMA_SLAVE_BUSWIDTH_4_BYTES,4,2 ## @DMA_SLAVE_BUSWIDTH_4_BYTES
L_.str.1:                               ## @.str.1
	.asciz	"hist: DMA slave configuration failed\n"

	.comm	_DMA_DEV_TO_MEM,4,2             ## @DMA_DEV_TO_MEM
	.comm	_DMA_CTRL_ACK,4,2               ## @DMA_CTRL_ACK
L_.str.2:                               ## @.str.2
	.asciz	"hist: DMA slave preparation failed\n"

	.comm	_hist_dma_cb,4,2                ## @hist_dma_cb
L_.str.3:                               ## @.str.3
	.asciz	"hist: DMA submission failed\n"

	.comm	_STAT_BUF_WAITING_DMA,4,2       ## @STAT_BUF_WAITING_DMA
	.comm	_STAT_NO_BUF,4,2                ## @STAT_NO_BUF
	.no_dead_strip	_hist_buf_dma
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hist_buf_dma
_hist_buf_dma:                          ; @hist_buf_dma
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	ldr	x8, [x0, #16]
	ldr	w20, [x8]
	cmp	w20, #0
	cset	w0, eq
	bl	_unlikely
	mov	x8, x0
	ldr	x0, [x19, #8]
	cbz	x8, LBB0_4
; %bb.1:
	ldr	w0, [x0]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
LBB0_2:
	bl	_dev_dbg
	mov	x0, x19
	bl	_hist_reset_mem
Lloh2:
	adrp	x8, _STAT_NO_BUF@GOTPAGE
Lloh3:
	ldr	x8, [x8, _STAT_NO_BUF@GOTPAGEOFF]
LBB0_3:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_4:
Lloh4:
	adrp	x21, _OMAP3_ISP_IOMEM_HIST@GOTPAGE
Lloh5:
	ldr	x21, [x21, _OMAP3_ISP_IOMEM_HIST@GOTPAGEOFF]
	ldr	w2, [x21]
Lloh6:
	adrp	x8, _ISPHIST_ADDR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ISPHIST_ADDR@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
	mov	w1, #0
	bl	_isp_reg_writel
	ldr	x0, [x19, #8]
	ldr	w1, [x21]
Lloh9:
	adrp	x8, _ISPHIST_CNT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ISPHIST_CNT@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
Lloh12:
	adrp	x8, _ISPHIST_CNT_CLEAR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ISPHIST_CNT_CLEAR@GOTPAGEOFF]
Lloh14:
	ldr	w3, [x8]
	bl	_isp_reg_set
	ldr	x0, [x19, #8]
	bl	_omap3isp_flush
	mov	x0, sp
	mov	w1, #0
	mov	w2, #16
	bl	_memset
	ldr	x8, [x19, #8]
	ldr	x8, [x8, #8]
Lloh15:
	adrp	x9, _ISPHIST_DATA@GOTPAGE
Lloh16:
	ldr	x9, [x9, _ISPHIST_DATA@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	add	x8, x9, x8
	str	x8, [sp, #8]
	ldp	w8, w0, [x19]
	add	w9, w8, #3
	cmp	w8, #0
	csel	w8, w9, w8, lt
Lloh18:
	adrp	x9, _DMA_SLAVE_BUSWIDTH_4_BYTES@GOTPAGE
Lloh19:
	ldr	x9, [x9, _DMA_SLAVE_BUSWIDTH_4_BYTES@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	asr	w8, w8, #2
	stp	w8, w9, [sp]
	mov	x1, sp
	bl	_dmaengine_slave_config
	tbnz	w0, #31, LBB0_8
; %bb.5:
	ldp	w2, w0, [x19]
Lloh21:
	adrp	x8, _DMA_DEV_TO_MEM@GOTPAGE
Lloh22:
	ldr	x8, [x8, _DMA_DEV_TO_MEM@GOTPAGEOFF]
Lloh23:
	ldr	w3, [x8]
Lloh24:
	adrp	x8, _DMA_CTRL_ACK@GOTPAGE
Lloh25:
	ldr	x8, [x8, _DMA_CTRL_ACK@GOTPAGEOFF]
Lloh26:
	ldr	w4, [x8]
	mov	x1, x20
	bl	_dmaengine_prep_slave_single
	cbz	x0, LBB0_9
; %bb.6:
Lloh27:
	adrp	x8, _hist_dma_cb@GOTPAGE
Lloh28:
	ldr	x8, [x8, _hist_dma_cb@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	str	w8, [x0, #16]
	str	x19, [x0, #8]
	ldr	x8, [x0]
	blr	x8
	bl	_dma_submit_error
	cbz	x0, LBB0_10
; %bb.7:
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
Lloh30:
	adrp	x1, l_.str.3@PAGE
Lloh31:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_2
LBB0_8:
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
Lloh32:
	adrp	x1, l_.str.1@PAGE
Lloh33:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_2
LBB0_9:
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
Lloh34:
	adrp	x1, l_.str.2@PAGE
Lloh35:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_2
LBB0_10:
	ldr	w0, [x19, #4]
	bl	_dma_async_issue_pending
Lloh36:
	adrp	x8, _STAT_BUF_WAITING_DMA@GOTPAGE
Lloh37:
	ldr	x8, [x8, _STAT_BUF_WAITING_DMA@GOTPAGEOFF]
	b	LBB0_3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"hist: invalid DMA buffer address\n"

	.comm	_OMAP3_ISP_IOMEM_HIST,4,2       ; @OMAP3_ISP_IOMEM_HIST
	.comm	_ISPHIST_ADDR,4,2               ; @ISPHIST_ADDR
	.comm	_ISPHIST_CNT,4,2                ; @ISPHIST_CNT
	.comm	_ISPHIST_CNT_CLEAR,4,2          ; @ISPHIST_CNT_CLEAR
	.comm	_ISPHIST_DATA,8,3               ; @ISPHIST_DATA
	.comm	_DMA_SLAVE_BUSWIDTH_4_BYTES,4,2 ; @DMA_SLAVE_BUSWIDTH_4_BYTES
l_.str.1:                               ; @.str.1
	.asciz	"hist: DMA slave configuration failed\n"

	.comm	_DMA_DEV_TO_MEM,4,2             ; @DMA_DEV_TO_MEM
	.comm	_DMA_CTRL_ACK,4,2               ; @DMA_CTRL_ACK
l_.str.2:                               ; @.str.2
	.asciz	"hist: DMA slave preparation failed\n"

	.comm	_hist_dma_cb,4,2                ; @hist_dma_cb
l_.str.3:                               ; @.str.3
	.asciz	"hist: DMA submission failed\n"

	.comm	_STAT_BUF_WAITING_DMA,4,2       ; @STAT_BUF_WAITING_DMA
	.comm	_STAT_NO_BUF,4,2                ; @STAT_NO_BUF
	.no_dead_strip	_hist_buf_dma
.subsections_via_symbols
