	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pwm_clk_alloc                  ## -- Begin function pwm_clk_alloc
	.p2align	4, 0x90
_pwm_clk_alloc:                         ## @pwm_clk_alloc
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $esi killed $esi def $rsi
	xorl	%r14d, %r14d
	cmpl	$9, %edi
	ja	LBB0_2
## %bb.1:
	leal	-256(%rsi), %eax
	cmpl	$-256, %eax
	jbe	LBB0_2
## %bb.3:
	movl	%edi, %ebx
	shll	$8, %ebx
	orl	%esi, %ebx
	movq	_EBUSY@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	movq	_pwm@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	callq	_spin_lock_irqsave
	movq	(%r15), %rdi
	movq	_PWM_MR@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	callq	_pwm_readl
	testw	%ax, %ax
	je	LBB0_4
## %bb.5:
	cmpl	$65535, %eax                    ## imm = 0xFFFF
	ja	LBB0_8
## %bb.6:
	shll	$16, %ebx
	orl	%ebx, %eax
	movq	_PWM_CPR_CLKB@GOTPCREL(%rip), %rcx
	jmp	LBB0_7
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_11
LBB0_4:
	orl	%ebx, %eax
	movq	_PWM_CPR_CLKA@GOTPCREL(%rip), %rcx
LBB0_7:
	movl	(%rcx), %r14d
LBB0_8:
	testl	%r14d, %r14d
	jle	LBB0_10
## %bb.9:
	movq	(%r15), %rdi
	movl	(%r12), %esi
	movl	%eax, %edx
	callq	_pwm_writel
LBB0_10:
	movq	(%r15), %rdi
	callq	_spin_unlock_irqrestore
LBB0_11:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_pwm,8,3                        ## @pwm
	.comm	_PWM_MR,4,2                     ## @PWM_MR
	.comm	_PWM_CPR_CLKA,4,2               ## @PWM_CPR_CLKA
	.comm	_PWM_CPR_CLKB,4,2               ## @PWM_CPR_CLKB
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pwm_clk_alloc                  ; -- Begin function pwm_clk_alloc
	.p2align	2
_pwm_clk_alloc:                         ; @pwm_clk_alloc
	.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
	cmp	w0, #9
	b.hi	LBB0_5
; %bb.1:
	sub	w8, w1, #256
	cmn	w8, #256
	b.ls	LBB0_5
; %bb.2:
	orr	w19, w1, w0, lsl #8
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
Lloh3:
	adrp	x20, _pwm@GOTPAGE
Lloh4:
	ldr	x20, [x20, _pwm@GOTPAGEOFF]
	ldr	x0, [x20]
	bl	_spin_lock_irqsave
	ldr	x0, [x20]
Lloh5:
	adrp	x21, _PWM_MR@GOTPAGE
Lloh6:
	ldr	x21, [x21, _PWM_MR@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_pwm_readl
	mov	x2, x0
	tst	w0, #0xffff
	b.eq	LBB0_6
; %bb.3:
	lsr	w8, w2, #16
	cbnz	w8, LBB0_11
; %bb.4:
	orr	w2, w2, w19, lsl #16
Lloh7:
	adrp	x8, _PWM_CPR_CLKB@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PWM_CPR_CLKB@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_10
LBB0_6:
	orr	w2, w2, w19
Lloh12:
	adrp	x8, _PWM_CPR_CLKA@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PWM_CPR_CLKA@GOTPAGEOFF]
LBB0_7:
	ldr	w19, [x8]
	cmp	w19, #1
	b.lt	LBB0_9
LBB0_8:
	ldr	x0, [x20]
	ldr	w1, [x21]
	bl	_pwm_writel
LBB0_9:
	ldr	x0, [x20]
	bl	_spin_unlock_irqrestore
LBB0_10:
	mov	x0, x19
	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_11:
	neg	w19, w22
	cmp	w19, #1
	b.ge	LBB0_8
	b	LBB0_9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_pwm,8,3                        ; @pwm
	.comm	_PWM_MR,4,2                     ; @PWM_MR
	.comm	_PWM_CPR_CLKA,4,2               ; @PWM_CPR_CLKA
	.comm	_PWM_CPR_CLKB,4,2               ; @PWM_CPR_CLKB
.subsections_via_symbols
