	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_p32x_pwm_update                ## -- Begin function p32x_pwm_update
	.p2align	4, 0x90
_p32x_pwm_update:                       ## @p32x_pwm_update
	.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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movl	%esi, %r14d
	movq	%rdi, %rbx
	xorl	%eax, %eax
	callq	_SekCyclesDone
	xorl	%edi, %edi
	movl	%eax, %esi
	callq	_consume_fifo
	movq	_Pico32x@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	96(%rax), %edi
	movl	%edi, %ecx
	andl	$15, %ecx
	cmpl	$15, %ecx
	ja	LBB0_6
## %bb.1:
	movl	$33345, %eax                    ## imm = 0x8241
	btl	%ecx, %eax
	jae	LBB0_6
LBB0_2:
	movq	_pwm_ptr@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	movq	_Pico32xMem@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	8(%rax), %rcx
	xorl	%eax, %eax
	cmpq	$0, (%rcx)
	jne	LBB0_4
## %bb.3:
	xorl	%eax, %eax
	cmpq	$0, 8(%rcx)
	sete	%al
LBB0_4:
	movq	_pwm_silent@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_pwm_silent@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_5
## %bb.7:
	movq	_pwm_ptr@GOTPCREL(%rip), %r8
	movl	(%r8), %eax
	shll	$16, %eax
	cltd
	idivl	%r14d
	movq	_Pico32xMem@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	(%rdx), %r10
	testl	%r15d, %r15d
	je	LBB0_14
## %bb.8:
	cmpl	$5, %ecx
	je	LBB0_18
## %bb.9:
	cmpl	$10, %ecx
	jne	LBB0_22
## %bb.10:
	testl	%r14d, %r14d
	jle	LBB0_26
## %bb.11:
	movl	%r14d, %ecx
	xorl	%edx, %edx
	xorl	%edi, %edi
	movq	%r10, %r9
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movswl	2(%r9), %esi
	addl	%esi, (%rbx,%rdx,8)
	movswl	(%r9), %esi
	addl	%esi, 4(%rbx,%rdx,8)
	addl	%eax, %edi
	movl	%edi, %esi
	sarl	$15, %esi
	andl	$-2, %esi
	movslq	%esi, %rsi
	leaq	(%r9,%rsi,2), %r9
	movzwl	%di, %edi
	incq	%rdx
	cmpl	%edx, %ecx
	jne	LBB0_12
	jmp	LBB0_21
LBB0_14:
	leal	-1(%r14), %ecx
	testl	%r14d, %r14d
	jle	LBB0_27
## %bb.15:
	testl	%ecx, %ecx
	je	LBB0_28
## %bb.16:
	movl	%r14d, %ecx
	andl	$-2, %ecx
	xorl	%edx, %edx
	movq	%r10, %r9
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movswl	(%r9), %esi
	addl	%esi, (%rbx)
	addl	%eax, %edx
	movzwl	%dx, %esi
	sarl	$15, %edx
	andl	$-2, %edx
	movslq	%edx, %rdx
	leaq	(%r9,%rdx,2), %rdi
	movswl	(%r9,%rdx,2), %edx
	addl	%edx, 4(%rbx)
	addq	$8, %rbx
	addl	%eax, %esi
	movzwl	%si, %edx
	sarl	$15, %esi
	andl	$-2, %esi
	movslq	%esi, %rsi
	leaq	(%rdi,%rsi,2), %r9
	addl	$-2, %ecx
	jne	LBB0_17
	jmp	LBB0_29
LBB0_18:
	testl	%r14d, %r14d
	jle	LBB0_26
## %bb.19:
	movl	%r14d, %ecx
	xorl	%edx, %edx
	xorl	%edi, %edi
	movq	%r10, %r9
	.p2align	4, 0x90
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movswl	(%r9), %esi
	addl	%esi, (%rbx,%rdx,8)
	movswl	2(%r9), %esi
	addl	%esi, 4(%rbx,%rdx,8)
	addl	%eax, %edi
	movl	%edi, %esi
	sarl	$15, %esi
	andl	$-2, %esi
	movslq	%esi, %rsi
	leaq	(%r9,%rsi,2), %r9
	movzwl	%di, %edi
	incq	%rdx
	cmpl	%edx, %ecx
	jne	LBB0_20
LBB0_21:
	movl	$-1, %ecx
	jmp	LBB0_35
LBB0_22:
	xorl	%ecx, %ecx
	testb	$6, %dil
	setne	%cl
	leaq	(%r10,%rcx,2), %r9
	leal	-1(%r14), %ecx
	testl	%r14d, %r14d
	jle	LBB0_35
