	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smscore_load_firmware_from_file
_smscore_load_firmware_from_file:       ## @smscore_load_firmware_from_file
	.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	%rdx, %r14
	movl	%esi, %ebx
	movq	%rdi, %r15
	callq	_smscore_get_fw_filename
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	leaq	L_.str.1(%rip), %rdi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	_pr_debug
	testq	%r14, %r14
	jne	LBB0_5
## %bb.3:
	movq	_SMS_DEVICE_FAMILY2@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_4
LBB0_5:
	movl	12(%r15), %edx
	leaq	-48(%rbp), %rdi
	movq	%r12, %rsi
	callq	_request_firmware
	testl	%eax, %eax
	js	LBB0_6
## %bb.7:
	movq	-48(%rbp), %rax
	movq	(%rax), %rdx
	leaq	L_.str.3(%rip), %rdi
	xorl	%r13d, %r13d
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	_pr_debug
	movq	-48(%rbp), %rax
	movq	(%rax), %rdi
	addq	$4, %rdi
	movq	_SMS_ALLOC_ALIGNMENT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_ALIGN
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rcx
	movl	4(%r15), %esi
	orl	(%rcx), %esi
	movl	%eax, %edi
	callq	_kmalloc
	movq	%rax, %r12
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	-48(%rbp), %rax
	movl	8(%rax), %esi
	movq	(%rax), %rdx
	movq	%r12, %rdi
	callq	_memcpy
	movq	-48(%rbp), %rax
	movq	(%rax), %rdx
	movq	_SMS_DEVICE_FAMILY2@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_11
## %bb.10:
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_smscore_load_firmware_family2
	jmp	LBB0_12
LBB0_1:
	leaq	L_.str(%rip), %rdi
	xorl	%r13d, %r13d
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_pr_err
	movq	_ENOENT@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	jmp	LBB0_14
LBB0_6:
	movl	%eax, %r13d
	leaq	L_.str.2(%rip), %rdi
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	_pr_err
	jmp	LBB0_14
LBB0_8:
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	jmp	LBB0_13
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_14
LBB0_11:
	movl	8(%r15), %edi
	movq	%r12, %rsi
	callq	*%r14
LBB0_12:
	movl	%eax, %r13d
LBB0_13:
	movq	%r12, %rdi
	callq	_kfree
	movq	-48(%rbp), %rdi
	callq	_release_firmware
LBB0_14:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOENT,4,2                     ## @ENOENT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mode %d not supported on this device\n"

L_.str.1:                               ## @.str.1
	.asciz	"Firmware name: %s\n"

	.comm	_SMS_DEVICE_FAMILY2,4,2         ## @SMS_DEVICE_FAMILY2
	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.2:                               ## @.str.2
	.asciz	"failed to open firmware file '%s'\n"

L_.str.3:                               ## @.str.3
	.asciz	"read fw %s, buffer size=0x%zx\n"

	.comm	_SMS_ALLOC_ALIGNMENT,4,2        ## @SMS_ALLOC_ALIGNMENT
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.4:                               ## @.str.4
	.asciz	"failed to allocate firmware buffer\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smscore_load_firmware_from_file
_smscore_load_firmware_from_file:       ; @smscore_load_firmware_from_file
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x2
	mov	x22, x1
	mov	x20, x0
	bl	_smscore_get_fw_filename
	cbz	x0, LBB0_7
; %bb.1:
	mov	x21, x0
Lloh0:
	adrp	x0, l_.str.1@PAGE
Lloh1:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
	bl	_pr_debug
	cbnz	x19, LBB0_3
; %bb.2:
	ldr	w8, [x20]
Lloh2:
	adrp	x9, _SMS_DEVICE_FAMILY2@GOTPAGE
Lloh3:
	ldr	x9, [x9, _SMS_DEVICE_FAMILY2@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_11
LBB0_3:
	ldr	w2, [x20, #12]
	add	x0, sp, #8
	mov	x1, x21
	bl	_request_firmware
	tbnz	w0, #31, LBB0_9
; %bb.4:
	ldr	x8, [sp, #8]
	ldr	x8, [x8]
	str	x8, [sp]
Lloh5:
	adrp	x0, l_.str.3@PAGE
Lloh6:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x21
	bl	_pr_debug
	ldr	x8, [sp, #8]
	ldr	x8, [x8]
	add	x0, x8, #4
Lloh7:
	adrp	x8, _SMS_ALLOC_ALIGNMENT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SMS_ALLOC_ALIGNMENT@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	bl	_ALIGN
Lloh10:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	ldr	w9, [x20, #4]
	orr	w1, w9, w8
	bl	_kmalloc
	mov	x21, x0
	cbz	x0, LBB0_10
; %bb.5:
	ldr	x8, [sp, #8]
	ldr	w1, [x8, #8]
	ldr	x2, [x8]
	mov	x0, x21
	bl	_memcpy
	ldr	x8, [sp, #8]
	ldr	x2, [x8]
	ldr	w8, [x20]
Lloh13:
	adrp	x9, _SMS_DEVICE_FAMILY2@GOTPAGE
Lloh14:
	ldr	x9, [x9, _SMS_DEVICE_FAMILY2@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.6:
	mov	x0, x20
	mov	x1, x21
	bl	_smscore_load_firmware_family2
	b	LBB0_13
LBB0_7:
	str	x22, [sp]
Lloh16:
	adrp	x0, l_.str@PAGE
Lloh17:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
Lloh18:
	adrp	x8, _ENOENT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_15
LBB0_9:
	mov	x22, x0
	str	x21, [sp]
Lloh20:
	adrp	x0, l_.str.2@PAGE
Lloh21:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_err
	b	LBB0_15
LBB0_10:
Lloh22:
	adrp	x0, l_.str.4@PAGE
Lloh23:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_pr_err
Lloh24:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_14
LBB0_11:
Lloh27:
	adrp	x8, _EINVAL@GOTPAGE
Lloh28:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_8
LBB0_12:
	ldr	w0, [x20, #8]
	mov	x1, x21
	blr	x19
LBB0_13:
	mov	x22, x0
LBB0_14:
	mov	x0, x21
	bl	_kfree
	ldr	x0, [sp, #8]
	bl	_release_firmware
LBB0_15:
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOENT,4,2                     ; @ENOENT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mode %d not supported on this device\n"

l_.str.1:                               ; @.str.1
	.asciz	"Firmware name: %s\n"

	.comm	_SMS_DEVICE_FAMILY2,4,2         ; @SMS_DEVICE_FAMILY2
	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.2:                               ; @.str.2
	.asciz	"failed to open firmware file '%s'\n"

l_.str.3:                               ; @.str.3
	.asciz	"read fw %s, buffer size=0x%zx\n"

	.comm	_SMS_ALLOC_ALIGNMENT,4,2        ; @SMS_ALLOC_ALIGNMENT
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.4:                               ; @.str.4
	.asciz	"failed to allocate firmware buffer\n"

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