#region Local Var
	var uLocal_0 = 0;
	var uLocal_1 = 0;
	int iLocal_2 = 0;
	int iLocal_3 = 0;
	int iLocal_4 = 0;
	int iLocal_5 = 0;
	int iLocal_6 = 0;
	int iLocal_7 = 0;
	int iLocal_8 = 0;
	int iLocal_9 = 0;
	int iLocal_10 = 0;
	int iLocal_11 = 0;
	var uLocal_12 = 0;
	var uLocal_13 = 0;
	float fLocal_14 = 0f;
	var uLocal_15 = 0;
	var uLocal_16 = 0;
	int iLocal_17 = 0;
	int iLocal_18 = 0;
	int iLocal_19[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
	int iLocal_32 = 0;
	int iLocal_33 = 0;
	int iLocal_34 = 0;
	int iLocal_35 = 0;
	var uLocal_36 = 0;
	int iLocal_37 = 0;
	int iLocal_38 = 0;
	int iLocal_39 = 0;
	int iLocal_40 = 0;
	int iLocal_41 = 0;
	int iLocal_42 = 0;
	int iLocal_43 = 0;
	int iLocal_44 = 0;
	var uLocal_45 = 0;
	struct<16> Local_46 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } ;
	struct<6> Local_62[19];
	struct<16> Local_177[19];
	int iLocal_482 = 0;
	vector3 vLocal_483 = { 0f, 0f, 0f };
	vector3 vLocal_486 = { 0f, 0f, 0f };
	int iLocal_489 = 0;
	int iLocal_490 = 0;
	int iLocal_491 = 0;
	int iLocal_492 = 0;
	int iLocal_493 = 0;
	struct<314> Local_494 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } ;
#endregion

void __EntryFunction__()//Position - 0x0
{
	iLocal_2 = 1;
	iLocal_3 = 134;
	iLocal_4 = 134;
	iLocal_5 = 1;
	iLocal_6 = 1;
	iLocal_7 = 1;
	iLocal_8 = 134;
	iLocal_9 = 1;
	iLocal_10 = 12;
	iLocal_11 = 12;
	fLocal_14 = 0.001f;
	iLocal_17 = -1;
	gameplay::network_set_script_is_safe_for_network_game();
	if (script::_get_number_of_instances_of_streamed_script(joaat("cellphone_flashhand")) == 0)
	{
		func_52();
	}
	func_51();
	Global_16811 = 0;
	Global_101652.f_12994[Global_14443 /*20*/].f_18 = 0;
	Global_14603 = 0;
	func_50();
	func_49(Global_14424, "SET_DATA_SLOT_EMPTY", 8f, -1082130432, -1082130432, -1082130432, -1082130432);
	func_47();
	func_45();
	if (Global_14443.f_1 > 3)
	{
		Global_14443.f_1 = 7;
	}
	iLocal_43 = gameplay::get_game_timer();
	Global_14447 = 0;
	mobile::get_mobile_phone_position(&vLocal_486);
	vLocal_483 = { vLocal_486 };
	vLocal_483.x = (vLocal_483.x - 10f);
	vLocal_483.y = (vLocal_483.y + 20f);
	Global_16778 = 0;
	Global_16779 = 1;
	while (true)
	{
		system::wait(0);
		if (Global_16779 == 0 && Global_16778 == 1)
		{
			func_44();
		}
		if (Global_16779 == 1 && Global_16778 == 0)
		{
			func_39();
		}
		if (iLocal_42 == 0)
		{
			iLocal_44 = gameplay::get_game_timer();
			if ((iLocal_44 - iLocal_43) > 500)
			{
				iLocal_42 = 1;
			}
		}
		if ((Global_14443.f_1 != 9 && Global_16779 == 0) && Global_16778 == 0)
		{
			switch (Global_14443.f_1)
			{
				case 7:
					if (Global_16811 == 0)
					{
						if (Global_2502404 == 0)
						{
							func_38();
							func_32();
						}
					}
					break;
				
				case 8:
					if (Global_16811 == 1)
					{
						func_11();
						func_5();
					}
					break;
				
				default:
					break;
			}
			if (Global_16811 == 0)
			{
				if (func_4())
				{
					Global_16778 = 1;
				}
			}
			else if (func_3(2, Global_14411, 0) || gameplay::is_bit_set(Global_2314, 12))
			{
				if (gameplay::are_strings_equal(&(Global_2593993[uLocal_36 /*104*/]), "CELL_FINV"))
				{
				}
				else
				{
					system::wait(0);
					gameplay::clear_bit(&Global_2314, 12);
					func_2();
					Global_14421 = 1;
					Global_16811 = 0;
					if (Global_14443.f_1 > 3)
					{
						Global_14443.f_1 = 7;
					}
					if (script::_get_number_of_instances_of_streamed_script(joaat("cellphone_flashhand")) == 0)
					{
						func_52();
					}
					func_49(Global_14424, "SET_DATA_SLOT_EMPTY", 8f, -1082130432, -1082130432, -1082130432, -1082130432);
					func_47();
					func_45();
					if (Global_2593993[uLocal_36 /*104*/].f_29 > 0)
					{
						if (Global_2593993[uLocal_36 /*104*/].f_31 == 1)
						{
							Global_2593993[uLocal_36 /*104*/].f_29 = 4;
							Global_2593993[uLocal_36 /*104*/].f_24 = 1;
						}
						else
						{
							Global_2593993[uLocal_36 /*104*/].f_24 = 1;
						}
					}
				}
			}
		}
		if (script::_get_number_of_instances_of_streamed_script(joaat("cellphone_flashhand")) == 0)
		{
			func_52();
		}
		if (func_1())
		{
			func_52();
		}
	}
}

bool func_1()//Position - 0x29C
{
	if (((Global_14443.f_1 == 1 || Global_14443.f_1 == 3) || Global_14443.f_1 == 0) || Global_14387 == 1)
	{
		Global_14430 = 1;
		return true;
	}
	return false;
}

void func_2()//Position - 0x2DF
{
	if (!entity::is_entity_dead(player::player_ped_id(), 0))
	{
		audio::play_sound_frontend(-1, "Menu_Back", &Global_14432, 1);
	}
}

bool func_3(int iParam0, int iParam1, int iParam2)//Position - 0x300
{
	if (controls::is_control_just_pressed(iParam0, iParam1) || (iParam2 == 1 && controls::is_disabled_control_just_pressed(iParam0, iParam1)))
	{
		if (gameplay::is_pc_version())
		{
			if (gameplay::update_onscreen_keyboard() == 0 || (network::_network_is_text_chat_active() && controls::_is_input_disabled(2)))
			{
				return false;
			}
		}
		if (ui::is_pause_menu_active() || ui::is_warning_message_active())
		{
			return false;
		}
		else
		{
			return true;
		}
	}
	return false;
}

bool func_4()//Position - 0x372
{
	if (Global_2919 == 1 || Global_14443.f_1 < 7)
	{
		Global_14430 = 1;
		return true;
	}
	return false;
}

void func_5()//Position - 0x39B
{
	if (iLocal_39)
	{
		if (system::timera() > 50)
		{
			iLocal_39 = 0;
		}
	}
	if (controls::_is_input_disabled(2))
	{
		if (func_3(2, 181, 0))
		{
			func_9();
		}
		if (func_3(2, 180, 0))
		{
			func_6();
		}
	}
	if (iLocal_39 == 0)
	{
		if (func_3(2, Global_14419, 0))
		{
			func_9();
			iLocal_39 = 1;
			system::settimera(0);
		}
		if (func_3(2, Global_14420, 0))
		{
			func_6();
			iLocal_39 = 1;
			system::settimera(0);
		}
	}
}

void func_6()//Position - 0x410
{
	func_49(Global_14424, "SET_INPUT_EVENT", system::to_float(3), -1082130432, -1082130432, -1082130432, -1082130432);
	audio::play_sound_frontend(-1, "Menu_Navigate", &Global_14432, 1);
	func_7();
}

void func_7()//Position - 0x44B
{
	if (func_8())
	{
		if (Global_14609 == 0)
		{
			mobile::_move_finger(2);
		}
		else
		{
			mobile::_move_finger(1);
		}
	}
}

bool func_8()//Position - 0x46E
{
	int iVar0;
	int iVar1;
	int iVar2;
	
	if (Global_69697)
	{
		return false;
	}
	iVar2 = 0;
	iVar0 = cam::_0x19CAFA3C87F7C2FF();
	iVar1 = cam::_0xEE778F8C7E1142E2(iVar0);
	if (iVar1 == 4)
	{
		iVar2 = 1;
	}
	if (Global_2595472 || iVar2)
	{
		return true;
	}
	return true;
}

void func_9()//Position - 0x4B5
{
	func_49(Global_14424, "SET_INPUT_EVENT", system::to_float(1), -1082130432, -1082130432, -1082130432, -1082130432);
	audio::play_sound_frontend(-1, "Menu_Navigate", &Global_14432, 1);
	func_10();
}

void func_10()//Position - 0x4F0
{
	if (func_8())
	{
		if (Global_14609 == 0)
		{
			mobile::_move_finger(1);
		}
		else
		{
			mobile::_move_finger(2);
		}
	}
}

void func_11()//Position - 0x513
{
	func_12();
}

void func_12()//Position - 0x51F
{
	if (Global_2593993[uLocal_36 /*104*/].f_24 == 1)
	{
		if (Global_14421 == 0)
		{
			if (controls::is_control_pressed(2, Global_14414))
			{
				func_2();
				Global_14421 = 1;
				func_26();
				if (Global_2593993[uLocal_36 /*104*/].f_27 == 1)
				{
					Global_2593993[uLocal_36 /*104*/].f_99[0] = 0;
					Global_2593993[uLocal_36 /*104*/].f_99[1] = 0;
					Global_2593993[uLocal_36 /*104*/].f_99[2] = 0;
				}
				else
				{
					Global_2593993[uLocal_36 /*104*/].f_99[Global_14443] = 0;
				}
				if (func_25(uLocal_36))
				{
				}
				else
				{
					Global_2593993[uLocal_36 /*104*/].f_24 = 0;
					Global_2593993[uLocal_36 /*104*/].f_28 = 0;
				}
				ui::_remove_notification(Global_2593993[uLocal_36 /*104*/].f_16);
				func_49(Global_14424, "SET_DATA_SLOT_EMPTY", 8f, -1082130432, -1082130432, -1082130432, -1082130432);
				func_47();
				if (iLocal_34 > 0)
				{
					iLocal_34 = (iLocal_34 - 1);
				}
				func_45();
				if (Global_14443.f_1 > 3)
				{
					Global_14443.f_1 = 7;
					Global_16811 = 0;
				}
			}
		}
	}
	else if (Global_14421 == 0)
	{
		if (controls::is_control_pressed(2, Global_14415))
		{
			if (iLocal_38 == 1)
			{
				if (Global_14443.f_1 > 3)
				{
					StringCopy(&Global_68111, ui::_get_label_text(&Global_16786), 64);
					Global_68188 = 7;
					gameplay::set_bit(&Global_2314, 10);
					Global_14443.f_1 = 6;
				}
				func_52();
			}
		}
	}
	if (Global_2593993[uLocal_36 /*104*/].f_31 == 1)
	{
		if (Global_14421 == 0)
		{
			if (func_3(2, Global_14415, 0))
			{
				func_23();
				Global_14421 = 1;
				Global_2593993[uLocal_36 /*104*/].f_29 = 2;
				Global_2593993[uLocal_36 /*104*/].f_24 = 1;
				Global_2593993[uLocal_36 /*104*/].f_31 = 0;
				gameplay::clear_bit(&Global_2313, 17);
				Global_16811 = 0;
				if (Global_14443.f_1 > 3)
				{
					Global_14443.f_1 = 7;
				}
				func_49(Global_14424, "SET_DATA_SLOT_EMPTY", 8f, -1082130432, -1082130432, -1082130432, -1082130432);
				func_47();
				func_45();
			}
		}
	}
	if (Global_14421 == 0 && iLocal_42 == 1)
	{
		if (func_3(2, Global_14412, 0))
		{
			Global_14421 = 1;
			if (Global_2593993[uLocal_36 /*104*/].f_29 > 0)
			{
				func_23();
				Global_2593993[uLocal_36 /*104*/].f_29 = 3;
				Global_2593993[uLocal_36 /*104*/].f_24 = 1;
				Global_16811 = 0;
				if (Global_14443.f_1 > 3)
				{
					Global_14443.f_1 = 7;
				}
				func_49(Global_14424, "SET_DATA_SLOT_EMPTY", 8f, -1082130432, -1082130432, -1082130432, -1082130432);
				func_47();
				func_45();
			}
			else if (Global_2593993[uLocal_36 /*104*/].f_30 == 1)
			{
				func_23();
				Global_1628 = 144;
				if (Global_14443.f_1 > 3)
				{
					Global_14443.f_1 = 10;
					func_21();
				}
				func_20("appContacts");
				Global_14441 = system::start_new_script("appContacts", 4000);
				script::set_script_as_no_longer_needed("appContacts");
				Global_1628 = Global_2593993[uLocal_36 /*104*/].f_17;
				if (Global_101652.f_26993[Global_1628 /*29*/].f_24[Global_14443] == 0)
				{
					func_19(Global_14424, "SET_DATA_SLOT", system::to_float(4), system::to_float(0), system::to_float(3), -1f, -1f, &(Global_117[Global_1628 /*10*/].f_4), "CELL_300", "CELL_211", "CELL_195", 0);
				}
				else
				{
					func_19(Global_14424, "SET_DATA_SLOT", system::to_float(4), system::to_float(0), system::to_float(3), -1f, -1f, &(Global_101652.f_26993[Global_1628 /*29*/].f_3), &(Global_101652.f_26993[Global_1628 /*29*/].f_7), "CELL_211", &(Global_101652.f_26993[Global_1628 /*29*/].f_3), 0);
				}
				func_13();
				func_52();
			}
		}
	}
}

