	.file	"162643335.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"usage: %s <port>"
.LC1:
	.string	"=== trying port %d\n"
.LC2:
	.string	"%d"
.LC3:
	.string	"getaddrinfo failed"
.LC4:
	.string	"creating socket for af = %d\n"
.LC5:
	.string	"socket"
	.align 8
.LC6:
	.string	"socket failed for port %d, continue"
.LC7:
	.string	"bind port %d failed"
.LC8:
	.string	"trying same port, next family"
.LC9:
	.string	"got one"
	.text
	.globl	main
	.type	main, @function
main:
.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, 144
	mov	DWORD PTR -132[rbp], edi
	mov	QWORD PTR -144[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -96[rbp]
	mov	edx, 48
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	DWORD PTR -92[rbp], 0
	mov	DWORD PTR -96[rbp], 1
	mov	DWORD PTR -88[rbp], 1
	cmp	DWORD PTR -132[rbp], 2
	je	.L2
	mov	rax, QWORD PTR -144[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdx, rax
	lea	rsi, .LC0[rip]
	mov	edi, 1
	mov	eax, 0
	call	errx@PLT
.L2:
	mov	rax, QWORD PTR -144[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	mov	eax, 0
	call	atoi@PLT
	mov	WORD PTR -118[rbp], ax
	movzx	eax, WORD PTR -118[rbp]
	mov	WORD PTR -120[rbp], ax
	jmp	.L3
.L14:
	movzx	eax, WORD PTR -120[rbp]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	movzx	edx, WORD PTR -120[rbp]
	lea	rax, -48[rbp]
	mov	ecx, edx
	lea	rdx, .LC2[rip]
	mov	esi, 32
	mov	rdi, rax
	mov	eax, 0
	call	snprintf@PLT
	lea	rcx, -112[rbp]
	lea	rdx, -96[rbp]
	lea	rax, -48[rbp]
	mov	rsi, rax
	mov	edi, 0
	call	getaddrinfo@PLT
	test	eax, eax
	je	.L4
	lea	rsi, .LC3[rip]
	mov	edi, 1
	mov	eax, 0
	call	errx@PLT
.L4:
	mov	rax, QWORD PTR -112[rbp]
	mov	QWORD PTR -104[rbp], rax
	jmp	.L5
.L13:
	mov	rax, QWORD PTR -104[rbp]
	mov	eax, DWORD PTR 4[rax]
	cmp	eax, 2
	je	.L6
	mov	rax, QWORD PTR -104[rbp]
	mov	eax, DWORD PTR 4[rax]
	cmp	eax, 10
	jne	.L17
.L6:
	mov	rax, QWORD PTR -104[rbp]
	mov	eax, DWORD PTR 4[rax]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -104[rbp]
	mov	eax, DWORD PTR 4[rax]
	mov	edx, 0
	mov	esi, 1
	mov	edi, eax
	call	socket@PLT
	mov	DWORD PTR -116[rbp], eax
	cmp	DWORD PTR -116[rbp], 0
	jns	.L8
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 22
	je	.L9
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 97
	je	.L9
	lea	rsi, .LC5[rip]
	mov	edi, 1
	mov	eax, 0
	call	errx@PLT
.L9:
	movzx	eax, WORD PTR -120[rbp]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	warnx@PLT
	jmp	.L7
.L8:
	mov	rax, QWORD PTR -104[rbp]
	mov	edx, DWORD PTR 16[rax]
	mov	rax, QWORD PTR -104[rbp]
	mov	rcx, QWORD PTR 24[rax]
	mov	eax, DWORD PTR -116[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	test	eax, eax
	jns	.L10
	movzx	eax, WORD PTR -120[rbp]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	warnx@PLT
	mov	rax, QWORD PTR -104[rbp]
	mov	rax, QWORD PTR 40[rax]
	test	rax, rax
	je	.L18
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	warnx@PLT
	jmp	.L7
.L10:
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	warnx@PLT
	jmp	.L12
.L17:
	nop
.L7:
	mov	rax, QWORD PTR -104[rbp]
	mov	rax, QWORD PTR 40[rax]
	mov	QWORD PTR -104[rbp], rax
.L5:
	cmp	QWORD PTR -104[rbp], 0
	jne	.L13
	jmp	.L12
.L18:
	nop
.L12:
	movzx	eax, WORD PTR -120[rbp]
	add	eax, 1
	mov	WORD PTR -120[rbp], ax
.L3:
	movzx	eax, WORD PTR -118[rbp]
	lea	edx, 4[rax]
	movzx	eax, WORD PTR -120[rbp]
	cmp	edx, eax
	jge	.L14
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.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	"162643335.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"usage: %s <port>\000"
	.align	2
.LC1:
	.ascii	"=== trying port %d\012\000"
	.align	2
.LC2:
	.ascii	"%d\000"
	.align	2
.LC3:
	.ascii	"getaddrinfo failed\000"
	.align	2
.LC4:
	.ascii	"creating socket for af = %d\012\000"
	.align	2
.LC5:
	.ascii	"socket\000"
	.align	2
.LC6:
	.ascii	"socket failed for port %d, continue\000"
	.align	2
.LC7:
	.ascii	"bind port %d failed\000"
	.align	2
.LC8:
	.ascii	"trying same port, next family\000"
	.align	2
.LC9:
	.ascii	"got one\000"
	.align	2
.LC10:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 96
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #96
	str	r0, [fp, #-96]
	str	r1, [fp, #-100]
	ldr	r3, .L19
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #72
	mov	r2, #32
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #0
	str	r3, [fp, #-68]
	mov	r3, #1
	str	r3, [fp, #-72]
	mov	r3, #1
	str	r3, [fp, #-64]
	ldr	r3, [fp, #-96]
	cmp	r3, #2
	beq	.L2
	ldr	r3, [fp, #-100]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L19+4
	mov	r0, #1
	bl	errx
.L2:
	ldr	r3, [fp, #-100]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	strh	r3, [fp, #-86]	@ movhi
	ldrh	r3, [fp, #-86]	@ movhi
	strh	r3, [fp, #-88]	@ movhi
	b	.L3
.L14:
	ldrh	r3, [fp, #-88]
	mov	r1, r3
	ldr	r0, .L19+8
	bl	printf
	ldrh	r3, [fp, #-88]
	sub	r0, fp, #40
	ldr	r2, .L19+12
	mov	r1, #32
	bl	snprintf
	sub	r3, fp, #84
	sub	r2, fp, #72
	sub	r1, fp, #40
	mov	r0, #0
	bl	getaddrinfo
	mov	r3, r0
	cmp	r3, #0
	beq	.L4
	ldr	r1, .L19+16
	mov	r0, #1
	bl	errx
.L4:
	ldr	r3, [fp, #-84]
	str	r3, [fp, #-80]
	b	.L5
.L13:
	ldr	r3, [fp, #-80]
	ldr	r3, [r3, #4]
	cmp	r3, #2
	beq	.L6
	ldr	r3, [fp, #-80]
	ldr	r3, [r3, #4]
	cmp	r3, #10
	bne	.L17
.L6:
	ldr	r3, [fp, #-80]
	ldr	r3, [r3, #4]
	mov	r1, r3
	ldr	r0, .L19+20
	bl	printf
	ldr	r3, [fp, #-80]
	ldr	r3, [r3, #4]
	mov	r2, #0
	mov	r1, #1
	mov	r0, r3
	bl	socket
	str	r0, [fp, #-76]
	ldr	r3, [fp, #-76]
	cmp	r3, #0
	bge	.L8
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #22
	beq	.L9
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #97
	beq	.L9
	ldr	r1, .L19+24
	mov	r0, #1
	bl	errx
.L9:
	ldrh	r3, [fp, #-88]
	mov	r1, r3
	ldr	r0, .L19+28
	bl	warnx
	b	.L7
.L8:
	ldr	r3, [fp, #-80]
	ldr	r1, [r3, #20]
	ldr	r3, [fp, #-80]
	ldr	r3, [r3, #16]
	mov	r2, r3
	ldr	r0, [fp, #-76]
	bl	bind
	mov	r3, r0
	cmp	r3, #0
	bge	.L10
	ldrh	r3, [fp, #-88]
	mov	r1, r3
	ldr	r0, .L19+32
	bl	warnx
	ldr	r3, [fp, #-80]
	ldr	r3, [r3, #28]
	cmp	r3, #0
	beq	.L18
	ldr	r0, .L19+36
	bl	warnx
	b	.L7
.L10:
	ldr	r0, .L19+40
	bl	warnx
	b	.L12
.L17:
	nop
.L7:
	ldr	r3, [fp, #-80]
	ldr	r3, [r3, #28]
	str	r3, [fp, #-80]
.L5:
	ldr	r3, [fp, #-80]
	cmp	r3, #0
	bne	.L13
	b	.L12
.L18:
	nop
.L12:
	ldrh	r3, [fp, #-88]
	add	r3, r3, #1
	strh	r3, [fp, #-88]	@ movhi
.L3:
	ldrh	r3, [fp, #-86]
	add	r2, r3, #4
	ldrh	r3, [fp, #-88]
	cmp	r2, r3
	bge	.L14
	mov	r3, #0
	ldr	r2, .L19
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L16
	bl	__stack_chk_fail
.L16:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L20:
	.align	2
.L19:
	.word	.LC10
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
