	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hdpvr_alloc_buffers            ## -- Begin function hdpvr_alloc_buffers
	.p2align	4, 0x90
_hdpvr_alloc_buffers:                   ## @hdpvr_alloc_buffers
	.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
	movq	%rsi, %r12
	movq	%rdi, %rcx
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	_MSG_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_hdpvr_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	leaq	16(%rcx), %r15
	leaq	L_.str(%rip), %rcx
	movq	%r15, %rdx
	movq	%r12, %r8
	callq	_v4l2_dbg
	testq	%r12, %r12
	jle	LBB0_11
## %bb.1:
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %esi
	movl	$24, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %r13
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movq	%r14, 16(%rax)
	movl	(%rbx), %esi
	xorl	%edi, %edi
	callq	_usb_alloc_urb
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %r12
	movq	%rax, 8(%r13)
	movl	4(%r14), %esi
	movl	12(%r14), %edi
	movl	(%rbx), %edx
	movq	%rax, %rcx
	addq	$4, %rcx
	callq	_usb_alloc_coherent
	testq	%rax, %rax
	je	LBB0_6
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %r15
	movq	8(%r13), %rbx
	movl	8(%r14), %esi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	12(%rax), %r14d
	movl	%r14d, %edi
	callq	_usb_rcvbulkpipe
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	4(%rcx), %r8d
	movq	_hdpvr_read_bulk_callback@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r9d
	movq	%r13, (%rsp)
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movl	%eax, %edx
	movq	%r15, %rcx
	callq	_usb_fill_bulk_urb
	movq	_URB_NO_TRANSFER_DMA_MAP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	8(%r13), %rcx
	orl	%eax, (%rcx)
	movq	_BUFSTAT_AVAILABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r13)
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_list_add_tail
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	decq	%r12
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	jne	LBB0_2
## %bb.10:
	xorl	%r14d, %r14d
	jmp	LBB0_11
LBB0_3:
	leaq	L_.str.1(%rip), %rsi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_v4l2_err
	jmp	LBB0_8
LBB0_6:
	leaq	L_.str.2(%rip), %rsi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_v4l2_err
	movq	%r12, %rdi
	callq	_usb_free_urb
LBB0_7:
	movq	%r13, %rdi
	callq	_kfree
LBB0_8:
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movq	%r14, %rdi
	callq	_hdpvr_free_buffers
	movl	%ebx, %r14d
LBB0_11:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_MSG_INFO,4,2                   ## @MSG_INFO
	.comm	_hdpvr_debug,4,2                ## @hdpvr_debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"allocating %u buffers\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.1:                               ## @.str.1
	.asciz	"cannot allocate buffer\n"

L_.str.2:                               ## @.str.2
	.asciz	"cannot allocate usb transfer buffer\n"

	.comm	_hdpvr_read_bulk_callback,4,2   ## @hdpvr_read_bulk_callback
	.comm	_URB_NO_TRANSFER_DMA_MAP,4,2    ## @URB_NO_TRANSFER_DMA_MAP
	.comm	_BUFSTAT_AVAILABLE,4,2          ## @BUFSTAT_AVAILABLE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hdpvr_alloc_buffers            ; -- Begin function hdpvr_alloc_buffers
	.p2align	2
_hdpvr_alloc_buffers:                   ; @hdpvr_alloc_buffers
	.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	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	adrp	x9, _MSG_INFO@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MSG_INFO@GOTPAGEOFF]
Lloh4:
	ldr	w20, [x8]
Lloh5:
	ldr	w0, [x9]
Lloh6:
	adrp	x8, _hdpvr_debug@GOTPAGE
