	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function getfdtype
_getfdtype:                             ## @getfdtype
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	4(%rdi), %edi
	leaq	-32(%rbp), %rsi
	callq	_fstat
	cmpl	$-1, %eax
	jne	LBB0_2
## %bb.1:
	movl	8(%r14), %edx
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_2:
	movl	-32(%rbp), %ebx
	movl	%ebx, %edi
	callq	_S_ISREG
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_ISTRUNC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r14)
LBB0_4:
	movl	%ebx, %edi
	callq	_S_ISCHR
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:
	movl	%ebx, %edi
	callq	_S_ISBLK
	testq	%rax, %rax
	je	LBB0_16
LBB0_6:
	movl	4(%r14), %edi
	movq	_FIODTYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-28(%rbp), %rdx
	callq	_ioctl
	cmpl	$-1, %eax
	je	LBB0_7
## %bb.8:
	movl	-28(%rbp), %eax
	movq	_D_TAPE@GOTPCREL(%rip), %r15
	testl	%eax, (%r15)
	je	LBB0_10
## %bb.9:
	movq	_ISTAPE@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_7:
	movl	8(%r14), %edx
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_err
	jmp	LBB0_21
LBB0_10:
	movq	_D_DISK@GOTPCREL(%rip), %rcx
	movq	_D_MEM@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	testl	%eax, %edx
	je	LBB0_13
## %bb.11:
	movq	_ISSEEK@GOTPCREL(%rip), %rax
LBB0_12:
	movl	(%rax), %eax
	orl	%eax, (%r14)
LBB0_13:
	movl	%ebx, %edi
	callq	_S_ISCHR
	testq	%rax, %rax
	je	LBB0_21
## %bb.14:
	movl	(%r15), %eax
	testl	%eax, -28(%rbp)
	jne	LBB0_21
## %bb.15:
	movq	_ISCHR@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_16:
	movq	_errno@GOTPCREL(%rip), %rbx
	movq	$0, (%rbx)
	movl	4(%r14), %edi
	movq	_SEEK_CUR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_lseek
	cmpl	$-1, %eax
	jne	LBB0_19
## %bb.17:
	movq	(%rbx), %rax
	movq	_ESPIPE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_19
## %bb.18:
	movq	_ISPIPE@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_19:
	movq	_ISSEEK@GOTPCREL(%rip), %rax
LBB0_20:
	movl	(%rax), %eax
	orl	%eax, (%r14)