void func_13()//Position - 0x866
{
	vector3 vVar0[24];
	
	if (Global_14426 == 1)
	{
		return;
	}
	if (Global_14443.f_1 < 4)
	{
		return;
	}
	while (!graphics::has_scaleform_movie_loaded(Global_14424))
	{
		system::wait(0);
	}
	switch (Global_14443.f_1)
	{
		case 6:
			func_49(Global_14424, "SET_DATA_SLOT_EMPTY", 1f, -1082130432, -1082130432, -1082130432, -1082130432);
			func_17(Global_2918);
			if (Global_2918 == 1)
			{
				func_49(Global_14424, "DISPLAY_VIEW", 1f, system::to_float(Global_14447), -1082130432, -1082130432, -1082130432);
				Global_14423 = Global_14447;
			}
			else
			{
				func_49(Global_14424, "DISPLAY_VIEW", 1f, system::to_float(Global_14448), -1082130432, -1082130432, -1082130432);
				Global_14423 = Global_14448;
			}
			if (Global_14431)
			{
				func_19(Global_14424, "SET_SOFT_KEYS", 2f, 1f, 2f, -1f, -1f, "CELL_205", 0, 0, 0, 0);
				func_19(Global_14424, "SET_SOFT_KEYS", 3f, 1f, 4f, -1f, -1f, "CELL_206", 0, 0, 0, 0);
			}
			else
			{
				func_19(Global_14424, "SET_SOFT_KEYS", 2f, 1f, 2f, -1f, -1f, 0, 0, 0, 0, 0);
				func_19(Global_14424, "SET_SOFT_KEYS", 3f, 1f, 4f, -1f, -1f, 0, 0, 0, 0, 0);
			}
			if (Global_14606 == 0)
			{
				func_19(Global_14424, "SET_SOFT_KEYS", 1f, 0f, 1f, -1f, -1f, 0, 0, 0, 0, 0);
				gameplay::clear_bit(&Global_2313, 17);
			}
			else if (Global_69697)
			{
				func_19(Global_14424, "SET_SOFT_KEYS", 1f, 0f, 1f, -1f, -1f, 0, 0, 0, 0, 0);
				gameplay::clear_bit(&Global_2313, 17);
			}
			else
			{
				if (Global_14605 == 1)
				{
					if (Global_14431)
					{
						func_19(Global_14424, "SET_SOFT_KEYS", 1f, 1f, 20f, -1f, -1f, "CELL_225", 0, 0, 0, 0);
					}
					else
					{
						func_19(Global_14424, "SET_SOFT_KEYS", 1f, 1f, 20f, -1f, -1f, 0, 0, 0, 0, 0);
					}
				}
				else if (Global_14431)
				{
					func_19(Global_14424, "SET_SOFT_KEYS", 1f, 1f, 3f, -1f, -1f, "CELL_225", 0, 0, 0, 0);
				}
				else
				{
					func_19(Global_14424, "SET_SOFT_KEYS", 1f, 1f, 3f, -1f, -1f, 0, 0, 0, 0, 0);
				}
				gameplay::set_bit(&Global_2313, 17);
			}
			break;
		
		case 7:
			break;
		
		case 10:
			func_49(Global_14424, "DISPLAY_VIEW", 4f, -1082130432, -1082130432, -1082130432, -1082130432);
			func_19(Global_14424, "SET_SOFT_KEYS", 2f, 0f, 1f, -1f, -1f, 0, 0, 0, 0, 0);
			func_19(Global_14424, "SET_SOFT_KEYS", 1f, 0f, 1f, -1f, -1f, 0, 0, 0, 0, 0);
			gameplay::clear_bit(&Global_2313, 17);
			if (gameplay::is_bit_set(Global_2313, 20))
			{
				func_19(Global_14424, "SET_SOFT_KEYS", 3f, 0f, 1f, -1f, -1f, 0, 0, 0, 0, 0);
			}
			else if (Global_14431)
			{
				func_19(Global_14424, "SET_SOFT_KEYS", 3f, 1f, 6f, -1f, -1f, "CELL_202", 0, 0, 0, 0);
				if (Global_14386)
				{
					func_19(Global_14424, "SET_SOFT_KEYS", 3f, 1f, 6f, -1f, -1f, 0, 0, 0, 0, 0);
				}
			}
			else
			{
				func_19(Global_14424, "SET_SOFT_KEYS", 3f, 1f, 6f, -1f, -1f, 0, 0, 0, 0, 0);
			}
			break;
		
		case 9:
			if (Global_14442 == 1)
			{
				func_16();
				func_49(Global_14424, "SET_THEME", system::to_float(Global_101652.f_12994[Global_14443 /*20*/].f_6), -1082130432, -1082130432, -1082130432, -1082130432);
				if (Global_15758)
				{
					graphics::_push_scaleform_movie_function(Global_14424, "SET_DATA_SLOT");
					graphics::_push_scaleform_movie_function_parameter_int(4);
					graphics::_push_scaleform_movie_function_parameter_int(0);
					graphics::_push_scaleform_movie_function_parameter_int(2);
					graphics::_begin_text_component("CELL_CONDFON");
					ui::add_text_component_substring_player_name(&Global_15760);
					graphics::_end_text_component();
					func_15("CELL_300");
					func_15("CELL_217");
					func_15("CELL_217");
					graphics::_pop_scaleform_movie_function_void();
				}
				else if (Global_101652.f_26993[Global_1628 /*29*/].f_24[Global_14443] == 0)
				{
					func_19(Global_14424, "SET_DATA_SLOT", system::to_float(4), system::to_float(0), system::to_float(2), -1f, -1f, &(Global_117[Global_1628 /*10*/].f_4), "CELL_300", "CELL_217", "CELL_195", 0);
				}
				else
				{
					func_19(Global_14424, "SET_DATA_SLOT", system::to_float(4), system::to_float(0), system::to_float(2), -1f, -1f, &(Global_101652.f_26993[Global_1628 /*29*/].f_3), &(Global_101652.f_26993[Global_1628 /*29*/].f_7), "CELL_217", &(Global_101652.f_26993[Global_1628 /*29*/].f_3), 0);
				}
				func_49(Global_14424, "DISPLAY_VIEW", 4f, -1082130432, -1082130432, -1082130432, -1082130432);
			}
			else if (Global_15745 == 4 || Global_15745 == 3)
			{
				func_49(Global_14424, "SET_THEME", system::to_float(Global_101652.f_12994[Global_14443 /*20*/].f_6), -1082130432, -1082130432, -1082130432, -1082130432);
				func_16();
				if (Global_15758)
				{
					graphics::_push_scaleform_movie_function(Global_14424, "SET_DATA_SLOT");
					graphics::_push_scaleform_movie_function_parameter_int(4);
					graphics::_push_scaleform_movie_function_parameter_int(0);
					graphics::_push_scaleform_movie_function_parameter_int(2);
					graphics::_begin_text_component("CELL_CONDFON");
					ui::add_text_component_substring_player_name(&Global_15760);
					graphics::_end_text_component();
					func_15("CELL_300");
					func_15("CELL_219");
					func_15("CELL_219");
					graphics::_pop_scaleform_movie_function_void();
				}
				else
				{
					if (Global_16003)
					{
						StringCopy(&cVar0, "CELL_219", 24);
					}
					else
					{
						StringCopy(&cVar0, "CELL_211", 24);
					}
					if (Global_101652.f_26993[Global_1628 /*29*/].f_24[Global_14443] == 0)
					{
						func_49(Global_14424, "SET_DATA_SLOT_EMPTY", 4f, -1082130432, -1082130432, -1082130432, -1082130432);
						func_19(Global_14424, "SET_DATA_SLOT", system::to_float(4), system::to_float(0), system::to_float(3), -1f, -1f, &(Global_117[Global_1628 /*10*/].f_4), "CELL_300", &cVar0, "CELL_195", 0);
					}
					else
					{
						func_49(Global_14424, "SET_DATA_SLOT_EMPTY", 4f, -1082130432, -1082130432, -1082130432, -1082130432);
						func_19(Global_14424, "SET_DATA_SLOT", system::to_float(4), system::to_float(0), system::to_float(3), -1f, -1f, &(Global_101652.f_26993[Global_1628 /*29*/].f_3), &(Global_101652.f_26993[Global_1628 /*29*/].f_7), &cVar0, &(Global_101652.f_26993[Global_1628 /*29*/].f_3), 0);
					}
				}
				func_49(Global_14424, "DISPLAY_VIEW", 4f, -1082130432, -1082130432, -1082130432, -1082130432);
			}
			func_14();
			break;
		
		default:
			break;
	}
}

void func_14()//Position - 0xE09
{
	if (graphics::has_scaleform_movie_loaded(Global_14424))
	{
		if (Global_14442 == 1)
		{
			if (Global_14431)
			{
				func_19(Global_14424, "SET_SOFT_KEYS", 2f, 1f, 5f, -1f, -1f, "CELL_203", 0, 0, 0, 0);
			}
			else
			{
				func_19(Global_14424, "SET_SOFT_KEYS", 2f, 1f, 5f, -1f, -1f, 0, 0, 0, 0, 0);
			}
			if (Global_15792)
			{
				func_19(Global_14424, "SET_SOFT_KEYS", 3f, 0f, 6f, -1f, -1f, 0, 0, 0, 0, 0);
			}
			else if (gameplay::is_bit_set(Global_2313, 20))
			{
				func_19(Global_14424, "SET_SOFT_KEYS", 3f, 0f, 1f, -1f, -1f, 0, 0, 0, 0, 0);
			}
			else if (Global_14431)
			{
				func_19(Global_14424, "SET_SOFT_KEYS", 3f, 1f, 6f, -1f, -1f, "CELL_204", 0, 0, 0, 0);
			}
			else
			{
				func_19(Global_14424, "SET_SOFT_KEYS", 3f, 1f, 6f, -1f, -1f, 0, 0, 0, 0, 0);
			}
			func_19(Global_14424, "SET_SOFT_KEYS", 1f, 0f, 1f, -1f, -1f, 0, 0, 0, 0, 0);
			gameplay::clear_bit(&Global_2313, 17);
		}
		else
		{
			func_19(Global_14424, "SET_SOFT_KEYS", 2f, 0f, 1f, -1f, -1f, 0, 0, 0, 0, 0);
			func_19(Global_14424, "SET_SOFT_KEYS", 1f, 0f, 1f, -1f, -1f, 0, 0, 0, 0, 0);
			gameplay::clear_bit(&Global_2313, 17);
			if (gameplay::is_bit_set(Global_2313, 20))
			{
				func_19(Global_14424, "SET_SOFT_KEYS", 3f, 0f, 1f, -1f, -1f, 0, 0, 0, 0, 0);
			}
			else if (Global_14431)
			{
				func_19(Global_14424, "SET_SOFT_KEYS", 3f, 1f, 6f, -1f, -1f, "CELL_202", 0, 0, 0, 0);
				if (Global_14386)
				{
					func_19(Global_14424, "SET_SOFT_KEYS", 3f, 1f, 6f, -1f, -1f, 0, 0, 0, 0, 0);
				}
			}
			else
			{
				func_19(Global_14424, "SET_SOFT_KEYS", 3f, 1f, 6f, -1f, -1f, 0, 0, 0, 0, 0);
			}
		}
	}
}

