	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function load_copro_firmware
_load_copro_firmware:                   ## @load_copro_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	%rdi, %r13
	movq	_FW_FILE_NAME@GOTPCREL(%rip), %r14
	movq	(%r14), %rsi
	movl	28(%rdi), %edx
	leaq	-48(%rbp), %rdi
	callq	_request_firmware
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	movl	28(%r13), %edi
	movq	(%r14), %rcx
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_18
LBB0_2:
	movq	(%r13), %rax
	cmpq	8(%r13), %rax
	jne	LBB0_3
## %bb.4:
	movq	_SYS_SIG_SHARED@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_3:
	movq	_SYS_SIG_SPLIT@GOTPCREL(%rip), %rax
LBB0_5:
	movq	(%rax), %r15
	movl	28(%r13), %edi
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdx
	callq	_dev_dbg
	movq	-48(%rbp), %rax
	movq	8(%rax), %rbx
	cmpl	$0, (%rax)
	jle	LBB0_6
## %bb.7:
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	_HDR_OFFSET@GOTPCREL(%rip), %r13
	movq	_HDR_FW_SIZE@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movslq	(%r13), %rax
	leaq	(%rbx,%rax,4), %rax
	movq	_HDR_SYS_SIG@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	leaq	(%rax,%rcx,4), %rdi
	callq	_be16_to_cpup
	movq	%rax, %r12
	movslq	(%r13), %rax
	leaq	(%rbx,%rax,4), %rax
	movslq	(%r14), %rcx
	leaq	(%rax,%rcx,4), %rdi
	callq	_be32_to_cpup
	cmpq	%r15, %r12
	je	LBB0_9
## %bb.12:                              ##   in Loop: Header=BB0_8 Depth=1
	leaq	(%rbx,%rax,4), %rbx
	movq	-48(%rbp), %rcx
	movslq	(%rcx), %rdx
	shlq	$2, %rdx
	addq	8(%rcx), %rdx
	cmpq	%rdx, %rbx
	jb	LBB0_8
## %bb.13:
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	cmpq	%r15, %r12
	jne	LBB0_15
	jmp	LBB0_10
LBB0_6:
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	cmpq	%r15, %r12
	je	LBB0_10
LBB0_15:
	movl	28(%r13), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_17
LBB0_9:
	movq	-56(%rbp), %r13                 ## 8-byte Reload
LBB0_10:
	movq	16(%r13), %rcx
	cmpq	%rcx, %rax
	jbe	LBB0_16
