	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function timbgpio_irq_type
_timbgpio_irq_type:                     ## @timbgpio_irq_type
	.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	$24, %rsp
	.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, %rbx
	callq	_irq_data_get_irq_chip_data
	movl	(%rbx), %ebx
	subl	(%rax), %ebx
	js	LBB0_2
## %bb.1:
	movq	%rax, %r15
	cmpl	16(%rax), %ebx
	jle	LBB0_3
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_22
LBB0_3:
	movq	_TGPIO_VER@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%r15), %rdi
	callq	_ioread32
	movl	%eax, %r13d
	movq	%r15, %r12
	addq	$4, %r12
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	movq	_TGPIO_LVR@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%r15), %rdi
	callq	_ioread32
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	_TGPIO_FLR@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%r15), %rdi
	callq	_ioread32
	movl	%eax, %r8d
	xorl	%eax, %eax
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	cmpl	$3, %r13d
	jl	LBB0_5
## %bb.4:
	movq	_TGPIO_BFLR@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%r15), %rdi
	movl	%r8d, %r13d
	callq	_ioread32
	movl	%r13d, %r8d
LBB0_5:
	movq	_IRQ_TYPE_LEVEL_HIGH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movq	_IRQ_TYPE_LEVEL_LOW@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%edi, %ecx
	testl	%r14d, %ecx
	je	LBB0_6
## %bb.7:
	movl	$1, %edx
	movl	%ebx, %ecx
	shll	%cl, %edx
	movl	$-2, %esi
	roll	%cl, %esi
	btrl	%ebx, %eax
	btrl	%ebx, %r8d
	testl	%r14d, %edi
	je	LBB0_9
## %bb.8:
	movl	-56(%rbp), %edi                 ## 4-byte Reload
	orl	%edx, %edi
	jmp	LBB0_10
LBB0_6:
	movl	-56(%rbp), %edi                 ## 4-byte Reload
	jmp	LBB0_10
LBB0_9:
	movl	-56(%rbp), %edi                 ## 4-byte Reload
	andl	%esi, %edi
LBB0_10:
	movq	_IRQ_TYPE_EDGE_BOTH@GOTPCREL(%rip), %rdx
	movl	%r14d, %ecx
	notl	%ecx
	testl	%ecx, (%rdx)
	jne	LBB0_14
## %bb.11:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	cmpl	$2, %r14d
	jg	LBB0_13
## %bb.12:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_21
LBB0_14:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movl	$1, %r12d
	movl	%ebx, %ecx
	shll	%cl, %r12d
	movl	$-2, %edx
	roll	%cl, %edx
	btrl	%ebx, %eax
	movq	_IRQ_TYPE_EDGE_FALLING@GOTPCREL(%rip), %rcx
	testl	%r14d, (%rcx)
	je	LBB0_16
## %bb.15:
	movl	%eax, %r13d
	andl	%edx, %edi
	jmp	LBB0_17
LBB0_13:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movl	$1, %r12d
	movl	%ebx, %ecx
	shll	%cl, %r12d
	btsl	%ebx, %eax
	movl	%eax, %r13d
	jmp	LBB0_18
LBB0_16:
	movl	%eax, %r13d
	orl	%r12d, %edi
LBB0_17:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
LBB0_18:
	movq	_TGPIO_LVR@GOTPCREL(%rip), %rax
	orl	%r8d, %r12d
	movq	(%rax), %rsi
	addq	8(%r15), %rsi
	callq	_iowrite32
	movq	_TGPIO_FLR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r15), %rsi
	movl	%r12d, %edi
	callq	_iowrite32
	cmpl	$3, %r14d
	jl	LBB0_20
## %bb.19:
	movq	_TGPIO_BFLR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r15), %rsi
	movl	%r13d, %edi
	callq	_iowrite32
LBB0_20:
	movl	$1, %edi
	movl	%ebx, %ecx
	shll	%cl, %edi
	movq	_TGPIO_ICR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r15), %rsi
	callq	_iowrite32
	xorl	%ebx, %ebx
	movq	-56(%rbp), %r12                 ## 8-byte Reload
LBB0_21:
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
LBB0_22:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_TGPIO_VER,8,3                  ## @TGPIO_VER
	.comm	_TGPIO_LVR,8,3                  ## @TGPIO_LVR
	.comm	_TGPIO_FLR,8,3                  ## @TGPIO_FLR
	.comm	_TGPIO_BFLR,8,3                 ## @TGPIO_BFLR
	.comm	_IRQ_TYPE_LEVEL_HIGH,4,2        ## @IRQ_TYPE_LEVEL_HIGH
	.comm	_IRQ_TYPE_LEVEL_LOW,4,2         ## @IRQ_TYPE_LEVEL_LOW
	.comm	_IRQ_TYPE_EDGE_BOTH,4,2         ## @IRQ_TYPE_EDGE_BOTH
	.comm	_IRQ_TYPE_EDGE_FALLING,4,2      ## @IRQ_TYPE_EDGE_FALLING
	.comm	_TGPIO_ICR,8,3                  ## @TGPIO_ICR
	.no_dead_strip	_timbgpio_irq_type
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function timbgpio_irq_type
_timbgpio_irq_type:                     ; @timbgpio_irq_type
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x22, x1
	mov	x19, x0
	bl	_irq_data_get_irq_chip_data
	ldr	w8, [x19]
	ldr	w9, [x0]
	subs	w25, w8, w9
	b.mi	LBB0_2
