	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_go7007_start_encoder           ## -- Begin function go7007_start_encoder
	.p2align	4, 0x90
_go7007_start_encoder:                  ## @go7007_start_encoder
	.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	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movl	$0, (%rdi)
	movq	64(%rdi), %rax
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rax)
	movl	72(%rdi), %edi
	callq	_v4l2_ctrl_g_ctrl
	cmpl	$129, %eax
	je	LBB0_25
## %bb.1:
	cmpl	$128, %eax
	jne	LBB0_14
## %bb.2:
	movl	16(%r15), %eax
	leal	15(%rax), %r9d
	testl	%eax, %eax
	cmovnsl	%eax, %r9d
	cmpl	$16, %eax
	jl	LBB0_13
## %bb.3:
	sarl	$4, %r9d
	movl	20(%r15), %r10d
	leal	15(%r10), %r12d
	testl	%r10d, %r10d
	cmovnsl	%r10d, %r12d
	sarl	$4, %r12d
	leaq	-1(%r12), %r8
	movl	%r12d, %edi
	andl	$3, %edi
	andl	$-4, %r12d
	xorl	%esi, %esi
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=1
	incl	%esi
	cmpl	%r9d, %esi
	je	LBB0_13
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
                                        ##     Child Loop BB0_11 Depth 2
	cmpl	$16, %r10d
	jl	LBB0_12
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%r10d, %eax
	imull	%esi, %eax
	leal	15(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$4, %ecx
	movq	8(%r15), %r11
	movq	64(%r15), %rax
	movslq	%ecx, %r14
	cmpq	$3, %r8
	jae	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	xorl	%ebx, %ebx
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	leaq	(%r11,%r14,8), %rcx
	addq	$24, %rcx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	-24(%rcx,%rbx,8), %rdx
	movl	$1, (%rax,%rdx,4)
	movq	-16(%rcx,%rbx,8), %rdx
	movl	$1, (%rax,%rdx,4)
	movq	-8(%rcx,%rbx,8), %rdx
	movl	$1, (%rax,%rdx,4)
	movq	(%rcx,%rbx,8), %rdx
	movl	$1, (%rax,%rdx,4)
	addq	$4, %rbx
	cmpq	%rbx, %r12
	jne	LBB0_8
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	testq	%rdi, %rdi
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	addq	%r14, %rbx
	leaq	(%r11,%rbx,8), %rcx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_11:                                ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%rcx,%rbx,8), %rdx
	movl	$1, (%rax,%rdx,4)
	incq	%rbx
	cmpq	%rbx, %rdi
	jne	LBB0_11
	jmp	LBB0_12
LBB0_25:
	movq	8(%r15), %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movq	64(%r15), %rax
	movl	$1, (%rax)
LBB0_13:
	movl	$1, (%r15)
LBB0_14:
	cmpq	$0, 56(%r15)
	je	LBB0_16
## %bb.15:
	movl	$0, (%r15)
LBB0_16:
	leaq	-48(%rbp), %rsi
	leaq	-36(%rbp), %rdx
	movq	%r15, %rdi
	callq	_go7007_construct_fw_image
	testq	%rax, %rax
	js	LBB0_17
## %bb.18:
	movq	-48(%rbp), %rsi
	movl	-36(%rbp), %edx
	movq	%r15, %rdi
	callq	_go7007_send_firmware
	leaq	L_.str(%rip), %r14
	testq	%rax, %rax
	js	LBB0_22
## %bb.19:
	leaq	-56(%rbp), %rsi
	leaq	-52(%rbp), %rdx
	movq	%r15, %rdi
	callq	_go7007_read_interrupt
	testq	%rax, %rax
	js	LBB0_22
## %bb.20:
	movq	_STATE_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%r15)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 32(%r15)
	movq	%r15, %rdi
	callq	_go7007_stream_start
	xorl	%r14d, %r14d
	testq	%rax, %rax
	jns	LBB0_23
## %bb.21:
	leaq	L_.str.1(%rip), %r14
LBB0_22:
	addq	$24, %r15
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_v4l2_err
	movl	$-1, %r14d
LBB0_23:
	movq	-48(%rbp), %rdi
	callq	_kfree
	jmp	LBB0_24
LBB0_17:
	movl	$-1, %r14d
LBB0_24:
	movl	%r14d, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"error transferring firmware\n"

	.comm	_STATE_DATA,4,2                 ## @STATE_DATA
