	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function reg_r
_reg_r:                                 ## @reg_r
	.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, %r14
	movq	_USB_BUF_SZ@GOTPCREL(%rip), %rax
	cmpq	%rcx, (%rax)
	jge	LBB0_1
## %bb.7:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_gspca_err                      ## TAILCALL
LBB0_1:
	cmpl	$0, (%r14)
	js	LBB0_6
## %bb.2:
	movq	%rcx, %rbx
	movq	%rdx, %r15
	movl	%esi, %r12d
	movl	16(%r14), %r13d
	movl	%r13d, %edi
	xorl	%esi, %esi
	callq	_usb_rcvctrlpipe
	movq	_USB_DIR_IN@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
	testq	%rbx, %rbx
	je	LBB0_3
## %bb.4:
	movq	8(%r14), %r10
	jmp	LBB0_5
LBB0_3:
	xorl	%r10d, %r10d
LBB0_5:
	subq	$8, %rsp
	movl	%r13d, %edi
	movl	%eax, %esi
	movl	%r12d, %edx
	xorl	%r8d, %r8d
	movq	%r15, %r9
	pushq	$500                            ## imm = 0x1F4
	pushq	%rbx
	pushq	%r10
	callq	_usb_control_msg
	addq	$32, %rsp
	testl	%eax, %eax
	js	LBB0_8
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	callq	_pr_err
	movl	%ebx, (%r14)
	movq	8(%r14), %rdi
	movq	_USB_BUF_SZ@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	xorl	%esi, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_memset                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_USB_BUF_SZ,8,3                 ## @USB_BUF_SZ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"reg_r: buffer overflow\n"

	.comm	_USB_DIR_IN,4,2                 ## @USB_DIR_IN
	.comm	_USB_TYPE_VENDOR,4,2            ## @USB_TYPE_VENDOR
	.comm	_USB_RECIP_DEVICE,4,2           ## @USB_RECIP_DEVICE
L_.str.1:                               ## @.str.1
	.asciz	"reg_r err %d\n"

	.no_dead_strip	_reg_r
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function reg_r
_reg_r:                                 ; @reg_r
	.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, x0
Lloh0:
	adrp	x24, _USB_BUF_SZ@GOTPAGE
Lloh1:
	ldr	x24, [x24, _USB_BUF_SZ@GOTPAGEOFF]
	ldr	x8, [x24]
	cmp	x8, x3
	b.ge	LBB0_2
; %bb.1:
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	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:
	ldr	w8, [x19]
	tbnz	w8, #31, LBB0_7
; %bb.3:
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	ldr	w23, [x19, #16]
	mov	x0, x23
	mov	w1, #0
	bl	_usb_rcvctrlpipe
	mov	x1, x0
Lloh4:
	adrp	x8, _USB_DIR_IN@GOTPAGE
Lloh5:
	ldr	x8, [x8, _USB_DIR_IN@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
Lloh7:
	adrp	x9, _USB_TYPE_VENDOR@GOTPAGE
Lloh8:
	ldr	x9, [x9, _USB_TYPE_VENDOR@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh10:
	adrp	x9, _USB_RECIP_DEVICE@GOTPAGE
Lloh11:
	ldr	x9, [x9, _USB_RECIP_DEVICE@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	orr	w3, w8, w9
	cbz	x20, LBB0_5
; %bb.4:
	ldr	x6, [x19, #8]
	b	LBB0_6
LBB0_5:
	mov	x6, #0
LBB0_6:
	mov	w8, #500
	str	w8, [sp]
	mov	x0, x23
	mov	x2, x22
	mov	w4, #0
	mov	x5, x21
	mov	x7, x20
	bl	_usb_control_msg
	tbnz	w0, #31, LBB0_8
LBB0_7:
	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
LBB0_8:
	mov	x20, x0
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	bl	_pr_err
	str	w20, [x19]
	ldr	x0, [x19, #8]
	ldr	x2, [x24]
	mov	w1, #0
	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	_memset
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_USB_BUF_SZ,8,3                 ; @USB_BUF_SZ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"reg_r: buffer overflow\n"

	.comm	_USB_DIR_IN,4,2                 ; @USB_DIR_IN
	.comm	_USB_TYPE_VENDOR,4,2            ; @USB_TYPE_VENDOR
	.comm	_USB_RECIP_DEVICE,4,2           ; @USB_RECIP_DEVICE
l_.str.1:                               ; @.str.1
	.asciz	"reg_r err %d\n"

	.no_dead_strip	_reg_r
.subsections_via_symbols