void func_15(char* sParam0)//Position - 0xF89
{
	graphics::_begin_text_component(sParam0);
	graphics::_end_text_component();
}

void func_16()//Position - 0xF9B
{
	if (!entity::is_entity_dead(player::player_ped_id(), 0))
	{
		if (Global_14443 == 0)
		{
			switch (Global_101652.f_12994[Global_14443 /*20*/].f_6)
			{
				case 1:
					player::set_player_reset_flag_prefer_rear_seats(player::player_id(), 0);
					break;
				
				case 2:
					player::set_player_reset_flag_prefer_rear_seats(player::player_id(), 1);
					break;
				
				case 3:
					player::set_player_reset_flag_prefer_rear_seats(player::player_id(), 2);
					break;
				
				case 4:
					player::set_player_reset_flag_prefer_rear_seats(player::player_id(), 3);
					break;
				
				case 5:
					player::set_player_reset_flag_prefer_rear_seats(player::player_id(), 4);
					break;
				
				case 6:
					player::set_player_reset_flag_prefer_rear_seats(player::player_id(), 5);
					break;
				
				case 7:
					player::set_player_reset_flag_prefer_rear_seats(player::player_id(), 6);
					break;
				
				default:
					break;
				}
		}
		if (Global_14443 == 1)
		{
			switch (Global_101652.f_12994[Global_14443 /*20*/].f_6)
			{
				case 1:
					player::set_player_reset_flag_prefer_rear_seats(player::player_id(), 6);
					break;
				
				case 2:
					player::set_player_reset_flag_prefer_rear_seats(player::player_id(), 0);
					break;
				
				case 3:
					player::set_player_reset_flag_prefer_rear_seats(player::player_id(), 1);
					break;
				
				case 4:
					player::set_player_reset_flag_prefer_rear_seats(player::player_id(), 2);
					break;
				
				case 5:
					player::set_player_reset_flag_prefer_rear_seats(player::player_id(), 3);
					break;
				
				case 6:
					player::set_player_reset_flag_prefer_rear_seats(player::player_id(), 4);
					break;
				
				case 7:
					player::set_player_reset_flag_prefer_rear_seats(player::player_id(), 5);
					break;
				
				default:
					break;
				}
		}
		if (Global_14443 == 2)
		{
			switch (Global_101652.f_12994[Global_14443 /*20*/].f_6)
			{
				case 1:
					player::set_player_reset_flag_prefer_rear_seats(player::player_id(), 5);
					break;
				
				case 2:
					player::set_player_reset_flag_prefer_rear_seats(player::player_id(), 6);
					break;
				
				case 3:
					player::set_player_reset_flag_prefer_rear_seats(player::player_id(), 1);
					break;
				
				case 4:
					player::set_player_reset_flag_prefer_rear_seats(player::player_id(), 0);
					break;
				
				case 5:
					player::set_player_reset_flag_prefer_rear_seats(player::player_id(), 2);
					break;
				
				case 6:
					player::set_player_reset_flag_prefer_rear_seats(player::player_id(), 3);
					break;
				
				case 7:
					player::set_player_reset_flag_prefer_rear_seats(player::player_id(), 4);
					break;
				
				default:
					break;
				}
		}
		if (Global_14443 == 3)
		{
			switch (Global_2595470)
			{
				case 1:
					player::set_player_reset_flag_prefer_rear_seats(player::player_id(), 0);
					break;
				
				case 2:
					player::set_player_reset_flag_prefer_rear_seats(player::player_id(), 1);
					break;
				
				case 3:
					player::set_player_reset_flag_prefer_rear_seats(player::player_id(), 2);
					break;
				
				case 4:
					player::set_player_reset_flag_prefer_rear_seats(player::player_id(), 3);
					break;
				
				case 5:
					player::set_player_reset_flag_prefer_rear_seats(player::player_id(), 4);
					break;
				
				case 6:
					player::set_player_reset_flag_prefer_rear_seats(player::player_id(), 5);
					break;
				
				case 7:
					player::set_player_reset_flag_prefer_rear_seats(player::player_id(), 6);
					break;
				
				default:
					break;
				}
			}
	}
}

void func_17(int iParam0)//Position - 0x1212
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	int iVar4;
	int iVar5;
	int iVar6;
	int iVar7;
	int iVar8;
	int iVar9;
	
	Global_16813 = 0;
	Global_2918 = iParam0;
	iVar0 = 0;
	while (iVar0 < 9)
	{
		Global_2882[iVar0] = 0;
		iVar0++;
	}
	iVar0 = 0;
	while (iVar0 < 9)
	{
		iVar1 = 0;
		if (func_18(14))
		{
			while (iVar1 < 34)
			{
				if (iParam0 == Global_2320[iVar1 /*15*/].f_11)
				{
					if (iVar0 == Global_2320[iVar1 /*15*/].f_4)
					{
						if (Global_2882[iVar0] == 0)
						{
							Global_2846[iVar0] = iVar1;
							if (iVar1 == 3)
							{
								if (gameplay::is_bit_set(Global_2314, 3))
								{
									iVar2 = 42;
									Global_14608 = 1;
								}
								else
								{
									iVar2 = 255;
									Global_14608 = 0;
								}
								graphics::_push_scaleform_movie_function(Global_14424, "SET_DATA_SLOT");
								graphics::_push_scaleform_movie_function_parameter_int(1);
								graphics::_push_scaleform_movie_function_parameter_int(iVar0);
								graphics::_push_scaleform_movie_function_parameter_int(Global_2320[iVar1 /*15*/].f_10);
								graphics::_push_scaleform_movie_function_parameter_int(0);
								func_15(&(Global_2320[iVar1 /*15*/]));
								graphics::_push_scaleform_movie_function_parameter_int(iVar2);
								graphics::_pop_scaleform_movie_function_void();
							}
							if (Global_2452475)
							{
								if (iVar1 == 14)
								{
									func_19(Global_14424, "SET_DATA_SLOT", system::to_float(1), system::to_float(iVar0), system::to_float(Global_2320[iVar1 /*15*/].f_10), system::to_float(Global_16808), -1f, &(Global_2320[iVar1 /*15*/]), 0, 0, 0, 0);
								}
							}
							Global_2882[iVar0] = 1;
						}
					}
				}
				iVar1++;
			}
		}
		else
		{
			while (iVar1 < 34)
			{
				if (iParam0 == Global_2320[iVar1 /*15*/].f_11)
				{
					if (iVar0 == Global_2320[iVar1 /*15*/].f_4)
					{
						if (Global_2882[iVar0] == 0)
						{
							Global_2846[iVar0] = iVar1;
							if (iVar1 == 1)
							{
								iVar3 = 0;
								while (iVar3 < 35)
								{
									if (Global_101652.f_13084[iVar3 /*104*/].f_24 != 0)
									{
										if (Global_101652.f_13084[iVar3 /*104*/].f_28 == 0)
										{
											if (Global_101652.f_13084[iVar3 /*104*/].f_99[Global_14443] == 1)
											{
												Global_16813++;
											}
										}
									}
									iVar3++;
								}
								func_19(Global_14424, "SET_DATA_SLOT", system::to_float(1), system::to_float(iVar0), system::to_float(Global_2320[iVar1 /*15*/].f_10), system::to_float(Global_16813), -1f, &(Global_2320[iVar1 /*15*/]), 0, 0, 0, 0);
							}
							else if (iVar1 == 7)
							{
								if (Global_69697)
								{
									iVar4 = 0;
									iVar4 = Global_2593992;
									iVar5 = 0;
									while (iVar5 < 12)
									{
										if (Global_2593993[iVar5 /*104*/].f_24 != 0)
										{
											if (Global_2593993[iVar5 /*104*/].f_28 == 0)
											{
												if (Global_2593993[iVar5 /*104*/].f_99[Global_14443] == 1)
												{
													iVar4++;
												}
											}
										}
										iVar5++;
									}
									func_19(Global_14424, "SET_DATA_SLOT", system::to_float(1), system::to_float(iVar0), system::to_float(Global_2320[iVar1 /*15*/].f_10), system::to_float(iVar4), -1f, &(Global_2320[iVar1 /*15*/]), 0, 0, 0, 0);
								}
								else
								{
									switch (Global_14443)
									{
										case 0:
											iVar6 = Global_36913;
											break;
										
										case 1:
											iVar6 = Global_36914;
											break;
										
										case 2:
											iVar6 = Global_36915;
											break;
										
										default:
											break;
									}
									func_19(Global_14424, "SET_DATA_SLOT", system::to_float(1), system::to_float(iVar0), system::to_float(Global_2320[iVar1 /*15*/].f_10), system::to_float(iVar6), -1f, &(Global_2320[iVar1 /*15*/]), 0, 0, 0, 0);
								}
							}
							else if (iVar1 == 14)
							{
								func_19(Global_14424, "SET_DATA_SLOT", system::to_float(1), system::to_float(iVar0), system::to_float(Global_2320[iVar1 /*15*/].f_10), system::to_float(Global_16808), -1f, &(Global_2320[iVar1 /*15*/]), 0, 0, 0, 0);
							}
							else if (iVar1 == 20)
							{
								graphics::_push_scaleform_movie_function(Global_14424, "SET_DATA_SLOT");
								graphics::_push_scaleform_movie_function_parameter_int(1);
								graphics::_push_scaleform_movie_function_parameter_int(iVar0);
								graphics::_push_scaleform_movie_function_parameter_int(Global_2320[iVar1 /*15*/].f_10);
								graphics::_push_scaleform_movie_function_parameter_int(0);
								func_15(&(Global_2320[iVar1 /*15*/]));
								graphics::_push_scaleform_movie_function_parameter_int(Global_2319);
								graphics::_pop_scaleform_movie_function_void();
							}
							else if (iVar1 == 2)
							{
								if (gameplay::is_bit_set(Global_2314, 6))
								{
									iVar7 = 42;
								}
								else
								{
									iVar7 = 255;
								}
								graphics::_push_scaleform_movie_function(Global_14424, "SET_DATA_SLOT");
								graphics::_push_scaleform_movie_function_parameter_int(1);
								graphics::_push_scaleform_movie_function_parameter_int(iVar0);
								graphics::_push_scaleform_movie_function_parameter_int(Global_2320[iVar1 /*15*/].f_10);
								graphics::_push_scaleform_movie_function_parameter_int(0);
								func_15(&(Global_2320[iVar1 /*15*/]));
								graphics::_push_scaleform_movie_function_parameter_int(iVar7);
								graphics::_pop_scaleform_movie_function_void();
							}
							else if (iVar1 == 3)
							{
								if (gameplay::is_bit_set(Global_2314, 3))
								{
									iVar8 = 42;
									Global_14608 = 1;
								}
								else
								{
									iVar8 = 255;
									Global_14608 = 0;
								}
								graphics::_push_scaleform_movie_function(Global_14424, "SET_DATA_SLOT");
								graphics::_push_scaleform_movie_function_parameter_int(1);
								graphics::_push_scaleform_movie_function_parameter_int(iVar0);
								graphics::_push_scaleform_movie_function_parameter_int(Global_2320[iVar1 /*15*/].f_10);
								graphics::_push_scaleform_movie_function_parameter_int(0);
								func_15(&(Global_2320[iVar1 /*15*/]));
								graphics::_push_scaleform_movie_function_parameter_int(iVar8);
								graphics::_pop_scaleform_movie_function_void();
							}
							else if (iVar1 == 8)
							{
								graphics::_push_scaleform_movie_function(Global_14424, "SET_DATA_SLOT");
								graphics::_push_scaleform_movie_function_parameter_int(1);
								graphics::_push_scaleform_movie_function_parameter_int(iVar0);
								graphics::_push_scaleform_movie_function_parameter_int(Global_2320[iVar1 /*15*/].f_10);
								graphics::_push_scaleform_movie_function_parameter_int(0);
								func_15(&(Global_2320[iVar1 /*15*/]));
								graphics::_push_scaleform_movie_function_parameter_int(42);
								graphics::_pop_scaleform_movie_function_void();
							}
							else if ((iVar1 == 23 && gameplay::are_strings_equal(&(Global_2320[iVar1 /*15*/]), "CELL_BENWEB")) && gameplay::is_bit_set(Global_2314, 6))
							{
								graphics::_push_scaleform_movie_function(Global_14424, "SET_DATA_SLOT");
								graphics::_push_scaleform_movie_function_parameter_int(1);
								graphics::_push_scaleform_movie_function_parameter_int(iVar0);
								graphics::_push_scaleform_movie_function_parameter_int(Global_2320[iVar1 /*15*/].f_10);
								graphics::_push_scaleform_movie_function_parameter_int(0);
								func_15(&(Global_2320[iVar1 /*15*/]));
								graphics::_push_scaleform_movie_function_parameter_int(42);
								graphics::_pop_scaleform_movie_function_void();
							}
							else if (Global_2320[iVar1 /*15*/].f_10 == 57 && iVar1 == 23)
							{
								iVar9 = 0;
								iVar9 = Global_1616829.f_1;
								func_19(Global_14424, "SET_DATA_SLOT", system::to_float(1), system::to_float(iVar0), system::to_float(Global_2320[iVar1 /*15*/].f_10), system::to_float(iVar9), -1f, &(Global_2320[iVar1 /*15*/]), 0, 0, 0, 0);
							}
							else
							{
								func_19(Global_14424, "SET_DATA_SLOT", system::to_float(1), system::to_float(iVar0), system::to_float(Global_2320[iVar1 /*15*/].f_10), system::to_float(0), -1f, &(Global_2320[iVar1 /*15*/]), 0, 0, 0, 0);
							}
							Global_2882[iVar0] = 1;
						}
					}
				}
				iVar1++;
			}
		}
		iVar0++;
	}
}

