#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 */

/* Variables and functions */
size_t set_intersect_size__raw(int *, size_t, int *, size_t);
size_t set_union_size__raw(int *a, size_t a_size, int *b, size_t b_size) {
  if (a_size == 0) {
    if (b_size == 0) {
      return 0;
    } else {
      return b_size;
    }
  } else {
    if (b_size == 0) {
      return a_size;
    }
  }
  return a_size + b_size - set_intersect_size__raw(a, a_size, b, b_size);
}


x86 assembly (clang, -O0):
<set_union_size__raw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <set_union_size__raw+0x48>
cmpq   $0x0,-0x28(%rbp)
jne    114b <set_union_size__raw+0x3b>
movq   $0x0,-0x8(%rbp)
jmp    11a4 <set_union_size__raw+0x94>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11a4 <set_union_size__raw+0x94>
cmpq   $0x0,-0x28(%rbp)
jne    1170 <set_union_size__raw+0x60>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11a4 <set_union_size__raw+0x94>
jmp    1175 <set_union_size__raw+0x65>
mov    -0x18(%rbp),%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1030 <set_intersect_size__raw@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_union_size__raw>:
test   %rsi,%rsi
je     112b <set_union_size__raw+0x1b>
test   %rcx,%rcx
je     112f <set_union_size__raw+0x1f>
push   %rbx
lea    (%rcx,%rsi,1),%rbx
call   1030 <set_intersect_size__raw@plt>
sub    %rax,%rbx
mov    %rbx,%rcx
pop    %rbx
mov    %rcx,%rax
ret
mov    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @set_union_size__raw(i32* %0, i64 %1, i32* %2, i64 %3) {
%5 = alloca i64
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i32*
%9 = alloca i64
store i32* %0, i32** %6
store i64 %1, i64* %7
store i32* %2, i32** %8
store i64 %3, i64* %9
%10 = load i64, i64* %7
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %4
%13 = load i64, i64* %9
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %12
store i64 0, i64* %5
br label %34
16: ; preds = %12
%17 = load i64, i64* %9
store i64 %17, i64* %5
br label %34
18: ; preds = %4
%19 = load i64, i64* %9
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = load i64, i64* %7
store i64 %22, i64* %5
br label %34
23: ; preds = %18
br label %24
24: ; preds = %23
%25 = load i64, i64* %7
%26 = load i64, i64* %9
%27 = add i64 %25, %26
%28 = load i32*, i32** %6
%29 = load i64, i64* %7
%30 = load i32*, i32** %8
%31 = load i64, i64* %9
%32 = call i64 @set_intersect_size__raw(i32* %28, i64 %29, i32* %30, i64 %31)
%33 = sub i64 %27, %32
store i64 %33, i64* %5
br label %34
34: ; preds = %24, %21, %16, %15
%35 = load i64, i64* %5
ret i64 %35
}

LLVM IR (-O2):
define i64 @set_union_size__raw(i32* %0, i64 %1, i32* %2, i64 %3) {
%5 = icmp eq i64 %1, 0
br i1 %5, label %12, label %6
6: ; preds = %4
%7 = icmp eq i64 %3, 0
br i1 %7, label %12, label %8
8: ; preds = %6
%9 = add i64 %3, %1
%10 = tail call i64 @set_intersect_size__raw(i32* %0, i64 %1, i32* %2, i64 %3)
%11 = sub i64 %9, %10
br label %12
12: ; preds = %4, %6, %8
%13 = phi i64 [ %11, %8 ], [ %1, %6 ], [ %3, %4 ]
ret i64 %13
}