## %bb.23:
	xorl	%edx, %edx
	testb	$12, %dil
	setne	%dl
	leaq	(%rbx,%rdx,4), %rdx
	testl	%ecx, %ecx
	je	LBB0_31
## %bb.24:
	movl	%r14d, %ecx
	andl	$-2, %ecx
	xorl	%edi, %edi
LBB0_25:                                ## =>This Inner Loop Header: Depth=1
	movswl	(%r9), %esi
	addl	%esi, (%rdx)
	addl	%eax, %edi
	movzwl	%di, %esi
	sarl	$15, %edi
	andl	$-2, %edi
	movslq	%edi, %rdi
	leaq	(%r9,%rdi,2), %rbx
	movswl	(%r9,%rdi,2), %edi
	addl	%edi, 8(%rdx)
	addl	%eax, %esi
	movzwl	%si, %edi
	sarl	$15, %esi
	andl	$-2, %esi
	movslq	%esi, %rsi
	leaq	(%rbx,%rsi,2), %r9
	addq	$16, %rdx
	addl	$-2, %ecx
	jne	LBB0_25
	jmp	LBB0_32
LBB0_26:
	decl	%r14d
	movq	%r10, %r9
	movl	%r14d, %ecx
	jmp	LBB0_35
LBB0_27:
	movq	%r10, %r9
	jmp	LBB0_35
LBB0_28:
	xorl	%edx, %edx
	movq	%r10, %r9
LBB0_29:
	movl	$-1, %ecx
	testb	$1, %r14b
	je	LBB0_35
## %bb.30:
	movswl	(%r9), %esi
	addl	%esi, (%rbx)
	addl	%eax, %edx
	sarl	$15, %edx
	andl	$-2, %edx
	movslq	%edx, %rdx
	jmp	LBB0_34
LBB0_31:
	xorl	%edi, %edi
LBB0_32:
	movl	$-1, %ecx
	testb	$1, %r14b
	je	LBB0_35
## %bb.33:
	movswl	(%r9), %esi
	addl	%esi, (%rdx)
	addl	%eax, %edi
	sarl	$15, %edi
	andl	$-2, %edi
	movslq	%edi, %rdx
LBB0_34:
	leaq	(%r9,%rdx,2), %r9
LBB0_35:
	movq	_EL_PWM@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edi
	movl	(%r8), %edx
	subq	%r10, %r9
	movq	%r9, %rsi
	shrq	%rsi
	shrq	$63, %r9
	addq	%rsi, %r9
	shrq	%r9
	leaq	L_.str(%rip), %rsi
	movl	%eax, %r8d
                                        ## kill: def $r9d killed $r9d killed $r9
	callq	_elprintf
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_Pico32x,8,3                    ## @Pico32x
	.comm	_pwm_silent,4,2                 ## @pwm_silent
	.comm	_pwm_ptr,4,2                    ## @pwm_ptr
	.comm	_Pico32xMem,8,3                 ## @Pico32xMem
	.comm	_EL_PWM,4,2                     ## @EL_PWM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pwm_update: pwm_ptr %d, len %d, step %04x, done %d"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_p32x_pwm_update                ; -- Begin function p32x_pwm_update
	.p2align	2
_p32x_pwm_update:                       ; @p32x_pwm_update
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x21, x2
	mov	x19, x1
	mov	x20, x0
	bl	_SekCyclesDone
	mov	x1, x0
	mov	x0, #0
	bl	_consume_fifo
Lloh0:
	adrp	x8, _Pico32x@GOTPAGE
