	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_imsg_get                       ## -- Begin function imsg_get
	.p2align	4, 0x90
_imsg_get:                              ## @imsg_get
	.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), %r14
	movq	_IMSG_HEADER_SIZE@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	cmpq	%r14, (%rax)
	ja	LBB0_16
## %bb.1:
	movq	%rsi, %r12
	movq	%rdi, %r13
	leaq	8(%rsi), %rdi
	movq	8(%r13), %rsi
	movl	$16, %edx
	callq	_memcpy
	movq	8(%r12), %r15
	movq	_IMSG_HEADER_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rax, %r15
	jb	LBB0_6
## %bb.2:
	movq	_MAX_IMSGSIZE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %r15
	ja	LBB0_6
## %bb.3:
	cmpq	%r14, %r15
	ja	LBB0_16
## %bb.4:
	movq	8(%r13), %rcx
	addq	%rax, %rcx
	movq	%rcx, 16(%r13)
	subq	%rax, %r15
	jne	LBB0_7
## %bb.5:
	movq	$0, 24(%r12)
	xorl	%edi, %edi
	jmp	LBB0_8
LBB0_6:
	movq	_ERANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
LBB0_15:
	movl	$-1, %ebx
	jmp	LBB0_16
LBB0_7:
	movq	%r15, %rdi
	callq	_malloc
	movq	%rax, %rdi
	movq	%rax, 24(%r12)
	testq	%rax, %rax
	je	LBB0_15
LBB0_8:
	movq	_IMSGF_HASFD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 16(%r12)
	je	LBB0_10
## %bb.9:
	movq	%r13, %rdi
	callq	_imsg_get_fd
	movq	24(%r12), %rdi
	jmp	LBB0_11
LBB0_10:
	movl	$-1, %eax
LBB0_11:
	movl	%eax, (%r12)
	movq	16(%r13), %rsi
	movq	%r15, %rdx
	callq	_memcpy
	movq	8(%r12), %rsi
	subq	%rsi, %r14
	jbe	LBB0_13
## %bb.12:
	leaq	8(%r13), %rdi
	addq	(%rdi), %rsi
	movq	%r14, %rdx
	callq	_memmove
	jmp	LBB0_14
LBB0_13:
	xorl	%r14d, %r14d
LBB0_14:
	movq	_IMSG_HEADER_SIZE@GOTPCREL(%rip), %rax
	movq	%r14, (%r13)
	addl	(%rax), %r15d
	movl	%r15d, %ebx
LBB0_16:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IMSG_HEADER_SIZE,8,3           ## @IMSG_HEADER_SIZE
	.comm	_MAX_IMSGSIZE,8,3               ## @MAX_IMSGSIZE
	.comm	_ERANGE,4,2                     ## @ERANGE
	.comm	_errno,4,2                      ## @errno
	.comm	_IMSGF_HASFD,4,2                ## @IMSGF_HASFD
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_imsg_get                       ; -- Begin function imsg_get
	.p2align	2
_imsg_get:                              ; @imsg_get
	.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
	ldr	x24, [x0]
Lloh0:
	adrp	x23, _IMSG_HEADER_SIZE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _IMSG_HEADER_SIZE@GOTPAGEOFF]
	ldr	x8, [x23]
	cmp	x8, x24
	b.ls	LBB0_2
LBB0_1:
	mov	w0, #0
	b	LBB0_16
LBB0_2:
	mov	x20, x1
	mov	x19, x0
	add	x0, x1, #8
	mov	x21, x19
	ldr	x1, [x21, #8]!
	mov	w2, #16
	bl	_memcpy
	ldr	x8, [x20, #8]
	ldr	x9, [x23]
Lloh2:
	adrp	x10, _MAX_IMSGSIZE@GOTPAGE
Lloh3:
	ldr	x10, [x10, _MAX_IMSGSIZE@GOTPAGEOFF]
Lloh4:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #2, hs
	b.ls	LBB0_5
; %bb.3:
Lloh5:
	adrp	x8, _ERANGE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ERANGE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _errno@GOTPAGE
Lloh9:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh10:
	str	w8, [x9]
LBB0_4:
	mov	w0, #-1
	b	LBB0_16
LBB0_5:
	cmp	x8, x24
	b.hi	LBB0_1
; %bb.6:
	ldr	x10, [x19, #8]
	add	x10, x10, x9
	str	x10, [x19, #16]
	subs	x22, x8, x9
	b.ne	LBB0_8
; %bb.7:
	mov	x0, #0
	str	xzr, [x20, #24]
	b	LBB0_9
LBB0_8:
	mov	x0, x22
	bl	_malloc
	str	x0, [x20, #24]
	cbz	x0, LBB0_4
LBB0_9:
	ldr	w8, [x20, #16]
Lloh11:
	adrp	x9, _IMSGF_HASFD@GOTPAGE
Lloh12:
	ldr	x9, [x9, _IMSGF_HASFD@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_11
; %bb.10:
	mov	x0, x19
	bl	_imsg_get_fd
	mov	x8, x0
	ldr	x0, [x20, #24]
	b	LBB0_12
LBB0_11:
	mov	w8, #-1
LBB0_12:
	str	w8, [x20]
	ldr	x1, [x19, #16]
	mov	x2, x22
	bl	_memcpy
	ldr	x8, [x20, #8]
	subs	x20, x24, x8
	b.ls	LBB0_14
; %bb.13:
	ldr	x9, [x21]
	add	x1, x9, x8
	mov	x0, x21
	mov	x2, x20
	bl	_memmove
	b	LBB0_15
LBB0_14:
	mov	x20, #0
LBB0_15:
	str	x20, [x19]
	ldr	w8, [x23]
	add	w0, w8, w22
LBB0_16:
	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 AdrpLdrGotStr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_IMSG_HEADER_SIZE,8,3           ; @IMSG_HEADER_SIZE
	.comm	_MAX_IMSGSIZE,8,3               ; @MAX_IMSGSIZE
	.comm	_ERANGE,4,2                     ; @ERANGE
	.comm	_errno,4,2                      ; @errno
	.comm	_IMSGF_HASFD,4,2                ; @IMSGF_HASFD
.subsections_via_symbols
