	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ehea_register_port
_ehea_register_port:                    ## @ehea_register_port
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	%rsi, %rdi
	callq	_of_node_get
	movl	%eax, 24(%rbx)
	movq	32(%rbx), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%rbx)
	movq	_ibmebus_bus_type@GOTPCREL(%rip), %rax
	movq	%rax, 8(%rbx)
	movq	_port_name_cnt@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leal	1(%rdx), %ecx
	movl	%ecx, (%rax)
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_dev_set_name
	movq	_logical_port_release@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	movq	%rbx, %rdi
	callq	_of_device_register
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	callq	_pr_err
	jmp	LBB0_4
LBB0_2:
	movq	_dev_attr_log_port_id@GOTPCREL(%rip), %rsi
	movq	%rbx, %rdi
	callq	_device_create_file
	testl	%eax, %eax
	je	LBB0_5
## %bb.3:
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	callq	_pr_err
	movq	%rbx, %rdi
	callq	_of_device_unregister
LBB0_4:
	xorl	%ebx, %ebx
LBB0_5:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ibmebus_bus_type,4,2           ## @ibmebus_bus_type
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"port%d"

	.comm	_port_name_cnt,4,2              ## @port_name_cnt
	.comm	_logical_port_release,4,2       ## @logical_port_release
L_.str.1:                               ## @.str.1
	.asciz	"failed to register device. ret=%d\n"

	.comm	_dev_attr_log_port_id,4,2       ## @dev_attr_log_port_id
L_.str.2:                               ## @.str.2
	.asciz	"failed to register attributes, ret=%d\n"

	.no_dead_strip	_ehea_register_port
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ehea_register_port
_ehea_register_port:                    ; @ehea_register_port
	.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
	mov	x0, x1
	bl	_of_node_get
	str	w0, [x19, #24]
	ldr	x8, [x19, #32]
	ldr	x8, [x8]
Lloh0:
	adrp	x9, _ibmebus_bus_type@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ibmebus_bus_type@GOTPAGEOFF]
	stp	x9, x8, [x19, #8]
Lloh2:
	adrp	x8, _port_name_cnt@GOTPAGE
Lloh3:
	ldr	x8, [x8, _port_name_cnt@GOTPAGEOFF]
	ldr	w2, [x8]
	add	w9, w2, #1
	str	w9, [x8]
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_set_name
Lloh6:
	adrp	x8, _logical_port_release@GOTPAGE
Lloh7:
	ldr	x8, [x8, _logical_port_release@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [x19]
	mov	x0, x19
	bl	_of_device_register
	cbz	w0, LBB0_2
; %bb.1:
	mov	x1, x0
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_err
	b	LBB0_4
LBB0_2:
Lloh11:
	adrp	x1, _dev_attr_log_port_id@GOTPAGE
Lloh12:
	ldr	x1, [x1, _dev_attr_log_port_id@GOTPAGEOFF]
	mov	x0, x19
	bl	_device_create_file
	cbz	w0, LBB0_5
; %bb.3:
	mov	x1, x0
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_err
	mov	x0, x19
	bl	_of_device_unregister
LBB0_4:
	mov	x19, #0
LBB0_5:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_ibmebus_bus_type,4,2           ; @ibmebus_bus_type
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"port%d"

	.comm	_port_name_cnt,4,2              ; @port_name_cnt
	.comm	_logical_port_release,4,2       ; @logical_port_release
l_.str.1:                               ; @.str.1
	.asciz	"failed to register device. ret=%d\n"

	.comm	_dev_attr_log_port_id,4,2       ; @dev_attr_log_port_id
l_.str.2:                               ; @.str.2
	.asciz	"failed to register attributes, ret=%d\n"

	.no_dead_strip	_ehea_register_port
.subsections_via_symbols
