	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function IFX_MEI_RunAdslModem
_IFX_MEI_RunAdslModem:                  ## @IFX_MEI_RunAdslModem
	.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, %r13
	movq	_mei_arc_swap_buff@GOTPCREL(%rip), %rbx
	cmpq	$0, (%rbx)
	jne	LBB0_5
## %bb.1:
	movq	_MAXSWAPSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	shll	$2, %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kmalloc
	movq	%rax, (%rbx)
	testq	%rax, %rax
	je	LBB0_2
## %bb.4:
	movq	%rax, %rdi
	callq	_ksize
                                        ## kill: def $eax killed $eax def $rax
	leal	1023(%rax), %esi
	testl	%eax, %eax
	cmovnsl	%eax, %esi
	sarl	$10, %esi
	movq	(%rbx), %rdx
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_IFX_MEI_DMSG
LBB0_5:
	movq	%r13, %rdi
	callq	_DSL_DEV_PRIVATE
	movq	16(%rax), %rax
	movq	8(%rax), %rbx
	movq	%r13, %rdi
	callq	_DSL_DEV_PRIVATE
	movq	%rbx, 24(%rax)
	movq	%r13, %rdi
	callq	_DSL_DEV_PRIVATE
	movq	24(%rax), %rax
	movslq	(%rax), %rax
	shlq	$2, %rax
	movq	_SDRAM_SEGMENT_SIZE@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	cmpq	%rcx, %rax
	jbe	LBB0_6
## %bb.8:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_3
LBB0_6:
	movq	_MAX_BAR_REGISTERS@GOTPCREL(%rip), %r14
	cmpl	$0, (%r14)
	jle	LBB0_7
## %bb.9:
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	callq	_DSL_DEV_PRIVATE
	movq	16(%rax), %rax
	addl	(%rax,%r12), %r15d
	incq	%rbx
	movslq	(%r14), %rax
	addq	$16, %r12
	cmpq	%rax, %rbx
	jl	LBB0_10
	jmp	LBB0_11
LBB0_7:
	xorl	%r15d, %r15d
LBB0_11:
	movq	%r13, %rdi
	callq	_DSL_DEV_PRIVATE
	cmpl	(%rax), %r15d
	jne	LBB0_12
## %bb.13:
	movq	%r13, %rdi
	callq	_IFX_MEI_ResetARC
	movq	%r13, %rdi
	callq	_IFX_MEI_HaltArc
	movq	%r13, %rdi
	callq	_DSL_DEV_PRIVATE
	movl	12(%rax), %esi
	movq	%r13, %rdi
	callq	_IFX_MEI_BarUpdate
	movq	%r13, %rdi
	callq	_IFX_MEI_DownloadBootCode
	movq	_LTQ_ICU_IM0_IER@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	$1048576, %r14d                 ## imm = 0x100000
	movl	(%rax), %r12d
	andl	%r14d, %r12d
	movq	_LTQ_ICU_IM2_IER@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	andl	(%rax), %r14d
	movq	_LTQ_USB_OC_INT@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_disable_irq
	movq	(%r13), %rax
	movq	_IFX_DYING_GASP@GOTPCREL(%rip), %r15
	movq	(%r15), %rcx
	movl	(%rax,%rcx,4), %edi
	callq	_disable_irq
	movq	%r13, %rdi
	callq	_IFX_MEI_RunArc
	movq	%r13, %rdi
	callq	_DSL_DEV_PRIVATE
	movl	8(%rax), %edi
	movl	$1000, %esi                     ## imm = 0x3E8
	callq	_MEI_WAIT_EVENT_TIMEOUT
	movl	(%rbx), %edi
	callq	_MEI_MASK_AND_ACK_IRQ
	movq	(%r13), %rax
	movq	(%r15), %rcx
	movl	(%rax,%rcx,4), %edi
	callq	_MEI_MASK_AND_ACK_IRQ
	movq	(%r13), %rax
	movq	(%r15), %rcx
	movl	(%rax,%rcx,4), %edi
	callq	_enable_irq
	movq	_LTQ_ICU_IM0_IER@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	orl	%r12d, (%rax)
	movq	_LTQ_ICU_IM2_IER@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	orl	%r14d, (%rax)
	movq	%r13, %rdi
	callq	_DSL_DEV_PRIVATE
	cmpl	$1, 4(%rax)
	jne	LBB0_14
## %bb.15:
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_IFX_MEI_DMSG
	movq	_DSL_DEV_MEI_ERR_SUCCESS@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_12:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_3
LBB0_2:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_3
LBB0_14:
	leaq	L_.str.4(%rip), %rdi
LBB0_3:
	callq	_IFX_MEI_EMSG
	movq	_DSL_DEV_MEI_ERR_FAILURE@GOTPCREL(%rip), %rax
LBB0_16:
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mei_arc_swap_buff,8,3          ## @mei_arc_swap_buff
	.comm	_MAXSWAPSIZE,4,2                ## @MAXSWAPSIZE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	">>> malloc fail for codeswap buff!!! <<<\n"

	.comm	_DSL_DEV_MEI_ERR_FAILURE,4,2    ## @DSL_DEV_MEI_ERR_FAILURE
