	.file	"extr_refs.c_get_terminal.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"reference chain too deep (%d)"
	.text
	.p2align 4
	.type	get_terminal, @function
get_terminal:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	r13d, ecx
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 24
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	cmp	DWORD PTR MAX_NESTING_LEVEL[rip], ecx
	jl	.L11
	mov	rbx, rdi
	mov	rdi, rsp
	mov	rbp, rsi
	call	git_reference_lookup@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L12
	mov	rdi, QWORD PTR [rsp]
	call	git_reference_type@PLT
	cmp	rax, QWORD PTR GIT_REFERENCE_DIRECT[rip]
	jne	.L5
	mov	rax, QWORD PTR [rsp]
	xor	r12d, r12d
	mov	QWORD PTR [rbx], rax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L12:
	mov	QWORD PTR [rbx], 0
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L13
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	mov	edi, DWORD PTR GIT_ERROR_REFERENCE[rip]
	mov	edx, ecx
	lea	rsi, .LC0[rip]
	call	git_error_set@PLT
	mov	r12d, DWORD PTR GIT_ENOTFOUND[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L5:
	mov	rdi, QWORD PTR [rsp]
	call	git_reference_symbolic_target@PLT
	mov	rdi, rbx
	lea	ecx, 1[r13]
	mov	rsi, rbp
	mov	rdx, rax
	call	get_terminal
	cmp	DWORD PTR GIT_ENOTFOUND[rip], eax
	mov	rdi, QWORD PTR [rsp]
	mov	r12d, eax
	jne	.L7
	cmp	QWORD PTR [rbx], 0
	je	.L14
.L7:
	call	git_reference_free@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L14:
	mov	QWORD PTR [rbx], rdi
	jmp	.L1
.L13:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	get_terminal, .-get_terminal
	.comm	MAX_NESTING_LEVEL,4,4
	.comm	GIT_REFERENCE_DIRECT,8,8
	.comm	GIT_ERROR_REFERENCE,4,4
	.comm	GIT_ENOTFOUND,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_refs.c_get_terminal.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"reference chain too deep (%d)\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	get_terminal, %function
get_terminal:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	mov	r5, r3
	ldr	r3, .L13
	mov	r6, r0
	ldr	r3, [r3]
	ldr	r0, .L13+4
	sub	sp, sp, #12
	cmp	r3, r5
	ldr	r0, [r0]
	str	r0, [sp, #4]
	mov	r0,#0
	blt	.L11
	mov	r0, sp
	mov	r7, r1
	bl	git_reference_lookup
	subs	r4, r0, #0
	movlt	r3, #0
	strlt	r3, [r6]
	blt	.L1
	ldr	r0, [sp]
	bl	git_reference_type
	ldr	r3, .L13+8
	ldr	r3, [r3]
	cmp	r0, r3
	bne	.L5
	mov	r4, #0
	ldr	r3, [sp]
	str	r3, [r6]
.L1:
	ldr	r3, .L13+4
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L12
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L11:
	ldr	r3, .L13+12
	mov	r2, r5
	ldr	r0, [r3]
	ldr	r1, .L13+16
	bl	git_error_set
	ldr	r3, .L13+20
	ldr	r4, [r3]
	b	.L1
.L5:
	ldr	r0, [sp]
	bl	git_reference_symbolic_target
	add	r3, r5, #1
	mov	r2, r0
	mov	r1, r7
	mov	r0, r6
	bl	get_terminal
	ldr	r3, .L13+20
	mov	r4, r0
	ldr	r3, [r3]
	cmp	r3, r0
	bne	.L6
	ldr	r3, [r6]
	ldr	r0, [sp]
	cmp	r3, #0
	streq	r0, [r6]
	beq	.L1
.L7:
	bl	git_reference_free
	b	.L1
.L6:
	ldr	r0, [sp]
	b	.L7
.L12:
	bl	__stack_chk_fail
.L14:
	.align	2
.L13:
	.word	MAX_NESTING_LEVEL
	.word	.LC1
	.word	GIT_REFERENCE_DIRECT
	.word	GIT_ERROR_REFERENCE
	.word	.LC0
	.word	GIT_ENOTFOUND
	.size	get_terminal, .-get_terminal
	.comm	MAX_NESTING_LEVEL,4,4
	.comm	GIT_REFERENCE_DIRECT,4,4
	.comm	GIT_ERROR_REFERENCE,4,4
	.comm	GIT_ENOTFOUND,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
