// File: /workspace/github_c_makefile_star2_O0/rakitzis[P]rc/builtins.c
// Function: b_flag
static void b_flag(char **av) {
	bool *flagp = NULL;
	char f;
	int mode = 3; /* 0 = reset (-), 1 = set (+), 2 = test */
	const char *usage = "usage: flag f [ + | - ]\n";

	if (*++av == NULL) {
		fprint(2, RC "not enough arguments to flag\n");
		set(FALSE);
		return;
	}
	f = av[0][0];
	if (f == '\0' || av[0][1] != '\0') goto flag_usage;
	if (*++av == NULL) {
		mode = 2;
	} else if (av[0][0] == '+' && av[0][1] == '\0') {
		mode = 1;
	} else if (av[0][0] == '-' && av[0][1] == '\0') {
		mode = 0;
	}
	if (mode == 3) goto flag_usage;
	switch (f) {
		case 'c':
			if (mode != 2) goto flag_immutable;
			set(dashsee[0] != NULL);
			return;
		case 'd':
			if (mode != 2) goto flag_immutable;
			flagp = &dashdee; break;
		case 'e': flagp = &dashee; break;
		case 'i': flagp = &interactive; break;
		case 'l':
			  if (mode != 2) goto flag_immutable;
			  flagp = &dashell; break;
		case 'n': flagp = &dashen; break;
		case 'o':
			  if (mode != 2) goto flag_immutable;
			  flagp = &dashoh; break;
		case 'p':
			  if (mode != 2) goto flag_immutable;
			  flagp = &dashpee; break;
		case 's':
			  if (mode != 2) goto flag_immutable;
			  flagp = &dashess; break;
		case 'v': flagp = &dashvee; break;
		case 'x': flagp = &dashex; break;
	}
	if (flagp != NULL) {
		if (mode == 2)
			set(*flagp);
		else {
			*flagp = mode;
			set(TRUE);
		}
	} else {
		fprint(2, RC "unknown flag");
		set(FALSE);
	}
	return;
flag_immutable:
	fprint(2, RC "flag immutable\n");
	set(FALSE);
	return;
flag_usage:
	fprint(2, usage);
	set(FALSE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movl $0x3, -0x18(%rbp)
leaq 0x11442(%rip), %rax     # 0x15154
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x8(%rbp)
cmpq $0x0, 0x8(%rax)
jne 0x3d4b
movl $0x2, %edi
leaq 0x11435(%rip), %rsi     # 0x1516d
movb $0x0, %al
callq 0xf3a0
xorl %edi, %edi
callq 0x107a0
jmp 0x3f7e
movq -0x8(%rbp), %rax
movq (%rax), %rax
movb (%rax), %al
movb %al, -0x11(%rbp)
movsbl -0x11(%rbp), %eax
cmpl $0x0, %eax
je 0x3d70
movq -0x8(%rbp), %rax
movq (%rax), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
je 0x3d75
jmp 0x3f67
movq -0x8(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x8(%rbp)
cmpq $0x0, 0x8(%rax)
jne 0x3d94
movl $0x2, -0x18(%rbp)
jmp 0x3de6
movq -0x8(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
jne 0x3dbc
movq -0x8(%rbp), %rax
movq (%rax), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0x3dbc
movl $0x1, -0x18(%rbp)
jmp 0x3de4
movq -0x8(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x3de2
movq -0x8(%rbp), %rax
movq (%rax), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0x3de2
movl $0x0, -0x18(%rbp)
jmp 0x3de4
jmp 0x3de6
cmpl $0x3, -0x18(%rbp)
jne 0x3df1
jmp 0x3f67
movsbl -0x11(%rbp), %eax
addl $-0x63, %eax
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0x15, %eax
ja 0x3f00
movq -0x28(%rbp), %rax
leaq 0x111f2(%rip), %rcx     # 0x15004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x2, -0x18(%rbp)
je 0x3e26
jmp 0x3f4b
leaq 0x1be13(%rip), %rax     # 0x1fc40
cmpq $0x0, (%rax)
setne %al
andb $0x1, %al
movzbl %al, %edi
callq 0x107a0
jmp 0x3f7e
cmpl $0x2, -0x18(%rbp)
je 0x3e4e
jmp 0x3f4b
leaq 0x1be03(%rip), %rax     # 0x1fc58
movq %rax, -0x10(%rbp)
jmp 0x3f00
leaq 0x1bdf7(%rip), %rax     # 0x1fc5c
movq %rax, -0x10(%rbp)
jmp 0x3f00
leaq 0x1bdef(%rip), %rax     # 0x1fc64
movq %rax, -0x10(%rbp)
jmp 0x3f00
cmpl $0x2, -0x18(%rbp)
je 0x3e89
jmp 0x3f4b
leaq 0x1bdc4(%rip), %rax     # 0x1fc54
movq %rax, -0x10(%rbp)
jmp 0x3f00
leaq 0x1bdcf(%rip), %rax     # 0x1fc6c
movq %rax, -0x10(%rbp)
jmp 0x3f00
cmpl $0x2, -0x18(%rbp)
je 0x3eae
jmp 0x3f4b
leaq 0x1bdbb(%rip), %rax     # 0x1fc70
movq %rax, -0x10(%rbp)
jmp 0x3f00
cmpl $0x2, -0x18(%rbp)
je 0x3ec6
jmp 0x3f4b
leaq 0x1bda7(%rip), %rax     # 0x1fc74
movq %rax, -0x10(%rbp)
jmp 0x3f00
cmpl $0x2, -0x18(%rbp)
je 0x3edb
jmp 0x3f4b
leaq 0x1bd96(%rip), %rax     # 0x1fc78
movq %rax, -0x10(%rbp)
jmp 0x3f00
leaq 0x1bd8d(%rip), %rax     # 0x1fc7c
movq %rax, -0x10(%rbp)
jmp 0x3f00
leaq 0x1bd84(%rip), %rax     # 0x1fc80
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x3f2f
cmpl $0x2, -0x18(%rbp)
jne 0x3f1a
movq -0x10(%rbp), %rax
movl (%rax), %edi
callq 0x107a0
jmp 0x3f2d
movl -0x18(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movl $0x1, %edi
callq 0x107a0
jmp 0x3f49
movl $0x2, %edi
leaq 0x11254(%rip), %rsi     # 0x1518f
movb $0x0, %al
callq 0xf3a0
xorl %edi, %edi
callq 0x107a0
jmp 0x3f7e
movl $0x2, %edi
leaq 0x11249(%rip), %rsi     # 0x151a0
movb $0x0, %al
callq 0xf3a0
xorl %edi, %edi
callq 0x107a0
jmp 0x3f7e
movq -0x20(%rbp), %rsi
movl $0x2, %edi
movb $0x0, %al
callq 0xf3a0
xorl %edi, %edi
callq 0x107a0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)