	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wm831x_irq_init                ## -- Begin function wm831x_irq_init
	.p2align	4, 0x90
_wm831x_irq_init:                       ## @wm831x_irq_init
	.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
	movl	%esi, %r14d
	movq	%rdi, %r13
	addq	$40, %rdi
	callq	_mutex_init
	movq	(%r13), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_3
## %bb.1:
	xorl	%ebx, %ebx
	movq	_WM831X_INTERRUPT_STATUS_1_MASK@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rax
	movl	$65535, (%rax,%rbx,4)           ## imm = 0xFFFF
	movq	8(%r13), %rax
	movl	$65535, (%rax,%rbx,4)           ## imm = 0xFFFF
	movq	(%r15), %rsi
	addq	%rbx, %rsi
	movq	%r13, %rdi
	movl	$65535, %edx                    ## imm = 0xFFFF
	callq	_wm831x_reg_write
	incq	%rbx
	movq	(%r13), %rdi
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %rbx
	jl	LBB0_2
LBB0_3:
	movq	56(%r13), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.4:
	movq	_WM831X_NUM_IRQS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	callq	_irq_alloc_descs
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_5
## %bb.7:
	je	LBB0_6
## %bb.8:
	movq	24(%r13), %rax
	movl	(%rax), %r12d
	movq	_wm831x_irqs@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_ARRAY_SIZE
	movq	_wm831x_irq_domain_ops@GOTPCREL(%rip), %r8
	movl	%r12d, %edi
	movl	%eax, %esi
	movl	%r15d, %edx
	xorl	%ecx, %ecx
	movq	%r13, %r9
	callq	_irq_domain_add_legacy
	jmp	LBB0_9
LBB0_5:
	movq	24(%r13), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_dev_warn
LBB0_6:
	movq	24(%r13), %rax
	movl	(%rax), %r15d
	movq	_wm831x_irqs@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_ARRAY_SIZE
	movq	_wm831x_irq_domain_ops@GOTPCREL(%rip), %rdx
	movl	%r15d, %edi
	movl	%eax, %esi
	movq	%r13, %rcx
	callq	_irq_domain_add_linear
LBB0_9:
	movq	%rax, %r15
	testq	%rax, %rax
	je	LBB0_10
## %bb.11:
	xorl	%ecx, %ecx
	cmpq	$0, 48(%r13)
	movq	_WM831X_IRQ_OD@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	cmovel	%edx, %ecx
	movq	_WM831X_IRQ_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_wm831x_set_bits
	movl	%r14d, 16(%r13)
	movq	%r15, 32(%r13)
	testl	%r14d, %r14d
	je	LBB0_16
## %bb.12:
	movl	%r14d, %edi
	callq	_enable_irq_wake
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:
	movq	24(%r13), %rdi
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_warn
LBB0_14:
	movq	_wm831x_irq_thread@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_IRQF_TRIGGER_LOW@GOTPCREL(%rip), %rax
	movq	_IRQF_ONESHOT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	leaq	L_.str.3(%rip), %r8
	movl	%r14d, %edi
	xorl	%esi, %esi
	movq	%r13, %r9
	callq	_request_threaded_irq
	testl	%eax, %eax
	je	LBB0_17
## %bb.15:
	movl	%eax, %r15d
	movq	24(%r13), %rdi
	leaq	L_.str.4(%rip), %rsi
	movl	%r14d, %edx
	movl	%eax, %ecx
	callq	_dev_err
	jmp	LBB0_18
