	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function if_usb_prog_firmware
LCPI0_0:
	.space	16
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_if_usb_prog_firmware:                  ## @if_usb_prog_firmware
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	8(%rdi), %r14
	testl	%esi, %esi
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	jmp	LBB0_25
LBB0_2:
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	%rdx, 16(%r14)
	movl	(%rdx), %esi
	movl	4(%rdx), %edi
	callq	_check_fwfile_format
	testq	%rax, %rax
	jne	LBB0_25
## %bb.3:
	movl	40(%r14), %edi
	callq	_usb_kill_urb
	movl	88(%r14), %edi
	callq	_usb_kill_urb
	movq	$0, 32(%r14)
	movq	$0, (%r14)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 64(%r14)
	movq	$0, 80(%r14)
	movq	%r14, %rdi
	callq	_if_usb_submit_rx_urb_fwload
	testq	%rax, %rax
	js	LBB0_16
## %bb.4:
	leaq	64(%r14), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	leaq	44(%r14), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	xorl	%r13d, %r13d
	movq	_BOOT_CMD_FW_BY_USB@GOTPCREL(%rip), %r12
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	_if_usb_prog_firmware.reset_count(%rip), %eax
	leal	-1(%rax), %ecx
	movl	%ecx, _if_usb_prog_firmware.reset_count(%rip)
	testl	%eax, %eax
	jle	LBB0_25
LBB0_15:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	%r14, %rdi
	callq	_if_usb_reset_device
	movq	%r14, %rdi
	callq	_if_usb_submit_rx_urb_fwload
	testq	%rax, %rax
	js	LBB0_16
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
                                        ##       Child Loop BB0_7 Depth 3
	movq	$0, (%r14)
	movl	%r13d, %r15d
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_7 Depth 3
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_if_usb_issue_boot_command
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_5 Depth=1
                                        ##     Parent Loop BB0_6 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movl	$100, %edi
	callq	_msleep_interruptible
	movq	(%r14), %rax
	testq	%rax, %rax
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=3
	leal	1(%rbx), %ecx
	cmpl	$9, %ebx
	movl	%ecx, %ebx
	jb	LBB0_7
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=2
	leal	1(%r15), %r13d
	testq	%rax, %rax
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=2
	cmpl	$4, %r15d
	movl	%r13d, %r15d
	jl	LBB0_6
LBB0_11:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	_BOOT_CMD_RESP_NOT_SUPPORTED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_5 Depth=1
	testq	%rax, %rax
	jle	LBB0_14
## %bb.17:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	$0, 80(%r14)
	movabsq	$-4294967295, %rax              ## imm = 0xFFFFFFFF00000001
	movq	%rax, 8(%r14)
	movq	$0, 32(%r14)
	xorps	%xmm0, %xmm0
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movups	%xmm0, (%rax)
	movq	%r14, %rdi
	callq	_if_usb_send_fw_pkt
	movb	$1, %al
	cmpq	$0, 48(%r14)
	jne	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_5 Depth=1
	cmpq	$0, 32(%r14)
	setne	%al
LBB0_19:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	56(%r14), %edi
	movzbl	%al, %esi
	callq	_wait_event_interruptible
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_del_timer_sync
	movl	40(%r14), %edi
	callq	_usb_kill_urb
	cmpq	$0, 32(%r14)
	jne	LBB0_22
## %bb.20:                              ##   in Loop: Header=BB0_5 Depth=1
	xorl	%r13d, %r13d
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_info
	movl	_if_usb_prog_firmware.reset_count(%rip), %eax
	leal	-1(%rax), %ecx
	movl	%ecx, _if_usb_prog_firmware.reset_count(%rip)
	testl	%eax, %eax
	jg	LBB0_15
## %bb.21:
	leaq	L_.str.3(%rip), %rdi
	xorl	%esi, %esi
	xorl	%eax, %eax
	callq	_pr_info
	jmp	LBB0_25
LBB0_16:
	movq	96(%r14), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_lbs_deb_usbd
	jmp	LBB0_25
LBB0_12:
	movl	40(%r14), %edi
	callq	_usb_kill_urb
	movl	88(%r14), %edi
	callq	_usb_kill_urb
	movq	%r14, %rdi
	callq	_if_usb_submit_rx_urb
	jmp	LBB0_25
