	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ad_write
_ad_write:                              ## @ad_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	%edx, %r14d
	movl	%esi, %r15d
	movq	%rdi, %r13
	movl	$900000, %ebx                   ## imm = 0xDBBA0
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	4(%r13), %edi
	callq	_inb
	cmpl	$128, %eax
	jne	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	leal	-1(%rbx), %eax
	cmpl	$1, %ebx
	movl	%eax, %ebx
	ja	LBB0_1
LBB0_3:
	cmpl	$31, %r15d
	jg	LBB0_5
## %bb.4:
	orb	(%r13), %r15b
	movq	%r13, %rdi
	callq	_io_Index_Addr
	jmp	LBB0_6
LBB0_5:
	movl	%r15d, %eax
	shll	$4, %eax
	shrl	$2, %r15d
	andl	$4, %r15d
	orl	%eax, %r15d
	movzbl	(%r13), %r12d
	movq	%r13, %rdi
	callq	_io_Index_Addr
	orl	$23, %r12d
	movl	%r12d, %edi
	movl	%eax, %esi
	callq	_outb
	orb	$8, %r15b
	movq	%r13, %rdi
	callq	_io_Indexed_Data
LBB0_6:
	movzbl	%r15b, %edi
	movl	%eax, %esi
	callq	_outb
	movq	%r13, %rdi
	callq	_io_Indexed_Data
	movzbl	%r14b, %edi
	movl	%eax, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_outb                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_ad_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ad_write
_ad_write:                              ; @ad_write
	.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
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	mov	w22, #48032
	movk	w22, #13, lsl #16
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20, #4]
	bl	_inb
	cmp	w0, #128
	ccmp	w22, #1, #0, eq
	sub	w22, w22, #1
	b.hi	LBB0_1
; %bb.2:
	cmp	w21, #31
	b.gt	LBB0_4
; %bb.3:
	ldrb	w8, [x20]
	and	w9, w21, #0xff
	orr	w21, w8, w9
	mov	x0, x20
	bl	_io_Index_Addr
	mov	x1, x0
	mov	x0, x21
	b	LBB0_5
LBB0_4:
	lsr	w8, w21, #2
	and	w22, w8, #0x4
	bfi	w22, w21, #4, #28
	ldrb	w21, [x20]
	mov	x0, x20
	bl	_io_Index_Addr
	mov	x1, x0
	mov	w8, #23
	orr	w0, w21, w8
	bl	_outb
	orr	w21, w22, #0x8
	mov	x0, x20
	bl	_io_Indexed_Data
	mov	x1, x0
	and	w0, w21, #0xfc
LBB0_5:
	bl	_outb
	mov	x0, x20
	bl	_io_Indexed_Data
	mov	x1, x0
	and	w0, w19, #0xff
	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	_outb
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_ad_write
.subsections_via_symbols
