	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ub_dev_open                    ## -- Begin function ub_dev_open
	.p2align	4, 0x90
_ub_dev_open:                           ## @ub_dev_open
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	subq	$16, %rsp
	movl	$0, -4(%rbp)
	testl	%edi, %edi
	js	LBB0_2
## %bb.1:
	movq	_UB_MAX_DEV@GOTPCREL(%rip), %rax
	cmpl	%edi, (%rax)
	jle	LBB0_2
## %bb.3:
	movq	_devices@GOTPCREL(%rip), %rax
	movl	%edi, %edx
	shlq	$2, %rdx
	addq	(%rax), %rdx
	movq	_API_DEV_OPEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-4(%rbp), %rsi
	callq	_syscall
	movl	%eax, %ecx
	xorl	%eax, %eax
	cmpl	$1, %ecx
	sbbl	%eax, %eax
	orl	-4(%rbp), %eax
	jmp	LBB0_4
LBB0_2:
	movq	_API_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_4:
	addq	$16, %rsp
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_UB_MAX_DEV,4,2                 ## @UB_MAX_DEV
	.comm	_API_EINVAL,4,2                 ## @API_EINVAL
	.comm	_devices,8,3                    ## @devices
	.comm	_API_DEV_OPEN,4,2               ## @API_DEV_OPEN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ub_dev_open                    ; -- Begin function ub_dev_open
	.p2align	2
_ub_dev_open:                           ; @ub_dev_open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #32
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	stur	wzr, [x29, #-4]
	tbnz	w0, #31, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _UB_MAX_DEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _UB_MAX_DEV@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w0
	b.le	LBB0_3
; %bb.2:
Lloh3:
	adrp	x8, _devices@GOTPAGE
Lloh4:
	ldr	x8, [x8, _devices@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	add	x2, x8, w0, uxtw #2
Lloh6:
	adrp	x8, _API_DEV_OPEN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _API_DEV_OPEN@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	sub	x1, x29, #4
	bl	_syscall
	ldur	w8, [x29, #-4]
	cmp	w0, #0
	csinv	w0, w8, wzr, ne
	b	LBB0_4
LBB0_3:
Lloh9:
	adrp	x8, _API_EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _API_EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
LBB0_4:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #32
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_UB_MAX_DEV,4,2                 ; @UB_MAX_DEV
	.comm	_API_EINVAL,4,2                 ; @API_EINVAL
	.comm	_devices,8,3                    ; @devices
	.comm	_API_DEV_OPEN,4,2               ; @API_DEV_OPEN
.subsections_via_symbols
