	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function firmware_download
_firmware_download:                     ## @firmware_download
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	$0, -48(%rbp)
	movq	_firmware_name@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	8(%rdi), %rdx
	leaq	-48(%rbp), %rdi
	callq	_request_firmware
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_log
	jmp	LBB0_13
LBB0_2:
	movq	-48(%rbp), %rax
	movq	(%rax), %r13
	movl	8(%rax), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rsi
	callq	_kmemdup
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_8
## %bb.3:
	movq	(%r14), %rax
	movq	8(%rax), %rax
	movq	(%rax), %rbx
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	callq	_log
	testq	%r13, %r13
	je	LBB0_9
## %bb.4:
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	movq	%r13, %r15
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	$0, -52(%rbp)
	movq	%rbx, %r14
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_usb_sndbulkpipe
	movl	%eax, %ebx
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	addq	%r12, %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_min
	movq	_HZ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	addl	%ecx, %ecx
	leal	(%rcx,%rcx,4), %r9d
	movq	%r13, %rdi
	movl	%ebx, %esi
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	movl	%eax, %ecx
	leaq	-52(%rbp), %r8
	callq	_usb_bulk_msg
	testl	%eax, %eax
	jne	LBB0_10
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	addq	%r14, %r12
	subq	%r14, %r15
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	cmpq	%r12, %r13
	movq	%r14, %rbx
	ja	LBB0_5
LBB0_9:
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_12
LBB0_10:
	movl	%eax, %ebx
LBB0_11:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_kfree
LBB0_12:
	movq	-48(%rbp), %rdi
	callq	_release_firmware
LBB0_13:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_firmware_name,4,2              ## @firmware_name
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"download err : %d"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"\t\t download size : %d"

	.comm	_HZ,4,2                         ## @HZ
	.no_dead_strip	_firmware_download
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function firmware_download
_firmware_download:                     ; @firmware_download
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	str	xzr, [sp]
Lloh0:
	adrp	x8, _firmware_name@GOTPAGE
Lloh1:
	ldr	x8, [x8, _firmware_name@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, x0, #8
	mov	x0, sp
	bl	_request_firmware
	cbz	w0, LBB0_2
; %bb.1:
	mov	x24, x0
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x24
	bl	_log
	b	LBB0_12
LBB0_2:
	ldr	x8, [sp]
	ldr	x21, [x8]
	ldr	w0, [x8, #8]
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x1, x21
	bl	_kmemdup
	cbz	x0, LBB0_8
; %bb.3:
	mov	x20, x0
	ldr	x8, [x19]
	ldr	x8, [x8, #8]
	ldr	x22, [x8]
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x22
	bl	_log
	cbz	x21, LBB0_7
; %bb.4:
	mov	x26, #0
Lloh10:
	adrp	x27, _HZ@GOTPAGE
Lloh11:
	ldr	x27, [x27, _HZ@GOTPAGEOFF]
	mov	x23, x21
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	str	wzr, [sp, #12]
	mov	x0, x19
	mov	w1, #1
	bl	_usb_sndbulkpipe
	mov	x24, x0
	add	x25, x20, x26
	mov	x0, x22
	mov	x1, x23
	bl	_min
	mov	x3, x0
	ldr	w8, [x27]
	add	w8, w8, w8, lsl #2
	lsl	w5, w8, #1
	add	x4, sp, #12
	mov	x0, x19
	mov	x1, x24
	mov	x2, x25
	bl	_usb_bulk_msg
	cbnz	w0, LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	sub	x23, x23, x22
	add	x26, x26, x22
	cmp	x21, x26
	b.hi	LBB0_5
LBB0_7:
	mov	w24, #0
	b	LBB0_10
LBB0_8:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_11
LBB0_9:
	mov	x24, x0
LBB0_10:
	mov	x0, x20
	bl	_kfree
LBB0_11:
	ldr	x0, [sp]
	bl	_release_firmware
LBB0_12:
	mov	x0, x24
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_firmware_name,4,2              ; @firmware_name
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"download err : %d"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"\t\t download size : %d"

	.comm	_HZ,4,2                         ; @HZ
	.no_dead_strip	_firmware_download
.subsections_via_symbols
