	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vicam_read_frame
_vicam_read_frame:                      ## @vicam_read_frame
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r12
	movl	$0, -44(%rbp)
	movq	(%rdi), %rbx
	movl	28(%rdi), %edi
	callq	_v4l2_ctrl_g_ctrl
	movl	%eax, %r14d
	movl	24(%r12), %edi
	callq	_v4l2_ctrl_g_ctrl
	movl	%eax, %r13d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	movl	%r13d, (%rbx)
	cmpl	$256, 16(%r12)                  ## imm = 0x100
	jne	LBB0_2
## %bb.1:
	orb	$1, 4(%rbx)
LBB0_2:
	movl	20(%r12), %eax
	cmpl	$122, %eax
	jg	LBB0_4
## %bb.3:
	orb	$16, 4(%rbx)
	movl	20(%r12), %eax
	addl	%eax, %eax
LBB0_4:
	movl	$144, 8(%rbx)
	cmpl	$200, %eax
	jg	LBB0_6
## %bb.5:
	movl	$6, 12(%rbx)
	jmp	LBB0_9
LBB0_6:
	cmpl	$242, %eax
	ja	LBB0_8
## %bb.7:
	movl	$7, 12(%rbx)
	jmp	LBB0_9
LBB0_8:
	movl	$8, 12(%rbx)
LBB0_9:
	movl	$255, %ecx
	subl	%r14d, %ecx
	movl	%r14d, %edx
	shrl	$8, %edx
	xorl	%r13d, %r13d
	cmpl	$256, %r14d                     ## imm = 0x100
	movzbl	%r14b, %esi
	cmovgel	%r13d, %ecx
	cmovll	%r13d, %esi
	movl	$1, %edi
	cmovgel	%edx, %edi
	movl	%ecx, 16(%rbx)
	movl	$0, 20(%rbx)
	movl	%esi, 24(%rbx)
	movl	%edi, 28(%rbx)
	movl	$244, %ecx
	subl	%eax, %ecx
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	andl	$-2, %eax
	movl	%eax, 32(%rbx)
	leaq	12(%r12), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	%r12, %rdi
	movl	$81, %esi
	movl	$128, %edx
	xorl	%ecx, %ecx
	movq	%rbx, %r8
	movl	$16, %r9d
	callq	_vicam_control_msg
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_mutex_unlock
	testl	%ebx, %ebx
	js	LBB0_10
## %bb.11:
	movl	8(%r12), %ebx
	movl	%ebx, %edi
	movl	$129, %esi
	callq	_usb_rcvbulkpipe
	leaq	-44(%rbp), %r8
	movl	%ebx, %edi
	movl	%eax, %esi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	%r15d, %ecx
	movl	$10000, %r9d                    ## imm = 0x2710
	callq	_usb_bulk_msg
	movl	-44(%rbp), %edx
	testl	%eax, %eax
	js	LBB0_13
## %bb.12:
	cmpl	%r15d, %edx
	je	LBB0_14
LBB0_13:
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	movl	%r15d, %ecx
	callq	_pr_err
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_14
LBB0_10:
	movl	%ebx, %r13d
LBB0_14:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bulk read fail (%d) len %d/%d\n"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_vicam_read_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vicam_read_frame
_vicam_read_frame:                      ; @vicam_read_frame
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	str	wzr, [sp, #12]
	ldr	x22, [x0]
	ldr	w0, [x0, #28]
	bl	_v4l2_ctrl_g_ctrl
	mov	x23, x0
	ldr	w0, [x21, #24]
	bl	_v4l2_ctrl_g_ctrl
	mov	x24, x0
	mov	x0, x22
	mov	w1, #0
	mov	w2, #16
	bl	_memset
	str	w24, [x22]
	ldr	w8, [x21, #16]
	cmp	w8, #256
	b.ne	LBB0_2
; %bb.1:
	ldr	w8, [x22, #4]
	orr	w8, w8, #0x1
	str	w8, [x22, #4]
LBB0_2:
	ldr	w8, [x21, #20]
	cmp	w8, #122
	b.gt	LBB0_4
; %bb.3:
	ldr	w8, [x22, #4]
	orr	w8, w8, #0x10
	str	w8, [x22, #4]
	ldr	w8, [x21, #20]
	lsl	w8, w8, #1
LBB0_4:
	mov	w9, #144
	str	w9, [x22, #8]
	cmp	w8, #200
	b.gt	LBB0_6
; %bb.5:
	mov	w9, #6
	b	LBB0_9
LBB0_6:
	cmp	w8, #242
	b.hi	LBB0_8
; %bb.7:
	mov	w9, #7
	b	LBB0_9
LBB0_8:
	mov	w9, #8
LBB0_9:
	str	w9, [x22, #12]
	mov	w9, #255
	sub	w9, w9, w23
	and	w10, w23, #0xff
	lsr	w11, w23, #8
	cmp	w23, #256
	csel	w9, w9, wzr, lt
	csel	w10, wzr, w10, lt
	csinc	w11, w11, wzr, ge
	stp	w9, wzr, [x22, #16]
	stp	w10, w11, [x22, #24]
	mov	w9, #244
	sub	w9, w9, w8
	mov	w10, #245
	sub	w8, w10, w8
	cmp	w9, #0
	csel	w8, w8, w9, lt
	asr	w8, w8, #1
	and	w8, w8, #0xfffffffe
	str	w8, [x22, #32]
	add	x23, x21, #12
	mov	x0, x23
	bl	_mutex_lock
	mov	x0, x21
	mov	w1, #81
	mov	w2, #128
	mov	w3, #0
	mov	x4, x22
	mov	w5, #16
	bl	_vicam_control_msg
	mov	x22, x0
	mov	x0, x23
	bl	_mutex_unlock
	tbnz	w22, #31, LBB0_14
; %bb.10:
	ldr	w21, [x21, #8]
	mov	x0, x21
	mov	w1, #129
	bl	_usb_rcvbulkpipe
	mov	x1, x0
	add	x4, sp, #12
	mov	x0, x21
	mov	x2, x20
	mov	x3, x19
	mov	w5, #10000
	bl	_usb_bulk_msg
	mov	x1, x0
	ldr	w2, [sp, #12]
	tbnz	w0, #31, LBB0_13
; %bb.11:
	cmp	w2, w19
	b.ne	LBB0_13
; %bb.12:
	mov	w22, #0
	b	LBB0_14
LBB0_13:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x3, x19
	bl	_pr_err
Lloh2:
	adrp	x8, _EIO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_14:
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bulk read fail (%d) len %d/%d\n"

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_vicam_read_frame
.subsections_via_symbols
