	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gameport_add_port
_gameport_add_port:                     ## @gameport_add_port
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	32(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%rbx, (%rax)
LBB0_2:
	movq	_use_ktime@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_4
## %bb.3:
	movq	%rbx, %rdi
	callq	_gameport_measure_speed
	jmp	LBB0_5
LBB0_4:
	movq	%rbx, %rdi
	callq	_old_gameport_measure_speed
LBB0_5:
	movl	%eax, 12(%rbx)
	leaq	24(%rbx), %rdi
	movq	_gameport_list@GOTPCREL(%rip), %rsi
	callq	_list_add_tail
	movq	16(%rbx), %r8
	leaq	8(%rbx), %r14
	movl	(%rbx), %edx
	movl	4(%rbx), %ecx
	testq	%r8, %r8
	je	LBB0_7
## %bb.6:
	movl	12(%rbx), %r9d
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
                                        ## kill: def $r8d killed $r8d killed $r8
	xorl	%eax, %eax
	callq	_dev_info
	jmp	LBB0_8
LBB0_7:
	movl	12(%rbx), %r8d
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_info
LBB0_8:
	movq	%r14, %rdi
	callq	_device_add
	testl	%eax, %eax
	je	LBB0_9
## %bb.10:
	movl	(%rbx), %ecx
	movl	4(%rbx), %edx
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %r8d
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_dev_err                        ## TAILCALL
LBB0_9:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_use_ktime,8,3                  ## @use_ktime
	.comm	_gameport_list,4,2              ## @gameport_list
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s is %s, io %#x, speed %dkHz\n"

L_.str.1:                               ## @.str.1
	.asciz	"%s is %s, speed %dkHz\n"

L_.str.2:                               ## @.str.2
	.asciz	"device_add() failed for %s (%s), error: %d\n"

	.no_dead_strip	_gameport_add_port
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gameport_add_port
_gameport_add_port:                     ; @gameport_add_port
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
	ldr	x8, [x0, #32]
	cbz	x8, LBB0_2
; %bb.1:
	str	x19, [x8]
LBB0_2:
Lloh0:
	adrp	x8, _use_ktime@GOTPAGE
Lloh1:
	ldr	x8, [x8, _use_ktime@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_gameport_measure_speed
	b	LBB0_5
LBB0_4:
	mov	x0, x19
	bl	_old_gameport_measure_speed
LBB0_5:
	str	w0, [x19, #12]
	add	x0, x19, #24
Lloh3:
	adrp	x1, _gameport_list@GOTPAGE
Lloh4:
	ldr	x1, [x1, _gameport_list@GOTPAGEOFF]
	bl	_list_add_tail
	ldr	x4, [x19, #16]
	add	x20, x19, #8
	ldp	w2, w3, [x19]
	cbz	x4, LBB0_7
; %bb.6:
	ldr	w8, [x19, #12]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	str	x8, [sp]
	mov	x0, x20
                                        ; kill: def $w4 killed $w4 killed $x4
	b	LBB0_8
LBB0_7:
	ldr	w4, [x19, #12]
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
LBB0_8:
	bl	_dev_info
	mov	x0, x20
	bl	_device_add
	cbz	w0, LBB0_10
; %bb.9:
	mov	x4, x0
Lloh9:
	adrp	x1, l_.str.2@PAGE
Lloh10:
	add	x1, x1, l_.str.2@PAGEOFF
	ldp	w3, w2, [x19]
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	b	_dev_err
LBB0_10:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_use_ktime,8,3                  ; @use_ktime
	.comm	_gameport_list,4,2              ; @gameport_list
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s is %s, io %#x, speed %dkHz\n"

l_.str.1:                               ; @.str.1
	.asciz	"%s is %s, speed %dkHz\n"

l_.str.2:                               ; @.str.2
	.asciz	"device_add() failed for %s (%s), error: %d\n"

	.no_dead_strip	_gameport_add_port
.subsections_via_symbols
