	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sm501_register_uart
_sm501_register_uart:                   ## @sm501_register_uart
	.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
	movl	%esi, %r15d
	movq	%rdi, %r12
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%edx, %edx
	movl	$12, %ecx
	callq	_sm501_create_subdev
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movq	%rax, %r14
	leaq	4(%rax), %rdi
	callq	_dev_get_platdata
	movq	%rax, %rsi
	movq	_SM501_USE_UART0@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_3
## %bb.2:
	movq	%rsi, %rbx
	addq	$4, %rbx
	movq	%r12, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	movl	$196608, %edx                   ## imm = 0x30000
	callq	_sm501_setup_uart_data
	movl	(%r12), %edi
	movq	_SM501_GATE_UART0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %edx
	callq	_sm501_unit_power
	movl	(%r12), %edi
	movq	_SM501_IRQ_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4096, %edx                     ## imm = 0x1000
	xorl	%ecx, %ecx
	callq	_sm501_modify_reg
	movl	(%r12), %edi
	movq	_SM501_GPIO63_32_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$480, %edx                      ## imm = 0x1E0
	xorl	%ecx, %ecx
	callq	_sm501_modify_reg
	movq	%rbx, %rsi
LBB0_3:
	movq	_SM501_USE_UART1@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_5
## %bb.4:
	movq	%r12, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	movl	$196640, %edx                   ## imm = 0x30020
	callq	_sm501_setup_uart_data
	movl	(%r12), %edi
	movq	_SM501_GATE_UART1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %edx
	callq	_sm501_unit_power
	movl	(%r12), %edi
	movq	_SM501_IRQ_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$8192, %edx                     ## imm = 0x2000
	xorl	%ecx, %ecx
	callq	_sm501_modify_reg
	movl	(%r12), %edi
	movq	_SM501_GPIO63_32_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$7680, %edx                     ## imm = 0x1E00
	xorl	%ecx, %ecx
	callq	_sm501_modify_reg
LBB0_5:
	movq	_PLAT8250_DEV_SM501@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	movq	%r12, %rdi
	movq	%r14, %rsi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_sm501_register_device          ## TAILCALL
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"serial8250"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_SM501_USE_UART0,4,2            ## @SM501_USE_UART0
	.comm	_SM501_GATE_UART0,4,2           ## @SM501_GATE_UART0
	.comm	_SM501_IRQ_MASK,4,2             ## @SM501_IRQ_MASK
	.comm	_SM501_GPIO63_32_CONTROL,4,2    ## @SM501_GPIO63_32_CONTROL
	.comm	_SM501_USE_UART1,4,2            ## @SM501_USE_UART1
	.comm	_SM501_GATE_UART1,4,2           ## @SM501_GATE_UART1
	.comm	_PLAT8250_DEV_SM501,4,2         ## @PLAT8250_DEV_SM501
	.no_dead_strip	_sm501_register_uart
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sm501_register_uart
_sm501_register_uart:                   ; @sm501_register_uart
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w2, #0
	mov	w3, #12
	bl	_sm501_create_subdev
	cbz	x0, LBB0_6
; %bb.1:
	mov	x20, x0
	add	x0, x0, #4
	bl	_dev_get_platdata
	mov	x1, x0
Lloh2:
	adrp	x8, _SM501_USE_UART0@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SM501_USE_UART0@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x23, _SM501_IRQ_MASK@GOTPAGE
Lloh6:
	ldr	x23, [x23, _SM501_IRQ_MASK@GOTPAGEOFF]
Lloh7:
	adrp	x22, _SM501_GPIO63_32_CONTROL@GOTPAGE
Lloh8:
	ldr	x22, [x22, _SM501_GPIO63_32_CONTROL@GOTPAGEOFF]
	tst	w8, w21
	b.eq	LBB0_3
; %bb.2:
	add	x24, x1, #4
	mov	x0, x19
                                        ; kill: def $w1 killed $w1 killed $x1
	mov	w2, #196608
	bl	_sm501_setup_uart_data
	ldr	w0, [x19]
Lloh9:
	adrp	x8, _SM501_GATE_UART0@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SM501_GATE_UART0@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	w2, #1
	bl	_sm501_unit_power
	ldr	w0, [x19]
	ldr	w1, [x23]
	mov	w2, #4096
	mov	w3, #0
	bl	_sm501_modify_reg
	ldr	w0, [x19]
	ldr	w1, [x22]
	mov	w2, #480
	mov	w3, #0
	bl	_sm501_modify_reg
	mov	x1, x24
LBB0_3:
Lloh12:
	adrp	x8, _SM501_USE_UART1@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SM501_USE_UART1@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_5
; %bb.4:
	mov	x0, x19
                                        ; kill: def $w1 killed $w1 killed $x1
	mov	w2, #32
	movk	w2, #3, lsl #16
	bl	_sm501_setup_uart_data
	ldr	w0, [x19]
Lloh15:
	adrp	x8, _SM501_GATE_UART1@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SM501_GATE_UART1@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	w2, #1
	bl	_sm501_unit_power
	ldr	w0, [x19]
	ldr	w1, [x23]
	mov	w2, #8192
	mov	w3, #0
	bl	_sm501_modify_reg
	ldr	w0, [x19]
	ldr	w1, [x22]
	mov	w2, #7680
	mov	w3, #0
	bl	_sm501_modify_reg
LBB0_5:
Lloh18:
	adrp	x8, _PLAT8250_DEV_SM501@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PLAT8250_DEV_SM501@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	str	w8, [x20]
	mov	x0, x19
	mov	x1, x20
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_sm501_register_device
LBB0_6:
Lloh21:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w0, w8
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"serial8250"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_SM501_USE_UART0,4,2            ; @SM501_USE_UART0
	.comm	_SM501_GATE_UART0,4,2           ; @SM501_GATE_UART0
	.comm	_SM501_IRQ_MASK,4,2             ; @SM501_IRQ_MASK
	.comm	_SM501_GPIO63_32_CONTROL,4,2    ; @SM501_GPIO63_32_CONTROL
	.comm	_SM501_USE_UART1,4,2            ; @SM501_USE_UART1
	.comm	_SM501_GATE_UART1,4,2           ; @SM501_GATE_UART1
	.comm	_PLAT8250_DEV_SM501,4,2         ; @PLAT8250_DEV_SM501
	.no_dead_strip	_sm501_register_uart
.subsections_via_symbols
