// File: /workspace/github_c_makefile_star2_O1/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 %rdi, %r14
leaq 0x8(%rdi), %r12
movq 0x8(%rdi), %rdi
xorl %ebx, %ebx
movb $0x1, %r13b
testq %rdi, %rdi
je 0x3c00
cmpb $0x2d, (%rdi)
jne 0x3c00
leaq 0xb578(%rip), %rsi      # 0xf160
callq 0x31f0
testl %eax, %eax
jne 0x3c00
addq $0x10, %r14
movl $0x1, %ebx
xorl %r13d, %r13d
movq %r14, %r12
movq (%r12), %r14
testq %r14, %r14
je 0x3c60
movb (%r14), %bpl
leaq 0x14f3d(%rip), %r15     # 0x18b50
leaq 0xb56d(%rip), %rsi      # 0xf187
cmpb (%rsi), %bpl
jne 0x3c2b
movq %r14, %rdi
callq 0x31f0
testl %eax, %eax
je 0x3c81
movq 0x18(%r15), %rsi
addq $0x18, %r15
testq %rsi, %rsi
jne 0x3c1a
leaq 0xb524(%rip), %rsi      # 0xf163
movl $0x2, %edi
xorl %eax, %eax
callq 0xb06f
xorl %edi, %edi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xbcdc
leaq 0x14ee9(%rip), %r14     # 0x18b50
movq %r14, %rdi
movl %ebx, %esi
callq 0x441d
cmpq $0x0, 0x18(%r14)
leaq 0x18(%r14), %r14
jne 0x3c67
jmp 0x3e64
cmpq $0x0, 0x8(%r12)
je 0x3d4c
movl 0x8(%r15), %ebp
leaq 0x18(%rsp), %rsi
movl %ebp, %edi
callq 0x3340
movq 0x8(%r12), %r14
movq %r14, %rdi
callq 0x30f0
movq %rax, %r12
movq 0x10(%r15), %rbx
cmpb $0x75, (%r14)
jne 0x3cce
leaq 0xb553(%rip), %rsi      # 0xf211
movq %r14, %rdi
callq 0x31f0
testl %eax, %eax
je 0x3dc0
leaq 0x14f9b(%rip), %rax     # 0x18c70
cmpq %rax, %rbx
je 0x3d64
movl $0x1, %r15d
testq %rbx, %rbx
je 0x3de3
movl %ebp, 0x8(%rsp)
movl %r13d, 0xc(%rsp)
movslq %r12d, %rax
movq %rax, 0x10(%rsp)
leaq (%r14,%rax), %rbp
movq 0x10(%rbx), %r12
movb (%r12), %r13b
movq %r12, %rdi
callq 0x30f0
movq %rbp, %rsi
subq %rax, %rsi
cmpb (%rsi), %r13b
jne 0x3d30
movq %rax, %r15
movq %r12, %rdi
callq 0x31f0
testl %eax, %eax
je 0x3dc9
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x3d02
movl 0xc(%rsp), %r13d
movl 0x8(%rsp), %ebp
movl $0x1, %r15d
jmp 0x3de3
movq %r15, %rdi
movl %ebx, %esi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x441d
movq %r14, %rdi
movl $0x3a, %esi
callq 0x3120
testq %rax, %rax
je 0x3cde
movl %ebp, %ebx
movq %rax, %r15
incq %r15
movb $0x0, (%rax)
movq %r14, %rdi
movl $0xa, %esi
callq 0xc890
movl %eax, %ebp
movq %r15, %rdi
movl $0xa, %esi
callq 0xc890
cmpl $-0x1, %ebp
setne %cl
cmpl $-0x1, %eax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x3e03
imull $0x3c, %ebp, %ecx
addl %eax, %ecx
movslq %ecx, %r15
xorl %eax, %eax
jmp 0x3e0b
movq $-0x1, %r15
jmp 0x3dfb
movq 0x10(%rsp), %rax
subq %r15, %rax
movb $0x0, (%r14,%rax)
movq 0x8(%rbx), %r15
movl 0xc(%rsp), %r13d
movl 0x8(%rsp), %ebp
movq %r14, %rdi
movl $0xa, %esi
callq 0xc890
cmpl $-0x1, %eax
je 0x3dff
cltq
imulq %rax, %r15
xorl %eax, %eax
jmp 0x3e0d
movb $0x1, %al
jmp 0x3e0d
movb $0x1, %al
movl $0x1, %r15d
movl %ebx, %ebp
testb %al, %al
je 0x3e28
leaq 0xb35a(%rip), %rsi      # 0xf172
xorl %ebx, %ebx
movl $0x2, %edi
xorl %eax, %eax
callq 0xb06f
jmp 0x3e5d
testb %r13b, %r13b
je 0x3e34
movq %r15, 0x18(%rsp)
jmp 0x3e39
movq %r15, 0x20(%rsp)
leaq 0x18(%rsp), %rsi
movl %ebp, %edi
callq 0x3290
movl $0x1, %ebx
cmpl $-0x1, %eax
jne 0x3e5d
leaq 0xb327(%rip), %rdi      # 0xf17d
callq 0xc7ed
xorl %ebx, %ebx
movl %ebx, %edi
callq 0xbcdc
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq