	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ov518_set_packet_size
_ov518_set_packet_size:                 ## @ov518_set_packet_size
	.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, %rbx
	callq	_ov51x_stop
	testq	%rax, %rax
	js	LBB0_14
## %bb.1:
	movq	(%rbx), %rax
	movq	_BCL_OV518@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.2:
	movl	%r14d, %eax
	roll	$25, %eax
	cmpl	$8, %eax
	jae	LBB0_3
## %bb.6:
	cltq
	leaq	l_switch.table.ov518_set_packet_size(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	movl	(%rax), %r15d
	leaq	L_.str.2(%rip), %rsi
	movl	$3, %edi
	movl	%r14d, %edx
	movl	%r15d, %ecx
	callq	_PDEBUG
	movl	%r14d, 8(%rbx)
	testl	%r14d, %r14d
	jle	LBB0_9
## %bb.7:
	movq	%rbx, %rdi
	movl	$48, %esi
	movl	%r14d, %edx
	movl	$2, %ecx
	callq	_ov518_reg_w32
	cmpq	$0, 24(%rbx)
	je	LBB0_9
## %bb.8:
	incl	8(%rbx)
LBB0_9:
	movl	12(%rbx), %esi
	movl	16(%rbx), %edi
	movl	%r15d, %edx
	callq	_usb_set_interface
	testq	%rax, %rax
	js	LBB0_10
## %bb.11:
	movq	%rbx, %rdi
	movl	$47, %esi
	movl	$128, %edx
	callq	_reg_w
	testq	%rax, %rax
	js	LBB0_14
## %bb.12:
	movq	%rbx, %rdi
	callq	_ov51x_restart
	testq	%rax, %rax
	js	LBB0_14
## %bb.13:
	movq	_OV511_RESET_NOREGS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_ov51x_reset
	xorl	%ebx, %ebx
	testq	%rax, %rax
	jns	LBB0_16
LBB0_14:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	jmp	LBB0_15
LBB0_4:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_3:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_10:
	leaq	L_.str.3(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_err
	movq	_EBUSY@GOTPCREL(%rip), %rax
LBB0_15:
	subl	(%rax), %ebx
LBB0_16:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.comm	_BCL_OV518,8,3                  ## @BCL_OV518
	.comm	_OV518_ALT_SIZE_0,4,2           ## @OV518_ALT_SIZE_0
	.comm	_OV518_ALT_SIZE_128,4,2         ## @OV518_ALT_SIZE_128
	.comm	_OV518_ALT_SIZE_256,4,2         ## @OV518_ALT_SIZE_256
	.comm	_OV518_ALT_SIZE_384,4,2         ## @OV518_ALT_SIZE_384
	.comm	_OV518_ALT_SIZE_512,4,2         ## @OV518_ALT_SIZE_512
	.comm	_OV518_ALT_SIZE_640,4,2         ## @OV518_ALT_SIZE_640
	.comm	_OV518_ALT_SIZE_768,4,2         ## @OV518_ALT_SIZE_768
	.comm	_OV518_ALT_SIZE_896,4,2         ## @OV518_ALT_SIZE_896
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Set packet size: invalid size (%d)"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Set packet size: Invalid bridge type"

L_.str.2:                               ## @.str.2
	.asciz	"%d, alt=%d"

L_.str.3:                               ## @.str.3
	.asciz	"Set packet size: set interface error"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_OV511_RESET_NOREGS,4,2         ## @OV511_RESET_NOREGS
	.no_dead_strip	_ov518_set_packet_size
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.ov518_set_packet_size
l_switch.table.ov518_set_packet_size:
	.quad	_OV518_ALT_SIZE_0
	.quad	_OV518_ALT_SIZE_128
	.quad	_OV518_ALT_SIZE_256
	.quad	_OV518_ALT_SIZE_384
	.quad	_OV518_ALT_SIZE_512
	.quad	_OV518_ALT_SIZE_640
	.quad	_OV518_ALT_SIZE_768
	.quad	_OV518_ALT_SIZE_896

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ov518_set_packet_size
_ov518_set_packet_size:                 ; @ov518_set_packet_size
	.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
	mov	x20, x1
	mov	x19, x0
	bl	_ov51x_stop
	tbnz	x0, #63, LBB0_11
; %bb.1:
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _BCL_OV518@GOTPAGE
Lloh1:
	ldr	x9, [x9, _BCL_OV518@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.2:
	ror	w8, w20, #7
	cmp	w8, #8
	b.hs	LBB0_13
; %bb.3:
Lloh3:
	adrp	x9, l_switch.table.ov518_set_packet_size@PAGE
Lloh4:
	add	x9, x9, l_switch.table.ov518_set_packet_size@PAGEOFF
	ldr	x8, [x9, w8, sxtw #3]
	ldr	w21, [x8]
Lloh5:
	adrp	x1, l_.str.2@PAGE
Lloh6:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #3
	mov	x2, x20
	mov	x3, x21
	bl	_PDEBUG
	str	w20, [x19, #8]
	cmp	w20, #1
	b.lt	LBB0_6
; %bb.4:
	mov	x0, x19
	mov	w1, #48
	mov	x2, x20
	mov	w3, #2
	bl	_ov518_reg_w32
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_6
; %bb.5:
	ldr	w8, [x19, #8]
	add	w8, w8, #1
	str	w8, [x19, #8]
LBB0_6:
	ldp	w1, w0, [x19, #12]
	mov	x2, x21
	bl	_usb_set_interface
	tbnz	x0, #63, LBB0_17
; %bb.7:
	mov	x0, x19
	mov	w1, #47
	mov	w2, #128
	bl	_reg_w
	tbnz	x0, #63, LBB0_11
; %bb.8:
	mov	x0, x19
	bl	_ov51x_restart
	tbnz	x0, #63, LBB0_11
; %bb.9:
Lloh7:
	adrp	x8, _OV511_RESET_NOREGS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _OV511_RESET_NOREGS@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ov51x_reset
	tbnz	x0, #63, LBB0_11
; %bb.10:
	mov	w0, #0
	b	LBB0_16
LBB0_11:
Lloh10:
	adrp	x8, _EIO@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_15
LBB0_12:
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_14
LBB0_13:
	str	x20, [sp]
Lloh14:
	adrp	x0, l_.str@PAGE
Lloh15:
	add	x0, x0, l_.str@PAGEOFF
LBB0_14:
	bl	_err
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_15:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_16:
	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_17:
Lloh18:
	adrp	x0, l_.str.3@PAGE
Lloh19:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_err
Lloh20:
	adrp	x8, _EBUSY@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_15
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.comm	_BCL_OV518,8,3                  ; @BCL_OV518
	.comm	_OV518_ALT_SIZE_0,4,2           ; @OV518_ALT_SIZE_0
	.comm	_OV518_ALT_SIZE_128,4,2         ; @OV518_ALT_SIZE_128
	.comm	_OV518_ALT_SIZE_256,4,2         ; @OV518_ALT_SIZE_256
	.comm	_OV518_ALT_SIZE_384,4,2         ; @OV518_ALT_SIZE_384
	.comm	_OV518_ALT_SIZE_512,4,2         ; @OV518_ALT_SIZE_512
	.comm	_OV518_ALT_SIZE_640,4,2         ; @OV518_ALT_SIZE_640
	.comm	_OV518_ALT_SIZE_768,4,2         ; @OV518_ALT_SIZE_768
	.comm	_OV518_ALT_SIZE_896,4,2         ; @OV518_ALT_SIZE_896
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Set packet size: invalid size (%d)"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Set packet size: Invalid bridge type"

l_.str.2:                               ; @.str.2
	.asciz	"%d, alt=%d"

l_.str.3:                               ; @.str.3
	.asciz	"Set packet size: set interface error"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_OV511_RESET_NOREGS,4,2         ; @OV511_RESET_NOREGS
	.no_dead_strip	_ov518_set_packet_size
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.ov518_set_packet_size
l_switch.table.ov518_set_packet_size:
	.quad	_OV518_ALT_SIZE_0
	.quad	_OV518_ALT_SIZE_128
	.quad	_OV518_ALT_SIZE_256
	.quad	_OV518_ALT_SIZE_384
	.quad	_OV518_ALT_SIZE_512
	.quad	_OV518_ALT_SIZE_640
	.quad	_OV518_ALT_SIZE_768
	.quad	_OV518_ALT_SIZE_896

.subsections_via_symbols