L_.str.1:                               ## @.str.1
	.asciz	"allocate %dKB swap buff memory at: 0x%p\n"

	.comm	_SDRAM_SEGMENT_SIZE,4,2         ## @SDRAM_SEGMENT_SIZE
L_.str.2:                               ## @.str.2
	.asciz	"firmware header size is bigger than 64K segment size\n"

	.comm	_MAX_BAR_REGISTERS,4,2          ## @MAX_BAR_REGISTERS
L_.str.3:                               ## @.str.3
	.asciz	"Firmware download is not completed. Please download firmware again!\n"

	.comm	_LTQ_ICU_IM0_IER,8,3            ## @LTQ_ICU_IM0_IER
	.comm	_LTQ_ICU_IM2_IER,8,3            ## @LTQ_ICU_IM2_IER
	.comm	_LTQ_USB_OC_INT,4,2             ## @LTQ_USB_OC_INT
	.comm	_IFX_DYING_GASP,8,3             ## @IFX_DYING_GASP
L_.str.4:                               ## @.str.4
	.asciz	"Modem failed to be ready!\n"

L_.str.5:                               ## @.str.5
	.asciz	"Modem is ready.\n"

	.comm	_DSL_DEV_MEI_ERR_SUCCESS,4,2    ## @DSL_DEV_MEI_ERR_SUCCESS
	.no_dead_strip	_IFX_MEI_RunAdslModem
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function IFX_MEI_RunAdslModem
_IFX_MEI_RunAdslModem:                  ; @IFX_MEI_RunAdslModem
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x19, x0
Lloh0:
	adrp	x20, _mei_arc_swap_buff@GOTPAGE
Lloh1:
	ldr	x20, [x20, _mei_arc_swap_buff@GOTPAGEOFF]
	ldr	x8, [x20]
	cbnz	x8, LBB0_3
; %bb.1:
Lloh2:
	adrp	x8, _MAXSWAPSIZE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MAXSWAPSIZE@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	lsl	w0, w8, #2
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	bl	_kmalloc
	str	x0, [x20]
	cbz	x0, LBB0_13
