// File: /workspace/github_c_makefile_star2_O3/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 0x3b73
leaq 0x8(%rdi), %r12
cmpb $0x2d, (%r14)
jne 0x3ba0
movb $0x1, %r13b
cmpb $0x68, 0x1(%r14)
jne 0x3b60
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 0x3ba5
jmp 0x3b75
xorl %ebx, %ebx
leaq 0x14fd4(%rip), %r14     # 0x18b50
movq %r14, %rdi
movl %ebx, %esi
callq 0x4336
cmpq $0x0, 0x18(%r14)
leaq 0x18(%r14), %r14
jne 0x3b7c
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %r13b
xorl %ebx, %ebx
movb (%r14), %bpl
leaq 0x14fa1(%rip), %r15     # 0x18b50
leaq 0xb5c4(%rip), %rsi      # 0xf17a
cmpb (%rsi), %bpl
jne 0x3bc7
movq %r14, %rdi
callq 0x31f0
testl %eax, %eax
je 0x3bfc
movq 0x18(%r15), %rsi
addq $0x18, %r15
testq %rsi, %rsi
jne 0x3bb6
leaq 0xb57b(%rip), %rsi      # 0xf156
movl $0x2, %edi
xorl %eax, %eax
callq 0xaf8c
xorl %edi, %edi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xbbec
cmpq $0x0, 0x8(%r12)
je 0x3c61
movl 0x8(%r15), %ebx
leaq 0x18(%rsp), %rsi
movl %ebx, %edi
callq 0x3340
movq 0x8(%r12), %r14
movq 0x10(%r15), %rbp
movq %r14, %rdi
callq 0x30f0
movq %rax, %r15
cmpb $0x75, (%r14)
jne 0x3c45
leaq 0xb5cf(%rip), %rsi      # 0xf204
movq %r14, %rdi
callq 0x31f0
testl %eax, %eax
je 0x3d2d
leaq 0x15024(%rip), %rax     # 0x18c70
cmpq %rax, %rbp
je 0x3c79
testq %rbp, %rbp
jne 0x3cd4
movl $0x1, %r15d
jmp 0x3d50
movq %r15, %rdi
movl %ebx, %esi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4336
movq %r14, %rdi
movl $0x3a, %esi
callq 0x3120
testq %rax, %rax
je 0x3cd4
movq %rax, %r15
incq %r15
movb $0x0, (%rax)
movq %r14, %rdi
movl $0xa, %esi
callq 0xc780
movl %eax, %ebp
movq %r15, %rdi
movl $0xa, %esi
callq 0xc780
cmpl $-0x1, %ebp
setne %cl
cmpl $-0x1, %eax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x3d9f
imull $0x3c, %ebp, %ecx
addl %eax, %ecx
movslq %ecx, %r15
jmp 0x3d68
movl %ebx, 0x4(%rsp)
movslq %r15d, %rax
movq %r14, 0x8(%rsp)
movq %rax, 0x10(%rsp)
leaq (%r14,%rax), %rbx
movq 0x10(%rbp), %r12
movb (%r12), %r14b
movq %r12, %rdi
callq 0x30f0
movq %rbx, %rsi
subq %rax, %rsi
cmpb (%rsi), %r14b
jne 0x3d13
movq %rax, %r15
movq %r12, %rdi
callq 0x31f0
testl %eax, %eax
je 0x3d36
movq (%rbp), %rbp
testq %rbp, %rbp
jne 0x3ce9
movl $0x1, %r15d
movl 0x4(%rsp), %ebx
movq 0x8(%rsp), %r14
jmp 0x3d50
movq $-0x1, %r15
jmp 0x3d68
movq 0x10(%rsp), %rax
subq %r15, %rax
movq 0x8(%rsp), %r14
movb $0x0, (%r14,%rax)
movq 0x8(%rbp), %r15
movl 0x4(%rsp), %ebx
movq %r14, %rdi
movl $0xa, %esi
callq 0xc780
cmpl $-0x1, %eax
je 0x3d9f
cltq
imulq %rax, %r15
testb %r13b, %r13b
je 0x3d74
movq %r15, 0x18(%rsp)
jmp 0x3d79
movq %r15, 0x20(%rsp)
leaq 0x18(%rsp), %rsi
movl %ebx, %edi
callq 0x3290
movl $0x1, %ebx
cmpl $-0x1, %eax
jne 0x3db4
leaq 0xb3da(%rip), %rdi      # 0xf170
callq 0xc6dd
xorl %ebx, %ebx
jmp 0x3db4
leaq 0xb3bf(%rip), %rsi      # 0xf165
xorl %ebx, %ebx
movl $0x2, %edi
xorl %eax, %eax
callq 0xaf8c
movl %ebx, %edi
callq 0xbbec
jmp 0x3b91