	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sd_dq_callback
_sd_dq_callback:                        ## @sd_dq_callback
	.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	(%rdi), %ecx
	testl	%ecx, %ecx
	js	LBB0_18
## %bb.1:
	movq	%rdi, %rbx
	leal	-1(%rcx), %eax
	movl	%eax, (%rdi)
	cmpl	$6, %ecx
	jbe	LBB0_2
LBB0_18:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	cmpl	$4, %eax
	ja	LBB0_4
## %bb.3:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_11:
	movl	16(%rbx), %r14d
	movl	%r14d, %edi
	movl	$2, %esi
	callq	_usb_rcvbulkpipe
	movq	(%rbx), %rdx
	movl	$32, %r15d
	leaq	-28(%rbp), %r8
	movl	%r14d, %edi
	movl	%eax, %esi
	movl	$32, %ecx
	movl	$500, %r9d                      ## imm = 0x1F4
	callq	_usb_bulk_msg
	testl	%eax, %eax
	js	LBB0_9
## %bb.12:
	movq	(%rbx), %rax
	movq	28(%rax), %xmm0                 ## xmm0 = mem[0],zero
	movq	40(%rax), %xmm1                 ## xmm1 = mem[0],zero
	paddd	%xmm0, %xmm1
	movq	52(%rax), %xmm0                 ## xmm0 = mem[0],zero
	movq	64(%rax), %xmm2                 ## xmm2 = mem[0],zero
	paddd	%xmm0, %xmm2
	paddd	%xmm1, %xmm2
	movq	76(%rax), %xmm0                 ## xmm0 = mem[0],zero
	movq	88(%rax), %xmm1                 ## xmm1 = mem[0],zero
	paddd	%xmm0, %xmm1
	movq	100(%rax), %xmm0                ## xmm0 = mem[0],zero
	paddd	%xmm1, %xmm0
	paddd	%xmm2, %xmm0
	movq	112(%rax), %xmm1                ## xmm1 = mem[0],zero
	paddd	%xmm0, %xmm1
	pextrd	$1, %xmm1, %ecx
	shll	$8, %ecx
	movd	%xmm1, %eax
	addl	%ecx, %eax
	cmpl	$640, 12(%rbx)                  ## imm = 0x280
	movl	$8, %ecx
	cmovel	%r15d, %ecx
	cltd
	idivl	%ecx
	movl	%eax, %r15d
	movq	%rbx, %rdi
	movl	$125, %esi
	xorl	%edx, %edx
	callq	_reg_w
	movl	8(%rbx), %edi
	callq	_v4l2_ctrl_g_ctrl
	movl	%eax, %r14d
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movl	$60, %edx
	movl	$6, %ecx
	movl	$2, %r8d
	movl	$70, %r9d
	callq	_gspca_expo_autogain
	movq	_AG_CNT_START@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	movl	4(%rbx), %eax
	movq	_BRIDGE_TP6810@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_18
## %bb.13:
	movl	8(%rbx), %edi
	callq	_v4l2_ctrl_g_ctrl
	cmpl	$128, %r14d
	jl	LBB0_15
## %bb.14:
	cmpl	$128, %eax
	jl	LBB0_17
LBB0_15:
	cmpl	$127, %r14d
	jg	LBB0_18
## %bb.16:
	cmpl	$128, %eax
	jl	LBB0_18
LBB0_17:
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_setframerate
	jmp	LBB0_18
LBB0_4:
	movq	%rbx, %rdi
	movl	$125, %esi
	xorl	%edx, %edx
	jmp	LBB0_5
LBB0_10:
	movq	%rbx, %rdi
	movl	$39, %esi
	movl	$208, %edx
	jmp	LBB0_5
LBB0_8:
	movl	16(%rbx), %r14d
	movl	%r14d, %edi
	movl	$2, %esi
	callq	_usb_rcvbulkpipe
	movq	(%rbx), %rdx
	leaq	-28(%rbp), %r8
	movl	%r14d, %edi
	movl	%eax, %esi
	movl	$32, %ecx
	movl	$500, %r9d                      ## imm = 0x1F4
	callq	_usb_bulk_msg
	testl	%eax, %eax
	jns	LBB0_18
LBB0_9:
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_pr_err
	jmp	LBB0_18
LBB0_7:
	movq	%rbx, %rdi
	movl	$12, %esi
	movl	$1, %edx
	jmp	LBB0_5
LBB0_6:
	movq	%rbx, %rdi
	movl	$39, %esi
	movl	$176, %edx
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_reg_w                          ## TAILCALL
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_11, LBB0_11-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
LJTI0_0:
	.long	L0_0_set_11
	.long	L0_0_set_10
	.long	L0_0_set_8
	.long	L0_0_set_7
	.long	L0_0_set_6
	.end_data_region
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bulk err %d\n"

	.comm	_AG_CNT_START,4,2               ## @AG_CNT_START
	.comm	_BRIDGE_TP6810,4,2              ## @BRIDGE_TP6810
	.no_dead_strip	_sd_dq_callback
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sd_dq_callback
_sd_dq_callback:                        ; @sd_dq_callback
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	ldr	w9, [x0]
	tbnz	w9, #31, LBB0_2
