	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ipu_di_sync_config
_ipu_di_sync_config:                    ## @ipu_di_sync_config
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	testl	%ecx, %ecx
	jle	LBB0_10
## %bb.1:
	movq	%rsi, %r12
	movl	%ecx, %eax
	movl	%edx, %ecx
	shll	$4, %ecx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	incl	%edx
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	imulq	$44, %rax, %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	orl	%eax, %ebx
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	movl	%r13d, %edi
	callq	_DI_SW_GEN1
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_ipu_di_write
	movl	%r13d, %edi
	callq	_DI_STP_REP
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_ipu_di_read
	movl	-48(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %ecx
	andb	$16, %cl
	movl	$65535, %edx                    ## imm = 0xFFFF
	shll	%cl, %edx
	notl	%edx
	andl	%eax, %edx
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movl	8(%r12,%r15), %ebx
	shll	%cl, %ebx
	orl	%edx, %ebx
	movl	%r13d, %edi
	callq	_DI_STP_REP
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_ipu_di_write
	addl	$16, %r14d
	movl	%r14d, -48(%rbp)                ## 4-byte Spill
	incl	%r13d
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	addq	$44, %r15
	cmpq	%r15, -72(%rbp)                 ## 8-byte Folded Reload
	je	LBB0_10
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12,%r15), %edi
	cmpl	$4095, %edi                     ## imm = 0xFFF
	jg	LBB0_11
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$4095, 4(%r12,%r15)             ## imm = 0xFFF
	jg	LBB0_11
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$4095, 8(%r12,%r15)             ## imm = 0xFFF
	jg	LBB0_11
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$1023, 12(%r12,%r15)            ## imm = 0x3FF
	jg	LBB0_11
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$1024, 16(%r12,%r15)            ## imm = 0x400
	jge	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	callq	_DI_SW_GEN0_RUN_COUNT
	movl	%eax, %r13d
	movl	40(%r12,%r15), %edi
	callq	_DI_SW_GEN0_RUN_SRC
	orl	%eax, %r13d
	movl	4(%r12,%r15), %edi
	callq	_DI_SW_GEN0_OFFSET_COUNT
	movl	%eax, %ebx
	movl	36(%r12,%r15), %edi
	callq	_DI_SW_GEN0_OFFSET_SRC
	orl	%eax, %ebx
	orl	%r13d, %ebx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_DI_SW_GEN0
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_ipu_di_write
	movl	32(%r12,%r15), %edi
	callq	_DI_SW_GEN1_CNT_POL_GEN_EN
	movl	%eax, %r13d
	movl	28(%r12,%r15), %edi
	callq	_DI_SW_GEN1_CNT_CLR_SRC
	movl	%eax, %ebx
	orl	%r13d, %ebx
	movl	24(%r12,%r15), %edi
	callq	_DI_SW_GEN1_CNT_POL_TRIGGER_SRC
	movl	%eax, %r13d
	movl	20(%r12,%r15), %edi
	callq	_DI_SW_GEN1_CNT_POL_CLR_SRC
	movl	%eax, %r14d
	orl	%r13d, %r14d
	orl	%ebx, %r14d
	movl	16(%r12,%r15), %edi
	callq	_DI_SW_GEN1_CNT_DOWN
	movl	%eax, %r13d
	movl	12(%r12,%r15), %edi
	callq	_DI_SW_GEN1_CNT_UP
	movl	%eax, %ebx
	orl	%r13d, %ebx
	orl	%r14d, %ebx
	xorl	%eax, %eax
	cmpl	$0, 8(%r12,%r15)
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_DI_SW_GEN1_AUTO_RELOAD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_9
LBB0_10:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	8(%rcx), %rax
	movl	(%rax), %edi
	movl	(%rcx), %edx
	leaq	L_.str(%rip), %rsi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_err                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DI%d counters out of range.\n"

	.comm	_DI_SW_GEN1_AUTO_RELOAD,4,2     ## @DI_SW_GEN1_AUTO_RELOAD
	.no_dead_strip	_ipu_di_sync_config
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ipu_di_sync_config
_ipu_di_sync_config:                    ; @ipu_di_sync_config
	.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
	cmp	w3, #1
	b.lt	LBB0_8
