#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ gcode_verbose();
int /*<<< orphan*/ prepare_test_data();
int test_ccw(int, int);
int test_cw(int, int);
main(int argc, char *argv[]) {
  int ret;
  int exit_code = EXIT_SUCCESS;
  prepare_test_data();
  gcode_verbose();
  gcode_verbose();
  ret = test_cw(0, 90);
  if (ret != 0)
    exit_code = EXIT_FAILURE;
  ret = test_cw(90, 180);
  if (ret != 0)
    exit_code = EXIT_FAILURE;
  ret = test_cw(180, 270);
  if (ret != 0)
    exit_code = EXIT_FAILURE;
  ret = test_cw(270, 0);
  if (ret != 0)
    exit_code = EXIT_FAILURE;
  ret = test_cw(90, 0);
  if (ret != 0)
    exit_code = EXIT_FAILURE;
  ret = test_cw(180, 90);
  if (ret != 0)
    exit_code = EXIT_FAILURE;
  ret = test_cw(270, 180);
  if (ret != 0)
    exit_code = EXIT_FAILURE;
  ret = test_cw(0, 270);
  if (ret != 0)
    exit_code = EXIT_FAILURE;
  ret = test_ccw(0, 90);
  if (ret != 0)
    exit_code = EXIT_FAILURE;
  ret = test_ccw(90, 180);
  if (ret != 0)
    exit_code = EXIT_FAILURE;
  ret = test_ccw(180, 270);
  if (ret != 0)
    exit_code = EXIT_FAILURE;
  ret = test_ccw(270, 0);
  if (ret != 0)
    exit_code = EXIT_FAILURE;
  ret = test_ccw(90, 0);
  if (ret != 0)
    exit_code = EXIT_FAILURE;
  ret = test_ccw(180, 90);
  if (ret != 0)
    exit_code = EXIT_FAILURE;
  ret = test_ccw(270, 180);
  if (ret != 0)
    exit_code = EXIT_FAILURE;
  ret = test_ccw(0, 270);
  if (ret != 0)
    exit_code = EXIT_FAILURE;
  return exit_code;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e7b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1050 <prepare_test_data@plt>
mov    $0x0,%al
call   1030 <gcode_verbose@plt>
mov    $0x0,%al
call   1030 <gcode_verbose@plt>
xor    %edi,%edi
mov    $0x5a,%esi
call   1040 <test_cw@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     119c <main+0x5c>
mov    0x2e49(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    $0x5a,%edi
mov    $0xb4,%esi
call   1040 <test_cw@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     11c4 <main+0x84>
mov    0x2e21(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    $0xb4,%edi
mov    $0x10e,%esi
call   1040 <test_cw@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     11ec <main+0xac>
mov    0x2df9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    $0x10e,%edi
xor    %esi,%esi
call   1040 <test_cw@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1211 <main+0xd1>
mov    0x2dd4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    $0x5a,%edi
xor    %esi,%esi
call   1040 <test_cw@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1236 <main+0xf6>
mov    0x2daf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    $0xb4,%edi
mov    $0x5a,%esi
call   1040 <test_cw@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     125e <main+0x11e>
mov    0x2d87(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    $0x10e,%edi
mov    $0xb4,%esi
call   1040 <test_cw@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1286 <main+0x146>
mov    0x2d5f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
xor    %edi,%edi
mov    $0x10e,%esi
call   1040 <test_cw@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     12ab <main+0x16b>
mov    0x2d3a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
xor    %edi,%edi
mov    $0x5a,%esi
call   1060 <test_ccw@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     12d0 <main+0x190>
mov    0x2d15(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    $0x5a,%edi
mov    $0xb4,%esi
call   1060 <test_ccw@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     12f8 <main+0x1b8>
mov    0x2ced(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    $0xb4,%edi
mov    $0x10e,%esi
call   1060 <test_ccw@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1320 <main+0x1e0>
mov    0x2cc5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    $0x10e,%edi
xor    %esi,%esi
call   1060 <test_ccw@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1345 <main+0x205>
mov    0x2ca0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    $0x5a,%edi
xor    %esi,%esi
call   1060 <test_ccw@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     136a <main+0x22a>
mov    0x2c7b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    $0xb4,%edi
mov    $0x5a,%esi
call   1060 <test_ccw@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1392 <main+0x252>
mov    0x2c53(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    $0x10e,%edi
mov    $0xb4,%esi
call   1060 <test_ccw@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     13ba <main+0x27a>
mov    0x2c2b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
xor    %edi,%edi
mov    $0x10e,%esi
call   1060 <test_ccw@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     13df <main+0x29f>
mov    0x2c06(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2e8d(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1050 <prepare_test_data@plt>
xor    %eax,%eax
call   1030 <gcode_verbose@plt>
xor    %eax,%eax
call   1030 <gcode_verbose@plt>
xor    %edi,%edi
mov    $0x5a,%esi
call   1040 <test_cw@plt>
mov    0x2e6b(%rip),%r14
test   %eax,%eax
je     117c <main+0x3c>
mov    (%r14),%ebx
mov    $0x5a,%edi
mov    $0xb4,%esi
call   1040 <test_cw@plt>
test   %eax,%eax
je     1192 <main+0x52>
mov    (%r14),%ebx
mov    $0xb4,%edi
mov    $0x10e,%esi
call   1040 <test_cw@plt>
test   %eax,%eax
je     11a8 <main+0x68>
mov    (%r14),%ebx
mov    $0x10e,%edi
xor    %esi,%esi
call   1040 <test_cw@plt>
test   %eax,%eax
je     11bb <main+0x7b>
mov    (%r14),%ebx
mov    $0x5a,%edi
xor    %esi,%esi
call   1040 <test_cw@plt>
test   %eax,%eax
je     11ce <main+0x8e>
mov    (%r14),%ebx
mov    $0xb4,%edi
mov    $0x5a,%esi
call   1040 <test_cw@plt>
test   %eax,%eax
je     11e4 <main+0xa4>
mov    (%r14),%ebx
mov    $0x10e,%edi
mov    $0xb4,%esi
call   1040 <test_cw@plt>
test   %eax,%eax
je     11fa <main+0xba>
mov    (%r14),%ebx
xor    %edi,%edi
mov    $0x10e,%esi
call   1040 <test_cw@plt>
test   %eax,%eax
je     120d <main+0xcd>
mov    (%r14),%ebx
xor    %edi,%edi
mov    $0x5a,%esi
call   1060 <test_ccw@plt>
test   %eax,%eax
je     1220 <main+0xe0>
mov    (%r14),%ebx
mov    $0x5a,%edi
mov    $0xb4,%esi
call   1060 <test_ccw@plt>
test   %eax,%eax
je     1236 <main+0xf6>
mov    (%r14),%ebx
mov    $0xb4,%edi
mov    $0x10e,%esi
call   1060 <test_ccw@plt>
test   %eax,%eax
je     124c <main+0x10c>
mov    (%r14),%ebx
mov    $0x10e,%edi
xor    %esi,%esi
call   1060 <test_ccw@plt>
test   %eax,%eax
je     125f <main+0x11f>
mov    (%r14),%ebx
mov    $0x5a,%edi
xor    %esi,%esi
call   1060 <test_ccw@plt>
test   %eax,%eax
je     1272 <main+0x132>
mov    (%r14),%ebx
mov    $0xb4,%edi
mov    $0x5a,%esi
call   1060 <test_ccw@plt>
test   %eax,%eax
je     1288 <main+0x148>
mov    (%r14),%ebx
mov    $0x10e,%edi
mov    $0xb4,%esi
call   1060 <test_ccw@plt>
test   %eax,%eax
je     129e <main+0x15e>
mov    (%r14),%ebx
xor    %edi,%edi
mov    $0x10e,%esi
call   1060 <test_ccw@plt>
test   %eax,%eax
je     12b1 <main+0x171>
mov    (%r14),%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* @EXIT_SUCCESS
store i32 %8, i32* %7
%9 = call i32 (...) @prepare_test_data()
%10 = call i32 (...) @gcode_verbose()
%11 = call i32 (...) @gcode_verbose()
%12 = call i32 @test_cw(i32 0, i32 90)
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = load i32, i32* @EXIT_FAILURE
store i32 %16, i32* %7
br label %17
17: ; preds = %15, %2
%18 = call i32 @test_cw(i32 90, i32 180)
store i32 %18, i32* %6
%19 = load i32, i32* %6
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = load i32, i32* @EXIT_FAILURE
store i32 %22, i32* %7
br label %23
23: ; preds = %21, %17
%24 = call i32 @test_cw(i32 180, i32 270)
store i32 %24, i32* %6
%25 = load i32, i32* %6
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = load i32, i32* @EXIT_FAILURE
store i32 %28, i32* %7
br label %29
29: ; preds = %27, %23
%30 = call i32 @test_cw(i32 270, i32 0)
store i32 %30, i32* %6
%31 = load i32, i32* %6
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %29
%34 = load i32, i32* @EXIT_FAILURE
store i32 %34, i32* %7
br label %35
35: ; preds = %33, %29
%36 = call i32 @test_cw(i32 90, i32 0)
store i32 %36, i32* %6
%37 = load i32, i32* %6
%38 = icmp ne i32 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %35
%40 = load i32, i32* @EXIT_FAILURE
store i32 %40, i32* %7
br label %41
41: ; preds = %39, %35
%42 = call i32 @test_cw(i32 180, i32 90)
store i32 %42, i32* %6
%43 = load i32, i32* %6
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %41
%46 = load i32, i32* @EXIT_FAILURE
store i32 %46, i32* %7
br label %47
47: ; preds = %45, %41
%48 = call i32 @test_cw(i32 270, i32 180)
store i32 %48, i32* %6
%49 = load i32, i32* %6
%50 = icmp ne i32 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %47
%52 = load i32, i32* @EXIT_FAILURE
store i32 %52, i32* %7
br label %53
53: ; preds = %51, %47
%54 = call i32 @test_cw(i32 0, i32 270)
store i32 %54, i32* %6
%55 = load i32, i32* %6
%56 = icmp ne i32 %55, 0
br i1 %56, label %57, label %59
57: ; preds = %53
%58 = load i32, i32* @EXIT_FAILURE
store i32 %58, i32* %7
br label %59
59: ; preds = %57, %53
%60 = call i32 @test_ccw(i32 0, i32 90)
store i32 %60, i32* %6
%61 = load i32, i32* %6
%62 = icmp ne i32 %61, 0
br i1 %62, label %63, label %65
63: ; preds = %59
%64 = load i32, i32* @EXIT_FAILURE
store i32 %64, i32* %7
br label %65
65: ; preds = %63, %59
%66 = call i32 @test_ccw(i32 90, i32 180)
store i32 %66, i32* %6
%67 = load i32, i32* %6
%68 = icmp ne i32 %67, 0
br i1 %68, label %69, label %71
69: ; preds = %65
%70 = load i32, i32* @EXIT_FAILURE
store i32 %70, i32* %7
br label %71
71: ; preds = %69, %65
%72 = call i32 @test_ccw(i32 180, i32 270)
store i32 %72, i32* %6
%73 = load i32, i32* %6
%74 = icmp ne i32 %73, 0
br i1 %74, label %75, label %77
75: ; preds = %71
%76 = load i32, i32* @EXIT_FAILURE
store i32 %76, i32* %7
br label %77
77: ; preds = %75, %71
%78 = call i32 @test_ccw(i32 270, i32 0)
store i32 %78, i32* %6
%79 = load i32, i32* %6
%80 = icmp ne i32 %79, 0
br i1 %80, label %81, label %83
81: ; preds = %77
%82 = load i32, i32* @EXIT_FAILURE
store i32 %82, i32* %7
br label %83
83: ; preds = %81, %77
%84 = call i32 @test_ccw(i32 90, i32 0)
store i32 %84, i32* %6
%85 = load i32, i32* %6
%86 = icmp ne i32 %85, 0
br i1 %86, label %87, label %89
87: ; preds = %83
%88 = load i32, i32* @EXIT_FAILURE
store i32 %88, i32* %7
br label %89
89: ; preds = %87, %83
%90 = call i32 @test_ccw(i32 180, i32 90)
store i32 %90, i32* %6
%91 = load i32, i32* %6
%92 = icmp ne i32 %91, 0
br i1 %92, label %93, label %95
93: ; preds = %89
%94 = load i32, i32* @EXIT_FAILURE
store i32 %94, i32* %7
br label %95
95: ; preds = %93, %89
%96 = call i32 @test_ccw(i32 270, i32 180)
store i32 %96, i32* %6
%97 = load i32, i32* %6
%98 = icmp ne i32 %97, 0
br i1 %98, label %99, label %101
99: ; preds = %95
%100 = load i32, i32* @EXIT_FAILURE
store i32 %100, i32* %7
br label %101
101: ; preds = %99, %95
%102 = call i32 @test_ccw(i32 0, i32 270)
store i32 %102, i32* %6
%103 = load i32, i32* %6
%104 = icmp ne i32 %103, 0
br i1 %104, label %105, label %107
105: ; preds = %101
%106 = load i32, i32* @EXIT_FAILURE
store i32 %106, i32* %7
br label %107
107: ; preds = %105, %101
%108 = load i32, i32* %7
ret i32 %108
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 (...) @prepare_test_data()
%5 = tail call i32 (...) @gcode_verbose()
%6 = tail call i32 (...) @gcode_verbose()
%7 = tail call i32 @test_cw(i32 0, i32 90)
%8 = icmp eq i32 %7, 0
%9 = load i32, i32* @EXIT_FAILURE
%10 = select i1 %8, i32 %3, i32 %9
%11 = tail call i32 @test_cw(i32 90, i32 180)
%12 = icmp eq i32 %11, 0
%13 = load i32, i32* @EXIT_FAILURE
%14 = select i1 %12, i32 %10, i32 %13
%15 = tail call i32 @test_cw(i32 180, i32 270)
%16 = icmp eq i32 %15, 0
%17 = load i32, i32* @EXIT_FAILURE
%18 = select i1 %16, i32 %14, i32 %17
%19 = tail call i32 @test_cw(i32 270, i32 0)
%20 = icmp eq i32 %19, 0
%21 = load i32, i32* @EXIT_FAILURE
%22 = select i1 %20, i32 %18, i32 %21
%23 = tail call i32 @test_cw(i32 90, i32 0)
%24 = icmp eq i32 %23, 0
%25 = load i32, i32* @EXIT_FAILURE
%26 = select i1 %24, i32 %22, i32 %25
%27 = tail call i32 @test_cw(i32 180, i32 90)
%28 = icmp eq i32 %27, 0
%29 = load i32, i32* @EXIT_FAILURE
%30 = select i1 %28, i32 %26, i32 %29
%31 = tail call i32 @test_cw(i32 270, i32 180)
%32 = icmp eq i32 %31, 0
%33 = load i32, i32* @EXIT_FAILURE
%34 = select i1 %32, i32 %30, i32 %33
%35 = tail call i32 @test_cw(i32 0, i32 270)
%36 = icmp eq i32 %35, 0
%37 = load i32, i32* @EXIT_FAILURE
%38 = select i1 %36, i32 %34, i32 %37
%39 = tail call i32 @test_ccw(i32 0, i32 90)
%40 = icmp eq i32 %39, 0
%41 = load i32, i32* @EXIT_FAILURE
%42 = select i1 %40, i32 %38, i32 %41
%43 = tail call i32 @test_ccw(i32 90, i32 180)
%44 = icmp eq i32 %43, 0
%45 = load i32, i32* @EXIT_FAILURE
%46 = select i1 %44, i32 %42, i32 %45
%47 = tail call i32 @test_ccw(i32 180, i32 270)
%48 = icmp eq i32 %47, 0
%49 = load i32, i32* @EXIT_FAILURE
%50 = select i1 %48, i32 %46, i32 %49
%51 = tail call i32 @test_ccw(i32 270, i32 0)
%52 = icmp eq i32 %51, 0
%53 = load i32, i32* @EXIT_FAILURE
%54 = select i1 %52, i32 %50, i32 %53
%55 = tail call i32 @test_ccw(i32 90, i32 0)
%56 = icmp eq i32 %55, 0
%57 = load i32, i32* @EXIT_FAILURE
%58 = select i1 %56, i32 %54, i32 %57
%59 = tail call i32 @test_ccw(i32 180, i32 90)
%60 = icmp eq i32 %59, 0
%61 = load i32, i32* @EXIT_FAILURE
%62 = select i1 %60, i32 %58, i32 %61
%63 = tail call i32 @test_ccw(i32 270, i32 180)
%64 = icmp eq i32 %63, 0
%65 = load i32, i32* @EXIT_FAILURE
%66 = select i1 %64, i32 %62, i32 %65
%67 = tail call i32 @test_ccw(i32 0, i32 270)
%68 = icmp eq i32 %67, 0
%69 = load i32, i32* @EXIT_FAILURE
%70 = select i1 %68, i32 %66, i32 %69
ret i32 %70
}