	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s5c73m3_spi_boot
_s5c73m3_spi_boot:                      ## @s5c73m3_spi_boot
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	movl	$805306372, %esi                ## imm = 0x30000004
	movl	$65535, %edx                    ## imm = 0xFFFF
	callq	_s5c73m3_write
	testl	%eax, %eax
	js	LBB0_21
## %bb.1:
	movl	$400, %edi                      ## imm = 0x190
	movl	$500, %esi                      ## imm = 0x1F4
	callq	_usleep_range
	movq	%r15, %rdi
	movl	$12, %esi
	movl	$100, %edx
	movl	$3, %ecx
	callq	_s5c73m3_system_status_wait
	testl	%eax, %eax
	js	LBB0_16
## %bb.2:
	movq	%r15, %rdi
	movl	$806354964, %esi                ## imm = 0x30100014
	movl	$8518, %edx                     ## imm = 0x2146
	callq	_s5c73m3_write
	testl	%eax, %eax
	js	LBB0_21
## %bb.3:
	movq	%r15, %rdi
	movl	$806354960, %esi                ## imm = 0x30100010
	movl	$8460, %edx                     ## imm = 0x210C
	callq	_s5c73m3_write
	testl	%eax, %eax
	js	LBB0_21
## %bb.4:
	movl	$200, %edi
	movl	$250, %esi
	callq	_usleep_range
	movq	%r15, %rdi
	movl	$8461, %esi                     ## imm = 0x210D
	movl	$100, %edx
	movl	$300, %ecx                      ## imm = 0x12C
	callq	_s5c73m3_system_status_wait
	testl	%eax, %eax
	jns	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	movl	%eax, %edx
	callq	_v4l2_err
LBB0_6:
	testl	%r14d, %r14d
	je	LBB0_8
## %bb.7:
	movq	%r15, %rdi
	callq	_s5c73m3_load_fw
LBB0_8:
	movq	%r15, %rdi
	movl	$805306372, %esi                ## imm = 0x30000004
	movl	$65533, %edx                    ## imm = 0xFFFD
	callq	_s5c73m3_write
	testl	%eax, %eax
	js	LBB0_21
## %bb.9:
	movq	%r15, %rdi
	movl	$806355108, %esi                ## imm = 0x301000A4
	movl	$387, %edx                      ## imm = 0x183
	callq	_s5c73m3_write
	testl	%eax, %eax
	js	LBB0_21
## %bb.10:
	movq	%r15, %rdi
	movl	$805306372, %esi                ## imm = 0x30000004
	movl	$65535, %edx                    ## imm = 0xFFFF
	callq	_s5c73m3_write
	movl	%eax, %ebx
	testl	%r14d, %r14d
	je	LBB0_17
## %bb.11:
	testl	%ebx, %ebx
	js	LBB0_17
## %bb.12:
	movq	%r15, %rdi
	callq	_s5c73m3_read_fw_version
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_17
## %bb.13:
	movq	_update_fw@GOTPCREL(%rip), %r14
	cmpq	$0, (%r14)
	je	LBB0_17
## %bb.14:
	movq	%r15, %rdi
	callq	_s5c73m3_fw_update_from
	movq	$0, (%r14)
	jmp	LBB0_22
LBB0_21:
	movl	%eax, %ebx
	jmp	LBB0_22
LBB0_16:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movl	%eax, %edx
	callq	_v4l2_err
LBB0_17:
	movl	%ebx, %eax
LBB0_22:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"booting failed: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"SPI not ready: %d\n"

	.comm	_update_fw,8,3                  ## @update_fw
	.no_dead_strip	_s5c73m3_spi_boot
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function s5c73m3_spi_boot
_s5c73m3_spi_boot:                      ; @s5c73m3_spi_boot
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x20, x1
	mov	x19, x0
	mov	w1, #4
	movk	w1, #12288, lsl #16
	mov	w2, #65535
	bl	_s5c73m3_write
	tbnz	w0, #31, LBB0_15
; %bb.1:
	mov	w0, #400
	mov	w1, #500
	bl	_usleep_range
	mov	x0, x19
	mov	w1, #12
	mov	w2, #100
	mov	w3, #3
	bl	_s5c73m3_system_status_wait
	tbnz	w0, #31, LBB0_16
; %bb.2:
	mov	w22, #16
	movk	w22, #12304, lsl #16
	orr	w1, w22, #0x4
	mov	x0, x19
	mov	w2, #8518
	bl	_s5c73m3_write
	tbnz	w0, #31, LBB0_15
; %bb.3:
	mov	x0, x19
	mov	w1, #16
	movk	w1, #12304, lsl #16
	mov	w2, #8460
	bl	_s5c73m3_write
	tbnz	w0, #31, LBB0_15
; %bb.4:
	mov	w0, #200
	mov	w1, #250
	bl	_usleep_range
	mov	x0, x19
	mov	w1, #8461
	mov	w2, #100
	mov	w3, #300
	bl	_s5c73m3_system_status_wait
	tbz	w0, #31, LBB0_6
; %bb.5:
	mov	x2, x0
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_v4l2_err
LBB0_6:
	cbz	w20, LBB0_8
; %bb.7:
	mov	x0, x19
	bl	_s5c73m3_load_fw
LBB0_8:
	mov	x0, x19
	mov	w1, #4
	movk	w1, #12288, lsl #16
	mov	w2, #65533
	bl	_s5c73m3_write
	tbnz	w0, #31, LBB0_15
; %bb.9:
	add	w1, w22, #148
	mov	x0, x19
	mov	w2, #387
	bl	_s5c73m3_write
	tbnz	w0, #31, LBB0_15
; %bb.10:
	mov	x0, x19
	mov	w1, #4
	movk	w1, #12288, lsl #16
	mov	w2, #65535
	bl	_s5c73m3_write
	mov	x21, x0
	cbz	w20, LBB0_17
; %bb.11:
	tbnz	w21, #31, LBB0_17
; %bb.12:
	mov	x0, x19
	bl	_s5c73m3_read_fw_version
	mov	x21, x0
	tbnz	w0, #31, LBB0_17
; %bb.13:
Lloh2:
	adrp	x20, _update_fw@GOTPAGE
Lloh3:
	ldr	x20, [x20, _update_fw@GOTPAGEOFF]
	ldr	x8, [x20]
	cbz	x8, LBB0_17
; %bb.14:
	mov	x0, x19
	bl	_s5c73m3_fw_update_from
	str	xzr, [x20]
	b	LBB0_18
LBB0_15:
	mov	x21, x0
	b	LBB0_18
LBB0_16:
	mov	x21, x0
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_v4l2_err
LBB0_17:
	mov	x0, x21
LBB0_18:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"booting failed: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"SPI not ready: %d\n"

	.comm	_update_fw,8,3                  ; @update_fw
	.no_dead_strip	_s5c73m3_spi_boot
.subsections_via_symbols
