	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pwm_channel_alloc              ## -- Begin function pwm_channel_alloc
	.p2align	4, 0x90
_pwm_channel_alloc:                     ## @pwm_channel_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	%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
	movq	_pwm@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	%edi, %ebx
	movl	(%rax), %eax
	movl	$1, %r14d
	movl	%ebx, %ecx
	shll	%cl, %r14d
	btl	%edi, %eax
	jae	LBB0_2
## %bb.4:
	testl	%ebx, %ebx
	js	LBB0_7
## %bb.5:
	movq	%rsi, %r15
	testq	%rsi, %rsi
	je	LBB0_7
## %bb.6:
	movq	_PWM_NCHAN@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jle	LBB0_7
## %bb.8:
	xorl	%r12d, %r12d
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$12, %edx
	callq	_memset
	movq	(%r13), %rdi
	addq	$4, %rdi
	callq	_spin_lock_irqsave
	movq	(%r13), %rdi
	movq	16(%rdi), %rax
	movl	%ebx, %ecx
	cmpq	$0, (%rax,%rcx,8)
	je	LBB0_10
## %bb.9:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_11
LBB0_2:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_12:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	24(%rdi), %edi
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	callq	_clk_enable
	movq	(%r13), %rdi
	movl	%ebx, %esi
	callq	_pwmc_regs
	movl	%eax, 8(%r15)
	movl	%ebx, (%r15)
	movq	(%r13), %rax
	movl	24(%rax), %edi
	callq	_clk_get_rate
	movl	%eax, 4(%r15)
	movq	(%r13), %rax
	movq	16(%rax), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%r15, (%rax,%rcx,8)
	movq	(%r13), %rax
	movq	8(%rax), %rax
	movq	$0, (%rax,%rcx,8)
	movq	(%r13), %rdi
	movq	_PWM_DIS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edx
	callq	_pwm_writel
	movq	(%r13), %rdi
	movq	_PWM_IDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edx
	callq	_pwm_writel
	movq	(%r13), %rdi
LBB0_11:
	addq	$4, %rdi
	callq	_spin_unlock_irqrestore
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_pwm,8,3                        ## @pwm
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_PWM_NCHAN,4,2                  ## @PWM_NCHAN
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_PWM_DIS,4,2                    ## @PWM_DIS
	.comm	_PWM_IDR,4,2                    ## @PWM_IDR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pwm_channel_alloc              ; -- Begin function pwm_channel_alloc
	.p2align	2
_pwm_channel_alloc:                     ; @pwm_channel_alloc
	.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
Lloh0:
	adrp	x22, _pwm@GOTPAGE
Lloh1:
	ldr	x22, [x22, _pwm@GOTPAGEOFF]
	ldr	x8, [x22]
	cbz	x8, LBB0_7
; %bb.1:
	mov	x21, x0
	ldr	w8, [x8]
	mov	w9, #1
	lsl	w19, w9, w0
	tst	w8, w19
	b.eq	LBB0_7
; %bb.2:
	tbnz	w21, #31, LBB0_8
; %bb.3:
	mov	x20, x1
	cbz	x1, LBB0_8
; %bb.4:
Lloh2:
	adrp	x8, _PWM_NCHAN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PWM_NCHAN@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w8, w21
	b.le	LBB0_8
; %bb.5:
	mov	x0, x20
	mov	w1, #0
	mov	w2, #12
	bl	_memset
	ldr	x8, [x22]
	add	x0, x8, #4
	bl	_spin_lock_irqsave
	ldr	x8, [x22]
	ldr	x9, [x8, #16]
	ldr	x9, [x9, w21, uxtw #3]
	cbz	x9, LBB0_11
; %bb.6:
Lloh5:
	adrp	x9, _EBUSY@GOTPAGE
Lloh6:
	ldr	x9, [x9, _EBUSY@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	neg	w19, w9
	b	LBB0_12
LBB0_7:
Lloh8:
	adrp	x8, _ENODEV@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_10:
	mov	x0, x19
	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
	ret
LBB0_11:
	mov	w23, w21
	ldr	w0, [x8, #24]
	bl	_clk_enable
	ldr	x0, [x22]
	mov	x1, x21
	bl	_pwmc_regs
	str	w0, [x20, #8]
	str	w21, [x20]
	ldr	x8, [x22]
	ldr	w0, [x8, #24]
	bl	_clk_get_rate
	str	w0, [x20, #4]
	ldr	x8, [x22]
	ldr	x8, [x8, #16]
	lsl	x9, x23, #3
	str	x20, [x8, x9]
	ldr	x8, [x22]
	ldr	x8, [x8, #8]
	str	xzr, [x8, x9]
	ldr	x0, [x22]
Lloh12:
	adrp	x8, _PWM_DIS@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PWM_DIS@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x2, x19
	bl	_pwm_writel
	ldr	x0, [x22]
Lloh15:
	adrp	x8, _PWM_IDR@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PWM_IDR@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x2, x19
	bl	_pwm_writel
	mov	w19, #0
	ldr	x8, [x22]
LBB0_12:
	add	x0, x8, #4
	bl	_spin_unlock_irqrestore
	b	LBB0_10
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_pwm,8,3                        ; @pwm
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_PWM_NCHAN,4,2                  ; @PWM_NCHAN
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_PWM_DIS,4,2                    ; @PWM_DIS
	.comm	_PWM_IDR,4,2                    ; @PWM_IDR
.subsections_via_symbols
