	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pswitch_attach
_pswitch_attach:                        ## @pswitch_attach
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r15d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	callq	_device_get_softc
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movl	%r15d, %edi
	callq	_macio_get_node
	movq	%rax, %rdi
	callq	_OF_child
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movq	%rax, %rbx
	leaq	L_.str(%rip), %r12
	leaq	-80(%rbp), %r13
	leaq	L_.str.1(%rip), %r14
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	callq	_OF_peer
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movq	%r13, %rdx
	movl	$32, %ecx
	callq	_OF_getprop
	cmpl	$-1, %eax
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_strcmp
	testq	%rax, %rax
	jne	LBB0_4
## %bb.7:
	leaq	L_.str.3(%rip), %rsi
	leaq	-82(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$2, %ecx
	callq	_OF_getprop
	cmpl	$-1, %eax
	je	LBB0_8
## %bb.9:
	movq	-96(%rbp), %r12                 ## 8-byte Reload
	leaq	8(%r12), %rdx
	movq	$0, 8(%r12)
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movsbl	-82(%rbp), %ecx
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	movl	%r15d, %edi
	movl	%ecx, %r8d
	movl	$1, %r9d
	callq	_bus_alloc_resource
	movq	%rax, (%r12)
	testq	%rax, %rax
	je	LBB0_10
## %bb.11:
	movq	_INTR_TYPE_MISC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_pswitch_intr@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	%r12, %rsi
	addq	$16, %rsi
	movq	%rsi, (%rsp)
	xorl	%ebx, %ebx
	movl	%r15d, %edi
	movq	%rax, %rsi
	xorl	%r8d, %r8d
	movl	%r15d, %r9d
	callq	_bus_setup_intr
	testq	%rax, %rax
	je	LBB0_14
## %bb.12:
	leaq	L_.str.6(%rip), %rsi
	movl	%r15d, %edi
	callq	_device_printf
	movl	(%r14), %esi
	movq	(%r12), %rcx
	movq	8(%r12), %rdx
	movl	%r15d, %edi
	callq	_bus_release_resource
	jmp	LBB0_13
LBB0_5:
	leaq	L_.str.2(%rip), %rsi
LBB0_6:
	movl	%r15d, %edi
	callq	_device_printf
LBB0_13:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_14:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_16
## %bb.15:
	movl	%ebx, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_6
LBB0_10:
	leaq	L_.str.5(%rip), %rsi
	jmp	LBB0_6
LBB0_16:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"device_type"

L_.str.1:                               ## @.str.1
	.asciz	"programmer-switch"

L_.str.2:                               ## @.str.2
	.asciz	"could not find correct node\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
L_.str.3:                               ## @.str.3
	.asciz	"interrupts"

L_.str.4:                               ## @.str.4
	.asciz	"could not get interrupt\n"

	.comm	_SYS_RES_IRQ,4,2                ## @SYS_RES_IRQ
	.comm	_RF_ACTIVE,4,2                  ## @RF_ACTIVE
L_.str.5:                               ## @.str.5
	.asciz	"could not allocate interrupt\n"

	.comm	_INTR_TYPE_MISC,4,2             ## @INTR_TYPE_MISC
	.comm	_pswitch_intr,4,2               ## @pswitch_intr
L_.str.6:                               ## @.str.6
	.asciz	"could not setup interrupt\n"

	.no_dead_strip	_pswitch_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pswitch_attach
_pswitch_attach:                        ; @pswitch_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	bl	_device_get_softc
	mov	x20, x0
	mov	x0, x19
	bl	_macio_get_node
	bl	_OF_child
	cbz	x0, LBB0_9
; %bb.1:
	mov	x21, x0
Lloh3:
	adrp	x22, l_.str@PAGE
Lloh4:
	add	x22, x22, l_.str@PAGEOFF
Lloh5:
	adrp	x23, l_.str.1@PAGE
Lloh6:
	add	x23, x23, l_.str.1@PAGEOFF
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x21
	bl	_OF_peer
	mov	x21, x0
	cbz	x0, LBB0_9
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	add	x2, sp, #8
	mov	x0, x21
	mov	x1, x22
	mov	w3, #32
	bl	_OF_getprop
	cmn	w0, #1
	b.eq	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x0, sp, #8
	mov	x1, x23
	bl	_strcmp
	cbnz	x0, LBB0_2
; %bb.5:
Lloh7:
	adrp	x1, l_.str.3@PAGE
Lloh8:
	add	x1, x1, l_.str.3@PAGEOFF
	add	x2, sp, #6
	mov	x0, x21
	mov	w3, #2
	bl	_OF_getprop
	cmn	w0, #1
	b.eq	LBB0_14
; %bb.6:
	mov	x2, x20
	str	xzr, [x2, #8]!
Lloh9:
	adrp	x21, _SYS_RES_IRQ@GOTPAGE
Lloh10:
	ldr	x21, [x21, _SYS_RES_IRQ@GOTPAGEOFF]
	ldr	w1, [x21]
	ldrsb	w3, [sp, #6]
Lloh11:
	adrp	x8, _RF_ACTIVE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _RF_ACTIVE@GOTPAGEOFF]
Lloh13:
	ldr	w6, [x8]
	mov	x0, x19
	mov	x4, x3
	mov	w5, #1
	bl	_bus_alloc_resource
	str	x0, [x20]
	cbz	x0, LBB0_15
; %bb.7:
	mov	x1, x0
Lloh14:
	adrp	x8, _INTR_TYPE_MISC@GOTPAGE
Lloh15:
	ldr	x8, [x8, _INTR_TYPE_MISC@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
Lloh17:
	adrp	x8, _pswitch_intr@GOTPAGE
Lloh18:
	ldr	x8, [x8, _pswitch_intr@GOTPAGEOFF]
Lloh19:
	ldr	w3, [x8]
	add	x6, x20, #16
	mov	x0, x19
	mov	x4, #0
	mov	x5, x19
	bl	_bus_setup_intr
	cbz	x0, LBB0_12
; %bb.8:
Lloh20:
	adrp	x1, l_.str.6@PAGE
Lloh21:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x19
	bl	_device_printf
	ldr	w1, [x21]
	ldp	x3, x2, [x20]
	mov	x0, x19
	bl	_bus_release_resource
	b	LBB0_11
LBB0_9:
Lloh22:
	adrp	x1, l_.str.2@PAGE
Lloh23:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_10:
	mov	x0, x19
	bl	_device_printf
LBB0_11:
Lloh24:
	adrp	x8, _ENXIO@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
LBB0_12:
	ldr	x8, [sp, #40]
Lloh27:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh28:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_16
; %bb.13:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_14:
Lloh30:
	adrp	x1, l_.str.4@PAGE
Lloh31:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_10
LBB0_15:
Lloh32:
	adrp	x1, l_.str.5@PAGE
Lloh33:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_10
LBB0_16:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"device_type"

l_.str.1:                               ; @.str.1
	.asciz	"programmer-switch"

l_.str.2:                               ; @.str.2
	.asciz	"could not find correct node\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
l_.str.3:                               ; @.str.3
	.asciz	"interrupts"

l_.str.4:                               ; @.str.4
	.asciz	"could not get interrupt\n"

	.comm	_SYS_RES_IRQ,4,2                ; @SYS_RES_IRQ
	.comm	_RF_ACTIVE,4,2                  ; @RF_ACTIVE
l_.str.5:                               ; @.str.5
	.asciz	"could not allocate interrupt\n"

	.comm	_INTR_TYPE_MISC,4,2             ; @INTR_TYPE_MISC
	.comm	_pswitch_intr,4,2               ; @pswitch_intr
l_.str.6:                               ; @.str.6
	.asciz	"could not setup interrupt\n"

	.no_dead_strip	_pswitch_attach
.subsections_via_symbols
