	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function coda_alloc_context_buffers
_coda_alloc_context_buffers:            ## @coda_alloc_context_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	%rsi, %r15
	movq	%rdi, %rbx
	movq	16(%rdi), %r12
	cmpl	$0, 12(%rdi)
	jne	LBB0_3
## %bb.1:
	leaq	12(%rbx), %rsi
	movq	_CODA_PARA_BUF_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	leaq	L_.str(%rip), %rcx
	movq	%rbx, %rdi
	callq	_coda_alloc_context_buf
	testl	%eax, %eax
	js	LBB0_2
LBB0_3:
	movq	(%r12), %rax
	movq	(%rax), %rax
	movq	_CODA_DX6@GOTPCREL(%rip), %rcx
	xorl	%r14d, %r14d
	cmpq	(%rcx), %rax
	je	LBB0_17
## %bb.4:
	cmpl	$0, 8(%rbx)
	jne	LBB0_7
## %bb.5:
	movq	(%r15), %rax
	movq	_V4L2_PIX_FMT_H264@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.6:
	leaq	8(%rbx), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	12(%r15), %edi
	movl	$16, %esi
	callq	_DIV_ROUND_UP
	movl	%eax, %r13d
	movl	8(%r15), %edi
	movl	$16, %esi
	callq	_DIV_ROUND_UP
	imull	%r13d, %eax
	imull	$400, %eax, %eax                ## imm = 0x190
	addl	$512, %eax                      ## imm = 0x200
	movslq	%eax, %rdx
	leaq	L_.str.1(%rip), %rcx
	movq	%rbx, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_coda_alloc_context_buf
	testl	%eax, %eax
	js	LBB0_16
LBB0_7:
	cmpl	$0, 4(%rbx)
	jne	LBB0_11
## %bb.8:
	movq	(%r12), %rax
	movq	(%rax), %rax
	movq	_CODA_HX4@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_10
## %bb.9:
	movq	_CODA_7541@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
LBB0_10:
	leaq	4(%rbx), %rsi
	movq	_CODA7_PS_BUF_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	leaq	L_.str.2(%rip), %rcx
	movq	%rbx, %rdi
	callq	_coda_alloc_context_buf
	testl	%eax, %eax
	js	LBB0_16
LBB0_11:
	cmpl	$0, (%rbx)
	jne	LBB0_17
## %bb.12:
	movq	(%r12), %rax
	movq	(%rax), %rcx
	movq	8(%rax), %rdx
	movq	_CODA_960@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rcx
	jne	LBB0_15
## %bb.13:
	movq	(%r15), %rax
	movq	_V4L2_PIX_FMT_H264@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_15
## %bb.14:
	movq	_CODA9_PS_SAVE_SIZE@GOTPCREL(%rip), %rax
	addq	(%rax), %rdx
LBB0_15:
	leaq	L_.str.3(%rip), %rcx
	movq	%rbx, %rdi
	movq	%rbx, %rsi
	callq	_coda_alloc_context_buf
	testl	%eax, %eax
	jns	LBB0_17
LBB0_16:
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_coda_free_context_buffers
	jmp	LBB0_17
LBB0_2:
	movl	%eax, %r14d
LBB0_17:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CODA_PARA_BUF_SIZE,8,3         ## @CODA_PARA_BUF_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"parabuf"

	.comm	_CODA_DX6,8,3                   ## @CODA_DX6
	.comm	_V4L2_PIX_FMT_H264,8,3          ## @V4L2_PIX_FMT_H264
L_.str.1:                               ## @.str.1
	.asciz	"slicebuf"

	.comm	_CODA_HX4,8,3                   ## @CODA_HX4
	.comm	_CODA_7541,8,3                  ## @CODA_7541
	.comm	_CODA7_PS_BUF_SIZE,8,3          ## @CODA7_PS_BUF_SIZE
L_.str.2:                               ## @.str.2
	.asciz	"psbuf"

	.comm	_CODA_960,8,3                   ## @CODA_960
	.comm	_CODA9_PS_SAVE_SIZE,8,3         ## @CODA9_PS_SAVE_SIZE
