	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function socket_complete
_socket_complete:                       ## @socket_complete
	.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), %rbx
	testq	%rbx, %rbx
	je	LBB0_9
## %bb.1:
	movq	%rdi, %r14
	movq	_WAITING_CLOSE@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	testl	%eax, (%rbx)
	jne	LBB0_6
## %bb.2:
	movq	%rdx, %r15
	movl	%esi, %r12d
	movl	(%rdx), %edi
	callq	_htonl
	movl	%eax, -44(%rbp)
	leaq	-44(%rbp), %rsi
	movq	%rbx, %rdi
	movl	$4, %edx
	callq	_output_data
	movq	_INCLUDE_ERROR_CODE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_4
## %bb.3:
	movl	%r12d, %edi
	callq	_htonl
	movl	%eax, -44(%rbp)
	leaq	-44(%rbp), %rsi
	movq	%rbx, %rdi
	movl	$4, %edx
	callq	_output_data
LBB0_4:
	movq	8(%r15), %rsi
	movl	(%r15), %edx
	movq	%rbx, %rdi
	callq	_output_data
	movl	(%rbx), %eax
	movq	_HTTP_REPLY@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.5:
	orl	(%r13), %eax
	movl	%eax, (%rbx)
	movq	_WAITING_READ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%eax, %ecx
	movl	%ecx, (%rbx)
LBB0_6:
	decl	4(%rbx)
	movq	16(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_8
## %bb.7:
	callq	_heim_ipc_free_cred
LBB0_8:
	movq	8(%r14), %rdi
	callq	_free
	movq	$0, (%r14)
	movq	%r14, %rdi
	callq	_free
	movq	%rbx, %rdi
	callq	_maybe_close
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	xorl	%eax, %eax
	callq	_abort
	.cfi_endproc
                                        ## -- End function
	.comm	_WAITING_CLOSE,4,2              ## @WAITING_CLOSE
	.comm	_INCLUDE_ERROR_CODE,4,2         ## @INCLUDE_ERROR_CODE
	.comm	_HTTP_REPLY,4,2                 ## @HTTP_REPLY
	.comm	_WAITING_READ,4,2               ## @WAITING_READ
	.no_dead_strip	_socket_complete
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function socket_complete
_socket_complete:                       ; @socket_complete
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	ldr	x19, [x0]
	cbz	x19, LBB0_9
; %bb.1:
	mov	x20, x0
	ldr	w8, [x19]
Lloh0:
	adrp	x23, _WAITING_CLOSE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _WAITING_CLOSE@GOTPAGEOFF]
	ldr	w9, [x23]
	tst	w9, w8
	b.ne	LBB0_6
; %bb.2:
	mov	x21, x2
	mov	x22, x1
	ldr	w0, [x2]
	bl	_htonl
	str	w0, [sp, #12]
	add	x1, sp, #12
	mov	x0, x19
	mov	w2, #4
	bl	_output_data
	ldr	w8, [x19]
Lloh2:
	adrp	x9, _INCLUDE_ERROR_CODE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _INCLUDE_ERROR_CODE@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
	mov	x0, x22
	bl	_htonl
	str	w0, [sp, #12]
	add	x1, sp, #12
	mov	x0, x19
	mov	w2, #4
	bl	_output_data
LBB0_4:
	ldr	x1, [x21, #8]
	ldr	w2, [x21]
	mov	x0, x19
	bl	_output_data
	ldr	w8, [x19]
Lloh5:
	adrp	x9, _HTTP_REPLY@GOTPAGE
Lloh6:
	ldr	x9, [x9, _HTTP_REPLY@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.5:
	ldr	w9, [x23]
	orr	w8, w9, w8
	str	w8, [x19]
Lloh8:
	adrp	x9, _WAITING_READ@GOTPAGE
Lloh9:
	ldr	x9, [x9, _WAITING_READ@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	bic	w8, w8, w9
	str	w8, [x19]
LBB0_6:
	ldr	w8, [x19, #4]
	sub	w8, w8, #1
	str	w8, [x19, #4]
	ldr	x0, [x20, #16]
	cbz	x0, LBB0_8
; %bb.7:
	bl	_heim_ipc_free_cred
LBB0_8:
	ldr	x0, [x20, #8]
	bl	_free
	str	xzr, [x20]
	mov	x0, x20
	bl	_free
	mov	x0, x19
	bl	_maybe_close
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_9:
	bl	_abort
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_WAITING_CLOSE,4,2              ; @WAITING_CLOSE
	.comm	_INCLUDE_ERROR_CODE,4,2         ; @INCLUDE_ERROR_CODE
	.comm	_HTTP_REPLY,4,2                 ; @HTTP_REPLY
	.comm	_WAITING_READ,4,2               ; @WAITING_READ
	.no_dead_strip	_socket_complete
.subsections_via_symbols
