	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s5c73m3_load_fw
_s5c73m3_load_fw:                       ## @s5c73m3_load_fw
	.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	%r12
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	callq	_sensor_sd_to_s5c73m3
	movq	%rax, %rbx
	movq	16(%rax), %r15
	movq	(%rax), %rcx
	leaq	L_.str(%rip), %rdx
	leaq	-64(%rbp), %r12
	movq	%r12, %rdi
	movl	$20, %esi
	callq	_snprintf
	leaq	-72(%rbp), %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_request_firmware
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	-72(%rbp), %rax
	movl	(%rax), %ecx
	leaq	L_.str.2(%rip), %rsi
	leaq	-64(%rbp), %rdx
	movq	%r14, %rdi
	callq	_v4l2_info
	movq	-72(%rbp), %rax
	movl	(%rax), %edx
	movl	4(%rax), %esi
	movq	%rbx, %rdi
	movl	$64, %ecx
	callq	_s5c73m3_spi_write
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_4
## %bb.3:
	movl	$1, 8(%rbx)
	jmp	LBB0_5
LBB0_1:
	leaq	L_.str.1(%rip), %rsi
	xorl	%r15d, %r15d
	leaq	-64(%rbp), %rdx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_v4l2_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_6
LBB0_4:
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_v4l2_err
LBB0_5:
	movq	-72(%rbp), %rdi
	callq	_release_firmware
LBB0_6:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_8
## %bb.7:
	movl	%r15d, %eax
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SlimISP_%.2s.bin"

L_.str.1:                               ## @.str.1
	.asciz	"Firmware request failed (%s)\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.2:                               ## @.str.2
	.asciz	"Loading firmware (%s, %zu B)\n"

L_.str.3:                               ## @.str.3
	.asciz	"SPI write failed\n"

	.no_dead_strip	_s5c73m3_load_fw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function s5c73m3_load_fw
_s5c73m3_load_fw:                       ; @s5c73m3_load_fw
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	bl	_sensor_sd_to_s5c73m3
	mov	x20, x0
	ldr	x21, [x0, #16]
	ldr	x3, [x0]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	add	x22, sp, #20
	add	x0, sp, #20
	mov	w1, #20
	bl	_snprintf
	add	x0, sp, #8
	add	x1, sp, #20
	mov	x2, x21
	bl	_request_firmware
	tbnz	w0, #31, LBB0_3
; %bb.1:
	ldr	x8, [sp, #8]
	ldr	w3, [x8]
Lloh5:
	adrp	x1, l_.str.2@PAGE
Lloh6:
	add	x1, x1, l_.str.2@PAGEOFF
	add	x2, sp, #20
	mov	x0, x19
	bl	_v4l2_info
	ldr	x8, [sp, #8]
	ldp	w2, w1, [x8]
	mov	x0, x20
	mov	w3, #64
	bl	_s5c73m3_spi_write
	mov	x21, x0
	tbnz	w0, #31, LBB0_4
; %bb.2:
	mov	w8, #1
	str	w8, [x20, #8]
	b	LBB0_5
LBB0_3:
	str	x22, [sp]
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_v4l2_err
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_6
LBB0_4:
Lloh12:
	adrp	x1, l_.str.3@PAGE
Lloh13:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_v4l2_err
LBB0_5:
	ldr	x0, [sp, #8]
	bl	_release_firmware
LBB0_6:
	ldr	x8, [sp, #40]
Lloh14:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh15:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.7:
	mov	x0, x21
	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
	add	sp, sp, #96
	ret
LBB0_8:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SlimISP_%.2s.bin"

l_.str.1:                               ; @.str.1
	.asciz	"Firmware request failed (%s)\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.2:                               ; @.str.2
	.asciz	"Loading firmware (%s, %zu B)\n"

l_.str.3:                               ; @.str.3
	.asciz	"SPI write failed\n"

	.no_dead_strip	_s5c73m3_load_fw
.subsections_via_symbols
