	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bochs_wait                     ## -- Begin function bochs_wait
	.p2align	4, 0x90
_bochs_wait:                            ## @bochs_wait
	.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
	movq	%rdi, %r12
	callq	_bochs_reset_buffer
	movl	8(%r12), %edi
	movq	_F_GETFL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	xorl	%eax, %eax
	callq	_fcntl
	movl	8(%r12), %edi
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	orl	%eax, %esi
	xorl	%eax, %eax
	callq	_fcntl
	movq	_lpTmpBuffer@GOTPCREL(%rip), %r13
	movq	_SIZE_BUF@GOTPCREL(%rip), %r14
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	shlq	$2, %rdi
	addq	16(%r12), %rdi
	incl	%ebx
	movl	%ebx, %edx
	callq	_memcpy
	addq	%r15, (%r12)
	movq	16(%r12), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_strstr
	testq	%rax, %rax
	jne	LBB0_5
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	8(%r12), %edi
	movq	(%r13), %rsi
	movl	(%r14), %edx
	decl	%edx
	callq	_read
	testl	%eax, %eax
	jle	LBB0_1
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%eax, %ebx
	movq	(%r13), %rsi
	movl	%eax, %r15d
	movq	$0, (%rsi,%r15,8)
	movq	(%r12), %rdi
	leaq	(%rdi,%r15), %rax
	movslq	(%r14), %rcx
	decq	%rcx
	cmpq	%rcx, %rax
	jb	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%r12, %rdi
	callq	_bochs_reset_buffer
	movq	(%r12), %rdi
	movq	(%r13), %rsi
	jmp	LBB0_4
LBB0_5:
	movl	8(%r12), %edi
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	orl	%eax, %esi
	xorl	%eax, %eax
	callq	_fcntl
	movl	$1, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_F_GETFL,4,2                    ## @F_GETFL
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
	.comm	_lpTmpBuffer,8,3                ## @lpTmpBuffer
	.comm	_SIZE_BUF,4,2                   ## @SIZE_BUF
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"<bochs:"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bochs_wait                     ; -- Begin function bochs_wait
	.p2align	2
_bochs_wait:                            ; @bochs_wait
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x19, x0
	bl	_bochs_reset_buffer
	ldr	w0, [x19, #8]
Lloh0:
	adrp	x8, _F_GETFL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _F_GETFL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	str	xzr, [sp]
	bl	_fcntl
	mov	x20, x0
	ldr	w0, [x19, #8]
Lloh3:
	adrp	x23, _O_NONBLOCK@GOTPAGE
Lloh4:
	ldr	x23, [x23, _O_NONBLOCK@GOTPAGEOFF]
	ldr	w8, [x23]
	orr	w1, w8, w20
	bl	_fcntl
Lloh5:
	adrp	x24, _lpTmpBuffer@GOTPAGE
Lloh6:
	ldr	x24, [x24, _lpTmpBuffer@GOTPAGEOFF]
Lloh7:
	adrp	x25, _SIZE_BUF@GOTPAGE
Lloh8:
	ldr	x25, [x25, _SIZE_BUF@GOTPAGEOFF]
Lloh9:
	adrp	x21, l_.str@PAGE
Lloh10:
	add	x21, x21, l_.str@PAGEOFF
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	x9, [x19, #16]
	add	x0, x9, x8, lsl #2
	add	w2, w22, #1
	bl	_memcpy
	ldr	x8, [x19]
	add	x8, x8, x26
	str	x8, [x19]
	ldr	x0, [x19, #16]
	mov	x1, x21
	bl	_strstr
	cbnz	x0, LBB0_5
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19, #8]
	ldr	x1, [x24]
	ldr	w8, [x25]
	sub	w2, w8, #1
	bl	_read
	cmp	w0, #1
	b.lt	LBB0_2
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x22, x0
	ldr	x1, [x24]
	str	xzr, [x1, w0, uxtw #3]
	mov	w26, w0
	ldr	x8, [x19]
	ldrsw	x9, [x25]
	sub	x9, x9, #1
	add	x10, x8, x26
	cmp	x10, x9
	b.lo	LBB0_1
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x19
	bl	_bochs_reset_buffer
	ldr	x8, [x19]
	ldr	x1, [x24]
	b	LBB0_1
LBB0_5:
	ldr	w0, [x19, #8]
	ldr	w8, [x23]
	orn	w1, w20, w8
	bl	_fcntl
	mov	w0, #1
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_F_GETFL,4,2                    ; @F_GETFL
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
	.comm	_lpTmpBuffer,8,3                ; @lpTmpBuffer
	.comm	_SIZE_BUF,4,2                   ; @SIZE_BUF
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"<bochs:"

.subsections_via_symbols
