	.file	"623167.c"
	.intel_syntax noprefix
	.text
	.globl	idcode
	.bss
	.align 8
	.type	idcode, @object
	.size	idcode, 8
idcode:
	.zero	8
	.text
	.globl	get_bit
	.type	get_bit, @function
get_bit:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -40[rbp], rdi
	mov	DWORD PTR -44[rbp], esi
	mov	DWORD PTR -48[rbp], edx
	mov	eax, DWORD PTR -48[rbp]
	mov	edx, 0
	div	DWORD PTR -44[rbp]
	mov	DWORD PTR -48[rbp], edx
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -8[rbp], rax
	mov	eax, DWORD PTR -48[rbp]
	shr	eax, 5
	mov	DWORD PTR -16[rbp], eax
	mov	eax, DWORD PTR -48[rbp]
	and	eax, 31
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -16[rbp]
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	mov	eax, DWORD PTR -12[rbp]
	mov	edx, 1
	mov	ecx, eax
	sal	edx, cl
	mov	eax, edx
	and	eax, esi
	mov	BYTE PTR -17[rbp], al
	movzx	eax, BYTE PTR -17[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	get_bit, .-get_bit
	.globl	set_bit
	.type	set_bit, @function
set_bit:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -40[rbp], rdi
	mov	DWORD PTR -44[rbp], esi
	mov	DWORD PTR -48[rbp], edx
	mov	eax, ecx
	mov	BYTE PTR -52[rbp], al
	mov	eax, DWORD PTR -48[rbp]
	mov	edx, 0
	div	DWORD PTR -44[rbp]
	mov	DWORD PTR -48[rbp], edx
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -8[rbp], rax
	mov	eax, DWORD PTR -48[rbp]
	shr	eax, 5
	mov	DWORD PTR -20[rbp], eax
	mov	eax, DWORD PTR -48[rbp]
	and	eax, 31
	mov	DWORD PTR -16[rbp], eax
	cmp	BYTE PTR -52[rbp], 0
	jne	.L4
	mov	eax, DWORD PTR -16[rbp]
	mov	edx, 1
	mov	ecx, eax
	sal	edx, cl
	mov	eax, edx
	not	eax
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -20[rbp]
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	edx, DWORD PTR -20[rbp]
	lea	rcx, 0[0+rdx*4]
	mov	rdx, QWORD PTR -8[rbp]
	add	rdx, rcx
	and	eax, DWORD PTR -12[rbp]
	mov	DWORD PTR [rdx], eax
	jmp	.L5
.L4:
	mov	eax, DWORD PTR -16[rbp]
	mov	edx, 1
	mov	ecx, eax
	sal	edx, cl
	mov	eax, edx
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -20[rbp]
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	edx, DWORD PTR -20[rbp]
	lea	rcx, 0[0+rdx*4]
	mov	rdx, QWORD PTR -8[rbp]
	add	rdx, rcx
	or	eax, DWORD PTR -12[rbp]
	mov	DWORD PTR [rdx], eax
.L5:
	mov	eax, DWORD PTR -20[rbp]
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	mov	eax, DWORD PTR -16[rbp]
	mov	edx, 1
	mov	ecx, eax
	sal	edx, cl
	mov	eax, edx
	and	eax, esi
	mov	BYTE PTR -52[rbp], al
	mov	eax, 0
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	set_bit, .-set_bit
	.section	.rodata
.LC0:
	.string	"gpio read %d"
.LC1:
	.string	"r"
.LC2:
	.string	"0\n"
.LC3:
	.string	"1\n"
	.align 8
.LC4:
	.string	"error: gpio %d read return [%s]\n"
.LC5:
	.string	"[%d]: 0x%02x\n"
	.text
	.globl	gpio_get
	.type	gpio_get, @function
gpio_get:
.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, 1072
	mov	DWORD PTR -1060[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -528[rbp]
	mov	edx, 512
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	edx, DWORD PTR -1060[rbp]
	lea	rax, -1040[rbp]
	mov	ecx, edx
	lea	rdx, .LC0[rip]
	mov	esi, 512
	mov	rdi, rax
	mov	eax, 0
	call	snprintf@PLT
	lea	rax, -1040[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	popen@PLT
	mov	QWORD PTR -1048[rbp], rax
	mov	rdx, QWORD PTR -1048[rbp]
	lea	rax, -528[rbp]
	mov	rcx, rdx
	mov	edx, 512
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	lea	rax, -528[rbp]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L8
	mov	rax, QWORD PTR -1048[rbp]
	mov	rdi, rax
	call	pclose@PLT
	mov	eax, 0
	jmp	.L13
.L8:
	lea	rax, -528[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L10
	mov	rax, QWORD PTR -1048[rbp]
	mov	rdi, rax
	call	pclose@PLT
	mov	eax, 1
	jmp	.L13
.L10:
	lea	rdx, -528[rbp]
	mov	eax, DWORD PTR -1060[rbp]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -1052[rbp], 0
	jmp	.L11
.L12:
	mov	eax, DWORD PTR -1052[rbp]
	cdqe
	movzx	eax, BYTE PTR -528[rbp+rax]
	movsx	edx, al
	mov	eax, DWORD PTR -1052[rbp]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -1052[rbp], 1
.L11:
	cmp	DWORD PTR -1052[rbp], 9
	jle	.L12
	mov	edi, -1
	call	exit@PLT
.L13:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	gpio_get, .-gpio_get
	.section	.rodata
.LC6:
	.string	"gpio write %d %d"
.LC7:
	.string	"error: gpio %d set %d fail \n"
	.text
	.globl	gpio_set
	.type	gpio_set, @function
gpio_set:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 544
	mov	DWORD PTR -532[rbp], edi
	mov	DWORD PTR -536[rbp], esi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	ecx, DWORD PTR -536[rbp]
	mov	edx, DWORD PTR -532[rbp]
	lea	rax, -528[rbp]
	mov	r8d, ecx
	mov	ecx, edx
	lea	rdx, .LC6[rip]
	mov	esi, 512
	mov	rdi, rax
	mov	eax, 0
	call	snprintf@PLT
	lea	rax, -528[rbp]
	mov	rdi, rax
	call	system@PLT
	mov	eax, DWORD PTR -532[rbp]
	mov	edi, eax
	call	gpio_get
	cmp	DWORD PTR -536[rbp], eax
	je	.L18
	mov	edx, DWORD PTR -536[rbp]
	mov	eax, DWORD PTR -532[rbp]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, -1
	call	exit@PLT
.L18:
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	gpio_set, .-gpio_set
	.section	.rodata
.LC8:
	.string	"gpio mode %d %s"
.LC9:
	.string	"cmd: %s\n"
	.text
	.globl	__gpio_init
	.type	__gpio_init, @function
__gpio_init:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 544
	mov	DWORD PTR -532[rbp], edi
	mov	QWORD PTR -544[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rcx, QWORD PTR -544[rbp]
	mov	edx, DWORD PTR -532[rbp]
	lea	rax, -528[rbp]
	mov	r8, rcx
	mov	ecx, edx
	lea	rdx, .LC8[rip]
	mov	esi, 512
	mov	rdi, rax
	mov	eax, 0
	call	snprintf@PLT
	lea	rax, -528[rbp]
	mov	rsi, rax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -528[rbp]
	mov	rdi, rax
	call	system@PLT
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	__gpio_init, .-__gpio_init
	.section	.rodata
.LC10:
	.string	"TCK: "
.LC11:
	.string	"out"
.LC12:
	.string	"TMS: "
.LC13:
	.string	"TDI: "
.LC14:
	.string	"TDO: "
.LC15:
	.string	"in"
.LC16:
	.string	"TRST_N: "
	.text
	.globl	gpio_init
	.type	gpio_init, @function
gpio_init:
.LFB11:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rsi, .LC11[rip]
	mov	edi, 25
	call	__gpio_init
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rsi, .LC11[rip]
	mov	edi, 24
	call	__gpio_init
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rsi, .LC11[rip]
	mov	edi, 23
	call	__gpio_init
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rsi, .LC15[rip]
	mov	edi, 22
	call	__gpio_init
	lea	rdi, .LC16[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rsi, .LC11[rip]
	mov	edi, 21
	call	__gpio_init
	mov	esi, 1
	mov	edi, 21
	call	gpio_set
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	gpio_init, .-gpio_init
	.globl	jtag_clk
	.type	jtag_clk, @function
jtag_clk:
.LFB12:
	.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	DWORD PTR -4[rbp], 0
	mov	esi, 0
	mov	edi, 25
	call	gpio_set
	mov	edi, 1
	call	usleep@PLT
	mov	esi, 1
	mov	edi, 25
	call	gpio_set
	mov	edi, 1
	call	usleep@PLT
	mov	edi, 22
	call	gpio_get
	mov	DWORD PTR -4[rbp], eax
	mov	esi, 0
	mov	edi, 25
	call	gpio_set
	mov	eax, DWORD PTR -4[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	jtag_clk, .-jtag_clk
	.globl	tap_reset
	.type	tap_reset, @function
tap_reset:
.LFB13:
	.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	esi, 1
	mov	edi, 24
	call	gpio_set
	mov	DWORD PTR -4[rbp], 0
	jmp	.L25
.L26:
	mov	eax, 0
	call	jtag_clk
	add	DWORD PTR -4[rbp], 1
.L25:
	cmp	DWORD PTR -4[rbp], 4
	jle	.L26
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	tap_reset, .-tap_reset
	.section	.rodata
.LC17:
	.string	"unknown state %d \n"
	.text
	.globl	tap_state
	.type	tap_state, @function
tap_state:
.LFB14:
	.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	DWORD PTR -4[rbp], edi
	mov	eax, 0
	call	tap_reset
	cmp	DWORD PTR -4[rbp], 10
	jne	.L28
	mov	esi, 0
	mov	edi, 24
	call	gpio_set
	mov	eax, 0
	call	jtag_clk
	mov	esi, 1
	mov	edi, 24
	call	gpio_set
	mov	eax, 0
	call	jtag_clk
	mov	eax, 0
	call	jtag_clk
	mov	esi, 0
	mov	edi, 24
	call	gpio_set
	mov	eax, 0
	call	jtag_clk
	mov	eax, 0
	call	jtag_clk
	jmp	.L30
.L28:
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC17[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, -1
	call	exit@PLT
.L30:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	tap_state, .-tap_state
	.section	.rodata
.LC18:
	.string	"IR len: "
.LC19:
	.string	"%d"
.LC20:
	.string	"\nIR len: %d\n"
.LC21:
	.string	"Tap Num:"
.LC22:
	.string	"\nTap Num: %d\n"
.LC23:
	.string	"IDCODE: "
.LC24:
	.string	"\nIDCODE:"
.LC25:
	.string	"[%d]: 0x%08x\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB15:
	.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	DWORD PTR -12[rbp], 0
	mov	BYTE PTR -13[rbp], 0
	mov	DWORD PTR -8[rbp], 0
	mov	DWORD PTR -4[rbp], 0
	mov	eax, 0
	call	gpio_init
	mov	edi, 25
	call	gpio_get
	mov	edi, 24
	call	gpio_get
	mov	edi, 23
	call	gpio_get
	mov	edi, 22
	call	gpio_get
	mov	eax, 0
	call	tap_reset
	mov	eax, 0
	call	tap_reset
	mov	esi, 0
	mov	edi, 24
	call	gpio_set
	mov	eax, 0
	call	jtag_clk
	mov	esi, 1
	mov	edi, 24
	call	gpio_set
	mov	eax, 0
	call	jtag_clk
	mov	esi, 1
	mov	edi, 24
	call	gpio_set
	mov	eax, 0
	call	jtag_clk
	mov	esi, 0
	mov	edi, 24
	call	gpio_set
	mov	eax, 0
	call	jtag_clk
	mov	esi, 0
	mov	edi, 24
	call	gpio_set
	mov	eax, 0
	call	jtag_clk
	lea	rdi, .LC18[rip]
	call	puts@PLT
	mov	esi, 0
	mov	edi, 23
	call	gpio_set
	mov	DWORD PTR -12[rbp], 0
	jmp	.L32
.L34:
	cmp	DWORD PTR -12[rbp], 0
	je	.L33
	mov	eax, DWORD PTR -12[rbp]
	and	eax, 3
	test	eax, eax
	jne	.L33
	mov	edi, 32
	call	putchar@PLT
.L33:
	mov	eax, 0
	call	jtag_clk
	mov	BYTE PTR -13[rbp], al
	movzx	eax, BYTE PTR -13[rbp]
	mov	esi, eax
	lea	rdi, .LC19[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -12[rbp], 1
.L32:
	cmp	DWORD PTR -12[rbp], 31
	jle	.L34
	mov	edi, 10
	call	putchar@PLT
	mov	esi, 1
	mov	edi, 23
	call	gpio_set
	mov	DWORD PTR -12[rbp], 0
	jmp	.L35
.L38:
	cmp	DWORD PTR -12[rbp], 0
	je	.L36
	mov	eax, DWORD PTR -12[rbp]
	and	eax, 3
	test	eax, eax
	jne	.L36
	mov	edi, 32
	call	putchar@PLT
.L36:
	mov	eax, 0
	call	jtag_clk
	mov	BYTE PTR -13[rbp], al
	cmp	BYTE PTR -13[rbp], 0
	jne	.L37
	add	DWORD PTR -8[rbp], 1
.L37:
	movzx	eax, BYTE PTR -13[rbp]
	mov	esi, eax
	lea	rdi, .LC19[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -12[rbp], 1
.L35:
	cmp	DWORD PTR -12[rbp], 31
	jle	.L38
	mov	eax, DWORD PTR -8[rbp]
	mov	esi, eax
	lea	rdi, .LC20[rip]
	mov	eax, 0
	call	printf@PLT
	mov	esi, 1
	mov	edi, 24
	call	gpio_set
	mov	eax, 0
	call	jtag_clk
	mov	esi, 1
	mov	edi, 24
	call	gpio_set
	mov	eax, 0
	call	jtag_clk
	mov	esi, 1
	mov	edi, 24
	call	gpio_set
	mov	eax, 0
	call	jtag_clk
	mov	esi, 0
	mov	edi, 23
	call	gpio_set
	mov	esi, 0
	mov	edi, 24
	call	gpio_set
	mov	eax, 0
	call	jtag_clk
	mov	esi, 0
	mov	edi, 24
	call	gpio_set
	mov	eax, 0
	call	jtag_clk
	lea	rdi, .LC21[rip]
	call	puts@PLT
	mov	esi, 0
	mov	edi, 23
	call	gpio_set
	mov	DWORD PTR -12[rbp], 0
	jmp	.L39
.L41:
	cmp	DWORD PTR -12[rbp], 0
	je	.L40
	mov	eax, DWORD PTR -12[rbp]
	and	eax, 3
	test	eax, eax
	jne	.L40
	mov	edi, 32
	call	putchar@PLT
.L40:
	mov	eax, 0
	call	jtag_clk
	mov	BYTE PTR -13[rbp], al
	movzx	eax, BYTE PTR -13[rbp]
	mov	esi, eax
	lea	rdi, .LC19[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -12[rbp], 1
.L39:
	cmp	DWORD PTR -12[rbp], 31
	jle	.L41
	mov	edi, 10
	call	putchar@PLT
	mov	esi, 1
	mov	edi, 23
	call	gpio_set
	mov	DWORD PTR -12[rbp], 0
	jmp	.L42
.L45:
	cmp	DWORD PTR -12[rbp], 0
	je	.L43
	mov	eax, DWORD PTR -12[rbp]
	and	eax, 3
	test	eax, eax
	jne	.L43
	mov	edi, 32
	call	putchar@PLT
.L43:
	mov	eax, 0
	call	jtag_clk
	mov	BYTE PTR -13[rbp], al
	cmp	BYTE PTR -13[rbp], 0
	jne	.L44
	add	DWORD PTR -4[rbp], 1
.L44:
	movzx	eax, BYTE PTR -13[rbp]
	mov	esi, eax
	lea	rdi, .LC19[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -12[rbp], 1
.L42:
	cmp	DWORD PTR -12[rbp], 31
	jle	.L45
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC22[rip]
	mov	eax, 0
	call	printf@PLT
	cmp	DWORD PTR -4[rbp], 32
	jne	.L46
	mov	eax, -1
	jmp	.L47
.L46:
	mov	eax, DWORD PTR -4[rbp]
	sal	rax, 2
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR idcode[rip], rax
	mov	eax, 0
	call	tap_reset
	mov	eax, 0
	call	tap_reset
	mov	esi, 0
	mov	edi, 24
	call	gpio_set
	mov	eax, 0
	call	jtag_clk
	mov	esi, 1
	mov	edi, 24
	call	gpio_set
	mov	eax, 0
	call	jtag_clk
	mov	esi, 0
	mov	edi, 24
	call	gpio_set
	mov	eax, 0
	call	jtag_clk
	mov	esi, 0
	mov	edi, 24
	call	gpio_set
	mov	eax, 0
	call	jtag_clk
	lea	rdi, .LC23[rip]
	call	puts@PLT
	mov	esi, 0
	mov	edi, 23
	call	gpio_set
	mov	DWORD PTR -12[rbp], 0
	jmp	.L48
.L50:
	cmp	DWORD PTR -12[rbp], 0
	je	.L49
	mov	eax, DWORD PTR -12[rbp]
	and	eax, 3
	test	eax, eax
	jne	.L49
	mov	edi, 32
	call	putchar@PLT
.L49:
	mov	eax, 0
	call	jtag_clk
	mov	BYTE PTR -13[rbp], al
	movzx	ecx, BYTE PTR -13[rbp]
	mov	edx, DWORD PTR -12[rbp]
	mov	eax, DWORD PTR -4[rbp]
	sal	eax, 5
	mov	esi, eax
	mov	rax, QWORD PTR idcode[rip]
	mov	rdi, rax
	call	set_bit
	movzx	eax, BYTE PTR -13[rbp]
	mov	esi, eax
	lea	rdi, .LC19[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -12[rbp], 1
.L48:
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	mov	edx, DWORD PTR -4[rbp]
	sal	rdx, 5
	cmp	rax, rdx
	jb	.L50
	lea	rdi, .LC24[rip]
	call	puts@PLT
	mov	DWORD PTR -12[rbp], 0
	jmp	.L51
.L52:
	mov	rdx, QWORD PTR idcode[rip]
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, eax
	lea	rdi, .LC25[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -12[rbp], 1
.L51:
	mov	eax, DWORD PTR -12[rbp]
	cmp	DWORD PTR -4[rbp], eax
	ja	.L52
	mov	rax, QWORD PTR idcode[rip]
	mov	rdi, rax
	call	free@PLT
	mov	eax, 0
	call	tap_reset
	mov	eax, 0
.L47:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.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	"623167.c"
	.text
	.comm	idcode,4,4
	.global	__aeabi_uidivmod
	.align	2
	.global	get_bit
	.syntax unified
	.arm
	.fpu softvfp
	.type	get_bit, %function
get_bit:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	str	r2, [fp, #-32]
	ldr	r3, [fp, #-32]
	ldr	r1, [fp, #-28]
	mov	r0, r3
	bl	__aeabi_uidivmod
	mov	r3, r1
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-32]
	lsr	r3, r3, #5
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-32]
	and	r3, r3, #31
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r3, [r3]
	and	r2, r3, #255
	mov	r1, #1
	ldr	r3, [fp, #-8]
	lsl	r3, r1, r3
	and	r3, r3, #255
	and	r3, r3, r2
	strb	r3, [fp, #-17]
	ldrb	r3, [fp, #-17]	@ zero_extendqisi2
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	get_bit, .-get_bit
	.align	2
	.global	set_bit
	.syntax unified
	.arm
	.fpu softvfp
	.type	set_bit, %function
set_bit:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	str	r2, [fp, #-32]
	strb	r3, [fp, #-33]
	ldr	r3, [fp, #-32]
	ldr	r1, [fp, #-28]
	mov	r0, r3
	bl	__aeabi_uidivmod
	mov	r3, r1
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-32]
	lsr	r3, r3, #5
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-32]
	and	r3, r3, #31
	str	r3, [fp, #-12]
	ldrb	r3, [fp, #-33]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L4
	mov	r2, #1
	ldr	r3, [fp, #-12]
	lsl	r3, r2, r3
	mvn	r3, r3
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r2, [fp, #-8]
	and	r2, r2, r1
	str	r2, [r3]
	b	.L5
.L4:
	mov	r2, #1
	ldr	r3, [fp, #-12]
	lsl	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r2, [fp, #-8]
	orr	r2, r1, r2
	str	r2, [r3]
.L5:
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r3, [r3]
	and	r2, r3, #255
	mov	r1, #1
	ldr	r3, [fp, #-12]
	lsl	r3, r1, r3
	and	r3, r3, #255
	and	r3, r3, r2
	strb	r3, [fp, #-33]
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	set_bit, .-set_bit
	.section	.rodata
	.align	2
.LC0:
	.ascii	"gpio read %d\000"
	.align	2
.LC1:
	.ascii	"r\000"
	.align	2
.LC2:
	.ascii	"0\012\000"
	.align	2
.LC3:
	.ascii	"1\012\000"
	.align	2
.LC4:
	.ascii	"error: gpio %d read return [%s]\012\000"
	.align	2
.LC5:
	.ascii	"[%d]: 0x%02x\012\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	gpio_get
	.syntax unified
	.arm
	.fpu softvfp
	.type	gpio_get, %function
gpio_get:
	@ args = 0, pretend = 0, frame = 1048
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1040
	sub	sp, sp, #8
	str	r0, [fp, #-1048]
	ldr	r3, .L15
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #520
	mov	r2, #512
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r0, fp, #1024
	sub	r0, r0, #4
	sub	r0, r0, #4
	ldr	r3, [fp, #-1048]
	ldr	r2, .L15+4
	mov	r1, #512
	bl	snprintf
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r1, .L15+8
	mov	r0, r3
	bl	popen
	str	r0, [fp, #-1036]
	sub	r0, fp, #520
	ldr	r3, [fp, #-1036]
	mov	r2, #512
	mov	r1, #1
	bl	fread
	sub	r3, fp, #520
	ldr	r1, .L15+12
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L8
	ldr	r0, [fp, #-1036]
	bl	pclose
	mov	r3, #0
	b	.L13
.L8:
	sub	r3, fp, #520
	ldr	r1, .L15+16
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L10
	ldr	r0, [fp, #-1036]
	bl	pclose
	mov	r3, #1
	b	.L13
.L10:
	sub	r3, fp, #520
	mov	r2, r3
	ldr	r1, [fp, #-1048]
	ldr	r0, .L15+20
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-1040]
	b	.L11
.L12:
	sub	r2, fp, #520
	ldr	r3, [fp, #-1040]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r2, r3
	ldr	r1, [fp, #-1040]
	ldr	r0, .L15+24
	bl	printf
	ldr	r3, [fp, #-1040]
	add	r3, r3, #1
	str	r3, [fp, #-1040]
.L11:
	ldr	r3, [fp, #-1040]
	cmp	r3, #9
	ble	.L12
	mvn	r0, #0
	bl	exit
.L13:
	ldr	r2, .L15
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L14
	bl	__stack_chk_fail
.L14:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L16:
	.align	2
.L15:
	.word	.LC6
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.size	gpio_get, .-gpio_get
	.section	.rodata
	.align	2
.LC7:
	.ascii	"gpio write %d %d\000"
	.align	2
.LC8:
	.ascii	"error: gpio %d set %d fail \012\000"
	.align	2
.LC9:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	gpio_set
	.syntax unified
	.arm
	.fpu softvfp
	.type	gpio_set, %function
gpio_set:
	@ args = 0, pretend = 0, frame = 528
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #536
	str	r0, [fp, #-528]
	str	r1, [fp, #-532]
	ldr	r3, .L21
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r0, fp, #520
	ldr	r3, [fp, #-532]
	str	r3, [sp]
	ldr	r3, [fp, #-528]
	ldr	r2, .L21+4
	mov	r1, #512
	bl	snprintf
	sub	r3, fp, #520
	mov	r0, r3
	bl	system
	ldr	r0, [fp, #-528]
	bl	gpio_get
	mov	r2, r0
	ldr	r3, [fp, #-532]
	cmp	r3, r2
	beq	.L20
	ldr	r2, [fp, #-532]
	ldr	r1, [fp, #-528]
	ldr	r0, .L21+8
	bl	printf
	mvn	r0, #0
	bl	exit
.L20:
	nop
	ldr	r3, .L21
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L19
	bl	__stack_chk_fail
.L19:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L22:
	.align	2
.L21:
	.word	.LC9
	.word	.LC7
	.word	.LC8
	.size	gpio_set, .-gpio_set
	.section	.rodata
	.align	2
.LC10:
	.ascii	"gpio mode %d %s\000"
	.align	2
.LC11:
	.ascii	"cmd: %s\012\000"
	.align	2
.LC12:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	__gpio_init
	.syntax unified
	.arm
	.fpu softvfp
	.type	__gpio_init, %function
__gpio_init:
	@ args = 0, pretend = 0, frame = 528
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #536
	str	r0, [fp, #-528]
	str	r1, [fp, #-532]
	ldr	r3, .L25
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r0, fp, #520
	ldr	r3, [fp, #-532]
	str	r3, [sp]
	ldr	r3, [fp, #-528]
	ldr	r2, .L25+4
	mov	r1, #512
	bl	snprintf
	sub	r3, fp, #520
	mov	r1, r3
	ldr	r0, .L25+8
	bl	printf
	sub	r3, fp, #520
	mov	r0, r3
	bl	system
	nop
	ldr	r3, .L25
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L24
	bl	__stack_chk_fail
.L24:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L26:
	.align	2
.L25:
	.word	.LC12
	.word	.LC10
	.word	.LC11
	.size	__gpio_init, .-__gpio_init
	.section	.rodata
	.align	2
.LC13:
	.ascii	"TCK: \000"
	.align	2
.LC14:
	.ascii	"out\000"
	.align	2
.LC15:
	.ascii	"TMS: \000"
	.align	2
.LC16:
	.ascii	"TDI: \000"
	.align	2
.LC17:
	.ascii	"TDO: \000"
	.align	2
.LC18:
	.ascii	"in\000"
	.align	2
.LC19:
	.ascii	"TRST_N: \000"
	.text
	.align	2
	.global	gpio_init
	.syntax unified
	.arm
	.fpu softvfp
	.type	gpio_init, %function
gpio_init:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r0, .L28
	bl	printf
	ldr	r1, .L28+4
	mov	r0, #25
	bl	__gpio_init
	ldr	r0, .L28+8
	bl	printf
	ldr	r1, .L28+4
	mov	r0, #24
	bl	__gpio_init
	ldr	r0, .L28+12
	bl	printf
	ldr	r1, .L28+4
	mov	r0, #23
	bl	__gpio_init
	ldr	r0, .L28+16
	bl	printf
	ldr	r1, .L28+20
	mov	r0, #22
	bl	__gpio_init
	ldr	r0, .L28+24
	bl	printf
	ldr	r1, .L28+4
	mov	r0, #21
	bl	__gpio_init
	mov	r1, #1
	mov	r0, #21
	bl	gpio_set
	nop
	pop	{fp, pc}
.L29:
	.align	2
.L28:
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.word	.LC17
	.word	.LC18
	.word	.LC19
	.size	gpio_init, .-gpio_init
	.align	2
	.global	jtag_clk
	.syntax unified
	.arm
	.fpu softvfp
	.type	jtag_clk, %function
jtag_clk:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	mov	r3, #0
	str	r3, [fp, #-8]
	mov	r1, #0
	mov	r0, #25
	bl	gpio_set
	mov	r0, #1
	bl	usleep
	mov	r1, #1
	mov	r0, #25
	bl	gpio_set
	mov	r0, #1
	bl	usleep
	mov	r0, #22
	bl	gpio_get
	str	r0, [fp, #-8]
	mov	r1, #0
	mov	r0, #25
	bl	gpio_set
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	jtag_clk, .-jtag_clk
	.align	2
	.global	tap_reset
	.syntax unified
	.arm
	.fpu softvfp
	.type	tap_reset, %function
tap_reset:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	mov	r1, #1
	mov	r0, #24
	bl	gpio_set
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L33
.L34:
	bl	jtag_clk
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L33:
	ldr	r3, [fp, #-8]
	cmp	r3, #4
	ble	.L34
	nop
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	tap_reset, .-tap_reset
	.section	.rodata
	.align	2
.LC20:
	.ascii	"unknown state %d \012\000"
	.text
	.align	2
	.global	tap_state
	.syntax unified
	.arm
	.fpu softvfp
	.type	tap_state, %function
tap_state:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	bl	tap_reset
	ldr	r3, [fp, #-8]
	cmp	r3, #10
	bne	.L36
	mov	r1, #0
	mov	r0, #24
	bl	gpio_set
	bl	jtag_clk
	mov	r1, #1
	mov	r0, #24
	bl	gpio_set
	bl	jtag_clk
	bl	jtag_clk
	mov	r1, #0
	mov	r0, #24
	bl	gpio_set
	bl	jtag_clk
	bl	jtag_clk
	b	.L38
.L36:
	ldr	r1, [fp, #-8]
	ldr	r0, .L39
	bl	printf
	mvn	r0, #0
	bl	exit
.L38:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L40:
	.align	2
.L39:
	.word	.LC20
	.size	tap_state, .-tap_state
	.section	.rodata
	.align	2
.LC21:
	.ascii	"IR len: \000"
	.align	2
.LC22:
	.ascii	"%d\000"
	.align	2
.LC23:
	.ascii	"\012IR len: %d\012\000"
	.align	2
.LC24:
	.ascii	"Tap Num:\000"
	.align	2
.LC25:
	.ascii	"\012Tap Num: %d\012\000"
	.align	2
.LC26:
	.ascii	"IDCODE: \000"
	.align	2
.LC27:
	.ascii	"\012IDCODE:\000"
	.align	2
.LC28:
	.ascii	"[%d]: 0x%08x\012\000"
	.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
	mov	r3, #0
	str	r3, [fp, #-16]
	mov	r3, #0
	strb	r3, [fp, #-17]
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-8]
	bl	gpio_init
	mov	r0, #25
	bl	gpio_get
	mov	r0, #24
	bl	gpio_get
	mov	r0, #23
	bl	gpio_get
	mov	r0, #22
	bl	gpio_get
	bl	tap_reset
	bl	tap_reset
	mov	r1, #0
	mov	r0, #24
	bl	gpio_set
	bl	jtag_clk
	mov	r1, #1
	mov	r0, #24
	bl	gpio_set
	bl	jtag_clk
	mov	r1, #1
	mov	r0, #24
	bl	gpio_set
	bl	jtag_clk
	mov	r1, #0
	mov	r0, #24
	bl	gpio_set
	bl	jtag_clk
	mov	r1, #0
	mov	r0, #24
	bl	gpio_set
	bl	jtag_clk
	ldr	r0, .L63
	bl	puts
	mov	r1, #0
	mov	r0, #23
	bl	gpio_set
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L42
.L44:
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L43
	ldr	r3, [fp, #-16]
	and	r3, r3, #3
	cmp	r3, #0
	bne	.L43
	mov	r0, #32
	bl	putchar
.L43:
	bl	jtag_clk
	mov	r3, r0
	strb	r3, [fp, #-17]
	ldrb	r3, [fp, #-17]	@ zero_extendqisi2
	mov	r1, r3
	ldr	r0, .L63+4
	bl	printf
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L42:
	ldr	r3, [fp, #-16]
	cmp	r3, #31
	ble	.L44
	mov	r0, #10
	bl	putchar
	mov	r1, #1
	mov	r0, #23
	bl	gpio_set
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L45
.L48:
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L46
	ldr	r3, [fp, #-16]
	and	r3, r3, #3
	cmp	r3, #0
	bne	.L46
	mov	r0, #32
	bl	putchar
.L46:
	bl	jtag_clk
	mov	r3, r0
	strb	r3, [fp, #-17]
	ldrb	r3, [fp, #-17]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L47
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L47:
	ldrb	r3, [fp, #-17]	@ zero_extendqisi2
	mov	r1, r3
	ldr	r0, .L63+4
	bl	printf
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L45:
	ldr	r3, [fp, #-16]
	cmp	r3, #31
	ble	.L48
	ldr	r1, [fp, #-12]
	ldr	r0, .L63+8
	bl	printf
	mov	r1, #1
	mov	r0, #24
	bl	gpio_set
	bl	jtag_clk
	mov	r1, #1
	mov	r0, #24
	bl	gpio_set
	bl	jtag_clk
	mov	r1, #1
	mov	r0, #24
	bl	gpio_set
	bl	jtag_clk
	mov	r1, #0
	mov	r0, #23
	bl	gpio_set
	mov	r1, #0
	mov	r0, #24
	bl	gpio_set
	bl	jtag_clk
	mov	r1, #0
	mov	r0, #24
	bl	gpio_set
	bl	jtag_clk
	ldr	r0, .L63+12
	bl	puts
	mov	r1, #0
	mov	r0, #23
	bl	gpio_set
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L49
.L51:
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L50
	ldr	r3, [fp, #-16]
	and	r3, r3, #3
	cmp	r3, #0
	bne	.L50
	mov	r0, #32
	bl	putchar
.L50:
	bl	jtag_clk
	mov	r3, r0
	strb	r3, [fp, #-17]
	ldrb	r3, [fp, #-17]	@ zero_extendqisi2
	mov	r1, r3
	ldr	r0, .L63+4
	bl	printf
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L49:
	ldr	r3, [fp, #-16]
	cmp	r3, #31
	ble	.L51
	mov	r0, #10
	bl	putchar
	mov	r1, #1
	mov	r0, #23
	bl	gpio_set
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L52
.L55:
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L53
	ldr	r3, [fp, #-16]
	and	r3, r3, #3
	cmp	r3, #0
	bne	.L53
	mov	r0, #32
	bl	putchar
.L53:
	bl	jtag_clk
	mov	r3, r0
	strb	r3, [fp, #-17]
	ldrb	r3, [fp, #-17]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L54
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L54:
	ldrb	r3, [fp, #-17]	@ zero_extendqisi2
	mov	r1, r3
	ldr	r0, .L63+4
	bl	printf
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L52:
	ldr	r3, [fp, #-16]
	cmp	r3, #31
	ble	.L55
	ldr	r1, [fp, #-8]
	ldr	r0, .L63+16
	bl	printf
	ldr	r3, [fp, #-8]
	cmp	r3, #32
	bne	.L56
	mvn	r3, #0
	b	.L57
.L56:
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L63+20
	str	r2, [r3]
	bl	tap_reset
	bl	tap_reset
	mov	r1, #0
	mov	r0, #24
	bl	gpio_set
	bl	jtag_clk
	mov	r1, #1
	mov	r0, #24
	bl	gpio_set
	bl	jtag_clk
	mov	r1, #0
	mov	r0, #24
	bl	gpio_set
	bl	jtag_clk
	mov	r1, #0
	mov	r0, #24
	bl	gpio_set
	bl	jtag_clk
	ldr	r0, .L63+24
	bl	puts
	mov	r1, #0
	mov	r0, #23
	bl	gpio_set
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L58
.L60:
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L59
	ldr	r3, [fp, #-16]
	and	r3, r3, #3
	cmp	r3, #0
	bne	.L59
	mov	r0, #32
	bl	putchar
.L59:
	bl	jtag_clk
	mov	r3, r0
	strb	r3, [fp, #-17]
	ldr	r3, .L63+20
	ldr	r0, [r3]
	ldr	r3, [fp, #-8]
	lsl	r1, r3, #5
	ldr	r2, [fp, #-16]
	ldrb	r3, [fp, #-17]	@ zero_extendqisi2
	bl	set_bit
	ldrb	r3, [fp, #-17]	@ zero_extendqisi2
	mov	r1, r3
	ldr	r0, .L63+4
	bl	printf
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L58:
	ldr	r3, [fp, #-8]
	lsl	r2, r3, #5
	ldr	r3, [fp, #-16]
	cmp	r2, r3
	bhi	.L60
	ldr	r0, .L63+28
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L61
.L62:
	ldr	r3, .L63+20
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, [fp, #-16]
	ldr	r0, .L63+32
	bl	printf
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L61:
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	bhi	.L62
	ldr	r3, .L63+20
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	bl	tap_reset
	mov	r3, #0
.L57:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L64:
	.align	2
.L63:
	.word	.LC21
	.word	.LC22
	.word	.LC23
	.word	.LC24
	.word	.LC25
	.word	idcode
	.word	.LC26
	.word	.LC27
	.word	.LC28
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
