// File: /workspace/github_c_makefile_star2_O2/rakitzis[P]rc/builtins.c
// Function: b_limit
static void b_limit(char **av) {
	const struct Limit *lp = limits;
	bool hard = FALSE;
	if (*++av != NULL && streq(*av, "-h")) {
		av++;
		hard = TRUE;
	}
	if (*av == NULL) {
		for (; lp->name != NULL; lp++)
			printlimit(lp, hard);
		return;
	}
	for (;; lp++) {
		if (lp->name == NULL) {
			fprint(2, "no such limit\n");
			set(FALSE);
			return;
		}
		if (streq(*av, lp->name))
			break;
	}
	if (*++av == NULL)
		printlimit(lp, hard);
	else {
		struct rlimit rlim;
		rlim_t pl;
		getrlimit(lp->flag, &rlim);
		if (!parselimit(lp, &pl, *av)) {
			fprint(2, "bad limit\n");
			set(FALSE);
			return;
		}
		if (hard)
			rlim.rlim_max = pl;
		else
			rlim.rlim_cur = pl;
		if (setrlimit(lp->flag, &rlim) == -1) {
			uerror("setrlimit");
			set(FALSE);
		} else
			set(TRUE);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x8(%rdi), %r14
testq %r14, %r14
je 0x3b09
leaq 0x8(%rdi), %r12
cmpb $0x2d, (%r14)
jne 0x3b2c
movb $0x1, %r13b
cmpb $0x68, 0x1(%r14)
jne 0x3af6
addq $0x10, %rdi
cmpb $0x0, 0x2(%r14)
setne %r13b
cmoveq %rdi, %r12
movl %r13d, %eax
xorb $0x1, %al
movzbl %al, %ebx
movq (%r12), %r14
testq %r14, %r14
jne 0x3b31
jmp 0x3b0b
xorl %ebx, %ebx
leaq 0x1503e(%rip), %r14     # 0x18b50
cmpq $0x0, (%r14)
je 0x3d1d
movq %r14, %rdi
movl %ebx, %esi
callq 0x4251
addq $0x18, %r14
jmp 0x3b12
movb $0x1, %r13b
xorl %ebx, %ebx
leaq 0x15018(%rip), %r15     # 0x18b50
movq (%r15), %rsi
testq %rsi, %rsi
je 0x3b59
movb (%r14), %al
cmpb (%rsi), %al
jne 0x3b53
movq %r14, %rdi
callq 0x31f0
testl %eax, %eax
je 0x3b7f
addq $0x18, %r15
jmp 0x3b38
leaq 0xa5f6(%rip), %rsi      # 0xe156
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0xa8f6
xorl %edi, %edi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb43a
cmpq $0x0, 0x8(%r12)
je 0x3c25
movl 0x8(%r15), %ebx
leaq 0x18(%rsp), %rsi
movl %ebx, %edi
callq 0x3340
movq 0x8(%r12), %r14
movq %r14, %rdi
callq 0x30f0
movq %rax, %r12
movq 0x10(%r15), %rbp
cmpb $0x75, (%r14)
jne 0x3bcc
leaq 0xa648(%rip), %rsi      # 0xe204
movq %r14, %rdi
callq 0x31f0
testl %eax, %eax
je 0x3cdd
movq %r14, (%rsp)
leaq 0x15099(%rip), %rax     # 0x18c70
cmpq %rax, %rbp
je 0x3c47
movl %ebx, 0xc(%rsp)
movslq %r12d, %rcx
movq (%rsp), %rax
movq %rcx, 0x10(%rsp)
leaq (%rax,%rcx), %rbx
testq %rbp, %rbp
je 0x3c3d
movq 0x10(%rbp), %r12
movb (%r12), %r14b
movq %r12, %rdi
callq 0x30f0
movq %rbx, %rsi
subq %rax, %rsi
cmpb (%rsi), %r14b
jne 0x3c1f
movq %rax, %r15
movq %r12, %rdi
callq 0x31f0
testl %eax, %eax
je 0x3c9b
movq (%rbp), %rbp
jmp 0x3bf0
movq %r15, %rdi
movl %ebx, %esi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4251
movq (%rsp), %rdi
pushq $0x1
popq %r14
jmp 0x3caf
pushq $0x3a
popq %rsi
movq (%rsp), %rdi
callq 0x3120
testq %rax, %rax
je 0x3bdc
movq %rax, %r15
incq %r15
movb $0x0, (%rax)
pushq $0xa
popq %r12
movq (%rsp), %rdi
movl %r12d, %esi
callq 0xbf32
movl %eax, %ebp
movq %r15, %rdi
movl %r12d, %esi
callq 0xbf32
cmpl $-0x1, %ebp
setne %cl
cmpl $-0x1, %eax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x3cc8
imull $0x3c, %ebp, %ecx
addl %eax, %ecx
movslq %ecx, %r14
jmp 0x3ce1
movq 0x10(%rsp), %rax
subq %r15, %rax
movq (%rsp), %rdi
movb $0x0, (%rdi,%rax)
movq 0x8(%rbp), %r14
pushq $0xa
popq %rsi
callq 0xbf32
cmpl $-0x1, %eax
movl 0xc(%rsp), %ebx
je 0x3cc8
cltq
imulq %rax, %r14
jmp 0x3ce1
leaq 0xa496(%rip), %rsi      # 0xe165
xorl %ebx, %ebx
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0xa8f6
jmp 0x3d16
pushq $-0x1
popq %r14
testb %r13b, %r13b
je 0x3ced
movq %r14, 0x18(%rsp)
jmp 0x3cf2
movq %r14, 0x20(%rsp)
leaq 0x18(%rsp), %rsi
movl %ebx, %edi
callq 0x3290
cmpl $-0x1, %eax
je 0x3d08
pushq $0x1
popq %rbx
jmp 0x3d16
leaq 0xa461(%rip), %rdi      # 0xe170
callq 0xbe9d
xorl %ebx, %ebx
movl %ebx, %edi
callq 0xb43a
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq