	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ionic_port_init                ## -- Begin function ionic_port_init
	.p2align	4, 0x90
_ionic_port_init:                       ## @ionic_port_init
	.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
	xorl	%r15d, %r15d
	cmpq	$0, 16(%rdi)
	je	LBB0_1
LBB0_5:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%rdi, %rbx
	leaq	8(%rdi), %r14
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edi
	callq	_ALIGN
	movl	%eax, 24(%rbx)
	movl	(%rbx), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%eax, %esi
	movq	%r14, %rdx
	callq	_dma_alloc_coherent
	movq	%rax, 16(%rbx)
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movl	$4, %edi
	movl	$4, %esi
	callq	_min
	movq	%rax, %r12
	leaq	4(%rbx), %r13
	movq	%r13, %rdi
	callq	_mutex_lock
	movq	32(%rbx), %rdi
	leaq	40(%rbx), %rsi
	movq	%r12, %rdx
	callq	_memcpy_toio
	movq	%r14, %rdi
	callq	_ionic_dev_cmd_port_init
	movq	_DEVCMD_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_ionic_dev_cmd_wait
	movl	%eax, %r12d
	movq	_IONIC_PORT_ADMIN_STATE_UP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_ionic_dev_cmd_port_state
	movq	_DEVCMD_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_ionic_dev_cmd_wait
	movq	%r13, %rdi
	callq	_mutex_unlock
	testl	%r12d, %r12d
	je	LBB0_5
## %bb.4:
	movl	(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	movl	(%rbx), %edi
	movl	24(%rbx), %esi
	movq	16(%rbx), %rdx
	movq	8(%rbx), %rcx
	callq	_dma_free_coherent
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%r14)
	movl	%r12d, %r15d
	jmp	LBB0_5
LBB0_2:
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to allocate port info, aborting\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_DEVCMD_TIMEOUT,4,2             ## @DEVCMD_TIMEOUT
	.comm	_IONIC_PORT_ADMIN_STATE_UP,4,2  ## @IONIC_PORT_ADMIN_STATE_UP
L_.str.1:                               ## @.str.1
	.asciz	"Failed to init port\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ionic_port_init                ; -- Begin function ionic_port_init
	.p2align	2
_ionic_port_init:                       ; @ionic_port_init
	.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
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_3
; %bb.1:
	mov	w21, #0
LBB0_2:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_3:
	mov	x20, x0
	add	x19, x0, #8
Lloh0:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #4
	bl	_ALIGN
	mov	x1, x0
	str	w0, [x20, #24]
	ldr	w0, [x20]
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	mov	x2, x19
	bl	_dma_alloc_coherent
	str	x0, [x20, #16]
	cbz	x0, LBB0_6
; %bb.4:
	mov	w0, #4
	mov	w1, #4
	bl	_min
	mov	x21, x0
	add	x22, x20, #4
	mov	x0, x22
	bl	_mutex_lock
	ldr	x0, [x20, #32]
	add	x1, x20, #40
	mov	x2, x21
	bl	_memcpy_toio
	mov	x0, x19
	bl	_ionic_dev_cmd_port_init
Lloh6:
	adrp	x23, _DEVCMD_TIMEOUT@GOTPAGE
Lloh7:
	ldr	x23, [x23, _DEVCMD_TIMEOUT@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x20
	bl	_ionic_dev_cmd_wait
	mov	x21, x0
Lloh8:
	adrp	x8, _IONIC_PORT_ADMIN_STATE_UP@GOTPAGE
Lloh9:
	ldr	x8, [x8, _IONIC_PORT_ADMIN_STATE_UP@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ionic_dev_cmd_port_state
	ldr	w1, [x23]
	mov	x0, x20
	bl	_ionic_dev_cmd_wait
	mov	x0, x22
	bl	_mutex_unlock
	cbz	w21, LBB0_2
; %bb.5:
	ldr	w0, [x20]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	ldr	w0, [x20]
	ldr	w1, [x20, #24]
	ldp	x3, x2, [x20, #8]
	bl	_dma_free_coherent
	stp	xzr, xzr, [x19]
	b	LBB0_2
LBB0_6:
	ldr	w0, [x20]
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh15:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to allocate port info, aborting\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_DEVCMD_TIMEOUT,4,2             ; @DEVCMD_TIMEOUT
	.comm	_IONIC_PORT_ADMIN_STATE_UP,4,2  ; @IONIC_PORT_ADMIN_STATE_UP
l_.str.1:                               ; @.str.1
	.asciz	"Failed to init port\n"

.subsections_via_symbols
