	.file	"extr_bg96.c_bg96_set_working_mode.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"+++"
.LC1:
	.string	"send command failed"
.LC2:
	.string	"enter command mode failed"
.LC3:
	.string	"enter command mode ok"
.LC4:
	.string	"ATD*99***1#\r"
.LC5:
	.string	"enter ppp mode failed"
.LC6:
	.string	"enter ppp mode ok"
.LC7:
	.string	"unsupported working mode: %d"
	.text
	.p2align 4
	.type	bg96_set_working_mode, @function
bg96_set_working_mode:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	rbx, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	rax, QWORD PTR 16[rdi]
	cmp	esi, 128
	je	.L2
	cmp	esi, 129
	jne	.L3
	mov	edx, DWORD PTR bg96_handle_exit_data_mode[rip]
	mov	r12d, DWORD PTR err[rip]
	lea	rsi, .LC0[rip]
	mov	DWORD PTR 8[rdi], edx
	mov	edx, DWORD PTR MODEM_COMMAND_TIMEOUT_MODE_CHANGE[rip]
	mov	rdi, rax
	call	[QWORD PTR [rax]]
	xor	edi, edi
	cmp	DWORD PTR ESP_OK[rip], eax
	mov	edx, r12d
	sete	dil
	lea	rsi, .LC1[rip]
	call	DCE_CHECK@PLT
	mov	eax, DWORD PTR MODEM_STATE_SUCCESS[rip]
	xor	edi, edi
	mov	edx, DWORD PTR err[rip]
	cmp	DWORD PTR 4[rbx], eax
	lea	rsi, .LC2[rip]
	sete	dil
	call	DCE_CHECK@PLT
	mov	edi, DWORD PTR DCE_TAG[rip]
	lea	rsi, .LC3[rip]
	call	ESP_LOGD@PLT
	mov	DWORD PTR [rbx], 129
