	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pwc_allocate_buffers
_pwc_allocate_buffers:                  ## @pwc_allocate_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
	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
	leaq	L_.str(%rip), %rdi
	xorl	%r15d, %r15d
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_PWC_DEBUG_MEMORY
	testq	%r14, %r14
	je	LBB0_17
## %bb.1:
	movq	_MAX_ISO_BUFS@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	testl	%eax, %eax
	jle	LBB0_7
## %bb.2:
	movq	40(%r14), %rcx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r15
	xorl	%ebx, %ebx
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_4 Depth=1
	incq	%rbx
	movslq	%eax, %rdx
	cmpq	%rdx, %rbx
	jge	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, (%rcx,%rbx,8)
	jne	LBB0_3
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_ISO_BUFFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r15), %esi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_31
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, %r12
	leaq	L_.str.2(%rip), %rdi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	_PWC_DEBUG_MEMORY
	movq	40(%r14), %rcx
	movq	%r12, (%rcx,%rbx,8)
	movl	(%r13), %eax
	jmp	LBB0_3
LBB0_7:
	movq	32(%r14), %r15
	testq	%r15, %r15
	jne	LBB0_10
## %bb.8:
	movq	_default_fbufs@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	shll	$2, %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_33
## %bb.9:
	movq	%rax, %r15
	leaq	L_.str.4(%rip), %rdi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	_PWC_DEBUG_MEMORY
	movq	%r15, 32(%r14)
LBB0_10:
	movq	_default_fbufs@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_18
## %bb.11:
	xorl	%ebx, %ebx
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_14 Depth=1
	movq	%rax, %r13
	leaq	L_.str.6(%rip), %rdi
	movl	%ebx, %esi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_PWC_DEBUG_MEMORY
	movq	32(%r14), %r15
	movq	%r13, (%r15,%rbx,8)
	movl	(%r12), %eax
LBB0_13:                                ##   in Loop: Header=BB0_14 Depth=1
	incq	%rbx
	movslq	%eax, %rcx
	cmpq	%rcx, %rbx
	jge	LBB0_18
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	cmpq	$0, (%r15,%rbx,8)
	jne	LBB0_13
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	_PWC_FRAME_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_vzalloc
	testq	%rax, %rax
	jne	LBB0_12
## %bb.16:
	leaq	L_.str.5(%rip), %rdi
	jmp	LBB0_32
LBB0_17:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	jmp	LBB0_37
LBB0_18:
	movl	24(%r14), %edi
	callq	_DEVICE_USE_CODEC1
	movq	%r14, %rdi
	testq	%rax, %rax
	je	LBB0_20
## %bb.19:
	callq	_pwc_dec1_alloc
	jmp	LBB0_21
LBB0_20:
	callq	_pwc_dec23_alloc
LBB0_21:
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_23
## %bb.22:
	leaq	L_.str.7(%rip), %rdi
	xorl	%eax, %eax
	callq	_PWC_ERROR
	jmp	LBB0_38
LBB0_23:
	movq	_pwc_mbufs@GOTPCREL(%rip), %r12
	movl	(%r14), %edi
	imull	(%r12), %edi
	callq	_pwc_rvmalloc
	testq	%rax, %rax
	je	LBB0_34
## %bb.24:
	movq	%rax, %r15
	leaq	L_.str.9(%rip), %rdi
	xorl	%ebx, %ebx
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	_PWC_DEBUG_MEMORY
	movq	%r15, 16(%r14)
	cmpl	$0, (%r12)
	jle	LBB0_27
## %bb.25:
	movl	(%r14), %eax
	movq	8(%r14), %rcx
	addq	$8, %rcx
	xorl	%edx, %edx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_26:                                ## =>This Inner Loop Header: Depth=1
	movl	%edx, -8(%rcx)
	movq	$0, (%rcx)
	incq	%rbx
	movslq	(%r12), %rsi
	addl	%eax, %edx
	addq	$16, %rcx
	cmpq	%rsi, %rbx
	jl	LBB0_26
