	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function Devices_H_Load
_Devices_H_Load:                        ## @Devices_H_Load
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, -60(%rbp)                 ## 4-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_devbug@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_Log_print
LBB0_2:
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_Devices_GetNumber
	movq	_h_devnum@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movq	_Devices_h_exe_path@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_10 Depth 2
	movb	(%r12), %al
	cmpb	$72, %al
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	testb	%al, %al
	jne	LBB0_5
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movsbq	1(%r12), %r15
	leal	-49(%r15), %eax
	cmpb	$3, %al
	ja	LBB0_5
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpb	$58, 2(%r12)
	jne	LBB0_5
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	addq	$-49, %r15
	addq	$3, %r12
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_h_devnum@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_10:                                ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movzbl	(%r12,%rbx), %eax
	testb	%al, %al
	je	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=2
	cmpb	$59, %al
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=2
	incq	%rbx
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	_atari_filename@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	leaq	(%r14,%rbx), %r13
	testq	%rbx, %rbx
	je	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	movq	%r12, %rsi
	movl	%ebx, %edx
	callq	_memcpy
	movsbl	-1(%r12,%rbx), %edi
	callq	_IS_DIR_SEP
	testl	%eax, %eax
	jne	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_3 Depth=1
	leaq	(%r14,%rbx), %r13
	incq	%r13
	movb	$62, (%r14,%rbx)
LBB0_16:                                ##   in Loop: Header=BB0_3 Depth=1
	movslq	%r15d, %r14
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_Devices_GetAtariPath
	testq	%rax, %rax
	je	LBB0_27
