// File: /workspace/github_cpp_makefile_star2_O3/pixlark[P]Badge/src/files.cc
// Function: Files::init(char const*)
void init(const char * first_file)
	{
		Files::first_file = strdup(first_file);
		
		{ // set cwd
			char buf[path_max];
			getcwd(buf, path_max);

			String_Builder builder;
			builder.append(buf);
			builder.append("/");
			cwd = builder.final_string();
		}
		{ // set running_dir
			size_t i = strlen(first_file);
			while (i > 0 && first_file[i - 1] != '/') {
				i--;
			}
			
			String_Builder builder;
			builder.append(cwd);
			if (i == 0) {
				// @Hack kind of a hack
				builder.append("./");
			} else {
				builder.append_size(first_file, i);
			}
			
			running_dir = builder.final_string();
		}
		{ // set stdlib dir
			String_Builder builder;
			auto env_variable = getenv("BADGE_STDLIB_PATH");
			if (!env_variable) {
				fatal("$BADGE_STDLIB_PATH not set!");
			}
			builder.append(env_variable);
			if (builder.at(builder.size() - 1) != '/') {
				builder.append("/");
			}
			stdlib_dir = builder.final_string();
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1028, %rsp           # imm = 0x1028
movq %rdi, %rbx
callq 0x11d0
movq %rax, 0xe505(%rip)      # 0x101e8
leaq -0x1050(%rbp), %r14
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdi
callq 0x10a0
leaq -0x50(%rbp), %r15
movq $0x0, 0x8(%r15)
movq $0x4, 0x10(%r15)
movq 0xe2be(%rip), %rax      # 0xffd0
movq %rax, 0x18(%r15)
movq 0xe2ab(%rip), %r13      # 0xffc8
movq %r13, 0x20(%r15)
movl $0x4, %edi
callq 0x1200
movq %rax, (%r15)
movq %r15, %rdi
movq %r14, %rsi
callq 0x1456
leaq 0x95e9(%rip), %rsi      # 0xb329
leaq -0x50(%rbp), %rdi
callq 0x1456
movq -0x48(%rbp), %r14
leaq 0x1(%r14), %rdi
callq 0x1200
movq %rax, %r15
movq -0x50(%rbp), %r12
movq %rax, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x10b0
movb $0x0, (%r15,%r14)
movq %r15, 0xe479(%rip)      # 0x101f0
movq %r12, %rdi
callq *-0x30(%rbp)
movq %rbx, %rdi
callq 0x1080
testq %rax, %rax
je 0x1da0
movq %rax, %r14
cmpb $0x2f, -0x1(%rbx,%r14)
setne %r12b
je 0x1da6
decq %r14
jne 0x1d8d
jmp 0x1da3
movb $0x1, %r12b
xorl %r14d, %r14d
leaq -0x1050(%rbp), %r15
movq $0x0, 0x8(%r15)
movq $0x4, 0x10(%r15)
movq 0xe20c(%rip), %rax      # 0xffd0
movq %rax, 0x18(%r15)
movq %r13, 0x20(%r15)
movl $0x4, %edi
callq 0x1200
movq %rax, (%r15)
movq 0xe410(%rip), %rsi      # 0x101f0
movq %r15, %rdi
callq 0x1456
testb %r12b, %r12b
je 0x1e02
leaq 0x9534(%rip), %rsi      # 0xb328
leaq -0x1050(%rbp), %rdi
callq 0x1456
jmp 0x1e1a
xorl %r12d, %r12d
movsbl (%rbx,%r12), %esi
movq %r15, %rdi
callq 0x51c6
incq %r12
cmpq %r12, %r14
jne 0x1e05
movq -0x1048(%rbp), %rbx
leaq 0x1(%rbx), %rdi
callq 0x1200
movq %rax, %r14
movq -0x1050(%rbp), %r15
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x10b0
movb $0x0, (%r14,%rbx)
movq %r14, 0xe3aa(%rip)      # 0x101f8
movq %r15, %rdi
callq *-0x1030(%rbp)
movq $0x0, -0x1048(%rbp)
movq $0x4, -0x1040(%rbp)
movq 0xe15c(%rip), %rax      # 0xffd0
movq %rax, -0x1038(%rbp)
movq %r13, -0x1030(%rbp)
movl $0x4, %edi
callq 0x1200
movq %rax, -0x1050(%rbp)
leaq 0x9491(%rip), %rdi      # 0xb32b
callq 0x1130
testq %rax, %rax
je 0x1f34
leaq -0x1050(%rbp), %rdi
movq %rax, %rsi
callq 0x1456
movq -0x1048(%rbp), %r14
testq %r14, %r14
je 0x1f42
movq -0x1050(%rbp), %rbx
cmpb $0x2f, -0x1(%rbx,%r14)
je 0x1ef3
leaq 0x9450(%rip), %rsi      # 0xb329
leaq -0x1050(%rbp), %rdi
callq 0x1456
movq -0x1050(%rbp), %rbx
movq -0x1048(%rbp), %r14
leaq 0x1(%r14), %rdi
callq 0x1200
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x10b0
movb $0x0, (%r15,%r14)
movq %r15, 0xe2e7(%rip)      # 0x10200
movq %rbx, %rdi
callq *-0x1030(%rbp)
addq $0x1028, %rsp           # imm = 0x1028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9402(%rip), %rdi      # 0xb33d
xorl %eax, %eax
callq 0x1a00
leaq 0x9347(%rip), %rdi      # 0xb290
leaq 0x9351(%rip), %rsi      # 0xb2a1
leaq 0x9360(%rip), %rcx      # 0xb2b7
movl $0x3b, %edx
callq 0x10d0
jmp 0x1fa3
jmp 0x1fa3
jmp 0x1fa3
movq %rax, %rbx
movq -0x1050(%rbp), %rdi
callq *-0x1030(%rbp)
jmp 0x1f9b
jmp 0x1fa3
jmp 0x1f8b
movq %rax, %rbx
movq -0x50(%rbp), %rdi
callq *-0x30(%rbp)
jmp 0x1f9b
jmp 0x1fa3
movq %rax, %rbx
movq -0x1050(%rbp), %rdi
callq *-0x1030(%rbp)
movq %rbx, %rdi
callq 0x11c0
movq %rax, %rdi
callq 0x51b8