// File: jasmeet13n[P]HTTP-Proxy-Server-Client/client.cpp
// Function: get_filename(char*)
char *get_filename(char *qq){
	char *name = (char *)malloc(512*sizeof(char));
	int k=0;
	int last = 0;
	int i=0;
	int len = strlen(qq);
	while(i < len){
		if(qq[i]=='/')
			last = i;
		i++;
	}
	if(last!=0){
		memcpy(name,&qq[last+1],(len-last-1));
		name[len-last]='\0';
	}
	if(strlen(name)==0){
		name[k++]='i';name[k++]='n';name[k++]='d';name[k++]='e';name[k++]='x';name[k++]='.';		// if filename cannot be extracted, set default name to index.html
		name[k++]='h';name[k++]='t';name[k++]='m';name[k++]='l';name[k]='\0';
		return name;
	}
	return name;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl $0x200, %edi            # imm = 0x200
callq 0x2200
movq %rax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x10(%rbp), %rdi
callq 0x20a0
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x2925
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2f, %eax
jne 0x291a
movl -0x24(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x28fb
cmpl $0x0, -0x20(%rbp)
je 0x2960
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x20(%rbp), %eax
addl $0x1, %eax
cltq
addq %rax, %rsi
movl -0x28(%rbp), %eax
subl -0x20(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rdx
callq 0x2130
movq -0x18(%rbp), %rax
movl -0x28(%rbp), %ecx
subl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
movq -0x18(%rbp), %rdi
callq 0x20a0
cmpq $0x0, %rax
jne 0x2a65
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
movb $0x69, (%rax,%rcx)
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
movb $0x6e, (%rax,%rcx)
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
movb $0x64, (%rax,%rcx)
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
movb $0x65, (%rax,%rcx)
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
movb $0x78, (%rax,%rcx)
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
movb $0x2e, (%rax,%rcx)
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
movb $0x68, (%rax,%rcx)
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
movb $0x74, (%rax,%rcx)
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
movb $0x6d, (%rax,%rcx)
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
movb $0x6c, (%rax,%rcx)
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x2a6d
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)