## %bb.17:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	_host_path@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movq	_Devices_atari_h_dir@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%r14,4), %esi
	movq	_atari_path@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_Util_catpath
	movl	(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_fopen
	movq	_binf@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	testq	%rax, %rax
	jne	LBB0_23
## %bb.18:                              ##   in Loop: Header=BB0_3 Depth=1
	cmpb	$0, (%r12,%rbx)
	leaq	1(%r12,%rbx), %r12
	jne	LBB0_3
LBB0_20:
	movq	_h_devnum@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_atari_filename@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	callq	_Devices_GetAtariPath
	testq	%rax, %rax
	je	LBB0_27
## %bb.21:
	movq	_host_path@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	movq	_Devices_atari_h_dir@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_h_devnum@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %esi
	movq	_atari_path@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_Util_catpath
	movl	(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_fopen
	movq	_binf@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	testq	%rax, %rax
	jne	LBB0_23
## %bb.22:
	movq	_CPU_regY@GOTPCREL(%rip), %rax
	movl	$170, (%rax)
	jmp	LBB0_27
LBB0_19:
	movq	_binf@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_20
LBB0_23:
	leaq	-56(%rbp), %rdi
	movl	$1, %esi
	movl	$2, %edx
	movq	%rax, %rcx
	callq	_fread
	cmpl	$2, %eax
	jne	LBB0_26
## %bb.24:
	cmpl	$255, -56(%rbp)
	jne	LBB0_26
## %bb.25:
	cmpl	$255, -52(%rbp)
	jne	LBB0_26
## %bb.29:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_31
## %bb.30:
	movl	-60(%rbp), %edi                 ## 4-byte Reload
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_Devices_H_LoadProceed          ## TAILCALL
LBB0_26:
	movq	_binf@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	callq	_fclose
	movq	$0, (%rbx)
	leaq	L_.str.2(%rip), %rdi
	callq	_Log_print
	movq	_CPU_regY@GOTPCREL(%rip), %rax
	movl	$180, (%rax)
LBB0_27:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_31
## %bb.28:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_31:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_devbug,8,3                     ## @devbug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"LOAD Command"

	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_h_devnum,8,3                   ## @h_devnum
	.comm	_Devices_h_exe_path,8,3         ## @Devices_h_exe_path
	.comm	_atari_filename,8,3             ## @atari_filename
	.comm	_host_path,4,2                  ## @host_path
	.comm	_Devices_atari_h_dir,8,3        ## @Devices_atari_h_dir
	.comm	_atari_path,4,2                 ## @atari_path
L_.str.1:                               ## @.str.1
	.asciz	"rb"

	.comm	_binf,8,3                       ## @binf
	.comm	_CPU_regY,4,2                   ## @CPU_regY
	.comm	_CPU_SetN,4,2                   ## @CPU_SetN
L_.str.2:                               ## @.str.2
	.asciz	"H: load: not valid BIN file"

	.no_dead_strip	_Devices_H_Load
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function Devices_H_Load
_Devices_H_Load:                        ; @Devices_H_Load
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	str	w0, [sp, #12]                   ; 4-byte Folded Spill
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
Lloh3:
	adrp	x8, _devbug@GOTPAGE
Lloh4:
	ldr	x8, [x8, _devbug@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Log_print
LBB0_2:
Lloh8:
	adrp	x8, _FALSE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_Devices_GetNumber
Lloh11:
	adrp	x27, _h_devnum@GOTPAGE
Lloh12:
	ldr	x27, [x27, _h_devnum@GOTPAGEOFF]
	str	x0, [x27]
Lloh13:
	adrp	x8, _Devices_h_exe_path@GOTPAGE
Lloh14:
	ldr	x8, [x8, _Devices_h_exe_path@GOTPAGEOFF]
Lloh15:
	adrp	x25, _atari_filename@GOTPAGE
Lloh16:
	ldr	x25, [x25, _atari_filename@GOTPAGEOFF]
Lloh17:
	adrp	x26, _host_path@GOTPAGE
Lloh18:
	ldr	x26, [x26, _host_path@GOTPAGEOFF]
Lloh19:
	adrp	x19, _Devices_atari_h_dir@GOTPAGE
Lloh20:
	ldr	x19, [x19, _Devices_atari_h_dir@GOTPAGEOFF]
Lloh21:
	ldr	x20, [x8]
Lloh22:
	adrp	x21, l_.str.1@PAGE
Lloh23:
	add	x21, x21, l_.str.1@PAGEOFF
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
	ldrb	w8, [x20]
	cmp	w8, #72
	b.eq	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	cbnz	w8, LBB0_8
	b	LBB0_22
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldrsb	x8, [x20, #1]
	sub	w9, w8, #49
	and	w9, w9, #0xff
	cmp	w9, #3
	b.hi	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	ldrb	w9, [x20, #2]
	cmp	w9, #58
	b.ne	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	sub	x28, x8, #49
	add	x20, x20, #3
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x28, [x27]
LBB0_9:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x22, #0
	ldrb	w8, [x20, x22]
	cbz	w8, LBB0_12
LBB0_10:                                ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cmp	w8, #59
	b.eq	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=2
	add	x22, x22, #1
	ldrb	w8, [x20, x22]
	cbnz	w8, LBB0_10
LBB0_12:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x24, [x25]
	add	x23, x24, x22
	cbz	x22, LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x24
	mov	x1, x20
	mov	x2, x22
	bl	_memcpy
	add	x8, x20, x22
	ldursb	w0, [x8, #-1]
	bl	_IS_DIR_SEP
	cbnz	w0, LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_3 Depth=1
	add	x23, x24, x22
	mov	w8, #62
	strb	w8, [x23], #1
LBB0_15:                                ;   in Loop: Header=BB0_3 Depth=1
	sxtw	x24, w28
	mov	x0, x24
	mov	x1, x23
	bl	_Devices_GetAtariPath
	cbz	x0, LBB0_30
; %bb.16:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x26]
	ldr	x8, [x19]
	ldr	w1, [x8, x24, lsl #2]
Lloh24:
	adrp	x8, _atari_path@GOTPAGE
Lloh25:
	ldr	x8, [x8, _atari_path@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	bl	_Util_catpath
	ldr	w0, [x26]
	mov	x1, x21
	bl	_fopen
Lloh27:
	adrp	x8, _binf@GOTPAGE
Lloh28:
	ldr	x8, [x8, _binf@GOTPAGEOFF]
Lloh29:
	str	x0, [x8]
	cbnz	x0, LBB0_21
; %bb.17:                               ;   in Loop: Header=BB0_3 Depth=1
	add	x20, x20, x22
	ldrb	w8, [x20], #1
	cbnz	w8, LBB0_3
LBB0_18:
	ldr	x0, [x27]
	ldr	x1, [x25]
	bl	_Devices_GetAtariPath
	cbz	x0, LBB0_30
; %bb.19:
	ldr	w0, [x26]
	ldr	x8, [x19]
	ldr	x9, [x27]
	ldr	w1, [x8, x9, lsl #2]
Lloh30:
	adrp	x8, _atari_path@GOTPAGE
Lloh31:
	ldr	x8, [x8, _atari_path@GOTPAGEOFF]
Lloh32:
	ldr	w2, [x8]
	bl	_Util_catpath
	ldr	w0, [x26]
Lloh33:
	adrp	x1, l_.str.1@PAGE
Lloh34:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_fopen
	mov	x3, x0
Lloh35:
	adrp	x8, _binf@GOTPAGE
Lloh36:
	ldr	x8, [x8, _binf@GOTPAGEOFF]
Lloh37:
	str	x0, [x8]
	cbnz	x0, LBB0_23
; %bb.20:
Lloh38:
	adrp	x8, _CPU_regY@GOTPAGE
Lloh39:
	ldr	x8, [x8, _CPU_regY@GOTPAGEOFF]
	mov	w9, #170
	b	LBB0_29
LBB0_21:
	mov	x3, x0
	b	LBB0_23
LBB0_22:
Lloh40:
	adrp	x8, _binf@GOTPAGE
Lloh41:
	ldr	x8, [x8, _binf@GOTPAGEOFF]
Lloh42:
	ldr	x3, [x8]
	cbz	x3, LBB0_18
LBB0_23:
	add	x0, sp, #16
	mov	w1, #1
	mov	w2, #2
	bl	_fread
	cmp	w0, #2
	b.ne	LBB0_28
; %bb.24:
	ldr	w8, [sp, #16]
	cmp	w8, #255
	b.ne	LBB0_28
; %bb.25:
	ldr	w8, [sp, #20]
	cmp	w8, #255
	b.ne	LBB0_28
; %bb.26:
	ldr	x8, [sp, #24]
Lloh43:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh44:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh45:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_32
; %bb.27:
	ldr	w0, [sp, #12]                   ; 4-byte Folded Reload
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_Devices_H_LoadProceed
LBB0_28:
Lloh46:
	adrp	x19, _binf@GOTPAGE
Lloh47:
	ldr	x19, [x19, _binf@GOTPAGEOFF]
	ldr	x0, [x19]
	bl	_fclose
	str	xzr, [x19]
Lloh48:
	adrp	x0, l_.str.2@PAGE
Lloh49:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_Log_print
Lloh50:
	adrp	x8, _CPU_regY@GOTPAGE
Lloh51:
	ldr	x8, [x8, _CPU_regY@GOTPAGEOFF]
	mov	w9, #180
LBB0_29:
	str	w9, [x8]
LBB0_30:
	ldr	x8, [sp, #24]
Lloh52:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh53:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh54:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_32
; %bb.31:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_32:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh21
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotStr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotStr	Lloh35, Lloh36, Lloh37
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGot	Lloh50, Lloh51
	.loh AdrpAdd	Lloh48, Lloh49
	.loh AdrpLdrGot	Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.cfi_endproc
                                        ; -- End function
	.comm	_devbug,8,3                     ; @devbug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"LOAD Command"

	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_h_devnum,8,3                   ; @h_devnum
	.comm	_Devices_h_exe_path,8,3         ; @Devices_h_exe_path
	.comm	_atari_filename,8,3             ; @atari_filename
	.comm	_host_path,4,2                  ; @host_path
	.comm	_Devices_atari_h_dir,8,3        ; @Devices_atari_h_dir
	.comm	_atari_path,4,2                 ; @atari_path
l_.str.1:                               ; @.str.1
	.asciz	"rb"

	.comm	_binf,8,3                       ; @binf
	.comm	_CPU_regY,4,2                   ; @CPU_regY
	.comm	_CPU_SetN,4,2                   ; @CPU_SetN
l_.str.2:                               ; @.str.2
	.asciz	"H: load: not valid BIN file"

	.no_dead_strip	_Devices_H_Load
.subsections_via_symbols
