	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_get_termcap_entry              ## -- Begin function get_termcap_entry
	.p2align	4, 0x90
_get_termcap_entry:                     ## @get_termcap_entry
	.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
	movq	%rsi, %r14
	movq	%rdi, %rbx
	testq	%rdi, %rdi
	jne	LBB0_6
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_getenv
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_5
## %bb.2:
	movq	_STDERR_FILENO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ttyname
	leaq	L_.str.1(%rip), %rbx
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	movq	%rax, %r15
	movq	%rax, %rdi
	movl	$47, %esi
	callq	_strrchr
	leaq	1(%rax), %rdi
	testq	%rax, %rax
	cmoveq	%r15, %rdi
	callq	_getttynam
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	(%rax), %rbx
LBB0_5:
	movq	%rbx, %rdi
	callq	_mapped
	movq	%rax, %rbx
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
	callq	_getenv
	testq	%rax, %rax
	je	LBB0_9
## %bb.7:
	cmpb	$47, (%rax)
	je	LBB0_9
## %bb.8:
	leaq	L_.str.2(%rip), %rdi
	callq	_unsetenv
LBB0_9:
	cmpb	$63, (%rbx)
	jne	LBB0_14
## %bb.10:
	cmpb	$0, 1(%rbx)
	je	LBB0_12
## %bb.11:
	incq	%rbx
	movq	%rbx, %rdi
	jmp	LBB0_13
LBB0_12:
	xorl	%edi, %edi
LBB0_13:
	callq	_askuser
	movq	%rax, %rbx
LBB0_14:
	movq	_tbuf@GOTPCREL(%rip), %r12
	leaq	L_.str.3(%rip), %r15
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rdi
	movq	%rbx, %rsi
	callq	_tgetent
	testl	%eax, %eax
	jne	LBB0_16
## %bb.21:                              ##   in Loop: Header=BB0_15 Depth=1
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_warnx
	xorl	%edi, %edi
	callq	_askuser
	movq	%rax, %rbx
	jmp	LBB0_15
LBB0_16:
	cmpl	$-1, %eax
	jne	LBB0_20
## %bb.17:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	testq	%rdi, %rdi
	jne	LBB0_19
## %bb.18:
	movq	_ENOENT@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
LBB0_19:
	callq	_strerror
	leaq	L_.str.4(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	callq	_errx
LBB0_20:
	movq	(%r12), %rax
	movq	%rax, (%r14)
	movq	%rbx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"TERM"

	.comm	_STDERR_FILENO,4,2              ## @STDERR_FILENO
L_.str.1:                               ## @.str.1
	.asciz	"unknown"

L_.str.2:                               ## @.str.2
	.asciz	"TERMCAP"

	.comm	_tbuf,8,3                       ## @tbuf
L_.str.3:                               ## @.str.3
	.asciz	"terminal type %s is unknown"

L_.str.4:                               ## @.str.4
	.asciz	"termcap: %s"

	.comm	_errno,8,3                      ## @errno
	.comm	_ENOENT,8,3                     ## @ENOENT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_get_termcap_entry              ; -- Begin function get_termcap_entry
	.p2align	2
_get_termcap_entry:                     ; @get_termcap_entry
	.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	x19, x1
	mov	x20, x0
	cbnz	x0, LBB0_7
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_getenv
	cbnz	x0, LBB0_6
; %bb.2:
Lloh2:
	adrp	x8, _STDERR_FILENO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _STDERR_FILENO@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_ttyname
	cbz	x0, LBB0_5
; %bb.3:
	mov	x20, x0
	mov	w1, #47
	bl	_strrchr
	cmp	x0, #0
	csinc	x0, x20, x0, eq
	bl	_getttynam
	cbz	x0, LBB0_5
; %bb.4:
	ldr	x0, [x0]
	b	LBB0_6
LBB0_5:
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_6:
	bl	_mapped
	mov	x20, x0
LBB0_7:
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_getenv
	cbz	x0, LBB0_10
; %bb.8:
	ldrb	w8, [x0]
	cmp	w8, #47
	b.eq	LBB0_10
; %bb.9:
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_unsetenv
LBB0_10:
	ldrb	w8, [x20]
	cmp	w8, #63
	b.ne	LBB0_15
; %bb.11:
	ldrb	w8, [x20, #1]!
	cbz	w8, LBB0_13
; %bb.12:
	mov	x0, x20
	b	LBB0_14
LBB0_13:
	mov	x0, #0
LBB0_14:
	bl	_askuser
	mov	x20, x0
LBB0_15:
Lloh11:
	adrp	x22, _tbuf@GOTPAGE
Lloh12:
	ldr	x22, [x22, _tbuf@GOTPAGEOFF]
Lloh13:
	adrp	x21, l_.str.3@PAGE
Lloh14:
	add	x21, x21, l_.str.3@PAGEOFF
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x22]
	mov	x1, x20
	bl	_tgetent
	cbnz	w0, LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	x0, x21
	mov	x1, x20
	bl	_warnx
	mov	x0, #0
	bl	_askuser
	mov	x20, x0
	b	LBB0_16
LBB0_18:
	cmn	w0, #1
	b.ne	LBB0_20
; %bb.19:
Lloh15:
	adrp	x8, _errno@GOTPAGE
Lloh16:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
Lloh18:
	adrp	x9, _ENOENT@GOTPAGE
Lloh19:
	ldr	x9, [x9, _ENOENT@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x8, #0
	csel	x0, x9, x8, eq
	bl	_strerror
	mov	x2, x0
Lloh21:
	adrp	x1, l_.str.4@PAGE
Lloh22:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_20:
	ldr	x8, [x22]
	str	x8, [x19]
	mov	x0, x20
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"TERM"

	.comm	_STDERR_FILENO,4,2              ; @STDERR_FILENO
l_.str.1:                               ; @.str.1
	.asciz	"unknown"

l_.str.2:                               ; @.str.2
	.asciz	"TERMCAP"

	.comm	_tbuf,8,3                       ; @tbuf
l_.str.3:                               ; @.str.3
	.asciz	"terminal type %s is unknown"

l_.str.4:                               ; @.str.4
	.asciz	"termcap: %s"

	.comm	_errno,8,3                      ; @errno
	.comm	_ENOENT,8,3                     ; @ENOENT
.subsections_via_symbols
