#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 BoolExpr {
  int dummy;
};

/* Variables and functions */
struct BoolExpr *BX_AndN(int, struct BoolExpr *, struct BoolExpr *);
int /*<<< orphan*/ BX_DecRef(struct BoolExpr *);
int BX_Depth(struct BoolExpr *);
struct BoolExpr *BX_IncRef(struct BoolExpr *);
struct BoolExpr *BX_Not(struct BoolExpr *);
struct BoolExpr *BX_OrN(int, struct BoolExpr *, struct BoolExpr *);
struct BoolExpr *BX_ToDNF(struct BoolExpr *);
struct BoolExpr *_choose_var(struct BoolExpr *);
int /*<<< orphan*/ _cofactors(struct BoolExpr **, struct BoolExpr **,
                              struct BoolExpr *, struct BoolExpr *);
struct BoolExpr *_complete_sum(struct BoolExpr *dnf) {
  if (BX_Depth(dnf) <= 1) {
    return BX_IncRef(dnf);
  } else {
    struct BoolExpr *v, *vn;
    struct BoolExpr *fv0, *fv1;
    struct BoolExpr *cs0, *cs1;
    struct BoolExpr *left, *right;
    struct BoolExpr *temp;
    struct BoolExpr *y;
    do {
      if ((v = _choose_var(dnf)) == NULL)
        return NULL;
    } while (0);
    if (!_cofactors(&fv0, &fv1, dnf, v)) {
      BX_DecRef(v);
      return NULL;
    }
    do {
      if ((cs0 = _complete_sum(fv0)) == NULL) {
        BX_DecRef(v);
        BX_DecRef(fv0);
        BX_DecRef(fv1);
        return NULL;
      }
    } while (0);
    BX_DecRef(fv0);
    do {
      if ((left = BX_OrN(2, v, cs0)) == NULL) {
        BX_DecRef(v);
        BX_DecRef(fv1);
        BX_DecRef(cs0);
        return NULL;
      }
    } while (0);
    BX_DecRef(v);
    BX_DecRef(cs0);
    do {
      if ((cs1 = _complete_sum(fv1)) == NULL) {
        BX_DecRef(fv1);
        BX_DecRef(left);
        return NULL;
      }
    } while (0);
    BX_DecRef(fv1);
    do {
      if ((vn = BX_Not(v)) == NULL) {
        BX_DecRef(left);
        BX_DecRef(cs1);
        return NULL;
      }
    } while (0);
    do {
      if ((right = BX_OrN(2, vn, cs1)) == NULL) {
        BX_DecRef(left);
        BX_DecRef(cs1);
        BX_DecRef(vn);
        return NULL;
      }
    } while (0);
    BX_DecRef(cs1);
    BX_DecRef(vn);
    do {
      if ((temp = BX_AndN(2, left, right)) == NULL) {
        BX_DecRef(left);
        BX_DecRef(right);
        return NULL;
      }
    } while (0);
    BX_DecRef(left);
    BX_DecRef(right);
    do {
      if ((y = BX_ToDNF(temp)) == NULL) {
        BX_DecRef(temp);
        return NULL;
      }
    } while (0);
    BX_DecRef(temp);
    return y;
  }
}