LBB0_21:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s"

	.comm	_ISTRUNC,4,2                    ## @ISTRUNC
	.comm	_FIODTYPE,4,2                   ## @FIODTYPE
	.comm	_D_TAPE,4,2                     ## @D_TAPE
	.comm	_ISTAPE,4,2                     ## @ISTAPE
	.comm	_D_DISK,4,2                     ## @D_DISK
	.comm	_D_MEM,4,2                      ## @D_MEM
	.comm	_ISSEEK,4,2                     ## @ISSEEK
	.comm	_ISCHR,4,2                      ## @ISCHR
	.comm	_errno,8,3                      ## @errno
	.comm	_SEEK_CUR,4,2                   ## @SEEK_CUR
	.comm	_ESPIPE,8,3                     ## @ESPIPE
	.comm	_ISPIPE,4,2                     ## @ISPIPE
	.no_dead_strip	_getfdtype
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function getfdtype
_getfdtype:                             ; @getfdtype
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	ldr	w0, [x0, #4]
	add	x1, sp, #8
	bl	_fstat
	cmn	w0, #1
	b.ne	LBB0_2
; %bb.1:
	ldr	w2, [x19, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_2:
	ldr	w20, [sp, #8]
	mov	x0, x20
	bl	_S_ISREG
	cbz	x0, LBB0_4
; %bb.3:
Lloh2:
	adrp	x8, _ISTRUNC@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ISTRUNC@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
LBB0_4:
	mov	x0, x20
	bl	_S_ISCHR
	cbnz	x0, LBB0_6
; %bb.5:
	mov	x0, x20
	bl	_S_ISBLK
	cbz	x0, LBB0_16
LBB0_6:
	ldr	w0, [x19, #4]
Lloh5:
	adrp	x8, _FIODTYPE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _FIODTYPE@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	add	x2, sp, #4
	bl	_ioctl
	cmn	w0, #1
	b.eq	LBB0_9
; %bb.7:
	ldr	w8, [sp, #4]
Lloh8:
	adrp	x21, _D_TAPE@GOTPAGE
Lloh9:
	ldr	x21, [x21, _D_TAPE@GOTPAGEOFF]
	ldr	w9, [x21]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.8:
Lloh10:
	adrp	x8, _ISTAPE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ISTAPE@GOTPAGEOFF]
	b	LBB0_12
LBB0_9:
	ldr	w2, [x19, #8]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_err
	b	LBB0_21
LBB0_10:
Lloh14:
	adrp	x9, _D_DISK@GOTPAGE
Lloh15:
	ldr	x9, [x9, _D_DISK@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
Lloh17:
	adrp	x10, _D_MEM@GOTPAGE
Lloh18:
	ldr	x10, [x10, _D_MEM@GOTPAGEOFF]
Lloh19:
	ldr	w10, [x10]
	orr	w9, w10, w9
	tst	w9, w8
	b.eq	LBB0_13
; %bb.11:
Lloh20:
	adrp	x8, _ISSEEK@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ISSEEK@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
LBB0_13:
	mov	x0, x20
	bl	_S_ISCHR
	cbz	x0, LBB0_21
; %bb.14:
	ldr	w8, [sp, #4]
	ldr	w9, [x21]
	tst	w9, w8
	b.ne	LBB0_21
; %bb.15:
Lloh22:
	adrp	x8, _ISCHR@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ISCHR@GOTPAGEOFF]
	b	LBB0_20
LBB0_16:
Lloh24:
	adrp	x20, _errno@GOTPAGE
Lloh25:
	ldr	x20, [x20, _errno@GOTPAGEOFF]
	str	xzr, [x20]
	ldr	w0, [x19, #4]
Lloh26:
	adrp	x8, _SEEK_CUR@GOTPAGE
Lloh27:
	ldr	x8, [x8, _SEEK_CUR@GOTPAGEOFF]
Lloh28:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_lseek
	cmn	w0, #1
	b.ne	LBB0_19
; %bb.17:
	ldr	x8, [x20]
Lloh29:
	adrp	x9, _ESPIPE@GOTPAGE
Lloh30:
	ldr	x9, [x9, _ESPIPE@GOTPAGEOFF]
Lloh31:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_19
; %bb.18:
Lloh32:
	adrp	x8, _ISPIPE@GOTPAGE
Lloh33:
	ldr	x8, [x8, _ISPIPE@GOTPAGEOFF]
	b	LBB0_20
LBB0_19:
Lloh34:
	adrp	x8, _ISSEEK@GOTPAGE
Lloh35:
	ldr	x8, [x8, _ISSEEK@GOTPAGEOFF]
LBB0_20:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
LBB0_21:
	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
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s"

	.comm	_ISTRUNC,4,2                    ; @ISTRUNC
	.comm	_FIODTYPE,4,2                   ; @FIODTYPE
	.comm	_D_TAPE,4,2                     ; @D_TAPE
	.comm	_ISTAPE,4,2                     ; @ISTAPE
	.comm	_D_DISK,4,2                     ; @D_DISK
	.comm	_D_MEM,4,2                      ; @D_MEM
	.comm	_ISSEEK,4,2                     ; @ISSEEK
	.comm	_ISCHR,4,2                      ; @ISCHR
	.comm	_errno,8,3                      ; @errno
	.comm	_SEEK_CUR,4,2                   ; @SEEK_CUR
	.comm	_ESPIPE,8,3                     ; @ESPIPE
	.comm	_ISPIPE,4,2                     ; @ISPIPE
	.no_dead_strip	_getfdtype
.subsections_via_symbols
