	.file	"765582.c"
	.intel_syntax noprefix
	.text
	.globl	keepalive
	.data
	.align 4
	.type	keepalive, @object
	.size	keepalive, 4
keepalive:
	.long	1
	.globl	keep_idle
	.align 4
	.type	keep_idle, @object
	.size	keep_idle, 4
keep_idle:
	.long	7200
	.globl	keep_intvl
	.align 4
	.type	keep_intvl, @object
	.size	keep_intvl, 4
keep_intvl:
	.long	75
	.globl	keep_cnt
	.align 4
	.type	keep_cnt, @object
	.size	keep_cnt, 4
keep_cnt:
	.long	9
	.globl	orig_connect
	.bss
	.align 8
	.type	orig_connect, @object
	.size	orig_connect, 8
orig_connect:
	.zero	8
	.section	.rodata
.LC0:
	.string	"connect"
	.align 8
.LC1:
	.string	"Failed to open connect function\n"
.LC2:
	.string	"FORCE_KEEPALIVE_IDLE"
.LC3:
	.string	"FORCE_KEEPALIVE_INTVL"
.LC4:
	.string	"FORCE_KEEPALIVE_CNT"
.LC5:
	.string	"Failed to set SO_KEEPALIVE\n"
.LC6:
	.string	"Failed to set TCP_KEEPIDLE\n"
.LC7:
	.string	"Failed to set TCP_KEEPINTVL\n"
.LC8:
	.string	"Failed to set TCP_KEEPCNT\n"
	.text
	.globl	connect
	.type	connect, @function
connect:
.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, 80
	mov	DWORD PTR -68[rbp], edi
	mov	QWORD PTR -80[rbp], rsi
	mov	DWORD PTR -72[rbp], edx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR orig_connect[rip]
	test	rax, rax
	jne	.L2
	lea	rsi, .LC0[rip]
	mov	rdi, -1
	call	dlsym@PLT
	mov	QWORD PTR orig_connect[rip], rax
	mov	rax, QWORD PTR orig_connect[rip]
	test	rax, rax
	jne	.L2
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 32
	mov	esi, 1
	lea	rdi, .LC1[rip]
	call	fwrite@PLT
	call	__errno_location@PLT
	mov	DWORD PTR [rax], 2
	mov	eax, -1
	jmp	.L13
.L2:
	mov	DWORD PTR -48[rbp], 4
	lea	rcx, -48[rbp]
	lea	rdx, -52[rbp]
	mov	eax, DWORD PTR -68[rbp]
	mov	r8, rcx
	mov	rcx, rdx
	mov	edx, 3
	mov	esi, 1
	mov	edi, eax
	call	getsockopt@PLT
	test	eax, eax
	jne	.L4
	mov	eax, DWORD PTR -52[rbp]
	cmp	eax, 1
	je	.L5
