	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aw_pwm_channel_config
_aw_pwm_channel_config:                 ## @aw_pwm_channel_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
	movl	%ecx, %r12d
	movl	%edx, %r15d
	callq	_device_get_softc
	movq	%rax, %rdi
	movq	_NS_PER_SEC@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, %eax
	cltd
	idivl	%r15d
	movq	_AW_PWM_MAX_FREQ@GOTPCREL(%rip), %r14
	movl	(%r14), %r13d
	cmpl	%r13d, %eax
	jg	LBB0_3
## %bb.1:
	movl	%eax, %ebx
	movl	%ecx, %eax
	cltd
	idivl	%r12d
	cmpl	%ebx, %eax
	jge	LBB0_6
## %bb.2:
	movl	8(%rdi), %edi
	leaq	L_.str(%rip), %rsi
	callq	_device_printf
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %eax
LBB0_5:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	movq	_AW_PWM_CTRL_PRESCALE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	%r13d, %eax
	cltd
	idivl	%ebx
	decl	%eax
	movq	_AW_PWM_PERIOD_TOTAL_MASK@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jle	LBB0_15
## %bb.7:
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movq	_aw_pwm_clk_prescaler@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	callq	_nitems
	testl	%eax, %eax
	jle	LBB0_14
## %bb.8:
	movl	%r12d, -52(%rbp)                ## 4-byte Spill
	xorl	%r12d, %r12d
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_10 Depth=1
	incq	%r12
	callq	_nitems
	cltq
	cmpq	%rax, %r12
	jge	LBB0_13
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rdi
	movl	(%rdi,%r12,4), %esi
	testl	%esi, %esi
	je	LBB0_9
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	(%r14), %ecx
	movl	%ecx, %eax
	imull	%esi, %eax
	cltd
	idivl	%ebx
	movq	_AW_PWM_PERIOD_TOTAL_MASK@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %eax
	jg	LBB0_9
## %bb.12:
	movl	%ecx, %eax
	cltd
	idivl	%esi
	movl	%eax, %r13d
	movl	%r12d, %eax
	movl	%r12d, -48(%rbp)                ## 4-byte Spill
LBB0_13:
	movl	-52(%rbp), %r12d                ## 4-byte Reload
LBB0_14:
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	_AW_PWM_CTRL_PRESCALE_MASK@GOTPCREL(%rip), %rax
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	cmpl	(%rax), %ecx
	je	LBB0_3
LBB0_15:
	movq	_AW_PWM_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rdi, %r14
	callq	_AW_PWM_READ
	movq	_AW_PWM_CTRL_PERIOD_BUSY@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_17
## %bb.16:
	movl	8(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_device_printf
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_17:
	movq	_AW_PWM_CTRL_PRESCALE_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%ecx, %eax
	orl	-48(%rbp), %eax                 ## 4-byte Folded Reload
	movq	_AW_PWM_CTRL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_AW_PWM_WRITE
	movl	%r13d, %eax
	cltd
	idivl	%ebx
	movl	%eax, %ebx
	movq	_AW_PWM_PERIOD_TOTAL_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %ebx
	movl	%r13d, %eax
	cltd
	idivl	-68(%rbp)                       ## 4-byte Folded Reload
	movq	_AW_PWM_PERIOD_ACTIVE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	orl	%eax, %ebx
	movq	_AW_PWM_PERIOD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_AW_PWM_WRITE
	movl	%r15d, (%r14)
	movl	%r12d, 4(%r14)
	xorl	%eax, %eax
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_NS_PER_SEC,4,2                 ## @NS_PER_SEC
	.comm	_AW_PWM_MAX_FREQ,4,2            ## @AW_PWM_MAX_FREQ
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"duty < period\n"

	.comm	_AW_PWM_CTRL_PRESCALE_MASK,4,2  ## @AW_PWM_CTRL_PRESCALE_MASK
	.comm	_AW_PWM_PERIOD_TOTAL_MASK,4,2   ## @AW_PWM_PERIOD_TOTAL_MASK
	.comm	_aw_pwm_clk_prescaler,8,3       ## @aw_pwm_clk_prescaler
	.comm	_AW_PWM_CTRL,4,2                ## @AW_PWM_CTRL
	.comm	_AW_PWM_CTRL_PERIOD_BUSY,4,2    ## @AW_PWM_CTRL_PERIOD_BUSY
L_.str.1:                               ## @.str.1
	.asciz	"pwm busy\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_AW_PWM_PERIOD_TOTAL_SHIFT,4,2  ## @AW_PWM_PERIOD_TOTAL_SHIFT
	.comm	_AW_PWM_PERIOD_ACTIVE_SHIFT,4,2 ## @AW_PWM_PERIOD_ACTIVE_SHIFT
	.comm	_AW_PWM_PERIOD,4,2              ## @AW_PWM_PERIOD
	.no_dead_strip	_aw_pwm_channel_config
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aw_pwm_channel_config
_aw_pwm_channel_config:                 ; @aw_pwm_channel_config
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x3
	mov	x20, x2
	bl	_device_get_softc
Lloh0:
	adrp	x8, _NS_PER_SEC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NS_PER_SEC@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	sdiv	w22, w8, w20
Lloh3:
	adrp	x27, _AW_PWM_MAX_FREQ@GOTPAGE
Lloh4:
	ldr	x27, [x27, _AW_PWM_MAX_FREQ@GOTPAGEOFF]
	ldr	w23, [x27]
	cmp	w22, w23
	b.gt	LBB0_3
; %bb.1:
	mov	x21, x0
	sdiv	w24, w8, w19
	cmp	w24, w22
	b.ge	LBB0_6
; %bb.2:
	ldr	w0, [x21, #8]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_device_printf
LBB0_3:
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_4:
	ldr	w0, [x8]
LBB0_5:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_6:
Lloh9:
	adrp	x26, _AW_PWM_CTRL_PRESCALE_MASK@GOTPAGE
Lloh10:
	ldr	x26, [x26, _AW_PWM_CTRL_PRESCALE_MASK@GOTPAGEOFF]
	ldr	w8, [x26]
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	sdiv	w8, w23, w22
	sub	w8, w8, #1
Lloh11:
	adrp	x28, _AW_PWM_PERIOD_TOTAL_MASK@GOTPAGE
Lloh12:
	ldr	x28, [x28, _AW_PWM_PERIOD_TOTAL_MASK@GOTPAGEOFF]
	ldr	w9, [x28]
	cmp	w8, w9
	b.le	LBB0_13
; %bb.7:
Lloh13:
	adrp	x25, _aw_pwm_clk_prescaler@GOTPAGE
Lloh14:
	ldr	x25, [x25, _aw_pwm_clk_prescaler@GOTPAGEOFF]
	ldr	x0, [x25]
	bl	_nitems
	cmp	w0, #1
	b.lt	LBB0_15
; %bb.8:
	mov	x26, #0
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x26, x26, #1
	bl	_nitems
	cmp	x26, w0, sxtw
	b.ge	LBB0_14
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x25]
	ldr	w8, [x0, x26, lsl #2]
	cbz	w8, LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	w9, [x27]
	mul	w10, w9, w8
	sdiv	w10, w10, w22
	ldr	w11, [x28]
	cmp	w10, w11
	b.gt	LBB0_9
; %bb.12:
	mov	x27, x26
	sdiv	w23, w9, w8
Lloh15:
	adrp	x26, _AW_PWM_CTRL_PRESCALE_MASK@GOTPAGE
Lloh16:
	ldr	x26, [x26, _AW_PWM_CTRL_PRESCALE_MASK@GOTPAGEOFF]
	b	LBB0_16
LBB0_13:
	ldr	w27, [sp, #12]                  ; 4-byte Folded Reload
	b	LBB0_17
LBB0_14:
Lloh17:
	adrp	x26, _AW_PWM_CTRL_PRESCALE_MASK@GOTPAGE
Lloh18:
	ldr	x26, [x26, _AW_PWM_CTRL_PRESCALE_MASK@GOTPAGEOFF]
LBB0_15:
	ldr	w27, [sp, #12]                  ; 4-byte Folded Reload
LBB0_16:
	ldr	w8, [x26]
	cmp	w27, w8
	b.eq	LBB0_3
LBB0_17:
Lloh19:
	adrp	x25, _AW_PWM_CTRL@GOTPAGE
Lloh20:
	ldr	x25, [x25, _AW_PWM_CTRL@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	x0, x21
	bl	_AW_PWM_READ
Lloh21:
	adrp	x8, _AW_PWM_CTRL_PERIOD_BUSY@GOTPAGE
Lloh22:
	ldr	x8, [x8, _AW_PWM_CTRL_PERIOD_BUSY@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_19
; %bb.18:
	ldr	w0, [x21, #8]
Lloh24:
	adrp	x1, l_.str.1@PAGE
Lloh25:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_device_printf
Lloh26:
	adrp	x8, _EBUSY@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_4
LBB0_19:
	ldr	w8, [x26]
	bic	w8, w0, w8
	orr	w2, w8, w27
	ldr	w1, [x25]
	mov	x0, x21
	bl	_AW_PWM_WRITE
Lloh28:
	adrp	x8, _AW_PWM_PERIOD_TOTAL_SHIFT@GOTPAGE
Lloh29:
	ldr	x8, [x8, _AW_PWM_PERIOD_TOTAL_SHIFT@GOTPAGEOFF]
	sdiv	w9, w23, w22
Lloh30:
	ldr	w8, [x8]
	lsl	w8, w9, w8
Lloh31:
	adrp	x9, _AW_PWM_PERIOD_ACTIVE_SHIFT@GOTPAGE
Lloh32:
	ldr	x9, [x9, _AW_PWM_PERIOD_ACTIVE_SHIFT@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	sdiv	w10, w23, w24
	lsl	w9, w10, w9
	orr	w2, w9, w8
Lloh34:
	adrp	x8, _AW_PWM_PERIOD@GOTPAGE
Lloh35:
	ldr	x8, [x8, _AW_PWM_PERIOD@GOTPAGEOFF]
Lloh36:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_AW_PWM_WRITE
	mov	w0, #0
	stp	w20, w19, [x21]
	b	LBB0_5
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_NS_PER_SEC,4,2                 ; @NS_PER_SEC
	.comm	_AW_PWM_MAX_FREQ,4,2            ; @AW_PWM_MAX_FREQ
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"duty < period\n"

	.comm	_AW_PWM_CTRL_PRESCALE_MASK,4,2  ; @AW_PWM_CTRL_PRESCALE_MASK
	.comm	_AW_PWM_PERIOD_TOTAL_MASK,4,2   ; @AW_PWM_PERIOD_TOTAL_MASK
	.comm	_aw_pwm_clk_prescaler,8,3       ; @aw_pwm_clk_prescaler
	.comm	_AW_PWM_CTRL,4,2                ; @AW_PWM_CTRL
	.comm	_AW_PWM_CTRL_PERIOD_BUSY,4,2    ; @AW_PWM_CTRL_PERIOD_BUSY
l_.str.1:                               ; @.str.1
	.asciz	"pwm busy\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_AW_PWM_PERIOD_TOTAL_SHIFT,4,2  ; @AW_PWM_PERIOD_TOTAL_SHIFT
	.comm	_AW_PWM_PERIOD_ACTIVE_SHIFT,4,2 ; @AW_PWM_PERIOD_ACTIVE_SHIFT
	.comm	_AW_PWM_PERIOD,4,2              ; @AW_PWM_PERIOD
	.no_dead_strip	_aw_pwm_channel_config
.subsections_via_symbols
