	.file	"185314.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"\n%s: GPIO pin %d interrupt occurred\n"
	.text
	.globl	isr_func
	.type	isr_func, @function
isr_func:
.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	DWORD PTR -4[rbp], edi
	mov	eax, DWORD PTR -4[rbp]
	mov	edx, eax
	lea	rsi, __func__.2[rip]
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	isr_func, .-isr_func
	.section	.rodata
.LC1:
	.string	"\npoll() failed!"
	.text
	.globl	irq_thread
	.type	irq_thread, @function
irq_thread:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	add	rsp, -128
	mov	QWORD PTR -120[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -120[rbp]
	mov	QWORD PTR -96[rbp], rax
.L6:
	lea	rax, -88[rbp]
	mov	edx, 8
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	rax, QWORD PTR -96[rbp]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -88[rbp], eax
	mov	WORD PTR -84[rbp], 2
	lea	rax, -88[rbp]
	mov	edx, 5000
	mov	esi, 1
	mov	rdi, rax
	call	poll@PLT
	mov	DWORD PTR -104[rbp], eax
	cmp	DWORD PTR -104[rbp], 0
	jns	.L3
	lea	rdi, .LC1[rip]
	call	puts@PLT
	jmp	.L4
.L3:
	cmp	DWORD PTR -104[rbp], 0
	jne	.L5
	mov	edi, 46
	call	putchar@PLT
	jmp	.L4
.L5:
	movzx	eax, WORD PTR -82[rbp]
	cwde
	and	eax, 2
	test	eax, eax
	je	.L4
	mov	eax, DWORD PTR -88[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	lseek@PLT
	mov	eax, DWORD PTR -88[rbp]
	lea	rcx, -80[rbp]
	mov	edx, 64
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -100[rbp], eax
	mov	rax, QWORD PTR -96[rbp]
	mov	rdx, QWORD PTR 8[rax]
	mov	rax, QWORD PTR -96[rbp]
	mov	eax, DWORD PTR 4[rax]
	mov	edi, eax
	call	rdx
.L4:
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	jmp	.L6
	.cfi_endproc
.LFE7:
	.size	irq_thread, .-irq_thread
	.section	.rodata
.LC2:
	.string	"/sys/class/gpio/export"
.LC3:
	.string	"gpio/export"
.LC4:
	.string	"%d"
	.align 8
.LC5:
	.string	"setup_int(): Failed to write gpio_pin to gpio/export"
	.align 8
.LC6:
	.string	"/sys/class/gpio/gpio%d/direction"
.LC7:
	.string	"gpio/direction"
.LC8:
	.string	"in"
.LC9:
	.string	"write direction"
.LC10:
	.string	"/sys/class/gpio/gpio%d/edge"
.LC11:
	.string	"gpio/edge"
.LC12:
	.string	"falling"
.LC13:
	.string	"write edge"
.LC14:
	.string	"/sys/class/gpio/gpio%d/value"
.LC15:
	.string	"gpio/value"
	.text
	.globl	setup_int
	.type	setup_int, @function
setup_int:
.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, 176
	mov	DWORD PTR -164[rbp], edi
	mov	QWORD PTR -176[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	esi, 1
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -152[rbp], eax
	cmp	DWORD PTR -152[rbp], 0
	jns	.L9
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	eax, 0
	jmp	.L17
.L9:
	mov	edx, DWORD PTR -164[rbp]
	lea	rax, -80[rbp]
	mov	ecx, edx
	lea	rdx, .LC4[rip]
	mov	esi, 64
	mov	rdi, rax
	mov	eax, 0
	call	snprintf@PLT
	movsx	rdx, eax
	lea	rcx, -80[rbp]
	mov	eax, DWORD PTR -152[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	DWORD PTR -148[rbp], eax
	mov	eax, DWORD PTR -152[rbp]
	mov	edi, eax
	call	close@PLT
	cmp	DWORD PTR -148[rbp], 0
	jns	.L11
	lea	rdi, .LC5[rip]
	call	perror@PLT
.L11:
	mov	edx, DWORD PTR -164[rbp]
	lea	rax, -80[rbp]
	mov	ecx, edx
	lea	rdx, .LC6[rip]
	mov	esi, 64
	mov	rdi, rax
	mov	eax, 0
	call	snprintf@PLT
	lea	rax, -80[rbp]
	mov	esi, 1
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -152[rbp], eax
	cmp	DWORD PTR -152[rbp], 0
	jns	.L12
	lea	rdi, .LC7[rip]
	call	perror@PLT
	mov	eax, 0
	jmp	.L17
.L12:
	mov	eax, DWORD PTR -152[rbp]
	mov	edx, 4
	lea	rsi, .LC8[rip]
	mov	edi, eax
	call	write@PLT
	mov	DWORD PTR -148[rbp], eax
	mov	eax, DWORD PTR -152[rbp]
	mov	edi, eax
	call	close@PLT
	cmp	DWORD PTR -148[rbp], 0
	jns	.L13
	lea	rdi, .LC9[rip]
	call	perror@PLT
	mov	eax, 0
	jmp	.L17
.L13:
	mov	edx, DWORD PTR -164[rbp]
	lea	rax, -80[rbp]
	mov	ecx, edx
	lea	rdx, .LC10[rip]
	mov	esi, 64
	mov	rdi, rax
	mov	eax, 0
	call	snprintf@PLT
	lea	rax, -80[rbp]
	mov	esi, 1
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -152[rbp], eax
	cmp	DWORD PTR -152[rbp], 0
	jns	.L14
	lea	rdi, .LC11[rip]
	call	perror@PLT
	mov	eax, 0
	jmp	.L17
.L14:
	mov	eax, DWORD PTR -152[rbp]
	mov	edx, 9
	lea	rsi, .LC12[rip]
	mov	edi, eax
	call	write@PLT
	mov	DWORD PTR -148[rbp], eax
	mov	eax, DWORD PTR -152[rbp]
	mov	edi, eax
	call	close@PLT
	cmp	DWORD PTR -148[rbp], 0
	jns	.L15
	lea	rdi, .LC13[rip]
	call	perror@PLT
	mov	eax, 0
	jmp	.L17
.L15:
	mov	edx, DWORD PTR -164[rbp]
	lea	rax, -80[rbp]
	mov	ecx, edx
	lea	rdx, .LC14[rip]
	mov	esi, 64
	mov	rdi, rax
	mov	eax, 0
	call	snprintf@PLT
	lea	rax, -80[rbp]
	mov	esi, 2048
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -152[rbp], eax
	cmp	DWORD PTR -152[rbp], 0
	jns	.L16
	lea	rdi, .LC15[rip]
	call	perror@PLT
	mov	eax, 0
	jmp	.L17
.L16:
	mov	rax, QWORD PTR -176[rbp]
	mov	QWORD PTR irqarg.1[rip+8], rax
	mov	eax, DWORD PTR -152[rbp]
	mov	DWORD PTR irqarg.1[rip], eax
	mov	eax, DWORD PTR -164[rbp]
	mov	DWORD PTR irqarg.1[rip+4], eax
	lea	rax, -144[rbp]
	mov	rdi, rax
	call	pthread_attr_init@PLT
	lea	rax, -144[rbp]
	lea	rcx, irqarg.1[rip]
	lea	rdx, irq_thread[rip]
	mov	rsi, rax
	lea	rdi, thread.0[rip]
	call	pthread_create@PLT
	lea	rax, thread.0[rip]
.L17:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	setup_int, .-setup_int
	.section	.rodata
.LC16:
	.string	"Usage: %s <gpio-pin>\n\n"
	.align 8
.LC17:
	.string	"Waits for a change in the GPIO pin voltage level or input on stdin"
	.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
	sub	rsp, 16
	mov	DWORD PTR -4[rbp], edi
	mov	QWORD PTR -16[rbp], rsi
	cmp	DWORD PTR -4[rbp], 1
	jg	.L20
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC16[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC17[rip]
	call	puts@PLT
	mov	edi, -1
	call	exit@PLT
.L20:
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	lea	rsi, isr_func[rip]
	mov	edi, eax
	call	setup_int
.L21:
	jmp	.L21
	.cfi_endproc
.LFE9:
	.size	main, .-main
	.section	.rodata
	.align 8
	.type	__func__.2, @object
	.size	__func__.2, 9
__func__.2:
	.string	"isr_func"
	.local	irqarg.1
	.comm	irqarg.1,56,32
	.local	thread.0
	.comm	thread.0,8,8
	.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	"185314.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"\012%s: GPIO pin %d interrupt occurred\012\000"
	.text
	.align	2
	.global	isr_func
	.syntax unified
	.arm
	.fpu softvfp
	.type	isr_func, %function
isr_func:
	@ 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]
	ldr	r2, [fp, #-8]
	ldr	r1, .L2
	ldr	r0, .L2+4
	bl	printf
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L3:
	.align	2
.L2:
	.word	__func__.6462
	.word	.LC0
	.size	isr_func, .-isr_func
	.section	.rodata
	.align	2
.LC1:
	.ascii	"\012poll() failed!\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	irq_thread
	.syntax unified
	.arm
	.fpu softvfp
	.type	irq_thread, %function
irq_thread:
	@ args = 0, pretend = 0, frame = 96
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #96
	str	r0, [fp, #-96]
	ldr	r3, .L10
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-96]
	str	r3, [fp, #-92]
.L8:
	sub	r3, fp, #80
	mov	r2, #8
	mov	r1, #0
	mov	r0, r3
	bl	memset
	ldr	r3, [fp, #-92]
	ldr	r3, [r3]
	str	r3, [fp, #-80]
	mov	r3, #2
	strh	r3, [fp, #-76]	@ movhi
	sub	r3, fp, #80
	ldr	r2, .L10+4
	mov	r1, #1
	mov	r0, r3
	bl	poll
	str	r0, [fp, #-88]
	ldr	r3, [fp, #-88]
	cmp	r3, #0
	bge	.L5
	ldr	r0, .L10+8
	bl	puts
	b	.L6
.L5:
	ldr	r3, [fp, #-88]
	cmp	r3, #0
	bne	.L7
	mov	r0, #46
	bl	putchar
	b	.L6
.L7:
	ldrsh	r3, [fp, #-74]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #2
	cmp	r3, #0
	beq	.L6
	ldr	r3, [fp, #-80]
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	lseek
	ldr	r3, [fp, #-80]
	sub	r1, fp, #72
	mov	r2, #64
	mov	r0, r3
	bl	read
	str	r0, [fp, #-84]
	ldr	r3, [fp, #-92]
	ldr	r3, [r3, #8]
	ldr	r2, [fp, #-92]
	ldr	r2, [r2, #4]
	mov	r0, r2
	blx	r3
.L6:
	ldr	r3, .L10+12
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	b	.L8
.L11:
	.align	2
.L10:
	.word	.LC2
	.word	5000
	.word	.LC1
	.word	stdout
	.size	irq_thread, .-irq_thread
	.section	.rodata
	.align	2
.LC3:
	.ascii	"/sys/class/gpio/export\000"
	.align	2
.LC4:
	.ascii	"gpio/export\000"
	.align	2
.LC5:
	.ascii	"%d\000"
	.align	2
.LC6:
	.ascii	"setup_int(): Failed to write gpio_pin to gpio/expor"
	.ascii	"t\000"
	.align	2
.LC7:
	.ascii	"/sys/class/gpio/gpio%d/direction\000"
	.align	2
.LC8:
	.ascii	"gpio/direction\000"
	.align	2
.LC9:
	.ascii	"in\000"
	.align	2
.LC10:
	.ascii	"write direction\000"
	.align	2
.LC11:
	.ascii	"/sys/class/gpio/gpio%d/edge\000"
	.align	2
.LC12:
	.ascii	"gpio/edge\000"
	.align	2
.LC13:
	.ascii	"falling\000"
	.align	2
.LC14:
	.ascii	"write edge\000"
	.align	2
.LC15:
	.ascii	"/sys/class/gpio/gpio%d/value\000"
	.align	2
.LC16:
	.ascii	"gpio/value\000"
	.align	2
.LC17:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	setup_int
	.syntax unified
	.arm
	.fpu softvfp
	.type	setup_int, %function
setup_int:
	@ args = 0, pretend = 0, frame = 120
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #120
	str	r0, [fp, #-120]
	str	r1, [fp, #-124]
	ldr	r3, .L23
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r1, #1
	ldr	r0, .L23+4
	bl	open
	str	r0, [fp, #-116]
	ldr	r3, [fp, #-116]
	cmp	r3, #0
	bge	.L13
	ldr	r0, .L23+8
	bl	perror
	mov	r3, #0
	b	.L21
.L13:
	sub	r0, fp, #72
	ldr	r3, [fp, #-120]
	ldr	r2, .L23+12
	mov	r1, #64
	bl	snprintf
	mov	r3, r0
	mov	r2, r3
	sub	r3, fp, #72
	mov	r1, r3
	ldr	r0, [fp, #-116]
	bl	write
	str	r0, [fp, #-112]
	ldr	r0, [fp, #-116]
	bl	close
	ldr	r3, [fp, #-112]
	cmp	r3, #0
	bge	.L15
	ldr	r0, .L23+16
	bl	perror
.L15:
	sub	r0, fp, #72
	ldr	r3, [fp, #-120]
	ldr	r2, .L23+20
	mov	r1, #64
	bl	snprintf
	sub	r3, fp, #72
	mov	r1, #1
	mov	r0, r3
	bl	open
	str	r0, [fp, #-116]
	ldr	r3, [fp, #-116]
	cmp	r3, #0
	bge	.L16
	ldr	r0, .L23+24
	bl	perror
	mov	r3, #0
	b	.L21
.L16:
	mov	r2, #4
	ldr	r1, .L23+28
	ldr	r0, [fp, #-116]
	bl	write
	str	r0, [fp, #-112]
	ldr	r0, [fp, #-116]
	bl	close
	ldr	r3, [fp, #-112]
	cmp	r3, #0
	bge	.L17
	ldr	r0, .L23+32
	bl	perror
	mov	r3, #0
	b	.L21
.L17:
	sub	r0, fp, #72
	ldr	r3, [fp, #-120]
	ldr	r2, .L23+36
	mov	r1, #64
	bl	snprintf
	sub	r3, fp, #72
	mov	r1, #1
	mov	r0, r3
	bl	open
	str	r0, [fp, #-116]
	ldr	r3, [fp, #-116]
	cmp	r3, #0
	bge	.L18
	ldr	r0, .L23+40
	bl	perror
	mov	r3, #0
	b	.L21
.L18:
	mov	r2, #9
	ldr	r1, .L23+44
	ldr	r0, [fp, #-116]
	bl	write
	str	r0, [fp, #-112]
	ldr	r0, [fp, #-116]
	bl	close
	ldr	r3, [fp, #-112]
	cmp	r3, #0
	bge	.L19
	ldr	r0, .L23+48
	bl	perror
	mov	r3, #0
	b	.L21
.L19:
	sub	r0, fp, #72
	ldr	r3, [fp, #-120]
	ldr	r2, .L23+52
	mov	r1, #64
	bl	snprintf
	sub	r3, fp, #72
	mov	r1, #2048
	mov	r0, r3
	bl	open
	str	r0, [fp, #-116]
	ldr	r3, [fp, #-116]
	cmp	r3, #0
	bge	.L20
	ldr	r0, .L23+56
	bl	perror
	mov	r3, #0
	b	.L21
.L20:
	ldr	r2, .L23+60
	ldr	r3, [fp, #-124]
	str	r3, [r2, #8]
	ldr	r2, .L23+60
	ldr	r3, [fp, #-116]
	str	r3, [r2]
	ldr	r3, [fp, #-120]
	ldr	r2, .L23+60
	str	r3, [r2, #4]
	sub	r3, fp, #108
	mov	r0, r3
	bl	pthread_attr_init
	sub	r1, fp, #108
	ldr	r3, .L23+60
	ldr	r2, .L23+64
	ldr	r0, .L23+68
	bl	pthread_create
	ldr	r3, .L23+68
.L21:
	ldr	r2, .L23
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L22
	bl	__stack_chk_fail
.L22:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L24:
	.align	2
.L23:
	.word	.LC17
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.word	irqarg.6479
	.word	irq_thread
	.word	thread.6478
	.size	setup_int, .-setup_int
	.section	.rodata
	.align	2
.LC18:
	.ascii	"Usage: %s <gpio-pin>\012\012\000"
	.align	2
.LC19:
	.ascii	"Waits for a change in the GPIO pin voltage level or"
	.ascii	" input on stdin\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ 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]
	str	r1, [fp, #-12]
	ldr	r3, [fp, #-8]
	cmp	r3, #1
	bgt	.L26
	ldr	r3, [fp, #-12]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L28
	bl	printf
	ldr	r0, .L28+4
	bl	puts
	mvn	r0, #0
	bl	exit
.L26:
	ldr	r3, [fp, #-12]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	ldr	r1, .L28+8
	mov	r0, r3
	bl	setup_int
.L27:
	b	.L27
.L29:
	.align	2
.L28:
	.word	.LC18
	.word	.LC19
	.word	isr_func
	.size	main, .-main
	.section	.rodata
	.align	2
	.type	__func__.6462, %object
	.size	__func__.6462, 9
__func__.6462:
	.ascii	"isr_func\000"
	.local	irqarg.6479
	.comm	irqarg.6479,36,4
	.local	thread.6478
	.comm	thread.6478,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
