int mkbranch(first, second)
int first, second;
{
  int eps;
  if (first == 0)
    return second;
  else if (second == 0)
    return first;
  eps = mkstate((256 + 1));
  mkxtion(eps, first);
  mkxtion(eps, second);
  return eps;
}


x86 assembly (clang, -O0):
<mkbranch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1143 <mkbranch+0x23>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    118c <mkbranch+0x6c>
cmpl   $0x0,-0xc(%rbp)
jne    1158 <mkbranch+0x38>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    118c <mkbranch+0x6c>
jmp    115d <mkbranch+0x3d>
mov    $0x101,%edi
mov    $0x0,%al
call   1040 <mkstate@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1030 <mkxtion@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <mkxtion@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkbranch>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
test   %edi,%edi
je     115d <mkbranch+0x3d>
mov    %edi,%ebp
test   %ebx,%ebx
je     115b <mkbranch+0x3b>
mov    $0x101,%edi
xor    %eax,%eax
call   1040 <mkstate@plt>
mov    %eax,%r14d
mov    %eax,%edi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <mkxtion@plt>
mov    %r14d,%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <mkxtion@plt>
mov    %r14d,%ebx
jmp    115d <mkbranch+0x3d>
mov    %ebp,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mkbranch(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %5
store i32 %10, i32* %3
br label %26
11: ; preds = %2
%12 = load i32, i32* %5
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = load i32, i32* %4
store i32 %15, i32* %3
br label %26
16: ; preds = %11
br label %17
17: ; preds = %16
%18 = call i32 (i32, ...) bitcast (i32 (...)* @mkstate to i32 (i32, ...)*)(i32 257)
store i32 %18, i32* %6
%19 = load i32, i32* %6
%20 = load i32, i32* %4
%21 = call i32 (i32, i32, ...) bitcast (i32 (...)* @mkxtion to i32 (i32, i32, ...)*)(i32 %19, i32 %20)
%22 = load i32, i32* %6
%23 = load i32, i32* %5
%24 = call i32 (i32, i32, ...) bitcast (i32 (...)* @mkxtion to i32 (i32, i32, ...)*)(i32 %22, i32 %23)
%25 = load i32, i32* %6
store i32 %25, i32* %3
br label %26
26: ; preds = %17, %14, %9
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @mkbranch(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = icmp eq i32 %1, 0
br i1 %5, label %10, label %6
6: ; preds = %4
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @mkstate to i32 (i32, ...)*)(i32 257)
%8 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @mkxtion to i32 (i32, i32, ...)*)(i32 %7, i32 %0)
%9 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @mkxtion to i32 (i32, i32, ...)*)(i32 %7, i32 %1)
br label %10
10: ; preds = %4, %2, %6
%11 = phi i32 [ %7, %6 ], [ %1, %2 ], [ %0, %4 ]
ret i32 %11
}