	.file	"extr_scsi_ch.c_chioctl.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"entering chioctl\n"
	.text
	.p2align 4
	.type	chioctl, @function
chioctl:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	mov	r14d, ecx
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13, rdx
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	ebp, esi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	r12, QWORD PTR [rdi]
	mov	rdi, r12
	call	cam_periph_lock@PLT
	mov	esi, DWORD PTR CAM_DEBUG_TRACE[rip]
	mov	edi, DWORD PTR [r12]
	lea	rdx, .LC0[rip]
	call	CAM_DEBUG@PLT
	mov	esi, DWORD PTR CAM_DEBUG_TRACE[rip]
	mov	edi, DWORD PTR [r12]
	movsx	rdx, ebp
	mov	rbx, QWORD PTR 8[r12]
	call	CAM_DEBUG@PLT
	cmp	ebp, 128
	je	.L2
	lea	eax, -134[rbp]
	cmp	eax, 2
	ja	.L21
.L3:
	lea	eax, -129[rbp]
	cmp	eax, 8
	ja	.L5
	lea	rdx, .L7[rip]
	movsx	rax, DWORD PTR [rdx+rax*4]
	add	rax, rdx
	notrack jmp	rax
	.section	.rodata
	.align 4
	.align 4
.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
	.p2align 4,,10
	.p2align 3
.L21:
	test	DWORD PTR FWRITE[rip], r14d
	jne	.L3
	mov	rdi, r12
	call	cam_periph_unlock@PLT
	mov	r13d, DWORD PTR EBADF[rip]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	mov	eax, r13d
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore_state
	mov	rdx, QWORD PTR 8[rbx]
	mov	rcx, QWORD PTR CHET_MT[rip]
	mov	eax, DWORD PTR [rbx]
	sub	eax, DWORD PTR [rdx+rcx*4]
	mov	DWORD PTR 0[r13], eax
	xor	r13d, r13d
	.p2align 4,,10
	.p2align 3
.L16:
	mov	rdi, r12
	call	cam_periph_unlock@PLT
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r13d
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
.L8:
	.cfi_restore_state
	mov	rax, QWORD PTR 16[rbx]
	mov	rdx, QWORD PTR CHET_MT[rip]
	mov	edx, DWORD PTR [rax+rdx*4]
	mov	DWORD PTR 12[r13], edx
	mov	rdx, QWORD PTR CHET_ST[rip]
	mov	edx, DWORD PTR [rax+rdx*4]
	mov	DWORD PTR 8[r13], edx
	mov	rdx, QWORD PTR CHET_IE[rip]
	mov	edx, DWORD PTR [rax+rdx*4]
	mov	DWORD PTR 4[r13], edx
	mov	rdx, QWORD PTR CHET_DT[rip]
	mov	eax, DWORD PTR [rax+rdx*4]
	mov	DWORD PTR 0[r13], eax
	xor	r13d, r13d
	jmp	.L16
.L6:
	mov	rsi, r13
	mov	rdi, r12
	call	chexchange@PLT
	mov	r13d, eax
	jmp	.L16
.L15:
	mov	rdx, QWORD PTR CHET_MT[rip]
	mov	rcx, QWORD PTR 16[rbx]
	mov	eax, DWORD PTR 0[r13]
	mov	r13d, DWORD PTR EINVAL[rip]
	cmp	DWORD PTR [rcx+rdx*4], eax
	jle	.L16
	mov	rcx, QWORD PTR 8[rbx]
	xor	r13d, r13d
	add	eax, DWORD PTR [rcx+rdx*4]
	mov	DWORD PTR [rbx], eax
	jmp	.L16
.L14:
	mov	rsi, r13
	mov	rdi, r12
	call	chsetvoltag@PLT
	mov	r13d, eax
	jmp	.L16
.L13:
	mov	rsi, r13
	mov	rdi, r12
	call	chposition@PLT
	mov	r13d, eax
	jmp	.L16
.L12:
	mov	rsi, r13
	mov	rdi, r12
	call	chmove@PLT
	mov	r13d, eax
	jmp	.L16
.L11:
	mov	esi, DWORD PTR 0[r13]
	mov	rdi, r12
	call	chielem@PLT
	mov	r13d, eax
	jmp	.L16
.L10:
	mov	rdi, r12
	call	chscsiversion@PLT
	cmp	DWORD PTR SCSI_REV_0[rip], eax
	mov	esi, eax
	jg	.L18
	mov	rcx, r13
	mov	edx, 134
	mov	rdi, r12
	call	chgetelemstatus@PLT
	mov	r13d, eax
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L2:
	mov	esi, DWORD PTR SCSI_REV_2[rip]
	mov	rcx, r13
	mov	edx, 128
	mov	rdi, r12
	call	chgetelemstatus@PLT
	mov	r13d, eax
	jmp	.L16
.L5:
	mov	ecx, DWORD PTR cherror[rip]
	mov	rdx, r13
	mov	esi, ebp
	mov	rdi, r12
	call	cam_periph_ioctl@PLT
	mov	r13d, eax
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L18:
	mov	rdi, r12
	call	cam_periph_unlock@PLT
	mov	r13d, DWORD PTR ENXIO[rip]
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	chioctl, .-chioctl
	.comm	cherror,4,4
	.comm	SCSI_REV_2,4,4
	.comm	SCSI_REV_0,4,4
	.comm	FWRITE,4,4
	.comm	ENXIO,4,4
	.comm	EINVAL,4,4
	.comm	EBADF,4,4
	.comm	CHET_ST,8,8
	.comm	CHET_MT,8,8
	.comm	CHET_IE,8,8
	.comm	CHET_DT,8,8
	.comm	CAM_DEBUG_TRACE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.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, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_scsi_ch.c_chioctl.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"entering chioctl\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	chioctl, %function
