	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function joydev_open
_joydev_open:                           ## @joydev_open
	.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
	callq	_iminor
	movq	_JOYDEV_MINOR_BASE@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	movslq	%eax, %rbx
	subq	%rcx, %rbx
	movq	_JOYDEV_MINORS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jge	LBB0_1
## %bb.2:
	movq	_joydev_table_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_lock_interruptible
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_10
## %bb.3:
	movq	_joydev_table@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%rbx,8), %r14
	testq	%r14, %r14
	je	LBB0_11
## %bb.4:
	movq	%r14, %rdi
	callq	_get_device
	movq	_joydev_table_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %r12
	movq	%rax, %rdi
	addq	$8, %rdi
	callq	_spin_lock_init
	movq	%r14, (%r12)
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_joydev_attach_client
	movq	%r14, %rdi
	callq	_joydev_open_device
	testl	%eax, %eax
	je	LBB0_7
## %bb.8:
	movl	%eax, %r13d
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_joydev_detach_client
	movq	%r12, %rdi
	callq	_kfree
	jmp	LBB0_9
LBB0_11:
	movq	_joydev_table_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_10:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_9:
	movq	%r14, %rdi
	callq	_put_device
	jmp	LBB0_10
LBB0_7:
	movq	%r12, (%r15)
	xorl	%r13d, %r13d
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_JOYDEV_MINOR_BASE,4,2          ## @JOYDEV_MINOR_BASE
	.comm	_JOYDEV_MINORS,4,2              ## @JOYDEV_MINORS
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_joydev_table_mutex,4,2         ## @joydev_table_mutex
	.comm	_joydev_table,8,3               ## @joydev_table
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_joydev_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function joydev_open
_joydev_open:                           ; @joydev_open
	.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, x1
	bl	_iminor
Lloh0:
	adrp	x8, _JOYDEV_MINOR_BASE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _JOYDEV_MINOR_BASE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _JOYDEV_MINORS@GOTPAGE
Lloh4:
	ldr	x9, [x9, _JOYDEV_MINORS@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	sub	w20, w0, w8
	cmp	w20, w9
	b.ge	LBB0_7
; %bb.1:
Lloh6:
	adrp	x0, _joydev_table_mutex@GOTPAGE
Lloh7:
	ldr	x0, [x0, _joydev_table_mutex@GOTPAGEOFF]
	bl	_mutex_lock_interruptible
	mov	x21, x0
	cbnz	w0, LBB0_8
; %bb.2:
Lloh8:
	adrp	x8, _joydev_table@GOTPAGE
Lloh9:
	ldr	x8, [x8, _joydev_table@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	ldr	x20, [x8, w20, sxtw #3]
	cbz	x20, LBB0_6
; %bb.3:
	mov	x0, x20
	bl	_get_device
Lloh11:
	adrp	x0, _joydev_table_mutex@GOTPAGE
Lloh12:
	ldr	x0, [x0, _joydev_table_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
Lloh13:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	w0, #16
	bl	_kzalloc
	cbz	x0, LBB0_9
; %bb.4:
	mov	x22, x0
	add	x0, x0, #8
	bl	_spin_lock_init
	str	x20, [x22]
	mov	x0, x20
	mov	x1, x22
	bl	_joydev_attach_client
	mov	x0, x20
	bl	_joydev_open_device
	mov	x21, x0
	cbz	w0, LBB0_11
; %bb.5:
	mov	x0, x20
	mov	x1, x22
	bl	_joydev_detach_client
	mov	x0, x22
	bl	_kfree
	b	LBB0_10
LBB0_6:
Lloh16:
	adrp	x0, _joydev_table_mutex@GOTPAGE
Lloh17:
	ldr	x0, [x0, _joydev_table_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
LBB0_7:
Lloh18:
	adrp	x8, _ENODEV@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_8:
	mov	x0, x21
	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_9:
Lloh21:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_10:
	mov	x0, x20
	bl	_put_device
	b	LBB0_8
LBB0_11:
	str	x22, [x19]
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_JOYDEV_MINOR_BASE,4,2          ; @JOYDEV_MINOR_BASE
	.comm	_JOYDEV_MINORS,4,2              ; @JOYDEV_MINORS
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_joydev_table_mutex,4,2         ; @joydev_table_mutex
	.comm	_joydev_table,8,3               ; @joydev_table
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_joydev_open
.subsections_via_symbols
