	.file	"639143.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"/dev/spidev0.0"
	.section	.data.rel.local,"aw"
	.align 8
	.type	device, @object
	.size	device, 8
device:
	.quad	.LC0
	.globl	spi_mode
	.bss
	.type	spi_mode, @object
	.size	spi_mode, 1
spi_mode:
	.zero	1
	.globl	spi_bits
	.data
	.type	spi_bits, @object
	.size	spi_bits, 1
spi_bits:
	.byte	8
	.globl	spi_speed
	.align 4
	.type	spi_speed, @object
	.size	spi_speed, 4
spi_speed:
	.long	200000
	.globl	spi_delay
	.bss
	.align 2
	.type	spi_delay, @object
	.size	spi_delay, 2
spi_delay:
	.zero	2
	.section	.rodata
.LC1:
	.string	"device not found[%s]\n"
.LC2:
	.string	"%s:can't set spi mode\n"
.LC3:
	.string	"%s:can't get spi mode\n"
.LC4:
	.string	"%s:can't set bits per word\n"
.LC5:
	.string	"%s:can't get bits per word\n"
	.align 8
.LC6:
	.string	"%s:can't set max speed hz [%d]\n"
.LC7:
	.string	"%s:can't get max speed hz\n"
	.align 8
.LC8:
	.string	"%s: spi mode: %d, bits per word %d, speed=%d (%d Khz)\n"
	.text
	.globl	serial_open
	.type	serial_open, @function
serial_open:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	DWORD PTR -8[rbp], -1
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, 2
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -8[rbp], eax
	cmp	DWORD PTR -8[rbp], 0
	jns	.L2
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -8[rbp]
	jmp	.L3
.L2:
	mov	eax, DWORD PTR -8[rbp]
	lea	rdx, spi_mode[rip]
	mov	esi, 1073834753
	mov	edi, eax
	mov	eax, 0
	call	ioctl@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], -1
	jne	.L4
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, -1
	jmp	.L3
.L4:
	mov	eax, DWORD PTR -8[rbp]
	lea	rdx, spi_mode[rip]
	mov	esi, 2147576577
	mov	edi, eax
	mov	eax, 0
	call	ioctl@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], -1
	jne	.L5
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, -2
	jmp	.L3
.L5:
	mov	eax, DWORD PTR -8[rbp]
	lea	rdx, spi_bits[rip]
	mov	esi, 1073834755
	mov	edi, eax
	mov	eax, 0
	call	ioctl@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], -1
	jne	.L6
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, -3
	jmp	.L3
.L6:
	mov	eax, DWORD PTR -8[rbp]
	lea	rdx, spi_bits[rip]
	mov	esi, 2147576579
	mov	edi, eax
	mov	eax, 0
	call	ioctl@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], -1
	jne	.L7
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, -4
	jmp	.L3
.L7:
	mov	eax, DWORD PTR -8[rbp]
	lea	rdx, spi_speed[rip]
	mov	esi, 1074031364
	mov	edi, eax
	mov	eax, 0
	call	ioctl@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], -1
	jne	.L8
	mov	edx, DWORD PTR spi_speed[rip]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, -5
	jmp	.L3
.L8:
	mov	eax, DWORD PTR -8[rbp]
	lea	rdx, spi_speed[rip]
	mov	esi, 2147773188
	mov	edi, eax
	mov	eax, 0
	call	ioctl@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], -1
	jne	.L9
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, -6
	jmp	.L3
.L9:
	mov	eax, DWORD PTR spi_speed[rip]
	mov	eax, eax
	imul	rax, rax, 274877907
	shr	rax, 32
	mov	edi, eax
	shr	edi, 6
	mov	esi, DWORD PTR spi_speed[rip]
	movzx	eax, BYTE PTR spi_bits[rip]
	movzx	ecx, al
	movzx	eax, BYTE PTR spi_mode[rip]
	movzx	edx, al
	mov	rax, QWORD PTR -24[rbp]
	mov	r9d, edi
	mov	r8d, esi
	mov	rsi, rax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -8[rbp]
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	serial_open, .-serial_open
	.globl	serial_close
	.type	serial_close, @function
serial_close:
.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, 16
	mov	DWORD PTR -4[rbp], edi
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	close@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	serial_close, .-serial_close
	.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	"639143.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"/dev/spidev0.0\000"
	.data
	.align	2
	.type	device, %object
	.size	device, 4
device:
	.word	.LC0
	.comm	spi_mode,1,1
	.global	spi_bits
	.type	spi_bits, %object
	.size	spi_bits, 1
