	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bochs_open                     ## -- Begin function bochs_open
	.p2align	4, 0x90
_bochs_open:                            ## @bochs_open
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	%rsi, %r15
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_SIZE_BUF@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	callq	_malloc
	movq	%rax, 72(%r13)
	xorl	%r14d, %r14d
	testq	%rax, %rax
	je	LBB0_24
## %bb.1:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movl	(%r12), %edi
	callq	_malloc
	movq	_lpTmpBuffer@GOTPCREL(%rip), %r12
	movq	%rax, (%r12)
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	leaq	-56(%rbp), %rdi
	callq	_pipe
	testq	%rax, %rax
	js	LBB0_4
## %bb.6:
	leaq	-64(%rbp), %rdi
	callq	_pipe
	testq	%rax, %rax
	js	LBB0_7
## %bb.8:
	xorl	%eax, %eax
	callq	_fork
	testl	%eax, %eax
	je	LBB0_9
## %bb.16:
	jle	LBB0_22
## %bb.17:
	movl	%eax, %ebx
	movl	-56(%rbp), %edi
	callq	_close
	movl	-60(%rbp), %edi
	callq	_close
	movl	-64(%rbp), %edi
	movq	(%r12), %rsi
	movl	$1, %edx
	callq	_read
	cmpl	$1, %eax
	jne	LBB0_18
## %bb.20:
	movl	-64(%rbp), %eax
	movl	%eax, (%r13)
	movl	-52(%rbp), %eax
	movl	%eax, 12(%r13)
	movl	$1, 16(%r13)
	movq	%r13, %rdi
	callq	_bochs_reset_buffer
	leaq	L_.str.9(%rip), %rdi
	callq	_eprintf
	movq	%r13, %rdi
	callq	_bochs_wait
	testq	%rax, %rax
	je	LBB0_19
## %bb.21:
	leaq	L_.str.10(%rip), %rdi
	callq	_eprintf
	movl	%ebx, 20(%r13)
	movl	$1, %r14d
	jmp	LBB0_24
LBB0_2:
	movq	72(%r13), %rdi
	callq	_R_FREE
	jmp	LBB0_24
LBB0_4:
	leaq	L_.str(%rip), %rdi
	callq	_eprintf
	jmp	LBB0_23
LBB0_7:
	movl	-56(%rbp), %edi
	callq	_close
	movl	-52(%rbp), %edi
	callq	_close
	leaq	L_.str.1(%rip), %rdi
	callq	_eprintf
	jmp	LBB0_23
LBB0_9:
	movl	-56(%rbp), %edi
	movq	_STDIN_FILENO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_dup2
	cmpl	$-1, %eax
	je	LBB0_10
## %bb.11:
	movl	-60(%rbp), %edi
	movq	_STDOUT_FILENO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_dup2
	cmpl	$-1, %eax
	je	LBB0_12
## %bb.13:
	movl	-60(%rbp), %edi
	movq	_STDERR_FILENO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_dup2
	cmpl	$-1, %eax
	jne	LBB0_15
## %bb.14:
	leaq	L_.str.4(%rip), %rdi
	callq	_eprintf
	jmp	LBB0_23
LBB0_18:
	leaq	L_.str.8(%rip), %rdi
	callq	_eprintf
LBB0_19:
	movq	%r13, %rdi
	callq	_bochs_close
	jmp	LBB0_23
LBB0_10:
	leaq	L_.str.2(%rip), %rdi
	callq	_eprintf
	jmp	LBB0_23
LBB0_12:
	leaq	L_.str.3(%rip), %rdi
	callq	_eprintf
	jmp	LBB0_23
LBB0_22:
	leaq	-56(%rbp), %rdi
	leaq	-64(%rbp), %rcx
	movq	%rdi, %rsi
	movq	%rcx, %rdx
	callq	_bochs_open.cold.1
LBB0_23:
	xorl	%r14d, %r14d
LBB0_24:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_26
## %bb.25:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_26:
	callq	___stack_chk_fail
LBB0_15:
	movl	-56(%rbp), %edi
	callq	_close
	movl	-52(%rbp), %edi
	callq	_close
	movl	-64(%rbp), %edi
	callq	_close
	movl	-60(%rbp), %edi
	callq	_close
	leaq	L_.str.5(%rip), %rdx
	leaq	L_.str.6(%rip), %rcx
	movq	%r15, %rdi
	movq	%r15, %rsi
	movq	-72(%rbp), %r8                  ## 8-byte Reload
	xorl	%r9d, %r9d
	callq	_execl
	leaq	L_.str.7(%rip), %rdi
	callq	_perror
	movl	$1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.p2align	4, 0x90                         ## -- Begin function bochs_open.cold.1
