	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nvenc_register_frame
_nvenc_register_frame:                  ## @nvenc_register_frame
	.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	$56, %rsp
	.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, %r14
	movq	8(%rdi), %r12
	movq	16(%rsi), %rax
	movq	(%rax), %r13
	movl	(%r12), %esi
	testl	%esi, %esi
	jle	LBB0_8
## %bb.1:
	movq	(%r14), %rax
	movq	_AV_PIX_FMT_CUDA@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r8
	movq	_AV_PIX_FMT_D3D11@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r9
	shlq	$3, %rsi
	leaq	(%rsi,%rsi,2), %r10
	xorl	%edi, %edi
	xorl	%ebx, %ebx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	incl	%ebx
	addq	$24, %rdi
	cmpq	%rdi, %r10
	je	LBB0_8
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%r8, %rax
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r12), %rcx
	movq	(%rcx,%rdi), %rcx
	movq	(%r15), %rdx
	cmpq	(%rdx), %rcx
	je	LBB0_17
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	cmpq	%r9, %rax
	jne	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r12), %rcx
	movq	(%rcx,%rdi), %rsi
	movq	(%r15), %rdx
	cmpq	(%rdx), %rsi
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%rcx,%rdi), %rcx
	cmpq	8(%rdx), %rcx
	jne	LBB0_7
	jmp	LBB0_17
LBB0_8:
	movq	%r14, %rdi
	callq	_nvenc_find_free_reg_resource
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_17
## %bb.9:
	movq	_NV_ENC_REGISTER_RESOURCE_VER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movl	8(%r13), %eax
	movl	%eax, -48(%rbp)
	movl	4(%r13), %eax
	movl	%eax, -52(%rbp)
	movq	8(%r15), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)
	movq	(%r15), %rax
	movq	(%rax), %rcx
	movq	%rcx, -88(%rbp)
	movq	(%r14), %rcx
	movq	_AV_PIX_FMT_CUDA@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_11
## %bb.10:
	movq	_NV_ENC_INPUT_RESOURCE_TYPE_CUDADEVICEPTR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -60(%rbp)
	jmp	LBB0_13
LBB0_11:
	movq	_AV_PIX_FMT_D3D11@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_13
## %bb.12:
	movq	_NV_ENC_INPUT_RESOURCE_TYPE_DIRECTX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -60(%rbp)
	movq	8(%rax), %rax
	movq	%rax, -80(%rbp)
LBB0_13:
	movl	(%r13), %edi
	callq	_nvenc_map_buffer_format
	movq	%rax, -72(%rbp)
	movq	_NV_ENC_BUFFER_FORMAT_UNDEFINED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_14
## %bb.18:
	movq	_AV_LOG_FATAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	(%r13), %edi
	callq	_av_get_pix_fmt_name
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%eax, %ecx
	callq	_av_log
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_14:
	movl	16(%r12), %edi
	leaq	-88(%rbp), %rsi
	callq	*24(%r12)
	movq	_NV_ENC_SUCCESS@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_15
## %bb.16:
	movq	(%r15), %rax
	movq	(%rax), %rax
	movq	8(%r12), %rcx
	movl	%ebx, %edx
	leaq	(%rdx,%rdx,2), %rdx
	movq	%rax, (%rcx,%rdx,8)
	movq	-80(%rbp), %rax
	movq	%rax, 8(%rcx,%rdx,8)
	movl	-64(%rbp), %eax
	movl	%eax, 16(%rcx,%rdx,8)
	jmp	LBB0_17
