	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function analog_connect
_analog_connect:                        ## @analog_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -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	$8, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	%rax, %rdx
	callq	_analog_init_port
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_12
## %bb.3:
	movq	%r15, %rdi
	callq	_analog_init_masks
	movl	%eax, %r12d
	testl	%eax, %eax
	je	LBB0_4
LBB0_11:
	movq	%r14, %rdi
	callq	_gameport_close
LBB0_12:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_gameport_set_drvdata
	movq	%r15, %rdi
	callq	_kfree
	movl	%r12d, %ebx
	jmp	LBB0_13
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_13:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_analog_poll@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_gameport_set_poll_handler
	movq	%r14, %rdi
	movl	$10, %esi
	callq	_gameport_set_poll_interval
	movq	(%r15), %rsi
	cmpq	$0, 8(%rsi)
	je	LBB0_7
## %bb.5:
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_analog_init_device
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_11
## %bb.6:
	movq	(%r15), %rsi
LBB0_7:
	xorl	%ebx, %ebx
	cmpq	$0, 24(%rsi)
	je	LBB0_13
## %bb.8:
	addq	$16, %rsi
	movq	%r15, %rdi
	movl	$1, %edx
	callq	_analog_init_device
	testl	%eax, %eax
	je	LBB0_13
## %bb.9:
	movl	%eax, %r12d
	movq	(%r15), %rax
	cmpq	$0, 8(%rax)
	je	LBB0_11
## %bb.10:
	movl	(%rax), %edi
	callq	_input_unregister_device
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_analog_poll,4,2                ## @analog_poll
	.no_dead_strip	_analog_connect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function analog_connect
_analog_connect:                        ; @analog_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, #8
	bl	_kzalloc
	cbz	x0, LBB0_5
; %bb.1:
	mov	x20, x0
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_analog_init_port
	mov	x21, x0
	cbnz	w0, LBB0_4
; %bb.2:
	mov	x0, x20
	bl	_analog_init_masks
	mov	x21, x0
	cbz	w0, LBB0_7
LBB0_3:
	mov	x0, x19
	bl	_gameport_close
LBB0_4:
	mov	x0, x19
	mov	x1, #0
	bl	_gameport_set_drvdata
	mov	x0, x20
	bl	_kfree
	b	LBB0_6
LBB0_5:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_6:
	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_7:
Lloh6:
	adrp	x8, _analog_poll@GOTPAGE
Lloh7:
	ldr	x8, [x8, _analog_poll@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_gameport_set_poll_handler
	mov	x0, x19
	mov	w1, #10
	bl	_gameport_set_poll_interval
	ldr	x1, [x20]
	ldr	x8, [x1, #8]
	cbz	x8, LBB0_10
; %bb.8:
	mov	x0, x20
	mov	w2, #0
	bl	_analog_init_device
	mov	x21, x0
	cbnz	w0, LBB0_3
; %bb.9:
	ldr	x1, [x20]
LBB0_10:
	ldr	x8, [x1, #24]
	cbz	x8, LBB0_14
; %bb.11:
	add	x1, x1, #16
	mov	x0, x20
	mov	w2, #1
	bl	_analog_init_device
	mov	x21, x0
	cbz	w0, LBB0_6
; %bb.12:
	ldr	x8, [x20]
	ldr	x9, [x8, #8]
	cbz	x9, LBB0_3
; %bb.13:
	ldr	w0, [x8]
	bl	_input_unregister_device
	b	LBB0_3
LBB0_14:
	mov	w21, #0
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_analog_poll,4,2                ; @analog_poll
	.no_dead_strip	_analog_connect
.subsections_via_symbols
