	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_LSAPI_InitRequest              ## -- Begin function LSAPI_InitRequest
	.p2align	4, 0x90
_LSAPI_InitRequest:                     ## @LSAPI_InitRequest
	.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
	movl	$-1, %r15d
	testq	%rdi, %rdi
	je	LBB0_10
## %bb.1:
	movl	%esi, %r14d
	movq	%rdi, %rbx
	xorl	%esi, %esi
	movl	$72, %edx
	callq	_memset
	movq	%rbx, %rdi
	movl	$16, %esi
	callq	_allocateIovec
	cmpl	$-1, %eax
	je	LBB0_10
## %bb.2:
	movq	_LSAPI_RESP_BUF_SIZE@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	callq	_malloc
	movq	%rax, 8(%rbx)
	movq	%rax, (%rbx)
	testq	%rax, %rax
	je	LBB0_10
## %bb.3:
	movslq	(%r12), %rcx
	addq	%rcx, %rax
	movq	%rax, 16(%rbx)
	movq	32(%rbx), %rax
	movq	48(%rbx), %rcx
	incq	%rcx
	movq	%rcx, 56(%rbx)
	movq	%rcx, 64(%rbx)
	addq	$20, %rax
	movq	%rax, 40(%rbx)
	movq	_LSAPI_INIT_RESP_HEADER_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_allocateRespHeaderBuf
	cmpl	$-1, %eax
	je	LBB0_10
## %bb.4:
	movq	_STDIN_FILENO@GOTPCREL(%rip), %r15
	cmpl	%r14d, (%r15)
	jne	LBB0_6
## %bb.5:
	movl	%r14d, %edi
	callq	_dup
	movl	%eax, %r14d
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdi
	callq	_open
	movl	(%r15), %esi
	movl	%eax, %edi
	callq	_dup2
LBB0_6:
	movl	%r14d, %edi
	callq	_isPipe
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movl	$-1, 24(%rbx)
	movl	%r14d, 28(%rbx)
	jmp	LBB0_9
LBB0_8:
	movl	%r14d, 24(%rbx)
	movl	$-1, 28(%rbx)
	movl	%r14d, %edi
	movl	$1, %esi
	callq	_lsapi_set_nblock
LBB0_9:
	xorl	%r15d, %r15d
LBB0_10:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LSAPI_RESP_BUF_SIZE,4,2        ## @LSAPI_RESP_BUF_SIZE
	.comm	_LSAPI_INIT_RESP_HEADER_LEN,4,2 ## @LSAPI_INIT_RESP_HEADER_LEN
	.comm	_STDIN_FILENO,4,2               ## @STDIN_FILENO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"/dev/null"

	.comm	_O_RDWR,4,2                     ## @O_RDWR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_LSAPI_InitRequest              ; -- Begin function LSAPI_InitRequest
	.p2align	2
_LSAPI_InitRequest:                     ; @LSAPI_InitRequest
	.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
	cbz	x0, LBB0_8
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	mov	w1, #0
	mov	w2, #72
	bl	_memset
	mov	x0, x20
	mov	w1, #16
	bl	_allocateIovec
	cmn	w0, #1
	b.eq	LBB0_9
; %bb.2:
Lloh0:
	adrp	x21, _LSAPI_RESP_BUF_SIZE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _LSAPI_RESP_BUF_SIZE@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_malloc
	stp	x0, x0, [x20]
	cbz	x0, LBB0_8
; %bb.3:
	ldrsw	x8, [x21]
	add	x8, x0, x8
	str	x8, [x20, #16]
	ldr	x8, [x20, #48]
	add	x8, x8, #1
	stp	x8, x8, [x20, #56]
	ldr	x8, [x20, #32]
	add	x8, x8, #20
	str	x8, [x20, #40]
Lloh2:
	adrp	x8, _LSAPI_INIT_RESP_HEADER_LEN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _LSAPI_INIT_RESP_HEADER_LEN@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_allocateRespHeaderBuf
	cmn	w0, #1
	b.eq	LBB0_9
; %bb.4:
Lloh5:
	adrp	x21, _STDIN_FILENO@GOTPAGE
Lloh6:
	ldr	x21, [x21, _STDIN_FILENO@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w8, w19
	b.ne	LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_dup
	mov	x19, x0
Lloh7:
	adrp	x8, _O_RDWR@GOTPAGE
Lloh8:
	ldr	x8, [x8, _O_RDWR@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_open
	ldr	w1, [x21]
	bl	_dup2
LBB0_6:
	mov	x0, x19
	bl	_isPipe
	cbz	x0, LBB0_10
; %bb.7:
	mov	w0, #0
	mov	w8, #-1
	stp	w8, w19, [x20, #24]
	b	LBB0_9
LBB0_8:
	mov	w0, #-1
LBB0_9:
	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
LBB0_10:
	mov	w8, #-1
	stp	w19, w8, [x20, #24]
	mov	x0, x19
	mov	w1, #1
	bl	_lsapi_set_nblock
	mov	w0, #0
	b	LBB0_9
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_LSAPI_RESP_BUF_SIZE,4,2        ; @LSAPI_RESP_BUF_SIZE
	.comm	_LSAPI_INIT_RESP_HEADER_LEN,4,2 ; @LSAPI_INIT_RESP_HEADER_LEN
	.comm	_STDIN_FILENO,4,2               ; @STDIN_FILENO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"/dev/null"

	.comm	_O_RDWR,4,2                     ; @O_RDWR
.subsections_via_symbols