_bochs_open.cold.1:                     ## @bochs_open.cold.1
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %rbx
	leaq	L_.str.11(%rip), %rdi
	callq	_perror
	movl	(%rbx), %edi
	callq	_close
	movl	4(%r12), %edi
	callq	_close
	movl	(%r15), %edi
	callq	_close
	movl	4(%r14), %edi
	callq	_close
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SIZE_BUF,4,2                   ## @SIZE_BUF
	.comm	_lpTmpBuffer,8,3                ## @lpTmpBuffer
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error: allocating pipe for child input redirect"

L_.str.1:                               ## @.str.1
	.asciz	"Error: allocating pipe for child output redirect"

	.comm	_STDIN_FILENO,4,2               ## @STDIN_FILENO
L_.str.2:                               ## @.str.2
	.asciz	"Error: redirecting stdin"

	.comm	_STDOUT_FILENO,4,2              ## @STDOUT_FILENO
L_.str.3:                               ## @.str.3
	.asciz	"Error: redirecting stdout"

	.comm	_STDERR_FILENO,4,2              ## @STDERR_FILENO
L_.str.4:                               ## @.str.4
	.asciz	"Error: redirecting stderr"

L_.str.5:                               ## @.str.5
	.asciz	"-q"

L_.str.6:                               ## @.str.6
	.asciz	"-f"

L_.str.7:                               ## @.str.7
	.asciz	"execl"

L_.str.8:                               ## @.str.8
	.asciz	"boch_open failed"

L_.str.9:                               ## @.str.9
	.asciz	"Waiting for bochs...\n"

L_.str.10:                              ## @.str.10
	.asciz	"Ready.\n"

L_.str.11:                              ## @.str.11
	.asciz	"pipe"

	.comm	_CREATE_NEW_CONSOLE,4,2         ## @CREATE_NEW_CONSOLE
	.comm	_INFINITE,4,2                   ## @INFINITE
	.comm	_PIPE_READ,8,3                  ## @PIPE_READ
	.comm	_PIPE_WRITE,8,3                 ## @PIPE_WRITE
	.comm	_STARTF_USESTDHANDLES,4,2       ## @STARTF_USESTDHANDLES
	.comm	_TRUE,4,2                       ## @TRUE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bochs_open                     ; -- Begin function bochs_open
	.p2align	2
