#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 */
struct graph {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ color_neigh(struct graph *, int, int, int);
void color_edge(struct graph *g, int u, int v, int color) {
  assert(color == 1 || color == 2 || color == 4);
  assert(u >= 0 && v >= 0);
  color_neigh(g, u, v, color);
  color_neigh(g, v, u, color);
}


x86 assembly (clang, -O0):
<color_edge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    $0x1,%al
cmpl   $0x1,-0x14(%rbp)
mov    %al,-0x15(%rbp)
je     115d <color_edge+0x3d>
mov    $0x1,%al
cmpl   $0x2,-0x14(%rbp)
mov    %al,-0x15(%rbp)
je     115d <color_edge+0x3d>
cmpl   $0x4,-0x14(%rbp)
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x16(%rbp)
jl     1183 <color_edge+0x63>
cmpl   $0x0,-0x10(%rbp)
setge  %al
mov    %al,-0x16(%rbp)
mov    -0x16(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1040 <color_neigh@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1040 <color_neigh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_edge>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
lea    -0x1(%rbx),%eax
cmp    $0x2,%eax
setb   %al
cmp    $0x4,%ecx
sete   %cl
or     %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
mov    %r14d,%edi
or     %ebp,%edi
not    %edi
shr    $0x1f,%edi
call   1030 <assert@plt>
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
mov    %ebx,%ecx
call   1040 <color_neigh@plt>
mov    %r15,%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <color_neigh@plt>

LLVM IR (-O0):
%struct.graph = type { i32 }
define void @color_edge(%struct.graph* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.graph*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.graph* %0, %struct.graph** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 1
br i1 %10, label %17, label %11
11: ; preds = %4
%12 = load i32, i32* %8
%13 = icmp eq i32 %12, 2
br i1 %13, label %17, label %14
14: ; preds = %11
%15 = load i32, i32* %8
%16 = icmp eq i32 %15, 4
br label %17
17: ; preds = %14, %11, %4
%18 = phi i1 [ true, %11 ], [ true, %4 ], [ %16, %14 ]
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = load i32, i32* %6
%22 = icmp sge i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %17
%24 = load i32, i32* %7
%25 = icmp sge i32 %24, 0
br label %26
26: ; preds = %23, %17
%27 = phi i1 [ false, %17 ], [ %25, %23 ]
%28 = zext i1 %27 to i32
%29 = call i32 @assert(i32 %28)
%30 = load %struct.graph*, %struct.graph** %5
%31 = load i32, i32* %6
%32 = load i32, i32* %7
%33 = load i32, i32* %8
%34 = call i32 @color_neigh(%struct.graph* %30, i32 %31, i32 %32, i32 %33)
%35 = load %struct.graph*, %struct.graph** %5
%36 = load i32, i32* %7
%37 = load i32, i32* %6
%38 = load i32, i32* %8
%39 = call i32 @color_neigh(%struct.graph* %35, i32 %36, i32 %37, i32 %38)
ret void
}

LLVM IR (-O2):
%struct.graph = type { i32 }
define void @color_edge(%struct.graph* %0, i32 %1, i32 %2, i32 %3) {
%5 = add i32 %3, -1
%6 = icmp ult i32 %5, 2
%7 = icmp eq i32 %3, 4
%8 = or i1 %7, %6
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = or i32 %2, %1
%12 = xor i32 %11, -1
%13 = lshr i32 %12, 31
%14 = tail call i32 @assert(i32 %13)
%15 = tail call i32 @color_neigh(%struct.graph* %0, i32 %1, i32 %2, i32 %3)
%16 = tail call i32 @color_neigh(%struct.graph* %0, i32 %2, i32 %1, i32 %3)
ret void
}