int func_18(int iParam0)//Position - 0x17AA
{
	return Global_35777 == iParam0;
}

void func_19(int iParam0, char* sParam1, float fParam2, float fParam3, float fParam4, float fParam5, float fParam6, char* sParam7, char* sParam8, char* sParam9, char* sParam10, char* sParam11)//Position - 0x17B8
{
	graphics::_push_scaleform_movie_function(iParam0, sParam1);
	graphics::_push_scaleform_movie_function_parameter_int(system::round(fParam2));
	if (fParam3 != -1f)
	{
		graphics::_push_scaleform_movie_function_parameter_int(system::round(fParam3));
	}
	if (fParam4 != -1f)
	{
		graphics::_push_scaleform_movie_function_parameter_int(system::round(fParam4));
	}
	if (fParam5 != -1f)
	{
		graphics::_push_scaleform_movie_function_parameter_int(system::round(fParam5));
	}
	if (fParam6 != -1f)
	{
		graphics::_push_scaleform_movie_function_parameter_int(system::round(fParam6));
	}
	if (!gameplay::is_string_null_or_empty(sParam7))
	{
		func_15(sParam7);
	}
	if (!gameplay::is_string_null_or_empty(sParam8))
	{
		func_15(sParam8);
	}
	if (!gameplay::is_string_null_or_empty(sParam9))
	{
		func_15(sParam9);
	}
	if (!gameplay::is_string_null_or_empty(sParam10))
	{
		func_15(sParam10);
	}
	if (!gameplay::is_string_null_or_empty(sParam11))
	{
		func_15(sParam11);
	}
	graphics::_pop_scaleform_movie_function_void();
}

void func_20(char* sParam0)//Position - 0x186B
{
	script::request_script(sParam0);
	while (!script::has_script_loaded(sParam0))
	{
		system::wait(0);
	}
}

void func_21()//Position - 0x188B
{
	int iVar0;
	int iVar1;
	int iVar2;
	
	iVar0 = 0;
	iVar1 = 0;
	if (!ped::is_ped_injured(player::player_ped_id()))
	{
		if (func_22() && ped::is_ped_in_cover(player::player_ped_id(), 0))
		{
			iVar1 = 1;
		}
	}
	if (!Global_69697)
	{
		if (!ped::is_ped_injured(player::player_ped_id()) && iVar1 == 0)
		{
			iVar2 = ped::get_ped_prop_index(player::player_ped_id(), 0);
			if (Global_69697)
			{
				if (((((iVar2 == 15 || iVar2 == 16) || iVar2 == 17) || iVar2 == 18) || iVar2 == 19) || ped::is_ped_wearing_helmet(player::player_ped_id()))
				{
					iVar0 = 1;
				}
			}
			else if (ped::is_ped_wearing_helmet(player::player_ped_id()))
			{
				iVar0 = 1;
			}
			if (!Global_14386)
			{
				if (Global_1628 != 128)
				{
					if (iVar0 == 0)
					{
						if (!entity::is_entity_dead(player::player_ped_id(), 0))
						{
							if (ped::is_ped_in_any_vehicle(player::player_ped_id(), 0))
							{
							}
							else
							{
								if (Global_69697)
								{
									ped::set_ped_config_flag(player::player_ped_id(), 244, false);
									ped::set_ped_config_flag(player::player_ped_id(), 243, false);
									ped::set_ped_config_flag(player::player_ped_id(), 242, false);
								}
								gameplay::set_bit(&Global_2313, 11);
								ai::task_use_mobile_phone(player::player_ped_id(), 1, 1);
							}
						}
					}
				}
			}
		}
	}
}

bool func_22()//Position - 0x19AE
{
	int iVar0;
	int iVar1;
	
	iVar0 = cam::_0x19CAFA3C87F7C2FF();
	iVar1 = cam::_0xEE778F8C7E1142E2(iVar0);
	if (iVar1 == 4)
	{
		return true;
	}
	return false;
}

void func_23()//Position - 0x19D2
{
	if (!entity::is_entity_dead(player::player_ped_id(), 0))
	{
		audio::play_sound_frontend(-1, "Menu_Accept", &Global_14432, 1);
		func_24();
	}
}

void func_24()//Position - 0x19F8
{
	if (func_8())
	{
		mobile::_move_finger(5);
	}
}

bool func_25(var uParam0)//Position - 0x1A0C
{
	if ((Global_101652.f_13084[uParam0 /*104*/].f_99[0] == 1 || Global_101652.f_13084[uParam0 /*104*/].f_99[1] == 1) || Global_101652.f_13084[uParam0 /*104*/].f_99[2] == 1)
	{
		return true;
	}
	return false;
}

void func_26()//Position - 0x1A61
{
	if (func_18(14))
	{
		if (!entity::is_entity_dead(player::player_ped_id(), 0))
		{
			if (entity::get_entity_model(player::player_ped_id()) == Global_101652.f_26993[0 /*29*/])
			{
				Global_14443 = 0;
			}
			else if (entity::get_entity_model(player::player_ped_id()) == Global_101652.f_26993[1 /*29*/])
			{
				Global_14443 = 1;
			}
			else if (entity::get_entity_model(player::player_ped_id()) == Global_101652.f_26993[2 /*29*/])
			{
				Global_14443 = 2;
			}
			else
			{
				Global_14443 = 0;
			}
		}
	}
	else
	{
		Global_14443 = func_27();
		if (Global_14443 == 145)
		{
			Global_14443 = 3;
		}
		if (Global_69697)
		{
			Global_14443 = 3;
		}
		if (Global_14443 > 3)
		{
			Global_14443 = 3;
		}
	}
}

var func_27()//Position - 0x1B03
{
	func_28();
	return Global_101652.f_2079.f_539.f_3549;
}

void func_28()//Position - 0x1B1C
{
	int iVar0;
	
	if (entity::does_entity_exist(player::player_ped_id()))
	{
		if (func_31(Global_101652.f_2079.f_539.f_3549) != entity::get_entity_model(player::player_ped_id()))
		{
			iVar0 = func_30(player::player_ped_id());
			if (func_29(iVar0) && (!func_18(14) || Global_100604))
			{
				if (Global_101652.f_2079.f_539.f_3549 != iVar0 && func_29(Global_101652.f_2079.f_539.f_3549))
				{
					Global_101652.f_2079.f_539.f_3550 = Global_101652.f_2079.f_539.f_3549;
				}
				Global_101652.f_2079.f_539.f_3551 = iVar0;
				Global_101652.f_2079.f_539.f_3549 = iVar0;
				return;
			}
		}
		else
		{
			if (Global_101652.f_2079.f_539.f_3549 != 145)
			{
				Global_101652.f_2079.f_539.f_3551 = Global_101652.f_2079.f_539.f_3549;
			}
			return;
		}
	}
	Global_101652.f_2079.f_539.f_3549 = 145;
}

int func_29(int iParam0)//Position - 0x1C19
{
	return iParam0 < 3;
}

int func_30(int iParam0)//Position - 0x1C25
{
	int iVar0;
	int iVar1;
	
	if (entity::does_entity_exist(iParam0))
	{
		iVar1 = entity::get_entity_model(iParam0);
		iVar0 = 0;
		while (iVar0 <= 2)
		{
			if (func_31(iVar0) == iVar1)
			{
				return iVar0;
			}
			iVar0++;
		}
	}
	return 145;
}

int func_31(int iParam0)//Position - 0x1C62
{
	if (func_29(iParam0))
	{
		return Global_101652.f_26993[iParam0 /*29*/];
	}
	else if (iParam0 != 145)
	{
	}
	return 0;
}