LBB0_22:
	movq	24(%r14), %rax
	movl	$1, (%rax)
	movq	%r14, %rdi
	callq	_if_usb_submit_rx_urb
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_lbs_start_card
	testq	%rax, %rax
	jne	LBB0_25
## %bb.23:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_if_usb_setup_firmware
	movq	_EHS_REMOVE_WAKEUP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%esi, 4(%rbx)
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_lbs_host_sleep_cfg
	testq	%rax, %rax
	je	LBB0_25
## %bb.24:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	$0, (%rax)
LBB0_25:
	movq	$0, 16(%r14)
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__DATA,__data
	.p2align	2                               ## @if_usb_prog_firmware.reset_count
_if_usb_prog_firmware.reset_count:
	.long	10                              ## 0xa

	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to find firmware (%d)\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"URB submission is failed\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_BOOT_CMD_FW_BY_USB,4,2         ## @BOOT_CMD_FW_BY_USB
	.comm	_BOOT_CMD_RESP_NOT_SUPPORTED,8,3 ## @BOOT_CMD_RESP_NOT_SUPPORTED
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
L_.str.2:                               ## @.str.2
	.asciz	"failed to load fw, resetting device!\n"

L_.str.3:                               ## @.str.3
	.asciz	"FW download failure, time = %d ms\n"

	.comm	_EHS_REMOVE_WAKEUP,4,2          ## @EHS_REMOVE_WAKEUP
	.no_dead_strip	_if_usb_prog_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function if_usb_prog_firmware