## %bb.11:
	movl	28(%r13), %edi
	movq	-48(%rbp), %rax
	movl	(%rax), %edx
	leaq	L_.str.3(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_17
LBB0_16:
	movl	24(%r13), %edi
	movq	%rbx, %rsi
	movq	%rax, %rdx
	callq	_memcpy_toio
	xorl	%ebx, %ebx
LBB0_17:
	movq	-48(%rbp), %rdi
	callq	_release_firmware
LBB0_18:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FW_FILE_NAME,8,3               ## @FW_FILE_NAME
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error %d to load firwmare '%s' !\n"

	.comm	_SYS_SIG_SHARED,8,3             ## @SYS_SIG_SHARED
	.comm	_SYS_SIG_SPLIT,8,3              ## @SYS_SIG_SPLIT
L_.str.1:                               ## @.str.1
	.asciz	"Looking for image sig %04x\n"

	.comm	_HDR_OFFSET,4,2                 ## @HDR_OFFSET
	.comm	_HDR_SYS_SIG,4,2                ## @HDR_SYS_SIG
	.comm	_HDR_FW_SIZE,4,2                ## @HDR_FW_SIZE
L_.str.2:                               ## @.str.2
	.asciz	"Failed to locate image sig %04x in FW blob\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.3:                               ## @.str.3
	.asciz	"FW size (%zd) bigger than memory reserve (%zd)\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_load_copro_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function load_copro_firmware
_load_copro_firmware:                   ; @load_copro_firmware
	.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	x21, _FW_FILE_NAME@GOTPAGE
Lloh1:
	ldr	x21, [x21, _FW_FILE_NAME@GOTPAGEOFF]
	ldr	x1, [x21]
	ldr	w2, [x0, #28]
	add	x0, sp, #8
	bl	_request_firmware
	cbz	w0, LBB0_2
; %bb.1:
	mov	x20, x0
	ldr	w0, [x19, #28]
	ldr	x8, [x21]
	str	x8, [sp]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_err
	b	LBB0_14
LBB0_2:
	ldp	x8, x9, [x19]
Lloh4:
	adrp	x10, _SYS_SIG_SHARED@GOTPAGE
Lloh5:
	ldr	x10, [x10, _SYS_SIG_SHARED@GOTPAGEOFF]
Lloh6:
	adrp	x11, _SYS_SIG_SPLIT@GOTPAGE
Lloh7:
	ldr	x11, [x11, _SYS_SIG_SPLIT@GOTPAGEOFF]
	cmp	x8, x9
	csel	x8, x10, x11, eq
	ldr	x20, [x8]
	ldr	w0, [x19, #28]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x20
	bl	_dev_dbg
	ldr	x8, [sp, #8]
	ldr	x21, [x8, #8]
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.3:
Lloh10:
	adrp	x23, _HDR_OFFSET@GOTPAGE
Lloh11:
	ldr	x23, [x23, _HDR_OFFSET@GOTPAGEOFF]
Lloh12:
	adrp	x24, _HDR_SYS_SIG@GOTPAGE
Lloh13:
	ldr	x24, [x24, _HDR_SYS_SIG@GOTPAGEOFF]
Lloh14:
	adrp	x25, _HDR_FW_SIZE@GOTPAGE
Lloh15:
	ldr	x25, [x25, _HDR_FW_SIZE@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldrsw	x8, [x23]
	add	x8, x21, x8, lsl #2
	ldrsw	x9, [x24]
	add	x0, x8, x9, lsl #2
	bl	_be16_to_cpup
	mov	x22, x0
	ldrsw	x8, [x23]
	add	x8, x21, x8, lsl #2
	ldrsw	x9, [x25]
	add	x0, x8, x9, lsl #2
	bl	_be32_to_cpup
	mov	x2, x0
	cmp	x22, x20
	b.eq	LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x21, x21, x2, lsl #2
	ldr	x8, [sp, #8]
	ldr	x9, [x8, #8]
	ldrsw	x8, [x8]
	add	x8, x9, x8, lsl #2
	cmp	x21, x8
	b.lo	LBB0_4
; %bb.6:
	cmp	x22, x20
	b.ne	LBB0_10
LBB0_7:
	ldr	x8, [x19, #16]
	cmp	x2, x8
	b.ls	LBB0_12
; %bb.8:
	ldr	w0, [x19, #28]
	ldr	x9, [sp, #8]
	ldr	w2, [x9]
	str	x8, [sp]
Lloh16:
	adrp	x1, l_.str.3@PAGE
Lloh17:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
Lloh18:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_11
LBB0_9:
	mov	x22, #0
	mov	x2, #0
	cmp	x22, x20
	b.eq	LBB0_7
LBB0_10:
	ldr	w0, [x19, #28]
Lloh20:
	adrp	x1, l_.str.2@PAGE
Lloh21:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x20
	bl	_dev_err
Lloh22:
	adrp	x8, _ENODEV@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_13
LBB0_12:
	ldr	w0, [x19, #24]
	mov	x1, x21
	bl	_memcpy_toio
	mov	w20, #0
LBB0_13:
	ldr	x0, [sp, #8]
	bl	_release_firmware
LBB0_14:
	mov	x0, x20
	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 AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_FW_FILE_NAME,8,3               ; @FW_FILE_NAME
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error %d to load firwmare '%s' !\n"

	.comm	_SYS_SIG_SHARED,8,3             ; @SYS_SIG_SHARED
	.comm	_SYS_SIG_SPLIT,8,3              ; @SYS_SIG_SPLIT
l_.str.1:                               ; @.str.1
	.asciz	"Looking for image sig %04x\n"

	.comm	_HDR_OFFSET,4,2                 ; @HDR_OFFSET
	.comm	_HDR_SYS_SIG,4,2                ; @HDR_SYS_SIG
	.comm	_HDR_FW_SIZE,4,2                ; @HDR_FW_SIZE
l_.str.2:                               ; @.str.2
	.asciz	"Failed to locate image sig %04x in FW blob\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.3:                               ; @.str.3
	.asciz	"FW size (%zd) bigger than memory reserve (%zd)\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_load_copro_firmware
.subsections_via_symbols
