#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
struct confctl {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cc_filter(struct confctl *, struct confctl *);
int /*<<< orphan*/ cc_merge(struct confctl **, struct confctl *);
int /*<<< orphan*/ cc_print(struct confctl *, int /*<<< orphan*/, int);
int /*<<< orphan*/ cc_remove(struct confctl *, struct confctl *);
struct confctl *confctl_from_line(char *);
int /*<<< orphan*/ confctl_load(struct confctl *, char *);
struct confctl *confctl_new();
int /*<<< orphan*/ confctl_save(struct confctl *, char *);
int /*<<< orphan*/ confctl_set_equals_sign(struct confctl *, int);
int /*<<< orphan*/ confctl_set_rewrite_in_place(struct confctl *, int);
int /*<<< orphan*/ confctl_set_semicolon(struct confctl *, int);
int /*<<< orphan*/ confctl_set_slash_slash_comments(struct confctl *, int);
int /*<<< orphan*/ confctl_set_slash_star_comments(struct confctl *, int);
int /*<<< orphan*/ errx(int, char *);
int getopt(int, char **, char *);
char *optarg;
scalar_t__ optind;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ usage();
int main(int argc, char **argv) {
  int ch, i;
  bool aflag = false, Cflag = false, Eflag = false, Iflag = false,
       Sflag = false, nflag = false;
  struct confctl *cc, *line, *merge = NULL, *remove = NULL, *filter = NULL;
  if (argc <= 1)
    usage();
  while ((ch = getopt(argc, argv, "aCEISnw:x:")) != -1) {
    switch (ch) {
    case 'a':
      aflag = true;
      break;
    case 'C':
      Cflag = true;
      break;
    case 'E':
      Eflag = true;
      break;
    case 'I':
      Iflag = true;
      break;
    case 'S':
      Sflag = true;
      break;
    case 'n':
      nflag = true;
      break;
    case 'w':
      line = confctl_from_line(optarg);
      cc_merge(&merge, line);
      break;
    case 'x':
      line = confctl_from_line(optarg);
      cc_merge(&remove, line);
      break;
    case '?':
    default:
      usage();
    }
  }
  argc -= optind;
  argv += optind;
  if (argc < 1)
    errx(1, "missing config file path");
  if (merge && argc > 1)
    errx(1, "-w and variable names are mutually exclusive");
  if (remove && argc > 1)
    errx(1, "-x and variable names are mutually exclusive");
  if (aflag && merge)
    errx(1, "-a and -w are mutually exclusive");
  if (aflag && remove)
    errx(1, "-a and -x are mutually exclusive");
  if (nflag && merge)
    errx(1, "-n and -w are mutually exclusive");
  if (nflag && merge)
    errx(1, "-n and -x are mutually exclusive");
  if (aflag && argc > 1)
    errx(1, "-a and variable names are mutually exclusive");
  if (!aflag && !merge && !remove && argc == 1)
    errx(1, "neither -a, -w, -x, or variable names specified");
  cc = confctl_new();
  confctl_set_equals_sign(cc, Eflag);
  confctl_set_rewrite_in_place(cc, Iflag);
  confctl_set_semicolon(cc, Sflag);
  confctl_set_slash_slash_comments(cc, Cflag);
  confctl_set_slash_star_comments(cc, Cflag);
  confctl_load(cc, argv[0]);
  if (merge == NULL && remove == NULL) {
    if (!aflag) {
      for (i = 1; i < argc; i++) {
        line = confctl_from_line(argv[i]);
        cc_merge(&filter, line);
      }
      cc_filter(cc, filter);
    }
    cc_print(cc, stdout, nflag);
  } else {
    if (remove != NULL)
      cc_remove(cc, remove);
    if (merge != NULL)
      cc_merge(&cc, merge);
    confctl_save(cc, argv[0]);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x50(%rbp)
movq   $0x0,-0x58(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1269 <main+0x69>
mov    $0x0,%al
call   10d0 <usage@plt>
jmp    126e <main+0x6e>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe6c(%rip),%rdx
call   1110 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     1359 <main+0x159>
mov    -0x14(%rbp),%eax
add    $0xffffffc1,%eax
mov    %eax,%ecx
mov    %rcx,-0x60(%rbp)
sub    $0x39,%eax
ja     134d <main+0x14d>
mov    -0x60(%rbp),%rax
lea    0xd53(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x1c(%rbp)
jmp    1354 <main+0x154>
movl   $0x1,-0x20(%rbp)
jmp    1354 <main+0x154>
movl   $0x1,-0x24(%rbp)
jmp    1354 <main+0x154>
movl   $0x1,-0x28(%rbp)
jmp    1354 <main+0x154>
movl   $0x1,-0x2c(%rbp)
jmp    1354 <main+0x154>
movl   $0x1,-0x30(%rbp)
jmp    1354 <main+0x154>
mov    0x2cf3(%rip),%rax
mov    (%rax),%rdi
call   1070 <confctl_from_line@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rsi
lea    -0x48(%rbp),%rdi
call   1120 <cc_merge@plt>
jmp    1354 <main+0x154>
mov    0x2cce(%rip),%rax
mov    (%rax),%rdi
call   1070 <confctl_from_line@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rsi
lea    -0x50(%rbp),%rdi
call   1120 <cc_merge@plt>
jmp    1354 <main+0x154>
jmp    134d <main+0x14d>
mov    $0x0,%al
call   10d0 <usage@plt>
jmp    126e <main+0x6e>
mov    0x2c80(%rip),%rax
mov    (%rax),%rcx
movslq -0x8(%rbp),%rax
sub    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    0x2c6c(%rip),%rax
mov    (%rax),%rax
shl    $0x3,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    139e <main+0x19e>
mov    $0x1,%edi
lea    0xd5a(%rip),%rsi
call   1050 <errx@plt>
cmpq   $0x0,-0x48(%rbp)
je     13c4 <main+0x1c4>
cmpl   $0x1,-0x8(%rbp)
jle    13c4 <main+0x1c4>
mov    $0x1,%edi
lea    0xd4d(%rip),%rsi
call   1050 <errx@plt>
cmpq   $0x0,-0x50(%rbp)
je     13ea <main+0x1ea>
cmpl   $0x1,-0x8(%rbp)
jle    13ea <main+0x1ea>
mov    $0x1,%edi
lea    0xd54(%rip),%rsi
call   1050 <errx@plt>
cmpl   $0x0,-0x1c(%rbp)
je     1410 <main+0x210>
cmpq   $0x0,-0x48(%rbp)
je     1410 <main+0x210>
mov    $0x1,%edi
lea    0xd5b(%rip),%rsi
call   1050 <errx@plt>
cmpl   $0x0,-0x1c(%rbp)
je     1436 <main+0x236>
cmpq   $0x0,-0x50(%rbp)
je     1436 <main+0x236>
mov    $0x1,%edi
lea    0xd56(%rip),%rsi
call   1050 <errx@plt>
cmpl   $0x0,-0x30(%rbp)
je     145c <main+0x25c>
cmpq   $0x0,-0x48(%rbp)
je     145c <main+0x25c>
mov    $0x1,%edi
lea    0xd51(%rip),%rsi
call   1050 <errx@plt>
cmpl   $0x0,-0x30(%rbp)
je     1482 <main+0x282>
cmpq   $0x0,-0x48(%rbp)
je     1482 <main+0x282>
mov    $0x1,%edi
lea    0xd4c(%rip),%rsi
call   1050 <errx@plt>
cmpl   $0x0,-0x1c(%rbp)
je     14a7 <main+0x2a7>
cmpl   $0x1,-0x8(%rbp)
jle    14a7 <main+0x2a7>
mov    $0x1,%edi
lea    0xd48(%rip),%rsi
call   1050 <errx@plt>
cmpl   $0x0,-0x1c(%rbp)
jne    14e2 <main+0x2e2>
cmpq   $0x0,-0x48(%rbp)
jne    14e2 <main+0x2e2>
cmpq   $0x0,-0x50(%rbp)
jne    14e2 <main+0x2e2>
cmpl   $0x1,-0x8(%rbp)
jne    14e2 <main+0x2e2>
mov    $0x1,%edi
lea    0xd3a(%rip),%rsi
call   1050 <errx@plt>
mov    $0x0,%al
call   10b0 <confctl_new@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   10c0 <confctl_set_equals_sign@plt>
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%esi
call   1090 <confctl_set_rewrite_in_place@plt>
mov    -0x38(%rbp),%rdi
mov    -0x2c(%rbp),%esi
call   10f0 <confctl_set_semicolon@plt>
mov    -0x38(%rbp),%rdi
mov    -0x20(%rbp),%esi
call   10e0 <confctl_set_slash_slash_comments@plt>
mov    -0x38(%rbp),%rdi
mov    -0x20(%rbp),%esi
call   1060 <confctl_set_slash_star_comments@plt>
mov    -0x38(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1030 <confctl_load@plt>
cmpq   $0x0,-0x48(%rbp)
jne    15c3 <main+0x3c3>
cmpq   $0x0,-0x50(%rbp)
jne    15c3 <main+0x3c3>
cmpl   $0x0,-0x1c(%rbp)
jne    15a9 <main+0x3a9>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    159c <main+0x39c>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1070 <confctl_from_line@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rsi
lea    -0x58(%rbp),%rdi
call   1120 <cc_merge@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1560 <main+0x360>
mov    -0x38(%rbp),%rdi
mov    -0x58(%rbp),%rsi
call   1100 <cc_filter@plt>
mov    -0x38(%rbp),%rdi
mov    0x2a1c(%rip),%rax
mov    (%rax),%esi
mov    -0x30(%rbp),%edx
call   1080 <cc_print@plt>
jmp    1603 <main+0x403>
cmpq   $0x0,-0x50(%rbp)
je     15db <main+0x3db>
mov    -0x38(%rbp),%rdi
mov    -0x50(%rbp),%rsi
call   1040 <cc_remove@plt>
cmpq   $0x0,-0x48(%rbp)
je     15f3 <main+0x3f3>
mov    -0x48(%rbp),%rsi
lea    -0x38(%rbp),%rdi
call   1120 <cc_merge@plt>
mov    -0x38(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   10a0 <confctl_save@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%r14
mov    %edi,%ebp
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
movq   $0x0,0x28(%rsp)
cmp    $0x1,%edi
jg     123a <main+0x3a>
xor    %eax,%eax
call   10d0 <usage@plt>
lea    0xe97(%rip),%r15
lea    0xdb8(%rip),%r12
mov    0x2da9(%rip),%r13
xor    %eax,%eax
movl   $0x0,0x24(%rsp)
movl   $0x0,0x18(%rsp)
movl   $0x0,0x1c(%rsp)
movl   $0x0,0x20(%rsp)
movl   $0x0,0x4(%rsp)
jmp    1290 <main+0x90>
movl   $0x1,0x4(%rsp)
mov    %ebx,%eax
cs nopw 0x0(%rax,%rax,1)
nop
mov    %eax,%ebx
mov    %ebp,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   1110 <getopt@plt>
lea    -0x43(%rax),%ecx
cmp    $0x35,%ecx
ja     130f <main+0x10f>
mov    $0x1,%eax
movslq (%r12,%rcx,4),%rcx
add    %r12,%rcx
jmp    *%rcx
movl   $0x1,0x24(%rsp)
mov    %ebx,%eax
jmp    1290 <main+0x90>
movl   $0x1,0x18(%rsp)
mov    %ebx,%eax
jmp    1290 <main+0x90>
movl   $0x1,0x1c(%rsp)
mov    %ebx,%eax
jmp    1290 <main+0x90>
movl   $0x1,0x20(%rsp)
mov    %ebx,%eax
jmp    1290 <main+0x90>
mov    0x0(%r13),%rdi
call   1070 <confctl_from_line@plt>
lea    0x8(%rsp),%rdi
jmp    1303 <main+0x103>
mov    0x0(%r13),%rdi
call   1070 <confctl_from_line@plt>
lea    0x10(%rsp),%rdi
mov    %rax,%rsi
call   1120 <cc_merge@plt>
mov    %ebx,%eax
jmp    1290 <main+0x90>
cmp    $0xffffffff,%eax
je     1322 <main+0x122>
xor    %eax,%eax
call   10d0 <usage@plt>
mov    %ebx,%eax
jmp    1290 <main+0x90>
mov    0x2cb7(%rip),%rax
mov    (%rax),%r15
sub    %r15d,%ebp
test   %ebp,%ebp
jle    136a <main+0x16a>
cmp    $0x1,%ebp
setne  %r12b
cmpq   $0x0,0x8(%rsp)
je     137b <main+0x17b>
cmp    $0x1,%ebp
mov    0x4(%rsp),%r13d
je     1360 <main+0x160>
lea    0xda9(%rip),%rsi
mov    $0x1,%edi
call   1050 <errx@plt>
mov    $0x1,%r12b
cmpq   $0x0,0x10(%rsp)
jne    1388 <main+0x188>
jmp    139e <main+0x19e>
lea    0xd72(%rip),%rsi
xor    %r12d,%r12d
mov    0x4(%rsp),%r13d
jmp    1394 <main+0x194>
mov    0x4(%rsp),%r13d
cmpq   $0x0,0x10(%rsp)
je     139e <main+0x19e>
test   %r12b,%r12b
je     139e <main+0x19e>
lea    0xd95(%rip),%rsi
mov    $0x1,%edi
call   1050 <errx@plt>
test   %ebx,%ebx
je     13bb <main+0x1bb>
cmpq   $0x0,0x8(%rsp)
je     13bb <main+0x1bb>
lea    0xda5(%rip),%rsi
mov    $0x1,%edi
call   1050 <errx@plt>
test   %ebx,%ebx
je     13d8 <main+0x1d8>
cmpq   $0x0,0x10(%rsp)
je     13d8 <main+0x1d8>
lea    0xda9(%rip),%rsi
mov    $0x1,%edi
call   1050 <errx@plt>
mov    0x8(%rsp),%rax
test   %r13d,%r13d
je     13fd <main+0x1fd>
test   %rax,%rax
je     13fd <main+0x1fd>
lea    0xdaa(%rip),%rsi
mov    $0x1,%edi
call   1050 <errx@plt>
mov    0x8(%rsp),%rax
test   %r13d,%r13d
je     1418 <main+0x218>
test   %rax,%rax
je     1418 <main+0x218>
lea    0xdab(%rip),%rsi
mov    $0x1,%edi
call   1050 <errx@plt>
test   %ebx,%ebx
setne  %al
and    %r12b,%al
cmp    $0x1,%al
jne    1435 <main+0x235>
lea    0xdaf(%rip),%rsi
mov    $0x1,%edi
call   1050 <errx@plt>
lea    (%r14,%r15,8),%r15
test   %ebx,%ebx
jne    1463 <main+0x263>
cmpq   $0x0,0x8(%rsp)
jne    1463 <main+0x263>
cmpq   $0x0,0x10(%rsp)
jne    1463 <main+0x263>
cmp    $0x1,%ebp
jne    1463 <main+0x263>
lea    0xdae(%rip),%rsi
mov    $0x1,%edi
call   1050 <errx@plt>
xor    %eax,%eax
call   10b0 <confctl_new@plt>
mov    %rax,%r14
mov    %rax,0x30(%rsp)
mov    %rax,%rdi
mov    0x18(%rsp),%esi
call   10c0 <confctl_set_equals_sign@plt>
mov    %r14,%rdi
mov    0x1c(%rsp),%esi
call   1090 <confctl_set_rewrite_in_place@plt>
mov    %r14,%rdi
mov    0x20(%rsp),%esi
call   10f0 <confctl_set_semicolon@plt>
mov    %r14,%rdi
mov    0x24(%rsp),%r12d
mov    %r12d,%esi
call   10e0 <confctl_set_slash_slash_comments@plt>
mov    %r14,%rdi
mov    %r12d,%esi
call   1060 <confctl_set_slash_star_comments@plt>
mov    (%r15),%rsi
mov    %r14,%rdi
call   1030 <confctl_load@plt>
mov    0x8(%rsp),%rsi
mov    0x10(%rsp),%rax
mov    %rsi,%rcx
or     %rax,%rcx
jne    1514 <main+0x314>
test   %ebx,%ebx
jne    1554 <main+0x354>
cmp    $0x2,%ebp
jl     154a <main+0x34a>
mov    %ebp,%ebp
mov    $0x1,%ebx
lea    0x28(%rsp),%r12
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rdi
call   1070 <confctl_from_line@plt>
mov    %r12,%rdi
mov    %rax,%rsi
call   1120 <cc_merge@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    14f0 <main+0x2f0>
mov    0x28(%rsp),%rsi
jmp    154c <main+0x34c>
test   %rax,%rax
je     1529 <main+0x329>
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <cc_remove@plt>
mov    0x8(%rsp),%rsi
test   %rsi,%rsi
je     153d <main+0x33d>
lea    0x30(%rsp),%rdi
call   1120 <cc_merge@plt>
mov    0x30(%rsp),%r14
mov    (%r15),%rsi
mov    %r14,%rdi
call   10a0 <confctl_save@plt>
jmp    1568 <main+0x368>
xor    %esi,%esi
mov    %r14,%rdi
call   1100 <cc_filter@plt>
mov    0x2a75(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdi
mov    %r13d,%edx
call   1080 <cc_print@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.confctl = type { i32 }
@.str = [11 x i8] c"aCEISnw:x:\00"
@optarg = global i8* null
@optind = global i64 0
@.str.1 = [25 x i8] c"missing config file path\00"
@.str.2 = [45 x i8] c"-w and variable names are mutually exclusive\00"
@.str.3 = [45 x i8] c"-x and variable names are mutually exclusive\00"
@.str.4 = [33 x i8] c"-a and -w are mutually exclusive\00"
@.str.5 = [33 x i8] c"-a and -x are mutually exclusive\00"
@.str.6 = [33 x i8] c"-n and -w are mutually exclusive\00"
@.str.7 = [33 x i8] c"-n and -x are mutually exclusive\00"
@.str.8 = [45 x i8] c"-a and variable names are mutually exclusive\00"
@.str.9 = [48 x i8] c"neither -a, -w, -x, or variable names specified\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca %struct.confctl*
%15 = alloca %struct.confctl*
%16 = alloca %struct.confctl*
%17 = alloca %struct.confctl*
%18 = alloca %struct.confctl*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
store i32 0, i32* %13
store %struct.confctl* null, %struct.confctl** %16
store %struct.confctl* null, %struct.confctl** %17
store %struct.confctl* null, %struct.confctl** %18
%19 = load i32, i32* %4
%20 = icmp sle i32 %19, 1
br i1 %20, label %21, label %23
21: ; preds = %2
%22 = call i32 (...) @usage()
br label %23
23: ; preds = %21, %2
br label %24
24: ; preds = %50, %23
%25 = load i32, i32* %4
%26 = load i8**, i8*** %5
%27 = call i32 @getopt(i32 %25, i8** %26, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i32 %27, i32* %6
%28 = icmp ne i32 %27, -1
br i1 %28, label %29, label %51
29: ; preds = %24
%30 = load i32, i32* %6
switch i32 %30, label %48 [
i32 97, label %31
i32 67, label %32
i32 69, label %33
i32 73, label %34
i32 83, label %35
i32 110, label %36
i32 119, label %37
i32 120, label %42
i32 63, label %47
]
31: ; preds = %29
store i32 1, i32* %8
br label %50
32: ; preds = %29
store i32 1, i32* %9
br label %50
33: ; preds = %29
store i32 1, i32* %10
br label %50
34: ; preds = %29
store i32 1, i32* %11
br label %50
35: ; preds = %29
store i32 1, i32* %12
br label %50
36: ; preds = %29
store i32 1, i32* %13
br label %50
37: ; preds = %29
%38 = load i8*, i8** @optarg
%39 = call %struct.confctl* @confctl_from_line(i8* %38)
store %struct.confctl* %39, %struct.confctl** %15
%40 = load %struct.confctl*, %struct.confctl** %15
%41 = call i32 @cc_merge(%struct.confctl** %16, %struct.confctl* %40)
br label %50
42: ; preds = %29
%43 = load i8*, i8** @optarg
%44 = call %struct.confctl* @confctl_from_line(i8* %43)
store %struct.confctl* %44, %struct.confctl** %15
%45 = load %struct.confctl*, %struct.confctl** %15
%46 = call i32 @cc_merge(%struct.confctl** %17, %struct.confctl* %45)
br label %50
47: ; preds = %29
br label %48
48: ; preds = %29, %47
%49 = call i32 (...) @usage()
br label %50
50: ; preds = %48, %42, %37, %36, %35, %34, %33, %32, %31
br label %24
51: ; preds = %24
%52 = load i64, i64* @optind
%53 = load i32, i32* %4
%54 = sext i32 %53 to i64
%55 = sub nsw i64 %54, %52
%56 = trunc i64 %55 to i32
store i32 %56, i32* %4
%57 = load i64, i64* @optind
%58 = load i8**, i8*** %5
%59 = getelementptr inbounds i8*, i8** %58, i64 %57
store i8** %59, i8*** %5
%60 = load i32, i32* %4
%61 = icmp slt i32 %60, 1
br i1 %61, label %62, label %64
62: ; preds = %51
%63 = call i32 @errx(i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %64
64: ; preds = %62, %51
%65 = load %struct.confctl*, %struct.confctl** %16
%66 = icmp ne %struct.confctl* %65, null
br i1 %66, label %67, label %72
67: ; preds = %64
%68 = load i32, i32* %4
%69 = icmp sgt i32 %68, 1
br i1 %69, label %70, label %72
70: ; preds = %67
%71 = call i32 @errx(i32 1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
br label %72
72: ; preds = %70, %67, %64
%73 = load %struct.confctl*, %struct.confctl** %17
%74 = icmp ne %struct.confctl* %73, null
br i1 %74, label %75, label %80
75: ; preds = %72
%76 = load i32, i32* %4
%77 = icmp sgt i32 %76, 1
br i1 %77, label %78, label %80
78: ; preds = %75
%79 = call i32 @errx(i32 1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0))
br label %80
80: ; preds = %78, %75, %72
%81 = load i32, i32* %8
%82 = icmp ne i32 %81, 0
br i1 %82, label %83, label %88
83: ; preds = %80
%84 = load %struct.confctl*, %struct.confctl** %16
%85 = icmp ne %struct.confctl* %84, null
br i1 %85, label %86, label %88
86: ; preds = %83
%87 = call i32 @errx(i32 1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
br label %88
88: ; preds = %86, %83, %80
%89 = load i32, i32* %8
%90 = icmp ne i32 %89, 0
br i1 %90, label %91, label %96
91: ; preds = %88
%92 = load %struct.confctl*, %struct.confctl** %17
%93 = icmp ne %struct.confctl* %92, null
br i1 %93, label %94, label %96
94: ; preds = %91
%95 = call i32 @errx(i32 1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
br label %96
96: ; preds = %94, %91, %88
%97 = load i32, i32* %13
%98 = icmp ne i32 %97, 0
br i1 %98, label %99, label %104
99: ; preds = %96
%100 = load %struct.confctl*, %struct.confctl** %16
%101 = icmp ne %struct.confctl* %100, null
br i1 %101, label %102, label %104
102: ; preds = %99
%103 = call i32 @errx(i32 1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0))
br label %104
104: ; preds = %102, %99, %96
%105 = load i32, i32* %13
%106 = icmp ne i32 %105, 0
br i1 %106, label %107, label %112
107: ; preds = %104
%108 = load %struct.confctl*, %struct.confctl** %16
%109 = icmp ne %struct.confctl* %108, null
br i1 %109, label %110, label %112
110: ; preds = %107
%111 = call i32 @errx(i32 1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0))
br label %112
112: ; preds = %110, %107, %104
%113 = load i32, i32* %8
%114 = icmp ne i32 %113, 0
br i1 %114, label %115, label %120
115: ; preds = %112
%116 = load i32, i32* %4
%117 = icmp sgt i32 %116, 1
br i1 %117, label %118, label %120
118: ; preds = %115
%119 = call i32 @errx(i32 1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.8, i64 0, i64 0))
br label %120
120: ; preds = %118, %115, %112
%121 = load i32, i32* %8
%122 = icmp ne i32 %121, 0
br i1 %122, label %134, label %123
123: ; preds = %120
%124 = load %struct.confctl*, %struct.confctl** %16
%125 = icmp ne %struct.confctl* %124, null
br i1 %125, label %134, label %126
126: ; preds = %123
%127 = load %struct.confctl*, %struct.confctl** %17
%128 = icmp ne %struct.confctl* %127, null
br i1 %128, label %134, label %129
129: ; preds = %126
%130 = load i32, i32* %4
%131 = icmp eq i32 %130, 1
br i1 %131, label %132, label %134
132: ; preds = %129
%133 = call i32 @errx(i32 1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.9, i64 0, i64 0))
br label %134
134: ; preds = %132, %129, %126, %123, %120
%135 = call %struct.confctl* (...) @confctl_new()
store %struct.confctl* %135, %struct.confctl** %14
%136 = load %struct.confctl*, %struct.confctl** %14
%137 = load i32, i32* %10
%138 = call i32 @confctl_set_equals_sign(%struct.confctl* %136, i32 %137)
%139 = load %struct.confctl*, %struct.confctl** %14
%140 = load i32, i32* %11
%141 = call i32 @confctl_set_rewrite_in_place(%struct.confctl* %139, i32 %140)
%142 = load %struct.confctl*, %struct.confctl** %14
%143 = load i32, i32* %12
%144 = call i32 @confctl_set_semicolon(%struct.confctl* %142, i32 %143)
%145 = load %struct.confctl*, %struct.confctl** %14
%146 = load i32, i32* %9
%147 = call i32 @confctl_set_slash_slash_comments(%struct.confctl* %145, i32 %146)
%148 = load %struct.confctl*, %struct.confctl** %14
%149 = load i32, i32* %9
%150 = call i32 @confctl_set_slash_star_comments(%struct.confctl* %148, i32 %149)
%151 = load %struct.confctl*, %struct.confctl** %14
%152 = load i8**, i8*** %5
%153 = getelementptr inbounds i8*, i8** %152, i64 0
%154 = load i8*, i8** %153
%155 = call i32 @confctl_load(%struct.confctl* %151, i8* %154)
%156 = load %struct.confctl*, %struct.confctl** %16
%157 = icmp eq %struct.confctl* %156, null
br i1 %157, label %158, label %190
158: ; preds = %134
%159 = load %struct.confctl*, %struct.confctl** %17
%160 = icmp eq %struct.confctl* %159, null
br i1 %160, label %161, label %190
161: ; preds = %158
%162 = load i32, i32* %8
%163 = icmp ne i32 %162, 0
br i1 %163, label %185, label %164
164: ; preds = %161
store i32 1, i32* %7
br label %165
165: ; preds = %178, %164
%166 = load i32, i32* %7
%167 = load i32, i32* %4
%168 = icmp slt i32 %166, %167
br i1 %168, label %169, label %181
169: ; preds = %165
%170 = load i8**, i8*** %5
%171 = load i32, i32* %7
%172 = sext i32 %171 to i64
%173 = getelementptr inbounds i8*, i8** %170, i64 %172
%174 = load i8*, i8** %173
%175 = call %struct.confctl* @confctl_from_line(i8* %174)
store %struct.confctl* %175, %struct.confctl** %15
%176 = load %struct.confctl*, %struct.confctl** %15
%177 = call i32 @cc_merge(%struct.confctl** %18, %struct.confctl* %176)
br label %178
178: ; preds = %169
%179 = load i32, i32* %7
%180 = add nsw i32 %179, 1
store i32 %180, i32* %7
br label %165
181: ; preds = %165
%182 = load %struct.confctl*, %struct.confctl** %14
%183 = load %struct.confctl*, %struct.confctl** %18
%184 = call i32 @cc_filter(%struct.confctl* %182, %struct.confctl* %183)
br label %185
185: ; preds = %181, %161
%186 = load %struct.confctl*, %struct.confctl** %14
%187 = load i32, i32* @stdout
%188 = load i32, i32* %13
%189 = call i32 @cc_print(%struct.confctl* %186, i32 %187, i32 %188)
br label %209
190: ; preds = %158, %134
%191 = load %struct.confctl*, %struct.confctl** %17
%192 = icmp ne %struct.confctl* %191, null
br i1 %192, label %193, label %197
193: ; preds = %190
%194 = load %struct.confctl*, %struct.confctl** %14
%195 = load %struct.confctl*, %struct.confctl** %17
%196 = call i32 @cc_remove(%struct.confctl* %194, %struct.confctl* %195)
br label %197
197: ; preds = %193, %190
%198 = load %struct.confctl*, %struct.confctl** %16
%199 = icmp ne %struct.confctl* %198, null
br i1 %199, label %200, label %203
200: ; preds = %197
%201 = load %struct.confctl*, %struct.confctl** %16
%202 = call i32 @cc_merge(%struct.confctl** %14, %struct.confctl* %201)
br label %203
203: ; preds = %200, %197
%204 = load %struct.confctl*, %struct.confctl** %14
%205 = load i8**, i8*** %5
%206 = getelementptr inbounds i8*, i8** %205, i64 0
%207 = load i8*, i8** %206
%208 = call i32 @confctl_save(%struct.confctl* %204, i8* %207)
br label %209
209: ; preds = %203, %185
ret i32 0
}

LLVM IR (-O2):
%struct.confctl = type { i32 }
@.str = [11 x i8] c"aCEISnw:x:\00"
@optarg = global i8* null
@optind = global i64 0
@.str.1 = [25 x i8] c"missing config file path\00"
@.str.2 = [45 x i8] c"-w and variable names are mutually exclusive\00"
@.str.3 = [45 x i8] c"-x and variable names are mutually exclusive\00"
@.str.4 = [33 x i8] c"-a and -w are mutually exclusive\00"
@.str.5 = [33 x i8] c"-a and -x are mutually exclusive\00"
@.str.6 = [33 x i8] c"-n and -w are mutually exclusive\00"
@.str.7 = [33 x i8] c"-n and -x are mutually exclusive\00"
@.str.8 = [45 x i8] c"-a and variable names are mutually exclusive\00"
@.str.9 = [48 x i8] c"neither -a, -w, -x, or variable names specified\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca %struct.confctl*
%4 = alloca %struct.confctl*
%5 = alloca %struct.confctl*
%6 = alloca %struct.confctl*
%7 = bitcast %struct.confctl** %3 to i8*
%8 = bitcast %struct.confctl** %4 to i8*
store %struct.confctl* null, %struct.confctl** %4
%9 = bitcast %struct.confctl** %5 to i8*
store %struct.confctl* null, %struct.confctl** %5
%10 = bitcast %struct.confctl** %6 to i8*
store %struct.confctl* null, %struct.confctl** %6
%11 = icmp slt i32 %0, 2
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = tail call i32 (...) @usage()
br label %14
14: ; preds = %12, %2
br label %15
15: ; preds = %23, %14
%16 = phi i32 [ 0, %14 ], [ %24, %23 ]
%17 = phi i32 [ 0, %14 ], [ %25, %23 ]
%18 = phi i32 [ 0, %14 ], [ %26, %23 ]
%19 = phi i32 [ 0, %14 ], [ %27, %23 ]
%20 = phi i32 [ 0, %14 ], [ %28, %23 ]
%21 = phi i32 [ 0, %14 ], [ %29, %23 ]
%22 = call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
switch i32 %22, label %43 [
i32 -1, label %45
i32 97, label %23
i32 67, label %30
i32 69, label %31
i32 73, label %32
i32 83, label %33
i32 110, label %34
i32 119, label %35
i32 120, label %39
]
23: ; preds = %15, %43, %39, %35, %34, %33, %32, %31, %30
%24 = phi i32 [ %16, %43 ], [ %16, %39 ], [ %16, %35 ], [ %16, %34 ], [ %16, %33 ], [ %16, %32 ], [ %16, %31 ], [ %16, %30 ], [ 1, %15 ]
%25 = phi i32 [ %17, %43 ], [ %17, %39 ], [ %17, %35 ], [ %17, %34 ], [ %17, %33 ], [ %17, %32 ], [ %17, %31 ], [ 1, %30 ], [ %17, %15 ]
%26 = phi i32 [ %18, %43 ], [ %18, %39 ], [ %18, %35 ], [ %18, %34 ], [ %18, %33 ], [ %18, %32 ], [ 1, %31 ], [ %18, %30 ], [ %18, %15 ]
%27 = phi i32 [ %19, %43 ], [ %19, %39 ], [ %19, %35 ], [ %19, %34 ], [ %19, %33 ], [ 1, %32 ], [ %19, %31 ], [ %19, %30 ], [ %19, %15 ]
%28 = phi i32 [ %20, %43 ], [ %20, %39 ], [ %20, %35 ], [ %20, %34 ], [ 1, %33 ], [ %20, %32 ], [ %20, %31 ], [ %20, %30 ], [ %20, %15 ]
%29 = phi i32 [ %21, %43 ], [ %21, %39 ], [ %21, %35 ], [ 1, %34 ], [ %21, %33 ], [ %21, %32 ], [ %21, %31 ], [ %21, %30 ], [ %21, %15 ]
br label %15
30: ; preds = %15
br label %23
31: ; preds = %15
br label %23
32: ; preds = %15
br label %23
33: ; preds = %15
br label %23
34: ; preds = %15
br label %23
35: ; preds = %15
%36 = load i8*, i8** @optarg
%37 = call %struct.confctl* @confctl_from_line(i8* %36)
%38 = call i32 @cc_merge(%struct.confctl** %4, %struct.confctl* %37)
br label %23
39: ; preds = %15
%40 = load i8*, i8** @optarg
%41 = call %struct.confctl* @confctl_from_line(i8* %40)
%42 = call i32 @cc_merge(%struct.confctl** %5, %struct.confctl* %41)
br label %23
43: ; preds = %15
%44 = call i32 (...) @usage()
br label %23
45: ; preds = %15
%46 = load i64, i64* @optind
%47 = trunc i64 %46 to i32
%48 = sub i32 %0, %47
%49 = getelementptr inbounds i8*, i8** %1, i64 %46
%50 = icmp slt i32 %48, 1
br i1 %50, label %63, label %51
51: ; preds = %45
%52 = load %struct.confctl*, %struct.confctl** %4
%53 = icmp ne %struct.confctl* %52, null
%54 = icmp ne i32 %48, 1
%55 = select i1 %53, i1 %54, i1 false
br i1 %55, label %56, label %58
56: ; preds = %51
%57 = call i32 @errx(i32 1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
br label %58
58: ; preds = %56, %51
%59 = phi i1 [ true, %56 ], [ %54, %51 ]
%60 = load %struct.confctl*, %struct.confctl** %5
%61 = icmp ne %struct.confctl* %60, null
%62 = select i1 %61, i1 %59, i1 false
br i1 %62, label %63, label %67
63: ; preds = %58, %45
%64 = phi i8* [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), %45 ], [ getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), %58 ]
%65 = phi i1 [ false, %45 ], [ %59, %58 ]
%66 = call i32 @errx(i32 1, i8* %64)
br label %67
67: ; preds = %63, %58
%68 = phi i1 [ %59, %58 ], [ %65, %63 ]
%69 = icmp ne i32 %16, 0
%70 = load %struct.confctl*, %struct.confctl** %4
%71 = icmp ne %struct.confctl* %70, null
%72 = select i1 %69, i1 %71, i1 false
br i1 %72, label %73, label %75
73: ; preds = %67
%74 = call i32 @errx(i32 1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
br label %75
75: ; preds = %73, %67
%76 = load %struct.confctl*, %struct.confctl** %5
%77 = icmp ne %struct.confctl* %76, null
%78 = select i1 %69, i1 %77, i1 false
br i1 %78, label %79, label %81
79: ; preds = %75
%80 = call i32 @errx(i32 1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
br label %81
81: ; preds = %79, %75
%82 = icmp ne i32 %21, 0
%83 = load %struct.confctl*, %struct.confctl** %4
%84 = icmp ne %struct.confctl* %83, null
%85 = select i1 %82, i1 %84, i1 false
br i1 %85, label %86, label %89
86: ; preds = %81
%87 = call i32 @errx(i32 1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0))
%88 = load %struct.confctl*, %struct.confctl** %4
br label %89
89: ; preds = %86, %81
%90 = phi %struct.confctl* [ %88, %86 ], [ %83, %81 ]
%91 = icmp ne %struct.confctl* %90, null
%92 = select i1 %82, i1 %91, i1 false
br i1 %92, label %93, label %95
93: ; preds = %89
%94 = call i32 @errx(i32 1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0))
br label %95
95: ; preds = %93, %89
%96 = select i1 %69, i1 %68, i1 false
br i1 %96, label %97, label %99
97: ; preds = %95
%98 = call i32 @errx(i32 1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.8, i64 0, i64 0))
br label %99
99: ; preds = %97, %95
%100 = load %struct.confctl*, %struct.confctl** %4
%101 = icmp eq %struct.confctl* %100, null
%102 = xor i1 %69, true
%103 = select i1 %102, i1 %101, i1 false
%104 = load %struct.confctl*, %struct.confctl** %5
%105 = icmp eq %struct.confctl* %104, null
%106 = select i1 %103, i1 %105, i1 false
%107 = icmp eq i32 %48, 1
%108 = select i1 %106, i1 %107, i1 false
br i1 %108, label %109, label %111
109: ; preds = %99
%110 = call i32 @errx(i32 1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.9, i64 0, i64 0))
br label %111
111: ; preds = %109, %99
%112 = call %struct.confctl* (...) @confctl_new()
store %struct.confctl* %112, %struct.confctl** %3
%113 = call i32 @confctl_set_equals_sign(%struct.confctl* %112, i32 %18)
%114 = call i32 @confctl_set_rewrite_in_place(%struct.confctl* %112, i32 %19)
%115 = call i32 @confctl_set_semicolon(%struct.confctl* %112, i32 %20)
%116 = call i32 @confctl_set_slash_slash_comments(%struct.confctl* %112, i32 %17)
%117 = call i32 @confctl_set_slash_star_comments(%struct.confctl* %112, i32 %17)
%118 = load i8*, i8** %49
%119 = call i32 @confctl_load(%struct.confctl* %112, i8* %118)
%120 = load %struct.confctl*, %struct.confctl** %4
%121 = icmp eq %struct.confctl* %120, null
%122 = load %struct.confctl*, %struct.confctl** %5
%123 = icmp eq %struct.confctl* %122, null
%124 = select i1 %121, i1 %123, i1 false
br i1 %124, label %125, label %146
125: ; preds = %111
br i1 %69, label %143, label %126
126: ; preds = %125
%127 = icmp sgt i32 %48, 1
br i1 %127, label %128, label %140
128: ; preds = %126
%129 = zext i32 %48 to i64
br label %130
130: ; preds = %128, %130
%131 = phi i64 [ 1, %128 ], [ %136, %130 ]
%132 = getelementptr inbounds i8*, i8** %49, i64 %131
%133 = load i8*, i8** %132
%134 = call %struct.confctl* @confctl_from_line(i8* %133)
%135 = call i32 @cc_merge(%struct.confctl** %6, %struct.confctl* %134)
%136 = add nuw nsw i64 %131, 1
%137 = icmp eq i64 %136, %129
br i1 %137, label %138, label %130
138: ; preds = %130
%139 = load %struct.confctl*, %struct.confctl** %6
br label %140
140: ; preds = %138, %126
%141 = phi %struct.confctl* [ %139, %138 ], [ null, %126 ]
%142 = call i32 @cc_filter(%struct.confctl* %112, %struct.confctl* %141)
br label %143
143: ; preds = %140, %125
%144 = load i32, i32* @stdout
%145 = call i32 @cc_print(%struct.confctl* %112, i32 %144, i32 %21)
br label %160
146: ; preds = %111
br i1 %123, label %150, label %147
147: ; preds = %146
%148 = call i32 @cc_remove(%struct.confctl* %112, %struct.confctl* %122)
%149 = load %struct.confctl*, %struct.confctl** %4
br label %150
150: ; preds = %147, %146
%151 = phi %struct.confctl* [ %149, %147 ], [ %120, %146 ]
%152 = icmp eq %struct.confctl* %151, null
br i1 %152, label %156, label %153
153: ; preds = %150
%154 = call i32 @cc_merge(%struct.confctl** %3, %struct.confctl* %151)
%155 = load %struct.confctl*, %struct.confctl** %3
br label %156
156: ; preds = %153, %150
%157 = phi %struct.confctl* [ %155, %153 ], [ %112, %150 ]
%158 = load i8*, i8** %49
%159 = call i32 @confctl_save(%struct.confctl* %157, i8* %158)
br label %160
160: ; preds = %156, %143
ret i32 0
}