	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ipu_reset_wave_gen
_ipu_reset_wave_gen:                    ## @ipu_reset_wave_gen
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	testl	%esi, %esi
	movq	_IPU_DI1_SW_GEN0_1@GOTPCREL(%rip), %rax
	cmoveq	_IPU_DI0_SW_GEN0_1@GOTPCREL(%rip), %rax
	movq	_IPU_DI1_SW_GEN1_1@GOTPCREL(%rip), %r13
	cmoveq	_IPU_DI0_SW_GEN1_1@GOTPCREL(%rip), %r13
	movq	_IPU_DI1_STP_REP@GOTPCREL(%rip), %r12
	cmoveq	_IPU_DI0_STP_REP@GOTPCREL(%rip), %r12
	leal	-1(%r15), %r14d
	leal	-4(,%r15,4), %ebx
	movl	(%rax), %esi
	addl	%ebx, %esi
	xorl	%edx, %edx
	callq	_IPU_WRITE4
	addl	(%r13), %ebx
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_IPU_WRITE4
	shrl	$31, %r14d
	leal	(%r15,%r14), %ebx
	decl	%ebx
	addl	%ebx, %ebx
	andl	$-4, %ebx
	addl	(%r12), %ebx
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_IPU_READ4
	testb	$1, %r15b
	movl	$65535, %ecx                    ## imm = 0xFFFF
	movl	$-65536, %edx                   ## imm = 0xFFFF0000
	cmovel	%ecx, %edx
	andl	%eax, %edx
	movq	%r13, %rdi
	movl	%ebx, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_IPU_WRITE4                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_IPU_DI1_SW_GEN0_1,4,2          ## @IPU_DI1_SW_GEN0_1
	.comm	_IPU_DI0_SW_GEN0_1,4,2          ## @IPU_DI0_SW_GEN0_1
	.comm	_IPU_DI1_SW_GEN1_1,4,2          ## @IPU_DI1_SW_GEN1_1
	.comm	_IPU_DI0_SW_GEN1_1,4,2          ## @IPU_DI0_SW_GEN1_1
	.comm	_IPU_DI1_STP_REP,4,2            ## @IPU_DI1_STP_REP
	.comm	_IPU_DI0_STP_REP,4,2            ## @IPU_DI0_STP_REP
	.no_dead_strip	_ipu_reset_wave_gen
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ipu_reset_wave_gen
_ipu_reset_wave_gen:                    ; @ipu_reset_wave_gen
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x2
	mov	x20, x0
Lloh0:
	adrp	x8, _IPU_DI1_SW_GEN0_1@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IPU_DI1_SW_GEN0_1@GOTPAGEOFF]
Lloh2:
	adrp	x9, _IPU_DI0_SW_GEN0_1@GOTPAGE
Lloh3:
	ldr	x9, [x9, _IPU_DI0_SW_GEN0_1@GOTPAGEOFF]
	sub	w21, w2, #1
	cmp	w1, #0
	csel	x8, x9, x8, eq
	ldr	w8, [x8]
	lsl	w22, w21, #2
	add	w1, w8, w22
Lloh4:
	adrp	x8, _IPU_DI1_SW_GEN1_1@GOTPAGE
Lloh5:
	ldr	x8, [x8, _IPU_DI1_SW_GEN1_1@GOTPAGEOFF]
Lloh6:
	adrp	x9, _IPU_DI0_SW_GEN1_1@GOTPAGE
Lloh7:
	ldr	x9, [x9, _IPU_DI0_SW_GEN1_1@GOTPAGEOFF]
	csel	x23, x9, x8, eq
Lloh8:
	adrp	x8, _IPU_DI1_STP_REP@GOTPAGE
Lloh9:
	ldr	x8, [x8, _IPU_DI1_STP_REP@GOTPAGEOFF]
Lloh10:
	adrp	x9, _IPU_DI0_STP_REP@GOTPAGE
Lloh11:
	ldr	x9, [x9, _IPU_DI0_STP_REP@GOTPAGEOFF]
	csel	x24, x9, x8, eq
	mov	w2, #0
	bl	_IPU_WRITE4
	ldr	w8, [x23]
	add	w1, w8, w22
	mov	x0, x20
	mov	w2, #0
	bl	_IPU_WRITE4
	ldr	w8, [x24]
	cmp	w21, #0
	csel	w9, w19, w21, lt
	lsl	w9, w9, #1
	and	w9, w9, #0xfffffffc
	add	w21, w8, w9
	mov	x0, x20
	mov	x1, x21
	bl	_IPU_READ4
	tst	w19, #0x1
	mov	w8, #65535
	cinv	w8, w8, ne
	and	w2, w0, w8
	mov	x0, x20
	mov	x1, x21
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_IPU_WRITE4
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_IPU_DI1_SW_GEN0_1,4,2          ; @IPU_DI1_SW_GEN0_1
	.comm	_IPU_DI0_SW_GEN0_1,4,2          ; @IPU_DI0_SW_GEN0_1
	.comm	_IPU_DI1_SW_GEN1_1,4,2          ; @IPU_DI1_SW_GEN1_1
	.comm	_IPU_DI0_SW_GEN1_1,4,2          ; @IPU_DI0_SW_GEN1_1
	.comm	_IPU_DI1_STP_REP,4,2            ; @IPU_DI1_STP_REP
	.comm	_IPU_DI0_STP_REP,4,2            ; @IPU_DI0_STP_REP
	.no_dead_strip	_ipu_reset_wave_gen
.subsections_via_symbols
