	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tty_register_driver            ## -- Begin function tty_register_driver
	.p2align	4, 0x90
_tty_register_driver:                   ## @tty_register_driver
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	_TTY_DRIVER_DEVPTS_MEM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rdi)
	je	LBB0_7
LBB0_1:
	xorl	%r14d, %r14d
LBB0_2:
	movq	48(%r12), %rdi
	movl	44(%r12), %esi
	testq	%rdi, %rdi
	je	LBB0_3
## %bb.10:
	callq	_MKDEV
	movl	%eax, -36(%rbp)
	movl	4(%r12), %esi
	movl	40(%r12), %edx
	movl	%eax, %edi
	callq	_register_chrdev_region
	movl	%eax, %r15d
	jmp	LBB0_11
LBB0_7:
	movl	4(%r12), %edi
	testl	%edi, %edi
	je	LBB0_1
## %bb.8:
	shll	$4, %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kzalloc
	movq	%rax, %r14
	testq	%rax, %rax
	jne	LBB0_2
## %bb.9:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_21
LBB0_3:
	movl	4(%r12), %edx
	movl	40(%r12), %ecx
	leaq	-36(%rbp), %rdi
	callq	_alloc_chrdev_region
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_4
LBB0_11:
	testl	%r15d, %r15d
	js	LBB0_12
## %bb.5:
	testq	%r14, %r14
	je	LBB0_13
LBB0_6:
	movq	%r14, 24(%r12)
	movslq	4(%r12), %rax
	leaq	(%r14,%rax,8), %rax
	movq	%rax, 16(%r12)
	jmp	LBB0_14
LBB0_4:
	movl	-36(%rbp), %edi
	callq	_MAJOR
	movq	%rax, 48(%r12)
	movl	-36(%rbp), %edi
	callq	_MINOR
	movl	%eax, 44(%r12)
	testq	%r14, %r14
	jne	LBB0_6
LBB0_13:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%r12)
LBB0_14:
	leaq	32(%r12), %rbx
	movq	_tty_fops@GOTPCREL(%rip), %rsi
	movq	%rbx, %rdi
	callq	_cdev_init
	movl	4(%r12), %edx
	movl	36(%r12), %eax
	movl	%eax, 32(%r12)
	movl	-36(%rbp), %esi
	movq	%rbx, %rdi
	callq	_cdev_add
	testl	%eax, %eax
	je	LBB0_16
## %bb.15:
	movl	%eax, %r15d
	movl	-36(%rbp), %edi
	movl	4(%r12), %esi
	callq	_unregister_chrdev_region
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%r12)
LBB0_12:
	movq	%r14, %rdi
	callq	_kfree
	jmp	LBB0_21
LBB0_16:
	movq	_tty_mutex@GOTPCREL(%rip), %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	leaq	8(%r12), %rdi
	movq	_tty_drivers@GOTPCREL(%rip), %rsi
	callq	_list_add
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movq	_TTY_DRIVER_DYNAMIC_DEV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	jne	LBB0_20
## %bb.17:
	cmpl	$0, 4(%r12)
	jle	LBB0_20
## %bb.18:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_tty_register_device
	incl	%ebx
	cmpl	4(%r12), %ebx
	jl	LBB0_19
LBB0_20:
	movq	%r12, %rdi
	callq	_proc_tty_register_driver
	movq	_TTY_DRIVER_INSTALLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r12)
	xorl	%r15d, %r15d
LBB0_21:
	movl	%r15d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TTY_DRIVER_DEVPTS_MEM,4,2      ## @TTY_DRIVER_DEVPTS_MEM
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_tty_fops,4,2                   ## @tty_fops
	.comm	_tty_mutex,4,2                  ## @tty_mutex
	.comm	_tty_drivers,4,2                ## @tty_drivers
	.comm	_TTY_DRIVER_DYNAMIC_DEV,4,2     ## @TTY_DRIVER_DYNAMIC_DEV
	.comm	_TTY_DRIVER_INSTALLED,4,2       ## @TTY_DRIVER_INSTALLED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tty_register_driver            ; -- Begin function tty_register_driver
	.p2align	2