Lloh1:
	ldr	x8, [x8, _Pico32x@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	w11, [x8, #96]
	and	w10, w11, #0xf
	cmp	w10, #15
	mov	w8, #1
	lsl	w8, w8, w10
	mov	w9, #33345
	and	w8, w8, w9
	ccmp	w8, #0, #4, ls
Lloh3:
	adrp	x22, _pwm_silent@GOTPAGE
Lloh4:
	ldr	x22, [x22, _pwm_silent@GOTPAGEOFF]
	b.eq	LBB0_5
LBB0_1:
	mov	w8, #0
Lloh5:
	adrp	x9, _pwm_ptr@GOTPAGE
Lloh6:
	ldr	x9, [x9, _pwm_ptr@GOTPAGEOFF]
Lloh7:
	str	wzr, [x9]
Lloh8:
	adrp	x9, _Pico32xMem@GOTPAGE
Lloh9:
	ldr	x9, [x9, _Pico32xMem@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	ldr	x9, [x9, #8]
	ldr	x10, [x9]
	cbnz	x10, LBB0_3
; %bb.2:
	ldr	x8, [x9, #8]
	cmp	x8, #0
	cset	w8, eq
LBB0_3:
	str	w8, [x22]
LBB0_4:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_5:
	ldr	w8, [x22]
	cbnz	w8, LBB0_4
; %bb.6:
Lloh11:
	adrp	x8, _pwm_ptr@GOTPAGE
Lloh12:
	ldr	x8, [x8, _pwm_ptr@GOTPAGEOFF]
	ldr	w9, [x8]
	lsl	w9, w9, #16
	sdiv	w4, w9, w19
Lloh13:
	adrp	x9, _Pico32xMem@GOTPAGE
Lloh14:
	ldr	x9, [x9, _Pico32xMem@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	ldr	x9, [x9]
	cbz	w21, LBB0_12
; %bb.7:
	cmp	w10, #5
	b.eq	LBB0_15
; %bb.8:
	cmp	w10, #10
	b.ne	LBB0_19
; %bb.9:
	subs	w3, w19, #1
	b.lt	LBB0_18
; %bb.10:
	mov	w11, #0
	mov	x10, x9
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldrsh	w12, [x10, #2]
	ldp	w13, w14, [x20]
	add	w12, w13, w12
	ldrsh	w13, [x10]
	add	w13, w14, w13
	stp	w12, w13, [x20], #8
	add	w11, w11, w4
	asr	w12, w11, #15
	and	w12, w12, #0xfffffffe
	add	x10, x10, w12, sxtw #1
	and	w11, w11, #0xffff
	subs	w19, w19, #1
	b.ne	LBB0_11
	b	LBB0_22
LBB0_12:
	subs	w3, w19, #1
	b.lt	LBB0_18
; %bb.13:
	mov	w11, #0
	mov	x10, x9
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldrsh	w12, [x10]
	ldr	w13, [x20]
	add	w12, w13, w12
	str	w12, [x20], #4
	add	w11, w11, w4
	asr	w12, w11, #15
	and	w12, w12, #0xfffffffe
	add	x10, x10, w12, sxtw #1
	and	w11, w11, #0xffff
	subs	w19, w19, #1
	b.ne	LBB0_14
	b	LBB0_22
LBB0_15:
	subs	w3, w19, #1
	b.lt	LBB0_18
; %bb.16:
	mov	w11, #0
	mov	x10, x9
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	ldrsh	w12, [x10]
	ldp	w13, w14, [x20]
	add	w12, w13, w12
	ldrsh	w13, [x10, #2]
	add	w13, w14, w13
	stp	w12, w13, [x20], #8
	add	w11, w11, w4
	asr	w12, w11, #15
	and	w12, w12, #0xfffffffe
	add	x10, x10, w12, sxtw #1
	and	w11, w11, #0xffff
	subs	w19, w19, #1
	b.ne	LBB0_17
	b	LBB0_22
LBB0_18:
	mov	x10, x9
	b	LBB0_23
LBB0_19:
	tst	w11, #0x6
	cset	w10, ne
	add	x10, x9, w10, uxtw #1
	subs	w3, w19, #1
	b.lt	LBB0_23
; %bb.20:
	mov	w12, #0
	tst	w11, #0xc
	cset	w11, ne
	add	x11, x20, w11, uxtw #2
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	ldrsh	w13, [x10]
	ldr	w14, [x11]
	add	w13, w14, w13
	str	w13, [x11], #8
	add	w12, w12, w4
	asr	w13, w12, #15
	and	w13, w13, #0xfffffffe
	add	x10, x10, w13, sxtw #1
	and	w12, w12, #0xffff
	subs	w19, w19, #1
	b.ne	LBB0_21
LBB0_22:
	mov	w3, #-1
LBB0_23:
Lloh16:
	adrp	x11, _EL_PWM@GOTPAGE
Lloh17:
	ldr	x11, [x11, _EL_PWM@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x11]
	ldr	w2, [x8]
	sub	x8, x10, x9
	asr	x8, x8, #1
	cmp	x8, #0
	cinc	x8, x8, lt
	lsr	x5, x8, #1
Lloh19:
	adrp	x1, l_.str@PAGE
Lloh20:
	add	x1, x1, l_.str@PAGEOFF
                                        ; kill: def $w5 killed $w5 killed $x5
	bl	_elprintf
	b	LBB0_1
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotStr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_Pico32x,8,3                    ; @Pico32x
	.comm	_pwm_silent,4,2                 ; @pwm_silent
	.comm	_pwm_ptr,4,2                    ; @pwm_ptr
	.comm	_Pico32xMem,8,3                 ; @Pico32xMem
	.comm	_EL_PWM,4,2                     ; @EL_PWM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pwm_update: pwm_ptr %d, len %d, step %04x, done %d"

.subsections_via_symbols
