// File: /workspace/github_cpp_makefile_star2_O2/allardlamberink[P]fritz-curl/fritz-curl.cpp
// Function: main
int main(int argc, char* argv[]) { 
	if (argc < 2)
	{
		cout << "Fritz-cURL version 0.1" << endl;
		cout << "No arguments given, example usage:" << endl;
		cout << "wlan24 0 (switch wlan 2.4 GHz off" << endl;
		cout << "wlan24 1 (switch wlan 2.4 GHz on" << endl;
		cout << "wlan24 2 (return wlan 2.4 GHz status" << endl;
	}
	if (argc == 3)
	{
		string functionname, argname, upnpaction, urn = "";
		upnpaction = "/upnp/control/wlanconfig1"; // currently only wlan support
		urn = "urn:dslforum-org:service:WLANConfiguration:1"; //=serviceType and !ID
		switch(argv[2][0])
		{
			case '0':
			       	functionname = "SetEnable";
			 	argname = "<NewEnable>0</NewEnable>";
				break;
			case '1':
			       	functionname = "SetEnable";
			 	argname = "<NewEnable>1</NewEnable>";
				break;
			case '2':
			       	functionname = "GetInfo";
			 	argname = "";
				break;
		}

		const string runningpath = argv[0];
		const string settingsfullpath = runningpath.substr(0,runningpath.find_last_of("/")) + "/settings.xml";

		string settingsstr = "";
		/* read settings file */
		try
	        {
			readfile(settingsfullpath, settingsstr);
		}
		catch (std::exception &e)
		{
			perror("Error loading settings file, make sure settings.xml exists and is readable. Original errormessage: ");
		}

		/* initialize variables */ 
	        if(settingsstr.empty())
		{
			perror("Error loading settings file, make sure settings.xml exists, is readable and is not empty.");
			return 1;
		}

		string fbuser = getXmlProp(settingsstr, "settings.fbuser");
		string fbpwd = getXmlProp(settingsstr, "settings.fbpwd");
		string fburl = "http://" + getXmlProp(settingsstr, "settings.fburl");
		string fbport = getXmlProp(settingsstr, "settings.fbport");
		string debugstr = getXmlProp(settingsstr, "settings.debug");
		bDebug = debugstr == "True";

		if(bDebug) cout << "functionname=" << functionname << " and argname=" << argname << endl;

		// if the fritzbox is password protected, then first an initchallenge needs to be sent in order to get the Nonce and the Realm

		string initdata="<?xml version=\"1.0\" encoding=\"utf-8\"?> <s:Envelope s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"><s:Header><h:InitChallenge xmlns:h=\"http://soap-authentication.org/digest/2001/10/\" s:mustUnderstand=\"1\"><UserID>" + fbuser + "</UserID></h:InitChallenge></s:Header><s:Body><u:" + functionname + " xmlns:u=\"" + urn + "\"></u:" + functionname + "></s:Body></s:Envelope>";

		if (bDebug)
		{	
		    cout << "sending initdata=" + initdata + "\r\n\r\n" << endl;
		}

		/* send the initdata using curl */
		string out = executeCurlAction(fburl, fbport, upnpaction, urn, functionname, initdata);
		if (bDebug)
		{
			cout << "result = " + out << endl;
		}	

		/* read the nonce and realm from the curlaction result */
		string nonce = getXmlProp(out, "s:Envelope.s:Header.h:Challenge.Nonce");
		string realm = getXmlProp(out, "s:Envelope.s:Header.h:Challenge.Realm");
		if (bDebug)
		{
			fprintf(stdout, "\r\n\r\nAllard:nonce=%s en realm=%s \r\n\r\n", nonce.c_str(), realm.c_str());
		}

		string authstr=fbuser + ":" + realm + ":" + fbpwd;
		string md5authstr=getmd5sum(authstr);
		string auth = getmd5sum(md5authstr + ":" + nonce);
		
		if (bDebug)
		{
			cout << "sending part2" << endl;
		}

		string actiondata="<?xml version=\"1.0\" encoding=\"utf-8\"?> <s:Envelope s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"><s:Header><h:ClientAuth xmlns:h=\"http://soap-authentication.org/digest/2001/10/\" s:mustUnderstand=\"1\"><Nonce>" + nonce + "</Nonce><Auth>" + auth + "</Auth><UserID>" + fbuser + "</UserID><Realm>" + realm + "</Realm></h:ClientAuth></s:Header><s:Body><u:" + functionname + " xmlns:u=\"" + urn + "\">" + argname + "</u:" + functionname + "></s:Body></s:Envelope>";

		out = executeCurlAction(fburl, fbport, upnpaction, urn, functionname, actiondata);

		// TODO: read the new nonce
		// TODO: read out the new WLAN status to verify whether the command was executed successfully or not
		// example: cout << "callist url=" + getXmlProp(out, "s:Envelope.s:Body.u:GetCallListResponse.NewCallListURL") << endl;
		//
		// TODO: cleanup all used variables / objects!!! 
		// TODO: add support for security port
	}
	else
	{ //other than 3 arguments, do nothing
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x7e8, %rsp            # imm = 0x7E8
cmpl $0x1, %edi
jg 0x4d0b
movq 0x12335(%rip), %rbx     # 0x16fc8
leaq 0xa458(%rip), %rsi      # 0xf0f2
movq %rbx, %rdi
callq 0x42a0
movq %rax, %rdi
callq 0x4440
leaq 0xa458(%rip), %rsi      # 0xf109
movq %rbx, %rdi
callq 0x42a0
movq %rax, %rdi
callq 0x4440
leaq 0xa464(%rip), %rsi      # 0xf12c
movq %rbx, %rdi
callq 0x42a0
movq %rax, %rdi
callq 0x4440
leaq 0xa46f(%rip), %rsi      # 0xf14e
movq %rbx, %rdi
callq 0x42a0
movq %rax, %rdi
callq 0x4440
leaq 0xa479(%rip), %rsi      # 0xf16f
movq %rbx, %rdi
callq 0x42a0
movq %rax, %rdi
callq 0x4440
jmp 0x59f1
cmpl $0x3, %edi
jne 0x59f1
movq %rsi, %rbx
leaq -0xa8(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
leaq -0x248(%rbp), %rdx
movq %rdx, -0x10(%rdx)
andq $0x0, -0x8(%rdx)
movb %cl, (%rax)
movb %cl, (%rdx)
leaq -0x228(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq 0xa808(%rip), %r14      # 0xf55e
leaq -0x178(%rbp), %rdi
leaq -0x2b8(%rbp), %rdx
movq %r14, %rsi
callq 0x6058
leaq 0xa421(%rip), %rsi      # 0xf194
leaq -0x238(%rbp), %rdi
callq 0x4490
leaq 0xa428(%rip), %rsi      # 0xf1ae
leaq -0x178(%rbp), %rdi
callq 0x4490
movq 0x10(%rbx), %rax
movzbl (%rax), %eax
cmpl $0x30, %eax
je 0x4dd9
cmpl $0x31, %eax
je 0x4dbd
cmpl $0x32, %eax
jne 0x4e02
leaq 0xa468(%rip), %rsi      # 0xf217
leaq -0xb8(%rbp), %rdi
callq 0x4490
jmp 0x4df3
leaq 0xa417(%rip), %rsi      # 0xf1db
leaq -0xb8(%rbp), %rdi
callq 0x4490
leaq 0xa427(%rip), %r14      # 0xf1fe
jmp 0x4df3
leaq 0xa3fb(%rip), %rsi      # 0xf1db
leaq -0xb8(%rbp), %rdi
callq 0x4490
leaq 0xa3f2(%rip), %r14      # 0xf1e5
leaq -0x258(%rbp), %rdi
movq %r14, %rsi
callq 0x4490
movq (%rbx), %rsi
leaq -0x2b8(%rbp), %rdi
leaq -0x298(%rbp), %rdx
callq 0x6058
leaq 0xa4f1(%rip), %rsi      # 0xf310
leaq -0x2b8(%rbp), %rbx
pushq $-0x1
popq %rdx
movq %rbx, %rdi
callq 0x4400
leaq -0x98(%rbp), %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x4430
leaq 0xa3d3(%rip), %rdx      # 0xf21f
leaq -0x298(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x60f4
leaq -0x98(%rbp), %rdi
callq 0x44c0
leaq 0xa6ec(%rip), %rsi      # 0xf55e
leaq -0x98(%rbp), %rdi
leaq -0x198(%rbp), %rdx
callq 0x6058
leaq -0x298(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x461c
movq -0x90(%rbp), %r15
testq %r15, %r15
je 0x5a06
leaq -0x7b8(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x4280
leaq 0xa429(%rip), %rsi      # 0xf2eb
leaq -0x798(%rbp), %rdi
leaq -0x278(%rbp), %rdx
callq 0x6058
leaq -0x198(%rbp), %rdi
leaq -0x7b8(%rbp), %rsi
leaq -0x798(%rbp), %rdx
callq 0x4aea
leaq -0x798(%rbp), %rdi
callq 0x44c0
leaq -0x7b8(%rbp), %rdi
callq 0x44c0
leaq -0x778(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x4280
leaq 0xa3da(%rip), %rsi      # 0xf2fb
leaq -0x758(%rbp), %rdi
leaq -0x218(%rbp), %rdx
callq 0x6058
leaq -0x278(%rbp), %rdi
leaq -0x778(%rbp), %rsi
leaq -0x758(%rbp), %rdx
callq 0x4aea
leaq -0x758(%rbp), %rdi
callq 0x44c0
leaq -0x778(%rbp), %rdi
callq 0x44c0
leaq -0x738(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x4280
leaq 0xa392(%rip), %rsi      # 0xf312
leaq -0x718(%rbp), %rdi
leaq -0x1f8(%rbp), %rdx
callq 0x6058
leaq -0x158(%rbp), %rdi
leaq -0x738(%rbp), %rsi
leaq -0x718(%rbp), %rdx
callq 0x4aea
leaq 0xa356(%rip), %rsi      # 0xf30a
leaq -0x218(%rbp), %rdi
leaq -0x158(%rbp), %rdx
callq 0x62c3
leaq -0x158(%rbp), %rdi
callq 0x44c0
leaq -0x718(%rbp), %rdi
callq 0x44c0
leaq -0x738(%rbp), %rdi
callq 0x44c0
leaq -0x6f8(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x4280
leaq 0xa31c(%rip), %rsi      # 0xf321
leaq -0x6d8(%rbp), %rdi
leaq -0x1f8(%rbp), %rdx
callq 0x6058
leaq -0x158(%rbp), %rdi
leaq -0x6f8(%rbp), %rsi
leaq -0x6d8(%rbp), %rdx
callq 0x4aea
leaq -0x6d8(%rbp), %rdi
callq 0x44c0
leaq -0x6f8(%rbp), %rdi
callq 0x44c0
leaq -0x6b8(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x4280
leaq 0xa2cd(%rip), %rsi      # 0xf331
leaq -0x698(%rbp), %rdi
leaq -0x1d8(%rbp), %rdx
callq 0x6058
leaq -0x1f8(%rbp), %rdi
leaq -0x6b8(%rbp), %rsi
leaq -0x698(%rbp), %rdx
callq 0x4aea
leaq -0x698(%rbp), %rdi
callq 0x44c0
leaq -0x6b8(%rbp), %rdi
callq 0x44c0
leaq 0xa290(%rip), %rsi      # 0xf340
leaq -0x1f8(%rbp), %rdi
callq 0x62f1
movb %al, 0x121c2(%rip)      # 0x17284
testb %al, %al
je 0x510e
movq 0x11efb(%rip), %rdi     # 0x16fc8
leaq 0xa271(%rip), %rsi      # 0xf345
callq 0x42a0
leaq -0xb8(%rbp), %rsi
movq %rax, %rdi
callq 0x4150
leaq 0xa264(%rip), %rsi      # 0xf353
movq %rax, %rdi
callq 0x42a0
leaq -0x258(%rbp), %rsi
movq %rax, %rdi
callq 0x4150
movq %rax, %rdi
callq 0x4440
leaq 0xa24c(%rip), %rsi      # 0xf361
leaq -0x58(%rbp), %rdi
leaq -0x198(%rbp), %rdx
callq 0x611d
leaq 0xa34a(%rip), %rdx      # 0xf476
leaq -0xd8(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x60f4
leaq -0xf8(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
leaq -0xb8(%rbp), %rdx
callq 0x6093
leaq 0xa34b(%rip), %rdx      # 0xf4a8
leaq -0x138(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x60f4
leaq -0x118(%rbp), %rdi
leaq -0x138(%rbp), %rsi
leaq -0x178(%rbp), %rdx
callq 0x6093
leaq 0xa322(%rip), %rdx      # 0xf4b3
leaq -0x38(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x60f4
leaq -0x78(%rbp), %rdi
leaq -0x38(%rbp), %rsi
leaq -0xb8(%rbp), %rdx
callq 0x6093
leaq 0xa2fe(%rip), %rdx      # 0xf4ba
leaq -0x1d8(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x60f4
leaq -0x78(%rbp), %rdi
callq 0x44c0
leaq -0x38(%rbp), %rdi
callq 0x44c0
leaq -0x118(%rbp), %rdi
callq 0x44c0
leaq -0x138(%rbp), %rdi
callq 0x44c0
leaq -0xf8(%rbp), %rdi
callq 0x44c0
leaq -0xd8(%rbp), %rdi
callq 0x44c0
leaq -0x58(%rbp), %rdi
callq 0x44c0
cmpb $0x1, 0x12066(%rip)     # 0x17284
jne 0x5275
leaq 0xa2ab(%rip), %rsi      # 0xf4d2
leaq -0x38(%rbp), %rdi
leaq -0x1d8(%rbp), %rdx
callq 0x611d
leaq 0xa31c(%rip), %rdx      # 0xf55a
leaq -0x78(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x60f4
movq 0x11d76(%rip), %rdi     # 0x16fc8
leaq -0x78(%rbp), %rsi
callq 0x4150
movq %rax, %rdi
callq 0x4440
leaq -0x78(%rbp), %rdi
callq 0x44c0
leaq -0x38(%rbp), %rdi
callq 0x44c0
leaq -0x678(%rbp), %rdi
leaq -0x218(%rbp), %rsi
callq 0x4280
leaq -0x658(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x4280
leaq -0x638(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0x4280
leaq -0x618(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0x4280
leaq -0x5f8(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x4280
leaq -0x7f8(%rbp), %rbx
leaq -0x1d8(%rbp), %rsi
movq %rbx, %rdi
callq 0x4280
movq %rbx, (%rsp)
leaq -0x78(%rbp), %rdi
leaq -0x678(%rbp), %rsi
leaq -0x658(%rbp), %rdx
leaq -0x638(%rbp), %rcx
leaq -0x618(%rbp), %r8
leaq -0x5f8(%rbp), %r9
callq 0x47a2
leaq -0x7f8(%rbp), %rdi
callq 0x44c0
leaq -0x5f8(%rbp), %rdi
callq 0x44c0
leaq -0x618(%rbp), %rdi
callq 0x44c0
leaq -0x638(%rbp), %rdi
callq 0x44c0
leaq -0x658(%rbp), %rdi
callq 0x44c0
leaq -0x678(%rbp), %rdi
callq 0x44c0
cmpb $0x1, 0x11f1b(%rip)     # 0x17284
jne 0x53a0
leaq 0xa172(%rip), %rsi      # 0xf4e4
leaq -0x38(%rbp), %rdi
leaq -0x78(%rbp), %rdx
callq 0x611d
movq 0x11c42(%rip), %rdi     # 0x16fc8
leaq -0x38(%rbp), %rsi
callq 0x4150
movq %rax, %rdi
callq 0x4440
leaq -0x38(%rbp), %rdi
callq 0x44c0
leaq -0x5d8(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x4280
leaq 0xa137(%rip), %rsi      # 0xf4ee
leaq -0x5b8(%rbp), %rdi
leaq -0x118(%rbp), %rdx
callq 0x6058
leaq -0x38(%rbp), %rdi
leaq -0x5d8(%rbp), %rsi
leaq -0x5b8(%rbp), %rdx
callq 0x4aea
leaq -0x5b8(%rbp), %rdi
callq 0x44c0
leaq -0x5d8(%rbp), %rdi
callq 0x44c0
leaq -0x598(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x4280
leaq 0xa104(%rip), %rsi      # 0xf514
leaq -0x578(%rbp), %rdi
leaq -0x138(%rbp), %rdx
callq 0x6058
leaq -0x118(%rbp), %rdi
leaq -0x598(%rbp), %rsi
leaq -0x578(%rbp), %rdx
callq 0x4aea
leaq -0x578(%rbp), %rdi
callq 0x44c0
leaq -0x598(%rbp), %rdi
callq 0x44c0
cmpb $0x1, 0x11e28(%rip)     # 0x17284
jne 0x5481
movq 0x11b6b(%rip), %rax     # 0x16fd0
movq (%rax), %rdi
movq -0x38(%rbp), %rdx
movq -0x118(%rbp), %rcx
leaq 0xa0c0(%rip), %rsi      # 0xf53a
xorl %eax, %eax
callq 0x4110
leaq 0x9ca2(%rip), %rdx      # 0xf12a
leaq -0x58(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x60bc
leaq -0xd8(%rbp), %rdi
leaq -0x58(%rbp), %rsi
leaq -0x118(%rbp), %rdx
callq 0x6093
leaq 0x9c74(%rip), %rdx      # 0xf12a
leaq -0xf8(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x60f4
leaq -0x138(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
leaq -0x278(%rbp), %rdx
callq 0x6093
leaq -0xf8(%rbp), %rdi
callq 0x44c0
leaq -0xd8(%rbp), %rdi
callq 0x44c0
leaq -0x58(%rbp), %rdi
callq 0x44c0
leaq -0x558(%rbp), %rdi
leaq -0x138(%rbp), %rsi
callq 0x4280
leaq -0xf8(%rbp), %rdi
leaq -0x558(%rbp), %rsi
callq 0x46ff
leaq -0x558(%rbp), %rdi
callq 0x44c0
leaq 0x9bed(%rip), %rdx      # 0xf12a
leaq -0x58(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x60bc
leaq -0x538(%rbp), %rdi
leaq -0x58(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x6093
leaq -0xd8(%rbp), %rdi
leaq -0x538(%rbp), %rsi
callq 0x46ff
leaq -0x538(%rbp), %rdi
callq 0x44c0
leaq -0x58(%rbp), %rdi
callq 0x44c0
cmpb $0x1, 0x11cf4(%rip)     # 0x17284
jne 0x55ad
movq 0x11a2f(%rip), %rdi     # 0x16fc8
leaq 0x9fbf(%rip), %rsi      # 0xf55f
callq 0x42a0
movq %rax, %rdi
callq 0x4440
leaq 0x9fb9(%rip), %rsi      # 0xf56d
leaq -0x378(%rbp), %rdi
leaq -0x38(%rbp), %rdx
callq 0x611d
leaq 0xa0b3(%rip), %rdx      # 0xf67e
leaq -0x398(%rbp), %rdi
leaq -0x378(%rbp), %rsi
callq 0x60f4
leaq -0x3b8(%rbp), %rdi
leaq -0x398(%rbp), %rsi
leaq -0xd8(%rbp), %rdx
callq 0x6093
leaq 0xa08e(%rip), %rdx      # 0xf68d
leaq -0x3d8(%rbp), %rdi
leaq -0x3b8(%rbp), %rsi
callq 0x60f4
leaq -0x3f8(%rbp), %rdi
leaq -0x3d8(%rbp), %rsi
leaq -0x198(%rbp), %rdx
callq 0x6093
leaq 0xa06a(%rip), %rdx      # 0xf69d
leaq -0x418(%rbp), %rdi
leaq -0x3f8(%rbp), %rsi
callq 0x60f4
leaq -0x438(%rbp), %rdi
leaq -0x418(%rbp), %rsi
leaq -0x118(%rbp), %rdx
callq 0x6093
leaq 0xa047(%rip), %rdx      # 0xf6ae
leaq -0x458(%rbp), %rdi
leaq -0x438(%rbp), %rsi
callq 0x60f4
leaq -0x478(%rbp), %rdi
leaq -0x458(%rbp), %rsi
leaq -0xb8(%rbp), %rdx
callq 0x6093
leaq 0x9e0d(%rip), %rdx      # 0xf4a8
leaq -0x498(%rbp), %rdi
leaq -0x478(%rbp), %rsi
callq 0x60f4
leaq -0x4b8(%rbp), %rdi
leaq -0x498(%rbp), %rsi
leaq -0x178(%rbp), %rdx
callq 0x6093
leaq 0xa00d(%rip), %rdx      # 0xf6dc
leaq -0x4d8(%rbp), %rdi
leaq -0x4b8(%rbp), %rsi
callq 0x60f4
leaq -0x4f8(%rbp), %rdi
leaq -0x4d8(%rbp), %rsi
leaq -0x258(%rbp), %rdx
callq 0x6093
leaq 0x9db2(%rip), %rdx      # 0xf4b5
leaq -0x518(%rbp), %rdi
leaq -0x4f8(%rbp), %rsi
callq 0x60f4
leaq -0x1b8(%rbp), %rdi
leaq -0x518(%rbp), %rsi
leaq -0xb8(%rbp), %rdx
callq 0x6093
leaq 0x9d83(%rip), %rdx      # 0xf4ba
leaq -0x58(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x60f4
leaq -0x1b8(%rbp), %rdi
callq 0x44c0
leaq -0x518(%rbp), %rdi
callq 0x44c0
leaq -0x4f8(%rbp), %rdi
callq 0x44c0
leaq -0x4d8(%rbp), %rdi
callq 0x44c0
leaq -0x4b8(%rbp), %rdi
callq 0x44c0
leaq -0x498(%rbp), %rdi
callq 0x44c0
leaq -0x478(%rbp), %rdi
callq 0x44c0
leaq -0x458(%rbp), %rdi
callq 0x44c0
leaq -0x438(%rbp), %rdi
callq 0x44c0
leaq -0x418(%rbp), %rdi
callq 0x44c0
leaq -0x3f8(%rbp), %rdi
callq 0x44c0
leaq -0x3d8(%rbp), %rdi
callq 0x44c0
leaq -0x3b8(%rbp), %rdi
callq 0x44c0
leaq -0x398(%rbp), %rdi
callq 0x44c0
leaq -0x378(%rbp), %rdi
callq 0x44c0
leaq -0x358(%rbp), %rdi
leaq -0x218(%rbp), %rsi
callq 0x4280
leaq -0x338(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x4280
leaq -0x318(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0x4280
leaq -0x2f8(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0x4280
leaq -0x2d8(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x4280
leaq -0x7d8(%rbp), %rbx
leaq -0x58(%rbp), %rsi
movq %rbx, %rdi
callq 0x4280
movq %rbx, (%rsp)
leaq -0x1b8(%rbp), %rdi
leaq -0x358(%rbp), %rsi
leaq -0x338(%rbp), %rdx
leaq -0x318(%rbp), %rcx
leaq -0x2f8(%rbp), %r8
leaq -0x2d8(%rbp), %r9
callq 0x47a2
leaq -0x78(%rbp), %rbx
leaq -0x1b8(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4270
movq %r14, %rdi
callq 0x44c0
leaq -0x7d8(%rbp), %rdi
callq 0x44c0
leaq -0x2d8(%rbp), %rdi
callq 0x44c0
leaq -0x2f8(%rbp), %rdi
callq 0x44c0
leaq -0x318(%rbp), %rdi
callq 0x44c0
leaq -0x338(%rbp), %rdi
callq 0x44c0
leaq -0x358(%rbp), %rdi
callq 0x44c0
leaq -0x58(%rbp), %rdi
callq 0x44c0
leaq -0xd8(%rbp), %rdi
callq 0x44c0
leaq -0xf8(%rbp), %rdi
callq 0x44c0
leaq -0x138(%rbp), %rdi
callq 0x44c0
leaq -0x118(%rbp), %rdi
callq 0x44c0
leaq -0x38(%rbp), %rdi
callq 0x44c0
movq %rbx, %rdi
callq 0x44c0
leaq -0x1d8(%rbp), %rdi
callq 0x44c0
leaq -0x1f8(%rbp), %rdi
callq 0x44c0
leaq -0x158(%rbp), %rdi
callq 0x44c0
leaq -0x218(%rbp), %rdi
callq 0x44c0
leaq -0x278(%rbp), %rdi
callq 0x44c0
leaq -0x198(%rbp), %rdi
callq 0x44c0
leaq -0x98(%rbp), %rdi
callq 0x44c0
leaq -0x298(%rbp), %rdi
callq 0x44c0
leaq -0x2b8(%rbp), %rdi
callq 0x44c0
leaq -0x178(%rbp), %rdi
callq 0x44c0
leaq -0x238(%rbp), %rdi
callq 0x44c0
leaq -0x258(%rbp), %rdi
callq 0x44c0
leaq -0xb8(%rbp), %rdi
callq 0x44c0
testq %r15, %r15
je 0x5a01
xorl %eax, %eax
addq $0x7e8, %rsp            # imm = 0x7E8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x1
popq %rax
jmp 0x59f3
leaq 0x9884(%rip), %rdi      # 0xf291
callq 0x4140
jmp 0x5998
jmp 0x5d57
movq %rax, %rbx
jmp 0x5dd7
jmp 0x5de0
movq %rax, %rbx
leaq -0x7d8(%rbp), %rdi
callq 0x44c0
jmp 0x5a3a
movq %rax, %rbx
leaq -0x2d8(%rbp), %rdi
callq 0x44c0
jmp 0x5a4b
movq %rax, %rbx
leaq -0x2f8(%rbp), %rdi
callq 0x44c0
jmp 0x5a5c
movq %rax, %rbx
leaq -0x318(%rbp), %rdi
callq 0x44c0
jmp 0x5a6d
movq %rax, %rbx
leaq -0x338(%rbp), %rdi
callq 0x44c0
leaq -0x358(%rbp), %rdi
callq 0x44c0
leaq -0x58(%rbp), %rdi
jmp 0x5b5e
movq %rax, %rbx
jmp 0x5a79
movq %rax, %rbx
jmp 0x5a85
movq %rax, %rbx
leaq -0x1b8(%rbp), %rdi
callq 0x44c0
jmp 0x5aac
movq %rax, %rbx
leaq -0x518(%rbp), %rdi
callq 0x44c0
jmp 0x5abd
movq %rax, %rbx
leaq -0x4f8(%rbp), %rdi
callq 0x44c0
jmp 0x5ace
movq %rax, %rbx
leaq -0x4d8(%rbp), %rdi
callq 0x44c0
jmp 0x5adf
movq %rax, %rbx
leaq -0x4b8(%rbp), %rdi
callq 0x44c0
leaq -0x498(%rbp), %rdi
callq 0x44c0
leaq -0x478(%rbp), %rdi
callq 0x44c0
leaq -0x458(%rbp), %rdi
callq 0x44c0
leaq -0x438(%rbp), %rdi
callq 0x44c0
leaq -0x418(%rbp), %rdi
callq 0x44c0
leaq -0x3f8(%rbp), %rdi
callq 0x44c0
leaq -0x3d8(%rbp), %rdi
callq 0x44c0
leaq -0x3b8(%rbp), %rdi
callq 0x44c0
leaq -0x398(%rbp), %rdi
callq 0x44c0
leaq -0x378(%rbp), %rdi
callq 0x44c0
leaq -0xd8(%rbp), %rdi
callq 0x44c0
leaq -0xf8(%rbp), %rdi
callq 0x44c0
leaq -0x138(%rbp), %rdi
callq 0x44c0
leaq -0x118(%rbp), %rdi
callq 0x44c0
leaq -0x38(%rbp), %rdi
callq 0x44c0
leaq -0x78(%rbp), %rdi
callq 0x44c0
leaq -0x1d8(%rbp), %rdi
callq 0x44c0
leaq -0x1f8(%rbp), %rdi
callq 0x44c0
leaq -0x158(%rbp), %rdi
callq 0x44c0
leaq -0x218(%rbp), %rdi
callq 0x44c0
leaq -0x278(%rbp), %rdi
callq 0x44c0
leaq -0x198(%rbp), %rdi
callq 0x44c0
leaq -0x98(%rbp), %rdi
callq 0x44c0
leaq -0x298(%rbp), %rdi
callq 0x44c0
leaq -0x2b8(%rbp), %rdi
callq 0x44c0
leaq -0x178(%rbp), %rdi
callq 0x44c0
leaq -0x238(%rbp), %rdi
callq 0x44c0
leaq -0x258(%rbp), %rdi
callq 0x44c0
leaq -0xb8(%rbp), %rdi
callq 0x44c0
movq %rbx, %rdi
callq 0x42e0
movq %rax, %rbx
jmp 0x5aeb
movq %rax, %rbx
jmp 0x5af7
movq %rax, %rbx
jmp 0x5b03
movq %rax, %rbx
jmp 0x5b0f
movq %rax, %rbx
jmp 0x5b1b
movq %rax, %rbx
jmp 0x5b27
movq %rax, %rbx
jmp 0x5b33
movq %rax, %rbx
jmp 0x5b3f
movq %rax, %rbx
jmp 0x5b4b
movq %rax, %rbx
jmp 0x5b57
jmp 0x5c9b
movq %rax, %rbx
jmp 0x5b63
movq %rax, %rbx
leaq -0x538(%rbp), %rdi
callq 0x44c0
jmp 0x5cb7
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
jmp 0x5b6a
movq %rax, %rbx
jmp 0x5b6f
movq %rax, %rbx
leaq -0x558(%rbp), %rdi
jmp 0x5b76
movq %rax, %rbx
jmp 0x5b7b
movq %rax, %rbx
leaq -0xf8(%rbp), %rdi
callq 0x44c0
jmp 0x5cf3
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
callq 0x44c0
jmp 0x5d04
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
jmp 0x5b82
movq %rax, %rbx
jmp 0x5b87
movq %rax, %rbx
leaq -0x578(%rbp), %rdi
callq 0x44c0
jmp 0x5d29
movq %rax, %rbx
leaq -0x598(%rbp), %rdi
jmp 0x5b8e
jmp 0x5d5f
movq %rax, %rbx
leaq -0x5b8(%rbp), %rdi
callq 0x44c0
jmp 0x5d4b
movq %rax, %rbx
leaq -0x5d8(%rbp), %rdi
jmp 0x5b97
movq %rax, %rbx
jmp 0x5b9c
movq %rax, %rbx
jmp 0x5b93
movq %rax, %rbx
leaq -0x7f8(%rbp), %rdi
callq 0x44c0
jmp 0x5d7b
movq %rax, %rbx
leaq -0x5f8(%rbp), %rdi
callq 0x44c0
jmp 0x5d8c
movq %rax, %rbx
leaq -0x618(%rbp), %rdi
callq 0x44c0
jmp 0x5d9d
movq %rax, %rbx
leaq -0x638(%rbp), %rdi
callq 0x44c0
jmp 0x5dae
movq %rax, %rbx
leaq -0x658(%rbp), %rdi
callq 0x44c0
leaq -0x678(%rbp), %rdi
jmp 0x5ba0
movq %rax, %rbx
jmp 0x5dba
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x44c0
leaq -0x38(%rbp), %rdi
jmp 0x5ba0
movq %rax, %rbx
jmp 0x5ba5
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x44c0
jmp 0x5df9
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x44c0
jmp 0x5e07
movq %rax, %rbx
leaq -0x118(%rbp), %rdi
callq 0x44c0
jmp 0x5e18
movq %rax, %rbx
leaq -0x138(%rbp), %rdi
callq 0x44c0
jmp 0x5e29
movq %rax, %rbx
leaq -0xf8(%rbp), %rdi
callq 0x44c0
leaq -0xd8(%rbp), %rdi
callq 0x44c0
leaq -0x58(%rbp), %rdi
jmp 0x5bac
movq %rax, %rbx
jmp 0x5e35
movq %rax, %rbx
jmp 0x5e41
jmp 0x5f87
movq %rax, %rbx
leaq -0x698(%rbp), %rdi
callq 0x44c0
jmp 0x5e6d
movq %rax, %rbx
leaq -0x6b8(%rbp), %rdi
jmp 0x5bb8
movq %rax, %rbx
jmp 0x5bbd
movq %rax, %rbx
leaq -0x6d8(%rbp), %rdi
callq 0x44c0
jmp 0x5e95
movq %rax, %rbx
leaq -0x6f8(%rbp), %rdi
jmp 0x5bc4
movq %rax, %rbx
jmp 0x5bc9
movq %rax, %rbx
leaq -0x158(%rbp), %rdi
callq 0x44c0
jmp 0x5ebd
movq %rax, %rbx
leaq -0x718(%rbp), %rdi
callq 0x44c0
jmp 0x5ece
movq %rax, %rbx
leaq -0x738(%rbp), %rdi
jmp 0x5bd0
movq %rax, %rbx
jmp 0x5bd5
movq %rax, %rbx
leaq -0x758(%rbp), %rdi
callq 0x44c0
jmp 0x5ef6
movq %rax, %rbx
leaq -0x778(%rbp), %rdi
jmp 0x5bdc
movq %rax, %rbx
jmp 0x5be1
movq %rax, %rbx
leaq -0x798(%rbp), %rdi
callq 0x44c0
jmp 0x5f1e
movq %rax, %rbx
leaq -0x7b8(%rbp), %rdi
jmp 0x5be8
movq %rax, %rbx
jmp 0x5bed
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x5bed
movq %rbx, %rdi
callq 0x4070
leaq 0x92e0(%rip), %rdi      # 0xf22d
callq 0x4140
callq 0x4340
jmp 0x4e98
jmp 0x5f2a
movq %rax, %rbx
jmp 0x5bf9
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
jmp 0x5c00
movq %rax, %rbx
jmp 0x5c05
jmp 0x5f8f
movq %rax, %rbx
jmp 0x5c1d
movq %rax, %rbx
jmp 0x5bb1
movq %rax, %rbx
jmp 0x5c11
nop