.L4:
	mov	r8, QWORD PTR orig_connect[rip]
	mov	edx, DWORD PTR -72[rbp]
	mov	rcx, QWORD PTR -80[rbp]
	mov	eax, DWORD PTR -68[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	r8
	jmp	.L13
.L5:
	mov	QWORD PTR -32[rbp], 0
	lea	rdi, .LC2[rip]
	call	getenv@PLT
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	je	.L6
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, 10
	mov	esi, 0
	mov	rdi, rax
	call	strtol@PLT
	mov	DWORD PTR -44[rbp], eax
	cmp	DWORD PTR -44[rbp], 0
	jle	.L6
	cmp	DWORD PTR -44[rbp], 7200
	jg	.L6
	mov	eax, DWORD PTR -44[rbp]
	mov	DWORD PTR keep_idle[rip], eax
.L6:
	lea	rdi, .LC3[rip]
	call	getenv@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	je	.L7
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, 10
	mov	esi, 0
	mov	rdi, rax
	call	strtol@PLT
	mov	DWORD PTR -40[rbp], eax
	cmp	DWORD PTR -40[rbp], 0
	jle	.L7
	cmp	DWORD PTR -40[rbp], 75
	jg	.L7
	mov	eax, DWORD PTR -40[rbp]
	mov	DWORD PTR keep_intvl[rip], eax
.L7:
	lea	rdi, .LC4[rip]
	call	getenv@PLT
	mov	QWORD PTR -32[rbp], rax
	cmp	QWORD PTR -32[rbp], 0
	je	.L8
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, 10
	mov	esi, 0
	mov	rdi, rax
	call	strtol@PLT
	mov	DWORD PTR -36[rbp], eax
	cmp	DWORD PTR -36[rbp], 0
	jle	.L8
	cmp	DWORD PTR -36[rbp], 9
	jg	.L8
	mov	eax, DWORD PTR -36[rbp]
	mov	DWORD PTR keep_cnt[rip], eax
.L8:
	mov	eax, DWORD PTR -68[rbp]
	mov	r8d, 4
	lea	rcx, keepalive[rip]
	mov	edx, 9
	mov	esi, 1
	mov	edi, eax
	call	setsockopt@PLT
	test	eax, eax
	je	.L9
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 27
	mov	esi, 1
	lea	rdi, .LC5[rip]
	call	fwrite@PLT
.L9:
	mov	eax, DWORD PTR -68[rbp]
	mov	r8d, 4
	lea	rcx, keep_idle[rip]
	mov	edx, 4
	mov	esi, 6
	mov	edi, eax
	call	setsockopt@PLT
	test	eax, eax
	je	.L10
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 27
	mov	esi, 1
	lea	rdi, .LC6[rip]
	call	fwrite@PLT
.L10:
	mov	eax, DWORD PTR -68[rbp]
	mov	r8d, 4
	lea	rcx, keep_intvl[rip]
	mov	edx, 5
	mov	esi, 6
	mov	edi, eax
	call	setsockopt@PLT
	test	eax, eax
	je	.L11
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 28
	mov	esi, 1
	lea	rdi, .LC7[rip]
	call	fwrite@PLT
.L11:
	mov	eax, DWORD PTR -68[rbp]
	mov	r8d, 4
	lea	rcx, keep_cnt[rip]
	mov	edx, 6
	mov	esi, 6
	mov	edi, eax
	call	setsockopt@PLT
	test	eax, eax
	je	.L12
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 26
	mov	esi, 1
	lea	rdi, .LC8[rip]
	call	fwrite@PLT
.L12:
	mov	r8, QWORD PTR orig_connect[rip]
	mov	edx, DWORD PTR -72[rbp]
	mov	rcx, QWORD PTR -80[rbp]
	mov	eax, DWORD PTR -68[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	r8
.L13:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	connect, .-connect
	.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	"765582.c"
	.text
	.global	keepalive
	.data
	.align	2
	.type	keepalive, %object
	.size	keepalive, 4
keepalive:
	.word	1
	.global	keep_idle
	.align	2
	.type	keep_idle, %object
	.size	keep_idle, 4
keep_idle:
	.word	7200
	.global	keep_intvl
	.align	2
	.type	keep_intvl, %object
	.size	keep_intvl, 4
keep_intvl:
	.word	75
	.global	keep_cnt
	.align	2
	.type	keep_cnt, %object
	.size	keep_cnt, 4
keep_cnt:
	.word	9
	.global	orig_connect
	.bss
	.align	2
	.type	orig_connect, %object
	.size	orig_connect, 4
orig_connect:
	.space	4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"connect\000"
	.align	2
.LC1:
	.ascii	"Failed to open connect function\012\000"
	.align	2
.LC2:
	.ascii	"FORCE_KEEPALIVE_IDLE\000"
	.align	2
.LC3:
	.ascii	"FORCE_KEEPALIVE_INTVL\000"
	.align	2
.LC4:
	.ascii	"FORCE_KEEPALIVE_CNT\000"
	.align	2
.LC5:
	.ascii	"Failed to set SO_KEEPALIVE\012\000"
	.align	2
.LC6:
	.ascii	"Failed to set TCP_KEEPIDLE\012\000"
	.align	2
.LC7:
	.ascii	"Failed to set TCP_KEEPINTVL\012\000"
	.align	2
.LC8:
	.ascii	"Failed to set TCP_KEEPCNT\012\000"
	.align	2
.LC9:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	connect
	.syntax unified
	.arm
	.fpu softvfp
	.type	connect, %function
connect:
	@ args = 0, pretend = 0, frame = 56
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #64
	str	r0, [fp, #-48]
	str	r1, [fp, #-52]
	str	r2, [fp, #-56]
	ldr	r3, .L15
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L15+4
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L2
	ldr	r1, .L15+8
	mvn	r0, #0
	bl	dlsym
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L15+4
	str	r2, [r3]
	ldr	r3, .L15+4
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L2
	ldr	r3, .L15+12
	ldr	r3, [r3]
	mov	r2, #32
	mov	r1, #1
	ldr	r0, .L15+16
	bl	fwrite
	bl	__errno_location
	mov	r3, r0
	mov	r2, #2
	str	r2, [r3]
	mvn	r3, #0
	b	.L13
.L2:
	mov	r3, #4
	str	r3, [fp, #-36]
	sub	r2, fp, #40
	sub	r3, fp, #36
	str	r3, [sp]
	mov	r3, r2
	mov	r2, #3
	mov	r1, #1
	ldr	r0, [fp, #-48]
	bl	getsockopt
	mov	r3, r0
	cmp	r3, #0
	bne	.L4
	ldr	r3, [fp, #-40]
	cmp	r3, #1
	beq	.L5
.L4:
	ldr	r3, .L15+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-56]
	ldr	r1, [fp, #-52]
	ldr	r0, [fp, #-48]
	blx	r3
	mov	r3, r0
	b	.L13
.L5:
	mov	r3, #0
	str	r3, [fp, #-32]
	ldr	r0, .L15+20
	bl	getenv
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L6
	mov	r2, #10
	mov	r1, #0
	ldr	r0, [fp, #-28]
	bl	strtol
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	ble	.L6
	ldr	r3, [fp, #-24]
	ldr	r2, .L15+24
	cmp	r3, r2
	bgt	.L6
	ldr	r2, .L15+28
	ldr	r3, [fp, #-24]
	str	r3, [r2]
.L6:
	ldr	r0, .L15+32
	bl	getenv
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L7
	mov	r2, #10
	mov	r1, #0
	ldr	r0, [fp, #-20]
	bl	strtol
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	ble	.L7
	ldr	r3, [fp, #-16]
	cmp	r3, #75
	bgt	.L7
	ldr	r2, .L15+36
	ldr	r3, [fp, #-16]
	str	r3, [r2]
.L7:
	ldr	r0, .L15+40
	bl	getenv
	str	r0, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	beq	.L8
	mov	r2, #10
	mov	r1, #0
	ldr	r0, [fp, #-32]
	bl	strtol
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	ble	.L8
	ldr	r3, [fp, #-12]
	cmp	r3, #9
	bgt	.L8
	ldr	r2, .L15+44
	ldr	r3, [fp, #-12]
	str	r3, [r2]
.L8:
	mov	r3, #4
	str	r3, [sp]
	ldr	r3, .L15+48
	mov	r2, #9
	mov	r1, #1
	ldr	r0, [fp, #-48]
	bl	setsockopt
	mov	r3, r0
	cmp	r3, #0
	beq	.L9
	ldr	r3, .L15+12
	ldr	r3, [r3]
	mov	r2, #27
	mov	r1, #1
	ldr	r0, .L15+52
	bl	fwrite
.L9:
	mov	r3, #4
	str	r3, [sp]
	ldr	r3, .L15+28
	mov	r2, #4
	mov	r1, #6
	ldr	r0, [fp, #-48]
	bl	setsockopt
	mov	r3, r0
	cmp	r3, #0
	beq	.L10
	ldr	r3, .L15+12
	ldr	r3, [r3]
	mov	r2, #27
	mov	r1, #1
	ldr	r0, .L15+56
	bl	fwrite
.L10:
	mov	r3, #4
	str	r3, [sp]
	ldr	r3, .L15+36
	mov	r2, #5
	mov	r1, #6
	ldr	r0, [fp, #-48]
	bl	setsockopt
	mov	r3, r0
	cmp	r3, #0
	beq	.L11
	ldr	r3, .L15+12
	ldr	r3, [r3]
	mov	r2, #28
	mov	r1, #1
	ldr	r0, .L15+60
	bl	fwrite
.L11:
	mov	r3, #4
	str	r3, [sp]
	ldr	r3, .L15+44
	mov	r2, #6
	mov	r1, #6
	ldr	r0, [fp, #-48]
	bl	setsockopt
	mov	r3, r0
	cmp	r3, #0
	beq	.L12
	ldr	r3, .L15+12
	ldr	r3, [r3]
	mov	r2, #26
	mov	r1, #1
	ldr	r0, .L15+64
	bl	fwrite
.L12:
	ldr	r3, .L15+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-56]
	ldr	r1, [fp, #-52]
	ldr	r0, [fp, #-48]
	blx	r3
	mov	r3, r0
.L13:
	ldr	r2, .L15
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L14
	bl	__stack_chk_fail
.L14:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L16:
	.align	2
.L15:
	.word	.LC9
	.word	orig_connect
	.word	.LC0
	.word	stderr
	.word	.LC1
	.word	.LC2
	.word	7200
	.word	keep_idle
	.word	.LC3
	.word	keep_intvl
	.word	.LC4
	.word	keep_cnt
	.word	keepalive
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.size	connect, .-connect
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
