	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ov518_mode_init_regs
_ov518_mode_init_regs:                  ## @ov518_mode_init_regs
	.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
	movq	%rdi, %r13
	movl	40(%rdi), %esi
	movl	44(%rdi), %edi
	callq	_usb_ifnum_to_if
	movl	36(%r13), %esi
	movq	%rax, %rdi
	callq	_usb_altnum_to_altsetting
	testq	%rax, %rax
	je	LBB0_18
## %bb.1:
	movq	(%rax), %rax
	movl	(%rax), %edi
	callq	_le16_to_cpu
	movq	_R51x_FIFO_PSIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	andl	$-8, %eax
	movq	%r13, %rdi
	movl	%eax, %edx
	movl	$2, %ecx
	callq	_ov518_reg_w32
	movq	%r13, %rdi
	movl	$43, %esi
	xorl	%edx, %edx
	callq	_reg_w
	movq	%r13, %rdi
	movl	$44, %esi
	xorl	%edx, %edx
	callq	_reg_w
	movq	%r13, %rdi
	movl	$45, %esi
	xorl	%edx, %edx
	callq	_reg_w
	movq	%r13, %rdi
	movl	$46, %esi
	xorl	%edx, %edx
	callq	_reg_w
	movq	%r13, %rdi
	movl	$59, %esi
	xorl	%edx, %edx
	callq	_reg_w
	movq	%r13, %rdi
	movl	$60, %esi
	xorl	%edx, %edx
	callq	_reg_w
	movq	%r13, %rdi
	movl	$61, %esi
	xorl	%edx, %edx
	callq	_reg_w
	movq	%r13, %rdi
	movl	$62, %esi
	xorl	%edx, %edx
	callq	_reg_w
	movq	(%r13), %rax
	movq	_BRIDGE_OV518@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.2:
	movq	%r13, %rdi
	movl	$32, %esi
	movl	$8, %edx
	movl	$8, %ecx
	callq	_reg_w_mask
	movq	%r13, %rdi
	movl	$40, %esi
	movl	$128, %edx
	movl	$240, %ecx
	callq	_reg_w_mask
	movq	%r13, %rdi
	movl	$56, %esi
	movl	$128, %edx
	movl	$240, %ecx
	callq	_reg_w_mask
	jmp	LBB0_4
LBB0_18:
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	callq	_gspca_err
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, 32(%r13)
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%r13, %rdi
	movl	$40, %esi
	movl	$128, %edx
	callq	_reg_w
	movq	%r13, %rdi
	movl	$56, %esi
	movl	$128, %edx
	callq	_reg_w
LBB0_4:
	movl	24(%r13), %eax
	movl	28(%r13), %ecx
	leal	15(%rax), %ebx
	testl	%eax, %eax
	cmovnsl	%eax, %ebx
	sarl	$4, %ebx
	leal	3(%rcx), %r14d
	testl	%ecx, %ecx
	cmovnsl	%ecx, %r14d
	sarl	$2, %r14d
	movq	%r13, %rdi
	movl	$41, %esi
	movl	%ebx, %edx
	callq	_reg_w
	movq	%r13, %rdi
	movl	$42, %esi
	movl	%r14d, %edx
	callq	_reg_w
	movq	%r13, %rdi
	movl	$57, %esi
	movl	%ebx, %edx
	callq	_reg_w
	movq	%r13, %rdi
	movl	$58, %esi
	movl	%r14d, %edx
	callq	_reg_w
	movq	%r13, %rdi
	movl	$47, %esi
	movl	$128, %edx
	callq	_reg_w
	movq	(%r13), %rax
	movq	_BRIDGE_OV518PLUS@GOTPCREL(%rip), %r14
	cmpq	(%r14), %rax
	jne	LBB0_7
## %bb.5:
	cmpq	$0, 8(%r13)
	jne	LBB0_7
## %bb.6:
	xorl	%eax, %eax
	cmpl	$128, 16(%r13)
	je	LBB0_8
LBB0_7:
	movl	$1, %eax
LBB0_8:
	movl	%eax, 20(%r13)
	movq	%r13, %rdi
	movl	$81, %esi
	movl	$4, %edx
	callq	_reg_w
	movq	%r13, %rdi
	movl	$34, %esi
	movl	$24, %edx
	callq	_reg_w
	movq	%r13, %rdi
	movl	$35, %esi
	movl	$255, %edx
	callq	_reg_w
	movq	(%r13), %rax
	cmpq	(%r14), %rax
	jne	LBB0_16