; %bb.1:
	mov	x19, x0
	lsl	w22, w2, #4
	add	w20, w2, #1
	add	x23, x1, #20
Lloh0:
	adrp	x24, _DI_SW_GEN1_AUTO_RELOAD@GOTPAGE
Lloh1:
	ldr	x24, [x24, _DI_SW_GEN1_AUTO_RELOAD@GOTPAGEOFF]
	mov	w25, #65535
	mov	w26, w3
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldur	w0, [x23, #-20]
	cmp	w0, #4095
	b.gt	LBB0_9
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldur	w8, [x23, #-16]
	cmp	w8, #4095
	b.gt	LBB0_9
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	ldur	w8, [x23, #-12]
	cmp	w8, #4095
	b.gt	LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	ldur	w8, [x23, #-8]
	cmp	w8, #1023
	b.gt	LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	ldur	w8, [x23, #-4]
	cmp	w8, #1024
	b.ge	LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_2 Depth=1
	bl	_DI_SW_GEN0_RUN_COUNT
	mov	x21, x0
	ldr	w0, [x23, #20]
	bl	_DI_SW_GEN0_RUN_SRC
	orr	w21, w0, w21
	ldur	w0, [x23, #-16]
	bl	_DI_SW_GEN0_OFFSET_COUNT
	orr	w21, w21, w0
	ldr	w0, [x23, #16]
	bl	_DI_SW_GEN0_OFFSET_SRC
	orr	w21, w21, w0
	mov	x0, x20
	bl	_DI_SW_GEN0
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_ipu_di_write
	ldr	w0, [x23, #12]
	bl	_DI_SW_GEN1_CNT_POL_GEN_EN
	mov	x21, x0
	ldr	w0, [x23, #8]
	bl	_DI_SW_GEN1_CNT_CLR_SRC
	orr	w21, w0, w21
	ldr	w0, [x23, #4]
	bl	_DI_SW_GEN1_CNT_POL_TRIGGER_SRC
	orr	w21, w21, w0
	ldr	w0, [x23]
	bl	_DI_SW_GEN1_CNT_POL_CLR_SRC
	orr	w21, w21, w0
	ldur	w0, [x23, #-4]
	bl	_DI_SW_GEN1_CNT_DOWN
	orr	w21, w21, w0
	ldur	w0, [x23, #-8]
	bl	_DI_SW_GEN1_CNT_UP
	orr	w8, w21, w0
	ldur	w9, [x23, #-12]
	ldr	w10, [x24]
	cmp	w9, #0
	csel	w9, w10, wzr, eq
	orr	w21, w8, w9
	mov	x0, x20
	bl	_DI_SW_GEN1
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_ipu_di_write
	mov	x0, x20
	bl	_DI_STP_REP
	mov	x1, x0
	mov	x0, x19
	bl	_ipu_di_read
	and	w8, w22, #0x10
	lsl	w9, w25, w8
	bic	w9, w0, w9
	ldur	w10, [x23, #-12]
	lsl	w8, w10, w8
	orr	w21, w8, w9
	mov	x0, x20
	bl	_DI_STP_REP
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_ipu_di_write
	add	w22, w22, #16
	add	w20, w20, #1
	add	x23, x23, #44
	subs	x26, x26, #1
	b.ne	LBB0_2
LBB0_8:
	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
LBB0_9:
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
	ldr	w2, [x19]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	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
	b	_dev_err
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DI%d counters out of range.\n"

	.comm	_DI_SW_GEN1_AUTO_RELOAD,4,2     ; @DI_SW_GEN1_AUTO_RELOAD
	.no_dead_strip	_ipu_di_sync_config
.subsections_via_symbols
