	.file	"176862.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"history$ "
.LC1:
	.string	"%s\n"
.LC2:
	.string	"quit"
.LC3:
	.string	"save"
.LC4:
	.string	"history_file"
.LC5:
	.string	"read"
.LC6:
	.string	"list"
.LC7:
	.string	"%a %R"
.LC8:
	.string	"%d: %s: %s\n"
.LC9:
	.string	"delete"
.LC10:
	.string	"%d"
.LC11:
	.string	"No such entry %d\n"
	.align 8
.LC12:
	.string	"non-numeric arg given to `delete'\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r12
	push	rbx
	sub	rsp, 1232
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	mov	DWORD PTR -1236[rbp], edi
	mov	QWORD PTR -1248[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	BYTE PTR -1056[rbp], 0
	mov	DWORD PTR -1220[rbp], 0
	call	using_history@PLT
	jmp	.L2
.L21:
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	mov	rdx, QWORD PTR stdin[rip]
	lea	rax, -1056[rbp]
	mov	esi, 1023
	mov	rdi, rax
	call	fgets@PLT
	mov	QWORD PTR -1200[rbp], rax
	cmp	QWORD PTR -1200[rbp], 0
	je	.L3
	mov	rax, QWORD PTR -1200[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	je	.L3
	mov	rax, QWORD PTR -1200[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	DWORD PTR -1216[rbp], eax
	mov	eax, DWORD PTR -1216[rbp]
	cdqe
	lea	rdx, -1[rax]
	mov	rax, QWORD PTR -1200[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	cmp	al, 10
	jne	.L3
	mov	eax, DWORD PTR -1216[rbp]
	cdqe
	lea	rdx, -1[rax]
	mov	rax, QWORD PTR -1200[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
.L3:
	cmp	QWORD PTR -1200[rbp], 0
	jne	.L4
	lea	rax, -1056[rbp]
	mov	DWORD PTR [rax], 1953068401
	mov	BYTE PTR 4[rax], 0
.L4:
	movzx	eax, BYTE PTR -1056[rbp]
	test	al, al
	je	.L5
	call	using_history@PLT
	lea	rdx, -1208[rbp]
	lea	rax, -1056[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	history_expand@PLT
	mov	DWORD PTR -1212[rbp], eax
	cmp	DWORD PTR -1212[rbp], 0
	je	.L6
	mov	rdx, QWORD PTR -1208[rbp]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L6:
	cmp	DWORD PTR -1212[rbp], 0
	js	.L7
	cmp	DWORD PTR -1212[rbp], 2
	jne	.L8
.L7:
	mov	rax, QWORD PTR -1208[rbp]
	mov	rdi, rax
	call	free@PLT
	jmp	.L2
.L8:
	mov	rax, QWORD PTR -1208[rbp]
	mov	rdi, rax
	call	add_history@PLT
	mov	rcx, QWORD PTR -1208[rbp]
	lea	rax, -1056[rbp]
	mov	edx, 1023
	mov	rsi, rcx
	mov	rdi, rax
	call	strncpy@PLT
	mov	rax, QWORD PTR -1208[rbp]
	mov	rdi, rax
	call	free@PLT
.L5:
	lea	rax, -1056[rbp]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L9
	mov	DWORD PTR -1220[rbp], 1
	jmp	.L2
.L9:
	lea	rax, -1056[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L10
	lea	rdi, .LC4[rip]
	call	write_history@PLT
	jmp	.L2
.L10:
	lea	rax, -1056[rbp]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L11
	lea	rdi, .LC4[rip]
	call	read_history@PLT
	jmp	.L2
.L11:
	lea	rax, -1056[rbp]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L12
	call	history_list@PLT
	mov	r12, rax
	test	r12, r12
	je	.L2
	mov	ebx, 0
	jmp	.L14
.L17:
	movsx	rax, ebx
	sal	rax, 3
	add	rax, r12
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	history_get_time@PLT
	mov	QWORD PTR -1208[rbp], rax
	mov	rax, QWORD PTR -1208[rbp]
	test	rax, rax
	je	.L15
	lea	rax, -1208[rbp]
	mov	rdi, rax
	call	localtime@PLT
	mov	rdx, rax
	lea	rax, -1184[rbp]
	mov	rcx, rdx
	lea	rdx, .LC7[rip]
	mov	esi, 128
	mov	rdi, rax
	call	strftime@PLT
	jmp	.L16
.L15:
	lea	rax, -1184[rbp]
	mov	WORD PTR [rax], 16191
	mov	BYTE PTR 2[rax], 0
.L16:
	movsx	rax, ebx
	sal	rax, 3
	add	rax, r12
	mov	rax, QWORD PTR [rax]
	mov	rdx, QWORD PTR [rax]
	mov	eax, DWORD PTR history_base[rip]
	lea	esi, [rbx+rax]
	lea	rax, -1184[rbp]
	mov	rcx, rdx
	mov	rdx, rax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	add	ebx, 1
.L14:
	movsx	rax, ebx
	sal	rax, 3
	add	rax, r12
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	jne	.L17
	jmp	.L2
.L12:
	lea	rax, -1056[rbp]
	mov	edx, 6
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	call	strncmp@PLT
	test	eax, eax
	jne	.L2
	lea	rax, -1056[rbp]
	add	rax, 6
	lea	rdx, -1208[rbp]
	lea	rsi, .LC10[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_sscanf@PLT
	cmp	eax, 1
	jne	.L18
	mov	eax, DWORD PTR -1208[rbp]
	mov	edi, eax
	call	remove_history@PLT
	mov	QWORD PTR -1192[rbp], rax
	cmp	QWORD PTR -1192[rbp], 0
	jne	.L19
	mov	edx, DWORD PTR -1208[rbp]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC11[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	jmp	.L2
.L19:
	mov	rax, QWORD PTR -1192[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -1192[rbp]
	mov	rdi, rax
	call	free@PLT
	jmp	.L2
.L18:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 34
	mov	esi, 1
	lea	rdi, .LC12[rip]
	call	fwrite@PLT
.L2:
	cmp	DWORD PTR -1220[rbp], 0
	je	.L21
	mov	eax, 0
	mov	rcx, QWORD PTR -24[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	add	rsp, 1232
	pop	rbx
	pop	r12
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.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, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"176862.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"history$ \000"
	.align	2
.LC1:
	.ascii	"quit\000"
	.align	2
.LC2:
	.ascii	"%s\012\000"
	.align	2
.LC3:
	.ascii	"save\000"
	.align	2
.LC4:
	.ascii	"history_file\000"
	.align	2
.LC5:
	.ascii	"read\000"
	.align	2
.LC6:
	.ascii	"list\000"
	.align	2
.LC7:
	.ascii	"%a %R\000"
	.align	2
.LC8:
	.ascii	"??\000"
	.align	2
.LC9:
	.ascii	"%d: %s: %s\012\000"
	.align	2
.LC10:
	.ascii	"delete\000"
	.align	2
.LC11:
	.ascii	"%d\000"
	.align	2
.LC12:
	.ascii	"No such entry %d\012\000"
	.align	2
.LC13:
	.ascii	"non-numeric arg given to `delete'\012\000"
	.align	2
.LC14:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 1192
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #1184
	sub	sp, sp, #8
	str	r0, [fp, #-1200]
	str	r1, [fp, #-1204]
	ldr	r3, .L24
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #0
	strb	r3, [fp, #-1040]
	mov	r3, #0
	str	r3, [fp, #-1188]
	bl	using_history
	b	.L2
.L21:
	ldr	r0, .L24+4
	bl	printf
	ldr	r3, .L24+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	ldr	r3, .L24+12
	ldr	r2, [r3]
	sub	r3, fp, #1024
	sub	r3, r3, #12
	sub	r3, r3, #4
	ldr	r1, .L24+16
	mov	r0, r3
	bl	fgets
	str	r0, [fp, #-1184]
	ldr	r3, [fp, #-1184]
	cmp	r3, #0
	beq	.L3
	ldr	r3, [fp, #-1184]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L3
	ldr	r0, [fp, #-1184]
	bl	strlen
	mov	r3, r0
	str	r3, [fp, #-1180]
	ldr	r3, [fp, #-1180]
	sub	r3, r3, #1
	ldr	r2, [fp, #-1184]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #10
	bne	.L3
	ldr	r3, [fp, #-1180]
	sub	r3, r3, #1
	ldr	r2, [fp, #-1184]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
.L3:
	ldr	r3, [fp, #-1184]
	cmp	r3, #0
	bne	.L4
	sub	r3, fp, #1024
	sub	r3, r3, #12
	sub	r3, r3, #4
	ldr	r2, .L24+20
	ldm	r2, {r0, r1}
	str	r0, [r3]
	add	r3, r3, #4
	strb	r1, [r3]
.L4:
	ldrb	r3, [fp, #-1040]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L5
	bl	using_history
	sub	r2, fp, #1168
	sub	r2, r2, #12
	sub	r2, r2, #12
	sub	r3, fp, #1024
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r1, r2
	mov	r0, r3
	bl	history_expand
	str	r0, [fp, #-1176]
	ldr	r3, [fp, #-1176]
	cmp	r3, #0
	beq	.L6
	ldr	r3, .L24+24
	ldr	r3, [r3]
	ldr	r2, [fp, #-1192]
	ldr	r1, .L24+28
	mov	r0, r3
	bl	fprintf
.L6:
	ldr	r3, [fp, #-1176]
	cmp	r3, #0
	blt	.L7
	ldr	r3, [fp, #-1176]
	cmp	r3, #2
	bne	.L8
.L7:
	ldr	r3, [fp, #-1192]
	mov	r0, r3
	bl	free
	b	.L2
.L8:
	ldr	r3, [fp, #-1192]
	mov	r0, r3
	bl	add_history
	ldr	r1, [fp, #-1192]
	sub	r3, fp, #1024
	sub	r3, r3, #12
	sub	r3, r3, #4
	ldr	r2, .L24+16
	mov	r0, r3
	bl	strncpy
	ldr	r3, [fp, #-1192]
	mov	r0, r3
	bl	free
.L5:
	sub	r3, fp, #1024
	sub	r3, r3, #12
	sub	r3, r3, #4
	ldr	r1, .L24+20
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L9
	mov	r3, #1
	str	r3, [fp, #-1188]
	b	.L2
.L9:
	sub	r3, fp, #1024
	sub	r3, r3, #12
	sub	r3, r3, #4
	ldr	r1, .L24+32
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L10
	ldr	r0, .L24+36
	bl	write_history
	b	.L2
.L10:
	sub	r3, fp, #1024
	sub	r3, r3, #12
	sub	r3, r3, #4
	ldr	r1, .L24+40
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L11
	ldr	r0, .L24+36
	bl	read_history
	b	.L2
.L11:
	sub	r3, fp, #1024
	sub	r3, r3, #12
	sub	r3, r3, #4
	ldr	r1, .L24+44
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L12
	bl	history_list
	mov	r4, r0
	cmp	r4, #0
	beq	.L2
	mov	r5, #0
	b	.L14
.L17:
	mov	r3, r5
	lsl	r3, r3, #2
	add	r3, r4, r3
	ldr	r3, [r3]
	mov	r0, r3
	bl	history_get_time
	mov	r3, r0
	str	r3, [fp, #-1192]
	ldr	r3, [fp, #-1192]
	cmp	r3, #0
	beq	.L15
	sub	r3, fp, #1168
	sub	r3, r3, #12
	sub	r3, r3, #12
	mov	r0, r3
	bl	localtime
	mov	r3, r0
	sub	r0, fp, #1152
	sub	r0, r0, #12
	sub	r0, r0, #4
	ldr	r2, .L24+48
	mov	r1, #128
	bl	strftime
	b	.L16
.L15:
	sub	r3, fp, #1152
	sub	r3, r3, #12
	sub	r3, r3, #4
	ldr	r2, .L24+52
	ldr	r2, [r2]
	strh	r2, [r3]	@ movhi
	add	r3, r3, #2
	lsr	r2, r2, #16
	strb	r2, [r3]
.L16:
	ldr	r3, .L24+56
	ldr	r3, [r3]
	add	r1, r5, r3
	mov	r3, r5
	lsl	r3, r3, #2
	add	r3, r4, r3
	ldr	r3, [r3]
	ldr	r3, [r3]
	sub	r2, fp, #1152
	sub	r2, r2, #12
	sub	r2, r2, #4
	ldr	r0, .L24+60
	bl	printf
	add	r5, r5, #1
.L14:
	mov	r3, r5
	lsl	r3, r3, #2
	add	r3, r4, r3
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L17
	b	.L2
.L12:
	sub	r3, fp, #1024
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r2, #6
	ldr	r1, .L24+64
	mov	r0, r3
	bl	strncmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L2
	sub	r3, fp, #1024
	sub	r3, r3, #12
	sub	r3, r3, #4
	add	r3, r3, #6
	sub	r2, fp, #1168
	sub	r2, r2, #12
	sub	r2, r2, #12
	ldr	r1, .L24+68
	mov	r0, r3
	bl	__isoc99_sscanf
	mov	r3, r0
	cmp	r3, #1
	bne	.L18
	ldr	r3, [fp, #-1192]
	mov	r0, r3
	bl	remove_history
	str	r0, [fp, #-1172]
	ldr	r3, [fp, #-1172]
	cmp	r3, #0
	bne	.L19
	ldr	r3, .L24+24
	ldr	r3, [r3]
	ldr	r2, [fp, #-1192]
	ldr	r1, .L24+72
	mov	r0, r3
	bl	fprintf
	b	.L2
.L19:
	ldr	r3, [fp, #-1172]
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	ldr	r0, [fp, #-1172]
	bl	free
	b	.L2
.L18:
	ldr	r3, .L24+24
	ldr	r3, [r3]
	mov	r2, #34
	mov	r1, #1
	ldr	r0, .L24+76
	bl	fwrite
.L2:
	ldr	r3, [fp, #-1188]
	cmp	r3, #0
	beq	.L21
	mov	r3, #0
	ldr	r2, .L24
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L23
	bl	__stack_chk_fail
.L23:
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L25:
	.align	2
.L24:
	.word	.LC14
	.word	.LC0
	.word	stdout
	.word	stdin
	.word	1023
	.word	.LC1
	.word	stderr
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	history_base
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
