	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ibmasm_remove_one
_ibmasm_remove_one:                     ## @ibmasm_remove_one
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	callq	_pci_get_drvdata
	movq	%rax, %rbx
	leaq	L_.str(%rip), %rdi
	callq	_dbg
	movq	%rbx, %rdi
	callq	_ibmasm_unregister_uart
	leaq	L_.str.1(%rip), %rdi
	callq	_dbg
	movq	_SYSTEM_STATE_OS_DOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_ibmasm_send_os_state
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str.2(%rip), %rdi
	callq	_err
LBB0_2:
	leaq	L_.str.3(%rip), %rdi
	callq	_dbg
	movq	%rbx, %rdi
	callq	_ibmasm_heartbeat_exit
	leaq	L_.str.4(%rip), %rdi
	callq	_dbg
	movl	(%rbx), %edi
	callq	_disable_sp_interrupts
	leaq	L_.str.5(%rip), %rdi
	callq	_dbg
	movl	4(%rbx), %edi
	movq	%rbx, %rsi
	callq	_free_irq
	leaq	L_.str.6(%rip), %rdi
	callq	_dbg
	movq	%rbx, %rdi
	callq	_ibmasm_free_remote_input_dev
	movl	(%rbx), %edi
	callq	_iounmap
	movq	%rbx, %rdi
	callq	_ibmasm_event_buffer_exit
	movq	%rbx, %rdi
	callq	_kfree
	movq	%r14, %rdi
	callq	_pci_release_regions
	movq	%r14, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_pci_disable_device             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unregistering UART\n"

L_.str.1:                               ## @.str.1
	.asciz	"Sending OS down message\n"

	.comm	_SYSTEM_STATE_OS_DOWN,4,2       ## @SYSTEM_STATE_OS_DOWN
L_.str.2:                               ## @.str.2
	.asciz	"failed to get response to 'Send OS State' command\n"

L_.str.3:                               ## @.str.3
	.asciz	"Disabling heartbeats\n"

L_.str.4:                               ## @.str.4
	.asciz	"Disabling interrupts\n"

L_.str.5:                               ## @.str.5
	.asciz	"Freeing SP irq\n"

L_.str.6:                               ## @.str.6
	.asciz	"Cleaning up\n"

	.no_dead_strip	_ibmasm_remove_one
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ibmasm_remove_one
_ibmasm_remove_one:                     ; @ibmasm_remove_one
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	bl	_pci_get_drvdata
	mov	x20, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dbg
	mov	x0, x20
	bl	_ibmasm_unregister_uart
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_dbg
Lloh4:
	adrp	x8, _SYSTEM_STATE_OS_DOWN@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SYSTEM_STATE_OS_DOWN@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_ibmasm_send_os_state
	cbz	x0, LBB0_2
; %bb.1:
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_err
LBB0_2:
Lloh9:
	adrp	x0, l_.str.3@PAGE
Lloh10:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_dbg
	mov	x0, x20
	bl	_ibmasm_heartbeat_exit
Lloh11:
	adrp	x0, l_.str.4@PAGE
Lloh12:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_dbg
	ldr	w0, [x20]
	bl	_disable_sp_interrupts
Lloh13:
	adrp	x0, l_.str.5@PAGE
Lloh14:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_dbg
	ldr	w0, [x20, #4]
	mov	x1, x20
	bl	_free_irq
Lloh15:
	adrp	x0, l_.str.6@PAGE
Lloh16:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_dbg
	mov	x0, x20
	bl	_ibmasm_free_remote_input_dev
	ldr	w0, [x20]
	bl	_iounmap
	mov	x0, x20
	bl	_ibmasm_event_buffer_exit
	mov	x0, x20
	bl	_kfree
	mov	x0, x19
	bl	_pci_release_regions
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_pci_disable_device
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unregistering UART\n"

l_.str.1:                               ; @.str.1
	.asciz	"Sending OS down message\n"

	.comm	_SYSTEM_STATE_OS_DOWN,4,2       ; @SYSTEM_STATE_OS_DOWN
l_.str.2:                               ; @.str.2
	.asciz	"failed to get response to 'Send OS State' command\n"

l_.str.3:                               ; @.str.3
	.asciz	"Disabling heartbeats\n"

l_.str.4:                               ; @.str.4
	.asciz	"Disabling interrupts\n"

l_.str.5:                               ; @.str.5
	.asciz	"Freeing SP irq\n"

l_.str.6:                               ; @.str.6
	.asciz	"Cleaning up\n"

	.no_dead_strip	_ibmasm_remove_one
.subsections_via_symbols
