	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amiga_write
_amiga_write:                           ## @amiga_write
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	movq	_raw_buf@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	andl	$3, %r14d
	movq	_unit@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movq	%r14, %r13
	shlq	$4, %r13
	movq	(%rax,%r13), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, %ecx
	je	LBB0_1
## %bb.2:
	imull	$415, %ecx, %eax                ## imm = 0x19F
	cmpl	$2, %eax
	movl	$1, %ebx
	cmovael	%eax, %ebx
	leaq	(,%rbx,8), %rdx
	leaq	L_.memset_pattern(%rip), %rsi
	movq	%r15, %rdi
	callq	_memset_pattern16
	decl	%ebx
	leaq	(%r15,%rbx,8), %r15
	addq	$8, %r15
	movq	(%r12), %rax
	movq	(%rax,%r13), %rcx
	movl	(%rcx), %ecx
	jmp	LBB0_3
LBB0_1:
	xorl	%ecx, %ecx
LBB0_3:
	movq	8(%rax,%r13), %rax
	imull	(%rax), %ecx
	testl	%ecx, %ecx
	je	LBB0_6
## %bb.4:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r14d, %edi
	movq	%r15, %rsi
	movl	%ebx, %edx
	callq	_putsec
	movq	%rax, %r15
	incl	%ebx
	movq	(%r12), %rax
	movq	(%rax,%r13), %rcx
	movq	8(%rax,%r13), %rax
	movl	(%rcx), %ecx
	imull	(%rax), %ecx
	cmpl	%ecx, %ebx
	jb	LBB0_5
LBB0_6:
	xorl	%eax, %eax
	testb	$1, -8(%r15)
	sete	%al
	shll	$15, %eax
	orl	$10920, %eax                    ## imm = 0x2AA8
	movl	%eax, (%r15)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_raw_buf,8,3                    ## @raw_buf
	.comm	_unit,8,3                       ## @unit
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## @.memset_pattern
L_.memset_pattern:
	.quad	2863311530                      ## 0xaaaaaaaa
	.quad	2863311530                      ## 0xaaaaaaaa

	.no_dead_strip	_amiga_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amiga_write
_amiga_write:                           ; @amiga_write
	.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
Lloh0:
	adrp	x8, _raw_buf@GOTPAGE
Lloh1:
	ldr	x8, [x8, _raw_buf@GOTPAGEOFF]
Lloh2:
	ldr	x19, [x8]
Lloh3:
	adrp	x22, _unit@GOTPAGE
Lloh4:
	ldr	x22, [x22, _unit@GOTPAGEOFF]
	and	w20, w0, #0x3
	ldr	x8, [x22]
	lsl	x21, x20, #4
	ldr	x9, [x8, x21]
	ldr	w9, [x9]
	cbz	w9, LBB0_2
; %bb.1:
	mov	w8, #415
	mul	w8, w9, w8
	cmp	w8, #1
	csinc	w23, w8, wzr, hi
	lsl	x2, x23, #3
Lloh5:
	adrp	x1, l_.memset_pattern@PAGE
Lloh6:
	add	x1, x1, l_.memset_pattern@PAGEOFF
	mov	x0, x19
	bl	_memset_pattern16
	sub	w8, w23, #1
	add	x8, x19, w8, uxtw #3
	add	x19, x8, #8
	ldr	x8, [x22]
	ldr	x9, [x8, x21]
	ldr	w9, [x9]
LBB0_2:
	add	x8, x8, x20, lsl #4
	ldr	x8, [x8, #8]
	ldr	w8, [x8]
	mul	w8, w9, w8
	cbz	w8, LBB0_5
; %bb.3:
	mov	w21, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	bl	_putsec
	mov	x19, x0
	add	w21, w21, #1
	ldr	x8, [x22]
	add	x8, x8, x20, lsl #4
	ldp	x8, x9, [x8]
	ldr	w9, [x9]
	ldr	w8, [x8]
	mul	w8, w8, w9
	cmp	w21, w8
	b.lo	LBB0_4
LBB0_5:
	ldur	x8, [x19, #-8]
	tst	x8, #0x1
	mov	w8, #10920
	mov	w9, #43688
	csel	w8, w9, w8, eq
	str	w8, [x19]
	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 AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_raw_buf,8,3                    ; @raw_buf
	.comm	_unit,8,3                       ; @unit
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ; @.memset_pattern
l_.memset_pattern:
	.quad	2863311530                      ; 0xaaaaaaaa
	.quad	2863311530                      ; 0xaaaaaaaa

	.no_dead_strip	_amiga_write
.subsections_via_symbols
