	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ESC_UpdatePatches              ## -- Begin function ESC_UpdatePatches
	.p2align	4, 0x90
_ESC_UpdatePatches:                     ## @ESC_UpdatePatches
	.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	_Atari800_machine_type@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_Atari800_MACHINE_5200@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
LBB0_6:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_1:
	movq	_Atari800_MACHINE_XLXE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.2:
	movq	_PIA_PORTB@GOTPCREL(%rip), %rcx
	testb	$1, (%rcx)
	je	LBB0_6
LBB0_3:
	movq	_Atari800_MACHINE_800@GOTPCREL(%rip), %rcx
	movl	$55296, %ebx                    ## imm = 0xD800
	movl	$49152, %r14d                   ## imm = 0xC000
	cmpq	(%rcx), %rax
	cmovel	%ebx, %r14d
	je	LBB0_5
## %bb.4:
	movq	_MEMORY_os@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movl	$53248, %edx                    ## imm = 0xD000
	subl	%r14d, %edx
	movl	%r14d, %esi
	callq	_MEMORY_dCopyToMem
LBB0_5:
	movq	_MEMORY_os@GOTPCREL(%rip), %rax
	subl	%r14d, %ebx
	addq	(%rax), %rbx
	movq	%rbx, %rdi
	movl	$55296, %esi                    ## imm = 0xD800
	movl	$10240, %edx                    ## imm = 0x2800
	callq	_MEMORY_dCopyToMem
	xorl	%eax, %eax
	callq	_ESC_PatchOS
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_Devices_UpdatePatches          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_Atari800_machine_type,8,3      ## @Atari800_machine_type
	.comm	_Atari800_MACHINE_5200,8,3      ## @Atari800_MACHINE_5200
	.comm	_Atari800_MACHINE_XLXE,8,3      ## @Atari800_MACHINE_XLXE
	.comm	_PIA_PORTB,4,2                  ## @PIA_PORTB
	.comm	_Atari800_MACHINE_800,8,3       ## @Atari800_MACHINE_800
	.comm	_MEMORY_os,8,3                  ## @MEMORY_os
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ESC_UpdatePatches              ; -- Begin function ESC_UpdatePatches
	.p2align	2
_ESC_UpdatePatches:                     ; @ESC_UpdatePatches
	.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
Lloh0:
	adrp	x8, _Atari800_machine_type@GOTPAGE
Lloh1:
	ldr	x8, [x8, _Atari800_machine_type@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _Atari800_MACHINE_5200@GOTPAGE
Lloh4:
	ldr	x9, [x9, _Atari800_MACHINE_5200@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
LBB0_1:
	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_2:
Lloh6:
	adrp	x9, _Atari800_MACHINE_XLXE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _Atari800_MACHINE_XLXE@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
Lloh9:
	adrp	x9, _PIA_PORTB@GOTPAGE
Lloh10:
	ldr	x9, [x9, _PIA_PORTB@GOTPAGEOFF]
	ldrb	w9, [x9]
	tbz	w9, #0, LBB0_1
LBB0_4:
Lloh11:
	adrp	x9, _Atari800_MACHINE_800@GOTPAGE
Lloh12:
	ldr	x9, [x9, _Atari800_MACHINE_800@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	mov	w10, #49152
	mov	w20, #55296
Lloh14:
	adrp	x21, _MEMORY_os@GOTPAGE
Lloh15:
	ldr	x21, [x21, _MEMORY_os@GOTPAGEOFF]
	cmp	x8, x9
	csel	w19, w20, w10, eq
	b.eq	LBB0_6
; %bb.5:
	ldr	x0, [x21]
	mov	w8, #53248
	sub	w2, w8, w19
	mov	x1, x19
	bl	_MEMORY_dCopyToMem
LBB0_6:
	ldr	x8, [x21]
	sub	w9, w20, w19
	add	x0, x8, x9
	mov	w1, #55296
	mov	w2, #10240
	bl	_MEMORY_dCopyToMem
	bl	_ESC_PatchOS
	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
	b	_Devices_UpdatePatches
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_Atari800_machine_type,8,3      ; @Atari800_machine_type
	.comm	_Atari800_MACHINE_5200,8,3      ; @Atari800_MACHINE_5200
	.comm	_Atari800_MACHINE_XLXE,8,3      ; @Atari800_MACHINE_XLXE
	.comm	_PIA_PORTB,4,2                  ; @PIA_PORTB
	.comm	_Atari800_MACHINE_800,8,3       ; @Atari800_MACHINE_800
	.comm	_MEMORY_os,8,3                  ; @MEMORY_os
.subsections_via_symbols
