#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 */
scalar_t__ is_on_1st_quarter(unsigned long);
scalar_t__ is_on_4th_quarter(unsigned long);
int prioq__is_seq_lt(unsigned long a, unsigned long b) {
  if (is_on_4th_quarter(a) && is_on_1st_quarter(b))
    return 1;
  if (is_on_1st_quarter(a) && is_on_4th_quarter(b))
    return 0;
  return a < b;
}


x86 assembly (clang, -O0):
<prioq__is_seq_lt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <is_on_4th_quarter@plt>
cmp    $0x0,%rax
je     1162 <prioq__is_seq_lt+0x42>
mov    -0x18(%rbp),%rdi
call   1030 <is_on_1st_quarter@plt>
cmp    $0x0,%rax
je     1162 <prioq__is_seq_lt+0x42>
movl   $0x1,-0x4(%rbp)
jmp    11a7 <prioq__is_seq_lt+0x87>
mov    -0x10(%rbp),%rdi
call   1030 <is_on_1st_quarter@plt>
cmp    $0x0,%rax
je     1194 <prioq__is_seq_lt+0x74>
mov    -0x18(%rbp),%rdi
call   1040 <is_on_4th_quarter@plt>
cmp    $0x0,%rax
je     1194 <prioq__is_seq_lt+0x74>
movl   $0x0,-0x4(%rbp)
jmp    11a7 <prioq__is_seq_lt+0x87>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
setb   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prioq__is_seq_lt>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <is_on_4th_quarter@plt>
test   %rax,%rax
je     1149 <prioq__is_seq_lt+0x29>
mov    %r14,%rdi
call   1030 <is_on_1st_quarter@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    1170 <prioq__is_seq_lt+0x50>
mov    %rbx,%rdi
call   1030 <is_on_1st_quarter@plt>
test   %rax,%rax
je     1168 <prioq__is_seq_lt+0x48>
mov    %r14,%rdi
call   1040 <is_on_4th_quarter@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    1170 <prioq__is_seq_lt+0x50>
xor    %eax,%eax
cmp    %r14,%rbx
setb   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @prioq__is_seq_lt(i64 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = call i64 @is_on_4th_quarter(i64 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i64, i64* %5
%11 = call i64 @is_on_1st_quarter(i64 %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 1, i32* %3
br label %28
14: ; preds = %9, %2
%15 = load i64, i64* %4
%16 = call i64 @is_on_1st_quarter(i64 %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = load i64, i64* %5
%20 = call i64 @is_on_4th_quarter(i64 %19)
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 0, i32* %3
br label %28
23: ; preds = %18, %14
%24 = load i64, i64* %4
%25 = load i64, i64* %5
%26 = icmp ult i64 %24, %25
%27 = zext i1 %26 to i32
store i32 %27, i32* %3
br label %28
28: ; preds = %23, %22, %13
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @prioq__is_seq_lt(i64 %0, i64 %1) {
%3 = tail call i64 @is_on_4th_quarter(i64 %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i64 @is_on_1st_quarter(i64 %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %5, %2
%9 = tail call i64 @is_on_1st_quarter(i64 %0)
%10 = icmp eq i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = tail call i64 @is_on_4th_quarter(i64 %1)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %11, %8
%15 = icmp ult i64 %0, %1
%16 = zext i1 %15 to i32
br label %17
17: ; preds = %11, %5, %14
%18 = phi i32 [ %16, %14 ], [ 1, %5 ], [ 0, %11 ]
ret i32 %18
}