; %bb.2:
	bl	_ksize
	add	w8, w0, #1023
	cmp	w0, #0
	csel	w8, w8, w0, lt
	asr	w8, w8, #10
	ldr	x9, [x20]
	stp	x8, x9, [sp]
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_IFX_MEI_DMSG
LBB0_3:
	mov	x0, x19
	bl	_DSL_DEV_PRIVATE
	ldr	x8, [x0, #16]
	ldr	x20, [x8, #8]
	mov	x0, x19
	bl	_DSL_DEV_PRIVATE
	str	x20, [x0, #24]
	mov	x0, x19
	bl	_DSL_DEV_PRIVATE
	ldr	x8, [x0, #24]
	ldrsw	x8, [x8]
Lloh10:
	adrp	x9, _SDRAM_SEGMENT_SIZE@GOTPAGE
Lloh11:
	ldr	x9, [x9, _SDRAM_SEGMENT_SIZE@GOTPAGEOFF]
Lloh12:
	ldrsw	x9, [x9]
	cmp	x9, x8, lsl #2
	b.hs	LBB0_5
; %bb.4:
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_15
LBB0_5:
Lloh15:
	adrp	x20, _MAX_BAR_REGISTERS@GOTPAGE
Lloh16:
	ldr	x20, [x20, _MAX_BAR_REGISTERS@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.6:
	mov	x22, #0
	mov	x23, #0
	mov	w21, #0
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_DSL_DEV_PRIVATE
	ldr	x8, [x0, #16]
	ldr	w8, [x8, x22]
	add	w21, w21, w8
	add	x23, x23, #1
	ldrsw	x8, [x20]
	add	x22, x22, #16
	cmp	x23, x8
	b.lt	LBB0_7
	b	LBB0_9
LBB0_8:
	mov	w21, #0
LBB0_9:
	mov	x0, x19
	bl	_DSL_DEV_PRIVATE
	ldr	w8, [x0]
	cmp	w21, w8
	b.ne	LBB0_12
; %bb.10:
	mov	x0, x19
	bl	_IFX_MEI_ResetARC
	mov	x0, x19
	bl	_IFX_MEI_HaltArc
	mov	x0, x19
	bl	_DSL_DEV_PRIVATE
	ldr	w1, [x0, #12]
	mov	x0, x19
	bl	_IFX_MEI_BarUpdate
	mov	x0, x19
	bl	_IFX_MEI_DownloadBootCode
Lloh17:
	adrp	x20, _LTQ_ICU_IM0_IER@GOTPAGE
Lloh18:
	ldr	x20, [x20, _LTQ_ICU_IM0_IER@GOTPAGEOFF]
	ldr	x8, [x20]
	ldr	w8, [x8]
	and	w21, w8, #0x100000
Lloh19:
	adrp	x22, _LTQ_ICU_IM2_IER@GOTPAGE
Lloh20:
	ldr	x22, [x22, _LTQ_ICU_IM2_IER@GOTPAGEOFF]
	ldr	x8, [x22]
	ldr	w8, [x8]
	and	w23, w8, #0x100000
Lloh21:
	adrp	x24, _LTQ_USB_OC_INT@GOTPAGE
Lloh22:
	ldr	x24, [x24, _LTQ_USB_OC_INT@GOTPAGEOFF]
	ldr	w0, [x24]
	bl	_disable_irq
	ldr	x8, [x19]
Lloh23:
	adrp	x25, _IFX_DYING_GASP@GOTPAGE
Lloh24:
	ldr	x25, [x25, _IFX_DYING_GASP@GOTPAGEOFF]
	ldr	x9, [x25]
	ldr	w0, [x8, x9, lsl #2]
	bl	_disable_irq
	mov	x0, x19
	bl	_IFX_MEI_RunArc
	mov	x0, x19
	bl	_DSL_DEV_PRIVATE
	ldr	w0, [x0, #8]
	mov	w1, #1000
	bl	_MEI_WAIT_EVENT_TIMEOUT
	ldr	w0, [x24]
	bl	_MEI_MASK_AND_ACK_IRQ
	ldr	x8, [x19]
	ldr	x9, [x25]
	ldr	w0, [x8, x9, lsl #2]
	bl	_MEI_MASK_AND_ACK_IRQ
	ldr	x8, [x19]
	ldr	x9, [x25]
	ldr	w0, [x8, x9, lsl #2]
	bl	_enable_irq
	ldr	x8, [x20]
	ldr	w9, [x8]
	orr	w9, w9, w21
	str	w9, [x8]
	ldr	x8, [x22]
	ldr	w9, [x8]
	orr	w9, w9, w23
	str	w9, [x8]
	mov	x0, x19
	bl	_DSL_DEV_PRIVATE
	ldr	w8, [x0, #4]
	cmp	w8, #1
	b.ne	LBB0_14
; %bb.11:
Lloh25:
	adrp	x0, l_.str.5@PAGE
Lloh26:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_IFX_MEI_DMSG
Lloh27:
	adrp	x8, _DSL_DEV_MEI_ERR_SUCCESS@GOTPAGE
Lloh28:
	ldr	x8, [x8, _DSL_DEV_MEI_ERR_SUCCESS@GOTPAGEOFF]
	b	LBB0_16
LBB0_12:
Lloh29:
	adrp	x0, l_.str.3@PAGE
Lloh30:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_15
LBB0_13:
Lloh31:
	adrp	x0, l_.str@PAGE
Lloh32:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_15
LBB0_14:
Lloh33:
	adrp	x0, l_.str.4@PAGE
Lloh34:
	add	x0, x0, l_.str.4@PAGEOFF
LBB0_15:
	bl	_IFX_MEI_EMSG
Lloh35:
	adrp	x8, _DSL_DEV_MEI_ERR_FAILURE@GOTPAGE
Lloh36:
	ldr	x8, [x8, _DSL_DEV_MEI_ERR_FAILURE@GOTPAGEOFF]
LBB0_16:
	ldr	w0, [x8]
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_mei_arc_swap_buff,8,3          ; @mei_arc_swap_buff
	.comm	_MAXSWAPSIZE,4,2                ; @MAXSWAPSIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	">>> malloc fail for codeswap buff!!! <<<\n"

	.comm	_DSL_DEV_MEI_ERR_FAILURE,4,2    ; @DSL_DEV_MEI_ERR_FAILURE
l_.str.1:                               ; @.str.1
	.asciz	"allocate %dKB swap buff memory at: 0x%p\n"

	.comm	_SDRAM_SEGMENT_SIZE,4,2         ; @SDRAM_SEGMENT_SIZE
l_.str.2:                               ; @.str.2
	.asciz	"firmware header size is bigger than 64K segment size\n"

	.comm	_MAX_BAR_REGISTERS,4,2          ; @MAX_BAR_REGISTERS
l_.str.3:                               ; @.str.3
	.asciz	"Firmware download is not completed. Please download firmware again!\n"

	.comm	_LTQ_ICU_IM0_IER,8,3            ; @LTQ_ICU_IM0_IER
	.comm	_LTQ_ICU_IM2_IER,8,3            ; @LTQ_ICU_IM2_IER
	.comm	_LTQ_USB_OC_INT,4,2             ; @LTQ_USB_OC_INT
	.comm	_IFX_DYING_GASP,8,3             ; @IFX_DYING_GASP
l_.str.4:                               ; @.str.4
	.asciz	"Modem failed to be ready!\n"

l_.str.5:                               ; @.str.5
	.asciz	"Modem is ready.\n"

	.comm	_DSL_DEV_MEI_ERR_SUCCESS,4,2    ; @DSL_DEV_MEI_ERR_SUCCESS
	.no_dead_strip	_IFX_MEI_RunAdslModem
.subsections_via_symbols
