	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cs5535_mfgpt_alloc_timer       ## -- Begin function cs5535_mfgpt_alloc_timer
	.p2align	4, 0x90
_cs5535_mfgpt_alloc_timer:              ## @cs5535_mfgpt_alloc_timer
	.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
	movq	_cs5535_mfgpt_chip@GOTPCREL(%rip), %r12
	cmpl	$0, 16(%r12)
	je	LBB0_14
## %bb.1:
	movl	%edi, %r15d
	movq	_MFGPT_DOMAIN_WORKING@GOTPCREL(%rip), %rax
	movl	$6, %ebx
	cmpl	%esi, (%rax)
	je	LBB0_3
## %bb.2:
	movq	_MFGPT_MAX_TIMERS@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_3:
	cmpl	%r15d, %ebx
	jle	LBB0_7
## %bb.4:
	leaq	8(%r12), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movl	12(%r12), %esi
	testl	%r15d, %r15d
	js	LBB0_8
## %bb.5:
	movl	%r15d, %edi
	callq	_test_bit
	testl	%eax, %eax
	jne	LBB0_10
	jmp	LBB0_13
LBB0_7:
	movl	$1, %edi
	callq	_WARN_ON
	jmp	LBB0_14
LBB0_8:
	movl	%esi, %edi
	movl	%ebx, %esi
	callq	_find_first_bit
	movq	%rax, %r15
	movslq	%ebx, %rax
	cmpq	%rax, %r15
	jae	LBB0_13
## %bb.9:
	testl	%r15d, %r15d
	js	LBB0_13
LBB0_10:
	movl	12(%r12), %esi
	movl	%r15d, %edi
	callq	___clear_bit
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movq	%rax, %rbx
	movq	%r12, 8(%rax)
	movl	%r15d, (%rax)
	movq	(%r12), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edx
	callq	_dev_info
	jmp	LBB0_15
LBB0_12:
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movl	12(%r12), %esi
	movl	%r15d, %edi
	callq	___set_bit
LBB0_13:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
LBB0_14:
	xorl	%ebx, %ebx
LBB0_15:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_cs5535_mfgpt_chip,24,3         ## @cs5535_mfgpt_chip
	.comm	_MFGPT_DOMAIN_WORKING,4,2       ## @MFGPT_DOMAIN_WORKING
	.comm	_MFGPT_MAX_TIMERS,4,2           ## @MFGPT_MAX_TIMERS
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"registered timer %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cs5535_mfgpt_alloc_timer       ; -- Begin function cs5535_mfgpt_alloc_timer
	.p2align	2
_cs5535_mfgpt_alloc_timer:              ; @cs5535_mfgpt_alloc_timer
	.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
Lloh0:
	adrp	x22, _cs5535_mfgpt_chip@GOTPAGE
Lloh1:
	ldr	x22, [x22, _cs5535_mfgpt_chip@GOTPAGEOFF]
	ldr	w8, [x22, #16]
	cbz	w8, LBB0_4
; %bb.1:
	mov	x19, x0
Lloh2:
	adrp	x8, _MFGPT_DOMAIN_WORKING@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MFGPT_DOMAIN_WORKING@GOTPAGEOFF]
Lloh4:
	adrp	x9, _MFGPT_MAX_TIMERS@GOTPAGE
Lloh5:
	ldr	x9, [x9, _MFGPT_MAX_TIMERS@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
Lloh7:
	ldr	w9, [x9]
	mov	w10, #6
	cmp	w8, w1
	csel	w20, w10, w9, eq
	cmp	w20, w0
	b.le	LBB0_5
; %bb.2:
	add	x0, x22, #8
	bl	_spin_lock_irqsave
	ldr	w1, [x22, #12]
	tbnz	w19, #31, LBB0_6
; %bb.3:
	mov	x0, x19
	bl	_test_bit
	cbnz	w0, LBB0_8
	b	LBB0_10
LBB0_4:
	mov	x21, #0
	b	LBB0_12
LBB0_5:
	mov	w0, #1
	bl	_WARN_ON
	mov	x21, #0
	b	LBB0_12
LBB0_6:
	mov	x0, x1
	mov	x1, x20
	bl	_find_first_bit
	cmp	x0, w20, sxtw
	b.hs	LBB0_10
; %bb.7:
	mov	x19, x0
	tbnz	w19, #31, LBB0_10
LBB0_8:
	ldr	w1, [x22, #12]
	mov	x0, x19
	bl	___clear_bit
	add	x20, x22, #8
	mov	x0, x20
	bl	_spin_unlock_irqrestore
Lloh8:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	w0, #16
	bl	_kmalloc
	mov	x21, x0
	cbz	x0, LBB0_11
; %bb.9:
	str	x22, [x21, #8]
	str	w19, [x21]
	ldr	x0, [x22]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_dev_info
	b	LBB0_12
LBB0_10:
	add	x0, x22, #8
	bl	_spin_unlock_irqrestore
	mov	x21, #0
	b	LBB0_12
LBB0_11:
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldr	w1, [x22, #12]
	mov	x0, x19
	bl	___set_bit
	mov	x0, x20
	bl	_spin_unlock_irqrestore
LBB0_12:
	mov	x0, x21
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh6
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_cs5535_mfgpt_chip,24,3         ; @cs5535_mfgpt_chip
	.comm	_MFGPT_DOMAIN_WORKING,4,2       ; @MFGPT_DOMAIN_WORKING
	.comm	_MFGPT_MAX_TIMERS,4,2           ; @MFGPT_MAX_TIMERS
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"registered timer %d\n"

.subsections_via_symbols
