	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function maceps2_allocate_port
_maceps2_allocate_port:                 ## @maceps2_allocate_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
	movl	%edi, %r14d
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$40, %edi
	callq	_kzalloc
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_SERIO_8042@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 36(%rbx)
	movq	_maceps2_write@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	movq	_maceps2_open@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%rbx)
	movq	_maceps2_close@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movl	20(%rbx), %edi
	leaq	L_.str(%rip), %rdx
	movl	$4, %esi
	movl	%r14d, %ecx
	callq	_snprintf
	movl	16(%rbx), %edi
	leaq	L_.str.1(%rip), %rdx
	movl	$4, %esi
	movl	%r14d, %ecx
	callq	_snprintf
	movq	_port_data@GOTPCREL(%rip), %rax
	movslq	%r14d, %rcx
	shlq	$2, %rcx
	addq	(%rax), %rcx
	movq	%rcx, 8(%rbx)
	movq	_maceps2_device@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rbx)
LBB0_2:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_SERIO_8042,4,2                 ## @SERIO_8042
	.comm	_maceps2_write,4,2              ## @maceps2_write
	.comm	_maceps2_open,4,2               ## @maceps2_open
	.comm	_maceps2_close,4,2              ## @maceps2_close
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MACE PS/2 port%d"

L_.str.1:                               ## @.str.1
	.asciz	"mace/serio%d"

	.comm	_port_data,8,3                  ## @port_data
	.comm	_maceps2_device,8,3             ## @maceps2_device
	.no_dead_strip	_maceps2_allocate_port
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function maceps2_allocate_port
_maceps2_allocate_port:                 ; @maceps2_allocate_port
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #40
	bl	_kzalloc
	mov	x20, x0
	cbz	x0, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _SERIO_8042@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SERIO_8042@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _maceps2_write@GOTPAGE
Lloh7:
	ldr	x9, [x9, _maceps2_write@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #32]
Lloh9:
	adrp	x8, _maceps2_open@GOTPAGE
Lloh10:
	ldr	x8, [x8, _maceps2_open@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _maceps2_close@GOTPAGE
Lloh13:
	ldr	x9, [x9, _maceps2_close@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #24]
	ldr	w0, [x20, #20]
Lloh15:
	adrp	x2, l_.str@PAGE
Lloh16:
	add	x2, x2, l_.str@PAGEOFF
	mov	w1, #4
	mov	x3, x19
	bl	_snprintf
	ldr	w0, [x20, #16]
Lloh17:
	adrp	x2, l_.str.1@PAGE
Lloh18:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	w1, #4
	mov	x3, x19
	bl	_snprintf
Lloh19:
	adrp	x8, _port_data@GOTPAGE
Lloh20:
	ldr	x8, [x8, _port_data@GOTPAGEOFF]
Lloh21:
	ldr	x8, [x8]
	add	x8, x8, w19, sxtw #2
Lloh22:
	adrp	x9, _maceps2_device@GOTPAGE
Lloh23:
	ldr	x9, [x9, _maceps2_device@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	stp	x9, x8, [x20]
LBB0_2:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_SERIO_8042,4,2                 ; @SERIO_8042
	.comm	_maceps2_write,4,2              ; @maceps2_write
	.comm	_maceps2_open,4,2               ; @maceps2_open
	.comm	_maceps2_close,4,2              ; @maceps2_close
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MACE PS/2 port%d"

l_.str.1:                               ; @.str.1
	.asciz	"mace/serio%d"

	.comm	_port_data,8,3                  ; @port_data
	.comm	_maceps2_device,8,3             ; @maceps2_device
	.no_dead_strip	_maceps2_allocate_port
.subsections_via_symbols
