	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function opencl_enumerate_devices
_opencl_enumerate_devices:              ## @opencl_enumerate_devices
	.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	%r8, -48(%rbp)                  ## 8-byte Spill
	movq	%rcx, %rbx
	movq	%rdx, %r14
	movl	%esi, %r13d
	movq	%rdi, %r12
	movq	_CL_DEVICE_TYPE_ALL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movl	%r13d, %edi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movq	%rbx, %r8
	callq	_clGetDeviceIDs
	movq	_CL_DEVICE_NOT_FOUND@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_1
## %bb.3:
	movq	_CL_SUCCESS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.4:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r12, %rdi
	movq	%r14, %rcx
	movq	%rax, %r8
	xorl	%eax, %eax
	callq	_av_log
LBB0_5:
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_6:
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_1:
	movq	_AV_LOG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	movq	%r14, %rcx
	xorl	%eax, %eax
	callq	_av_log
	movq	$0, (%rbx)
LBB0_2:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_AV_LOG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%rbx), %rcx
	leaq	L_.str.2(%rip), %rdx
	movq	%r12, %rdi
	movq	%r14, %r8
	xorl	%eax, %eax
	callq	_av_log
	movq	(%rbx), %rdi
	movl	$4, %esi
	callq	_av_malloc_array
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movl	(%r15), %esi
	movq	(%rbx), %rdx
	movl	%r13d, %edi
	movq	%rax, %rcx
	xorl	%r8d, %r8d
	callq	_clGetDeviceIDs
	movq	_CL_SUCCESS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_2
## %bb.10:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	L_.str.3(%rip), %rdx
	movq	%r12, %rdi
	movq	%r14, %rcx
	movq	%rax, %r8
	xorl	%eax, %eax
	callq	_av_log
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_av_freep
	jmp	LBB0_5
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_CL_DEVICE_TYPE_ALL,4,2         ## @CL_DEVICE_TYPE_ALL
	.comm	_CL_DEVICE_NOT_FOUND,8,3        ## @CL_DEVICE_NOT_FOUND
	.comm	_AV_LOG_DEBUG,4,2               ## @AV_LOG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No devices found on platform \"%s\".\n"

	.comm	_CL_SUCCESS,8,3                 ## @CL_SUCCESS
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
L_.str.1:                               ## @.str.1
	.asciz	"Failed to get number of devices on platform \"%s\": %d.\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.2:                               ## @.str.2
	.asciz	"%u OpenCL devices found on platform \"%s\".\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.3:                               ## @.str.3
	.asciz	"Failed to get list of devices on platform \"%s\": %d.\n"

	.no_dead_strip	_opencl_enumerate_devices
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function opencl_enumerate_devices
_opencl_enumerate_devices:              ; @opencl_enumerate_devices
	.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	x21, x4
	mov	x22, x3
	mov	x19, x2
	mov	x23, x1
	mov	x20, x0
Lloh0:
	adrp	x24, _CL_DEVICE_TYPE_ALL@GOTPAGE
Lloh1:
	ldr	x24, [x24, _CL_DEVICE_TYPE_ALL@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x23
	mov	x2, #0
	mov	x3, #0
	mov	x4, x22
	bl	_clGetDeviceIDs
Lloh2:
	adrp	x8, _CL_DEVICE_NOT_FOUND@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CL_DEVICE_NOT_FOUND@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_5
; %bb.1:
Lloh5:
	adrp	x25, _CL_SUCCESS@GOTPAGE
Lloh6:
	ldr	x25, [x25, _CL_SUCCESS@GOTPAGEOFF]
	ldr	x8, [x25]
	cmp	x0, x8
	b.eq	LBB0_7
; %bb.2:
Lloh7:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh8:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	str	x0, [sp]
Lloh10:
	adrp	x2, l_.str.1@PAGE
Lloh11:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x3, x19
	bl	_av_log
LBB0_3:
Lloh12:
	adrp	x8, _ENODEV@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_4:
	ldr	w0, [x8]
	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
	b	_AVERROR
LBB0_5:
Lloh14:
	adrp	x8, _AV_LOG_DEBUG@GOTPAGE
Lloh15:
	ldr	x8, [x8, _AV_LOG_DEBUG@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
Lloh17:
	adrp	x2, l_.str@PAGE
Lloh18:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	mov	x3, x19
	bl	_av_log
	str	xzr, [x22]
LBB0_6:
	mov	w0, #0
	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_7:
Lloh19:
	adrp	x8, _AV_LOG_DEBUG@GOTPAGE
Lloh20:
	ldr	x8, [x8, _AV_LOG_DEBUG@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	ldr	x3, [x22]
	str	x19, [sp]
Lloh22:
	adrp	x2, l_.str.2@PAGE
Lloh23:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_av_log
	ldr	x0, [x22]
	mov	w1, #4
	bl	_av_malloc_array
	str	x0, [x21]
	cbz	x0, LBB0_10
; %bb.8:
	mov	x3, x0
	ldr	w1, [x24]
	ldr	x2, [x22]
	mov	x0, x23
	mov	x4, #0
	bl	_clGetDeviceIDs
	ldr	x8, [x25]
	cmp	x0, x8
	b.eq	LBB0_6
; %bb.9:
Lloh24:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh25:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	str	x0, [sp]
Lloh27:
	adrp	x2, l_.str.3@PAGE
Lloh28:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	x0, x20
	mov	x3, x19
	bl	_av_log
	mov	x0, x21
	bl	_av_freep
	b	LBB0_3
LBB0_10:
Lloh29:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh30:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_CL_DEVICE_TYPE_ALL,4,2         ; @CL_DEVICE_TYPE_ALL
	.comm	_CL_DEVICE_NOT_FOUND,8,3        ; @CL_DEVICE_NOT_FOUND
	.comm	_AV_LOG_DEBUG,4,2               ; @AV_LOG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No devices found on platform \"%s\".\n"

	.comm	_CL_SUCCESS,8,3                 ; @CL_SUCCESS
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
l_.str.1:                               ; @.str.1
	.asciz	"Failed to get number of devices on platform \"%s\": %d.\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.2:                               ; @.str.2
	.asciz	"%u OpenCL devices found on platform \"%s\".\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.3:                               ; @.str.3
	.asciz	"Failed to get list of devices on platform \"%s\": %d.\n"

	.no_dead_strip	_opencl_enumerate_devices
.subsections_via_symbols