LBB0_27:
	movq	_MAX_IMAGES@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jge	LBB0_30
## %bb.28:
	movl	%ebx, %ecx
	shlq	$4, %rcx
	addq	8(%r14), %rcx
	.p2align	4, 0x90
LBB0_29:                                ## =>This Inner Loop Header: Depth=1
	movl	$0, (%rcx)
	addq	$16, %rcx
	incl	%ebx
	cmpl	%ebx, (%rax)
	jg	LBB0_29
LBB0_30:
	leaq	L_.str.10(%rip), %rdi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_PWC_DEBUG_MEMORY
	jmp	LBB0_38
LBB0_31:
	leaq	L_.str.1(%rip), %rdi
LBB0_32:
	xorl	%r15d, %r15d
	movl	%ebx, %esi
	jmp	LBB0_35
LBB0_33:
	leaq	L_.str.3(%rip), %rdi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_PWC_ERROR
	jmp	LBB0_36
LBB0_34:
	movl	(%r14), %esi
	imull	(%r12), %esi
	leaq	L_.str.8(%rip), %rdi
	xorl	%r15d, %r15d
LBB0_35:
	xorl	%eax, %eax
	callq	_PWC_ERROR
LBB0_36:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_37:
	subl	(%rax), %r15d
LBB0_38:
	movl	%r15d, %eax
	addq	$8, %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	">> pwc_allocate_buffers(pdev = 0x%p)\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_MAX_ISO_BUFS,4,2               ## @MAX_ISO_BUFS
	.comm	_ISO_BUFFER_SIZE,4,2            ## @ISO_BUFFER_SIZE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.1:                               ## @.str.1
	.asciz	"Failed to allocate iso buffer %d.\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.2:                               ## @.str.2
	.asciz	"Allocated iso buffer at %p.\n"

	.comm	_default_fbufs,4,2              ## @default_fbufs
L_.str.3:                               ## @.str.3
	.asciz	"Failed to allocate frame buffer structure.\n"

L_.str.4:                               ## @.str.4
	.asciz	"Allocated frame buffer structure at %p.\n"

	.comm	_PWC_FRAME_SIZE,4,2             ## @PWC_FRAME_SIZE
L_.str.5:                               ## @.str.5
	.asciz	"Failed to allocate frame buffer %d.\n"

L_.str.6:                               ## @.str.6
	.asciz	"Allocated frame buffer %d at %p.\n"

L_.str.7:                               ## @.str.7
	.asciz	"Failed to allocate decompress table.\n"

	.comm	_pwc_mbufs,4,2                  ## @pwc_mbufs
L_.str.8:                               ## @.str.8
	.asciz	"Failed to allocate image buffer(s). needed (%d)\n"

L_.str.9:                               ## @.str.9
	.asciz	"Allocated image buffer at %p.\n"

	.comm	_MAX_IMAGES,4,2                 ## @MAX_IMAGES
L_.str.10:                              ## @.str.10
	.asciz	"<< pwc_allocate_buffers()\n"

	.no_dead_strip	_pwc_allocate_buffers
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pwc_allocate_buffers
_pwc_allocate_buffers:                  ; @pwc_allocate_buffers
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x19, x0
	str	x0, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_PWC_DEBUG_MEMORY
	cbz	x19, LBB0_17
; %bb.1:
Lloh2:
	adrp	x22, _MAX_ISO_BUFS@GOTPAGE