## %bb.9:
	movl	16(%r13), %eax
	cmpl	$129, %eax
	je	LBB0_14
## %bb.10:
	cmpl	$128, %eax
	jne	LBB0_15
## %bb.11:
	cmpq	$0, 8(%r13)
	jle	LBB0_14
## %bb.12:
	cmpl	$640, 24(%r13)                  ## imm = 0x280
	jne	LBB0_14
## %bb.13:
	movq	%r13, %rdi
	movl	$32, %esi
	movl	$96, %edx
	callq	_reg_w
	movq	%r13, %rdi
	movl	$33, %esi
	movl	$31, %edx
	jmp	LBB0_17
LBB0_16:
	movq	%r13, %rdi
	movl	$113, %esi
	movl	$23, %edx
	jmp	LBB0_17
LBB0_14:
	movq	%r13, %rdi
	movl	$32, %esi
	xorl	%edx, %edx
	callq	_reg_w
LBB0_15:
	movq	%r13, %rdi
	movl	$33, %esi
	movl	$25, %edx
LBB0_17:
	callq	_reg_w
	movq	%r13, %rdi
	movl	$84, %esi
	movl	$35, %edx
	callq	_i2c_w
	movl	$128, %ebx
	movq	%r13, %rdi
	movl	$47, %esi
	movl	$128, %edx
	callq	_reg_w
	movq	(%r13), %rax
	cmpq	(%r14), %rax
	movl	$148, %eax
	movl	$159, %edx
	cmovel	%eax, %edx
	movl	$540, %eax                      ## imm = 0x21C
	movl	$381, %r12d                     ## imm = 0x17D
	cmovel	%eax, %r12d
	movl	$108, %r15d
	cmovnel	%ebx, %r15d
	movl	$131098, %eax                   ## imm = 0x2001A
	movl	$183331, %r14d                  ## imm = 0x2CC23
	cmovel	%eax, %r14d
	movl	$532, %eax                      ## imm = 0x214
	movl	$746, %ebx                      ## imm = 0x2EA
	cmovel	%eax, %ebx
	movl	$2400, %eax                     ## imm = 0x960
	movl	$1750, %ecx                     ## imm = 0x6D6
	cmovel	%eax, %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	$32, %eax
	movl	$45, %ecx
	cmovel	%eax, %ecx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movl	$608, %eax                      ## imm = 0x260
	movl	$851, %ecx                      ## imm = 0x353
	cmovel	%eax, %ecx
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movq	%r13, %rdi
	movl	$36, %esi
	callq	_reg_w
	movq	%r13, %rdi
	movl	$37, %esi
	movl	$144, %edx
	callq	_reg_w
	movq	%r13, %rdi
	movl	$196, %esi
	movl	$400, %edx                      ## imm = 0x190
	movl	$2, %ecx
	callq	_ov518_reg_w32
	movq	%r13, %rdi
	movl	$198, %esi
	movl	%r12d, %edx
	movl	$2, %ecx
	callq	_ov518_reg_w32
	movq	%r13, %rdi
	movl	$199, %esi
	movl	%r12d, %edx
	movl	$2, %ecx
	callq	_ov518_reg_w32
	movq	%r13, %rdi
	movl	$200, %esi
	movl	%r15d, %edx
	movl	$2, %ecx
	callq	_ov518_reg_w32
	movq	%r13, %rdi
	movl	$202, %esi
	movl	%r14d, %edx
	movl	$3, %ecx
	callq	_ov518_reg_w32
	movq	%r13, %rdi
	movl	$203, %esi
	movl	%ebx, %edx
	movl	$2, %ecx
	callq	_ov518_reg_w32
	movq	%r13, %rdi
	movl	$204, %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	$2, %ecx
	callq	_ov518_reg_w32
	movq	%r13, %rdi
	movl	$205, %esi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	$2, %ecx
	callq	_ov518_reg_w32
	movq	%r13, %rdi
	movl	$206, %esi
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	movl	$2, %ecx
	callq	_ov518_reg_w32
	movq	%r13, %rdi
	movl	$47, %esi
	movl	$128, %edx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_reg_w                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Couldn't get altsetting\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_R51x_FIFO_PSIZE,4,2            ## @R51x_FIFO_PSIZE
	.comm	_BRIDGE_OV518,8,3               ## @BRIDGE_OV518
	.comm	_BRIDGE_OV518PLUS,8,3           ## @BRIDGE_OV518PLUS
	.no_dead_strip	_ov518_mode_init_regs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ov518_mode_init_regs
