// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x1ac1d(%rip), %rax     # 0x1ebc0
movq %rax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x8(%rbp)
cmpq $0x0, 0x8(%rax)
je 0x4004
movq -0x8(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
movsbl 0x111df(%rip), %ecx     # 0x151b4
cmpl %ecx, %eax
jne 0x4004
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x111cd(%rip), %rsi     # 0x151b4
callq 0x31e0
cmpl $0x0, %eax
jne 0x4004
movq -0x8(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x8(%rbp)
movl $0x1, -0x14(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x4039
jmp 0x4010
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x4034
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x4870
movq -0x10(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x10(%rbp)
jmp 0x4010
jmp 0x4160
jmp 0x403b
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x4064
movl $0x2, %edi
leaq 0x11166(%rip), %rsi     # 0x151b7
movb $0x0, %al
callq 0xf3a0
xorl %edi, %edi
callq 0x107a0
jmp 0x4160
movq -0x8(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x4096
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x31e0
cmpl $0x0, %eax
jne 0x4096
jmp 0x40a6
jmp 0x4098
movq -0x10(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x10(%rbp)
jmp 0x403b
movq -0x8(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x8(%rbp)
cmpq $0x0, 0x8(%rax)
jne 0x40cd
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x4870
jmp 0x4160
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edi
leaq -0x28(%rbp), %rsi
callq 0x3330
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rdx
leaq -0x30(%rbp), %rsi
callq 0x4990
cmpl $0x0, %eax
jne 0x4112
movl $0x2, %edi
leaq 0x110c4(%rip), %rsi     # 0x151c6
movb $0x0, %al
callq 0xf3a0
xorl %edi, %edi
callq 0x107a0
jmp 0x4160
cmpl $0x0, -0x14(%rbp)
je 0x4122
movq -0x30(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x412a
movq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edi
leaq -0x28(%rbp), %rsi
callq 0x3280
cmpl $-0x1, %eax
jne 0x4154
leaq 0x1108b(%rip), %rdi     # 0x151d1
callq 0x11c10
xorl %edi, %edi
callq 0x107a0
jmp 0x415e
movl $0x1, %edi
callq 0x107a0
jmp 0x4160
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)