	.file	"617704.c"
	.intel_syntax noprefix
	.text
	.globl	input
	.bss
	.align 32
	.type	input, @object
	.size	input, 256
input:
	.zero	256
	.section	.rodata
.LC0:
	.string	"Reach bug1"
.LC1:
	.string	"A"
.LC2:
	.string	"QAQ"
	.text
	.globl	BUG
	.type	BUG, @function
BUG:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdi, .LC0[rip]
	call	puts@PLT
	lea	rsi, .LC1[rip]
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	strtok@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	BUG, .-BUG
	.section	.rodata
.LC3:
	.string	"Reach bug2"
	.text
	.globl	BUG2
	.type	BUG2, @function
BUG2:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	BYTE PTR input[rip+257], 0
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	BUG2, .-BUG2
	.section	.rodata
.LC4:
	.string	"Reach bug3"
	.text
	.globl	BUG3
	.type	BUG3, @function
BUG3:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	edx, 10
	lea	rsi, input[rip]
	mov	edi, 0
	mov	eax, 0
	call	read@PLT
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	sub	eax, 1
	cdqe
	lea	rdx, input[rip]
	mov	BYTE PTR [rax+rdx], 0
	lea	rdi, input[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	BUG3, .-BUG3
	.section	.rodata
	.align 8
.LC5:
	.string	"Mediatek Fuzzing Workshop in HITCON 2021!"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdi, .LC5[rip]
	call	puts@PLT
	mov	edx, 256
	lea	rsi, input[rip]
	mov	edi, 0
	mov	eax, 0
	call	read@PLT
	cmp	eax, 6
	jg	.L5
	mov	eax, -1
	jmp	.L6
.L5:
	movzx	eax, BYTE PTR input[rip]
	cmp	al, 77
	jne	.L7
	movzx	eax, BYTE PTR input[rip+1]
	cmp	al, 84
	jne	.L7
	movzx	eax, BYTE PTR input[rip+2]
	cmp	al, 75
	jne	.L7
	lea	rax, input[rip+3]
	mov	eax, DWORD PTR [rax]
	cmp	eax, -559038737
	jne	.L7
	mov	eax, 0
	call	BUG
.L7:
	mov	eax, 0
.L6:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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	"617704.c"
	.text
	.comm	input,256,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Reach bug1\000"
	.align	2
.LC1:
	.ascii	"A\000"
	.align	2
.LC2:
	.ascii	"QAQ\000"
	.text
	.align	2
	.global	BUG
	.syntax unified
	.arm
	.fpu softvfp
	.type	BUG, %function
BUG:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r0, .L2
	bl	puts
	ldr	r1, .L2+4
	ldr	r0, .L2+8
	bl	strtok
	nop
	pop	{fp, pc}
.L3:
	.align	2
.L2:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.size	BUG, .-BUG
	.section	.rodata
	.align	2
.LC3:
	.ascii	"Reach bug2\000"
	.text
	.align	2
	.global	BUG2
	.syntax unified
	.arm
	.fpu softvfp
	.type	BUG2, %function
BUG2:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r0, .L5
	bl	puts
	ldr	r3, .L5+4
	mov	r2, #0
	strb	r2, [r3, #257]
	nop
	pop	{fp, pc}
.L6:
	.align	2
.L5:
	.word	.LC3
	.word	input
	.size	BUG2, .-BUG2
	.section	.rodata
	.align	2
.LC4:
	.ascii	"Reach bug3\000"
	.text
	.align	2
	.global	BUG3
	.syntax unified
	.arm
	.fpu softvfp
	.type	BUG3, %function
BUG3:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	ldr	r0, .L8
	bl	puts
	mov	r2, #10
	ldr	r1, .L8+4
	mov	r0, #0
	bl	read
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	sub	r3, r3, #1
	ldr	r2, .L8+4
	mov	r1, #0
	strb	r1, [r2, r3]
	ldr	r0, .L8+4
	bl	printf
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L9:
	.align	2
.L8:
	.word	.LC4
	.word	input
	.size	BUG3, .-BUG3
	.section	.rodata
	.align	2
.LC5:
	.ascii	"Mediatek Fuzzing Workshop in HITCON 2021!\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r0, .L14
	bl	puts
	mov	r2, #256
	ldr	r1, .L14+4
	mov	r0, #0
	bl	read
	mov	r3, r0
	cmp	r3, #6
	bgt	.L11
	mvn	r3, #0
	b	.L12
.L11:
	ldr	r3, .L14+4
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #77
	bne	.L13
	ldr	r3, .L14+4
	ldrb	r3, [r3, #1]	@ zero_extendqisi2
	cmp	r3, #84
	bne	.L13
	ldr	r3, .L14+4
	ldrb	r3, [r3, #2]	@ zero_extendqisi2
	cmp	r3, #75
	bne	.L13
	ldr	r3, .L14+8
	ldr	r3, [r3]
	ldr	r2, .L14+12
	cmp	r3, r2
	bne	.L13
	bl	BUG
.L13:
	mov	r3, #0
.L12:
	mov	r0, r3
	pop	{fp, pc}
.L15:
	.align	2
.L14:
	.word	.LC5
	.word	input
	.word	input+3
	.word	-559038737
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