.L4:
	mov	eax, DWORD PTR ESP_OK[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	edx, DWORD PTR bg96_handle_atd_ppp[rip]
	mov	r12d, DWORD PTR err[rip]
	lea	rsi, .LC4[rip]
	mov	DWORD PTR 8[rdi], edx
	mov	edx, DWORD PTR MODEM_COMMAND_TIMEOUT_MODE_CHANGE[rip]
	mov	rdi, rax
	call	[QWORD PTR [rax]]
	xor	edi, edi
	cmp	DWORD PTR ESP_OK[rip], eax
	mov	edx, r12d
	sete	dil
	lea	rsi, .LC1[rip]
	call	DCE_CHECK@PLT
	mov	eax, DWORD PTR MODEM_STATE_SUCCESS[rip]
	xor	edi, edi
	mov	edx, DWORD PTR err[rip]
	cmp	DWORD PTR 4[rbx], eax
	lea	rsi, .LC5[rip]
	sete	dil
	call	DCE_CHECK@PLT
	mov	edi, DWORD PTR DCE_TAG[rip]
	lea	rsi, .LC6[rip]
	call	ESP_LOGD@PLT
	mov	DWORD PTR [rbx], 128
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	mov	edi, DWORD PTR DCE_TAG[rip]
	mov	edx, esi
	lea	rsi, .LC7[rip]
	call	ESP_LOGW@PLT
	mov	eax, DWORD PTR ESP_FAIL[rip]
	add	rsp, 8
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	bg96_set_working_mode, .-bg96_set_working_mode
	.comm	err,4,4
	.comm	bg96_handle_exit_data_mode,4,4
	.comm	bg96_handle_atd_ppp,4,4
	.comm	MODEM_STATE_SUCCESS,4,4
	.comm	MODEM_COMMAND_TIMEOUT_MODE_CHANGE,4,4
	.comm	ESP_OK,4,4
	.comm	ESP_FAIL,4,4
	.comm	DCE_TAG,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_bg96.c_bg96_set_working_mode.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"+++\000"
	.align	2
.LC1:
	.ascii	"send command failed\000"
	.align	2
.LC2:
	.ascii	"enter command mode failed\000"
	.align	2
.LC3:
	.ascii	"enter command mode ok\000"
	.align	2
.LC4:
	.ascii	"ATD*99***1#\015\000"
	.align	2
.LC5:
	.ascii	"enter ppp mode failed\000"
	.align	2
.LC6:
	.ascii	"enter ppp mode ok\000"
	.align	2
.LC7:
	.ascii	"unsupported working mode: %d\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	bg96_set_working_mode, %function
bg96_set_working_mode:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	cmp	r1, #128
	push	{r4, r5, r6, r7, r8, lr}
	mov	r5, r0
	mov	r4, r1
	ldr	r0, [r0, #12]
	beq	.L2
	cmp	r1, #129
	bne	.L3
	ldr	r3, .L8
	ldr	r2, .L8+4
	ldr	r3, [r3]
	ldr	r2, [r2]
	str	r3, [r5, #8]
	ldr	r1, .L8+8
	ldr	r3, [r0]
	blx	r3
	ldr	r6, .L8+12
	ldr	r7, .L8+16
	ldr	r3, [r6]
	ldr	r2, [r7]
	sub	r0, r3, r0
	clz	r0, r0
	ldr	r1, .L8+20
	lsr	r0, r0, #5
	bl	DCE_CHECK
	ldr	r3, .L8+24
	ldr	r0, [r5, #4]
	ldr	r3, [r3]
	ldr	r2, [r7]
	sub	r0, r0, r3
	clz	r0, r0
	ldr	r1, .L8+28
	lsr	r0, r0, #5
	bl	DCE_CHECK
	ldr	r3, .L8+32
	ldr	r1, .L8+36
	ldr	r0, [r3]
	bl	ESP_LOGD
	ldr	r0, [r6]
	str	r4, [r5]
	pop	{r4, r5, r6, r7, r8, pc}
.L2:
	ldr	r3, .L8+40
	ldr	r2, .L8+4
	ldr	r3, [r3]
	ldr	r2, [r2]
	str	r3, [r5, #8]
	ldr	r1, .L8+44
	ldr	r3, [r0]
	blx	r3
	ldr	r6, .L8+12
	ldr	r7, .L8+16
	ldr	r3, [r6]
	ldr	r2, [r7]
	sub	r0, r3, r0
	clz	r0, r0
	ldr	r1, .L8+20
	lsr	r0, r0, #5
	bl	DCE_CHECK
	ldr	r3, .L8+24
	ldr	r0, [r5, #4]
	ldr	r3, [r3]
	ldr	r2, [r7]
	sub	r0, r0, r3
	clz	r0, r0
	ldr	r1, .L8+48
	lsr	r0, r0, #5
	bl	DCE_CHECK
	ldr	r3, .L8+32
	ldr	r1, .L8+52
	ldr	r0, [r3]
	bl	ESP_LOGD
	ldr	r0, [r6]
	str	r4, [r5]
	pop	{r4, r5, r6, r7, r8, pc}
.L3:
	ldr	r3, .L8+32
	mov	r2, r1
	ldr	r0, [r3]
	ldr	r1, .L8+56
	bl	ESP_LOGW
	ldr	r3, .L8+60
	ldr	r0, [r3]
	pop	{r4, r5, r6, r7, r8, pc}
.L9:
	.align	2
.L8:
	.word	bg96_handle_exit_data_mode
	.word	MODEM_COMMAND_TIMEOUT_MODE_CHANGE
	.word	.LC0
	.word	ESP_OK
	.word	err
	.word	.LC1
	.word	MODEM_STATE_SUCCESS
	.word	.LC2
	.word	DCE_TAG
	.word	.LC3
	.word	bg96_handle_atd_ppp
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	ESP_FAIL
	.size	bg96_set_working_mode, .-bg96_set_working_mode
	.comm	err,4,4
	.comm	bg96_handle_exit_data_mode,4,4
	.comm	bg96_handle_atd_ppp,4,4
	.comm	MODEM_STATE_SUCCESS,4,4
	.comm	MODEM_COMMAND_TIMEOUT_MODE_CHANGE,4,4
	.comm	ESP_OK,4,4
	.comm	ESP_FAIL,4,4
	.comm	DCE_TAG,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
