	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cgx_lmac_init
_cgx_lmac_init:                         ## @cgx_lmac_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
	movq	%rdi, %r15
	movq	_CGXX_CMRX_RX_LMACS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_cgx_read
	andl	$7, %eax
	movl	%eax, (%r15)
	movq	_MAX_LMAC_PER_CGX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%ecx, %eax
	cmovgel	%ecx, %eax
	movl	%eax, (%r15)
	testl	%eax, %eax
	jle	LBB0_8
## %bb.1:
	xorl	%r13d, %r13d
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r14
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edx
	movl	$1, %edi
	movl	$40, %esi
	callq	_kcalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %rbx
	movl	(%r14), %edx
	movl	$1, %edi
	movl	$16, %esi
	callq	_kcalloc
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_3
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	4(%r15), %edx
	movq	%rax, %rdi
	leaq	L_.str(%rip), %rsi
	movl	%r12d, %ecx
	callq	_sprintf
	movl	%r12d, (%rbx)
	movq	%r15, 32(%rbx)
	leaq	24(%rbx), %rdi
	callq	_init_waitqueue_head
	leaq	20(%rbx), %rdi
	callq	_mutex_init
	movq	%rbx, %rdi
	addq	$16, %rdi
	callq	_spin_lock_init
	movl	16(%r15), %edi
	movl	%r13d, %esi
	movq	_CGX_LMAC_FWI@GOTPCREL(%rip), %rax
	addq	(%rax), %rsi
	callq	_pci_irq_vector
	movq	_cgx_fwi_event_handler@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	8(%rbx), %rcx
	movl	%eax, %edi
	xorl	%edx, %edx
	movq	%rbx, %r8
	callq	_request_irq
	testl	%eax, %eax
	jne	LBB0_4
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%rbx), %esi
	movq	_CGXX_CMRX_INT_ENA_W1S@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_FW_CGX_INT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	callq	_cgx_write
	movq	8(%r15), %rax
	movq	%rbx, (%rax,%r12,8)
	incq	%r12
	movslq	(%r15), %rax
	addq	$9, %r13
	cmpq	%rax, %r12
	jl	LBB0_2
LBB0_8:
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_cgx_lmac_verify_fwi_version    ## TAILCALL
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CGXX_CMRX_RX_LMACS,4,2         ## @CGXX_CMRX_RX_LMACS
	.comm	_MAX_LMAC_PER_CGX,4,2           ## @MAX_LMAC_PER_CGX
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cgx_fwi_%d_%d"

	.comm	_CGX_LMAC_FWI,8,3               ## @CGX_LMAC_FWI
	.comm	_cgx_fwi_event_handler,4,2      ## @cgx_fwi_event_handler
	.comm	_CGXX_CMRX_INT_ENA_W1S,4,2      ## @CGXX_CMRX_INT_ENA_W1S
	.comm	_FW_CGX_INT,4,2                 ## @FW_CGX_INT
	.no_dead_strip	_cgx_lmac_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cgx_lmac_init
_cgx_lmac_init:                         ; @cgx_lmac_init
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
Lloh0:
	adrp	x8, _CGXX_CMRX_RX_LMACS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CGXX_CMRX_RX_LMACS@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_cgx_read
	and	w8, w0, #0x7
Lloh3:
	adrp	x9, _MAX_LMAC_PER_CGX@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MAX_LMAC_PER_CGX@GOTPAGEOFF]
	str	w8, [x19]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	csel	w8, w8, w9, lt
	str	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.1:
	mov	x23, #0
	mov	x20, #0
Lloh6:
	adrp	x24, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x24, [x24, _GFP_KERNEL@GOTPAGEOFF]
Lloh8:
	adrp	x25, _CGX_LMAC_FWI@GOTPAGE
Lloh9:
	ldr	x25, [x25, _CGX_LMAC_FWI@GOTPAGEOFF]
Lloh10:
	adrp	x26, _cgx_fwi_event_handler@GOTPAGE
Lloh11:
	ldr	x26, [x26, _cgx_fwi_event_handler@GOTPAGEOFF]
Lloh12:
	adrp	x21, l_.str@PAGE
Lloh13:
	add	x21, x21, l_.str@PAGEOFF
Lloh14:
	adrp	x27, _CGXX_CMRX_INT_ENA_W1S@GOTPAGE
Lloh15:
	ldr	x27, [x27, _CGXX_CMRX_INT_ENA_W1S@GOTPAGEOFF]
Lloh16:
	adrp	x28, _FW_CGX_INT@GOTPAGE
Lloh17:
	ldr	x28, [x28, _FW_CGX_INT@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w2, [x24]
	mov	w0, #1
	mov	w1, #40
	bl	_kcalloc
	cbz	x0, LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x22, x0
	ldr	w2, [x24]
	mov	w0, #1
	mov	w1, #16
	bl	_kcalloc
	str	x0, [x22, #8]
	cbz	x0, LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w2, [x19, #4]
	mov	x1, x21
	mov	x3, x20
	bl	_sprintf
	str	w20, [x22]
	str	x19, [x22, #32]
	add	x0, x22, #24
	bl	_init_waitqueue_head
	add	x0, x22, #20
	bl	_mutex_init
	add	x0, x22, #16
	bl	_spin_lock_init
	ldr	w0, [x19, #16]
	ldr	x8, [x25]
	add	x1, x8, w23, uxtw
	bl	_pci_irq_vector
	ldr	w1, [x26]
	ldr	x3, [x22, #8]
	mov	w2, #0
	mov	x4, x22
	bl	_request_irq
	cbnz	w0, LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w1, [x22]
	ldr	w2, [x27]
	ldr	w3, [x28]
	mov	x0, x19
	bl	_cgx_write
	ldr	x8, [x19, #8]
	str	x22, [x8, x20, lsl #3]
	add	x20, x20, #1
	ldrsw	x8, [x19]
	add	x23, x23, #9
	cmp	x20, x8
	b.lt	LBB0_2
LBB0_6:
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_cgx_lmac_verify_fwi_version
LBB0_7:
Lloh18:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_CGXX_CMRX_RX_LMACS,4,2         ; @CGXX_CMRX_RX_LMACS
	.comm	_MAX_LMAC_PER_CGX,4,2           ; @MAX_LMAC_PER_CGX
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cgx_fwi_%d_%d"

	.comm	_CGX_LMAC_FWI,8,3               ; @CGX_LMAC_FWI
	.comm	_cgx_fwi_event_handler,4,2      ; @cgx_fwi_event_handler
	.comm	_CGXX_CMRX_INT_ENA_W1S,4,2      ; @CGXX_CMRX_INT_ENA_W1S
	.comm	_FW_CGX_INT,4,2                 ; @FW_CGX_INT
	.no_dead_strip	_cgx_lmac_init
.subsections_via_symbols