; %bb.1:
	mov	x20, x0
	ldr	w8, [x0, #16]
	cmp	w25, w8
	b.le	LBB0_3
LBB0_2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_15
LBB0_3:
	ldr	x8, [x20, #8]
Lloh3:
	adrp	x9, _TGPIO_VER@GOTPAGE
Lloh4:
	ldr	x9, [x9, _TGPIO_VER@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_ioread32
	mov	x21, x0
	add	x19, x20, #4
	mov	x0, x19
	bl	_spin_lock_irqsave
	ldr	x8, [x20, #8]
Lloh6:
	adrp	x26, _TGPIO_LVR@GOTPAGE
Lloh7:
	ldr	x26, [x26, _TGPIO_LVR@GOTPAGEOFF]
	ldr	x9, [x26]
	add	x0, x9, x8
	bl	_ioread32
	mov	x23, x0
	ldr	x8, [x20, #8]
Lloh8:
	adrp	x27, _TGPIO_FLR@GOTPAGE
Lloh9:
	ldr	x27, [x27, _TGPIO_FLR@GOTPAGEOFF]
	ldr	x9, [x27]
	add	x0, x9, x8
	bl	_ioread32
	mov	x24, x0
	cmp	w21, #3
	b.lt	LBB0_5
; %bb.4:
	ldr	x8, [x20, #8]
Lloh10:
	adrp	x9, _TGPIO_BFLR@GOTPAGE
Lloh11:
	ldr	x9, [x9, _TGPIO_BFLR@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_ioread32
	mov	x8, x0
	b	LBB0_6
LBB0_5:
	mov	w8, #0
LBB0_6:
Lloh13:
	adrp	x9, _IRQ_TYPE_LEVEL_HIGH@GOTPAGE
Lloh14:
	ldr	x9, [x9, _IRQ_TYPE_LEVEL_HIGH@GOTPAGEOFF]
Lloh15:
	ldr	w10, [x9]
Lloh16:
	adrp	x9, _IRQ_TYPE_LEVEL_LOW@GOTPAGE
Lloh17:
	ldr	x9, [x9, _IRQ_TYPE_LEVEL_LOW@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	orr	w12, w9, w10
	mov	w9, #1
	lsl	w9, w9, w25
	mvn	w11, w9
	bic	w13, w8, w9
	bic	w14, w24, w9
	tst	w10, w22
	and	w10, w23, w11
	orr	w15, w23, w9
	csel	w10, w10, w15, eq
	tst	w12, w22
	csel	w0, w23, w10, eq
	csel	w10, w24, w14, eq
	csel	w8, w8, w13, eq
Lloh19:
	adrp	x12, _IRQ_TYPE_EDGE_BOTH@GOTPAGE
Lloh20:
	ldr	x12, [x12, _IRQ_TYPE_EDGE_BOTH@GOTPAGEOFF]
Lloh21:
	ldr	w12, [x12]
	bics	wzr, w12, w22
	b.ne	LBB0_9
; %bb.7:
	cmp	w21, #2
	b.gt	LBB0_10
; %bb.8:
Lloh22:
	adrp	x8, _EINVAL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_14
LBB0_9:
Lloh25:
	adrp	x12, _IRQ_TYPE_EDGE_FALLING@GOTPAGE
Lloh26:
	ldr	x12, [x12, _IRQ_TYPE_EDGE_FALLING@GOTPAGEOFF]
	bic	w23, w8, w9
Lloh27:
	ldr	w8, [x12]
	tst	w8, w22
	orr	w8, w0, w9
	and	w11, w0, w11
	csel	w0, w8, w11, eq
	b	LBB0_11
LBB0_10:
	mov	w9, #1
	lsl	w9, w9, w25
	orr	w23, w8, w9
LBB0_11:
	orr	w22, w9, w10
	ldr	x8, [x20, #8]
	ldr	x9, [x26]
	add	x1, x9, x8
	bl	_iowrite32
	ldr	x8, [x20, #8]
	ldr	x9, [x27]
	add	x1, x9, x8
	mov	x0, x22
	bl	_iowrite32
	cmp	w21, #3
	b.lt	LBB0_13
; %bb.12:
	ldr	x8, [x20, #8]
Lloh28:
	adrp	x9, _TGPIO_BFLR@GOTPAGE
Lloh29:
	ldr	x9, [x9, _TGPIO_BFLR@GOTPAGEOFF]
Lloh30:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x23
	bl	_iowrite32
LBB0_13:
	mov	w8, #1
	lsl	w0, w8, w25
	ldr	x8, [x20, #8]
Lloh31:
	adrp	x9, _TGPIO_ICR@GOTPAGE
Lloh32:
	ldr	x9, [x9, _TGPIO_ICR@GOTPAGEOFF]
Lloh33:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_iowrite32
	mov	w20, #0
LBB0_14:
	mov	x0, x19
	bl	_spin_unlock_irqrestore
LBB0_15:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_TGPIO_VER,8,3                  ; @TGPIO_VER
	.comm	_TGPIO_LVR,8,3                  ; @TGPIO_LVR
	.comm	_TGPIO_FLR,8,3                  ; @TGPIO_FLR
	.comm	_TGPIO_BFLR,8,3                 ; @TGPIO_BFLR
	.comm	_IRQ_TYPE_LEVEL_HIGH,4,2        ; @IRQ_TYPE_LEVEL_HIGH
	.comm	_IRQ_TYPE_LEVEL_LOW,4,2         ; @IRQ_TYPE_LEVEL_LOW
	.comm	_IRQ_TYPE_EDGE_BOTH,4,2         ; @IRQ_TYPE_EDGE_BOTH
	.comm	_IRQ_TYPE_EDGE_FALLING,4,2      ; @IRQ_TYPE_EDGE_FALLING
	.comm	_TGPIO_ICR,8,3                  ; @TGPIO_ICR
	.no_dead_strip	_timbgpio_irq_type
.subsections_via_symbols
