	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function goldfish_pipe_open
_goldfish_pipe_open:                    ## @goldfish_pipe_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rsi, %rdi
	callq	_to_goldfish_pipe_dev
	movq	%rax, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movl	$32, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	%r14, 24(%rax)
	leaq	20(%rax), %rdi
	callq	_mutex_init
	movq	%r12, %rdi
	addq	$16, %rdi
	callq	_init_waitqueue_head
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpl	$4, (%rax)
	setb	%dil
	callq	_BUILD_BUG_ON
	movl	(%rbx), %edi
	callq	___get_free_page
	movq	%rax, 8(%r12)
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	%r14, %rdi
	callq	_get_free_pipe_id_locked
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_8
## %bb.5:
	movq	8(%r14), %rax
	movl	%ebx, %r13d
	movq	%r12, (%rax,%r13,8)
	movl	%ebx, (%r12)
	movq	8(%r12), %rdi
	movl	%ebx, (%rdi)
	movq	_MAX_BUFFERS_PER_COMMAND@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	16(%r14), %rcx
	movl	%eax, 8(%rcx)
	callq	___pa
	movq	16(%r14), %rcx
	movq	%rax, (%rcx)
	movq	_PIPE_CMD_OPEN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_goldfish_pipe_cmd_locked
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	testl	%ebx, %ebx
	js	LBB0_7
## %bb.6:
	movq	%r12, (%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_9
LBB0_7:
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	8(%r14), %rax
	movq	$0, (%rax,%r13,8)
LBB0_8:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movq	8(%r12), %rdi
	callq	_free_page
LBB0_9:
	movq	%r12, %rdi
	callq	_kfree
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_MAX_BUFFERS_PER_COMMAND,4,2    ## @MAX_BUFFERS_PER_COMMAND
	.comm	_PIPE_CMD_OPEN,4,2              ## @PIPE_CMD_OPEN
	.no_dead_strip	_goldfish_pipe_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function goldfish_pipe_open
_goldfish_pipe_open:                    ; @goldfish_pipe_open
	.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
	mov	x21, x1
	mov	x0, x1
	bl	_to_goldfish_pipe_dev
	mov	x20, x0
Lloh0:
	adrp	x22, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x22, [x22, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	w0, #32
	bl	_kzalloc
	cbz	x0, LBB0_5
; %bb.1:
	mov	x19, x0
	str	x20, [x0, #24]
	add	x0, x0, #20
	bl	_mutex_init
	add	x0, x19, #16
	bl	_init_waitqueue_head
Lloh2:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w8, #4
	cset	w0, lo
	bl	_BUILD_BUG_ON
	ldr	w0, [x22]
	bl	___get_free_page
	str	x0, [x19, #8]
	cbz	x0, LBB0_6
; %bb.2:
	mov	x0, x20
	bl	_spin_lock_irqsave
	mov	x0, x20
	bl	_get_free_pipe_id_locked
	mov	x22, x0
	tbnz	w0, #31, LBB0_8
; %bb.3:
	ldr	x8, [x20, #8]
	str	x19, [x8, w22, uxtw #3]
	str	w22, [x19]
	ldr	x0, [x19, #8]
	str	w22, [x0]
Lloh5:
	adrp	x8, _MAX_BUFFERS_PER_COMMAND@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MAX_BUFFERS_PER_COMMAND@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	ldr	x9, [x20, #16]
	str	w8, [x9, #8]
	bl	___pa
	ldr	x8, [x20, #16]
	str	x0, [x8]
Lloh8:
	adrp	x8, _PIPE_CMD_OPEN@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PIPE_CMD_OPEN@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_goldfish_pipe_cmd_locked
	mov	x23, x0
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	tbnz	w23, #31, LBB0_7
; %bb.4:
	mov	w22, #0
	str	x19, [x21]
	b	LBB0_10
LBB0_5:
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_10
LBB0_6:
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_9
LBB0_7:
	mov	w21, w22
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldr	x8, [x20, #8]
	str	xzr, [x8, x21, lsl #3]
	mov	x22, x23
LBB0_8:
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	ldr	x0, [x19, #8]
	bl	_free_page
LBB0_9:
	mov	x0, x19
	bl	_kfree
LBB0_10:
	mov	x0, x22
	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	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_MAX_BUFFERS_PER_COMMAND,4,2    ; @MAX_BUFFERS_PER_COMMAND
	.comm	_PIPE_CMD_OPEN,4,2              ; @PIPE_CMD_OPEN
	.no_dead_strip	_goldfish_pipe_open
.subsections_via_symbols