LBB0_15:
	leaq	L_.str.1(%rip), %rdx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_nvenc_print_error
	movq	_AVERROR_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_17:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_PIX_FMT_CUDA,8,3            ## @AV_PIX_FMT_CUDA
	.comm	_AV_PIX_FMT_D3D11,8,3           ## @AV_PIX_FMT_D3D11
	.comm	_NV_ENC_REGISTER_RESOURCE_VER,4,2 ## @NV_ENC_REGISTER_RESOURCE_VER
	.comm	_NV_ENC_INPUT_RESOURCE_TYPE_CUDADEVICEPTR,4,2 ## @NV_ENC_INPUT_RESOURCE_TYPE_CUDADEVICEPTR
	.comm	_NV_ENC_INPUT_RESOURCE_TYPE_DIRECTX,4,2 ## @NV_ENC_INPUT_RESOURCE_TYPE_DIRECTX
	.comm	_NV_ENC_BUFFER_FORMAT_UNDEFINED,8,3 ## @NV_ENC_BUFFER_FORMAT_UNDEFINED
	.comm	_AV_LOG_FATAL,4,2               ## @AV_LOG_FATAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid input pixel format: %s\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_NV_ENC_SUCCESS,4,2             ## @NV_ENC_SUCCESS
L_.str.1:                               ## @.str.1
	.asciz	"Error registering an input resource"

	.comm	_AVERROR_UNKNOWN,4,2            ## @AVERROR_UNKNOWN
	.no_dead_strip	_nvenc_register_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nvenc_register_frame