_ov518_mode_init_regs:                  ; @ov518_mode_init_regs
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	ldr	w0, [x0, #44]
	ldr	w1, [x19, #40]
	bl	_usb_ifnum_to_if
	ldr	w1, [x19, #36]
	bl	_usb_altnum_to_altsetting
	cbz	x0, LBB0_3
; %bb.1:
	ldr	x8, [x0]
	ldr	w0, [x8]
	bl	_le16_to_cpu
Lloh0:
	adrp	x8, _R51x_FIFO_PSIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _R51x_FIFO_PSIZE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	and	w2, w0, #0xfffffff8
	mov	x0, x19
	mov	w3, #2
	bl	_ov518_reg_w32
	mov	x0, x19
	mov	w1, #43
	mov	w2, #0
	bl	_reg_w
	mov	x0, x19
	mov	w1, #44
	mov	w2, #0
	bl	_reg_w
	mov	x0, x19
	mov	w1, #45
	mov	w2, #0
	bl	_reg_w
	mov	x0, x19
	mov	w1, #46
	mov	w2, #0
	bl	_reg_w
	mov	x0, x19
	mov	w1, #59
	mov	w2, #0
	bl	_reg_w
	mov	x0, x19
	mov	w1, #60
	mov	w2, #0
	bl	_reg_w
	mov	x0, x19
	mov	w1, #61
	mov	w2, #0
	bl	_reg_w
	mov	x0, x19
	mov	w1, #62
	mov	w2, #0
	bl	_reg_w
	ldr	x8, [x19]
Lloh3:
	adrp	x9, _BRIDGE_OV518@GOTPAGE
Lloh4:
	ldr	x9, [x9, _BRIDGE_OV518@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	mov	x0, x19
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.2:
	mov	w1, #32
	mov	w2, #8
	mov	w3, #8
	bl	_reg_w_mask
	mov	x0, x19
	mov	w1, #40
	mov	w2, #128
	mov	w3, #240
	bl	_reg_w_mask
	mov	x0, x19
	mov	w1, #56
	mov	w2, #128
	mov	w3, #240
	bl	_reg_w_mask
	b	LBB0_5
LBB0_3:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_gspca_err
Lloh8:
	adrp	x8, _EIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w8, w8
	str	w8, [x19, #32]
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_4:
	mov	w1, #40
	mov	w2, #128
	bl	_reg_w
	mov	x0, x19
	mov	w1, #56
	mov	w2, #128
	bl	_reg_w
LBB0_5:
	ldp	w8, w9, [x19, #24]
	add	w10, w8, #15
	cmp	w8, #0
	csel	w8, w10, w8, lt
	asr	w20, w8, #4
	add	w8, w9, #3
	cmp	w9, #0
	csel	w8, w8, w9, lt
	asr	w21, w8, #2
	mov	x0, x19
	mov	w1, #41
	mov	x2, x20
	bl	_reg_w
	mov	x0, x19
	mov	w1, #42
	mov	x2, x21
	bl	_reg_w
	mov	x0, x19
	mov	w1, #57
	mov	x2, x20
	bl	_reg_w
	mov	x0, x19
	mov	w1, #58
	mov	x2, x21
	bl	_reg_w
	mov	x0, x19
	mov	w1, #47
	mov	w2, #128
	bl	_reg_w
	ldr	x8, [x19]
Lloh11:
	adrp	x20, _BRIDGE_OV518PLUS@GOTPAGE
Lloh12:
	ldr	x20, [x20, _BRIDGE_OV518PLUS@GOTPAGEOFF]
	ldr	x9, [x20]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.6:
	ldr	x8, [x19, #8]
	cbnz	x8, LBB0_9
; %bb.7:
	ldr	w8, [x19, #16]
	cmp	w8, #128
	b.ne	LBB0_9
; %bb.8:
	mov	w8, #0
	b	LBB0_10
LBB0_9:
	mov	w8, #1
LBB0_10:
	str	w8, [x19, #20]
	mov	x0, x19
	mov	w1, #81
	mov	w2, #4
	bl	_reg_w
	mov	x0, x19
	mov	w1, #34
	mov	w2, #24
	bl	_reg_w
	mov	x0, x19
	mov	w1, #35
	mov	w2, #255
	bl	_reg_w
	ldr	x8, [x19]
	ldr	x9, [x20]
	cmp	x8, x9
	b.ne	LBB0_16
; %bb.11:
	ldr	w8, [x19, #16]
	cmp	w8, #129
	b.eq	LBB0_17
; %bb.12:
	cmp	w8, #128
	b.ne	LBB0_18
; %bb.13:
	ldr	x8, [x19, #8]
	cmp	x8, #1
	b.lt	LBB0_17
; %bb.14:
	ldr	w8, [x19, #24]
	cmp	w8, #640
	b.ne	LBB0_17
; %bb.15:
	mov	x0, x19
	mov	w1, #32
	mov	w2, #96
	bl	_reg_w
	mov	x0, x19
	mov	w1, #33
	mov	w2, #31
	b	LBB0_19
LBB0_16:
	mov	x0, x19
	mov	w1, #113
	mov	w2, #23
	b	LBB0_19
LBB0_17:
	mov	x0, x19
	mov	w1, #32
	mov	w2, #0
	bl	_reg_w
LBB0_18:
	mov	x0, x19
	mov	w1, #33
	mov	w2, #25
LBB0_19:
	bl	_reg_w
	mov	x0, x19
	mov	w1, #84
	mov	w2, #35
	bl	_i2c_w
	mov	w21, #128
	mov	x0, x19
	mov	w1, #47
	mov	w2, #128
	bl	_reg_w
	ldr	x8, [x19]
	ldr	x9, [x20]
	cmp	x8, x9
	mov	w8, #159
	mov	w9, #148
	csel	w2, w9, w8, eq
	mov	w8, #381
	mov	w9, #540
	csel	w26, w9, w8, eq
	mov	w8, #108
	csel	w25, w8, w21, eq
	mov	w8, #52259
	movk	w8, #2, lsl #16
	mov	w9, #26
	movk	w9, #2, lsl #16
	csel	w24, w9, w8, eq
	mov	w8, #746
	mov	w9, #532
	csel	w23, w9, w8, eq
	mov	w8, #1750
	mov	w9, #2400
	csel	w22, w9, w8, eq
	mov	w8, #45
	mov	w9, #32
	csel	w21, w9, w8, eq
	mov	w8, #851
	mov	w9, #608
	csel	w20, w9, w8, eq
	mov	x0, x19
	mov	w1, #36
	bl	_reg_w
	mov	x0, x19
	mov	w1, #37
	mov	w2, #144
	bl	_reg_w
	mov	x0, x19
	mov	w1, #196
	mov	w2, #400
	mov	w3, #2
	bl	_ov518_reg_w32
	mov	x0, x19
	mov	w1, #198
	mov	x2, x26
	mov	w3, #2
	bl	_ov518_reg_w32
	mov	x0, x19
	mov	w1, #199
	mov	x2, x26
	mov	w3, #2
	bl	_ov518_reg_w32
	mov	x0, x19
	mov	w1, #200
	mov	x2, x25
	mov	w3, #2
	bl	_ov518_reg_w32
	mov	x0, x19
	mov	w1, #202
	mov	x2, x24
	mov	w3, #3
	bl	_ov518_reg_w32
	mov	x0, x19
	mov	w1, #203
	mov	x2, x23
	mov	w3, #2
	bl	_ov518_reg_w32
	mov	x0, x19
	mov	w1, #204
	mov	x2, x22
	mov	w3, #2
	bl	_ov518_reg_w32
	mov	x0, x19
	mov	w1, #205
	mov	x2, x21
	mov	w3, #2
	bl	_ov518_reg_w32
	mov	x0, x19
	mov	w1, #206
	mov	x2, x20
	mov	w3, #2
	bl	_ov518_reg_w32
	mov	x0, x19
	mov	w1, #47
	mov	w2, #128
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_reg_w
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Couldn't get altsetting\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_R51x_FIFO_PSIZE,4,2            ; @R51x_FIFO_PSIZE
	.comm	_BRIDGE_OV518,8,3               ; @BRIDGE_OV518
	.comm	_BRIDGE_OV518PLUS,8,3           ; @BRIDGE_OV518PLUS
	.no_dead_strip	_ov518_mode_init_regs
.subsections_via_symbols
