#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 */
typedef scalar_t__ uint8_t;

/* Variables and functions */
uint8_t u8g_is_intersection_decision_tree(uint8_t a0, uint8_t a1, uint8_t v0,
                                          uint8_t v1) {
  if (v0 < a1) {
    if (v1 > a0) {
      return 1;
    } else {
      if (v0 > v1) {
        return 1;
      } else {
        return 0;
      }
    }
  } else {
    if (v1 > a0) {
      if (v0 > v1) {
        return 1;
      } else {
        return 0;
      }
    } else {
      return 0;
    }
  }
}


x86 assembly (clang, -O0):
<u8g_is_intersection_decision_tree>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1165 <u8g_is_intersection_decision_tree+0x65>
mov    -0x28(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    113d <u8g_is_intersection_decision_tree+0x3d>
movq   $0x1,-0x8(%rbp)
jmp    11a3 <u8g_is_intersection_decision_tree+0xa3>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jle    1158 <u8g_is_intersection_decision_tree+0x58>
movq   $0x1,-0x8(%rbp)
jmp    11a3 <u8g_is_intersection_decision_tree+0xa3>
movq   $0x0,-0x8(%rbp)
jmp    11a3 <u8g_is_intersection_decision_tree+0xa3>
mov    -0x28(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    119b <u8g_is_intersection_decision_tree+0x9b>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jle    118e <u8g_is_intersection_decision_tree+0x8e>
movq   $0x1,-0x8(%rbp)
jmp    11a3 <u8g_is_intersection_decision_tree+0xa3>
movq   $0x0,-0x8(%rbp)
jmp    11a3 <u8g_is_intersection_decision_tree+0xa3>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8g_is_intersection_decision_tree>:
cmp    %rsi,%rdx
jge    1117 <u8g_is_intersection_decision_tree+0x17>
cmp    %rcx,%rdx
setg   %dl
cmp    %rdi,%rcx
setg   %al
or     %dl,%al
movzbl %al,%eax
ret
cmp    %rcx,%rdx
setg   %dl
cmp    %rdi,%rcx
setg   %al
and    %dl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i64 @u8g_is_intersection_decision_tree(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = icmp slt i64 %2, %1
%6 = icmp sgt i64 %3, %0
%7 = icmp sgt i64 %2, %3
br i1 %5, label %8, label %10
8: ; preds = %4
%9 = or i1 %6, %7
br label %12
10: ; preds = %4
%11 = and i1 %6, %7
br label %12
12: ; preds = %10, %8
%13 = phi i1 [ %9, %8 ], [ %11, %10 ]
%14 = zext i1 %13 to i64
ret i64 %14
}