	.file	"extr_ses.c_ses_get_page2_descriptor.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ses_get_page2_descriptor, @function
ses_get_page2_descriptor:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	edi, DWORD PTR 8[rdi]
	mov	ebx, DWORD PTR [rsi]
	call	to_scsi_device@PLT
	mov	r13, QWORD PTR 0[rbp]
	mov	esi, 2
	mov	rdi, rax
	mov	rdx, QWORD PTR 8[r13]
	mov	ecx, DWORD PTR 20[r13]
	mov	rbp, QWORD PTR 0[r13]
	lea	r12, 8[rdx]
	call	ses_recv_diag@PLT
	test	rax, rax
	js	.L11
	mov	eax, DWORD PTR 16[r13]
	test	eax, eax
	jle	.L11
	sub	eax, 1
	movzx	edi, BYTE PTR ENCLOSURE_COMPONENT_DEVICE[rip]
	movzx	r8d, BYTE PTR ENCLOSURE_COMPONENT_ARRAY_DEVICE[rip]
	lea	r9, 4[rbp+rax*4]
	xor	eax, eax
.L3:
	movzx	ecx, BYTE PTR 1[rbp]
	test	cl, cl
	je	.L8
	sub	ecx, 1
	movzx	edx, BYTE PTR 0[rbp]
	lea	rsi, 4[r12+rcx*4]
	.p2align 4,,10
	.p2align 3
.L6:
	add	r12, 4
	cmp	dl, dil
	je	.L4
	cmp	dl, r8b
	jne	.L5
.L4:
	lea	ecx, 1[rax]
	cmp	ebx, eax
	je	.L1
	mov	eax, ecx
.L5:
	cmp	rsi, r12
	jne	.L6
.L8:
	add	rbp, 4
	cmp	r9, rbp
	jne	.L3
.L11:
	xor	r12d, r12d
.L1:
	add	rsp, 8
	.cfi_def_cfa_offset 40
	mov	rax, r12
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	ses_get_page2_descriptor, .-ses_get_page2_descriptor
	.comm	ENCLOSURE_COMPONENT_DEVICE,1,1
	.comm	ENCLOSURE_COMPONENT_ARRAY_DEVICE,1,1
	.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_ses.c_ses_get_page2_descriptor.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ses_get_page2_descriptor, %function
ses_get_page2_descriptor:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r4, r0
	ldr	r0, [r0, #4]
	ldr	r5, [r1]
	bl	to_scsi_device
	ldr	r7, [r4]
	mov	r1, #2
	ldr	r2, [r7, #4]
	ldr	r3, [r7, #12]
	ldr	r6, [r7]
	add	r4, r2, #8
	bl	ses_recv_diag
	cmp	r0, #0
	blt	.L11
	ldr	r8, [r7, #8]
	cmp	r8, #0
	ble	.L11
	mov	r3, #0
	mov	r7, r3
	ldr	r1, .L15
	ldr	r2, .L15+4
	ldrb	ip, [r1]	@ zero_extendqisi2
	ldrb	lr, [r2]	@ zero_extendqisi2
	add	r9, r6, #1
.L3:
	ldrb	r0, [r9, r7, lsl #2]	@ zero_extendqisi2
	cmp	r0, #0
	movne	r2, #0
	ldrbne	r1, [r6, r7, lsl #2]	@ zero_extendqisi2
	beq	.L8
.L6:
	cmp	r1, ip
	add	r2, r2, #1
	add	r4, r4, #4
	beq	.L4
	cmp	r1, lr
	bne	.L5
.L4:
	cmp	r5, r3
	add	r3, r3, #1
	beq	.L1
.L5:
	cmp	r2, r0
	bne	.L6
.L8:
	add	r7, r7, #1
	cmp	r7, r8
	bne	.L3
.L11:
	mov	r4, #0
.L1:
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L16:
	.align	2
.L15:
	.word	ENCLOSURE_COMPONENT_DEVICE
	.word	ENCLOSURE_COMPONENT_ARRAY_DEVICE
	.size	ses_get_page2_descriptor, .-ses_get_page2_descriptor
	.comm	ENCLOSURE_COMPONENT_DEVICE,1,1
	.comm	ENCLOSURE_COMPONENT_ARRAY_DEVICE,1,1
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
