	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function opencl_enumerate_platforms
_opencl_enumerate_platforms:            ## @opencl_enumerate_platforms
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	%rdi, %r15
	xorl	%edi, %edi
	xorl	%esi, %esi
	movq	%rbx, %rdx
	callq	_clGetPlatformIDs
	movq	_CL_SUCCESS@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rax
	jne	LBB0_1
## %bb.2:
	movq	_AV_LOG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%rbx), %rcx
	leaq	L_.str.1(%rip), %rdx
	movq	%r15, %rdi
	callq	_av_log
	movq	(%rbx), %rdi
	movl	$4, %esi
	callq	_av_malloc_array
	movq	%rax, (%r14)
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	(%rbx), %rdi
	movq	%rax, %rsi
	xorl	%edx, %edx
	callq	_clGetPlatformIDs
	cmpq	(%r12), %rax
	jne	LBB0_5
## %bb.8:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r15, %rdi
	movq	%rax, %rcx
	callq	_av_log
	jmp	LBB0_6
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_5:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	L_.str.2(%rip), %rdx
	movq	%r15, %rdi
	movq	%rax, %rcx
	callq	_av_log
	movq	%r14, %rdi
	callq	_av_freep
LBB0_6:
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_CL_SUCCESS,8,3                 ## @CL_SUCCESS
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to get number of OpenCL platforms: %d.\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_AV_LOG_DEBUG,4,2               ## @AV_LOG_DEBUG
L_.str.1:                               ## @.str.1
	.asciz	"%u OpenCL platforms found.\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.2:                               ## @.str.2
	.asciz	"Failed to get list of OpenCL platforms: %d.\n"

	.no_dead_strip	_opencl_enumerate_platforms
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function opencl_enumerate_platforms
_opencl_enumerate_platforms:            ; @opencl_enumerate_platforms
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	mov	x0, #0
	mov	x1, #0
	mov	x2, x21
	bl	_clGetPlatformIDs
Lloh0:
	adrp	x22, _CL_SUCCESS@GOTPAGE
Lloh1:
	ldr	x22, [x22, _CL_SUCCESS@GOTPAGEOFF]
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_4
; %bb.1:
Lloh2:
	adrp	x8, _AV_LOG_DEBUG@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AV_LOG_DEBUG@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	ldr	x3, [x21]
Lloh5:
	adrp	x2, l_.str.1@PAGE
Lloh6:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_av_log
	ldr	x0, [x21]
	mov	w1, #4
	bl	_av_malloc_array
	str	x0, [x19]
	cbz	x0, LBB0_5
; %bb.2:
	mov	x1, x0
	ldr	x0, [x21]
	mov	x2, #0
	bl	_clGetPlatformIDs
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_6
; %bb.3:
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_4:
	mov	x3, x0
Lloh7:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh8:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
Lloh10:
	adrp	x2, l_.str@PAGE
Lloh11:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	bl	_av_log
	b	LBB0_7
LBB0_5:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_8
LBB0_6:
	mov	x3, x0
Lloh14:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
Lloh17:
	adrp	x2, l_.str.2@PAGE
Lloh18:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_av_log
	mov	x0, x19
	bl	_av_freep
LBB0_7:
Lloh19:
	adrp	x8, _ENODEV@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_8:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_AVERROR
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_CL_SUCCESS,8,3                 ; @CL_SUCCESS
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to get number of OpenCL platforms: %d.\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_AV_LOG_DEBUG,4,2               ; @AV_LOG_DEBUG
l_.str.1:                               ; @.str.1
	.asciz	"%u OpenCL platforms found.\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.2:                               ; @.str.2
	.asciz	"Failed to get list of OpenCL platforms: %d.\n"

	.no_dead_strip	_opencl_enumerate_platforms
.subsections_via_symbols
