	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ftgmac100_open
_ftgmac100_open:                        ## @ftgmac100_open
	.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
	movq	%rdi, %r14
	callq	_netdev_priv
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_ftgmac100_alloc_rings
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_netdev_err
	jmp	LBB0_17
LBB0_2:
	movq	16(%r15), %rax
	movq	%rax, %rcx
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_DUPLEX_FULL@GOTPCREL(%rip), %rax
	movq	_SPEED_100@GOTPCREL(%rip), %rcx
	movq	(%rax), %rax
	movq	(%rcx), %rcx
LBB0_4:
	movq	%rax, 32(%r15)
	movq	%rcx, 24(%r15)
	movq	%r15, %rdi
	callq	_ftgmac100_reset_and_config_mac
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.5:
	movq	%r15, %r12
	addq	$8, %r12
	movq	_ftgmac100_poll@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movq	%r12, %rsi
	movl	$64, %ecx
	callq	_netif_napi_add
	movq	_ftgmac100_interrupt@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r14), %edi
	movl	16(%r14), %ecx
	xorl	%edx, %edx
	movq	%r14, %r8
	callq	_request_irq
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %ebx
	movl	(%r14), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_netdev_err
	jmp	LBB0_15
LBB0_7:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_ftgmac100_init_all
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_netdev_err
LBB0_14:
	movq	%r15, %rdi
	callq	_ftgmac100_free_buffers
	movl	(%r14), %edi
	movq	%r14, %rsi
	callq	_free_irq
LBB0_15:
	movq	%r12, %rdi
	callq	_netif_napi_del
LBB0_16:
	movq	_FTGMAC100_OFFSET_IER@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r15), %rsi
	xorl	%edi, %edi
	callq	_iowrite32
	movq	%r15, %rdi
	callq	_ftgmac100_free_rings
LBB0_17:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	8(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.10:
	callq	_phy_start
	xorl	%ebx, %ebx
	jmp	LBB0_17
LBB0_11:
	xorl	%ebx, %ebx
	cmpq	$0, 16(%r15)
	je	LBB0_17
## %bb.12:
	movq	%r14, %rdi
	callq	_netif_carrier_on
	movl	12(%r15), %edi
	callq	_ncsi_start_dev
	testl	%eax, %eax
	je	LBB0_17
## %bb.13:
	movl	%eax, %r13d
	movq	%r12, %rdi
	callq	_napi_disable
	movq	%r14, %rdi
	callq	_netif_stop_queue
	movl	%r13d, %ebx
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to allocate descriptors\n"

	.comm	_DUPLEX_FULL,8,3                ## @DUPLEX_FULL
	.comm	_SPEED_100,8,3                  ## @SPEED_100
	.comm	_ftgmac100_poll,4,2             ## @ftgmac100_poll
	.comm	_ftgmac100_interrupt,4,2        ## @ftgmac100_interrupt
L_.str.1:                               ## @.str.1
	.asciz	"failed to request irq %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to allocate packet buffers\n"

	.comm	_FTGMAC100_OFFSET_IER,8,3       ## @FTGMAC100_OFFSET_IER
	.no_dead_strip	_ftgmac100_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ftgmac100_open
_ftgmac100_open:                        ; @ftgmac100_open
	.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	x20, x0
	bl	_netdev_priv
	mov	x19, x0
	bl	_ftgmac100_alloc_rings
	cbz	w0, LBB0_2
; %bb.1:
	mov	x22, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_netdev_err
	b	LBB0_10
LBB0_2:
	ldr	x8, [x19, #16]
Lloh2:
	adrp	x9, _DUPLEX_FULL@GOTPAGE
Lloh3:
	ldr	x9, [x9, _DUPLEX_FULL@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
Lloh5:
	adrp	x10, _SPEED_100@GOTPAGE
Lloh6:
	ldr	x10, [x10, _SPEED_100@GOTPAGEOFF]
Lloh7:
	ldr	x10, [x10]
	cmp	x8, #0
	csel	x8, xzr, x9, eq
	csel	x9, xzr, x10, eq
	stp	x9, x8, [x19, #24]
	mov	x0, x19
	bl	_ftgmac100_reset_and_config_mac
	mov	x22, x0
	cbnz	w0, LBB0_9
; %bb.3:
	add	x21, x19, #8
Lloh8:
	adrp	x8, _ftgmac100_poll@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ftgmac100_poll@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x21
	mov	w3, #64
	bl	_netif_napi_add
	ldr	w0, [x20]
Lloh11:
	adrp	x8, _ftgmac100_interrupt@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ftgmac100_interrupt@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	ldr	w3, [x20, #16]
	mov	w2, #0
	mov	x4, x20
	bl	_request_irq
	cbz	w0, LBB0_5
; %bb.4:
	mov	x22, x0
	ldr	w8, [x20]
	str	x8, [sp]
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_netdev_err
	b	LBB0_8
LBB0_5:
	mov	x0, x19
	mov	w1, #0
	bl	_ftgmac100_init_all
	cbz	w0, LBB0_11
; %bb.6:
	mov	x22, x0
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_netdev_err
LBB0_7:
	mov	x0, x19
	bl	_ftgmac100_free_buffers
	ldr	w0, [x20]
	mov	x1, x20
	bl	_free_irq
LBB0_8:
	mov	x0, x21
	bl	_netif_napi_del
LBB0_9:
	ldr	x8, [x19]
Lloh18:
	adrp	x9, _FTGMAC100_OFFSET_IER@GOTPAGE
Lloh19:
	ldr	x9, [x9, _FTGMAC100_OFFSET_IER@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #0
	bl	_iowrite32
	mov	x0, x19
	bl	_ftgmac100_free_rings
LBB0_10:
	mov	x0, x22
	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_11:
	ldr	x0, [x20, #8]
	cbz	x0, LBB0_13
; %bb.12:
	bl	_phy_start
	mov	w22, #0
	b	LBB0_10
LBB0_13:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_16
; %bb.14:
	mov	x0, x20
	bl	_netif_carrier_on
	ldr	w0, [x19, #12]
	bl	_ncsi_start_dev
	mov	x22, x0
	cbz	w0, LBB0_10
; %bb.15:
	mov	x0, x21
	bl	_napi_disable
	mov	x0, x20
	bl	_netif_stop_queue
	b	LBB0_7
LBB0_16:
	mov	w22, #0
	b	LBB0_10
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to allocate descriptors\n"

	.comm	_DUPLEX_FULL,8,3                ; @DUPLEX_FULL
	.comm	_SPEED_100,8,3                  ; @SPEED_100
	.comm	_ftgmac100_poll,4,2             ; @ftgmac100_poll
	.comm	_ftgmac100_interrupt,4,2        ; @ftgmac100_interrupt
l_.str.1:                               ; @.str.1
	.asciz	"failed to request irq %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to allocate packet buffers\n"

	.comm	_FTGMAC100_OFFSET_IER,8,3       ; @FTGMAC100_OFFSET_IER
	.no_dead_strip	_ftgmac100_open
.subsections_via_symbols
