// File: /workspace/github_cpp_makefile_star2_O1/UTSASRG[P]Guarder/libguarder.cpp
// Function: parseEnvOpts()
void parseEnvOpts() {
		char * value;

		// opts is a global struct located in bibopheap.hh
		if((value = getenv("GUARDER_NUMERATOR"))) {
				opts.over_prov_numerator = atoi(value);
		}
    if((value = getenv("GUARDER_DENOMINATOR"))) {
        opts.over_prov_denominator = atoi(value);
    }
		// Over provisioning ratio must be greater than or equal to 1
		if((opts.over_prov_denominator <= 0) ||
						(opts.over_prov_numerator < opts.over_prov_denominator)) {
				PRERR("over provisioning ratio invalid; setting to 1/1");
				opts.over_prov_numerator = 1;
				opts.over_prov_denominator = 1;
		}

    if((value = getenv("GUARDER_ENTROPY_BITS"))) {
        opts.bibop_entropy_bits = atoi(value);
    }
		// Entropy bits must be a positive integer
		if(opts.bibop_entropy_bits <= 0) {
				PRERR("invalid bibop entropy bits; setting to default value (%u)",
								DEFAULT_BIBOP_ENTROPY_BITS);
				opts.bibop_entropy_bits = DEFAULT_BIBOP_ENTROPY_BITS;
		}

		opts.bibop_cache_size = (1U << (opts.bibop_entropy_bits + 1));

		/*
    if((value = getenv("GUARDER_CACHE_DIVISOR"))) {
        opts.bibop_cache_allowance_divisor = atoi(value);
    }
		// Cache allowance divisor must be a positive integer >= 2
		if(opts.bibop_cache_allowance_divisor < 2) {
				PRERR("invalid bibop cache allowance divisor; "
								"setting to default value (%u)", DEFAULT_BIBOP_CACHE_ALLOWANCE_DIVISOR);
				opts.bibop_cache_allowance_divisor = DEFAULT_BIBOP_CACHE_ALLOWANCE_DIVISOR;
		}
		*/

    if((value = getenv("GUARDER_RAND_GUARD_PROP"))) {
        opts.random_guard_prop = atof(value);
    }
		// Random guard proportion must be a fraction between [0, 1)
		if((opts.random_guard_prop < 0.0f) || (opts.random_guard_prop >= 1.0f)) {
				PRERR("invalid random guard proportion; "
								"setting to default value (%4.2f)", DEFAULT_RAND_GUARD_PROP);
				opts.random_guard_prop = DEFAULT_RAND_GUARD_PROP;
		}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0x4123(%rip), %rdi      # 0x9120
callq 0x4380
testq %rax, %rax
je 0x5019
movq %rax, %rdi
callq 0x4470
movq 0x7f0a(%rip), %rcx      # 0xcf20
movl %eax, 0xc(%rcx)
leaq 0x4112(%rip), %rdi      # 0x9132
callq 0x4380
testq %rax, %rax
je 0x503c
movq %rax, %rdi
callq 0x4470
movq 0x7ee7(%rip), %rcx      # 0xcf20
movl %eax, 0x10(%rcx)
movq 0x7edd(%rip), %r14      # 0xcf20
movl 0x10(%r14), %eax
decl %eax
cmpl 0xc(%r14), %eax
jb 0x50b5
callq 0x41e0
movq %rax, %rbx
callq 0x4250
leaq 0x40e3(%rip), %rdx      # 0x9146
leaq 0x40a7(%rip), %r8       # 0x9111
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
movq %rax, %rcx
movl $0xb4, %r9d
xorl %eax, %eax
callq 0x4490
callq 0x41e0
movq %rax, %rbx
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x40f0
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0xc(%r14)
leaq 0x40de(%rip), %rdi      # 0x919a
callq 0x4380
testq %rax, %rax
je 0x50d2
movq %rax, %rdi
callq 0x4470
movl %eax, 0x4(%r14)
cmpl $0x0, 0x4(%r14)
jne 0x513d
callq 0x41e0
movq %rax, %rbx
callq 0x4250
movl $0xa, %ebp
movl %ebp, (%rsp)
leaq 0x40ba(%rip), %rdx      # 0x91af
leaq 0x4015(%rip), %r8       # 0x9111
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
movq %rax, %rcx
movl $0xbf, %r9d
xorl %eax, %eax
callq 0x4490
callq 0x41e0
movq %rax, %rbx
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x40f0
movl %ebp, 0x4(%r14)
movb 0x4(%r14), %cl
incb %cl
movl $0x1, %eax
shll %cl, %eax
movl %eax, 0x8(%r14)
leaq 0x40b8(%rip), %rdi      # 0x920d
callq 0x4380
testq %rax, %rax
je 0x5171
movq %rax, %rdi
callq 0x4390
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x14(%r14)
movss 0x14(%r14), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
ja 0x5188
ucomiss 0x3ec2(%rip), %xmm0     # 0x9048
jb 0x51f0
callq 0x41e0
movq %rax, %rbx
callq 0x4250
leaq 0x4089(%rip), %rdx      # 0x9225
leaq 0x3f6e(%rip), %r8       # 0x9111
movsd 0x3ea5(%rip), %xmm0     # 0x9050
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
movq %rax, %rcx
movl $0xd7, %r9d
movb $0x1, %al
callq 0x4490
callq 0x41e0
movq %rax, %rbx
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x40f0
movl $0x3dcccccd, 0x14(%r14) # imm = 0x3DCCCCCD
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq