.file "absend.c" .version "01.01" gcc2_compiled.: .section .rodata .align 32 .LC0: .string "format: absender -[dn] rcvhost rcvportno c1host c1portno\n" .align 32 .LC1: .string " option: n set the number of messages to be sent\n" .align 32 .LC2: .string " option: d set debug mode\n" .text .align 4 .globl help_msg .type help_msg,@function help_msg: pushl %ebp movl %esp, %ebp subl $8, %esp subl $12, %esp pushl $.LC0 call printf addl $16, %esp subl $12, %esp pushl $.LC1 call printf addl $16, %esp subl $12, %esp pushl $.LC2 call printf addl $16, %esp leave ret .Lfe1: .size help_msg,.Lfe1-help_msg .section .rodata .LC3: .string " sockaddr_in: " .LC4: .string "Domain=%d, " .LC5: .string "Hostname=%s, " .LC6: .string "Port=%d, " .LC7: .string "Address=%s,\n" .text .align 4 .globl printsockaddr .type printsockaddr,@function printsockaddr: pushl %ebp movl %esp, %ebp subl $8, %esp subl $12, %esp pushl $.LC3 call printf addl $16, %esp subl $8, %esp movl 8(%ebp), %eax movzwl (%eax), %eax pushl %eax pushl $.LC4 call printf addl $16, %esp subl $4, %esp pushl $2 pushl $4 movl 8(%ebp), %eax addl $4, %eax pushl %eax call gethostbyaddr addl $16, %esp movl %eax, %eax movl %eax, -4(%ebp) subl $8, %esp movl -4(%ebp), %eax pushl (%eax) pushl $.LC5 call printf addl $16, %esp subl $8, %esp movl 8(%ebp), %eax movzwl 2(%eax), %eax subl $4, %esp pushl %eax call ntohs addl $8, %esp movl %eax, %eax movl %eax, %eax movzwl %ax, %eax pushl %eax pushl $.LC6 call printf addl $16, %esp subl $8, %esp subl $4, %esp movl 8(%ebp), %eax pushl 4(%eax) call inet_ntoa addl $8, %esp movl %eax, %eax pushl %eax pushl $.LC7 call printf addl $16, %esp leave ret .Lfe2: .size printsockaddr,.Lfe2-printsockaddr .section .rodata .LC8: .string "dn:" .align 32 .LC9: .string "The number of messages to be sent is %d\n" .LC10: .string "set debug mode on\n" .LC11: .string "unrecognized arg >%s<\n" .LC12: .string "%s: unknown host" .LC13: .string "state %d:" .LC14: .string "packet %d" .string "" .LC15: .string "Get NewData=%s\n" .LC16: .string "send D0 with msg=%s\n" .text .align 4 .globl main .type main,@function main: pushl %ebp movl %esp, %ebp subl $328, %esp movl $0, -12(%ebp) movl $1, -20(%ebp) movl $1, -308(%ebp) .p2align 2 .L5: subl $4, %esp pushl $.LC8 pushl 12(%ebp) pushl 8(%ebp) call getopt addl $16, %esp movl %eax, %eax movl %eax, -16(%ebp) cmpl $-1, -16(%ebp) jne .L7 jmp .L6 .p2align 2 .L7: movl $1, -12(%ebp) movl -16(%ebp), %eax movl %eax, -312(%ebp) cmpl $100, -312(%ebp) je .L11 cmpl $100, -312(%ebp) jg .L15 cmpl $63, -312(%ebp) je .L12 jmp .L13 .p2align 2 .L15: cmpl $110, -312(%ebp) je .L9 jmp .L13 .p2align 2 .L9: subl $12, %esp pushl optarg call atoi addl $16, %esp movl %eax, %eax movl %eax, %eax movl %eax, -304(%ebp) cmpl $0, -304(%ebp) jg .L10 movl $1, -304(%ebp) .L10: subl $8, %esp pushl -304(%ebp) pushl $.LC9 call printf addl $16, %esp jmp .L5 .p2align 2 .L11: movl $1, -20(%ebp) subl $12, %esp pushl $.LC10 call printf addl $16, %esp jmp .L5 .p2align 2 .L12: call help_msg subl $12, %esp pushl $1 call exit .p2align 2 .L13: subl $4, %esp pushl optarg pushl $.LC11 pushl stderr call fprintf addl $16, %esp call help_msg subl $12, %esp pushl $1 call exit .p2align 2 .L6: movl optind, %eax imull $4, %eax, %edx movl 12(%ebp), %eax movl (%eax,%edx), %eax movl %eax, -24(%ebp) incl optind movl optind, %eax imull $4, %eax, %edx movl 12(%ebp), %eax incl optind subl $12, %esp pushl (%eax,%edx) call atoi addl $16, %esp movl %eax, %eax movl %eax, %eax movl %eax, -28(%ebp) movl optind, %eax imull $4, %eax, %edx movl 12(%ebp), %eax movl (%eax,%edx), %eax movl %eax, -32(%ebp) incl optind movl optind, %eax imull $4, %eax, %edx movl 12(%ebp), %eax incl optind subl $12, %esp pushl (%eax,%edx) call atoi addl $16, %esp movl %eax, %eax movl %eax, %eax movl %eax, -36(%ebp) subl $8, %esp pushl $80 leal -296(%ebp), %eax pushl %eax call gethostname addl $16, %esp subl $12, %esp leal -296(%ebp), %eax pushl %eax call gethostbyname addl $16, %esp movl %eax, %eax movl %eax, -204(%ebp) cmpl $0, -204(%ebp) jne .L16 subl $4, %esp pushl -24(%ebp) pushl $.LC12 pushl stderr call fprintf addl $16, %esp subl $12, %esp pushl $2 call exit .p2align 2 .L16: subl $4, %esp movl -204(%ebp), %eax pushl 12(%eax) leal -168(%ebp), %eax addl $20, %eax pushl %eax movl -204(%ebp), %eax movl 16(%eax), %eax pushl (%eax) call bcopy addl $16, %esp movw $2, -152(%ebp) movw -198(%ebp), %ax movw %ax, -150(%ebp) movl $1, -300(%ebp) .p2align 2 .L17: movl -300(%ebp), %eax cmpl -304(%ebp), %eax jl .L20 jmp .L18 .p2align 2 .L20: subl $8, %esp pushl -308(%ebp) pushl $.LC13 call printf addl $16, %esp movl -308(%ebp), %eax movl %eax, -316(%ebp) cmpl $2, -316(%ebp) je .L23 cmpl $2, -316(%ebp) jg .L27 cmpl $1, -316(%ebp) je .L22 jmp .L17 .p2align 2 .L27: cmpl $3, -316(%ebp) je .L17 jmp .L17 .p2align 2 .L22: subl $4, %esp pushl -300(%ebp) leal -300(%ebp), %eax incl (%eax) pushl $.LC14 leal -168(%ebp), %eax addl $33, %eax pushl %eax call sprintf addl $16, %esp subl $8, %esp leal -168(%ebp), %eax addl $33, %eax pushl %eax pushl $.LC15 call printf addl $16, %esp movl $2, -308(%ebp) jmp .L17 .p2align 2 .L23: subl $8, %esp leal -168(%ebp), %eax addl $33, %eax pushl %eax pushl $.LC16 call printf addl $16, %esp movl $3, -308(%ebp) jmp .L17 .p2align 2 .L18: leave ret .Lfe3: .size main,.Lfe3-main .ident "GCC: (GNU) 2.96 20000731 (Red Hat Linux 7.2 2.96-108.7.2)"