	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function reg_w
_reg_w:                                 ## @reg_w
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_USB_BUF_SZ@GOTPCREL(%rip), %rax
	cmpq	%rcx, (%rax)
	jge	LBB0_1
## %bb.2:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_gspca_err                      ## TAILCALL
LBB0_1:
	movq	%rcx, %r15
	movq	%rdx, %r13
	movq	%rsi, %r14
	movq	8(%rbx), %r12
	movq	_D_USBO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rdx), %r8d
	leaq	L_.str.1(%rip), %rdx
	movq	%rbx, %rdi
	movq	%r14, %rcx
	callq	_gspca_dbg
	movl	(%rbx), %edi
	movq	%r13, %rsi
	movq	%r15, %rdx
	callq	_memcpy
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_usb_sndctrlpipe
	movq	_USB_DIR_OUT@GOTPCREL(%rip), %rdx
	movq	_USB_TYPE_VENDOR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rdx), %ecx
	movq	_USB_RECIP_DEVICE@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	movl	(%rbx), %ebx
	subq	$8, %rsp
	movq	%r12, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	movq	%r14, %r9
	pushq	$500                            ## imm = 0x1F4
	pushq	%r15
	pushq	%rbx
	callq	_usb_control_msg
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_USB_BUF_SZ,8,3                 ## @USB_BUF_SZ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"reg_w: buffer overflow\n"

	.comm	_D_USBO,4,2                     ## @D_USBO
L_.str.1:                               ## @.str.1
	.asciz	"reg write [%02x] = %02x..\n"

	.comm	_USB_DIR_OUT,4,2                ## @USB_DIR_OUT
	.comm	_USB_TYPE_VENDOR,4,2            ## @USB_TYPE_VENDOR
	.comm	_USB_RECIP_DEVICE,4,2           ## @USB_RECIP_DEVICE
	.no_dead_strip	_reg_w
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function reg_w
_reg_w:                                 ; @reg_w
	.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	x21, x0
Lloh0:
	adrp	x8, _USB_BUF_SZ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _USB_BUF_SZ@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x3
	b.ge	LBB0_2
; %bb.1:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	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
	b	_gspca_err
LBB0_2:
	mov	x19, x3
	mov	x22, x2
	mov	x20, x1
	ldr	x23, [x21, #8]
Lloh5:
	adrp	x8, _D_USBO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _D_USBO@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	ldr	w4, [x2]
Lloh8:
	adrp	x2, l_.str.1@PAGE
Lloh9:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x21
	mov	x3, x20
	bl	_gspca_dbg
	ldr	w0, [x21]
	mov	x1, x22
	mov	x2, x19
	bl	_memcpy
	mov	x0, x23
	mov	w1, #0
	bl	_usb_sndctrlpipe
	mov	x1, x0
Lloh10:
	adrp	x8, _USB_DIR_OUT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _USB_DIR_OUT@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	adrp	x9, _USB_TYPE_VENDOR@GOTPAGE
Lloh14:
	ldr	x9, [x9, _USB_TYPE_VENDOR@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh16:
	adrp	x9, _USB_RECIP_DEVICE@GOTPAGE
Lloh17:
	ldr	x9, [x9, _USB_RECIP_DEVICE@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	orr	w3, w8, w9
	ldr	w6, [x21]
	mov	w8, #500
	str	w8, [sp]
	mov	x0, x23
	mov	w2, #0
	mov	w4, #0
	mov	x5, x20
	mov	x7, x19
	bl	_usb_control_msg
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_USB_BUF_SZ,8,3                 ; @USB_BUF_SZ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"reg_w: buffer overflow\n"

	.comm	_D_USBO,4,2                     ; @D_USBO
l_.str.1:                               ; @.str.1
	.asciz	"reg write [%02x] = %02x..\n"

	.comm	_USB_DIR_OUT,4,2                ; @USB_DIR_OUT
	.comm	_USB_TYPE_VENDOR,4,2            ; @USB_TYPE_VENDOR
	.comm	_USB_RECIP_DEVICE,4,2           ; @USB_RECIP_DEVICE
	.no_dead_strip	_reg_w
.subsections_via_symbols