Lloh7:
	ldr	x8, [x8, _hdpvr_debug@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	add	x22, x19, #16
Lloh9:
	adrp	x3, l_.str@PAGE
Lloh10:
	add	x3, x3, l_.str@PAGEOFF
	mov	x2, x22
	mov	x4, x21
	bl	_v4l2_dbg
	cmp	x21, #1
	b.lt	LBB0_6
; %bb.1:
	str	x22, [sp]                       ; 8-byte Folded Spill
	neg	w8, w20
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
Lloh11:
	adrp	x27, _GFP_KERNEL@GOTPAGE
Lloh12:
	ldr	x27, [x27, _GFP_KERNEL@GOTPAGEOFF]
Lloh13:
	adrp	x28, _hdpvr_read_bulk_callback@GOTPAGE
Lloh14:
	ldr	x28, [x28, _hdpvr_read_bulk_callback@GOTPAGEOFF]
Lloh15:
	adrp	x20, _URB_NO_TRANSFER_DMA_MAP@GOTPAGE
Lloh16:
	ldr	x20, [x20, _URB_NO_TRANSFER_DMA_MAP@GOTPAGEOFF]
Lloh17:
	adrp	x22, _BUFSTAT_AVAILABLE@GOTPAGE
Lloh18:
	ldr	x22, [x22, _BUFSTAT_AVAILABLE@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x27]
	mov	w0, #24
	bl	_kzalloc
	cbz	x0, LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x23, x0
	str	x19, [x0, #16]
	ldr	w1, [x27]
	mov	w0, #0
	bl	_usb_alloc_urb
	cbz	x0, LBB0_9
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x24, x0
	str	x0, [x23, #8]
	ldr	w0, [x19, #12]
	ldr	w1, [x19, #4]
	add	x3, x24, #4
	ldr	w2, [x27]
	bl	_usb_alloc_coherent
	cbz	x0, LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x25, x0
	ldr	x24, [x23, #8]
	ldp	w1, w26, [x19, #8]
	mov	x0, x26
	bl	_usb_rcvbulkpipe
	mov	x2, x0
	ldr	w4, [x19, #4]
	ldr	w5, [x28]
	mov	x0, x24
	mov	x1, x26
	mov	x3, x25
	mov	x6, x23
	bl	_usb_fill_bulk_urb
	ldr	w8, [x20]
	ldr	x9, [x23, #8]
	ldr	w10, [x9]
	orr	w8, w10, w8
	str	w8, [x9]
	ldr	w8, [x22]
	str	w8, [x23, #4]
	mov	x0, x23
	mov	x1, x19
	bl	_list_add_tail
	subs	x21, x21, #1
	b.ne	LBB0_2
LBB0_6:
	mov	w20, #0
	b	LBB0_11
LBB0_7:
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	ldr	x0, [sp]                        ; 8-byte Folded Reload
	bl	_v4l2_err
	b	LBB0_10
LBB0_8:
Lloh21:
	adrp	x1, l_.str.2@PAGE
Lloh22:
	add	x1, x1, l_.str.2@PAGEOFF
	ldr	x0, [sp]                        ; 8-byte Folded Reload
	bl	_v4l2_err
	mov	x0, x24
	bl	_usb_free_urb
LBB0_9:
	mov	x0, x23
	bl	_kfree
LBB0_10:
	ldr	w20, [sp, #12]                  ; 4-byte Folded Reload
	mov	x0, x19
	bl	_hdpvr_free_buffers
LBB0_11:
	mov	x0, x20
	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	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_MSG_INFO,4,2                   ; @MSG_INFO
	.comm	_hdpvr_debug,4,2                ; @hdpvr_debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"allocating %u buffers\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.1:                               ; @.str.1
	.asciz	"cannot allocate buffer\n"

l_.str.2:                               ; @.str.2
	.asciz	"cannot allocate usb transfer buffer\n"

	.comm	_hdpvr_read_bulk_callback,4,2   ; @hdpvr_read_bulk_callback
	.comm	_URB_NO_TRANSFER_DMA_MAP,4,2    ; @URB_NO_TRANSFER_DMA_MAP
	.comm	_BUFSTAT_AVAILABLE,4,2          ; @BUFSTAT_AVAILABLE
.subsections_via_symbols
