#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*/ EXIT_FAILURE;
double calculate_dihedral_angle(int, int, int, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int get_dihedral_angle(int alpha, int beta, int gamma, int epsilon) {
  int angle_code;
  double angle;
  angle = calculate_dihedral_angle(alpha, beta, gamma, epsilon);
  if ((angle >= 0 && angle <= 20) || (angle >= 340 && angle <= 360)) {
    angle_code = 0;
  } else if (angle > 20 && angle <= 40) {
    angle_code = 1;
  } else if (angle > 40 && angle <= 80) {
    angle_code = 2;
  } else if (angle > 80 && angle <= 100) {
    angle_code = 3;
  } else if (angle > 100 && angle <= 140) {
    angle_code = 4;
  } else if (angle > 140 && angle <= 160) {
    angle_code = 5;
  } else if (angle > 160 && angle <= 200) {
    angle_code = 6;
  } else if (angle > 200 && angle <= 220) {
    angle_code = 7;
  } else if (angle > 220 && angle <= 260) {
    angle_code = 8;
  } else if (angle > 260 && angle <= 280) {
    angle_code = 9;
  } else if (angle > 280 && angle <= 320) {
    angle_code = 10;
  } else if (angle > 320 && angle <= 340) {
    angle_code = 11;
  } else {
    printf("Error : Cannot assign dihedral code \n");
    exit(EXIT_FAILURE);
  }
  return angle_code;
}


x86 assembly (clang, -O0):
<get_dihedral_angle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <calculate_dihedral_angle@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     117f <get_dihedral_angle+0x4f>
movsd  0xe8c(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jae    11a9 <get_dihedral_angle+0x79>
movsd  -0x20(%rbp),%xmm0
movsd  0xe7c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11b5 <get_dihedral_angle+0x85>
movsd  0xe72(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     11b5 <get_dihedral_angle+0x85>
movl   $0x0,-0x14(%rbp)
jmp    1458 <get_dihedral_angle+0x328>
movsd  -0x20(%rbp),%xmm0
movsd  0xe3e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11eb <get_dihedral_angle+0xbb>
movsd  0xe44(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     11eb <get_dihedral_angle+0xbb>
movl   $0x1,-0x14(%rbp)
jmp    1453 <get_dihedral_angle+0x323>
movsd  -0x20(%rbp),%xmm0
movsd  0xe20(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1221 <get_dihedral_angle+0xf1>
movsd  0xe16(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     1221 <get_dihedral_angle+0xf1>
movl   $0x2,-0x14(%rbp)
jmp    144e <get_dihedral_angle+0x31e>
movsd  -0x20(%rbp),%xmm0
movsd  0xdf2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1257 <get_dihedral_angle+0x127>
movsd  0xde8(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     1257 <get_dihedral_angle+0x127>
movl   $0x3,-0x14(%rbp)
jmp    1449 <get_dihedral_angle+0x319>
movsd  -0x20(%rbp),%xmm0
movsd  0xdc4(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    128d <get_dihedral_angle+0x15d>
movsd  0xdba(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     128d <get_dihedral_angle+0x15d>
movl   $0x4,-0x14(%rbp)
jmp    1444 <get_dihedral_angle+0x314>
movsd  -0x20(%rbp),%xmm0
movsd  0xd96(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12c3 <get_dihedral_angle+0x193>
movsd  0xd8c(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     12c3 <get_dihedral_angle+0x193>
movl   $0x5,-0x14(%rbp)
jmp    143f <get_dihedral_angle+0x30f>
movsd  -0x20(%rbp),%xmm0
movsd  0xd68(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12f9 <get_dihedral_angle+0x1c9>
movsd  0xd5e(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     12f9 <get_dihedral_angle+0x1c9>
movl   $0x6,-0x14(%rbp)
jmp    143a <get_dihedral_angle+0x30a>
movsd  -0x20(%rbp),%xmm0
movsd  0xd3a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    132f <get_dihedral_angle+0x1ff>
movsd  0xd30(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     132f <get_dihedral_angle+0x1ff>
movl   $0x7,-0x14(%rbp)
jmp    1435 <get_dihedral_angle+0x305>
movsd  -0x20(%rbp),%xmm0
movsd  0xd0c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1365 <get_dihedral_angle+0x235>
movsd  0xd02(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     1365 <get_dihedral_angle+0x235>
movl   $0x8,-0x14(%rbp)
jmp    1430 <get_dihedral_angle+0x300>
movsd  -0x20(%rbp),%xmm0
movsd  0xcde(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    139b <get_dihedral_angle+0x26b>
movsd  0xcd4(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     139b <get_dihedral_angle+0x26b>
movl   $0x9,-0x14(%rbp)
jmp    142b <get_dihedral_angle+0x2fb>
movsd  -0x20(%rbp),%xmm0
movsd  0xcb0(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    13d1 <get_dihedral_angle+0x2a1>
movsd  0xca6(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     13d1 <get_dihedral_angle+0x2a1>
movl   $0xa,-0x14(%rbp)
jmp    1426 <get_dihedral_angle+0x2f6>
movsd  -0x20(%rbp),%xmm0
movsd  0xc82(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1407 <get_dihedral_angle+0x2d7>
movsd  0xc18(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     1407 <get_dihedral_angle+0x2d7>
movl   $0xb,-0x14(%rbp)
jmp    1421 <get_dihedral_angle+0x2f1>
lea    0xc5a(%rip),%rdi
call   1040 <printf@plt>
mov    0x2bc6(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
jmp    1426 <get_dihedral_angle+0x2f6>
jmp    142b <get_dihedral_angle+0x2fb>
jmp    1430 <get_dihedral_angle+0x300>
jmp    1435 <get_dihedral_angle+0x305>
jmp    143a <get_dihedral_angle+0x30a>
jmp    143f <get_dihedral_angle+0x30f>
jmp    1444 <get_dihedral_angle+0x314>
jmp    1449 <get_dihedral_angle+0x319>
jmp    144e <get_dihedral_angle+0x31e>
jmp    1453 <get_dihedral_angle+0x323>
jmp    1458 <get_dihedral_angle+0x328>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dihedral_angle>:
push   %rax
call   1030 <calculate_dihedral_angle@plt>
xor    %eax,%eax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1154 <get_dihedral_angle+0x24>
movsd  0xeb6(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    12c7 <get_dihedral_angle+0x197>
ucomisd 0xeac(%rip),%xmm0
jb     1170 <get_dihedral_angle+0x40>
movsd  0xeaa(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    12c7 <get_dihedral_angle+0x197>
ucomisd 0xe88(%rip),%xmm0
jbe    1191 <get_dihedral_angle+0x61>
mov    $0x1,%eax
movsd  0xe91(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    12c7 <get_dihedral_angle+0x197>
ucomisd 0xe7f(%rip),%xmm0
jbe    11b2 <get_dihedral_angle+0x82>
mov    $0x2,%eax
movsd  0xe78(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    12c7 <get_dihedral_angle+0x197>
ucomisd 0xe66(%rip),%xmm0
jbe    11d3 <get_dihedral_angle+0xa3>
mov    $0x3,%eax
movsd  0xe5f(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    12c7 <get_dihedral_angle+0x197>
ucomisd 0xe4d(%rip),%xmm0
jbe    11f4 <get_dihedral_angle+0xc4>
mov    $0x4,%eax
movsd  0xe46(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    12c7 <get_dihedral_angle+0x197>
ucomisd 0xe34(%rip),%xmm0
jbe    1215 <get_dihedral_angle+0xe5>
mov    $0x5,%eax
movsd  0xe2d(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    12c7 <get_dihedral_angle+0x197>
ucomisd 0xe1b(%rip),%xmm0
jbe    1236 <get_dihedral_angle+0x106>
mov    $0x6,%eax
movsd  0xe14(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    12c7 <get_dihedral_angle+0x197>
ucomisd 0xe02(%rip),%xmm0
jbe    1253 <get_dihedral_angle+0x123>
mov    $0x7,%eax
movsd  0xdfb(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    12c7 <get_dihedral_angle+0x197>
ucomisd 0xded(%rip),%xmm0
jbe    1270 <get_dihedral_angle+0x140>
mov    $0x8,%eax
movsd  0xde6(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    12c7 <get_dihedral_angle+0x197>
ucomisd 0xdd8(%rip),%xmm0
jbe    128d <get_dihedral_angle+0x15d>
mov    $0x9,%eax
movsd  0xdd1(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    12c7 <get_dihedral_angle+0x197>
ucomisd 0xdc3(%rip),%xmm0
jbe    12aa <get_dihedral_angle+0x17a>
mov    $0xa,%eax
movsd  0xdbc(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    12c7 <get_dihedral_angle+0x197>
ucomisd 0xdae(%rip),%xmm0
jbe    12c9 <get_dihedral_angle+0x199>
mov    $0xb,%eax
movsd  0xd47(%rip),%xmm1
ucomisd %xmm0,%xmm1
jb     12c9 <get_dihedral_angle+0x199>
pop    %rcx
ret
lea    0xd98(%rip),%rdi
call   1040 <puts@plt>
mov    0x2d04(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Error : Cannot assign dihedral code \0A\00"
@EXIT_FAILURE = global i32 0
define i32 @get_dihedral_angle(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca double
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = call double @calculate_dihedral_angle(i32 %11, i32 %12, i32 %13, i32 %14)
store double %15, double* %10
%16 = load double, double* %10
%17 = fcmp oge double %16, 0.000000e+00
br i1 %17, label %18, label %21
18: ; preds = %4
%19 = load double, double* %10
%20 = fcmp ole double %19, 2.000000e+01
br i1 %20, label %27, label %21
21: ; preds = %18, %4
%22 = load double, double* %10
%23 = fcmp oge double %22, 3.400000e+02
br i1 %23, label %24, label %28
24: ; preds = %21
%25 = load double, double* %10
%26 = fcmp ole double %25, 3.600000e+02
br i1 %26, label %27, label %28
27: ; preds = %24, %18
store i32 0, i32* %9
br label %120
28: ; preds = %24, %21
%29 = load double, double* %10
%30 = fcmp ogt double %29, 2.000000e+01
br i1 %30, label %31, label %35
31: ; preds = %28
%32 = load double, double* %10
%33 = fcmp ole double %32, 4.000000e+01
br i1 %33, label %34, label %35
34: ; preds = %31
store i32 1, i32* %9
br label %119
35: ; preds = %31, %28
%36 = load double, double* %10
%37 = fcmp ogt double %36, 4.000000e+01
br i1 %37, label %38, label %42
38: ; preds = %35
%39 = load double, double* %10
%40 = fcmp ole double %39, 8.000000e+01
br i1 %40, label %41, label %42
41: ; preds = %38
store i32 2, i32* %9
br label %118
42: ; preds = %38, %35
%43 = load double, double* %10
%44 = fcmp ogt double %43, 8.000000e+01
br i1 %44, label %45, label %49
45: ; preds = %42
%46 = load double, double* %10
%47 = fcmp ole double %46, 1.000000e+02
br i1 %47, label %48, label %49
48: ; preds = %45
store i32 3, i32* %9
br label %117
49: ; preds = %45, %42
%50 = load double, double* %10
%51 = fcmp ogt double %50, 1.000000e+02
br i1 %51, label %52, label %56
52: ; preds = %49
%53 = load double, double* %10
%54 = fcmp ole double %53, 1.400000e+02
br i1 %54, label %55, label %56
55: ; preds = %52
store i32 4, i32* %9
br label %116
56: ; preds = %52, %49
%57 = load double, double* %10
%58 = fcmp ogt double %57, 1.400000e+02
br i1 %58, label %59, label %63
59: ; preds = %56
%60 = load double, double* %10
%61 = fcmp ole double %60, 1.600000e+02
br i1 %61, label %62, label %63
62: ; preds = %59
store i32 5, i32* %9
br label %115
63: ; preds = %59, %56
%64 = load double, double* %10
%65 = fcmp ogt double %64, 1.600000e+02
br i1 %65, label %66, label %70
66: ; preds = %63
%67 = load double, double* %10
%68 = fcmp ole double %67, 2.000000e+02
br i1 %68, label %69, label %70
69: ; preds = %66
store i32 6, i32* %9
br label %114
70: ; preds = %66, %63
%71 = load double, double* %10
%72 = fcmp ogt double %71, 2.000000e+02
br i1 %72, label %73, label %77
73: ; preds = %70
%74 = load double, double* %10
%75 = fcmp ole double %74, 2.200000e+02
br i1 %75, label %76, label %77
76: ; preds = %73
store i32 7, i32* %9
br label %113
77: ; preds = %73, %70
%78 = load double, double* %10
%79 = fcmp ogt double %78, 2.200000e+02
br i1 %79, label %80, label %84
80: ; preds = %77
%81 = load double, double* %10
%82 = fcmp ole double %81, 2.600000e+02
br i1 %82, label %83, label %84
83: ; preds = %80
store i32 8, i32* %9
br label %112
84: ; preds = %80, %77
%85 = load double, double* %10
%86 = fcmp ogt double %85, 2.600000e+02
br i1 %86, label %87, label %91
87: ; preds = %84
%88 = load double, double* %10
%89 = fcmp ole double %88, 2.800000e+02
br i1 %89, label %90, label %91
90: ; preds = %87
store i32 9, i32* %9
br label %111
91: ; preds = %87, %84
%92 = load double, double* %10
%93 = fcmp ogt double %92, 2.800000e+02
br i1 %93, label %94, label %98
94: ; preds = %91
%95 = load double, double* %10
%96 = fcmp ole double %95, 3.200000e+02
br i1 %96, label %97, label %98
97: ; preds = %94
store i32 10, i32* %9
br label %110
98: ; preds = %94, %91
%99 = load double, double* %10
%100 = fcmp ogt double %99, 3.200000e+02
br i1 %100, label %101, label %105
101: ; preds = %98
%102 = load double, double* %10
%103 = fcmp ole double %102, 3.400000e+02
br i1 %103, label %104, label %105
104: ; preds = %101
store i32 11, i32* %9
br label %109
105: ; preds = %101, %98
%106 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%107 = load i32, i32* @EXIT_FAILURE
%108 = call i32 @exit(i32 %107)
unreachable
109: ; preds = %104
br label %110
110: ; preds = %109, %97
br label %111
111: ; preds = %110, %90
br label %112
112: ; preds = %111, %83
br label %113
113: ; preds = %112, %76
br label %114
114: ; preds = %113, %69
br label %115
115: ; preds = %114, %62
br label %116
116: ; preds = %115, %55
br label %117
117: ; preds = %116, %48
br label %118
118: ; preds = %117, %41
br label %119
119: ; preds = %118, %34
br label %120
120: ; preds = %119, %27
%121 = load i32, i32* %9
ret i32 %121
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [37 x i8] c"Error : Cannot assign dihedral code \00"
define i32 @get_dihedral_angle(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call double @calculate_dihedral_angle(i32 %0, i32 %1, i32 %2, i32 %3)
%6 = fcmp oge double %5, 0.000000e+00
%7 = fcmp ole double %5, 2.000000e+01
%8 = and i1 %6, %7
br i1 %8, label %61, label %9
9: ; preds = %4
%10 = fcmp oge double %5, 3.400000e+02
%11 = fcmp ole double %5, 3.600000e+02
%12 = and i1 %10, %11
br i1 %12, label %61, label %13
13: ; preds = %9
%14 = fcmp ogt double %5, 2.000000e+01
%15 = fcmp ole double %5, 4.000000e+01
%16 = and i1 %14, %15
br i1 %16, label %61, label %17
17: ; preds = %13
%18 = fcmp ogt double %5, 4.000000e+01
%19 = fcmp ole double %5, 8.000000e+01
%20 = and i1 %18, %19
br i1 %20, label %61, label %21
21: ; preds = %17
%22 = fcmp ogt double %5, 8.000000e+01
%23 = fcmp ole double %5, 1.000000e+02
%24 = and i1 %22, %23
br i1 %24, label %61, label %25
25: ; preds = %21
%26 = fcmp ogt double %5, 1.000000e+02
%27 = fcmp ole double %5, 1.400000e+02
%28 = and i1 %26, %27
br i1 %28, label %61, label %29
29: ; preds = %25
%30 = fcmp ogt double %5, 1.400000e+02
%31 = fcmp ole double %5, 1.600000e+02
%32 = and i1 %30, %31
br i1 %32, label %61, label %33
33: ; preds = %29
%34 = fcmp ogt double %5, 1.600000e+02
%35 = fcmp ole double %5, 2.000000e+02
%36 = and i1 %34, %35
br i1 %36, label %61, label %37
37: ; preds = %33
%38 = fcmp ogt double %5, 2.000000e+02
%39 = fcmp ole double %5, 2.200000e+02
%40 = and i1 %38, %39
br i1 %40, label %61, label %41
41: ; preds = %37
%42 = fcmp ogt double %5, 2.200000e+02
%43 = fcmp ole double %5, 2.600000e+02
%44 = and i1 %42, %43
br i1 %44, label %61, label %45
45: ; preds = %41
%46 = fcmp ogt double %5, 2.600000e+02
%47 = fcmp ole double %5, 2.800000e+02
%48 = and i1 %46, %47
br i1 %48, label %61, label %49
49: ; preds = %45
%50 = fcmp ogt double %5, 2.800000e+02
%51 = fcmp ole double %5, 3.200000e+02
%52 = and i1 %50, %51
br i1 %52, label %61, label %53
53: ; preds = %49
%54 = fcmp ogt double %5, 3.200000e+02
%55 = fcmp ole double %5, 3.400000e+02
%56 = and i1 %54, %55
br i1 %56, label %61, label %57
57: ; preds = %53
%58 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%59 = load i32, i32* @EXIT_FAILURE
%60 = tail call i32 @exit(i32 %59)
unreachable
61: ; preds = %53, %49, %45, %41, %37, %33, %29, %25, %21, %17, %13, %4, %9
%62 = phi i32 [ 0, %9 ], [ 0, %4 ], [ 1, %13 ], [ 2, %17 ], [ 3, %21 ], [ 4, %25 ], [ 5, %29 ], [ 6, %33 ], [ 7, %37 ], [ 8, %41 ], [ 9, %45 ], [ 10, %49 ], [ 11, %53 ]
ret i32 %62
}