_tty_register_driver:                   ; @tty_register_driver
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x0
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _TTY_DRIVER_DEVPTS_MEM@GOTPAGE
Lloh1:
	ldr	x9, [x9, _TTY_DRIVER_DEVPTS_MEM@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
LBB0_1:
	mov	x20, #0
LBB0_2:
	ldr	x0, [x19, #48]
	ldr	w1, [x19, #44]
	cbz	x0, LBB0_7
; %bb.3:
	bl	_MKDEV
	str	w0, [sp, #12]
	ldr	w1, [x19, #4]
	ldr	w2, [x19, #40]
	bl	_register_chrdev_region
	mov	x21, x0
	b	LBB0_8
LBB0_4:
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_1
; %bb.5:
	lsl	w0, w8, #4
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_kzalloc
	mov	x20, x0
	cbnz	x0, LBB0_2
; %bb.6:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_21
LBB0_7:
	ldr	w2, [x19, #4]
	ldr	w3, [x19, #40]
	add	x0, sp, #12
	bl	_alloc_chrdev_region
	mov	x21, x0
	cbz	w0, LBB0_11
LBB0_8:
	tbnz	w21, #31, LBB0_15
; %bb.9:
	cbz	x20, LBB0_12
LBB0_10:
	ldrsw	x8, [x19, #4]
	add	x8, x20, x8, lsl #3
	stp	x8, x20, [x19, #16]
	b	LBB0_13
LBB0_11:
	ldr	w0, [sp, #12]
	bl	_MAJOR
	str	x0, [x19, #48]
	ldr	w0, [sp, #12]
	bl	_MINOR
	str	w0, [x19, #44]
	cbnz	x20, LBB0_10
LBB0_12:
	stp	xzr, xzr, [x19, #16]
LBB0_13:
	add	x21, x19, #32
Lloh9:
	adrp	x1, _tty_fops@GOTPAGE
Lloh10:
	ldr	x1, [x1, _tty_fops@GOTPAGEOFF]
	mov	x0, x21
	bl	_cdev_init
	ldr	w8, [x19, #36]
	str	w8, [x19, #32]
	ldr	w1, [sp, #12]
	ldr	w2, [x19, #4]
	mov	x0, x21
	bl	_cdev_add
	cbz	w0, LBB0_16
; %bb.14:
	mov	x21, x0
	ldr	w0, [sp, #12]
	ldr	w1, [x19, #4]
	bl	_unregister_chrdev_region
	stp	xzr, xzr, [x19, #16]
LBB0_15:
	mov	x0, x20
	bl	_kfree
	b	LBB0_21
LBB0_16:
Lloh11:
	adrp	x20, _tty_mutex@GOTPAGE
Lloh12:
	ldr	x20, [x20, _tty_mutex@GOTPAGEOFF]
	mov	x0, x20
	bl	_mutex_lock
	add	x0, x19, #8
Lloh13:
	adrp	x1, _tty_drivers@GOTPAGE
Lloh14:
	ldr	x1, [x1, _tty_drivers@GOTPAGEOFF]
	bl	_list_add
	mov	x0, x20
	bl	_mutex_unlock
	ldr	w8, [x19]
Lloh15:
	adrp	x9, _TTY_DRIVER_DYNAMIC_DEV@GOTPAGE
Lloh16:
	ldr	x9, [x9, _TTY_DRIVER_DYNAMIC_DEV@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_20
; %bb.17:
	ldr	w8, [x19, #4]
	cmp	w8, #1
	b.lt	LBB0_20
; %bb.18:
	mov	w20, #0
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x20
	mov	x2, #0
	bl	_tty_register_device
	add	w20, w20, #1
	ldr	w8, [x19, #4]
	cmp	w20, w8
	b.lt	LBB0_19
LBB0_20:
	mov	x0, x19
	bl	_proc_tty_register_driver
	mov	w21, #0
Lloh18:
	adrp	x8, _TTY_DRIVER_INSTALLED@GOTPAGE
Lloh19:
	ldr	x8, [x8, _TTY_DRIVER_INSTALLED@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
LBB0_21:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_TTY_DRIVER_DEVPTS_MEM,4,2      ; @TTY_DRIVER_DEVPTS_MEM
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_tty_fops,4,2                   ; @tty_fops
	.comm	_tty_mutex,4,2                  ; @tty_mutex
	.comm	_tty_drivers,4,2                ; @tty_drivers
	.comm	_TTY_DRIVER_DYNAMIC_DEV,4,2     ; @TTY_DRIVER_DYNAMIC_DEV
	.comm	_TTY_DRIVER_INSTALLED,4,2       ; @TTY_DRIVER_INSTALLED
.subsections_via_symbols
