	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sunxi_sc_nmi_set_type
_sunxi_sc_nmi_set_type:                 ## @sunxi_sc_nmi_set_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r12
	callq	_irq_data_get_irq_chip_data
	movq	%rax, %r14
	movq	8(%rax), %r13
	movl	4(%r13), %r15d
	movq	%rax, %rdi
	callq	_irq_gc_lock
	movq	_IRQF_TRIGGER_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%ebx, %eax
	addl	$-128, %eax
	cmpl	$5, %eax
	jae	LBB0_1
## %bb.2:
	cltq
	leaq	l_switch.table.sunxi_sc_nmi_set_type(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_irqd_set_trigger_type
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_irq_setup_alt_chip
	movl	(%r14), %eax
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	cmpl	$1, %eax
	jne	LBB0_6
## %bb.5:
	movl	-44(%rbp), %r12d                ## 4-byte Reload
LBB0_12:
	testb	$1, %al
	je	LBB0_15
## %bb.13:
	testl	%ebx, (%r13)
	je	LBB0_15
## %bb.14:
	movl	4(%r13), %r15d
	jmp	LBB0_15
LBB0_1:
	movq	%r14, %rdi
	callq	_irq_gc_unlock
	movl	(%r12), %esi
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	movq	_EBADR@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_16
LBB0_3:
	movl	-44(%rbp), %r12d                ## 4-byte Reload
LBB0_15:
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_sunxi_sc_nmi_read
	movq	_SUNXI_NMI_SRC_TYPE_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	notl	%edx
	andl	%eax, %edx
	orl	%r12d, %edx
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_sunxi_sc_nmi_write
	movq	%r14, %rdi
	callq	_irq_gc_unlock
	movq	_IRQ_SET_MASK_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	%eax, %ecx
	andl	$-2, %ecx
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_7 Depth=1
	addq	$16, %r13
	addl	$-2, %ecx
	je	LBB0_12
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	testl	%ebx, (%r13)
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	4(%r13), %r15d
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	testl	%ebx, 8(%r13)
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	12(%r13), %r15d
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_IRQF_TRIGGER_MASK,4,2          ## @IRQF_TRIGGER_MASK
	.comm	_SUNXI_SRC_TYPE_EDGE_FALLING,4,2 ## @SUNXI_SRC_TYPE_EDGE_FALLING
	.comm	_SUNXI_SRC_TYPE_EDGE_RISING,4,2 ## @SUNXI_SRC_TYPE_EDGE_RISING
	.comm	_SUNXI_SRC_TYPE_LEVEL_HIGH,4,2  ## @SUNXI_SRC_TYPE_LEVEL_HIGH
	.comm	_SUNXI_SRC_TYPE_LEVEL_LOW,4,2   ## @SUNXI_SRC_TYPE_LEVEL_LOW
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot assign multiple trigger modes to IRQ %d.\n"

	.comm	_EBADR,4,2                      ## @EBADR
	.comm	_SUNXI_NMI_SRC_TYPE_MASK,4,2    ## @SUNXI_NMI_SRC_TYPE_MASK
	.comm	_IRQ_SET_MASK_OK,4,2            ## @IRQ_SET_MASK_OK
	.no_dead_strip	_sunxi_sc_nmi_set_type
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.sunxi_sc_nmi_set_type
l_switch.table.sunxi_sc_nmi_set_type:
	.quad	_SUNXI_SRC_TYPE_LEVEL_LOW
	.quad	_SUNXI_SRC_TYPE_LEVEL_LOW
	.quad	_SUNXI_SRC_TYPE_LEVEL_HIGH
	.quad	_SUNXI_SRC_TYPE_EDGE_RISING
	.quad	_SUNXI_SRC_TYPE_EDGE_FALLING

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sunxi_sc_nmi_set_type
_sunxi_sc_nmi_set_type:                 ; @sunxi_sc_nmi_set_type
	.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
	mov	x21, x1
	mov	x22, x0
	bl	_irq_data_get_irq_chip_data
	mov	x19, x0
	ldr	x24, [x0, #8]
	ldr	w20, [x24, #4]
	bl	_irq_gc_lock
Lloh0:
	adrp	x8, _IRQF_TRIGGER_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IRQF_TRIGGER_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	and	w8, w8, w21
	sub	w8, w8, #128
	cmp	w8, #5
	b.hs	LBB0_6
; %bb.1:
Lloh3:
	adrp	x9, l_switch.table.sunxi_sc_nmi_set_type@PAGE
Lloh4:
	add	x9, x9, l_switch.table.sunxi_sc_nmi_set_type@PAGEOFF
	ldr	x8, [x9, w8, sxtw #3]
	ldr	w23, [x8]
	mov	x0, x22
	mov	x1, x21
	bl	_irqd_set_trigger_type
	mov	x0, x22
	mov	x1, x21
	bl	_irq_setup_alt_chip
	ldr	w8, [x19]
	cbz	w8, LBB0_7
; %bb.2:
	add	x9, x24, #4
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x9, x9, #8
	subs	w8, w8, #1
	b.eq	LBB0_7
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldur	w10, [x9, #-4]
	tst	w10, w21
	b.eq	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w20, [x9]
	b	LBB0_3
LBB0_6:
	mov	x0, x19
	bl	_irq_gc_unlock
	ldr	w1, [x22]
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
Lloh7:
	adrp	x8, _EBADR@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EBADR@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_8
LBB0_7:
	mov	x0, x19
	mov	x1, x20
	bl	_sunxi_sc_nmi_read
Lloh10:
	adrp	x8, _SUNXI_NMI_SRC_TYPE_MASK@GOTPAGE
Lloh11:
	ldr	x8, [x8, _SUNXI_NMI_SRC_TYPE_MASK@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	bic	w8, w0, w8
	orr	w2, w8, w23
	mov	x0, x19
	mov	x1, x20
	bl	_sunxi_sc_nmi_write
	mov	x0, x19
	bl	_irq_gc_unlock
Lloh13:
	adrp	x8, _IRQ_SET_MASK_OK@GOTPAGE
Lloh14:
	ldr	x8, [x8, _IRQ_SET_MASK_OK@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
LBB0_8:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_IRQF_TRIGGER_MASK,4,2          ; @IRQF_TRIGGER_MASK
	.comm	_SUNXI_SRC_TYPE_EDGE_FALLING,4,2 ; @SUNXI_SRC_TYPE_EDGE_FALLING
	.comm	_SUNXI_SRC_TYPE_EDGE_RISING,4,2 ; @SUNXI_SRC_TYPE_EDGE_RISING
	.comm	_SUNXI_SRC_TYPE_LEVEL_HIGH,4,2  ; @SUNXI_SRC_TYPE_LEVEL_HIGH
	.comm	_SUNXI_SRC_TYPE_LEVEL_LOW,4,2   ; @SUNXI_SRC_TYPE_LEVEL_LOW
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot assign multiple trigger modes to IRQ %d.\n"

	.comm	_EBADR,4,2                      ; @EBADR
	.comm	_SUNXI_NMI_SRC_TYPE_MASK,4,2    ; @SUNXI_NMI_SRC_TYPE_MASK
	.comm	_IRQ_SET_MASK_OK,4,2            ; @IRQ_SET_MASK_OK
	.no_dead_strip	_sunxi_sc_nmi_set_type
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.sunxi_sc_nmi_set_type
l_switch.table.sunxi_sc_nmi_set_type:
	.quad	_SUNXI_SRC_TYPE_LEVEL_LOW
	.quad	_SUNXI_SRC_TYPE_LEVEL_LOW
	.quad	_SUNXI_SRC_TYPE_LEVEL_HIGH
	.quad	_SUNXI_SRC_TYPE_EDGE_RISING
	.quad	_SUNXI_SRC_TYPE_EDGE_FALLING

.subsections_via_symbols
