#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 /*<<< orphan*/ assert(int /*<<< orphan*/, char *);
int rotate(int N) {
  int a, b, c, x, i, temp;
  a = 1;
  b = 2;
  c = 3;
  x = 0;
  for (i = 0; i < N; i++) {
    if (!(a != b))
      goto ERROR1;
    temp = a;
    a = b;
    b = c;
    c = temp;
  }
  if (!(x == 0))
    goto ERROR;
ERROR:
  assert(0, "ERROR");
ERROR1:
  assert(0, "ERROR1");
}


x86 assembly (clang, -O0):
<rotate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1181 <rotate+0x71>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    115b <rotate+0x4b>
jmp    11a3 <rotate+0x93>
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113e <rotate+0x2e>
cmpl   $0x0,-0x18(%rbp)
je     1190 <rotate+0x80>
jmp    1195 <rotate+0x85>
jmp    1195 <rotate+0x85>
xor    %edi,%edi
lea    0xe62(%rip),%rsi
call   1030 <assert@plt>
xor    %edi,%edi
lea    0xe5a(%rip),%rsi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate>:
test   %edi,%edi
jle    1141 <rotate+0x31>
mov    $0x3,%eax
mov    $0x2,%ecx
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    %ecx,%edx
je     1154 <rotate+0x44>
mov    %edx,%esi
mov    %ecx,%edx
mov    %eax,%ecx
mov    %esi,%eax
add    $0xffffffff,%edi
jne    1130 <rotate+0x20>
push   %rax
lea    0xeb7(%rip),%rsi
xor    %edi,%edi
call   1030 <assert@plt>
add    $0x8,%rsp
lea    0xeab(%rip),%rsi
xor    %edi,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ERROR\00"
@.str.1 = [7 x i8] c"ERROR1\00"
define i32 @rotate(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %3
store i32 1, i32* %4
store i32 2, i32* %5
store i32 3, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
br label %10
10: ; preds = %24, %1
%11 = load i32, i32* %8
%12 = load i32, i32* %3
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %27
14: ; preds = %10
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = icmp ne i32 %15, %16
br i1 %17, label %19, label %18
18: ; preds = %14
br label %34
19: ; preds = %14
%20 = load i32, i32* %4
store i32 %20, i32* %9
%21 = load i32, i32* %5
store i32 %21, i32* %4
%22 = load i32, i32* %6
store i32 %22, i32* %5
%23 = load i32, i32* %9
store i32 %23, i32* %6
br label %24
24: ; preds = %19
%25 = load i32, i32* %8
%26 = add nsw i32 %25, 1
store i32 %26, i32* %8
br label %10
27: ; preds = %10
%28 = load i32, i32* %7
%29 = icmp eq i32 %28, 0
br i1 %29, label %31, label %30
30: ; preds = %27
br label %32
31: ; preds = %27
br label %32
32: ; preds = %31, %30
%33 = call i32 @assert(i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %34
34: ; preds = %32, %18
%35 = call i32 @assert(i32 0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%36 = load i32, i32* %2
ret i32 %36
}

LLVM IR (-O2):
@.str = [6 x i8] c"ERROR\00"
@.str.1 = [7 x i8] c"ERROR1\00"
define i32 @rotate(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %5, label %12
3: ; preds = %5
%4 = icmp eq i32 %11, %0
br i1 %4, label %12, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %8, %3 ], [ 1, %1 ]
%7 = phi i32 [ %11, %3 ], [ 0, %1 ]
%8 = phi i32 [ %9, %3 ], [ 2, %1 ]
%9 = phi i32 [ %6, %3 ], [ 3, %1 ]
%10 = icmp eq i32 %6, %8
%11 = add nuw nsw i32 %7, 1
br i1 %10, label %14, label %3
12: ; preds = %3, %1
%13 = tail call i32 @assert(i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %5, %12
%15 = tail call i32 @assert(i32 0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}