L_.str.1:                               ## @.str.1
	.asciz	"error starting stream transfer\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_go7007_start_encoder           ; -- Begin function go7007_start_encoder
	.p2align	2
_go7007_start_encoder:                  ; @go7007_start_encoder
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	mov	x19, x0
	str	wzr, [x0]
	ldr	x8, [x0, #64]
	stp	xzr, xzr, [x8]
	ldr	w0, [x0, #72]
	bl	_v4l2_ctrl_g_ctrl
	cmp	w0, #129
	b.eq	LBB0_13
; %bb.1:
	cmp	w0, #128
	b.ne	LBB0_15
; %bb.2:
	ldr	w8, [x19, #16]
	add	w9, w8, #15
	cmp	w8, #0
	csel	w9, w9, w8, lt
	cmp	w8, #16
	b.lt	LBB0_14
; %bb.3:
	mov	w8, #0
	asr	w9, w9, #4
	ldr	w10, [x19, #20]
	add	w11, w10, #15
	cmp	w10, #0
	csel	w11, w11, w10, lt
	asr	w11, w11, #4
	and	x12, x11, #0xfffffffc
	mov	w13, #1
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	w8, w8, #1
	cmp	w8, w9
	b.eq	LBB0_14
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
                                        ;     Child Loop BB0_12 Depth 2
	cmp	w10, #16
	b.lt	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mul	w14, w10, w8
	add	w15, w14, #15
	cmp	w14, #0
	csel	w16, w15, w14, lt
	ldr	x14, [x19, #64]
	ldr	x15, [x19, #8]
	sbfx	x16, x16, #4, #28
	cmp	w11, #4
	b.hs	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x17, #0
	b	LBB0_11
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x17, x15, x16, lsl #3
	add	x17, x17, #16
	mov	x0, x12
LBB0_9:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldp	x1, x2, [x17, #-16]
	ldp	x3, x4, [x17], #32
	str	w13, [x14, x1, lsl #2]
	str	w13, [x14, x2, lsl #2]
	str	w13, [x14, x3, lsl #2]
	str	w13, [x14, x4, lsl #2]
	subs	x0, x0, #4
	b.ne	LBB0_9
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x17, x12
	cmp	x12, x11
	b.eq	LBB0_4
LBB0_11:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x16, x17, x16
	add	x15, x15, x16, lsl #3
	sub	x16, x11, x17
LBB0_12:                                ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x17, [x15], #8
	str	w13, [x14, x17, lsl #2]
	subs	x16, x16, #1
	b.ne	LBB0_12
	b	LBB0_4
LBB0_13:
	ldr	x0, [x19, #8]
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	ldr	x8, [x19, #64]
	mov	w9, #1
	str	w9, [x8]
LBB0_14:
	mov	w8, #1
	str	w8, [x19]
LBB0_15:
	ldr	x8, [x19, #56]
	cbz	x8, LBB0_17
; %bb.16:
	str	wzr, [x19]
LBB0_17:
	add	x1, sp, #24
	add	x2, sp, #20
	mov	x0, x19
	bl	_go7007_construct_fw_image
	tbnz	x0, #63, LBB0_22
; %bb.18:
	ldr	x1, [sp, #24]
	ldr	w2, [sp, #20]
	mov	x0, x19
	bl	_go7007_send_firmware
	tbnz	x0, #63, LBB0_23
; %bb.19:
	add	x1, sp, #16
	add	x2, sp, #12
	mov	x0, x19
	bl	_go7007_read_interrupt
	tbnz	x0, #63, LBB0_23
; %bb.20:
Lloh0:
	adrp	x8, _STATE_DATA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _STATE_DATA@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x19, #48]
	stp	xzr, xzr, [x19, #32]
	mov	x0, x19
	bl	_go7007_stream_start
	tbnz	x0, #63, LBB0_24
; %bb.21:
	mov	w19, #0
	b	LBB0_26
LBB0_22:
	mov	w19, #-1
	b	LBB0_27
LBB0_23:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_25
LBB0_24:
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_25:
	add	x0, x19, #24
	bl	_v4l2_err
	mov	w19, #-1
LBB0_26:
	ldr	x0, [sp, #24]
	bl	_kfree
LBB0_27:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"error transferring firmware\n"

	.comm	_STATE_DATA,4,2                 ; @STATE_DATA
l_.str.1:                               ; @.str.1
	.asciz	"error starting stream transfer\n"

.subsections_via_symbols