void func_32()//Position - 0x1C8C
{
	struct<16> Var0;
	
	if (Global_14421 == 0)
	{
		if ((func_3(2, Global_14412, 0) || Global_2595243 == 1) || Global_16805 == 1)
		{
			if (Global_2595243 == 0 && Global_16805 == 0)
			{
				func_23();
			}
			Global_14421 = 1;
			iLocal_42 = 0;
			func_19(Global_14424, "SET_SOFT_KEYS", 1f, 0f, 11f, -1f, -1f, 0, 0, 0, 0, 0);
			gameplay::clear_bit(&Global_2313, 17);
			uLocal_36 = iLocal_19[iLocal_34];
			if (iLocal_34 == iLocal_33 || iLocal_34 > iLocal_33)
			{
				if (Global_14443.f_1 > 3)
				{
					Global_14443.f_1 = 8;
					Global_16811 = 1;
					iLocal_35 = iLocal_34;
					socialclub::_0x4737980E8A283806(iLocal_19[iLocal_34], &Local_494);
				}
				system::settimerb(0);
				iLocal_40 = 0;
				graphics::_push_scaleform_movie_function(Global_14424, "GET_CURRENT_SELECTION");
				uLocal_45 = graphics::_pop_scaleform_movie_function();
				while (!graphics::_0x768FF8961BA904D6(uLocal_45) && iLocal_40 == 0)
				{
					system::wait(0);
					if (system::timerb() > 2000)
					{
						iLocal_40 = 1;
					}
				}
				func_37();
				graphics::_push_scaleform_movie_function(Global_14424, "SET_DATA_SLOT");
				graphics::_push_scaleform_movie_function_parameter_int(9);
				graphics::_push_scaleform_movie_function_parameter_int(0);
				func_15("CELL_1");
				graphics::_begin_text_component("CELL_TO_FIELD");
				ui::add_text_component_substring_player_name(player::get_player_name(player::player_id()));
				graphics::_end_text_component();
				graphics::_begin_text_component("CELL_FROM_FIELD");
				ui::add_text_component_substring_player_name(&(Local_494.f_2));
				graphics::_end_text_component();
				graphics::_begin_text_component("CELL_EMAIL_BCON");
				ui::add_text_component_substring_player_name(&(Local_494.f_56[0 /*16*/]));
				ui::add_text_component_substring_player_name(&(Local_494.f_56[1 /*16*/]));
				ui::add_text_component_substring_player_name(&(Local_494.f_56[2 /*16*/]));
				ui::add_text_component_substring_player_name(&(Local_494.f_56[3 /*16*/]));
				ui::add_text_component_substring_player_name(&(Local_494.f_56[4 /*16*/]));
				ui::add_text_component_substring_player_name(&(Local_494.f_56[5 /*16*/]));
				ui::add_text_component_substring_player_name(&(Local_494.f_56[6 /*16*/]));
				ui::add_text_component_substring_player_name(&(Local_494.f_56[7 /*16*/]));
				ui::add_text_component_substring_player_name(&(Local_494.f_56[8 /*16*/]));
				ui::add_text_component_substring_player_name(&(Local_494.f_56[9 /*16*/]));
				graphics::_end_text_component();
				graphics::_begin_text_component("CELL_2000");
				ui::add_text_component_substring_player_name(&(Local_494.f_2));
				graphics::_end_text_component();
				switch (Local_494.f_313)
				{
					case 0:
						break;
					
					case 1:
						break;
					
					case 2:
						graphics::_push_scaleform_movie_function_parameter_string("EmailAds_Dock_Tease");
						graphics::_push_scaleform_movie_function_parameter_bool(true);
						break;
					
					case 3:
						graphics::_push_scaleform_movie_function_parameter_string("EmailAds_Warstock");
						graphics::_push_scaleform_movie_function_parameter_bool(true);
						break;
					
					case 4:
						graphics::_push_scaleform_movie_function_parameter_string("EmailAds_Legendary_Motorsport");
						graphics::_push_scaleform_movie_function_parameter_bool(true);
						break;
					
					case 5:
						graphics::_push_scaleform_movie_function_parameter_string("EmailAds_LS_Customs");
						graphics::_push_scaleform_movie_function_parameter_bool(true);
						break;
					
					case 6:
						graphics::_push_scaleform_movie_function_parameter_string("EmailAds_Elitas_Travel");
						graphics::_push_scaleform_movie_function_parameter_bool(true);
						break;
					
					case 7:
						graphics::_push_scaleform_movie_function_parameter_string("EmailAds_LS_Tourist_Info");
						graphics::_push_scaleform_movie_function_parameter_bool(true);
						break;
					
					case 8:
						graphics::_push_scaleform_movie_function_parameter_string("emailads_dynasty8");
						graphics::_push_scaleform_movie_function_parameter_bool(true);
						break;
					
					case 9:
						graphics::_push_scaleform_movie_function_parameter_string("emailads_bennys");
						graphics::_push_scaleform_movie_function_parameter_bool(true);
						break;
					
					case 10:
						graphics::_push_scaleform_movie_function_parameter_string("emailads_ammunation");
						graphics::_push_scaleform_movie_function_parameter_bool(true);
						break;
					
					case 11:
						graphics::_push_scaleform_movie_function_parameter_string("emailads_SSSA");
						graphics::_push_scaleform_movie_function_parameter_bool(true);
						break;
					
					case 12:
						graphics::_push_scaleform_movie_function_parameter_string("emailads_maze_bank");
						graphics::_push_scaleform_movie_function_parameter_bool(true);
						break;
					
					case 13:
						graphics::_push_scaleform_movie_function_parameter_string("emailads_shark");
						graphics::_push_scaleform_movie_function_parameter_bool(true);
						break;
					
					case 14:
						graphics::_push_scaleform_movie_function_parameter_string("emailads_RP");
						graphics::_push_scaleform_movie_function_parameter_bool(true);
						break;
				}
				graphics::_pop_scaleform_movie_function_void();
				func_19(Global_14424, "SET_SOFT_KEYS", 2f, 0f, 1f, -1f, -1f, 0, 0, 0, 0, 0);
				func_49(Global_14424, "DISPLAY_VIEW", 9f, -1082130432, -1082130432, -1082130432, -1082130432);
				if (iLocal_34 == iLocal_33)
				{
					if (gameplay::is_bit_set(Global_2595258, 25))
					{
						gameplay::clear_bit(&Global_2595258, 25);
					}
					if (Global_2593992 > 0)
					{
						func_34(5850, iLocal_489, -1, 1, 0);
						if (Global_2593992 > 0)
						{
							Global_2593992 = 0;
						}
					}
				}
				return;
			}
			if (Global_2593993[uLocal_36 /*104*/].f_24 != 0)
			{
				if (Global_14443.f_1 > 3)
				{
					Global_14443.f_1 = 8;
				}
				if (Global_2595243 == 1 || Global_16805 == 1)
				{
					uLocal_36 = iLocal_19[0];
					iLocal_35 = 0;
					if (Global_2595243 == 1)
					{
					}
					Global_16805 = 0;
				}
				else
				{
					system::settimerb(0);
					iLocal_40 = 0;
					graphics::_push_scaleform_movie_function(Global_14424, "GET_CURRENT_SELECTION");
					uLocal_45 = graphics::_pop_scaleform_movie_function();
					while (!graphics::_0x768FF8961BA904D6(uLocal_45) && iLocal_40 == 0)
					{
						system::wait(0);
						if (system::timerb() > 2000)
						{
							iLocal_40 = 1;
						}
					}
					if (iLocal_40 == 1)
					{
						iLocal_41 = 0;
					}
					else
					{
						iLocal_41 = graphics::_0x2DE7EFA66B906036(uLocal_45);
					}
					if (iLocal_41 < 0)
					{
						iLocal_41 = 0;
					}
					uLocal_36 = iLocal_19[iLocal_34];
					iLocal_35 = iLocal_34;
				}
				Global_2593993[uLocal_36 /*104*/].f_28 = 1;
				iLocal_38 = 0;
				StringCopy(&Global_16786, "NO_HYPERLINK", 64);
				Var0 = { Global_2593993[uLocal_36 /*104*/] };
				StringConCat(&Var0, "_LINK", 64);
				if (ui::does_text_label_exist(&Var0))
				{
					Global_16786 = { Var0 };
					iLocal_38 = 1;
					if (Global_14431)
					{
						func_19(Global_14424, "SET_SOFT_KEYS", 1f, 1f, 16f, -1f, -1f, "CELL_267", 0, 0, 0, 0);
					}
					else
					{
						func_19(Global_14424, "SET_SOFT_KEYS", 1f, 1f, 16f, -1f, -1f, 0, 0, 0, 0, 0);
					}
					gameplay::set_bit(&Global_2313, 17);
					Global_2593993[uLocal_36 /*104*/].f_26 = 1;
					Global_2593993[uLocal_36 /*104*/].f_24 = 2;
				}
				if (Global_2593993[uLocal_36 /*104*/].f_26 == 0)
				{
					Global_2593993[uLocal_36 /*104*/].f_24 = 1;
				}
				func_37();
				graphics::_push_scaleform_movie_function(Global_14424, "SET_DATA_SLOT");
				graphics::_push_scaleform_movie_function_parameter_int(9);
				graphics::_push_scaleform_movie_function_parameter_int(0);
				func_15("CELL_1");
				graphics::_begin_text_component("CELL_TO_FIELD");
				ui::add_text_component_substring_player_name(player::get_player_name(player::player_id()));
				graphics::_end_text_component();
				if (Global_2593993[uLocal_36 /*104*/].f_17 == 145)
				{
					graphics::_begin_text_component("CELL_FROM_FIELD");
					ui::add_text_component_substring_player_name(&(Global_2593993[uLocal_36 /*104*/].f_50));
					graphics::_end_text_component();
				}
				else
				{
					graphics::_begin_text_component("CELL_FROM_FIELD");
					ui::_add_text_component_item_string(&(Global_101652.f_26993[Global_2593993[uLocal_36 /*104*/].f_17 /*29*/].f_3));
					graphics::_end_text_component();
				}
				switch (Global_2593993[uLocal_36 /*104*/].f_32)
				{
					case 0:
						func_15(&(Global_2593993[uLocal_36 /*104*/]));
						break;
					
					case 1:
						graphics::_begin_text_component(&(Global_2593993[uLocal_36 /*104*/]));
						ui::add_text_component_substring_player_name(&(Global_2593993[uLocal_36 /*104*/].f_33));
						if (Global_2593993[uLocal_36 /*104*/].f_66 == 1 && !gameplay::are_strings_equal(&(Global_2593993[uLocal_36 /*104*/].f_67), "NULL"))
						{
							ui::add_text_component_substring_player_name(&(Global_2593993[uLocal_36 /*104*/].f_67));
						}
						if ((Global_2593993[uLocal_36 /*104*/].f_66 == 2 && !gameplay::are_strings_equal(&(Global_2593993[uLocal_36 /*104*/].f_67), "NULL")) && !gameplay::are_strings_equal(&(Global_2593993[uLocal_36 /*104*/].f_83), "NULL"))
						{
							if (ui::does_text_label_exist(&(Global_2593993[uLocal_36 /*104*/].f_67)))
							{
								ui::_add_text_component_item_string(&(Global_2593993[uLocal_36 /*104*/].f_67));
							}
							else
							{
								ui::add_text_component_substring_player_name(&(Global_2593993[uLocal_36 /*104*/].f_67));
							}
							if (ui::does_text_label_exist(&(Global_2593993[uLocal_36 /*104*/].f_83)))
							{
								ui::_add_text_component_item_string(&(Global_2593993[uLocal_36 /*104*/].f_83));
							}
							else
							{
								ui::add_text_component_substring_player_name(&(Global_2593993[uLocal_36 /*104*/].f_83));
							}
						}
						graphics::_end_text_component();
						break;
					
					case 2:
						graphics::_begin_text_component(&(Global_2593993[uLocal_36 /*104*/]));
						ui::add_text_component_integer(Global_2593993[uLocal_36 /*104*/].f_49);
						graphics::_end_text_component();
						break;
					
					case 3:
						graphics::_begin_text_component(&(Global_2593993[uLocal_36 /*104*/]));
						ui::add_text_component_substring_player_name(&(Global_2593993[uLocal_36 /*104*/].f_33));
						ui::add_text_component_integer(Global_2593993[uLocal_36 /*104*/].f_49);
						if (Global_2593993[uLocal_36 /*104*/].f_66 == 1 && !gameplay::are_strings_equal(&(Global_2593993[uLocal_36 /*104*/].f_67), "NULL"))
						{
							ui::add_text_component_substring_player_name(&(Global_2593993[uLocal_36 /*104*/].f_67));
						}
						if ((Global_2593993[uLocal_36 /*104*/].f_66 == 2 && !gameplay::are_strings_equal(&(Global_2593993[uLocal_36 /*104*/].f_67), "NULL")) && !gameplay::are_strings_equal(&(Global_2593993[uLocal_36 /*104*/].f_83), "NULL"))
						{
							if (ui::does_text_label_exist(&(Global_2593993[uLocal_36 /*104*/].f_67)))
							{
								ui::_add_text_component_item_string(&(Global_2593993[uLocal_36 /*104*/].f_67));
							}
							else
							{
								ui::add_text_component_substring_player_name(&(Global_2593993[uLocal_36 /*104*/].f_67));
							}
							if (ui::does_text_label_exist(&(Global_2593993[uLocal_36 /*104*/].f_83)))
							{
								ui::_add_text_component_item_string(&(Global_2593993[uLocal_36 /*104*/].f_83));
							}
							else
							{
								ui::add_text_component_substring_player_name(&(Global_2593993[uLocal_36 /*104*/].f_83));
							}
						}
						graphics::_end_text_component();
						break;
					
					case 4:
						func_33(uLocal_36);
						break;
					
					case 5:
						func_33(uLocal_36);
						break;
					
					case 6:
						func_33(uLocal_36);
						break;
					
					case 7:
						func_33(uLocal_36);
						break;
					
					case 8:
						func_33(uLocal_36);
						break;
					
					case 9:
						func_33(uLocal_36);
						break;
					
					case 10:
						func_33(uLocal_36);
						break;
					
					case 11:
						func_33(uLocal_36);
						break;
				}
				if (Global_2593993[uLocal_36 /*104*/].f_17 == 145)
				{
					graphics::_begin_text_component("CELL_2000");
					ui::add_text_component_substring_player_name(&(Global_2593993[uLocal_36 /*104*/].f_50));
					graphics::_end_text_component();
				}
				else
				{
					func_15(&(Global_101652.f_26993[Global_2593993[uLocal_36 /*104*/].f_17 /*29*/].f_3));
				}
				if (Global_2593993[uLocal_36 /*104*/].f_17 == 149)
				{
					graphics::_push_scaleform_movie_function_parameter_string("emailads_maze_bank");
					graphics::_push_scaleform_movie_function_parameter_bool(true);
				}
				graphics::_pop_scaleform_movie_function_void();
				Global_16811 = 1;
				func_49(Global_14424, "DISPLAY_VIEW", 9f, -1082130432, -1082130432, -1082130432, -1082130432);
				ui::_remove_notification(Global_2593993[uLocal_36 /*104*/].f_16);
				if (Global_2593993[uLocal_36 /*104*/].f_29 > 0)
				{
					if (Global_14431)
					{
						func_19(Global_14424, "SET_SOFT_KEYS", 2f, 1f, 13f, -1f, -1f, "CELL_212", 0, 0, 0, 0);
					}
					else
					{
						func_19(Global_14424, "SET_SOFT_KEYS", 2f, 1f, 13f, -1f, -1f, 0, 0, 0, 0, 0);
					}
				}
				else if (Global_2593993[uLocal_36 /*104*/].f_30 == 1)
				{
					if (Global_14431)
					{
						func_19(Global_14424, "SET_SOFT_KEYS", 2f, 1f, 5f, -1f, -1f, "CELL_201", 0, 0, 0, 0);
					}
					else
					{
						func_19(Global_14424, "SET_SOFT_KEYS", 2f, 1f, 5f, -1f, -1f, 0, 0, 0, 0, 0);
					}
				}
				else
				{
					func_19(Global_14424, "SET_SOFT_KEYS", 2f, 0f, 1f, -1f, -1f, 0, 0, 0, 0, 0);
				}
				if (Global_2593993[uLocal_36 /*104*/].f_29 > 0)
				{
					if (gameplay::are_strings_equal(&(Global_2593993[uLocal_36 /*104*/]), "CELL_FINV"))
					{
						if (Global_14431)
						{
							func_19(Global_14424, "SET_SOFT_KEYS", 3f, 0f, 14f, -1f, -1f, "CELL_213", 0, 0, 0, 0);
						}
						else
						{
							func_19(Global_14424, "SET_SOFT_KEYS", 3f, 0f, 14f, -1f, -1f, 0, 0, 0, 0, 0);
						}
					}
					else if (Global_14431)
					{
						func_19(Global_14424, "SET_SOFT_KEYS", 3f, 1f, 4f, -1f, -1f, "CELL_206", 0, 0, 0, 0);
					}
					else
					{
						func_19(Global_14424, "SET_SOFT_KEYS", 3f, 1f, 4f, -1f, -1f, 0, 0, 0, 0, 0);
					}
				}
				else if (Global_14431)
				{
					func_19(Global_14424, "SET_SOFT_KEYS", 3f, 1f, 4f, -1f, -1f, "CELL_206", 0, 0, 0, 0);
				}
				else
				{
					func_19(Global_14424, "SET_SOFT_KEYS", 3f, 1f, 4f, -1f, -1f, 0, 0, 0, 0, 0);
				}
				if (Global_2593993[uLocal_36 /*104*/].f_24 == 2)
				{
					if (Global_2593993[uLocal_36 /*104*/].f_31 == 1)
					{
						iLocal_38 = 0;
						if (Global_14431)
						{
							func_19(Global_14424, "SET_SOFT_KEYS", 1f, 1f, 11f, -1f, -1f, "CELL_264", 0, 0, 0, 0);
						}
						else
						{
							func_19(Global_14424, "SET_SOFT_KEYS", 1f, 1f, 11f, -1f, -1f, 0, 0, 0, 0, 0);
						}
						gameplay::set_bit(&Global_2313, 17);
					}
					else if (iLocal_38 == 0)
					{
						func_19(Global_14424, "SET_SOFT_KEYS", 1f, 0f, 1f, -1f, -1f, 0, 0, 0, 0, 0);
						gameplay::clear_bit(&Global_2313, 17);
					}
				}
				else if (Global_14431)
				{
					func_19(Global_14424, "SET_SOFT_KEYS", 1f, 1f, 12f, -1f, -1f, "CELL_216", 0, 0, 0, 0);
					gameplay::set_bit(&Global_2313, 17);
				}
				else
				{
					func_19(Global_14424, "SET_SOFT_KEYS", 1f, 1f, 12f, -1f, -1f, 0, 0, 0, 0, 0);
					gameplay::set_bit(&Global_2313, 17);
				}
				Global_101652.f_12994[Global_14443 /*20*/].f_18 = 0;
				Global_2595243 = 0;
			}
			else
			{
				Global_101652.f_12994[Global_14443 /*20*/].f_18 = 0;
				Global_2595243 = 0;
			}
		}
		if (Global_2502404 == 0)
		{
			if (Global_69697)
			{
			}
		}
	}
}

