// File: /workspace/github_c_makefile_star2_O0/rakitzis[P]rc/builtins.c
// Function: parselimit
static bool parselimit(const struct Limit *resource, rlim_t *limit, char *s) {
	char *t;
	int len = strlen(s);
	const struct Suffix *suf = resource->suffix;

	*limit = 1;
	if (streq(s, "unlimited")) {
		*limit = RLIM_INFINITY;
		return TRUE;
	}
	if (suf == TIMESUF && (t = strchr(s, ':')) != NULL) {
		int min, sec;
		*t++ = '\0';
		min = a2u(s); sec = a2u(t);
		if (min == -1 || sec == -1) return FALSE;
		*limit = 60 * min + sec;
	} else {
		int n;
		for (; suf != NULL; suf = suf->next)
			if (streq(suf->name, s + len - strlen(suf->name))) {
				s[len - strlen(suf->name)] = '\0';
				*limit *= suf->amount;
				break;
			}
		n = a2u(s);
		if (n == -1) return FALSE;
		*limit *= n;
	}
	return TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x30f0
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq $0x1, (%rax)
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
movsbl 0x10890(%rip), %ecx     # 0x15265
cmpl %ecx, %eax
jne 0x4a05
movq -0x20(%rbp), %rdi
leaq 0x10881(%rip), %rsi     # 0x15265
callq 0x31e0
cmpl $0x0, %eax
jne 0x4a05
movq -0x18(%rbp), %rax
movq $-0x1, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x4baf
leaq 0x1a2d4(%rip), %rax     # 0x1ece0
cmpq %rax, -0x38(%rbp)
jne 0x4a8c
movq -0x20(%rbp), %rdi
movl $0x3a, %esi
callq 0x3120
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
je 0x4a8c
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movb $0x0, (%rax)
movq -0x20(%rbp), %rdi
movl $0xa, %esi
callq 0x11cf0
movl %eax, -0x3c(%rbp)
movq -0x28(%rbp), %rdi
movl $0xa, %esi
callq 0x11cf0
movl %eax, -0x40(%rbp)
cmpl $-0x1, -0x3c(%rbp)
je 0x4a6a
cmpl $-0x1, -0x40(%rbp)
jne 0x4a76
movl $0x0, -0x4(%rbp)
jmp 0x4baf
imull $0x3c, -0x3c(%rbp), %eax
addl -0x40(%rbp), %eax
movslq %eax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
jmp 0x4ba8
jmp 0x4a8e
cmpq $0x0, -0x38(%rbp)
je 0x4b79
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movsbl (%rax), %eax
movl %eax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movslq -0x2c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x30f0
movq -0x50(%rbp), %rcx
movq %rax, %rsi
movl -0x48(%rbp), %eax
xorl %edx, %edx
subq %rsi, %rdx
movsbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jne 0x4b67
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rax
movslq -0x2c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x30f0
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdi
movq %rax, %rcx
xorl %eax, %eax
subq %rcx, %rax
addq %rax, %rsi
callq 0x31e0
cmpl $0x0, %eax
jne 0x4b67
movq -0x20(%rbp), %rax
movq %rax, -0x68(%rbp)
movslq -0x2c(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x30f0
movq -0x70(%rbp), %rcx
movq %rax, %rdx
movq -0x68(%rbp), %rax
subq %rdx, %rcx
movb $0x0, (%rax,%rcx)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x18(%rbp), %rax
imulq (%rax), %rcx
movq %rcx, (%rax)
jmp 0x4b79
jmp 0x4b69
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0x4a8e
movq -0x20(%rbp), %rdi
movl $0xa, %esi
callq 0x11cf0
movl %eax, -0x44(%rbp)
cmpl $-0x1, -0x44(%rbp)
jne 0x4b99
movl $0x0, -0x4(%rbp)
jmp 0x4baf
movslq -0x44(%rbp), %rcx
movq -0x18(%rbp), %rax
imulq (%rax), %rcx
movq %rcx, (%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)