	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function perf_file_header__read_pipe
_perf_file_header__read_pipe:           ## @perf_file_header__read_pipe
	.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	%ecx, %r15d
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movl	%edx, %edi
	movq	%rbx, %rsi
	movl	$8, %edx
	callq	_readn
	movl	$-1, %r14d
	testl	%eax, %eax
	jle	LBB0_8
## %bb.1:
	movl	(%rbx), %esi
	movl	4(%rbx), %edi
	movl	$1, %edx
	movq	%r12, %rcx
	callq	_check_magic_endian
	testq	%rax, %rax
	js	LBB0_2
## %bb.3:
	cmpq	$0, (%r12)
	je	LBB0_5
## %bb.4:
	movl	(%rbx), %edi
	callq	_bswap_64
	movl	%eax, (%rbx)
LBB0_5:
	testl	%r15d, %r15d
	je	LBB0_7
## %bb.6:
	movq	_STDOUT_FILENO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	movl	$8, %edx
	callq	_do_write
	testq	%rax, %rax
	js	LBB0_8
LBB0_7:
	xorl	%r14d, %r14d
	jmp	LBB0_8
LBB0_2:
	leaq	L_.str(%rip), %rdi
	callq	_pr_debug
LBB0_8:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"endian/magic failed\n"

	.comm	_STDOUT_FILENO,4,2              ## @STDOUT_FILENO
	.no_dead_strip	_perf_file_header__read_pipe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function perf_file_header__read_pipe
_perf_file_header__read_pipe:           ; @perf_file_header__read_pipe
	.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
	mov	x20, x3
	mov	x21, x1
	mov	x19, x0
	mov	x0, x2
	mov	x1, x19
	mov	w2, #8
	bl	_readn
	cmp	w0, #1
	b.lt	LBB0_8
; %bb.1:
	ldp	w1, w0, [x19]
	mov	w2, #1
	mov	x3, x21
	bl	_check_magic_endian
	tbnz	x0, #63, LBB0_7
; %bb.2:
	ldr	x8, [x21]
	cbz	x8, LBB0_4
; %bb.3:
	ldr	w0, [x19]
	bl	_bswap_64
	str	w0, [x19]
LBB0_4:
	cbz	w20, LBB0_6
; %bb.5:
Lloh0:
	adrp	x8, _STDOUT_FILENO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _STDOUT_FILENO@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	mov	x1, x19
	mov	w2, #8
	bl	_do_write
	tbnz	x0, #63, LBB0_8
LBB0_6:
	mov	w0, #0
	b	LBB0_9
LBB0_7:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"endian/magic failed\n"

	.comm	_STDOUT_FILENO,4,2              ; @STDOUT_FILENO
	.no_dead_strip	_perf_file_header__read_pipe
.subsections_via_symbols