void func_33(var uParam0)//Position - 0x2802
{
	int iVar0;
	
	iVar0 = 0;
	switch (Global_101652.f_13084[uParam0 /*104*/].f_49)
	{
		case 1:
			graphics::_begin_text_component("CELL_CL01");
			break;
		
		case 2:
			graphics::_begin_text_component("CELL_CL02");
			break;
		
		case 3:
			graphics::_begin_text_component("CELL_CL03");
			break;
		
		case 4:
			graphics::_begin_text_component("CELL_CL04");
			break;
		
		case 5:
			graphics::_begin_text_component("CELL_CL05");
			break;
		
		case 6:
			graphics::_begin_text_component("CELL_CL06");
			break;
		
		case 7:
			graphics::_begin_text_component("CELL_CL07");
			break;
		
		case 8:
			graphics::_begin_text_component("CELL_CL08");
			break;
		
		case 9:
			graphics::_begin_text_component("CELL_CL09");
			break;
	}
	ui::_add_text_component_item_string(&(Global_101652.f_13084[uParam0 /*104*/]));
	while (iVar0 < Global_101652.f_13084[uParam0 /*104*/].f_49)
	{
		switch (Global_101652.f_13084[uParam0 /*104*/].f_32)
		{
			case 4:
				ui::_add_text_component_item_string(&(Global_2494149.f_1570[iVar0 /*4*/]));
				break;
			
			case 5:
				ui::_add_text_component_item_string(&(Global_1747159[iVar0 /*4*/]));
				break;
			
			case 6:
				ui::_add_text_component_item_string(&(Global_1747200[iVar0 /*4*/]));
				break;
			
			case 7:
				ui::_add_text_component_item_string(&(Global_1747221[iVar0 /*4*/]));
				break;
			
			case 8:
				ui::_add_text_component_item_string(&(Global_1747238[iVar0 /*4*/]));
				break;
			
			case 9:
				ui::_add_text_component_item_string(&(Global_1747251[iVar0 /*4*/]));
				break;
			
			case 10:
				ui::_add_text_component_item_string(&(Global_1747264[iVar0 /*4*/]));
				break;
			
			case 11:
				ui::_add_text_component_item_string(&(Global_1747277[iVar0 /*4*/]));
				break;
		}
		iVar0++;
	}
	graphics::_end_text_component();
}

void func_34(int iParam0, int iParam1, int iParam2, int iParam3, int iParam4)//Position - 0x29A3
{
	int iVar0;
	
	if (iParam4)
	{
	}
	iVar0 = Global_2503773[iParam0 /*3*/][func_35(iParam2)];
	if (iVar0 != 0)
	{
		stats::stat_set_int(iVar0, iParam1, iParam3);
	}
}

int func_35(var uParam0)//Position - 0x29D3
{
	int iVar0;
	int iVar1;
	
	iVar0 = uParam0;
	if (iVar0 == -1)
	{
		iVar1 = func_36();
		if (iVar1 > -1)
		{
			Global_2503486 = 0;
			iVar0 = iVar1;
		}
		else
		{
			iVar0 = 0;
			Global_2503486 = 1;
		}
	}
	return iVar0;
}

var func_36()//Position - 0x2A07
{
	return Global_1312731;
}

void func_37()//Position - 0x2A13
{
	if (iLocal_482)
	{
		graphics::set_streamed_texture_dict_as_no_longer_needed(&Local_46);
	}
	iLocal_482 = 0;
	StringCopy(&Local_46, "05_b_sext_stripperJuliet", 64);
	iLocal_482 = 1;
	graphics::request_streamed_texture_dict(&Local_46, false);
	while (!graphics::has_streamed_texture_dict_loaded(&Local_46))
	{
		system::wait(100);
	}
	if (gameplay::are_strings_equal(&(Global_2593993[1 /*104*/]), &(Local_62[1 /*6*/])))
	{
		Local_177[1 /*16*/] = { Local_46 };
		if (gameplay::are_strings_equal(&(Local_177[1 /*16*/]), &Local_46))
		{
		}
	}
}

void func_38()//Position - 0x2A7F
{
	if (iLocal_39)
	{
		if (system::timera() > 50)
		{
			iLocal_39 = 0;
		}
	}
	if (controls::_is_input_disabled(2))
	{
		if (func_3(2, 181, 0))
		{
			if (iLocal_34 > 0)
			{
				iLocal_34 = (iLocal_34 - 1);
				func_9();
			}
		}
		if (func_3(2, 180, 0))
		{
			iLocal_34++;
			if (iLocal_34 == iLocal_32)
			{
				iLocal_34 = 0;
			}
			func_6();
		}
	}
	if (iLocal_39 == 0)
	{
		if (func_3(2, Global_14419, 0))
		{
			if (iLocal_34 > 0)
			{
				iLocal_34 = (iLocal_34 - 1);
				func_9();
			}
			iLocal_39 = 1;
			system::settimera(0);
		}
		if (func_3(2, Global_14420, 0))
		{
			iLocal_34++;
			if (iLocal_34 == iLocal_32)
			{
				iLocal_34 = 0;
			}
			func_6();
			iLocal_39 = 1;
			system::settimera(0);
		}
	}
}

void func_39()//Position - 0x2B2C
{
	float fVar0;
	
	fVar0 = func_40(vLocal_486, vLocal_483, Global_14403, -90f, 0f, 90f, 350f, 0);
	mobile::set_mobile_phone_scale((500f + (75f * fVar0)));
	if (fVar0 >= 1f)
	{
		Global_16779 = 0;
		iLocal_18 = 0;
	}
}

