// File: /workspace/github_cpp_makefile_star2_O1/sanaa-khan[P]mini-linux-shell/gbsh.cpp
// Function: setEnvVar(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>)
void setEnvVar(vector<string> tokens) {

	char cwd[100];
	getcwd(cwd, 100);

	setenv("SHELL", cwd, 1);

	string name, value;

	if (tokens.size() == 1) {
		cout << "\033[1;31m" << "Error: ";
		cout << "\033[0;38m" << "Name of environment variable not given.\n";
		return;
	}

	name = tokens[1];

	if (tokens.size() == 2)
		value = "";

	else if (tokens.size() == 3)
		value = tokens[2];

	else {
		cout << "\033[1;31m" << "Error: ";
		cout << "\033[0;38m" << "Too many arguments provided.\n";
		return;
	}

	char* var = getenv(name.c_str());

	if (var != NULL)
		cout << "'" << name << "' is already defined.\n";

	else
		setenv(name.c_str(), value.c_str(), 0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xb0, %rsp
movq %rdi, %rbx
leaq 0x40(%rsp), %r14
movl $0x64, %esi
movq %r14, %rdi
callq 0x20a0
leaq 0x1aa9(%rip), %rdi      # 0x5069
movq %r14, %rsi
movl $0x1, %edx
callq 0x2270
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
xorl %eax, %eax
movq %rax, -0x8(%r14)
movb %al, (%r14)
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
movq %rax, -0x8(%r15)
movb %al, (%r15)
movq (%rbx), %rsi
movq 0x8(%rbx), %rax
subq %rsi, %rax
cmpq $0x20, %rax
jne 0x3658
movq 0x39c2(%rip), %rdi      # 0x6fc8
leaq 0x1a74(%rip), %rsi      # 0x5081
movl $0x7, %edx
callq 0x21b0
movq 0x39aa(%rip), %rdi      # 0x6fc8
leaq 0x1a64(%rip), %rsi      # 0x5089
movl $0x7, %edx
callq 0x21b0
movq 0x3992(%rip), %rdi      # 0x6fc8
leaq 0x1a54(%rip), %rsi      # 0x5091
movl $0x7, %edx
callq 0x21b0
movl $0x28, %edx
leaq 0x1ab1(%rip), %rsi      # 0x5104
jmp 0x3758
addq $0x20, %rsi
movq %rsp, %rdi
callq 0x20c0
movq (%rbx), %rsi
movq 0x8(%rbx), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq $0x3, %rax
je 0x369e
cmpq $0x2, %rax
jne 0x3704
leaq 0x20(%rsp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x1a3a(%rip), %rcx      # 0x50cc
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x22b0
jmp 0x36ac
addq $0x40, %rsi
leaq 0x20(%rsp), %rdi
callq 0x20c0
movq (%rsp), %rbx
movq %rbx, %rdi
callq 0x21f0
testq %rax, %rax
je 0x379e
movq 0x3900(%rip), %rdi      # 0x6fc8
leaq 0x1a7c(%rip), %rsi      # 0x514b
movl $0x1, %edx
callq 0x21b0
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0x38df(%rip), %rdi      # 0x6fc8
callq 0x21b0
leaq 0x1a58(%rip), %rsi      # 0x514d
movl $0x16, %edx
movq %rax, %rdi
callq 0x21b0
jmp 0x3764
movq 0x38bd(%rip), %rdi      # 0x6fc8
leaq 0x196f(%rip), %rsi      # 0x5081
movl $0x7, %edx
callq 0x21b0
movq 0x38a5(%rip), %rdi      # 0x6fc8
leaq 0x195f(%rip), %rsi      # 0x5089
movl $0x7, %edx
callq 0x21b0
movq 0x388d(%rip), %rdi      # 0x6fc8
leaq 0x194f(%rip), %rsi      # 0x5091
movl $0x7, %edx
callq 0x21b0
movl $0x1d, %edx
leaq 0x19d5(%rip), %rsi      # 0x512d
movq 0x3869(%rip), %rdi      # 0x6fc8
callq 0x21b0
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x377b
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21a0
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x3791
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21a0
addq $0xb0, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x20(%rsp), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2270
jmp 0x3764
jmp 0x37b1
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x37cb
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21a0
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x37e1
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x22f0