; %bb.1:
	mov	x19, x0
	sub	w8, w9, #1
	str	w8, [x0]
	cmp	w9, #6
	b.ls	LBB0_3
LBB0_2:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_3:
	cmp	w8, #4
	b.hi	LBB0_12
; %bb.4:
Lloh0:
	adrp	x9, lJTI0_0@PAGE
Lloh1:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_5
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_5:
	ldr	w20, [x19, #16]
	mov	x0, x20
	mov	w1, #2
	bl	_usb_rcvbulkpipe
	mov	x1, x0
	ldr	x2, [x19]
	mov	w21, #32
	add	x4, sp, #12
	mov	x0, x20
	mov	w3, #32
	mov	w5, #500
	bl	_usb_bulk_msg
	tbnz	w0, #31, LBB0_15
; %bb.6:
	ldr	x8, [x19]
	ldur	d0, [x8, #28]
	ldr	d1, [x8, #40]
	ldur	d2, [x8, #52]
	ldr	d3, [x8, #64]
	ldur	d4, [x8, #76]
	ldr	d5, [x8, #88]
	ldur	d6, [x8, #100]
	ldr	d7, [x8, #112]
	add.2s	v0, v1, v0
	add.2s	v0, v0, v2
	add.2s	v0, v0, v3
	add.2s	v0, v0, v4
	add.2s	v0, v0, v5
	add.2s	v0, v0, v6
	add.2s	v0, v0, v7
	mov.s	w8, v0[1]
	fmov	w9, s0
	add	w8, w9, w8, lsl #8
	ldr	w9, [x19, #12]
	mov	w10, #8
	cmp	w9, #640
	csel	w9, w21, w10, eq
	sdiv	w21, w8, w9
	mov	x0, x19
	mov	w1, #125
	mov	w2, #0
	bl	_reg_w
	ldr	w0, [x19, #8]
	bl	_v4l2_ctrl_g_ctrl
	mov	x20, x0
	mov	x0, x19
	mov	x1, x21
	mov	w2, #60
	mov	w3, #6
	mov	w4, #2
	mov	w5, #70
	bl	_gspca_expo_autogain
Lloh2:
	adrp	x8, _AG_CNT_START@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AG_CNT_START@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	str	w8, [x19]
	ldr	w8, [x19, #4]
Lloh5:
	adrp	x9, _BRIDGE_TP6810@GOTPAGE
Lloh6:
	ldr	x9, [x9, _BRIDGE_TP6810@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.7:
	ldr	w0, [x19, #8]
	bl	_v4l2_ctrl_g_ctrl
	mov	x1, x0
	cmp	w20, #128
	b.lt	LBB0_9
; %bb.8:
	cmp	w1, #128
	b.lt	LBB0_11
LBB0_9:
	cmp	w20, #127
	b.gt	LBB0_2
; %bb.10:
	cmp	w1, #128
	b.lt	LBB0_2
LBB0_11:
	mov	x0, x19
	bl	_setframerate
	b	LBB0_2
LBB0_12:
	mov	x0, x19
	mov	w1, #125
	mov	w2, #0
	b	LBB0_18
LBB0_13:
	mov	x0, x19
	mov	w1, #39
	mov	w2, #208
	b	LBB0_18
LBB0_14:
	ldr	w20, [x19, #16]
	mov	x0, x20
	mov	w1, #2
	bl	_usb_rcvbulkpipe
	mov	x1, x0
	ldr	x2, [x19]
	add	x4, sp, #12
	mov	x0, x20
	mov	w3, #32
	mov	w5, #500
	bl	_usb_bulk_msg
	tbz	w0, #31, LBB0_2
LBB0_15:
	mov	x1, x0
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
	b	LBB0_2
LBB0_16:
	mov	x0, x19
	mov	w1, #12
	mov	w2, #1
	b	LBB0_18
LBB0_17:
	mov	x0, x19
	mov	w1, #39
	mov	w2, #176
LBB0_18:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	b	_reg_w
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_5-LBB0_5)>>2
	.byte	(LBB0_13-LBB0_5)>>2
	.byte	(LBB0_14-LBB0_5)>>2
	.byte	(LBB0_16-LBB0_5)>>2
	.byte	(LBB0_17-LBB0_5)>>2
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bulk err %d\n"

	.comm	_AG_CNT_START,4,2               ; @AG_CNT_START
	.comm	_BRIDGE_TP6810,4,2              ; @BRIDGE_TP6810
	.no_dead_strip	_sd_dq_callback
.subsections_via_symbols