float func_40(vector3 vParam0, vector3 vParam3, vector3 vParam6, vector3 vParam9, float fParam12, int iParam13)//Position - 0x2B7A
{
	struct<2> Var0;
	float fVar3;
	float fVar4;
	float fVar5;
	
	if (Global_2595473 == 0)
	{
		if (gameplay::is_bit_set(Global_2313, 14) && Global_14443.f_1 < 4)
		{
			mobile::get_mobile_phone_position(&Var0);
			if (Global_14396[Global_14388 /*3*/].f_1 == Var0.f_1)
			{
				Global_2595473 = 1;
			}
		}
	}
	if (func_43() && Global_2595473 == 0)
	{
		return 2f;
	}
	if (iLocal_18 == 0)
	{
		iLocal_18 = gameplay::get_game_timer();
	}
	fVar3 = func_42((system::to_float((gameplay::get_game_timer() - iLocal_18)) / fParam12), 0f, 1f);
	if (fVar3 < 1f)
	{
		fVar4 = fVar3;
		if (iParam13)
		{
			fVar4 = (fVar4 - 1f);
			fVar5 = 0.670158f;
			fVar4 = (((fVar4 * fVar4) * (((fVar5 + 1f) * fVar4) + fVar5)) + 1f);
		}
		else
		{
			fVar4 = system::sin((fVar3 * 90f));
		}
		Global_14371 = { func_41(vParam0, vParam3, fVar4) };
		Global_14374 = { func_41(vParam6, vParam9, fVar4) };
	}
	else
	{
		Global_14371 = { vParam3 };
		Global_14374 = { vParam9 };
	}
	mobile::set_mobile_phone_position(Global_14371);
	mobile::set_mobile_phone_rotation(Global_14374, 0);
	return fVar3;
}

Vector3 func_41(vector3 vParam0, vector3 vParam3, float fParam6)//Position - 0x2C8C
{
	return vParam0 + vParam3 - vParam0 * Vector(fParam6, fParam6, fParam6);
}

float func_42(float fParam0, float fParam1, float fParam2)//Position - 0x2CA6
{
	if (fParam0 > fParam2)
	{
		return fParam2;
	}
	else if (fParam0 < fParam1)
	{
		return fParam1;
	}
	return fParam0;
}

bool func_43()//Position - 0x2CCD
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	
	if (!entity::is_entity_dead(player::player_ped_id(), 0))
	{
		if (Global_14443.f_1 == 10 || Global_14443.f_1 == 9)
		{
			if (Global_14386 == 0)
			{
				if (Global_1628 != 128)
				{
					if (!ped::is_ped_in_any_vehicle(player::player_ped_id(), 0))
					{
						if (Global_15745 != 2)
						{
						}
					}
				}
			}
		}
		if (func_18(14))
		{
			return false;
		}
		if (ped::is_ped_in_cover(player::player_ped_id(), 0))
		{
			return false;
		}
		if (ped::is_ped_in_any_vehicle(player::player_ped_id(), 0))
		{
			if (!cam::_0x4F32C0D5A90A9B40())
			{
				if (entity::is_entity_in_water(ped::get_vehicle_ped_is_in(player::player_ped_id(), 0)))
				{
					return false;
				}
			}
		}
		if (((ped::is_ped_swimming(player::player_ped_id()) || ped::is_ped_swimming_under_water(player::player_ped_id())) || player::is_player_climbing(player::player_id())) || ped::is_ped_hanging_on_to_vehicle(player::player_ped_id()))
		{
			return false;
		}
		if (Global_100700)
		{
			return false;
		}
	}
	if (Global_69697)
	{
		return false;
	}
	iVar2 = 0;
	iVar0 = cam::_0x19CAFA3C87F7C2FF();
	iVar1 = cam::_0xEE778F8C7E1142E2(iVar0);
	if (iVar1 == 4 && (iVar0 == 0 || cam::_0x4F32C0D5A90A9B40()))
	{
		iVar2 = 1;
		if (!entity::is_entity_dead(player::player_ped_id(), 0))
		{
			if (ped::is_ped_in_any_vehicle(player::player_ped_id(), 0))
			{
				iVar3 = ped::get_vehicle_ped_is_in(player::player_ped_id(), 0);
				if ((((((((vehicle::is_this_model_a_bike(entity::get_entity_model(iVar3)) || vehicle::is_this_model_a_bicycle(entity::get_entity_model(iVar3))) || vehicle::is_this_model_a_quadbike(entity::get_entity_model(iVar3))) || entity::get_entity_model(iVar3) == joaat("seashark")) || entity::get_entity_model(iVar3) == joaat("seashark2")) || entity::get_entity_model(iVar3) == joaat("rhino")) || entity::get_entity_model(iVar3) == joaat("submersible")) || entity::get_entity_model(iVar3) == joaat("submersible2")) || entity::get_entity_model(iVar3) == joaat("toro"))
				{
					iVar2 = 0;
				}
			}
		}
	}
	if (Global_2595472 || iVar2 == 1)
	{
		if (script::_get_number_of_instances_of_streamed_script(joaat("apptrackify")) > 0 || Global_101652.f_12994.f_89)
		{
			if (script::_get_number_of_instances_of_streamed_script(joaat("michael2")) > 0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}
		else
		{
			return true;
		}
	}
	return false;
}

void func_44()//Position - 0x2EF4
{
	float fVar0;
	
	fVar0 = func_40(vLocal_483, vLocal_486, -90f, 0f, 90f, Global_14403, 350f, 0);
	mobile::set_mobile_phone_scale((500f + (75f * (1f - fVar0))));
	if (fVar0 >= 1f)
	{
		Global_16778 = 0;
		func_52();
		iLocal_18 = 0;
	}
}

void func_45()//Position - 0x2F48
{
	if (Global_2595243 == 0)
	{
		if (iLocal_35 < 0)
		{
			iLocal_35 = 0;
		}
		func_46(Global_14424, "SET_HEADER", "CELL_INBOX", 0, 0, 0, 0);
		func_49(Global_14424, "DISPLAY_VIEW", 8f, system::to_float(iLocal_35), -1082130432, -1082130432, -1082130432);
		if (Global_14431)
		{
			if (iLocal_32 > 0)
			{
				func_19(Global_14424, "SET_SOFT_KEYS", 2f, 1f, 2f, -1f, -1f, "CELL_214", 0, 0, 0, 0);
			}
			else
			{
				func_19(Global_14424, "SET_SOFT_KEYS", 2f, 0f, 2f, -1f, -1f, 0, 0, 0, 0, 0);
			}
			func_19(Global_14424, "SET_SOFT_KEYS", 3f, 1f, 4f, -1f, -1f, "CELL_206", 0, 0, 0, 0);
		}
		else
		{
			if (iLocal_32 > 0)
			{
				func_19(Global_14424, "SET_SOFT_KEYS", 2f, 1f, 2f, -1f, -1f, 0, 0, 0, 0, 0);
			}
			else
			{
				func_19(Global_14424, "SET_SOFT_KEYS", 2f, 0f, 2f, -1f, -1f, 0, 0, 0, 0, 0);
			}
			func_19(Global_14424, "SET_SOFT_KEYS", 3f, 1f, 4f, -1f, -1f, 0, 0, 0, 0, 0);
		}
		if (Global_69697)
		{
			func_19(Global_14424, "SET_SOFT_KEYS", 1f, 0f, 1f, -1f, -1f, 0, 0, 0, 0, 0);
			gameplay::clear_bit(&Global_2313, 17);
		}
		else
		{
			func_19(Global_14424, "SET_SOFT_KEYS", 1f, 0f, 1f, -1f, -1f, 0, 0, 0, 0, 0);
			gameplay::clear_bit(&Global_2313, 17);
		}
	}
	else
	{
		iLocal_35 = 0;
	}
}

void func_46(int iParam0, char* sParam1, char* sParam2, char* sParam3, char* sParam4, char* sParam5, char* sParam6)//Position - 0x307A
{
	graphics::_push_scaleform_movie_function(iParam0, sParam1);
	func_15(sParam2);
	if (!gameplay::is_string_null_or_empty(sParam3))
	{
		func_15(sParam3);
	}
	if (!gameplay::is_string_null_or_empty(sParam4))
	{
		func_15(sParam4);
	}
	if (!gameplay::is_string_null_or_empty(sParam5))
	{
		func_15(sParam5);
	}
	if (!gameplay::is_string_null_or_empty(sParam6))
	{
		func_15(sParam6);
	}
	graphics::_pop_scaleform_movie_function_void();
}

void func_47()//Position - 0x30D5
{
	int iVar0[12];
	int iVar13;
	int iVar14;
	int iVar15;
	int iVar16;
	struct<8> Var17;
	int iVar33[10];
	int iVar44;
	
	iLocal_32 = 0;
	iLocal_33 = 0;
	func_26();
	iVar13 = 0;
	iVar14 = 0;
	while (iVar13 < 11)
	{
		if (script::_get_number_of_instances_of_streamed_script(joaat("cellphone_flashhand")) == 0)
		{
			func_52();
		}
		iVar15 = 0;
		iVar16 = 11;
		Global_2593993[iVar16 /*104*/].f_18 = -1;
		Global_2593993[iVar16 /*104*/].f_18.f_1 = 0;
		Global_2593993[iVar16 /*104*/].f_18.f_2 = 0;
		Global_2593993[iVar16 /*104*/].f_18.f_3 = 0;
		Global_2593993[iVar16 /*104*/].f_18.f_5 = 0;
		while (iVar15 < 12)
		{
			if (script::_get_number_of_instances_of_streamed_script(joaat("cellphone_flashhand")) == 0)
			{
				func_52();
			}
			if (iVar0[iVar15] == 0)
			{
				if (Global_2593993[iVar15 /*104*/].f_24 != 0)
				{
					if (Global_2593993[iVar15 /*104*/].f_99[Global_14443] == 1)
					{
						if (func_48(Global_2593993[iVar15 /*104*/].f_18, Global_2593993[iVar16 /*104*/].f_18))
						{
							iVar16 = iVar15;
							if (Global_2593993[iVar16 /*104*/].f_28 == 0)
							{
								iLocal_37 = 0;
							}
							else
							{
								iLocal_37 = 1;
							}
						}
					}
				}
			}
			iVar15++;
		}
		iLocal_19[iVar13] = iVar16;
		iVar0[iVar16] = 1;
		if (Global_2593993[iVar16 /*104*/].f_24 != 0)
		{
			if (Global_2593993[iVar16 /*104*/].f_99[Global_14443] == 1)
			{
				graphics::_push_scaleform_movie_function(Global_14424, "SET_DATA_SLOT");
				graphics::_push_scaleform_movie_function_parameter_int(8);
				graphics::_push_scaleform_movie_function_parameter_int(iVar13);
				graphics::_push_scaleform_movie_function_parameter_int(iLocal_37);
				graphics::_push_scaleform_movie_function_parameter_bool(false);
				if (Global_2593993[iVar16 /*104*/].f_17 == 145)
				{
					graphics::_begin_text_component("CELL_2000");
					ui::add_text_component_substring_player_name(&(Global_2593993[iVar16 /*104*/].f_50));
					graphics::_end_text_component();
				}
				else
				{
					func_15(&(Global_101652.f_26993[Global_2593993[iVar16 /*104*/].f_17 /*29*/].f_3));
				}
				Var17 = { Global_2593993[iVar16 /*104*/] };
				StringConCat(&Var17, "_SUB", 64);
				func_15(&Var17);
				graphics::_pop_scaleform_movie_function_void();
				iLocal_32++;
				iLocal_33++;
			}
		}
		iVar13++;
	}
	iVar13 = iLocal_32;
	iVar44 = 0;
	while (iVar13 < (iLocal_493 + iLocal_32))
	{
		iVar14 = 0;
		iVar44 = 0;
		while (iVar14 < iLocal_493 && iVar44 == 0)
		{
			socialclub::_0x4737980E8A283806(iVar14, &Local_494);
			if (iVar33[iVar14] == 0)
			{
				graphics::_push_scaleform_movie_function(Global_14424, "SET_DATA_SLOT");
				graphics::_push_scaleform_movie_function_parameter_int(8);
				graphics::_push_scaleform_movie_function_parameter_int(iVar13);
				if (iVar13 == 0)
				{
					if (Global_2593992 == 0)
					{
						graphics::_push_scaleform_movie_function_parameter_int(1);
					}
					else
					{
						graphics::_push_scaleform_movie_function_parameter_int(0);
					}
				}
				else
				{
					graphics::_push_scaleform_movie_function_parameter_int(1);
				}
				graphics::_push_scaleform_movie_function_parameter_bool(false);
				graphics::_begin_text_component("CELL_2000");
				ui::add_text_component_substring_player_name(&(Local_494.f_2));
				graphics::_end_text_component();
				graphics::_begin_text_component("CELL_EMAIL_SUBJ");
				ui::add_text_component_substring_player_name(&(Local_494.f_23[0 /*16*/]));
				ui::add_text_component_substring_player_name(&(Local_494.f_23[1 /*16*/]));
				graphics::_end_text_component();
				graphics::_pop_scaleform_movie_function_void();
				iVar33[iVar14] = 1;
				iLocal_19[iVar13] = iVar14;
				iVar44 = 1;
				iLocal_32++;
				if (iVar14 == 0)
				{
					iLocal_489 = Local_494.f_1;
				}
			}
			iVar14++;
		}
		iVar13++;
	}
}