chioctl:
	@ args = 4, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r1
	ldr	r5, [r0]
	ldr	r7, .L22
	mov	r0, r5
	mov	r8, r3
	mov	r6, r2
	bl	cam_periph_lock
	ldr	r1, [r7]
	ldr	r2, .L22+4
	ldr	r0, [r5]
	bl	CAM_DEBUG
	ldr	r1, [r7]
	mov	r2, r4
	ldm	r5, {r0, r7}
	bl	CAM_DEBUG
	cmp	r4, #128
	beq	.L2
	sub	r2, r4, #134
	cmp	r2, #2
	bhi	.L21
.L3:
	sub	r3, r4, #129
	cmp	r3, #8
	ldrls	pc, [pc, r3, asl #2]
	b	.L5
.L7:
	.word	.L15
	.word	.L14
	.word	.L13
	.word	.L12
	.word	.L11
	.word	.L10
	.word	.L9
	.word	.L8
	.word	.L6
.L21:
	ldr	r3, .L22+8
	ldr	r3, [r3]
	tst	r8, r3
	bne	.L3
	mov	r0, r5
	bl	cam_periph_unlock
	ldr	r3, .L22+12
	ldr	r4, [r3]
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, pc}
.L8:
	mov	r4, #0
	ldr	r2, .L22+16
	ldr	r3, [r7, #8]
	ldr	r1, [r2]
	ldr	r2, .L22+20
	ldr	r1, [r3, r1, lsl #2]
	ldr	r2, [r2]
	str	r1, [r6, #12]
	ldr	r1, .L22+24
	ldr	r2, [r3, r2, lsl #2]
	ldr	r1, [r1]
	str	r2, [r6, #8]
	ldr	r2, .L22+28
	ldr	r1, [r3, r1, lsl #2]
	ldr	r2, [r2]
	str	r1, [r6, #4]
	ldr	r3, [r3, r2, lsl #2]
	str	r3, [r6]
.L16:
	mov	r0, r5
	bl	cam_periph_unlock
.L1:
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, pc}
.L6:
	mov	r1, r6
	mov	r0, r5
	bl	chexchange
	mov	r4, r0
	b	.L16
.L15:
	ldr	r3, .L22+16
	ldr	r1, [r7, #8]
	ldr	r2, [r3]
	ldr	r3, [r6]
	ldr	r1, [r1, r2, lsl #2]
	cmp	r1, r3
	ldrgt	r1, [r7, #4]
	ldrle	r3, .L22+32
	ldrgt	r2, [r1, r2, lsl #2]
	movgt	r4, #0
	addgt	r3, r2, r3
	ldrle	r4, [r3]
	strgt	r3, [r7]
	b	.L16
.L14:
	mov	r1, r6
	mov	r0, r5
	bl	chsetvoltag
	mov	r4, r0
	b	.L16
.L13:
	mov	r1, r6
	mov	r0, r5
	bl	chposition
	mov	r4, r0
	b	.L16
.L12:
	mov	r1, r6
	mov	r0, r5
	bl	chmove
	mov	r4, r0
	b	.L16
.L11:
	mov	r0, r5
	ldr	r1, [r6]
	bl	chielem
	mov	r4, r0
	b	.L16
.L10:
	mov	r0, r5
	bl	chscsiversion
	ldr	r3, .L22+36
	mov	r1, r0
	ldr	r3, [r3]
	cmp	r3, r0
	bgt	.L18
	mov	r3, r6
	mov	r2, #134
	mov	r0, r5
	bl	chgetelemstatus
	mov	r4, r0
	b	.L16
.L9:
	ldr	r3, .L22+16
	ldr	r2, [r7, #4]
	ldr	r1, [r3]
	ldr	r3, [r7]
	ldr	r2, [r2, r1, lsl #2]
	mov	r4, #0
	sub	r3, r3, r2
	str	r3, [r6]
	b	.L16
.L2:
	ldr	r1, .L22+40
	mov	r2, r4
	mov	r3, r6
	mov	r0, r5
	ldr	r1, [r1]
	bl	chgetelemstatus
	mov	r4, r0
	b	.L16
.L18:
	mov	r0, r5
	bl	cam_periph_unlock
	ldr	r3, .L22+44
	ldr	r4, [r3]
	b	.L1
.L5:
	ldr	r3, .L22+48
	mov	r1, r4
	mov	r2, r6
	mov	r0, r5
	ldr	r3, [r3]
	bl	cam_periph_ioctl
	mov	r4, r0
	b	.L16
.L23:
	.align	2
.L22:
	.word	CAM_DEBUG_TRACE
	.word	.LC0
	.word	FWRITE
	.word	EBADF
	.word	CHET_MT
	.word	CHET_ST
	.word	CHET_IE
	.word	CHET_DT
	.word	EINVAL
	.word	SCSI_REV_0
	.word	SCSI_REV_2
	.word	ENXIO
	.word	cherror
	.size	chioctl, .-chioctl
	.comm	cherror,4,4
	.comm	SCSI_REV_2,4,4
	.comm	SCSI_REV_0,4,4
	.comm	FWRITE,4,4
	.comm	ENXIO,4,4
	.comm	EINVAL,4,4
	.comm	EBADF,4,4
	.comm	CHET_ST,4,4
	.comm	CHET_MT,4,4
	.comm	CHET_IE,4,4
	.comm	CHET_DT,4,4
	.comm	CAM_DEBUG_TRACE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
