	.file	"210791.c"
	.intel_syntax noprefix
	.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, 16
	mov	DWORD PTR -4[rbp], edi
	mov	QWORD PTR -16[rbp], rsi
	call	load_menu
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC0:
	.string	"What's your requirement? 1.DNS 2. QUERY 3. QUIT: "
.LC1:
	.string	"%d"
.LC2:
	.string	"Input URL address: "
.LC3:
	.string	"Input student ID: "
.LC4:
	.string	"Quitting program!"
.LC5:
	.string	"Invalid choice!"
	.text
	.globl	load_menu
	.type	load_menu, @function
load_menu:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
.L9:
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -12[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, 3
	je	.L4
	cmp	eax, 3
	jg	.L5
	cmp	eax, 1
	je	.L6
	cmp	eax, 2
	je	.L7
	jmp	.L5
.L6:
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -12[rbp]
	movsx	eax, al
	mov	edi, eax
	call	socketquery
	jmp	.L8
.L7:
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -12[rbp]
	movsx	eax, al
	mov	edi, eax
	call	socketquery
	jmp	.L8
.L4:
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	edi, 0
	call	exit@PLT
.L5:
	lea	rdi, .LC5[rip]
	call	puts@PLT
	nop
.L8:
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, 3
	jne	.L9
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	load_menu, .-load_menu
	.section	.rodata
.LC6:
	.string	"%s"
	.align 8
.LC7:
	.string	"\n Error : Could not create socket "
.LC8:
	.string	"127.0.0.1"
.LC9:
	.string	"\n inet_pton error occured"
.LC10:
	.string	"\n Error : Connect Failed "
.LC11:
	.string	"\n Error : Send failed"
.LC12:
	.string	"\n Error : recv failed"
.LC13:
	.string	"receive from server: %s\n"
	.text
	.globl	socketquery
	.type	socketquery, @function
socketquery:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 1344
	mov	eax, edi
	mov	BYTE PTR -1332[rbp], al
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -1296[rbp]
	mov	rsi, rax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	DWORD PTR -1320[rbp], 0
	mov	DWORD PTR -1316[rbp], 0
	lea	rax, -1040[rbp]
	mov	edx, 1024
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -1320[rbp], eax
	cmp	DWORD PTR -1320[rbp], 0
	jns	.L12
	lea	rdi, .LC7[rip]
	call	puts@PLT
	jmp	.L11
.L12:
	lea	rax, -1312[rbp]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	WORD PTR -1312[rbp], 2
	mov	edi, 1234
	call	htons@PLT
	mov	WORD PTR -1310[rbp], ax
	lea	rax, -1312[rbp]
	add	rax, 4
	mov	rdx, rax
	lea	rsi, .LC8[rip]
	mov	edi, 2
	call	inet_pton@PLT
	test	eax, eax
	jg	.L14
	lea	rdi, .LC9[rip]
	call	puts@PLT
	jmp	.L11
.L14:
	lea	rcx, -1312[rbp]
	mov	eax, DWORD PTR -1320[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	connect@PLT
	test	eax, eax
	jns	.L15
	lea	rdi, .LC10[rip]
	call	puts@PLT
	jmp	.L11
.L15:
	lea	rsi, -1332[rbp]
	mov	eax, DWORD PTR -1320[rbp]
	mov	ecx, 0
	mov	edx, 1
	mov	edi, eax
	call	send@PLT
	test	rax, rax
	jns	.L16
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L11
.L16:
	lea	rsi, -1040[rbp]
	mov	eax, DWORD PTR -1320[rbp]
	mov	ecx, 0
	mov	edx, 1024
	mov	edi, eax
	call	recv@PLT
	test	rax, rax
	jns	.L17
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L11
.L17:
	lea	rsi, -1296[rbp]
	mov	eax, DWORD PTR -1320[rbp]
	mov	ecx, 0
	mov	edx, 256
	mov	edi, eax
	call	send@PLT
	test	rax, rax
	jns	.L18
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L11
.L18:
	lea	rsi, -1040[rbp]
	mov	eax, DWORD PTR -1320[rbp]
	mov	ecx, 0
	mov	edx, 1024
	mov	edi, eax
	call	recv@PLT
	test	rax, rax
	jns	.L19
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L11
.L19:
	lea	rsi, -1296[rbp]
	mov	eax, DWORD PTR -1320[rbp]
	mov	ecx, 0
	mov	edx, 256
	mov	edi, eax
	call	send@PLT
	test	rax, rax
	jns	.L20
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L11
.L20:
	lea	rsi, -1040[rbp]
	mov	eax, DWORD PTR -1320[rbp]
	mov	ecx, 0
	mov	edx, 1024
	mov	edi, eax
	call	recv@PLT
	test	rax, rax
	jns	.L21
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L11
.L21:
	lea	rax, -1040[rbp]
	mov	rsi, rax
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -1320[rbp]
	mov	edi, eax
	call	close@PLT
	nop
.L11:
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	socketquery, .-socketquery
	.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	"210791.c"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	bl	load_menu
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	main, .-main
	.section	.rodata
	.align	2
.LC0:
	.ascii	"What's your requirement? 1.DNS 2. QUERY 3. QUIT: \000"
	.align	2
.LC1:
	.ascii	"%d\000"
	.align	2
.LC2:
	.ascii	"Input URL address: \000"
	.align	2
.LC3:
	.ascii	"Input student ID: \000"
	.align	2
.LC4:
	.ascii	"Quitting program!\000"
	.align	2
.LC5:
	.ascii	"Invalid choice!\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	load_menu
	.syntax unified
	.arm
	.fpu softvfp
	.type	load_menu, %function
load_menu:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	ldr	r3, .L11
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
.L9:
	ldr	r0, .L11+4
	bl	printf
	sub	r3, fp, #12
	mov	r1, r3
	ldr	r0, .L11+8
	bl	__isoc99_scanf
	ldr	r3, [fp, #-12]
	cmp	r3, #3
	beq	.L4
	cmp	r3, #3
	bgt	.L5
	cmp	r3, #1
	beq	.L6
	cmp	r3, #2
	beq	.L7
	b	.L5
.L6:
	ldr	r0, .L11+12
	bl	printf
	ldr	r3, [fp, #-12]
	and	r3, r3, #255
	mov	r0, r3
	bl	socketquery
	b	.L8
.L7:
	ldr	r0, .L11+16
	bl	printf
	ldr	r3, [fp, #-12]
	and	r3, r3, #255
	mov	r0, r3
	bl	socketquery
	b	.L8
.L4:
	ldr	r0, .L11+20
	bl	puts
	mov	r0, #0
	bl	exit
.L5:
	ldr	r0, .L11+24
	bl	puts
	nop
.L8:
	ldr	r3, [fp, #-12]
	cmp	r3, #3
	bne	.L9
	nop
	ldr	r3, .L11
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L10
	bl	__stack_chk_fail
.L10:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC6
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.size	load_menu, .-load_menu
	.section	.rodata
	.align	2
.LC7:
	.ascii	"%s\000"
	.align	2
.LC8:
	.ascii	"\012 Error : Could not create socket \000"
	.align	2
.LC9:
	.ascii	"127.0.0.1\000"
	.align	2
.LC10:
	.ascii	"\012 inet_pton error occured\000"
	.align	2
.LC11:
	.ascii	"\012 Error : Connect Failed \000"
	.align	2
.LC12:
	.ascii	"\012 Error : Send failed\000"
	.align	2
.LC13:
	.ascii	"\012 Error : recv failed\000"
	.align	2
.LC14:
	.ascii	"receive from server: %s\012\000"
	.align	2
.LC15:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	socketquery
	.syntax unified
	.arm
	.fpu softvfp
	.type	socketquery, %function
socketquery:
	@ args = 0, pretend = 0, frame = 1320
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1312
	sub	sp, sp, #8
	mov	r3, r0
	strb	r3, [fp, #-1317]
	ldr	r3, .L26
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #1280
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r3
	ldr	r0, .L26+4
	bl	__isoc99_scanf
	mov	r3, #0
	str	r3, [fp, #-1312]
	mov	r3, #0
	str	r3, [fp, #-1308]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, #1024
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-1312]
	ldr	r3, [fp, #-1312]
	cmp	r3, #0
	bge	.L14
	ldr	r0, .L26+8
	bl	puts
	b	.L13
.L14:
	sub	r3, fp, #1296
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #4
	sub	r3, r3, #1296
	sub	r3, r3, #4
	mov	r2, #2
	strh	r2, [r3]	@ movhi
	ldr	r0, .L26+12
	bl	htons
	mov	r3, r0
	mov	r2, r3
	sub	r3, fp, #4
	sub	r3, r3, #1296
	sub	r3, r3, #4
	strh	r2, [r3, #2]	@ movhi
	sub	r3, fp, #1296
	sub	r3, r3, #4
	sub	r3, r3, #4
	add	r3, r3, #4
	mov	r2, r3
	ldr	r1, .L26+16
	mov	r0, #2
	bl	inet_pton
	mov	r3, r0
	cmp	r3, #0
	bgt	.L16
	ldr	r0, .L26+20
	bl	puts
	b	.L13
.L16:
	sub	r3, fp, #1296
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-1312]
	bl	connect
	mov	r3, r0
	cmp	r3, #0
	bge	.L17
	ldr	r0, .L26+24
	bl	puts
	b	.L13
.L17:
	sub	r1, fp, #1312
	sub	r1, r1, #4
	sub	r1, r1, #1
	mov	r3, #0
	mov	r2, #1
	ldr	r0, [fp, #-1312]
	bl	send
	mov	r3, r0
	cmp	r3, #0
	bge	.L18
	ldr	r0, .L26+28
	bl	printf
	b	.L13
.L18:
	sub	r1, fp, #1024
	sub	r1, r1, #4
	sub	r1, r1, #4
	mov	r3, #0
	mov	r2, #1024
	ldr	r0, [fp, #-1312]
	bl	recv
	mov	r3, r0
	cmp	r3, #0
	bge	.L19
	ldr	r0, .L26+32
	bl	printf
	b	.L13
.L19:
	sub	r1, fp, #1280
	sub	r1, r1, #4
	sub	r1, r1, #4
	mov	r3, #0
	mov	r2, #256
	ldr	r0, [fp, #-1312]
	bl	send
	mov	r3, r0
	cmp	r3, #0
	bge	.L20
	ldr	r0, .L26+28
	bl	printf
	b	.L13
.L20:
	sub	r1, fp, #1024
	sub	r1, r1, #4
	sub	r1, r1, #4
	mov	r3, #0
	mov	r2, #1024
	ldr	r0, [fp, #-1312]
	bl	recv
	mov	r3, r0
	cmp	r3, #0
	bge	.L21
	ldr	r0, .L26+32
	bl	printf
	b	.L13
.L21:
	sub	r1, fp, #1280
	sub	r1, r1, #4
	sub	r1, r1, #4
	mov	r3, #0
	mov	r2, #256
	ldr	r0, [fp, #-1312]
	bl	send
	mov	r3, r0
	cmp	r3, #0
	bge	.L22
	ldr	r0, .L26+28
	bl	printf
	b	.L13
.L22:
	sub	r1, fp, #1024
	sub	r1, r1, #4
	sub	r1, r1, #4
	mov	r3, #0
	mov	r2, #1024
	ldr	r0, [fp, #-1312]
	bl	recv
	mov	r3, r0
	cmp	r3, #0
	bge	.L23
	ldr	r0, .L26+32
	bl	printf
	b	.L13
.L23:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r3
	ldr	r0, .L26+36
	bl	printf
	ldr	r0, [fp, #-1312]
	bl	close
	nop
.L13:
	ldr	r3, .L26
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L25
	bl	__stack_chk_fail
.L25:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L27:
	.align	2
.L26:
	.word	.LC15
	.word	.LC7
	.word	.LC8
	.word	1234
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.size	socketquery, .-socketquery
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
