#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 */
int mkstate(int);
int /*<<< orphan*/ mkxtion(int, int);
int mkbranch(int first, int 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    1186 <mkbranch+0x66>
cmpl   $0x0,-0xc(%rbp)
jne    1158 <mkbranch+0x38>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1186 <mkbranch+0x66>
jmp    115d <mkbranch+0x3d>
mov    $0x101,%edi
call   1040 <mkstate@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <mkxtion@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
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     1157 <mkbranch+0x37>
mov    %edi,%ebp
test   %ebx,%ebx
je     1155 <mkbranch+0x35>
mov    $0x101,%edi
call   1040 <mkstate@plt>
mov    %eax,%r14d
mov    %eax,%edi
mov    %ebp,%esi
call   1030 <mkxtion@plt>
mov    %r14d,%edi
mov    %ebx,%esi
call   1030 <mkxtion@plt>
mov    %r14d,%ebx
jmp    1157 <mkbranch+0x37>
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 @mkstate(i32 257)
store i32 %18, i32* %6
%19 = load i32, i32* %6
%20 = load i32, i32* %4
%21 = call i32 @mkxtion(i32 %19, i32 %20)
%22 = load i32, i32* %6
%23 = load i32, i32* %5
%24 = call i32 @mkxtion(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 @mkstate(i32 257)
%8 = tail call i32 @mkxtion(i32 %7, i32 %0)
%9 = tail call i32 @mkxtion(i32 %7, i32 %1)
br label %10
10: ; preds = %4, %2, %6
%11 = phi i32 [ %7, %6 ], [ %1, %2 ], [ %0, %4 ]
ret i32 %11
}