	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sd_listen_fds                  ## -- Begin function sd_listen_fds
	.p2align	4, 0x90
_sd_listen_fds:                         ## @sd_listen_fds
	.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	%edi, %r14d
	movq	$0, -48(%rbp)
	leaq	L_.str(%rip), %rdi
	callq	_getenv
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	_errno@GOTPCREL(%rip), %r12
	movl	$0, (%r12)
	leaq	-48(%rbp), %rsi
	movq	%rax, %rdi
	movl	$10, %edx
	callq	_strtoul
	movl	(%r12), %ebx
	testl	%ebx, %ebx
	je	LBB0_4
## %bb.3:
	negl	%ebx
	jmp	LBB0_21
LBB0_1:
	xorl	%ebx, %ebx
	jmp	LBB0_21
LBB0_4:
	movq	%rax, %r15
	movq	-48(%rbp), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:
	cmpb	$0, (%rax)
	jne	LBB0_7
## %bb.6:
	testq	%r15, %r15
	je	LBB0_7
## %bb.8:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_getpid
	cmpq	%r15, %rax
	jne	LBB0_21
## %bb.9:
	leaq	L_.str.1(%rip), %rdi
	callq	_getenv
	testq	%rax, %rax
	je	LBB0_21
## %bb.10:
	movl	$0, (%r12)
	leaq	-48(%rbp), %rsi
	movq	%rax, %rdi
	movl	$10, %edx
	callq	_strtoul
	movq	%rax, %rbx
	movl	(%r12), %eax
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:
	negl	%eax
	movl	%eax, %ebx
	jmp	LBB0_21
LBB0_12:
	movq	-48(%rbp), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.13:
	cmpb	$0, (%rax)
	je	LBB0_14
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_21:
	testl	%r14d, %r14d
	je	LBB0_23
## %bb.22:
	leaq	L_.str(%rip), %rdi
	callq	_unsetenv
	leaq	L_.str.1(%rip), %rdi
	callq	_unsetenv
LBB0_23:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	testl	%ebx, %ebx
	jle	LBB0_21
## %bb.15:
	movq	_SD_LISTEN_FDS_START@GOTPCREL(%rip), %r13
	movl	(%r13), %r15d
	jmp	LBB0_16
LBB0_20:                                ##   in Loop: Header=BB0_16 Depth=1
	incl	%r15d
	movl	(%r13), %eax
	addl	%ebx, %eax
	cmpl	%eax, %r15d
	jge	LBB0_21
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	_F_GETFD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edi
	xorl	%eax, %eax
	callq	_fcntl
	testl	%eax, %eax
	js	LBB0_17
## %bb.18:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	_FD_CLOEXEC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	testl	%eax, %edx
	jne	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	_F_SETFD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	%eax, %edx
	movl	%r15d, %edi
	xorl	%eax, %eax
	callq	_fcntl
	testl	%eax, %eax
	jns	LBB0_20
LBB0_17:
	xorl	%ebx, %ebx
	subl	(%r12), %ebx
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"LISTEN_PID"

	.comm	_errno,4,2                      ## @errno
	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"LISTEN_FDS"

	.comm	_SD_LISTEN_FDS_START,4,2        ## @SD_LISTEN_FDS_START
	.comm	_F_GETFD,4,2                    ## @F_GETFD
	.comm	_FD_CLOEXEC,4,2                 ## @FD_CLOEXEC
	.comm	_F_SETFD,4,2                    ## @F_SETFD
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sd_listen_fds                  ; -- Begin function sd_listen_fds
	.p2align	2
_sd_listen_fds:                         ; @sd_listen_fds
	.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
	str	xzr, [sp, #8]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_getenv
	cbz	x0, LBB0_13
; %bb.1:
Lloh2:
	adrp	x22, _errno@GOTPAGE
Lloh3:
	ldr	x22, [x22, _errno@GOTPAGEOFF]
	str	wzr, [x22]
	add	x1, sp, #8
	mov	w2, #10
	bl	_strtoul
	ldr	w8, [x22]
	cbnz	w8, LBB0_5
; %bb.2:
	ldr	x8, [sp, #8]
	cbz	x8, LBB0_4
; %bb.3:
	mov	x20, x0
	ldrb	w8, [x8]
	cmp	w8, #0
	ccmp	x0, #0, #4, eq
	b.ne	LBB0_6
LBB0_4:
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
LBB0_5:
	neg	w20, w8
	b	LBB0_14
LBB0_6:
	bl	_getpid
	cmp	x0, x20
	b.ne	LBB0_13
; %bb.7:
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_getenv
	cbz	x0, LBB0_13
; %bb.8:
	str	wzr, [x22]
	add	x1, sp, #8
	mov	w2, #10
	bl	_strtoul
	ldr	w8, [x22]
	cbnz	w8, LBB0_5
; %bb.9:
	ldr	x8, [sp, #8]
	cbz	x8, LBB0_4
; %bb.10:
	ldrb	w8, [x8]
	cbnz	w8, LBB0_4
; %bb.11:
	mov	x20, x0
	cmp	w20, #1
	b.lt	LBB0_14
; %bb.12:
Lloh9:
	adrp	x23, _SD_LISTEN_FDS_START@GOTPAGE
Lloh10:
	ldr	x23, [x23, _SD_LISTEN_FDS_START@GOTPAGEOFF]
	ldr	w21, [x23]
Lloh11:
	adrp	x24, _F_GETFD@GOTPAGE
Lloh12:
	ldr	x24, [x24, _F_GETFD@GOTPAGEOFF]
Lloh13:
	adrp	x25, _FD_CLOEXEC@GOTPAGE
Lloh14:
	ldr	x25, [x25, _FD_CLOEXEC@GOTPAGEOFF]
Lloh15:
	adrp	x26, _F_SETFD@GOTPAGE
Lloh16:
	ldr	x26, [x26, _F_SETFD@GOTPAGEOFF]
	b	LBB0_18
LBB0_13:
	mov	w20, #0
LBB0_14:
	cbz	w19, LBB0_16
; %bb.15:
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
	bl	_unsetenv
Lloh19:
	adrp	x0, l_.str.1@PAGE
Lloh20:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_unsetenv
LBB0_16:
	mov	x0, x20
	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
LBB0_17:                                ;   in Loop: Header=BB0_18 Depth=1
	add	w21, w21, #1
	ldr	w8, [x23]
	add	w8, w8, w20
	cmp	w21, w8
	b.ge	LBB0_14
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x24]
	mov	x0, x21
	bl	_fcntl
	tbnz	w0, #31, LBB0_21
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	ldr	w8, [x25]
	tst	w8, w0
	b.ne	LBB0_17
; %bb.20:                               ;   in Loop: Header=BB0_18 Depth=1
	ldr	w1, [x26]
	orr	w8, w8, w0
	str	x8, [sp]
	mov	x0, x21
	bl	_fcntl
	tbz	w0, #31, LBB0_17
LBB0_21:
	ldr	w8, [x22]
	b	LBB0_5
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"LISTEN_PID"

	.comm	_errno,4,2                      ; @errno
	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"LISTEN_FDS"

	.comm	_SD_LISTEN_FDS_START,4,2        ; @SD_LISTEN_FDS_START
	.comm	_F_GETFD,4,2                    ; @F_GETFD
	.comm	_FD_CLOEXEC,4,2                 ; @FD_CLOEXEC
	.comm	_F_SETFD,4,2                    ; @F_SETFD
.subsections_via_symbols
