	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function grip_connect
_grip_connect:                          ## @grip_connect
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movq	%r14, 8(%rax)
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_gameport_set_drvdata
	movq	_GAMEPORT_MODE_RAW@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_gameport_open
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_3
LBB0_9:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_gameport_set_drvdata
	movq	%r15, %rdi
	callq	_kfree
	jmp	LBB0_10
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_grip_poll@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_gameport_set_poll_handler
	movq	%r14, %rdi
	movl	$20, %esi
	callq	_gameport_set_poll_interval
	movq	%r15, %rdi
	callq	_multiport_init
	testl	%eax, %eax
	je	LBB0_8
## %bb.4:
	movq	(%r15), %rax
	movq	(%rax), %rcx
	xorl	%ebx, %ebx
	cmpl	$0, (%rcx)
	jne	LBB0_10
## %bb.5:
	movq	8(%rax), %rcx
	cmpl	$0, (%rcx)
	jne	LBB0_10
## %bb.6:
	movq	16(%rax), %rcx
	cmpl	$0, (%rcx)
	jne	LBB0_10
## %bb.7:
	movq	24(%rax), %rax
	cmpl	$0, (%rax)
	jne	LBB0_10
LBB0_8:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	%r14, %rdi
	callq	_gameport_close
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_GAMEPORT_MODE_RAW,4,2          ## @GAMEPORT_MODE_RAW
	.comm	_grip_poll,4,2                  ## @grip_poll
	.comm	_ENODEV,4,2                     ## @ENODEV
	.no_dead_strip	_grip_connect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function grip_connect
_grip_connect:                          ; @grip_connect
	.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	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #16
	bl	_kzalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
	str	x19, [x0, #8]
	mov	x0, x19
	mov	x1, x20
	bl	_gameport_set_drvdata
Lloh3:
	adrp	x8, _GAMEPORT_MODE_RAW@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GAMEPORT_MODE_RAW@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x21
	bl	_gameport_open
	mov	x21, x0
	cbz	w0, LBB0_4
LBB0_2:
	mov	x0, x19
	mov	x1, #0
	bl	_gameport_set_drvdata
	mov	x0, x20
	bl	_kfree
	b	LBB0_10
LBB0_3:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_10
LBB0_4:
Lloh9:
	adrp	x8, _grip_poll@GOTPAGE
Lloh10:
	ldr	x8, [x8, _grip_poll@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_gameport_set_poll_handler
	mov	x0, x19
	mov	w1, #20
	bl	_gameport_set_poll_interval
	mov	x0, x20
	bl	_multiport_init
	cbz	w0, LBB0_11
; %bb.5:
	ldr	x8, [x20]
	ldr	x9, [x8]
	ldr	w9, [x9]
	cbnz	w9, LBB0_9
; %bb.6:
	ldr	x9, [x8, #8]
	ldr	w9, [x9]
	cbnz	w9, LBB0_9
; %bb.7:
	ldr	x9, [x8, #16]
	ldr	w9, [x9]
	cbnz	w9, LBB0_9
; %bb.8:
	ldr	x8, [x8, #24]
	ldr	w8, [x8]
	cbz	w8, LBB0_11
LBB0_9:
	mov	w21, #0
LBB0_10:
	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_11:
Lloh12:
	adrp	x8, _ENODEV@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w21, w8
	mov	x0, x19
	bl	_gameport_close
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_GAMEPORT_MODE_RAW,4,2          ; @GAMEPORT_MODE_RAW
	.comm	_grip_poll,4,2                  ; @grip_poll
	.comm	_ENODEV,4,2                     ; @ENODEV
	.no_dead_strip	_grip_connect
.subsections_via_symbols
