	.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
	movq	%rsi, %rbx
	movq	%rdi, %r15
	testq	%rdx, %rdx
	jne	LBB0_3
## %bb.1:
	movq	_SMS_DEVICE_FAMILY2@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_2
LBB0_3:
	movl	8(%r15), %edx
	leaq	-48(%rbp), %rdi
	movq	%rbx, %rsi
	callq	_request_firmware
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	movq	-48(%rbp), %rax
	movl	(%rax), %edx
	leaq	L_.str.1(%rip), %rdi
	xorl	%r13d, %r13d
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_sms_info
	movq	-48(%rbp), %rax
	movl	(%rax), %edi
	movq	_SMS_ALLOC_ALIGNMENT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_ALIGN
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rcx
	movq	_GFP_DMA@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	orl	(%rcx), %esi
	movl	%eax, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_10
## %bb.6:
	movq	%rax, %r12
	movq	-48(%rbp), %rax
	movl	(%rax), %edx
	movl	4(%rax), %esi
	movq	%r12, %rdi
	callq	_memcpy
	movq	_SMS_DEVICE_FAMILY2@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_8
## %bb.7:
	movq	-48(%rbp), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_smscore_load_firmware_family2
	jmp	LBB0_9
LBB0_4:
	movl	%eax, %r13d
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_sms_info
	jmp	LBB0_12
LBB0_10:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_sms_info
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	jmp	LBB0_11
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_12
LBB0_8:
	movl	4(%r15), %edi
	movq	-48(%rbp), %rax
	movl	(%rax), %edx
	movq	%r12, %rsi
	callq	*%r14
LBB0_9:
	movl	%eax, %r13d
	movq	%r12, %rdi
	callq	_kfree
LBB0_11:
	movq	-48(%rbp), %rdi
	callq	_release_firmware
LBB0_12:
	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
	.comm	_SMS_DEVICE_FAMILY2,4,2         ## @SMS_DEVICE_FAMILY2
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to open \"%s\""

L_.str.1:                               ## @.str.1
	.asciz	"read FW %s, size=%zd"

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

	.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, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x21, x1
	mov	x20, x0
	cbnz	x2, LBB0_2
; %bb.1:
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _SMS_DEVICE_FAMILY2@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SMS_DEVICE_FAMILY2@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
LBB0_2:
	ldr	w2, [x20, #8]
	add	x0, sp, #24
	mov	x1, x21
	bl	_request_firmware
	tbnz	w0, #31, LBB0_6
; %bb.3:
	ldr	x8, [sp, #24]
	ldr	w8, [x8]
	stp	x21, x8, [sp]
Lloh3:
	adrp	x0, l_.str.1@PAGE
Lloh4:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_sms_info
	ldr	x8, [sp, #24]
	ldr	w0, [x8]
Lloh5:
	adrp	x8, _SMS_ALLOC_ALIGNMENT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SMS_ALLOC_ALIGNMENT@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	bl	_ALIGN
Lloh8:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _GFP_DMA@GOTPAGE
Lloh12:
	ldr	x9, [x9, _GFP_DMA@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w1, w9, w8
	bl	_kmalloc
	cbz	x0, LBB0_7
; %bb.4:
	mov	x21, x0
	ldr	x8, [sp, #24]
	ldp	w2, w1, [x8]
	bl	_memcpy
	ldr	w8, [x20]
Lloh14:
	adrp	x9, _SMS_DEVICE_FAMILY2@GOTPAGE
Lloh15:
	ldr	x9, [x9, _SMS_DEVICE_FAMILY2@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.5:
	ldr	x8, [sp, #24]
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x21
	bl	_smscore_load_firmware_family2
	b	LBB0_10
LBB0_6:
	mov	x22, x0
	str	x21, [sp]
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
	bl	_sms_info
	b	LBB0_12
LBB0_7:
Lloh19:
	adrp	x0, l_.str.2@PAGE
Lloh20:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_sms_info
Lloh21:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_11
LBB0_8:
Lloh24:
	adrp	x8, _EINVAL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_12
LBB0_9:
	ldr	w0, [x20, #4]
	ldr	x8, [sp, #24]
	ldr	w2, [x8]
	mov	x1, x21
	blr	x19
LBB0_10:
	mov	x22, x0
	mov	x0, x21
	bl	_kfree
LBB0_11:
	ldr	x0, [sp, #24]
	bl	_release_firmware
LBB0_12:
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_SMS_DEVICE_FAMILY2,4,2         ; @SMS_DEVICE_FAMILY2
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to open \"%s\""

l_.str.1:                               ; @.str.1
	.asciz	"read FW %s, size=%zd"

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

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