	.file	"517104.c"
	.intel_syntax noprefix
	.text
	.globl	ROM
	.data
	.align 32
	.type	ROM, @object
	.size	ROM, 64
ROM:
	.long	135
	.long	65
	.long	177
	.long	65
	.long	179
	.long	134
	.long	65
	.long	182
	.long	65
	.long	184
	.long	128
	.long	132
	.long	65
	.long	186
	.long	136
	.long	175
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -12[rbp], 0
	mov	DWORD PTR -16[rbp], 0
	lea	rdx, -16[rbp]
	mov	eax, DWORD PTR -12[rbp]
	mov	rsi, rdx
	mov	edi, eax
	mov	eax, 0
	call	fourbit_computer
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC0:
	.string	"STEP%3d: PC=%X ROM=%X INST=%X IMM=%x\n"
.LC1:
	.string	"ERROR: EXEC OF UNDEF INST\n"
.LC2:
	.string	" sel_idx=%X wr_en=%X\n"
.LC3:
	.string	"ERROR: UNKNOWN REG ACCESS\n"
	.align 8
.LC4:
	.string	"WARNING: NON WRITEBACK (MAYBE NOP?)\n"
	.align 8
.LC5:
	.string	" NextPC=%X, REGA=%X, REGB=%X, OUT=%X\n"
	.text
	.globl	fourbit_computer
	.type	fourbit_computer, @function
fourbit_computer:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 80
	mov	DWORD PTR -68[rbp], edi
	mov	QWORD PTR -80[rbp], rsi
	mov	DWORD PTR -52[rbp], 0
	mov	DWORD PTR -48[rbp], 0
	mov	DWORD PTR -44[rbp], 0
	mov	DWORD PTR -40[rbp], 0
	mov	DWORD PTR -20[rbp], 0