lCPI0_0:
	.long	1                               ; 0x1
	.long	4294967295                      ; 0xffffffff
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_if_usb_prog_firmware:                  ; @if_usb_prog_firmware
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	d9, d8, [sp, #16]               ; 16-byte Folded Spill
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset b8, -104
	.cfi_offset b9, -112
	ldr	x19, [x0, #8]
	cbz	w1, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
	b	LBB0_25
LBB0_2:
	mov	x20, x0
	str	x2, [x19, #16]
	ldp	w1, w0, [x2]
	bl	_check_fwfile_format
	cbnz	x0, LBB0_25
; %bb.3:
	ldr	w0, [x19, #40]
	bl	_usb_kill_urb
	ldr	w0, [x19, #88]
	bl	_usb_kill_urb
	str	xzr, [x19, #32]
	mov	x23, x19
	str	xzr, [x23, #64]!
	str	xzr, [x19]
	stp	xzr, xzr, [x19, #72]
	mov	x0, x19
	bl	_if_usb_submit_rx_urb_fwload
	tbnz	x0, #63, LBB0_19
; %bb.4:
	mov	w27, #0
Lloh2:
	adrp	x24, _BOOT_CMD_FW_BY_USB@GOTPAGE
Lloh3:
	ldr	x24, [x24, _BOOT_CMD_FW_BY_USB@GOTPAGEOFF]
Lloh4:
	adrp	x25, _BOOT_CMD_RESP_NOT_SUPPORTED@GOTPAGE
Lloh5:
	ldr	x25, [x25, _BOOT_CMD_RESP_NOT_SUPPORTED@GOTPAGEOFF]
	add	x21, x19, #44
	adrp	x26, _if_usb_prog_firmware.reset_count@PAGE
Lloh6:
	adrp	x8, lCPI0_0@PAGE
Lloh7:
	ldr	d8, [x8, lCPI0_0@PAGEOFF]
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	w8, [x26, _if_usb_prog_firmware.reset_count@PAGEOFF]
	subs	w8, w8, #1
	str	w8, [x26, _if_usb_prog_firmware.reset_count@PAGEOFF]
	b.lt	LBB0_25
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x19
	bl	_if_usb_reset_device
	mov	x0, x19
	bl	_if_usb_submit_rx_urb_fwload
	tbnz	x0, #63, LBB0_19
LBB0_7:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
                                        ;       Child Loop BB0_9 Depth 3
	str	xzr, [x19]
	mov	x28, x27
LBB0_8:                                 ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_9 Depth 3
	ldr	w1, [x24]
	mov	x0, x19
	bl	_if_usb_issue_boot_command
	mov	w27, #0
LBB0_9:                                 ;   Parent Loop BB0_7 Depth=1
                                        ;     Parent Loop BB0_8 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	add	w22, w27, #1
	mov	w0, #100
	bl	_msleep_interruptible
	ldr	x8, [x19]
	cmp	x8, #0
	ccmp	w27, #9, #2, eq
	mov	x27, x22
	b.lo	LBB0_9
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=2
	add	w27, w28, #1
	cmp	x8, #0
	ccmp	w28, #4, #0, eq
	mov	x28, x27
	b.lt	LBB0_8
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	x9, [x25]
	cmp	x8, x9
	b.eq	LBB0_20
; %bb.12:                               ;   in Loop: Header=BB0_7 Depth=1
	cmp	x8, #0
	b.le	LBB0_5
; %bb.13:                               ;   in Loop: Header=BB0_7 Depth=1
	str	xzr, [x19, #80]
	str	xzr, [x19, #32]
	str	d8, [x19, #8]
	stp	xzr, xzr, [x23]
	mov	x0, x19
	bl	_if_usb_send_fw_pkt
	ldr	x8, [x19, #48]
	cbz	x8, LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	w1, #1
	b	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x19, #32]
	cmp	x8, #0
	cset	w1, ne
LBB0_16:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w0, [x19, #56]
	bl	_wait_event_interruptible
	mov	x0, x21
	bl	_del_timer_sync
	ldr	w0, [x19, #40]
	bl	_usb_kill_urb
	ldr	x8, [x19, #32]
	cbnz	x8, LBB0_21
; %bb.17:                               ;   in Loop: Header=BB0_7 Depth=1
Lloh8:
	adrp	x0, l_.str.2@PAGE
Lloh9:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_info
	ldr	w8, [x26, _if_usb_prog_firmware.reset_count@PAGEOFF]
	sub	w9, w8, #1
	str	w9, [x26, _if_usb_prog_firmware.reset_count@PAGEOFF]
	cmp	w8, #0
	b.le	LBB0_24
; %bb.18:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	w27, #0
	b	LBB0_6
LBB0_19:
	ldr	x0, [x19, #96]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_lbs_deb_usbd
	b	LBB0_25
LBB0_20:
	ldr	w0, [x19, #40]
	bl	_usb_kill_urb
	ldr	w0, [x19, #88]
	bl	_usb_kill_urb
	mov	x0, x19
	bl	_if_usb_submit_rx_urb
	b	LBB0_25
LBB0_21:
	ldr	x8, [x19, #24]
	mov	w9, #1
	str	w9, [x8]
	mov	x0, x19
	bl	_if_usb_submit_rx_urb
	mov	x0, x20
	bl	_lbs_start_card
	cbnz	x0, LBB0_25
; %bb.22:
	mov	x0, x20
	bl	_if_usb_setup_firmware
Lloh12:
	adrp	x8, _EHS_REMOVE_WAKEUP@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EHS_REMOVE_WAKEUP@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	str	w1, [x20, #4]
	mov	x0, x20
	mov	x2, #0
	bl	_lbs_host_sleep_cfg
	cbz	x0, LBB0_25
; %bb.23:
	str	wzr, [x20]
	b	LBB0_25
LBB0_24:
	str	xzr, [sp]
Lloh15:
	adrp	x0, l_.str.3@PAGE
Lloh16:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pr_info
LBB0_25:
	str	xzr, [x19, #16]
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #16]               ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdr	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__DATA,__data
	.p2align	2                               ; @if_usb_prog_firmware.reset_count
_if_usb_prog_firmware.reset_count:
	.long	10                              ; 0xa

	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to find firmware (%d)\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"URB submission is failed\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_BOOT_CMD_FW_BY_USB,4,2         ; @BOOT_CMD_FW_BY_USB
	.comm	_BOOT_CMD_RESP_NOT_SUPPORTED,8,3 ; @BOOT_CMD_RESP_NOT_SUPPORTED
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
l_.str.2:                               ; @.str.2
	.asciz	"failed to load fw, resetting device!\n"

l_.str.3:                               ; @.str.3
	.asciz	"FW download failure, time = %d ms\n"

	.comm	_EHS_REMOVE_WAKEUP,4,2          ; @EHS_REMOVE_WAKEUP
	.no_dead_strip	_if_usb_prog_firmware
.subsections_via_symbols