L_.str.3:                               ## @.str.3
	.asciz	"workbuf"

	.no_dead_strip	_coda_alloc_context_buffers
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function coda_alloc_context_buffers
_coda_alloc_context_buffers:            ; @coda_alloc_context_buffers
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x20, x1
	mov	x19, x0
	mov	x1, x0
	ldr	w8, [x1, #12]!
	ldur	x23, [x1, #4]
	cbnz	w8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _CODA_PARA_BUF_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CODA_PARA_BUF_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x2, [x8]
Lloh3:
	adrp	x3, l_.str@PAGE
Lloh4:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x19
	bl	_coda_alloc_context_buf
	tbnz	w0, #31, LBB0_16
LBB0_2:
	ldr	x8, [x23]
	ldr	x8, [x8]
Lloh5:
	adrp	x9, _CODA_DX6@GOTPAGE
Lloh6:
	ldr	x9, [x9, _CODA_DX6@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_14
; %bb.3:
	mov	x21, x19
	ldr	w8, [x21, #8]!
	cbnz	w8, LBB0_6
; %bb.4:
	ldr	x8, [x20]
Lloh8:
	adrp	x9, _V4L2_PIX_FMT_H264@GOTPAGE
Lloh9:
	ldr	x9, [x9, _V4L2_PIX_FMT_H264@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
	ldr	w0, [x20, #12]
	mov	w1, #16
	bl	_DIV_ROUND_UP
	mov	x22, x0
	ldr	w0, [x20, #8]
	mov	w1, #16
	bl	_DIV_ROUND_UP
	mul	w8, w22, w0
	mov	w9, #400
	orr	w10, wzr, #0x200
	madd	w8, w8, w9, w10
	sxtw	x2, w8
Lloh11:
	adrp	x3, l_.str.1@PAGE
Lloh12:
	add	x3, x3, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x1, x21
	bl	_coda_alloc_context_buf
	tbnz	w0, #31, LBB0_17
LBB0_6:
	mov	x1, x19
	ldr	w8, [x1, #4]!
	cbnz	w8, LBB0_9
; %bb.7:
	ldr	x8, [x23]
	ldr	x8, [x8]
Lloh13:
	adrp	x9, _CODA_HX4@GOTPAGE
Lloh14:
	ldr	x9, [x9, _CODA_HX4@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
Lloh16:
	adrp	x10, _CODA_7541@GOTPAGE
Lloh17:
	ldr	x10, [x10, _CODA_7541@GOTPAGEOFF]
Lloh18:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_9
; %bb.8:
Lloh19:
	adrp	x8, _CODA7_PS_BUF_SIZE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _CODA7_PS_BUF_SIZE@GOTPAGEOFF]
Lloh21:
	ldr	x2, [x8]
Lloh22:
	adrp	x3, l_.str.2@PAGE
Lloh23:
	add	x3, x3, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_coda_alloc_context_buf
	tbnz	w0, #31, LBB0_17
LBB0_9:
	ldr	w8, [x19]
	cbnz	w8, LBB0_14
; %bb.10:
	ldr	x8, [x23]
	ldp	x8, x2, [x8]
Lloh24:
	adrp	x9, _CODA_960@GOTPAGE
Lloh25:
	ldr	x9, [x9, _CODA_960@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.11:
	ldr	x8, [x20]
Lloh27:
	adrp	x9, _V4L2_PIX_FMT_H264@GOTPAGE
Lloh28:
	ldr	x9, [x9, _V4L2_PIX_FMT_H264@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.12:
Lloh30:
	adrp	x8, _CODA9_PS_SAVE_SIZE@GOTPAGE
Lloh31:
	ldr	x8, [x8, _CODA9_PS_SAVE_SIZE@GOTPAGEOFF]
Lloh32:
	ldr	x8, [x8]
	add	x2, x8, x2
LBB0_13:
Lloh33:
	adrp	x3, l_.str.3@PAGE
Lloh34:
	add	x3, x3, l_.str.3@PAGEOFF
	mov	x0, x19
	mov	x1, x19
	bl	_coda_alloc_context_buf
	tbnz	w0, #31, LBB0_17
LBB0_14:
	mov	w21, #0
LBB0_15:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_16:
	mov	x21, x0
	b	LBB0_15
LBB0_17:
	mov	x21, x0
	mov	x0, x19
	bl	_coda_free_context_buffers
	b	LBB0_15
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_CODA_PARA_BUF_SIZE,8,3         ; @CODA_PARA_BUF_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"parabuf"

	.comm	_CODA_DX6,8,3                   ; @CODA_DX6
	.comm	_V4L2_PIX_FMT_H264,8,3          ; @V4L2_PIX_FMT_H264
l_.str.1:                               ; @.str.1
	.asciz	"slicebuf"

	.comm	_CODA_HX4,8,3                   ; @CODA_HX4
	.comm	_CODA_7541,8,3                  ; @CODA_7541
	.comm	_CODA7_PS_BUF_SIZE,8,3          ; @CODA7_PS_BUF_SIZE
l_.str.2:                               ; @.str.2
	.asciz	"psbuf"

	.comm	_CODA_960,8,3                   ; @CODA_960
	.comm	_CODA9_PS_SAVE_SIZE,8,3         ; @CODA9_PS_SAVE_SIZE
l_.str.3:                               ; @.str.3
	.asciz	"workbuf"

	.no_dead_strip	_coda_alloc_context_buffers
.subsections_via_symbols
