	.file	"extr_util.c_uv_os_getenv.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	uv_os_getenv
	.type	uv_os_getenv, @function
uv_os_getenv:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	push	r12
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	mov	r12, rsi
	push	rbx
	.cfi_offset 3, -56
	mov	rbx, rdx
	sub	rsp, 24
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	movsx	rax, DWORD PTR MAX_ENV_VAR_LENGTH[rip]
	mov	rcx, rsp
	lea	rax, 15[0+rax*4]
	mov	rdx, rax
	and	rax, -4096
	sub	rcx, rax
	and	rdx, -16
	mov	rax, rcx
	cmp	rsp, rax
	je	.L3
.L20:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L20
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L21
.L4:
	test	r12, r12
	mov	r14, rsp
	sete	dl
	test	rbx, rbx
	sete	al
	or	dl, al
	jne	.L5
	test	rdi, rdi
	je	.L5
	cmp	QWORD PTR [rbx], 0
	je	.L5
	lea	rdx, -64[rbp]
	mov	esi, -1
	call	uv__convert_utf8_to_utf16@PLT
	mov	r13d, eax
	test	eax, eax
	je	.L22
	.p2align 4,,10
	.p2align 3
.L1:
	mov	rax, QWORD PTR -56[rbp]
	xor	rax, QWORD PTR fs:40
	jne	.L23
	lea	rsp, -40[rbp]
	mov	eax, r13d
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	mov	r13d, DWORD PTR UV_EINVAL[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L21:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L22:
	mov	edi, DWORD PTR ERROR_SUCCESS[rip]
	call	SetLastError@PLT
	mov	edx, DWORD PTR MAX_ENV_VAR_LENGTH[rip]
	mov	rdi, QWORD PTR -64[rbp]
	mov	rsi, r14
	call	GetEnvironmentVariableW@PLT
	mov	rdi, QWORD PTR -64[rbp]
	mov	r15, rax
	call	uv__free@PLT
	movsx	rax, DWORD PTR MAX_ENV_VAR_LENGTH[rip]
	xor	edi, edi
	cmp	rax, r15
	seta	dil
	call	assert@PLT
	test	r15, r15
	jne	.L8
	xor	eax, eax
	call	GetLastError@PLT
	cmp	DWORD PTR ERROR_SUCCESS[rip], eax
	jne	.L17
.L8:
	push	0
	mov	edi, DWORD PTR CP_UTF8[rip]
	xor	esi, esi
	xor	r9d, r9d
	push	0
	xor	r8d, r8d
	mov	ecx, -1
	mov	rdx, r14
	call	WideCharToMultiByte@PLT
	pop	rsi
	pop	rdi
	test	rax, rax
	je	.L18
	mov	r9, QWORD PTR [rbx]
	cmp	r9, rax
	jnb	.L10
	mov	QWORD PTR [rbx], rax
	mov	r13d, DWORD PTR UV_ENOBUFS[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L18:
	call	GetLastError@PLT
.L17:
	mov	edi, eax
	call	uv_translate_sys_error@PLT
	mov	r13d, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L10:
	push	0
	mov	edi, DWORD PTR CP_UTF8[rip]
	mov	ecx, -1
	mov	rdx, r14
	push	0
	mov	r8, r12
	xor	esi, esi
	call	WideCharToMultiByte@PLT
	pop	rdx
	pop	rcx
	test	rax, rax
	je	.L18
	sub	rax, 1
	mov	QWORD PTR [rbx], rax
	jmp	.L1
.L23:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	uv_os_getenv, .-uv_os_getenv
	.comm	UV_ENOBUFS,4,4
	.comm	UV_EINVAL,4,4
	.comm	MAX_ENV_VAR_LENGTH,4,4
	.comm	ERROR_SUCCESS,4,4
	.comm	CP_UTF8,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_util.c_uv_os_getenv.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	uv_os_getenv
	.syntax unified
	.arm
	.fpu softvfp
	.type	uv_os_getenv, %function
uv_os_getenv:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	clz	r3, r2
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	cmp	r1, #0
	lsr	r3, r3, #5
	add	fp, sp, #32
	moveq	r3, #1
	sub	sp, sp, #28
	cmp	r0, #0
	moveq	r3, #1
	ldr	r4, .L15
	cmp	r3, #0
	ldr	r3, [r4]
	ldr	ip, .L15+4
	lsl	r3, r3, #2
	add	r3, r3, #7
	bic	r3, r3, #7
	ldr	ip, [ip]
	str	ip, [fp, #-40]
	mov	ip,#0
	sub	sp, sp, r3
	bne	.L2
	ldr	r3, [r2]
	mov	r8, r2
	cmp	r3, #0
	bne	.L3
.L2:
	ldr	r3, .L15+8
	ldr	r6, [r3]
.L1:
	ldr	r3, .L15+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L14
	mov	r0, r6
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L3:
	mov	r5, r1
	sub	r2, fp, #44
	mvn	r1, #0
	bl	uv__convert_utf8_to_utf16
	subs	r6, r0, #0
	bne	.L1
	ldr	r10, .L15+12
	add	r7, sp, #16
	ldr	r0, [r10]
	bl	SetLastError
	mov	r1, r7
	ldr	r2, [r4]
	ldr	r0, [fp, #-44]
	bl	GetEnvironmentVariableW
	mov	r9, r0
	ldr	r0, [fp, #-44]
	bl	uv__free
	ldr	r0, [r4]
	cmp	r0, r9
	movls	r0, #0
	movhi	r0, #1
	bl	assert
	cmp	r9, #0
	bne	.L5
	bl	GetLastError
	ldr	r3, [r10]
	cmp	r3, r0
	bne	.L11
.L5:
	mov	r4, #0
	ldr	r9, .L15+16
	str	r4, [sp, #12]
	str	r4, [sp, #8]
	str	r4, [sp, #4]
	str	r4, [sp]
	mov	r1, r4
	mvn	r3, #0
	mov	r2, r7
	ldr	r0, [r9]
	bl	WideCharToMultiByte
	cmp	r0, #0
	beq	.L12
	ldr	r3, [r8]
	cmp	r3, r0
	ldrcc	r3, .L15+20
	strcc	r0, [r8]
	ldrcc	r6, [r3]
	bcc	.L1
.L7:
	stmib	sp, {r3, r4}
	str	r4, [sp, #12]
	str	r5, [sp]
	mov	r2, r7
	mov	r1, r4
	mvn	r3, #0
	ldr	r0, [r9]
	bl	WideCharToMultiByte
	cmp	r0, #0
	subne	r0, r0, #1
	strne	r0, [r8]
	bne	.L1
.L12:
	bl	GetLastError
.L11:
	bl	uv_translate_sys_error
	mov	r6, r0
	b	.L1
.L14:
	bl	__stack_chk_fail
.L16:
	.align	2
.L15:
	.word	MAX_ENV_VAR_LENGTH
	.word	.LC0
	.word	UV_EINVAL
	.word	ERROR_SUCCESS
	.word	CP_UTF8
	.word	UV_ENOBUFS
	.size	uv_os_getenv, .-uv_os_getenv
	.comm	UV_ENOBUFS,4,4
	.comm	UV_EINVAL,4,4
	.comm	MAX_ENV_VAR_LENGTH,4,4
	.comm	ERROR_SUCCESS,4,4
	.comm	CP_UTF8,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