x86 assembly (clang, -O0):
<_complete_sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <BX_Depth@plt>
cmp    $0x1,%eax
jg     11d0 <_complete_sum+0x30>
mov    -0x10(%rbp),%rdi
call   10b0 <BX_IncRef@plt>
mov    %rax,-0x8(%rbp)
jmp    145f <_complete_sum+0x2bf>
jmp    11d5 <_complete_sum+0x35>
mov    -0x10(%rbp),%rdi
call   1050 <_choose_var@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    11f9 <_complete_sum+0x59>
movq   $0x0,-0x8(%rbp)
jmp    145f <_complete_sum+0x2bf>
jmp    11fe <_complete_sum+0x5e>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    -0x28(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <_cofactors@plt>
cmp    $0x0,%eax
jne    1232 <_complete_sum+0x92>
mov    -0x18(%rbp),%rdi
call   1090 <BX_DecRef@plt>
movq   $0x0,-0x8(%rbp)
jmp    145f <_complete_sum+0x2bf>
jmp    1237 <_complete_sum+0x97>
mov    -0x28(%rbp),%rdi
call   10c0 <_complete_sum@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
jne    1276 <_complete_sum+0xd6>
mov    -0x18(%rbp),%rdi
call   1090 <BX_DecRef@plt>
mov    -0x28(%rbp),%rdi
call   1090 <BX_DecRef@plt>
mov    -0x30(%rbp),%rdi
call   1090 <BX_DecRef@plt>
movq   $0x0,-0x8(%rbp)
jmp    145f <_complete_sum+0x2bf>
jmp    127b <_complete_sum+0xdb>
mov    -0x28(%rbp),%rdi
call   1090 <BX_DecRef@plt>
mov    -0x18(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    $0x2,%edi
call   10a0 <BX_OrN@plt>
mov    %rax,-0x48(%rbp)
cmp    $0x0,%rax
jne    12cc <_complete_sum+0x12c>
mov    -0x18(%rbp),%rdi
call   1090 <BX_DecRef@plt>
mov    -0x30(%rbp),%rdi
call   1090 <BX_DecRef@plt>
mov    -0x38(%rbp),%rdi
call   1090 <BX_DecRef@plt>
movq   $0x0,-0x8(%rbp)
jmp    145f <_complete_sum+0x2bf>
jmp    12d1 <_complete_sum+0x131>
mov    -0x18(%rbp),%rdi
call   1090 <BX_DecRef@plt>
mov    -0x38(%rbp),%rdi
call   1090 <BX_DecRef@plt>
mov    -0x30(%rbp),%rdi
call   10c0 <_complete_sum@plt>
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
jne    1319 <_complete_sum+0x179>
mov    -0x30(%rbp),%rdi
call   1090 <BX_DecRef@plt>
mov    -0x48(%rbp),%rdi
call   1090 <BX_DecRef@plt>
movq   $0x0,-0x8(%rbp)
jmp    145f <_complete_sum+0x2bf>
jmp    131e <_complete_sum+0x17e>
mov    -0x30(%rbp),%rdi
call   1090 <BX_DecRef@plt>
mov    -0x18(%rbp),%rdi
call   1040 <BX_Not@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    135d <_complete_sum+0x1bd>
mov    -0x48(%rbp),%rdi
call   1090 <BX_DecRef@plt>
mov    -0x40(%rbp),%rdi
call   1090 <BX_DecRef@plt>
movq   $0x0,-0x8(%rbp)
jmp    145f <_complete_sum+0x2bf>
jmp    1362 <_complete_sum+0x1c2>
jmp    1367 <_complete_sum+0x1c7>
mov    -0x20(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    $0x2,%edi
call   10a0 <BX_OrN@plt>
mov    %rax,-0x50(%rbp)
cmp    $0x0,%rax
jne    13af <_complete_sum+0x20f>
mov    -0x48(%rbp),%rdi
call   1090 <BX_DecRef@plt>
mov    -0x40(%rbp),%rdi
call   1090 <BX_DecRef@plt>
mov    -0x20(%rbp),%rdi
call   1090 <BX_DecRef@plt>
movq   $0x0,-0x8(%rbp)
jmp    145f <_complete_sum+0x2bf>
jmp    13b4 <_complete_sum+0x214>
mov    -0x40(%rbp),%rdi
call   1090 <BX_DecRef@plt>
mov    -0x20(%rbp),%rdi
call   1090 <BX_DecRef@plt>
mov    -0x48(%rbp),%rsi
mov    -0x50(%rbp),%rdx
mov    $0x2,%edi
call   1080 <BX_AndN@plt>
mov    %rax,-0x58(%rbp)
cmp    $0x0,%rax
jne    1405 <_complete_sum+0x265>
mov    -0x48(%rbp),%rdi
call   1090 <BX_DecRef@plt>
mov    -0x50(%rbp),%rdi
call   1090 <BX_DecRef@plt>
movq   $0x0,-0x8(%rbp)
jmp    145f <_complete_sum+0x2bf>
jmp    140a <_complete_sum+0x26a>
mov    -0x48(%rbp),%rdi
call   1090 <BX_DecRef@plt>
mov    -0x50(%rbp),%rdi
call   1090 <BX_DecRef@plt>
mov    -0x58(%rbp),%rdi
call   1070 <BX_ToDNF@plt>
mov    %rax,-0x60(%rbp)
cmp    $0x0,%rax
jne    1449 <_complete_sum+0x2a9>
mov    -0x58(%rbp),%rdi
call   1090 <BX_DecRef@plt>
movq   $0x0,-0x8(%rbp)
jmp    145f <_complete_sum+0x2bf>
jmp    144e <_complete_sum+0x2ae>
mov    -0x58(%rbp),%rdi
call   1090 <BX_DecRef@plt>
mov    -0x60(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_complete_sum>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
call   1060 <BX_Depth@plt>
cmp    $0x1,%eax
jg     11cb <_complete_sum+0x2b>
mov    %rbx,%rdi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    10b0 <BX_IncRef@plt>
mov    %rbx,%rdi
call   1050 <_choose_var@plt>
test   %rax,%rax
je     131f <_complete_sum+0x17f>
mov    %rax,%r12
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1030 <_cofactors@plt>
test   %eax,%eax
je     12e5 <_complete_sum+0x145>
mov    0x10(%rsp),%rdi
call   10c0 <_complete_sum@plt>
test   %rax,%rax
je     12ea <_complete_sum+0x14a>
mov    %rax,%r15
mov    0x10(%rsp),%rdi
call   1090 <BX_DecRef@plt>
mov    $0x2,%edi
mov    %r12,%rsi
mov    %r15,%rdx
call   10a0 <BX_OrN@plt>
mov    %rax,%r14
mov    %r12,%rdi
call   1090 <BX_DecRef@plt>
test   %r14,%r14
je     1303 <_complete_sum+0x163>
mov    %r15,%rdi
call   1090 <BX_DecRef@plt>
mov    0x8(%rsp),%rdi
call   10c0 <_complete_sum@plt>
mov    %rax,%r15
mov    0x8(%rsp),%rdi
call   1090 <BX_DecRef@plt>
test   %r15,%r15
je     130a <_complete_sum+0x16a>
mov    %r12,%rdi
call   1040 <BX_Not@plt>
test   %rax,%rax
je     130f <_complete_sum+0x16f>
mov    %rax,%rbx
mov    $0x2,%edi
mov    %rax,%rsi
mov    %r15,%rdx
call   10a0 <BX_OrN@plt>
test   %rax,%rax
je     1330 <_complete_sum+0x190>
mov    %rax,%r12
mov    %r15,%rdi
call   1090 <BX_DecRef@plt>
mov    %rbx,%rdi
call   1090 <BX_DecRef@plt>
mov    $0x2,%edi
mov    %r14,%rsi
mov    %r12,%rdx
call   1080 <BX_AndN@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1090 <BX_DecRef@plt>
mov    %r12,%rdi
call   1090 <BX_DecRef@plt>
test   %r15,%r15
je     131f <_complete_sum+0x17f>
mov    %r15,%rdi
call   1070 <BX_ToDNF@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1090 <BX_DecRef@plt>
jmp    1321 <_complete_sum+0x181>
mov    %r12,%rdi
jmp    131a <_complete_sum+0x17a>
mov    %r12,%rdi
call   1090 <BX_DecRef@plt>
mov    0x10(%rsp),%rdi
call   1090 <BX_DecRef@plt>
mov    0x8(%rsp),%rdi
jmp    131a <_complete_sum+0x17a>
mov    0x8(%rsp),%rdi
jmp    1312 <_complete_sum+0x172>
mov    %r14,%rdi
jmp    131a <_complete_sum+0x17a>
mov    %r14,%rdi
call   1090 <BX_DecRef@plt>
mov    %r15,%rdi
call   1090 <BX_DecRef@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
mov    %r14,%rdi
call   1090 <BX_DecRef@plt>
mov    %r15,%rdi
call   1090 <BX_DecRef@plt>
mov    %rbx,%rdi
jmp    131a <_complete_sum+0x17a>

LLVM IR (-O0):
%struct.BoolExpr = type { i32 }
define %struct.BoolExpr* @_complete_sum(%struct.BoolExpr* %0) {
%2 = alloca %struct.BoolExpr*
%3 = alloca %struct.BoolExpr*
%4 = alloca %struct.BoolExpr*
%5 = alloca %struct.BoolExpr*
%6 = alloca %struct.BoolExpr*
%7 = alloca %struct.BoolExpr*
%8 = alloca %struct.BoolExpr*
%9 = alloca %struct.BoolExpr*
%10 = alloca %struct.BoolExpr*
%11 = alloca %struct.BoolExpr*
%12 = alloca %struct.BoolExpr*
%13 = alloca %struct.BoolExpr*
store %struct.BoolExpr* %0, %struct.BoolExpr** %3
%14 = load %struct.BoolExpr*, %struct.BoolExpr** %3
%15 = call i32 @BX_Depth(%struct.BoolExpr* %14)
%16 = icmp sle i32 %15, 1
br i1 %16, label %17, label %20
17: ; preds = %1
%18 = load %struct.BoolExpr*, %struct.BoolExpr** %3
%19 = call %struct.BoolExpr* @BX_IncRef(%struct.BoolExpr* %18)
store %struct.BoolExpr* %19, %struct.BoolExpr** %2
br label %139
20: ; preds = %1
br label %21
21: ; preds = %20
%22 = load %struct.BoolExpr*, %struct.BoolExpr** %3
%23 = call %struct.BoolExpr* @_choose_var(%struct.BoolExpr* %22)
store %struct.BoolExpr* %23, %struct.BoolExpr** %4
%24 = icmp eq %struct.BoolExpr* %23, null
br i1 %24, label %25, label %26
25: ; preds = %21
store %struct.BoolExpr* null, %struct.BoolExpr** %2
br label %139
26: ; preds = %21
br label %27
27: ; preds = %26
%28 = load %struct.BoolExpr*, %struct.BoolExpr** %3
%29 = load %struct.BoolExpr*, %struct.BoolExpr** %4
%30 = call i32 @_cofactors(%struct.BoolExpr** %6, %struct.BoolExpr** %7, %struct.BoolExpr* %28, %struct.BoolExpr* %29)
%31 = icmp ne i32 %30, 0
br i1 %31, label %35, label %32
32: ; preds = %27
%33 = load %struct.BoolExpr*, %struct.BoolExpr** %4
%34 = call i32 @BX_DecRef(%struct.BoolExpr* %33)
store %struct.BoolExpr* null, %struct.BoolExpr** %2
br label %139
35: ; preds = %27
br label %36
36: ; preds = %35
%37 = load %struct.BoolExpr*, %struct.BoolExpr** %6
%38 = call %struct.BoolExpr* @_complete_sum(%struct.BoolExpr* %37)
store %struct.BoolExpr* %38, %struct.BoolExpr** %8
%39 = icmp eq %struct.BoolExpr* %38, null
br i1 %39, label %40, label %47
40: ; preds = %36
%41 = load %struct.BoolExpr*, %struct.BoolExpr** %4
%42 = call i32 @BX_DecRef(%struct.BoolExpr* %41)
%43 = load %struct.BoolExpr*, %struct.BoolExpr** %6
%44 = call i32 @BX_DecRef(%struct.BoolExpr* %43)
%45 = load %struct.BoolExpr*, %struct.BoolExpr** %7
%46 = call i32 @BX_DecRef(%struct.BoolExpr* %45)
store %struct.BoolExpr* null, %struct.BoolExpr** %2
br label %139
47: ; preds = %36
br label %48
48: ; preds = %47
%49 = load %struct.BoolExpr*, %struct.BoolExpr** %6
%50 = call i32 @BX_DecRef(%struct.BoolExpr* %49)
br label %51
51: ; preds = %48
%52 = load %struct.BoolExpr*, %struct.BoolExpr** %4
%53 = load %struct.BoolExpr*, %struct.BoolExpr** %8
%54 = call %struct.BoolExpr* @BX_OrN(i32 2, %struct.BoolExpr* %52, %struct.BoolExpr* %53)
store %struct.BoolExpr* %54, %struct.BoolExpr** %10
%55 = icmp eq %struct.BoolExpr* %54, null
br i1 %55, label %56, label %63
56: ; preds = %51
%57 = load %struct.BoolExpr*, %struct.BoolExpr** %4
%58 = call i32 @BX_DecRef(%struct.BoolExpr* %57)
%59 = load %struct.BoolExpr*, %struct.BoolExpr** %7
%60 = call i32 @BX_DecRef(%struct.BoolExpr* %59)
%61 = load %struct.BoolExpr*, %struct.BoolExpr** %8
%62 = call i32 @BX_DecRef(%struct.BoolExpr* %61)
store %struct.BoolExpr* null, %struct.BoolExpr** %2
br label %139
63: ; preds = %51
br label %64
64: ; preds = %63
%65 = load %struct.BoolExpr*, %struct.BoolExpr** %4
%66 = call i32 @BX_DecRef(%struct.BoolExpr* %65)
%67 = load %struct.BoolExpr*, %struct.BoolExpr** %8
%68 = call i32 @BX_DecRef(%struct.BoolExpr* %67)
br label %69
69: ; preds = %64
%70 = load %struct.BoolExpr*, %struct.BoolExpr** %7
%71 = call %struct.BoolExpr* @_complete_sum(%struct.BoolExpr* %70)
store %struct.BoolExpr* %71, %struct.BoolExpr** %9
%72 = icmp eq %struct.BoolExpr* %71, null
br i1 %72, label %73, label %78
73: ; preds = %69
%74 = load %struct.BoolExpr*, %struct.BoolExpr** %7
%75 = call i32 @BX_DecRef(%struct.BoolExpr* %74)
%76 = load %struct.BoolExpr*, %struct.BoolExpr** %10
%77 = call i32 @BX_DecRef(%struct.BoolExpr* %76)
store %struct.BoolExpr* null, %struct.BoolExpr** %2
br label %139
78: ; preds = %69
br label %79
79: ; preds = %78
%80 = load %struct.BoolExpr*, %struct.BoolExpr** %7
%81 = call i32 @BX_DecRef(%struct.BoolExpr* %80)
br label %82
82: ; preds = %79
%83 = load %struct.BoolExpr*, %struct.BoolExpr** %4
%84 = call %struct.BoolExpr* @BX_Not(%struct.BoolExpr* %83)
store %struct.BoolExpr* %84, %struct.BoolExpr** %5
%85 = icmp eq %struct.BoolExpr* %84, null
br i1 %85, label %86, label %91
86: ; preds = %82
%87 = load %struct.BoolExpr*, %struct.BoolExpr** %10
%88 = call i32 @BX_DecRef(%struct.BoolExpr* %87)
%89 = load %struct.BoolExpr*, %struct.BoolExpr** %9
%90 = call i32 @BX_DecRef(%struct.BoolExpr* %89)
store %struct.BoolExpr* null, %struct.BoolExpr** %2
br label %139
91: ; preds = %82
br label %92
92: ; preds = %91
br label %93
93: ; preds = %92
%94 = load %struct.BoolExpr*, %struct.BoolExpr** %5
%95 = load %struct.BoolExpr*, %struct.BoolExpr** %9
%96 = call %struct.BoolExpr* @BX_OrN(i32 2, %struct.BoolExpr* %94, %struct.BoolExpr* %95)
store %struct.BoolExpr* %96, %struct.BoolExpr** %11
%97 = icmp eq %struct.BoolExpr* %96, null
br i1 %97, label %98, label %105
98: ; preds = %93
%99 = load %struct.BoolExpr*, %struct.BoolExpr** %10
%100 = call i32 @BX_DecRef(%struct.BoolExpr* %99)
%101 = load %struct.BoolExpr*, %struct.BoolExpr** %9
%102 = call i32 @BX_DecRef(%struct.BoolExpr* %101)
%103 = load %struct.BoolExpr*, %struct.BoolExpr** %5
%104 = call i32 @BX_DecRef(%struct.BoolExpr* %103)
store %struct.BoolExpr* null, %struct.BoolExpr** %2
br label %139
105: ; preds = %93
br label %106
106: ; preds = %105
%107 = load %struct.BoolExpr*, %struct.BoolExpr** %9
%108 = call i32 @BX_DecRef(%struct.BoolExpr* %107)
%109 = load %struct.BoolExpr*, %struct.BoolExpr** %5
%110 = call i32 @BX_DecRef(%struct.BoolExpr* %109)
br label %111
111: ; preds = %106
%112 = load %struct.BoolExpr*, %struct.BoolExpr** %10
%113 = load %struct.BoolExpr*, %struct.BoolExpr** %11
%114 = call %struct.BoolExpr* @BX_AndN(i32 2, %struct.BoolExpr* %112, %struct.BoolExpr* %113)
store %struct.BoolExpr* %114, %struct.BoolExpr** %12
%115 = icmp eq %struct.BoolExpr* %114, null
br i1 %115, label %116, label %121
116: ; preds = %111
%117 = load %struct.BoolExpr*, %struct.BoolExpr** %10
%118 = call i32 @BX_DecRef(%struct.BoolExpr* %117)
%119 = load %struct.BoolExpr*, %struct.BoolExpr** %11
%120 = call i32 @BX_DecRef(%struct.BoolExpr* %119)
store %struct.BoolExpr* null, %struct.BoolExpr** %2
br label %139
121: ; preds = %111
br label %122
122: ; preds = %121
%123 = load %struct.BoolExpr*, %struct.BoolExpr** %10
%124 = call i32 @BX_DecRef(%struct.BoolExpr* %123)
%125 = load %struct.BoolExpr*, %struct.BoolExpr** %11
%126 = call i32 @BX_DecRef(%struct.BoolExpr* %125)
br label %127
127: ; preds = %122
%128 = load %struct.BoolExpr*, %struct.BoolExpr** %12
%129 = call %struct.BoolExpr* @BX_ToDNF(%struct.BoolExpr* %128)
store %struct.BoolExpr* %129, %struct.BoolExpr** %13
%130 = icmp eq %struct.BoolExpr* %129, null
br i1 %130, label %131, label %134
131: ; preds = %127
%132 = load %struct.BoolExpr*, %struct.BoolExpr** %12
%133 = call i32 @BX_DecRef(%struct.BoolExpr* %132)
store %struct.BoolExpr* null, %struct.BoolExpr** %2
br label %139
134: ; preds = %127
br label %135
135: ; preds = %134
%136 = load %struct.BoolExpr*, %struct.BoolExpr** %12
%137 = call i32 @BX_DecRef(%struct.BoolExpr* %136)
%138 = load %struct.BoolExpr*, %struct.BoolExpr** %13
store %struct.BoolExpr* %138, %struct.BoolExpr** %2
br label %139
139: ; preds = %135, %131, %116, %98, %86, %73, %56, %40, %32, %25, %17
%140 = load %struct.BoolExpr*, %struct.BoolExpr** %2
ret %struct.BoolExpr* %140
}

LLVM IR (-O2):
%struct.BoolExpr = type { i32 }
define %struct.BoolExpr* @_complete_sum(%struct.BoolExpr* %0) {
%2 = alloca %struct.BoolExpr*
%3 = alloca %struct.BoolExpr*
%4 = tail call i32 @BX_Depth(%struct.BoolExpr* %0)
%5 = icmp slt i32 %4, 2
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call %struct.BoolExpr* @BX_IncRef(%struct.BoolExpr* %0)
br label %72
8: ; preds = %1
%9 = bitcast %struct.BoolExpr** %2 to i8*
%10 = bitcast %struct.BoolExpr** %3 to i8*
%11 = tail call %struct.BoolExpr* @_choose_var(%struct.BoolExpr* %0)
%12 = icmp eq %struct.BoolExpr* %11, null
br i1 %12, label %70, label %13
13: ; preds = %8
%14 = call i32 @_cofactors(%struct.BoolExpr** %2, %struct.BoolExpr** %3, %struct.BoolExpr* %0, %struct.BoolExpr* %11)
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 @BX_DecRef(%struct.BoolExpr* %11)
br label %70
18: ; preds = %13
%19 = load %struct.BoolExpr*, %struct.BoolExpr** %2
%20 = call %struct.BoolExpr* @_complete_sum(%struct.BoolExpr* %19)
%21 = icmp eq %struct.BoolExpr* %20, null
br i1 %21, label %22, label %28
22: ; preds = %18
%23 = call i32 @BX_DecRef(%struct.BoolExpr* %11)
%24 = load %struct.BoolExpr*, %struct.BoolExpr** %2
%25 = call i32 @BX_DecRef(%struct.BoolExpr* %24)
%26 = load %struct.BoolExpr*, %struct.BoolExpr** %3
%27 = call i32 @BX_DecRef(%struct.BoolExpr* %26)
br label %70
28: ; preds = %18
%29 = load %struct.BoolExpr*, %struct.BoolExpr** %2
%30 = call i32 @BX_DecRef(%struct.BoolExpr* %29)
%31 = call %struct.BoolExpr* @BX_OrN(i32 2, %struct.BoolExpr* %11, %struct.BoolExpr* %20)
%32 = icmp eq %struct.BoolExpr* %31, null
%33 = call i32 @BX_DecRef(%struct.BoolExpr* %11)
br i1 %32, label %34, label %38
34: ; preds = %28
%35 = load %struct.BoolExpr*, %struct.BoolExpr** %3
%36 = call i32 @BX_DecRef(%struct.BoolExpr* %35)
%37 = call i32 @BX_DecRef(%struct.BoolExpr* %20)
br label %70
38: ; preds = %28
%39 = call i32 @BX_DecRef(%struct.BoolExpr* %20)
%40 = load %struct.BoolExpr*, %struct.BoolExpr** %3
%41 = call %struct.BoolExpr* @_complete_sum(%struct.BoolExpr* %40)
%42 = icmp eq %struct.BoolExpr* %41, null
%43 = load %struct.BoolExpr*, %struct.BoolExpr** %3
%44 = call i32 @BX_DecRef(%struct.BoolExpr* %43)
br i1 %42, label %45, label %47
45: ; preds = %38
%46 = call i32 @BX_DecRef(%struct.BoolExpr* %31)
br label %70
47: ; preds = %38
%48 = call %struct.BoolExpr* @BX_Not(%struct.BoolExpr* %11)
%49 = icmp eq %struct.BoolExpr* %48, null
br i1 %49, label %50, label %53
50: ; preds = %47
%51 = call i32 @BX_DecRef(%struct.BoolExpr* %31)
%52 = call i32 @BX_DecRef(%struct.BoolExpr* %41)
br label %70
53: ; preds = %47
%54 = call %struct.BoolExpr* @BX_OrN(i32 2, %struct.BoolExpr* %48, %struct.BoolExpr* %41)
%55 = icmp eq %struct.BoolExpr* %54, null
br i1 %55, label %56, label %60
56: ; preds = %53
%57 = call i32 @BX_DecRef(%struct.BoolExpr* %31)
%58 = call i32 @BX_DecRef(%struct.BoolExpr* %41)
%59 = call i32 @BX_DecRef(%struct.BoolExpr* %48)
br label %70
60: ; preds = %53
%61 = call i32 @BX_DecRef(%struct.BoolExpr* %41)
%62 = call i32 @BX_DecRef(%struct.BoolExpr* %48)
%63 = call %struct.BoolExpr* @BX_AndN(i32 2, %struct.BoolExpr* %31, %struct.BoolExpr* %54)
%64 = icmp eq %struct.BoolExpr* %63, null
%65 = call i32 @BX_DecRef(%struct.BoolExpr* %31)
%66 = call i32 @BX_DecRef(%struct.BoolExpr* %54)
br i1 %64, label %70, label %67
67: ; preds = %60
%68 = call %struct.BoolExpr* @BX_ToDNF(%struct.BoolExpr* %63)
%69 = call i32 @BX_DecRef(%struct.BoolExpr* %63)
br label %70
70: ; preds = %67, %60, %8, %56, %50, %45, %34, %22, %16
%71 = phi %struct.BoolExpr* [ null, %22 ], [ null, %34 ], [ null, %45 ], [ null, %50 ], [ null, %56 ], [ null, %16 ], [ null, %8 ], [ null, %60 ], [ %68, %67 ]
br label %72
72: ; preds = %70, %6
%73 = phi %struct.BoolExpr* [ %7, %6 ], [ %71, %70 ]
ret %struct.BoolExpr* %73
}