_bochs_open:                            ; @bochs_open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
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	x22, _SIZE_BUF@GOTPAGE
Lloh4:
	ldr	x22, [x22, _SIZE_BUF@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_malloc
	str	x0, [x20, #72]
	cbz	x0, LBB0_22
; %bb.1:
	ldr	w0, [x22]
	bl	_malloc
Lloh5:
	adrp	x23, _lpTmpBuffer@GOTPAGE
Lloh6:
	ldr	x23, [x23, _lpTmpBuffer@GOTPAGEOFF]
	str	x0, [x23]
	cbz	x0, LBB0_9
; %bb.2:
	add	x0, sp, #16
	bl	_pipe
	tbnz	x0, #63, LBB0_10
; %bb.3:
	add	x0, sp, #8
	bl	_pipe
	tbnz	x0, #63, LBB0_11
; %bb.4:
	bl	_fork
	cbz	w0, LBB0_12
; %bb.5:
	mov	x22, x0
	cmp	w0, #1
	b.lt	LBB0_20
; %bb.6:
	ldr	w0, [sp, #16]
	bl	_close
	ldr	w0, [sp, #12]
	bl	_close
	ldr	w0, [sp, #8]
	ldr	x1, [x23]
	mov	w19, #1
	mov	w2, #1
	bl	_read
	cmp	w0, #1
	b.ne	LBB0_16
; %bb.7:
	ldr	w8, [sp, #8]
	str	w8, [x20]
	ldr	w8, [sp, #20]
	stp	w8, w19, [x20, #12]
	mov	x0, x20
	bl	_bochs_reset_buffer
Lloh7:
	adrp	x0, l_.str.9@PAGE
Lloh8:
	add	x0, x0, l_.str.9@PAGEOFF
	bl	_eprintf
	mov	x0, x20
	bl	_bochs_wait
	cbz	x0, LBB0_17
; %bb.8:
Lloh9:
	adrp	x0, l_.str.10@PAGE
Lloh10:
	add	x0, x0, l_.str.10@PAGEOFF
	bl	_eprintf
	str	w22, [x20, #20]
	mov	w0, #1
	b	LBB0_22
LBB0_9:
	ldr	x0, [x20, #72]
	bl	_R_FREE
	b	LBB0_21
LBB0_10:
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	bl	_eprintf
	b	LBB0_21
LBB0_11:
	ldr	w0, [sp, #16]
	bl	_close
	ldr	w0, [sp, #20]
	bl	_close
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_eprintf
	b	LBB0_21
LBB0_12:
	ldr	w0, [sp, #16]
Lloh15:
	adrp	x8, _STDIN_FILENO@GOTPAGE
Lloh16:
	ldr	x8, [x8, _STDIN_FILENO@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	bl	_dup2
	cmn	w0, #1
	b.eq	LBB0_18
; %bb.13:
	ldr	w0, [sp, #12]
Lloh18:
	adrp	x8, _STDOUT_FILENO@GOTPAGE
Lloh19:
	ldr	x8, [x8, _STDOUT_FILENO@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	bl	_dup2
	cmn	w0, #1
	b.eq	LBB0_19
; %bb.14:
	ldr	w0, [sp, #12]
Lloh21:
	adrp	x8, _STDERR_FILENO@GOTPAGE
Lloh22:
	ldr	x8, [x8, _STDERR_FILENO@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	bl	_dup2
	cmn	w0, #1
	b.ne	LBB0_25
; %bb.15:
Lloh24:
	adrp	x0, l_.str.4@PAGE
Lloh25:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_eprintf
	b	LBB0_21
LBB0_16:
Lloh26:
	adrp	x0, l_.str.8@PAGE
Lloh27:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_eprintf
LBB0_17:
	mov	x0, x20
	bl	_bochs_close
	b	LBB0_21
LBB0_18:
Lloh28:
	adrp	x0, l_.str.2@PAGE
Lloh29:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_eprintf
	b	LBB0_21
LBB0_19:
Lloh30:
	adrp	x0, l_.str.3@PAGE
Lloh31:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_eprintf
	b	LBB0_21
LBB0_20:
	add	x0, sp, #16
	add	x1, sp, #16
	add	x2, sp, #8
	add	x3, sp, #8
	bl	_bochs_open.cold.1
LBB0_21:
	mov	w0, #0
LBB0_22:
	ldr	x8, [sp, #24]
Lloh32:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh33:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh34:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_24
; %bb.23:
	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
	add	sp, sp, #96
	ret
LBB0_24:
	bl	___stack_chk_fail
LBB0_25:
	ldr	w0, [sp, #16]
	bl	_close
	ldr	w0, [sp, #20]
	bl	_close
	ldr	w0, [sp, #8]
	bl	_close
	ldr	w0, [sp, #12]
	bl	_close
Lloh35:
	adrp	x2, l_.str.5@PAGE
Lloh36:
	add	x2, x2, l_.str.5@PAGEOFF
Lloh37:
	adrp	x3, l_.str.6@PAGE
Lloh38:
	add	x3, x3, l_.str.6@PAGEOFF
	mov	x0, x21
	mov	x1, x21
	mov	x4, x19
	mov	x5, #0
	bl	_execl
Lloh39:
	adrp	x0, l_.str.7@PAGE
Lloh40:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_perror
	mov	w0, #1
	bl	_exit
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpAdd	Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.p2align	2                               ; -- Begin function bochs_open.cold.1
_bochs_open.cold.1:                     ; @bochs_open.cold.1
	.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, x3
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
Lloh41:
	adrp	x0, l_.str.11@PAGE
Lloh42:
	add	x0, x0, l_.str.11@PAGEOFF
	bl	_perror
	ldr	w0, [x22]
	bl	_close
	ldr	w0, [x21, #4]
	bl	_close
	ldr	w0, [x20]
	bl	_close
	ldr	w0, [x19, #4]
	bl	_close
	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
	.loh AdrpAdd	Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_SIZE_BUF,4,2                   ; @SIZE_BUF
	.comm	_lpTmpBuffer,8,3                ; @lpTmpBuffer
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error: allocating pipe for child input redirect"

l_.str.1:                               ; @.str.1
	.asciz	"Error: allocating pipe for child output redirect"

	.comm	_STDIN_FILENO,4,2               ; @STDIN_FILENO
l_.str.2:                               ; @.str.2
	.asciz	"Error: redirecting stdin"

	.comm	_STDOUT_FILENO,4,2              ; @STDOUT_FILENO
l_.str.3:                               ; @.str.3
	.asciz	"Error: redirecting stdout"

	.comm	_STDERR_FILENO,4,2              ; @STDERR_FILENO
l_.str.4:                               ; @.str.4
	.asciz	"Error: redirecting stderr"

l_.str.5:                               ; @.str.5
	.asciz	"-q"

l_.str.6:                               ; @.str.6
	.asciz	"-f"

l_.str.7:                               ; @.str.7
	.asciz	"execl"

l_.str.8:                               ; @.str.8
	.asciz	"boch_open failed"

l_.str.9:                               ; @.str.9
	.asciz	"Waiting for bochs...\n"

l_.str.10:                              ; @.str.10
	.asciz	"Ready.\n"

l_.str.11:                              ; @.str.11
	.asciz	"pipe"

	.comm	_CREATE_NEW_CONSOLE,4,2         ; @CREATE_NEW_CONSOLE
	.comm	_INFINITE,4,2                   ; @INFINITE
	.comm	_PIPE_READ,8,3                  ; @PIPE_READ
	.comm	_PIPE_WRITE,8,3                 ; @PIPE_WRITE
	.comm	_STARTF_USESTDHANDLES,4,2       ; @STARTF_USESTDHANDLES
	.comm	_TRUE,4,2                       ; @TRUE
.subsections_via_symbols