.L42:
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, ROM[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	DWORD PTR -16[rbp], eax
	mov	eax, DWORD PTR -16[rbp]
	sar	eax, 4
	and	eax, 15
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -16[rbp]
	and	eax, 15
	mov	DWORD PTR -8[rbp], eax
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, ROM[rip]
	mov	ecx, DWORD PTR [rdx+rax]
	mov	edi, DWORD PTR -8[rbp]
	mov	esi, DWORD PTR -12[rbp]
	mov	edx, DWORD PTR -52[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	r9d, edi
	mov	r8d, esi
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -24[rbp], 0
	cmp	DWORD PTR -12[rbp], 15
	ja	.L5
	mov	eax, DWORD PTR -12[rbp]
	lea	rdx, 0[0+rax*4]
	lea	rax, .L7[rip]
	mov	eax, DWORD PTR [rdx+rax]
	cdqe
	lea	rdx, .L7[rip]
	add	rax, rdx
	notrack jmp	rax
	.section	.rodata
	.align 4
	.align 4
.L7:
	.long	.L22-.L7
	.long	.L21-.L7
	.long	.L20-.L7
	.long	.L19-.L7
	.long	.L18-.L7
	.long	.L17-.L7
	.long	.L16-.L7
	.long	.L15-.L7
	.long	.L14-.L7
	.long	.L13-.L7
	.long	.L12-.L7
	.long	.L11-.L7
	.long	.L10-.L7
	.long	.L9-.L7
	.long	.L8-.L7
	.long	.L6-.L7
	.text
.L22:
	mov	DWORD PTR -36[rbp], 8
	mov	DWORD PTR -28[rbp], 1
	jmp	.L23
.L21:
	mov	DWORD PTR -36[rbp], 8
	mov	DWORD PTR -28[rbp], 2
	jmp	.L23
.L20:
	mov	DWORD PTR -36[rbp], 2
	mov	DWORD PTR -28[rbp], 1
	jmp	.L23
.L19:
	mov	DWORD PTR -36[rbp], 1
	mov	DWORD PTR -28[rbp], 2
	jmp	.L23
.L18:
	mov	DWORD PTR -36[rbp], 1
	mov	DWORD PTR -28[rbp], 1
	jmp	.L23
.L17:
	mov	DWORD PTR -36[rbp], 2
	mov	DWORD PTR -28[rbp], 2
	jmp	.L23
.L16:
	mov	DWORD PTR -36[rbp], 4
	mov	DWORD PTR -28[rbp], 1
	jmp	.L23
.L15:
	mov	DWORD PTR -36[rbp], 4
	mov	DWORD PTR -28[rbp], 2
	jmp	.L23
.L14:
	mov	DWORD PTR -36[rbp], 8
	mov	DWORD PTR -28[rbp], 4
	jmp	.L23
.L13:
	mov	DWORD PTR -36[rbp], 2
	mov	DWORD PTR -28[rbp], 4
	jmp	.L23
.L12:
	mov	DWORD PTR -36[rbp], 8
	mov	DWORD PTR -28[rbp], 8
	mov	DWORD PTR -24[rbp], 1
	jmp	.L23
.L11:
	mov	DWORD PTR -36[rbp], 8
	mov	DWORD PTR -28[rbp], 8
	cmp	DWORD PTR -40[rbp], 0
	jne	.L24
	mov	DWORD PTR -24[rbp], 1
	jmp	.L23
.L24:
	mov	DWORD PTR -24[rbp], 0
	jmp	.L23
.L10:
	mov	DWORD PTR -36[rbp], 8
	mov	DWORD PTR -28[rbp], 0
	jmp	.L23
.L9:
	mov	DWORD PTR -36[rbp], 8
	mov	DWORD PTR -28[rbp], 0
	jmp	.L23
.L8:
	mov	DWORD PTR -36[rbp], 8
	mov	DWORD PTR -28[rbp], 0
	jmp	.L23
.L6:
	mov	DWORD PTR -36[rbp], 8
	mov	DWORD PTR -28[rbp], 0
	jmp	.L23
.L5:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 26
	mov	esi, 1
	lea	rdi, .LC1[rip]
	call	fwrite@PLT
	mov	edi, -1
	call	exit@PLT
.L23:
	mov	edx, DWORD PTR -28[rbp]
	mov	eax, DWORD PTR -36[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	cmp	DWORD PTR -36[rbp], 8
	je	.L26
	cmp	DWORD PTR -36[rbp], 8
	jg	.L27
	cmp	DWORD PTR -36[rbp], 4
	je	.L28
	cmp	DWORD PTR -36[rbp], 4
	jg	.L27
	cmp	DWORD PTR -36[rbp], 1
	je	.L29
	cmp	DWORD PTR -36[rbp], 2
	je	.L30
	jmp	.L27
.L29:
	mov	eax, DWORD PTR -48[rbp]
	mov	DWORD PTR -32[rbp], eax
	jmp	.L31
.L30:
	mov	eax, DWORD PTR -44[rbp]
	mov	DWORD PTR -32[rbp], eax
	jmp	.L31
.L28:
	mov	eax, DWORD PTR -68[rbp]
	mov	DWORD PTR -32[rbp], eax
	jmp	.L31
.L26:
	mov	DWORD PTR -32[rbp], 0
	jmp	.L31
.L27:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 26
	mov	esi, 1
	lea	rdi, .LC3[rip]
	call	fwrite@PLT
	mov	edi, -1
	call	exit@PLT
.L31:
	mov	edx, DWORD PTR -32[rbp]
	mov	eax, DWORD PTR -8[rbp]
	add	eax, edx
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	and	eax, 16
	test	eax, eax
	je	.L32
	mov	DWORD PTR -40[rbp], 1
	jmp	.L33
.L32:
	mov	DWORD PTR -40[rbp], 0
.L33:
	cmp	DWORD PTR -28[rbp], 8
	je	.L34
	cmp	DWORD PTR -28[rbp], 8
	jg	.L35
	cmp	DWORD PTR -28[rbp], 4
	je	.L36
	cmp	DWORD PTR -28[rbp], 4
	jg	.L35
	cmp	DWORD PTR -28[rbp], 1
	je	.L37
	cmp	DWORD PTR -28[rbp], 2
	je	.L38
	jmp	.L35
.L37:
	mov	eax, DWORD PTR -4[rbp]
	and	eax, 15
	mov	DWORD PTR -48[rbp], eax
	add	DWORD PTR -52[rbp], 1
	jmp	.L39
.L38:
	mov	eax, DWORD PTR -4[rbp]
	and	eax, 15
	mov	DWORD PTR -44[rbp], eax
	add	DWORD PTR -52[rbp], 1
	jmp	.L39
.L36:
	mov	eax, DWORD PTR -4[rbp]
	and	eax, 15
	mov	edx, eax
	mov	rax, QWORD PTR -80[rbp]
	mov	DWORD PTR [rax], edx
	add	DWORD PTR -52[rbp], 1
	jmp	.L39
.L34:
	cmp	DWORD PTR -24[rbp], 1
	jne	.L40
	mov	eax, DWORD PTR -4[rbp]
	and	eax, 15
	mov	DWORD PTR -52[rbp], eax
	jmp	.L39
.L40:
	add	DWORD PTR -52[rbp], 1
	jmp	.L39
.L35:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 36
	mov	esi, 1
	lea	rdi, .LC4[rip]
	call	fwrite@PLT
	mov	edi, -1
	call	exit@PLT
.L39:
	and	DWORD PTR -52[rbp], 15
	mov	rax, QWORD PTR -80[rbp]
	mov	esi, DWORD PTR [rax]
	mov	ecx, DWORD PTR -44[rbp]
	mov	edx, DWORD PTR -48[rbp]
	mov	eax, DWORD PTR -52[rbp]
	mov	r8d, esi
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -20[rbp], 1
	jmp	.L42
	.cfi_endproc
.LFE7:
	.size	fourbit_computer, .-fourbit_computer
	.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	"517104.c"
	.text
	.global	ROM
	.data
	.align	2
	.type	ROM, %object
	.size	ROM, 64
ROM:
	.word	135
	.word	65
	.word	177
	.word	65
	.word	179
	.word	134
	.word	65
	.word	182
	.word	65
	.word	184
	.word	128
	.word	132
	.word	65
	.word	186
	.word	136
	.word	175
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	ldr	r3, .L4
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-16]
	sub	r3, fp, #16
	mov	r1, r3
	ldr	r0, [fp, #-12]
	bl	fourbit_computer
	mov	r3, #0
	ldr	r2, .L4
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L3
	bl	__stack_chk_fail
.L3:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L5:
	.align	2
.L4:
	.word	.LC0
	.size	main, .-main
	.section	.rodata
	.align	2
.LC1:
	.ascii	"STEP%3d: PC=%X ROM=%X INST=%X IMM=%x\012\000"
	.align	2
.LC2:
	.ascii	"ERROR: EXEC OF UNDEF INST\012\000"
	.align	2
.LC3:
	.ascii	" sel_idx=%X wr_en=%X\012\000"
	.align	2
.LC4:
	.ascii	"ERROR: UNKNOWN REG ACCESS\012\000"
	.align	2
.LC5:
	.ascii	"WARNING: NON WRITEBACK (MAYBE NOP?)\012\000"
	.align	2
.LC6:
	.ascii	" NextPC=%X, REGA=%X, REGB=%X, OUT=%X\012\000"
	.text
	.align	2
	.global	fourbit_computer
	.syntax unified
	.arm
	.fpu softvfp
	.type	fourbit_computer, %function
fourbit_computer:
	@ args = 0, pretend = 0, frame = 64
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #72
	str	r0, [fp, #-64]
	str	r1, [fp, #-68]
	mov	r3, #0
	str	r3, [fp, #-56]
	mov	r3, #0
	str	r3, [fp, #-52]
	mov	r3, #0
	str	r3, [fp, #-48]
	mov	r3, #0
	str	r3, [fp, #-44]
	mov	r3, #0
	str	r3, [fp, #-24]
.L46:
	ldr	r2, .L47
	ldr	r3, [fp, #-56]
	ldr	r3, [r2, r3, lsl #2]
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	asr	r3, r3, #4
	and	r3, r3, #15
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-20]
	and	r3, r3, #15
	str	r3, [fp, #-12]
	ldr	r2, .L47
	ldr	r3, [fp, #-56]
	ldr	r2, [r2, r3, lsl #2]
	ldr	r3, [fp, #-12]
	str	r3, [sp, #4]
	ldr	r3, [fp, #-16]
	str	r3, [sp]
	mov	r3, r2
	ldr	r2, [fp, #-56]
	ldr	r1, [fp, #-24]
	ldr	r0, .L47+4
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-16]
	cmp	r3, #15
	ldrls	pc, [pc, r3, asl #2]
	b	.L7
.L9:
	.word	.L24
	.word	.L23
	.word	.L22
	.word	.L21
	.word	.L20
	.word	.L19
	.word	.L18
	.word	.L17
	.word	.L16
	.word	.L15
	.word	.L14
	.word	.L13
	.word	.L12
	.word	.L11
	.word	.L10
	.word	.L8
.L24:
	mov	r3, #8
	str	r3, [fp, #-40]
	mov	r3, #1
	str	r3, [fp, #-32]
	b	.L25
.L23:
	mov	r3, #8
	str	r3, [fp, #-40]
	mov	r3, #2
	str	r3, [fp, #-32]
	b	.L25
.L22:
	mov	r3, #2
	str	r3, [fp, #-40]
	mov	r3, #1
	str	r3, [fp, #-32]
	b	.L25
.L21:
	mov	r3, #1
	str	r3, [fp, #-40]
	mov	r3, #2
	str	r3, [fp, #-32]
	b	.L25
.L20:
	mov	r3, #1
	str	r3, [fp, #-40]
	mov	r3, #1
	str	r3, [fp, #-32]
	b	.L25
.L19:
	mov	r3, #2
	str	r3, [fp, #-40]
	mov	r3, #2
	str	r3, [fp, #-32]
	b	.L25
.L18:
	mov	r3, #4
	str	r3, [fp, #-40]
	mov	r3, #1
	str	r3, [fp, #-32]
	b	.L25
.L17:
	mov	r3, #4
	str	r3, [fp, #-40]
	mov	r3, #2
	str	r3, [fp, #-32]
	b	.L25
.L16:
	mov	r3, #8
	str	r3, [fp, #-40]
	mov	r3, #4
	str	r3, [fp, #-32]
	b	.L25
.L15:
	mov	r3, #2
	str	r3, [fp, #-40]
	mov	r3, #4
	str	r3, [fp, #-32]
	b	.L25
.L14:
	mov	r3, #8
	str	r3, [fp, #-40]
	mov	r3, #8
	str	r3, [fp, #-32]
	mov	r3, #1
	str	r3, [fp, #-28]
	b	.L25
.L13:
	mov	r3, #8
	str	r3, [fp, #-40]
	mov	r3, #8
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-44]
	cmp	r3, #0
	bne	.L26
	mov	r3, #1
	str	r3, [fp, #-28]
	b	.L25
.L26:
	mov	r3, #0
	str	r3, [fp, #-28]
	b	.L25
.L12:
	mov	r3, #8
	str	r3, [fp, #-40]
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L25
.L11:
	mov	r3, #8
	str	r3, [fp, #-40]
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L25
.L10:
	mov	r3, #8
	str	r3, [fp, #-40]
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L25
.L8:
	mov	r3, #8
	str	r3, [fp, #-40]
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L25
.L7:
	ldr	r3, .L47+8
	ldr	r3, [r3]
	mov	r2, #26
	mov	r1, #1
	ldr	r0, .L47+12
	bl	fwrite
	mvn	r0, #0
	bl	exit
.L25:
	ldr	r2, [fp, #-32]
	ldr	r1, [fp, #-40]
	ldr	r0, .L47+16
	bl	printf
	ldr	r3, [fp, #-40]
	sub	r3, r3, #1
	cmp	r3, #7
	ldrls	pc, [pc, r3, asl #2]
	b	.L28
.L30:
	.word	.L33
	.word	.L32
	.word	.L28
	.word	.L31
	.word	.L28
	.word	.L28
	.word	.L28
	.word	.L29
.L33:
	ldr	r3, [fp, #-52]
	str	r3, [fp, #-36]
	b	.L34
.L32:
	ldr	r3, [fp, #-48]
	str	r3, [fp, #-36]
	b	.L34
.L31:
	ldr	r3, [fp, #-64]
	str	r3, [fp, #-36]
	b	.L34
.L29:
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L34
.L28:
	ldr	r3, .L47+8
	ldr	r3, [r3]
	mov	r2, #26
	mov	r1, #1
	ldr	r0, .L47+20
	bl	fwrite
	mvn	r0, #0
	bl	exit
.L34:
	ldr	r2, [fp, #-36]
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	and	r3, r3, #16
	cmp	r3, #0
	beq	.L35
	mov	r3, #1
	str	r3, [fp, #-44]
	b	.L36
.L35:
	mov	r3, #0
	str	r3, [fp, #-44]
.L36:
	ldr	r3, [fp, #-32]
	sub	r3, r3, #1
	cmp	r3, #7
	ldrls	pc, [pc, r3, asl #2]
	b	.L37
.L39:
	.word	.L42
	.word	.L41
	.word	.L37
	.word	.L40
	.word	.L37
	.word	.L37
	.word	.L37
	.word	.L38
.L42:
	ldr	r3, [fp, #-8]
	and	r3, r3, #15
	str	r3, [fp, #-52]
	ldr	r3, [fp, #-56]
	add	r3, r3, #1
	str	r3, [fp, #-56]
	b	.L43
.L41:
	ldr	r3, [fp, #-8]
	and	r3, r3, #15
	str	r3, [fp, #-48]
	ldr	r3, [fp, #-56]
	add	r3, r3, #1
	str	r3, [fp, #-56]
	b	.L43
.L40:
	ldr	r3, [fp, #-8]
	and	r2, r3, #15
	ldr	r3, [fp, #-68]
	str	r2, [r3]
	ldr	r3, [fp, #-56]
	add	r3, r3, #1
	str	r3, [fp, #-56]
	b	.L43
.L38:
	ldr	r3, [fp, #-28]
	cmp	r3, #1
	bne	.L44
	ldr	r3, [fp, #-8]
	and	r3, r3, #15
	str	r3, [fp, #-56]
	b	.L43
.L44:
	ldr	r3, [fp, #-56]
	add	r3, r3, #1
	str	r3, [fp, #-56]
	b	.L43
.L37:
	ldr	r3, .L47+8
	ldr	r3, [r3]
	mov	r2, #36
	mov	r1, #1
	ldr	r0, .L47+24
	bl	fwrite
	mvn	r0, #0
	bl	exit
.L43:
	ldr	r3, [fp, #-56]
	and	r3, r3, #15
	str	r3, [fp, #-56]
	ldr	r3, [fp, #-68]
	ldr	r3, [r3]
	str	r3, [sp]
	ldr	r3, [fp, #-48]
	ldr	r2, [fp, #-52]
	ldr	r1, [fp, #-56]
	ldr	r0, .L47+28
	bl	printf
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
	b	.L46
.L48:
	.align	2
.L47:
	.word	ROM
	.word	.LC1
	.word	stderr
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.size	fourbit_computer, .-fourbit_computer
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
