	.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
	cmpl	$0, (%rdi)
	js	LBB0_3
## %bb.1:
	movl	%edx, %r15d
	movq	%rdi, %rbx
	movq	_USB_BUF_SZ@GOTPCREL(%rip), %r13
	cmpl	%edx, (%r13)
	jge	LBB0_2
## %bb.4:
	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_2:
	movl	%esi, %r14d
	movl	16(%rbx), %r12d
	movl	%r12d, %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_INTERFACE@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	subq	$8, %rsp
	movl	%r12d, %edi
	movl	%eax, %esi
	xorl	%edx, %edx
	movl	%r14d, %r8d
	xorl	%r9d, %r9d
	pushq	$500                            ## imm = 0x1F4
	pushq	%r15
	pushq	8(%rbx)
	callq	_usb_control_msg
	addq	$32, %rsp
	movl	%eax, %r15d
	movq	_D_USBI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	8(%rbx), %rax
	movl	(%rax), %r8d
	leaq	L_.str.1(%rip), %rdx
	movq	%rbx, %rdi
	movl	%r14d, %ecx
	callq	_gspca_dbg
	testl	%r15d, %r15d
	js	LBB0_5
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	leaq	L_.str.2(%rip), %rdi
	movl	%r15d, %esi
	callq	_pr_err
	movl	%r15d, (%rbx)
	movq	8(%rbx), %rdi
	movl	(%r13), %edx
	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,4,2                 ## @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_INTERFACE,4,2        ## @USB_RECIP_INTERFACE
	.comm	_D_USBI,4,2                     ## @D_USBI
L_.str.1:                               ## @.str.1
	.asciz	"reg_r [%02x] -> %02x\n"

L_.str.2:                               ## @.str.2
	.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
	ldr	w8, [x0]
	tbnz	w8, #31, LBB0_4
; %bb.1:
	mov	x21, x2
	mov	x19, x0
Lloh0:
	adrp	x23, _USB_BUF_SZ@GOTPAGE
Lloh1:
	ldr	x23, [x23, _USB_BUF_SZ@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, w2
	b.ge	LBB0_3
; %bb.2:
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_3:
	mov	x20, x1
	ldr	w22, [x19, #16]
	mov	x0, x22
	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_INTERFACE@GOTPAGE
Lloh11:
	ldr	x9, [x9, _USB_RECIP_INTERFACE@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	orr	w3, w8, w9
	ldr	x6, [x19, #8]
	mov	w8, #500
	str	w8, [sp]
	mov	x0, x22
	mov	w2, #0
	mov	x4, x20
	mov	w5, #0
	mov	x7, x21
	bl	_usb_control_msg
	mov	x21, x0
Lloh13:
	adrp	x8, _D_USBI@GOTPAGE
Lloh14:
	ldr	x8, [x8, _D_USBI@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	ldr	x8, [x19, #8]
	ldr	w4, [x8]
Lloh16:
	adrp	x2, l_.str.1@PAGE
Lloh17:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x3, x20
	bl	_gspca_dbg
	tbnz	w21, #31, LBB0_5
LBB0_4:
	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_5:
Lloh18:
	adrp	x0, l_.str.2@PAGE
Lloh19:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x21
	bl	_pr_err
	str	w21, [x19]
	ldr	x0, [x19, #8]
	ldr	w2, [x23]
	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 AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_USB_BUF_SZ,4,2                 ; @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_INTERFACE,4,2        ; @USB_RECIP_INTERFACE
	.comm	_D_USBI,4,2                     ; @D_USBI
l_.str.1:                               ; @.str.1
	.asciz	"reg_r [%02x] -> %02x\n"

l_.str.2:                               ; @.str.2
	.asciz	"reg_r err %d\n"

	.no_dead_strip	_reg_r
.subsections_via_symbols