_nvenc_register_frame:                  ; @nvenc_register_frame
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x21, x1
	mov	x19, x0
	ldr	x22, [x0, #8]
	ldr	x8, [x1, #16]
	ldr	x23, [x8]
	ldr	w12, [x22]
Lloh0:
	adrp	x24, _AV_PIX_FMT_CUDA@GOTPAGE
Lloh1:
	ldr	x24, [x24, _AV_PIX_FMT_CUDA@GOTPAGEOFF]
	cmp	w12, #1
	b.lt	LBB0_8
; %bb.1:
	mov	x8, #0
	mov	w20, #0
	ldr	x9, [x19]
	ldr	x10, [x24]
Lloh2:
	adrp	x11, _AV_PIX_FMT_D3D11@GOTPAGE
Lloh3:
	ldr	x11, [x11, _AV_PIX_FMT_D3D11@GOTPAGEOFF]
Lloh4:
	ldr	x11, [x11]
	add	x12, x12, x12, lsl #1
	lsl	x12, x12, #3
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w20, w20, #1
	add	x8, x8, #24
	cmp	x12, x8
	b.eq	LBB0_8
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	cmp	x9, x10
	b.ne	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x13, [x22, #8]
	ldr	x13, [x13, x8]
	ldr	x14, [x21]
	ldr	x14, [x14]
	cmp	x13, x14
	b.eq	LBB0_18
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
	cmp	x9, x11
	b.ne	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x14, [x22, #8]
	ldr	x15, [x14, x8]
	ldr	x13, [x21]
	ldr	x16, [x13]
	cmp	x15, x16
	b.ne	LBB0_2
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x14, x14, x8
	ldr	x14, [x14, #8]
	ldr	x13, [x13, #8]
	cmp	x14, x13
	b.ne	LBB0_2
	b	LBB0_18
LBB0_8:
	mov	x0, x19
	bl	_nvenc_find_free_reg_resource
	mov	x20, x0
	tbnz	w0, #31, LBB0_18
; %bb.9:
Lloh5:
	adrp	x8, _NV_ENC_REGISTER_RESOURCE_VER@GOTPAGE
Lloh6:
	ldr	x8, [x8, _NV_ENC_REGISTER_RESOURCE_VER@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	str	w8, [sp, #44]
	ldur	d0, [x23, #4]
	stur	d0, [sp, #36]
	ldp	x8, x9, [x21]
	ldr	w9, [x9]
	str	w9, [sp, #32]
	ldr	x9, [x8]
	str	x9, [sp]
	ldr	x9, [x19]
	ldr	x10, [x24]
	cmp	x9, x10
	b.ne	LBB0_11
; %bb.10:
Lloh8:
	adrp	x8, _NV_ENC_INPUT_RESOURCE_TYPE_CUDADEVICEPTR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _NV_ENC_INPUT_RESOURCE_TYPE_CUDADEVICEPTR@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	str	w8, [sp, #28]
	b	LBB0_13
LBB0_11:
Lloh11:
	adrp	x10, _AV_PIX_FMT_D3D11@GOTPAGE
Lloh12:
	ldr	x10, [x10, _AV_PIX_FMT_D3D11@GOTPAGEOFF]
Lloh13:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_13
; %bb.12:
Lloh14:
	adrp	x9, _NV_ENC_INPUT_RESOURCE_TYPE_DIRECTX@GOTPAGE
Lloh15:
	ldr	x9, [x9, _NV_ENC_INPUT_RESOURCE_TYPE_DIRECTX@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	str	w9, [sp, #28]
	ldr	x8, [x8, #8]
	str	x8, [sp, #8]
LBB0_13:
	ldr	w0, [x23]
	bl	_nvenc_map_buffer_format
	str	x0, [sp, #16]
Lloh17:
	adrp	x8, _NV_ENC_BUFFER_FORMAT_UNDEFINED@GOTPAGE
Lloh18:
	ldr	x8, [x8, _NV_ENC_BUFFER_FORMAT_UNDEFINED@GOTPAGEOFF]
Lloh19:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_15
; %bb.14:
Lloh20:
	adrp	x8, _AV_LOG_FATAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _AV_LOG_FATAL@GOTPAGEOFF]
Lloh22:
	ldr	w20, [x8]
	ldr	w0, [x23]
	bl	_av_get_pix_fmt_name
	mov	x3, x0
Lloh23:
	adrp	x2, l_.str@PAGE
Lloh24:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	mov	x1, x20
	bl	_av_log
Lloh25:
	adrp	x8, _EINVAL@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
	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
	add	sp, sp, #112
	b	_AVERROR
LBB0_15:
	ldr	x8, [x22, #24]
	ldr	w0, [x22, #16]
	mov	x1, sp
	blr	x8
Lloh28:
	adrp	x8, _NV_ENC_SUCCESS@GOTPAGE
Lloh29:
	ldr	x8, [x8, _NV_ENC_SUCCESS@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_17
; %bb.16:
	ldr	x8, [x21]
	ldr	x8, [x8]
	ldr	x9, [x22, #8]
	mov	w10, #24
	umaddl	x9, w20, w10, x9
	str	x8, [x9]
	ldr	x8, [sp, #8]
	str	x8, [x9, #8]
	ldr	w8, [sp, #24]
	str	w8, [x9, #16]
	b	LBB0_18
LBB0_17:
	mov	x1, x0
Lloh31:
	adrp	x2, l_.str.1@PAGE
Lloh32:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_nvenc_print_error
Lloh33:
	adrp	x8, _AVERROR_UNKNOWN@GOTPAGE
Lloh34:
	ldr	x8, [x8, _AVERROR_UNKNOWN@GOTPAGEOFF]
Lloh35:
	ldr	w20, [x8]
LBB0_18:
	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
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_PIX_FMT_CUDA,8,3            ; @AV_PIX_FMT_CUDA
	.comm	_AV_PIX_FMT_D3D11,8,3           ; @AV_PIX_FMT_D3D11
	.comm	_NV_ENC_REGISTER_RESOURCE_VER,4,2 ; @NV_ENC_REGISTER_RESOURCE_VER
	.comm	_NV_ENC_INPUT_RESOURCE_TYPE_CUDADEVICEPTR,4,2 ; @NV_ENC_INPUT_RESOURCE_TYPE_CUDADEVICEPTR
	.comm	_NV_ENC_INPUT_RESOURCE_TYPE_DIRECTX,4,2 ; @NV_ENC_INPUT_RESOURCE_TYPE_DIRECTX
	.comm	_NV_ENC_BUFFER_FORMAT_UNDEFINED,8,3 ; @NV_ENC_BUFFER_FORMAT_UNDEFINED
	.comm	_AV_LOG_FATAL,4,2               ; @AV_LOG_FATAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid input pixel format: %s\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_NV_ENC_SUCCESS,4,2             ; @NV_ENC_SUCCESS
l_.str.1:                               ; @.str.1
	.asciz	"Error registering an input resource"

	.comm	_AVERROR_UNKNOWN,4,2            ; @AVERROR_UNKNOWN
	.no_dead_strip	_nvenc_register_frame
.subsections_via_symbols