Lloh3:
	ldr	x22, [x22, _MAX_ISO_BUFS@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.2:
	mov	x23, #0
	ldr	x9, [x19, #40]
Lloh4:
	adrp	x24, _ISO_BUFFER_SIZE@GOTPAGE
Lloh5:
	ldr	x24, [x24, _ISO_BUFFER_SIZE@GOTPAGEOFF]
Lloh6:
	adrp	x20, l_.str.2@PAGE
Lloh7:
	add	x20, x20, l_.str.2@PAGEOFF
Lloh8:
	adrp	x25, _GFP_KERNEL@GOTPAGE
Lloh9:
	ldr	x25, [x25, _GFP_KERNEL@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x21, x0
	str	x0, [sp]
	mov	x0, x20
	bl	_PWC_DEBUG_MEMORY
	ldr	x9, [x19, #40]
	str	x21, [x9, x23, lsl #3]
	ldr	w8, [x22]
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x23, x23, #1
	cmp	x23, w8, sxtw
	b.ge	LBB0_8
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x9, x23, lsl #3]
	cbnz	x10, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x24]
	ldr	w1, [x25]
	bl	_kzalloc
	cbnz	x0, LBB0_3
; %bb.7:
	str	x23, [sp]
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_29
LBB0_8:
	ldr	x20, [x19, #32]
Lloh12:
	adrp	x23, _default_fbufs@GOTPAGE
Lloh13:
	ldr	x23, [x23, _default_fbufs@GOTPAGEOFF]
	cbnz	x20, LBB0_11
; %bb.9:
	ldr	w8, [x23]
	lsl	w0, w8, #2
Lloh14:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	bl	_kzalloc
	cbz	x0, LBB0_27
; %bb.10:
	mov	x20, x0
	str	x0, [sp]
Lloh17:
	adrp	x0, l_.str.4@PAGE
Lloh18:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_PWC_DEBUG_MEMORY
	str	x20, [x19, #32]
LBB0_11:
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_18
; %bb.12:
	mov	x24, #0
Lloh19:
	adrp	x25, _PWC_FRAME_SIZE@GOTPAGE
Lloh20:
	ldr	x25, [x25, _PWC_FRAME_SIZE@GOTPAGEOFF]
Lloh21:
	adrp	x21, l_.str.6@PAGE
Lloh22:
	add	x21, x21, l_.str.6@PAGEOFF
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=1
	add	x24, x24, #1
	cmp	x24, w8, sxtw
	b.ge	LBB0_18
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x20, x24, lsl #3]
	cbnz	x9, LBB0_13
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	w0, [x25]
	bl	_vzalloc
	cbz	x0, LBB0_26
; %bb.16:                               ;   in Loop: Header=BB0_14 Depth=1
	mov	x22, x0
	stp	x24, x0, [sp]
	mov	x0, x21
	bl	_PWC_DEBUG_MEMORY
	ldr	x20, [x19, #32]
	str	x22, [x20, x24, lsl #3]
	ldr	w8, [x23]
	b	LBB0_13
LBB0_17:
Lloh23:
	adrp	x8, _ENXIO@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
	b	LBB0_30
LBB0_18:
	ldr	w0, [x19, #24]
	bl	_DEVICE_USE_CODEC1
	cbz	x0, LBB0_21
; %bb.19:
	mov	x0, x19
	bl	_pwc_dec1_alloc
	mov	x20, x0
	cbz	w0, LBB0_22
LBB0_20:
Lloh25:
	adrp	x0, l_.str.7@PAGE
Lloh26:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_PWC_ERROR
	b	LBB0_31
LBB0_21:
	mov	x0, x19
	bl	_pwc_dec23_alloc
	mov	x20, x0
	cbnz	w0, LBB0_20
LBB0_22:
Lloh27:
	adrp	x21, _pwc_mbufs@GOTPAGE
Lloh28:
	ldr	x21, [x21, _pwc_mbufs@GOTPAGEOFF]
	ldr	w8, [x21]
	ldr	w9, [x19]
	mul	w0, w9, w8
	bl	_pwc_rvmalloc
	cbz	x0, LBB0_28
; %bb.23:
	mov	x20, x0
	str	x0, [sp]
Lloh29:
	adrp	x0, l_.str.9@PAGE
Lloh30:
	add	x0, x0, l_.str.9@PAGEOFF
	bl	_PWC_DEBUG_MEMORY
	str	x20, [x19, #16]
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_32
; %bb.24:
	mov	w9, #0
	mov	x8, #0
	ldr	w10, [x19]
	ldr	x11, [x19, #8]
	add	x11, x11, #8
LBB0_25:                                ; =>This Inner Loop Header: Depth=1
	stur	w9, [x11, #-8]
	str	xzr, [x11], #16
	add	x8, x8, #1
	ldrsw	x12, [x21]
	add	w9, w9, w10
	cmp	x8, x12
	b.lt	LBB0_25
	b	LBB0_33
LBB0_26:
	str	x24, [sp]
Lloh31:
	adrp	x0, l_.str.5@PAGE
Lloh32:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_29
LBB0_27:
Lloh33:
	adrp	x0, l_.str.3@PAGE
Lloh34:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_29
LBB0_28:
	ldr	w8, [x21]
	ldr	w9, [x19]
	mul	w8, w9, w8
	str	x8, [sp]
Lloh35:
	adrp	x0, l_.str.8@PAGE
Lloh36:
	add	x0, x0, l_.str.8@PAGEOFF
LBB0_29:
	bl	_PWC_ERROR
Lloh37:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh38:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_30:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_31:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_32:
	mov	w8, #0
LBB0_33:
Lloh39:
	adrp	x9, _MAX_IMAGES@GOTPAGE
Lloh40:
	ldr	x9, [x9, _MAX_IMAGES@GOTPAGEOFF]
	ldr	w10, [x9]
	cmp	w8, w10
	b.ge	LBB0_36
; %bb.34:
	ldr	x10, [x19, #8]
	add	x10, x10, w8, uxtw #4
LBB0_35:                                ; =>This Inner Loop Header: Depth=1
	str	wzr, [x10], #16
	ldr	w11, [x9]
	add	w8, w8, #1
	cmp	w11, w8
	b.gt	LBB0_35
LBB0_36:
Lloh41:
	adrp	x0, l_.str.10@PAGE
Lloh42:
	add	x0, x0, l_.str.10@PAGEOFF
	bl	_PWC_DEBUG_MEMORY
	mov	w20, #0
	b	LBB0_31
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpAdd	Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	">> pwc_allocate_buffers(pdev = 0x%p)\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_MAX_ISO_BUFS,4,2               ; @MAX_ISO_BUFS
	.comm	_ISO_BUFFER_SIZE,4,2            ; @ISO_BUFFER_SIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.1:                               ; @.str.1
	.asciz	"Failed to allocate iso buffer %d.\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.2:                               ; @.str.2
	.asciz	"Allocated iso buffer at %p.\n"

	.comm	_default_fbufs,4,2              ; @default_fbufs
l_.str.3:                               ; @.str.3
	.asciz	"Failed to allocate frame buffer structure.\n"

l_.str.4:                               ; @.str.4
	.asciz	"Allocated frame buffer structure at %p.\n"

	.comm	_PWC_FRAME_SIZE,4,2             ; @PWC_FRAME_SIZE
l_.str.5:                               ; @.str.5
	.asciz	"Failed to allocate frame buffer %d.\n"

l_.str.6:                               ; @.str.6
	.asciz	"Allocated frame buffer %d at %p.\n"

l_.str.7:                               ; @.str.7
	.asciz	"Failed to allocate decompress table.\n"

	.comm	_pwc_mbufs,4,2                  ; @pwc_mbufs
l_.str.8:                               ; @.str.8
	.asciz	"Failed to allocate image buffer(s). needed (%d)\n"

l_.str.9:                               ; @.str.9
	.asciz	"Allocated image buffer at %p.\n"

	.comm	_MAX_IMAGES,4,2                 ; @MAX_IMAGES
l_.str.10:                              ; @.str.10
	.asciz	"<< pwc_allocate_buffers()\n"

	.no_dead_strip	_pwc_allocate_buffers
.subsections_via_symbols