spi_bits:
	.byte	8
	.global	spi_speed
	.align	2
	.type	spi_speed, %object
	.size	spi_speed, 4
spi_speed:
	.word	200000
	.comm	spi_delay,2,2
	.section	.rodata
	.align	2
.LC1:
	.ascii	"device not found[%s]\012\000"
	.align	2
.LC2:
	.ascii	"%s:can't set spi mode\012\000"
	.align	2
.LC3:
	.ascii	"%s:can't get spi mode\012\000"
	.align	2
.LC4:
	.ascii	"%s:can't set bits per word\012\000"
	.align	2
.LC5:
	.ascii	"%s:can't get bits per word\012\000"
	.align	2
.LC6:
	.ascii	"%s:can't set max speed hz [%d]\012\000"
	.align	2
.LC7:
	.ascii	"%s:can't get max speed hz\012\000"
	.align	2
.LC8:
	.ascii	"%s: spi mode: %d, bits per word %d, speed=%d (%d Kh"
	.ascii	"z)\012\000"
	.text
	.align	2
	.global	serial_open
	.syntax unified
	.arm
	.fpu softvfp
	.type	serial_open, %function
serial_open:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	mvn	r3, #0
	str	r3, [fp, #-12]
	mov	r1, #2
	ldr	r0, [fp, #-16]
	bl	open
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bge	.L2
	ldr	r1, [fp, #-16]
	ldr	r0, .L10
	bl	printf
	ldr	r3, [fp, #-12]
	b	.L3
.L2:
	ldr	r2, .L10+4
	ldr	r1, .L10+8
	ldr	r0, [fp, #-12]
	bl	ioctl
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L4
	ldr	r1, [fp, #-16]
	ldr	r0, .L10+12
	bl	printf
	mvn	r3, #0
	b	.L3
.L4:
	ldr	r2, .L10+4
	ldr	r1, .L10+16
	ldr	r0, [fp, #-12]
	bl	ioctl
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L5
	ldr	r1, [fp, #-16]
	ldr	r0, .L10+20
	bl	printf
	mvn	r3, #1
	b	.L3
.L5:
	ldr	r2, .L10+24
	ldr	r1, .L10+28
	ldr	r0, [fp, #-12]
	bl	ioctl
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L6
	ldr	r1, [fp, #-16]
	ldr	r0, .L10+32
	bl	printf
	mvn	r3, #2
	b	.L3
.L6:
	ldr	r2, .L10+24
	ldr	r1, .L10+36
	ldr	r0, [fp, #-12]
	bl	ioctl
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L7
	ldr	r1, [fp, #-16]
	ldr	r0, .L10+40
	bl	printf
	mvn	r3, #3
	b	.L3
.L7:
	ldr	r2, .L10+44
	ldr	r1, .L10+48
	ldr	r0, [fp, #-12]
	bl	ioctl
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L8
	ldr	r3, .L10+44
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, [fp, #-16]
	ldr	r0, .L10+52
	bl	printf
	mvn	r3, #4
	b	.L3
.L8:
	ldr	r2, .L10+44
	ldr	r1, .L10+56
	ldr	r0, [fp, #-12]
	bl	ioctl
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L9
	ldr	r1, [fp, #-16]
	ldr	r0, .L10+60
	bl	printf
	mvn	r3, #5
	b	.L3
.L9:
	ldr	r3, .L10+4
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r0, r3
	ldr	r3, .L10+24
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	ip, r3
	ldr	r3, .L10+44
	ldr	r3, [r3]
	ldr	r2, .L10+44
	ldr	r2, [r2]
	ldr	r1, .L10+64
	umull	lr, r2, r1, r2
	lsr	r2, r2, #6
	str	r2, [sp, #4]
	str	r3, [sp]
	mov	r3, ip
	mov	r2, r0
	ldr	r1, [fp, #-16]
	ldr	r0, .L10+68
	bl	printf
	ldr	r3, [fp, #-12]
.L3:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	.LC1
	.word	spi_mode
	.word	1073834753
	.word	.LC2
	.word	-2147390719
	.word	.LC3
	.word	spi_bits
	.word	1073834755
	.word	.LC4
	.word	-2147390717
	.word	.LC5
	.word	spi_speed
	.word	1074031364
	.word	.LC6
	.word	-2147194108
	.word	.LC7
	.word	274877907
	.word	.LC8
	.size	serial_open, .-serial_open
	.align	2
	.global	serial_close
	.syntax unified
	.arm
	.fpu softvfp
	.type	serial_close, %function
serial_close:
	@ 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	r0, [fp, #-8]
	bl	close
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	serial_close, .-serial_close
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
