	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function em28xx_copy_video
_em28xx_copy_video:                     ## @em28xx_copy_video
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	(%rdi), %r14d
	addl	%r14d, %r14d
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	(%rsi), %rax
	leaq	(%rax,%r9), %rsi
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	(%rdx), %r10
	movq	%r10, %r15
	subq	%rax, %r15
	cmpq	%r10, %rsi
	cmovbeq	%r9, %r15
	movq	%rcx, %r13
	movq	8(%rdi), %rcx
	movslq	%r14d, %rsi
	movq	%r8, %rbx
	testq	%rcx, %rcx
	jne	LBB0_3
## %bb.1:
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	cmpq	$0, 8(%rdx)
	movq	%r8, %rbx
	jne	LBB0_3
## %bb.2:
	leaq	(%r8,%rsi), %rbx
LBB0_3:
	movq	%rax, %rdx
	orq	%rsi, %rdx
	shrq	$32, %rdx
	je	LBB0_4
## %bb.5:
	xorl	%edx, %edx
	divq	%rsi
	jmp	LBB0_6
LBB0_4:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%r14d
                                        ## kill: def $edx killed $edx def $rdx
                                        ## kill: def $eax killed $eax def $rax
LBB0_6:
	testq	%rcx, %rcx
	sete	%cl
	imull	%r14d, %eax
	shll	%cl, %eax
	addl	%edx, %eax
	cltq
	addq	%rax, %rbx
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
                                        ## kill: def $r14d killed $r14d killed $r14 def $r14
	subl	%edx, %r14d
	cmpl	%r15d, %r14d
	cmovgel	%r15d, %r14d
	movslq	%r14d, %rsi
	addq	%rbx, %rsi
	addq	%r8, %r10
	movl	%r15d, %r12d
	cmpq	%r10, %rsi
	jbe	LBB0_8
## %bb.7:
	subl	%r10d, %esi
	leaq	L_.str(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	movq	%r8, %r14
	callq	_em28xx_isocdbg
	movq	%r14, %r8
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %r14d
	addl	%r8d, %r14d
	subl	%ebx, %r14d
	movl	%r14d, %r12d
LBB0_8:
	testl	%r14d, %r14d
	jle	LBB0_15
## %bb.9:
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movq	%r13, %rsi
	movl	%r14d, %edx
	callq	_memcpy
	subl	%r14d, %r12d
	jle	LBB0_14
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rax
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	leal	(%r14,%rdx), %ecx
	movslq	%ecx, %rbx
	addq	%rax, %rbx
	cmpl	%r12d, %edx
	movl	%r12d, %r15d
	cmovll	%edx, %r15d
	movslq	%r15d, %rsi
	addq	%rbx, %rsi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	addq	-56(%rbp), %rax                 ## 8-byte Folded Reload
	cmpq	%rax, %rsi
	jbe	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	subl	%eax, %esi
	leaq	L_.str.1(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_em28xx_isocdbg
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %r15d
	addl	-56(%rbp), %r15d                ## 4-byte Folded Reload
	subl	%ebx, %r15d
	movl	%r15d, %r12d
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=1
	testl	%r15d, %r15d
	jle	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	%r14d, %eax
	addq	%rax, %r13
	movq	%rbx, %rdi
	movq	%r13, %rsi
	movl	%r15d, %edx
	callq	_memcpy
	movl	%r15d, %r14d
	subl	%r15d, %r12d
	jg	LBB0_10
LBB0_14:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	addq	%rcx, (%rax)
LBB0_15:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Overflow of %zi bytes past buffer end (1)\n"

L_.str.1:                               ## @.str.1
	.asciz	"Overflow of %zi bytes past buffer end(2)\n"

	.no_dead_strip	_em28xx_copy_video
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function em28xx_copy_video
_em28xx_copy_video:                     ; @em28xx_copy_video
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x4
	mov	x21, x3
	mov	x22, x2
	mov	x19, x1
	ldr	w8, [x0]
	lsl	w27, w8, #1
	ldr	x9, [x1]
	ldr	x8, [x2]
	sub	x10, x8, x9
	add	x11, x9, x5
	cmp	x11, x8
	csel	x26, x10, x5, hi
	mov	x25, x26
	ldr	x11, [x0, #8]
	mov	x10, x4
	cbnz	x11, LBB0_2
; %bb.1:
	ldr	x10, [x22, #8]
	add	x12, x20, w27, sxtw
	cmp	x10, #0
	csel	x10, x20, x12, ne
LBB0_2:
	cmp	x11, #0
	cset	w11, eq
	sxtw	x12, w27
	udiv	x13, x9, x12
	msub	w9, w13, w12, w9
	mul	w12, w27, w13
	lsl	w11, w12, w11
	add	w11, w11, w9
	add	x23, x10, w11, sxtw
	sub	w9, w27, w9
	cmp	w9, w25
	csel	w24, w9, w25, lt
	add	x9, x23, w24, sxtw
	add	x8, x20, x8
	cmp	x9, x8
	b.ls	LBB0_4
; %bb.3:
	sub	w1, w9, w8
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_em28xx_isocdbg
	ldr	w8, [x22]
	add	w8, w20, w8
	sub	w24, w8, w23
	mov	x25, x24
LBB0_4:
	cmp	w24, #1
	b.lt	LBB0_12
; %bb.5:
	str	x26, [sp, #8]                   ; 8-byte Folded Spill
	mov	x0, x23
	mov	x1, x21
	mov	x2, x24
	bl	_memcpy
	sub	w28, w25, w24
	cmp	w28, #1
	b.lt	LBB0_11
; %bb.6:
Lloh2:
	adrp	x25, l_.str.1@PAGE
Lloh3:
	add	x25, x25, l_.str.1@PAGEOFF
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	sxtw	x8, w24
	add	x8, x8, w27, sxtw
	add	x23, x23, x8
	cmp	w27, w28
	csel	w26, w27, w28, lt
	add	x8, x23, w26, sxtw
	ldr	x9, [x22]
	add	x9, x20, x9
	cmp	x8, x9
	b.ls	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	sub	w1, w8, w9
	mov	x0, x25
	bl	_em28xx_isocdbg
	ldr	w8, [x22]
	add	w8, w20, w8
	sub	w26, w8, w23
	mov	x28, x26
LBB0_9:                                 ;   in Loop: Header=BB0_7 Depth=1
	cmp	w26, #1
	b.lt	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	add	x21, x21, w24, uxtw
	mov	x0, x23
	mov	x1, x21
	mov	x2, x26
	bl	_memcpy
	sub	w28, w28, w26
	mov	x24, x26
	cmp	w28, #0
	b.gt	LBB0_7
LBB0_11:
	ldr	x8, [x19]
	ldr	x9, [sp, #8]                    ; 8-byte Folded Reload
	add	x8, x8, x9
	str	x8, [x19]
LBB0_12:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Overflow of %zi bytes past buffer end (1)\n"

l_.str.1:                               ; @.str.1
	.asciz	"Overflow of %zi bytes past buffer end(2)\n"

	.no_dead_strip	_em28xx_copy_video
.subsections_via_symbols