LBB0_10:
	movq	24(%r13), %rdi
	leaq	L_.str.1(%rip), %rsi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_dev_warn
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_18
LBB0_16:
	movq	24(%r13), %rdi
	leaq	L_.str.5(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_warn
LBB0_17:
	movq	_WM831X_SYSTEM_INTERRUPTS_MASK@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	xorl	%r15d, %r15d
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_wm831x_reg_write
LBB0_18:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WM831X_INTERRUPT_STATUS_1_MASK,8,3 ## @WM831X_INTERRUPT_STATUS_1_MASK
	.comm	_WM831X_NUM_IRQS,4,2            ## @WM831X_NUM_IRQS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to allocate IRQs: %d\n"

	.comm	_wm831x_irqs,8,3                ## @wm831x_irqs
	.comm	_wm831x_irq_domain_ops,4,2      ## @wm831x_irq_domain_ops
L_.str.1:                               ## @.str.1
	.asciz	"Failed to allocate IRQ domain\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_WM831X_IRQ_OD,4,2              ## @WM831X_IRQ_OD
	.comm	_WM831X_IRQ_CONFIG,4,2          ## @WM831X_IRQ_CONFIG
L_.str.2:                               ## @.str.2
	.asciz	"Can't enable IRQ as wake source: %d\n"

	.comm	_wm831x_irq_thread,4,2          ## @wm831x_irq_thread
	.comm	_IRQF_TRIGGER_LOW,4,2           ## @IRQF_TRIGGER_LOW
	.comm	_IRQF_ONESHOT,4,2               ## @IRQF_ONESHOT
L_.str.3:                               ## @.str.3
	.asciz	"wm831x"

L_.str.4:                               ## @.str.4
	.asciz	"Failed to request IRQ %d: %d\n"

L_.str.5:                               ## @.str.5
	.asciz	"No interrupt specified - functionality limited\n"

	.comm	_WM831X_SYSTEM_INTERRUPTS_MASK,8,3 ## @WM831X_SYSTEM_INTERRUPTS_MASK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wm831x_irq_init                ; -- Begin function wm831x_irq_init
	.p2align	2
_wm831x_irq_init:                       ; @wm831x_irq_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x1
	mov	x19, x0
	add	x0, x0, #40
	bl	_mutex_init
	ldr	x0, [x19]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x21, #0
	mov	w22, #65535
Lloh0:
	adrp	x23, _WM831X_INTERRUPT_STATUS_1_MASK@GOTPAGE
Lloh1:
	ldr	x23, [x23, _WM831X_INTERRUPT_STATUS_1_MASK@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x8, x21, #2
	ldp	x9, x10, [x19]
	str	w22, [x9, x8]
	str	w22, [x10, x8]
	ldr	x8, [x23]
	add	x1, x21, x8
	mov	x0, x19
	mov	w2, #65535
	bl	_wm831x_reg_write
	add	x21, x21, #1
	ldr	x0, [x19]
	bl	_ARRAY_SIZE
	cmp	x21, w0, sxtw
	b.lt	LBB0_2
LBB0_3:
	ldr	x0, [x19, #56]
	cbz	x0, LBB0_9
; %bb.4:
Lloh2:
	adrp	x8, _WM831X_NUM_IRQS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _WM831X_NUM_IRQS@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	w1, #0
	mov	w3, #0
	bl	_irq_alloc_descs
	mov	x21, x0
	tbnz	w0, #31, LBB0_8
; %bb.5:
	cbz	w21, LBB0_9
; %bb.6:
	ldr	x8, [x19, #24]
	ldr	w22, [x8]
Lloh5:
	adrp	x8, _wm831x_irqs@GOTPAGE
Lloh6:
	ldr	x8, [x8, _wm831x_irqs@GOTPAGEOFF]
Lloh7:
	ldr	x0, [x8]
	bl	_ARRAY_SIZE
	mov	x1, x0
Lloh8:
	adrp	x4, _wm831x_irq_domain_ops@GOTPAGE
Lloh9:
	ldr	x4, [x4, _wm831x_irq_domain_ops@GOTPAGEOFF]
	mov	x0, x22
	mov	x2, x21
	mov	w3, #0
	mov	x5, x19
	bl	_irq_domain_add_legacy
	mov	x21, x0
	cbnz	x0, LBB0_10
LBB0_7:
	ldr	x0, [x19, #24]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_warn
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_17
LBB0_8:
	ldr	x0, [x19, #24]
	str	x21, [sp]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
LBB0_9:
	ldr	x8, [x19, #24]
	ldr	w21, [x8]
Lloh17:
	adrp	x8, _wm831x_irqs@GOTPAGE
Lloh18:
	ldr	x8, [x8, _wm831x_irqs@GOTPAGEOFF]
Lloh19:
	ldr	x0, [x8]
	bl	_ARRAY_SIZE
	mov	x1, x0
Lloh20:
	adrp	x2, _wm831x_irq_domain_ops@GOTPAGE
Lloh21:
	ldr	x2, [x2, _wm831x_irq_domain_ops@GOTPAGEOFF]
	mov	x0, x21
	mov	x3, x19
	bl	_irq_domain_add_linear
	mov	x21, x0
	cbz	x0, LBB0_7
LBB0_10:
	ldr	x8, [x19, #48]
Lloh22:
	adrp	x9, _WM831X_IRQ_OD@GOTPAGE
Lloh23:
	ldr	x9, [x9, _WM831X_IRQ_OD@GOTPAGEOFF]
Lloh24:
	ldr	w2, [x9]
	cmp	x8, #0
	csel	w3, w2, wzr, eq
Lloh25:
	adrp	x8, _WM831X_IRQ_CONFIG@GOTPAGE
Lloh26:
	ldr	x8, [x8, _WM831X_IRQ_CONFIG@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_wm831x_set_bits
	str	w20, [x19, #16]
	str	x21, [x19, #32]
	cbz	w20, LBB0_15
; %bb.11:
	mov	x0, x20
	bl	_enable_irq_wake
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_13
; %bb.12:
	ldr	x8, [x19, #24]
	str	x0, [sp]
Lloh28:
	adrp	x1, l_.str.2@PAGE
Lloh29:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x8
	bl	_dev_warn
LBB0_13:
Lloh30:
	adrp	x8, _wm831x_irq_thread@GOTPAGE
Lloh31:
	ldr	x8, [x8, _wm831x_irq_thread@GOTPAGEOFF]
Lloh32:
	adrp	x9, _IRQF_TRIGGER_LOW@GOTPAGE
Lloh33:
	ldr	x9, [x9, _IRQF_TRIGGER_LOW@GOTPAGEOFF]
Lloh34:
	ldr	w2, [x8]
Lloh35:
	ldr	w8, [x9]
Lloh36:
	adrp	x9, _IRQF_ONESHOT@GOTPAGE
Lloh37:
	ldr	x9, [x9, _IRQF_ONESHOT@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
	orr	w3, w9, w8
Lloh39:
	adrp	x4, l_.str.3@PAGE
Lloh40:
	add	x4, x4, l_.str.3@PAGEOFF
	mov	x0, x20
	mov	x1, #0
	mov	x5, x19
	bl	_request_threaded_irq
	cbz	w0, LBB0_16
; %bb.14:
	mov	x21, x0
	ldr	x0, [x19, #24]
Lloh41:
	adrp	x1, l_.str.4@PAGE
Lloh42:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x2, x20
	mov	x3, x21
	bl	_dev_err
	b	LBB0_17
LBB0_15:
	ldr	x0, [x19, #24]
Lloh43:
	adrp	x1, l_.str.5@PAGE
Lloh44:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_dev_warn
LBB0_16:
Lloh45:
	adrp	x8, _WM831X_SYSTEM_INTERRUPTS_MASK@GOTPAGE
Lloh46:
	ldr	x8, [x8, _WM831X_SYSTEM_INTERRUPTS_MASK@GOTPAGEOFF]
Lloh47:
	ldr	x1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_wm831x_reg_write
	mov	w21, #0
LBB0_17:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh34
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.cfi_endproc
                                        ; -- End function
	.comm	_WM831X_INTERRUPT_STATUS_1_MASK,8,3 ; @WM831X_INTERRUPT_STATUS_1_MASK
	.comm	_WM831X_NUM_IRQS,4,2            ; @WM831X_NUM_IRQS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to allocate IRQs: %d\n"

	.comm	_wm831x_irqs,8,3                ; @wm831x_irqs
	.comm	_wm831x_irq_domain_ops,4,2      ; @wm831x_irq_domain_ops
l_.str.1:                               ; @.str.1
	.asciz	"Failed to allocate IRQ domain\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_WM831X_IRQ_OD,4,2              ; @WM831X_IRQ_OD
	.comm	_WM831X_IRQ_CONFIG,4,2          ; @WM831X_IRQ_CONFIG
l_.str.2:                               ; @.str.2
	.asciz	"Can't enable IRQ as wake source: %d\n"

	.comm	_wm831x_irq_thread,4,2          ; @wm831x_irq_thread
	.comm	_IRQF_TRIGGER_LOW,4,2           ; @IRQF_TRIGGER_LOW
	.comm	_IRQF_ONESHOT,4,2               ; @IRQF_ONESHOT
l_.str.3:                               ; @.str.3
	.asciz	"wm831x"

l_.str.4:                               ; @.str.4
	.asciz	"Failed to request IRQ %d: %d\n"

l_.str.5:                               ; @.str.5
	.asciz	"No interrupt specified - functionality limited\n"

	.comm	_WM831X_SYSTEM_INTERRUPTS_MASK,8,3 ; @WM831X_SYSTEM_INTERRUPTS_MASK
.subsections_via_symbols
