	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ibmasm_init_one
_ibmasm_init_one:                       ## @ibmasm_init_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	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_pci_enable_device
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	addq	$16, %r15
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	jmp	LBB0_27
LBB0_2:
	movq	_DRIVER_NAME@GOTPCREL(%rip), %r12
	movq	(%r12), %rsi
	movq	%r15, %rdi
	callq	_pci_request_regions
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	leaq	16(%r15), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_26
LBB0_4:
	movq	%r15, %rdi
	callq	_pci_set_master
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$40, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %r14
	leaq	36(%rax), %rdi
	callq	_spin_lock_init
	movq	%r14, %rdi
	addq	$32, %rdi
	callq	_INIT_LIST_HEAD
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_pci_set_drvdata
	leaq	16(%r15), %rax
	movq	%rax, 16(%r14)
	movq	8(%r15), %rax
	movl	(%rax), %ecx
	movl	%ecx, (%r14)
	movl	28(%r14), %edi
	movq	_IBMASM_NAME_SIZE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	L_.str.3(%rip), %rdx
	xorl	%eax, %eax
	callq	_snprintf
	movl	(%r14), %r8d
	movl	24(%r14), %edi
	movl	(%rbx), %esi
	movq	(%r12), %rcx
	leaq	L_.str.4(%rip), %rdx
	xorl	%eax, %eax
	callq	_snprintf
	movq	%r14, %rdi
	callq	_ibmasm_event_buffer_init
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %ebx
	movq	16(%r14), %rdi
	leaq	L_.str.5(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_24
LBB0_5:
	leaq	16(%r15), %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_25
LBB0_8:
	movq	%r14, %rdi
	callq	_ibmasm_heartbeat_init
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	%eax, %ebx
	movq	16(%r14), %rdi
	leaq	L_.str.6(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_23
LBB0_10:
	movl	(%r15), %eax
	movl	%eax, 8(%r14)
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_pci_ioremap_bar
	movl	%eax, 4(%r14)
	testl	%eax, %eax
	je	LBB0_11
## %bb.12:
	movq	_ibmasm_interrupt_handler@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_IRQF_SHARED@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	8(%r14), %edi
	movl	24(%r14), %ecx
	movq	%r14, %r8
	callq	_request_irq
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:
	movl	%eax, %ebx
	movq	16(%r14), %rdi
	leaq	L_.str.8(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_21
LBB0_11:
	movq	16(%r14), %rdi
	leaq	L_.str.7(%rip), %rsi
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_22
LBB0_14:
	movl	4(%r14), %edi
	callq	_enable_sp_interrupts
	movq	%r14, %rdi
	callq	_ibmasm_init_remote_input_dev
	testl	%eax, %eax
	je	LBB0_16
## %bb.15:
	movl	%eax, %ebx
	leaq	L_.str.9(%rip), %rsi
	jmp	LBB0_20
LBB0_16:
	movq	%r14, %rdi
	callq	_ibmasm_send_driver_vpd
	testl	%eax, %eax
	je	LBB0_18
## %bb.17:
	movl	%eax, %ebx
	leaq	L_.str.10(%rip), %rsi
	jmp	LBB0_20
LBB0_18:
	movq	_SYSTEM_STATE_OS_UP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_ibmasm_send_os_state
	testl	%eax, %eax
	je	LBB0_28
## %bb.19:
	movl	%eax, %ebx
	leaq	L_.str.11(%rip), %rsi
LBB0_20:
	movq	16(%r14), %rdi
	callq	_dev_err
	movl	4(%r14), %edi
	callq	_disable_sp_interrupts
	movq	%r14, %rdi
	callq	_ibmasm_free_remote_input_dev
	movl	8(%r14), %edi
	movq	%r14, %rsi
	callq	_free_irq
LBB0_21:
	movl	4(%r14), %edi
	callq	_iounmap
LBB0_22:
	movq	%r14, %rdi
	callq	_ibmasm_heartbeat_exit
LBB0_23:
	movq	%r14, %rdi
	callq	_ibmasm_event_buffer_exit
LBB0_24:
	movq	%r14, %rdi
	callq	_kfree
LBB0_25:
	movq	%r15, %rdi
	callq	_pci_release_regions
LBB0_26:
	movq	%r15, %rdi
	callq	_pci_disable_device
LBB0_27:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_28:
	movq	%r14, %rdi
	callq	_ibmasmfs_add_sp
	movq	%r14, %rdi
	callq	_ibmasm_register_uart
	xorl	%ebx, %ebx
	jmp	LBB0_27
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to enable PCI device\n"

	.comm	_DRIVER_NAME,8,3                ## @DRIVER_NAME
L_.str.1:                               ## @.str.1
	.asciz	"Failed to allocate PCI resources\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.2:                               ## @.str.2
	.asciz	"Failed to allocate memory\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_IBMASM_NAME_SIZE,4,2           ## @IBMASM_NAME_SIZE
L_.str.3:                               ## @.str.3
	.asciz	"%d"

L_.str.4:                               ## @.str.4
	.asciz	"%s%d"

L_.str.5:                               ## @.str.5
	.asciz	"Failed to allocate event buffer\n"

L_.str.6:                               ## @.str.6
	.asciz	"Failed to allocate heartbeat command\n"

L_.str.7:                               ## @.str.7
	.asciz	"Failed to ioremap pci memory\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_ibmasm_interrupt_handler,4,2   ## @ibmasm_interrupt_handler
	.comm	_IRQF_SHARED,4,2                ## @IRQF_SHARED
L_.str.8:                               ## @.str.8
	.asciz	"Failed to register interrupt handler\n"

L_.str.9:                               ## @.str.9
	.asciz	"Failed to initialize remote queue\n"

L_.str.10:                              ## @.str.10
	.asciz	"Failed to send driver VPD to service processor\n"

	.comm	_SYSTEM_STATE_OS_UP,4,2         ## @SYSTEM_STATE_OS_UP
L_.str.11:                              ## @.str.11
	.asciz	"Failed to send OS state to service processor\n"

	.no_dead_strip	_ibmasm_init_one
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ibmasm_init_one
_ibmasm_init_one:                       ; @ibmasm_init_one
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	bl	_pci_enable_device
	cbz	w0, LBB0_2
; %bb.1:
	mov	x21, x0
	add	x0, x19, #16
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_27
LBB0_2:
Lloh2:
	adrp	x22, _DRIVER_NAME@GOTPAGE
Lloh3:
	ldr	x22, [x22, _DRIVER_NAME@GOTPAGEOFF]
	ldr	x1, [x22]
	mov	x0, x19
	bl	_pci_request_regions
	cbz	w0, LBB0_4
; %bb.3:
	mov	x21, x0
	add	x0, x19, #16
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	b	LBB0_26
LBB0_4:
	mov	x0, x19
	bl	_pci_set_master
Lloh6:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	w0, #40
	bl	_kzalloc
	cbz	x0, LBB0_7
; %bb.5:
	mov	x20, x0
	add	x0, x0, #36
	bl	_spin_lock_init
	add	x0, x20, #32
	bl	_INIT_LIST_HEAD
	mov	x0, x19
	mov	x1, x20
	bl	_pci_set_drvdata
	add	x8, x19, #16
	str	x8, [x20, #16]
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
	str	w8, [x20]
	ldr	w0, [x20, #28]
Lloh9:
	adrp	x21, _IBMASM_NAME_SIZE@GOTPAGE
Lloh10:
	ldr	x21, [x21, _IBMASM_NAME_SIZE@GOTPAGEOFF]
	ldr	w1, [x21]
	str	x8, [sp]
Lloh11:
	adrp	x2, l_.str.3@PAGE
Lloh12:
	add	x2, x2, l_.str.3@PAGEOFF
	bl	_snprintf
	ldr	w0, [x20, #24]
	ldr	w1, [x21]
	ldr	x8, [x22]
	ldr	w9, [x20]
	stp	x8, x9, [sp]
Lloh13:
	adrp	x2, l_.str.4@PAGE
Lloh14:
	add	x2, x2, l_.str.4@PAGEOFF
	bl	_snprintf
	mov	x0, x20
	bl	_ibmasm_event_buffer_init
	cbz	w0, LBB0_8
; %bb.6:
	mov	x21, x0
	ldr	x0, [x20, #16]
Lloh15:
	adrp	x1, l_.str.5@PAGE
Lloh16:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_dev_err
	b	LBB0_24
LBB0_7:
	add	x0, x19, #16
Lloh17:
	adrp	x1, l_.str.2@PAGE
Lloh18:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_25
LBB0_8:
	mov	x0, x20
	bl	_ibmasm_heartbeat_init
	cbz	w0, LBB0_10
; %bb.9:
	mov	x21, x0
	ldr	x0, [x20, #16]
Lloh22:
	adrp	x1, l_.str.6@PAGE
Lloh23:
	add	x1, x1, l_.str.6@PAGEOFF
	bl	_dev_err
	b	LBB0_23
LBB0_10:
	ldr	w8, [x19]
	str	w8, [x20, #8]
	mov	x0, x19
	mov	w1, #0
	bl	_pci_ioremap_bar
	str	w0, [x20, #4]
	cbz	w0, LBB0_13
; %bb.11:
Lloh24:
	adrp	x8, _ibmasm_interrupt_handler@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ibmasm_interrupt_handler@GOTPAGEOFF]
	ldr	w0, [x20, #8]
Lloh26:
	ldr	w1, [x8]
Lloh27:
	adrp	x8, _IRQF_SHARED@GOTPAGE
Lloh28:
	ldr	x8, [x8, _IRQF_SHARED@GOTPAGEOFF]
Lloh29:
	ldr	w2, [x8]
	ldr	w3, [x20, #24]
	mov	x4, x20
	bl	_request_irq
	cbz	w0, LBB0_14
; %bb.12:
	mov	x21, x0
	ldr	x0, [x20, #16]
Lloh30:
	adrp	x1, l_.str.8@PAGE
Lloh31:
	add	x1, x1, l_.str.8@PAGEOFF
	bl	_dev_err
	b	LBB0_21
LBB0_13:
	ldr	x0, [x20, #16]
Lloh32:
	adrp	x1, l_.str.7@PAGE
Lloh33:
	add	x1, x1, l_.str.7@PAGEOFF
	bl	_dev_err
Lloh34:
	adrp	x8, _ENODEV@GOTPAGE
Lloh35:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_22
LBB0_14:
	ldr	w0, [x20, #4]
	bl	_enable_sp_interrupts
	mov	x0, x20
	bl	_ibmasm_init_remote_input_dev
	cbz	w0, LBB0_16
; %bb.15:
	mov	x21, x0
Lloh37:
	adrp	x1, l_.str.9@PAGE
Lloh38:
	add	x1, x1, l_.str.9@PAGEOFF
	b	LBB0_20
LBB0_16:
	mov	x0, x20
	bl	_ibmasm_send_driver_vpd
	cbz	w0, LBB0_18
; %bb.17:
	mov	x21, x0
Lloh39:
	adrp	x1, l_.str.10@PAGE
Lloh40:
	add	x1, x1, l_.str.10@PAGEOFF
	b	LBB0_20
LBB0_18:
Lloh41:
	adrp	x8, _SYSTEM_STATE_OS_UP@GOTPAGE
Lloh42:
	ldr	x8, [x8, _SYSTEM_STATE_OS_UP@GOTPAGEOFF]
Lloh43:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_ibmasm_send_os_state
	mov	x21, x0
	cbz	w0, LBB0_28
; %bb.19:
Lloh44:
	adrp	x1, l_.str.11@PAGE
Lloh45:
	add	x1, x1, l_.str.11@PAGEOFF
LBB0_20:
	ldr	x0, [x20, #16]
	bl	_dev_err
	ldr	w0, [x20, #4]
	bl	_disable_sp_interrupts
	mov	x0, x20
	bl	_ibmasm_free_remote_input_dev
	ldr	w0, [x20, #8]
	mov	x1, x20
	bl	_free_irq
LBB0_21:
	ldr	w0, [x20, #4]
	bl	_iounmap
LBB0_22:
	mov	x0, x20
	bl	_ibmasm_heartbeat_exit
LBB0_23:
	mov	x0, x20
	bl	_ibmasm_event_buffer_exit
LBB0_24:
	mov	x0, x20
	bl	_kfree
LBB0_25:
	mov	x0, x19
	bl	_pci_release_regions
LBB0_26:
	mov	x0, x19
	bl	_pci_disable_device
LBB0_27:
	mov	x0, x21
	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
	add	sp, sp, #64
	ret
LBB0_28:
	mov	x0, x20
	bl	_ibmasmfs_add_sp
	mov	x0, x20
	bl	_ibmasm_register_uart
	b	LBB0_27
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpAdd	Lloh44, Lloh45
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to enable PCI device\n"

	.comm	_DRIVER_NAME,8,3                ; @DRIVER_NAME
l_.str.1:                               ; @.str.1
	.asciz	"Failed to allocate PCI resources\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.2:                               ; @.str.2
	.asciz	"Failed to allocate memory\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_IBMASM_NAME_SIZE,4,2           ; @IBMASM_NAME_SIZE
l_.str.3:                               ; @.str.3
	.asciz	"%d"

l_.str.4:                               ; @.str.4
	.asciz	"%s%d"

l_.str.5:                               ; @.str.5
	.asciz	"Failed to allocate event buffer\n"

l_.str.6:                               ; @.str.6
	.asciz	"Failed to allocate heartbeat command\n"

l_.str.7:                               ; @.str.7
	.asciz	"Failed to ioremap pci memory\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_ibmasm_interrupt_handler,4,2   ; @ibmasm_interrupt_handler
	.comm	_IRQF_SHARED,4,2                ; @IRQF_SHARED
l_.str.8:                               ; @.str.8
	.asciz	"Failed to register interrupt handler\n"

l_.str.9:                               ; @.str.9
	.asciz	"Failed to initialize remote queue\n"

l_.str.10:                              ; @.str.10
	.asciz	"Failed to send driver VPD to service processor\n"

	.comm	_SYSTEM_STATE_OS_UP,4,2         ; @SYSTEM_STATE_OS_UP
l_.str.11:                              ; @.str.11
	.asciz	"Failed to send OS state to service processor\n"

	.no_dead_strip	_ibmasm_init_one
.subsections_via_symbols