bool func_48(struct<6> Param0, struct<6> Param6)//Position - 0x339D
{
	struct<4> Var0;
	struct<4> Var6;
	int iVar12;
	int iVar13;
	
	if (Param0.f_5 < Param6.f_5)
	{
		return false;
	}
	if (Param0.f_5 > Param6.f_5)
	{
		return true;
	}
	if (Param0.f_5 == Param6.f_5)
	{
		if (Param0.f_4 < Param6.f_4)
		{
			return false;
		}
		if (Param0.f_4 > Param6.f_4)
		{
			return true;
		}
		if (Param0.f_4 == Param6.f_4)
		{
			Var0 = Param0;
			Var0.f_1 = Param0.f_1 * 60;
			Var0.f_2 = Param0.f_2 * 3600;
			Var0.f_3 = (Param0.f_3 * 86400);
			iVar12 = (((Var0 + Var0.f_1) + Var0.f_2) + Var0.f_3);
			Var6 = Param6;
			Var6.f_1 = Param6.f_1 * 60;
			Var6.f_2 = Param6.f_2 * 3600;
			Var6.f_3 = (Param6.f_3 * 86400);
			iVar13 = (((Var6 + Var6.f_1) + Var6.f_2) + Var6.f_3);
			if (iVar12 > iVar13 || iVar12 == iVar13)
			{
				return true;
			}
			else
			{
				return false;
			}
		}
	}
	return false;
}

void func_49(int iParam0, char* sParam1, float fParam2, float fParam3, float fParam4, float fParam5, float fParam6)//Position - 0x3488
{
	graphics::_push_scaleform_movie_function(iParam0, sParam1);
	graphics::_push_scaleform_movie_function_parameter_int(system::round(fParam2));
	if (fParam3 != -1f)
	{
		graphics::_push_scaleform_movie_function_parameter_int(system::round(fParam3));
	}
	if (fParam4 != -1f)
	{
		graphics::_push_scaleform_movie_function_parameter_int(system::round(fParam4));
	}
	if (fParam5 != -1f)
	{
		graphics::_push_scaleform_movie_function_parameter_int(system::round(fParam5));
	}
	if (fParam6 != -1f)
	{
		graphics::_push_scaleform_movie_function_parameter_int(system::round(fParam6));
	}
	graphics::_pop_scaleform_movie_function_void();
}

void func_50()//Position - 0x34EB
{
	switch (unk::_get_ui_language_id())
	{
		case -1:
			unk_0x07DBD622D9533857("gta5mkt_en");
			break;
		
		case 0:
			unk_0x07DBD622D9533857("gta5mkt_en");
			break;
		
		case 1:
			unk_0x07DBD622D9533857("gta5mkt_fr");
			break;
		
		case 2:
			unk_0x07DBD622D9533857("gta5mkt_ge");
			break;
		
		case 3:
			unk_0x07DBD622D9533857("gta5mkt_it");
			break;
		
		case 4:
			unk_0x07DBD622D9533857("gta5mkt_sp");
			break;
		
		case 5:
			unk_0x07DBD622D9533857("gta5mkt_pt");
			break;
		
		case 6:
			unk_0x07DBD622D9533857("gta5mkt_pl");
			break;
		
		case 7:
			unk_0x07DBD622D9533857("gta5mkt_ru");
			break;
		
		case 8:
			unk_0x07DBD622D9533857("gta5mkt_ko");
			break;
		
		case 9:
			unk_0x07DBD622D9533857("gta5mkt_ch");
			break;
		
		case 10:
			unk_0x07DBD622D9533857("gta5mkt_ja");
			break;
		
		case 11:
			unk_0x07DBD622D9533857("gta5mkt_me");
			break;
	}
	socialclub::_0x040ADDCBAFA1018A(0, 6);
	system::wait(0);
	iLocal_490 = 1;
	iLocal_491 = false;
	while (iLocal_490 && Global_14443.f_1 > 3)
	{
		system::wait(0);
		iLocal_492 = socialclub::_0x16DA8172459434AA();
		if (func_4())
		{
			Global_14443.f_1 = 3;
			iLocal_490 = 0;
			iLocal_491 = false;
		}
		switch (iLocal_492)
		{
			case 3:
				iLocal_490 = 0;
				iLocal_491 = true;
				break;
			
			case 0:
				iLocal_490 = 0;
				iLocal_491 = true;
				break;
			
			case 1:
				break;
			
			case 4:
				iLocal_490 = 0;
				iLocal_491 = false;
				break;
			
			case 2:
				iLocal_490 = 0;
				iLocal_491 = false;
				break;
		}
	}
	if (iLocal_491)
	{
		iLocal_493 = unk_0x7DB18CA8CAD5B098();
	}
	else
	{
		iLocal_493 = 0;
	}
}

void func_51()//Position - 0x3698
{
	StringCopy(&(Local_62[0 /*6*/]), "SXT_JUL_1ST", 24);
	StringCopy(&(Local_177[0 /*16*/]), "05_a_sext_stripperJuliet", 64);
	StringCopy(&(Local_62[1 /*6*/]), "SXT_JUL_2ND", 24);
	StringCopy(&(Local_177[1 /*16*/]), "05_b_sext_stripperJuliet", 64);
	StringCopy(&(Local_62[2 /*6*/]), "SXT_JUL_NEED", 24);
	StringCopy(&(Local_177[2 /*16*/]), "05_c_sext_stripperJuliet", 64);
	StringCopy(&(Local_62[3 /*6*/]), "SXT_NIK_1ST", 24);
	StringCopy(&(Local_177[3 /*16*/]), "06_a_sext_stripperNikki", 64);
	StringCopy(&(Local_62[4 /*6*/]), "SXT_NIK_2ND", 24);
	StringCopy(&(Local_177[4 /*16*/]), "06_b_sext_stripperNikki", 64);
	StringCopy(&(Local_62[5 /*6*/]), "SXT_NIK_NEED", 24);
	StringCopy(&(Local_177[5 /*16*/]), "06_c_sext_stripperNikki", 64);
	StringCopy(&(Local_62[6 /*6*/]), "SXT_SAP_1ST", 24);
	StringCopy(&(Local_177[6 /*16*/]), "08_a_sext_stripperSapphire", 64);
	StringCopy(&(Local_62[7 /*6*/]), "SXT_SAP_2ND", 24);
	StringCopy(&(Local_177[7 /*16*/]), "08_b_sext_stripperSapphire", 64);
	StringCopy(&(Local_62[8 /*6*/]), "SXT_SAP_NEED", 24);
	StringCopy(&(Local_177[8 /*16*/]), "08_c_sext_stripperSapphire", 64);
	StringCopy(&(Local_62[9 /*6*/]), "SXT_INF_1ST", 24);
	StringCopy(&(Local_177[9 /*16*/]), "04_a_sext_stripperInfernus", 64);
	StringCopy(&(Local_62[10 /*6*/]), "SXT_INF_2ND", 24);
	StringCopy(&(Local_177[10 /*16*/]), "04_b_sext_stripperInfernus", 64);
	StringCopy(&(Local_62[11 /*6*/]), "SXT_INF_NEED", 24);
	StringCopy(&(Local_177[11 /*16*/]), "04_c_sext_stripperInfernus", 64);
	StringCopy(&(Local_62[12 /*6*/]), "SXT_TXI_1ST", 24);
	StringCopy(&(Local_177[12 /*16*/]), "11_a_sext_taxiLiz", 64);
	StringCopy(&(Local_62[13 /*6*/]), "SXT_TXI_2ND", 24);
	StringCopy(&(Local_177[13 /*16*/]), "11_b_sext_taxiLiz", 64);
	StringCopy(&(Local_62[14 /*6*/]), "SXT_TXI_NEED", 24);
	StringCopy(&(Local_177[14 /*16*/]), "11_c_sext_taxiLiz", 64);
	StringCopy(&(Local_62[15 /*6*/]), "SXT_HCH_1ST", 24);
	StringCopy(&(Local_177[15 /*16*/]), "10_a_sext_hitcherGirl", 64);
	StringCopy(&(Local_62[16 /*6*/]), "SXT_HCH_2ND", 24);
	StringCopy(&(Local_177[16 /*16*/]), "10_b_sext_hitcherGirl", 64);
	StringCopy(&(Local_62[17 /*6*/]), "SXT_HCH_NEED", 24);
	StringCopy(&(Local_177[17 /*16*/]), "10_c_sext_hitcherGirl", 64);
	StringCopy(&(Local_62[18 /*6*/]), "SOL2_PASS", 24);
	StringCopy(&(Local_177[18 /*16*/]), "executiveproducer", 64);
}

void func_52()//Position - 0x3858
{
	if (func_43() == 0)
	{
		mobile::set_mobile_phone_position(Global_14396[Global_14388 /*3*/]);
	}
	if (script::_get_number_of_instances_of_streamed_script(joaat("cellphone_flashhand")) == 0)
	{
		func_53(0);
	}
	if (iLocal_482)
	{
		graphics::set_streamed_texture_dict_as_no_longer_needed(&Local_46);
	}
	Global_16779 = 0;
	Global_16778 = 0;
	script::terminate_this_thread();
}

void func_53(int iParam0)//Position - 0x38A0
{
	if (Global_14604)
	{
		func_55(0, 0);
	}
	if (Global_14443.f_1 == 10 || Global_14443.f_1 == 9)
	{
		gameplay::set_bit(&Global_2314, 16);
	}
	if (audio::is_mobile_phone_call_ongoing())
	{
		audio::stop_scripted_conversation(false);
	}
	Global_15745 = 5;
	if (iParam0 == 1)
	{
		gameplay::set_bit(&Global_2313, 30);
	}
	else
	{
		gameplay::clear_bit(&Global_2313, 30);
	}
	if (!func_54())
	{
		Global_14443.f_1 = 3;
	}
}

bool func_54()//Position - 0x3910
{
	if (Global_14443.f_1 == 1 || Global_14443.f_1 == 0)
	{
		return true;
	}
	return false;
}

void func_55(int iParam0, int iParam1)//Position - 0x3937
{
	if (iParam0)
	{
		if (func_56(0))
		{
			Global_14604 = 1;
			if (iParam1)
			{
				mobile::get_mobile_phone_position(&Global_14380);
			}
			Global_14371 = { Global_14389[Global_14388 /*3*/] };
			mobile::set_mobile_phone_position(Global_14371);
		}
	}
	else if (Global_14604 == 1)
	{
		Global_14604 = 0;
		Global_14371 = { Global_14396[Global_14388 /*3*/] };
		if (iParam1)
		{
			mobile::set_mobile_phone_position(Global_14380);
		}
		else
		{
			mobile::set_mobile_phone_position(Global_14371);
		}
	}
}

bool func_56(int iParam0)//Position - 0x39AB
{
	if (iParam0 == 1)
	{
		if (Global_14443.f_1 > 3)
		{
			if (gameplay::is_bit_set(Global_2313, 14))
			{
				return true;
			}
			else
			{
				return false;
			}
		}
		else
		{
			return false;
		}
	}
	if (script::_get_number_of_instances_of_streamed_script(joaat("cellphone_flashhand")) > 0)
	{
		return true;
	}
	if (Global_14443.f_1 > 3)
	{
		return true;
	}
	return false;
}

