#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 iio_event_data {
  int /*<<< orphan*/ id;
};
typedef enum iio_modifier { ____Placeholder_iio_modifier } iio_modifier;
typedef enum iio_event_type { ____Placeholder_iio_event_type } iio_event_type;
typedef enum iio_event_direction {
  ____Placeholder_iio_event_direction
} iio_event_direction;
typedef enum iio_chan_type { ____Placeholder_iio_chan_type } iio_chan_type;

/* Variables and functions */
#define IIO_ACCEL 189
#define IIO_ACTIVITY 188
#define IIO_ALTVOLTAGE 187
#define IIO_ANGL 186
#define IIO_ANGL_VEL 185
#define IIO_CAPACITANCE 184
#define IIO_CCT 183
#define IIO_CURRENT 182
int IIO_EVENT_CODE_EXTRACT_CHAN_TYPE(int /*<<< orphan*/);
int IIO_EVENT_CODE_EXTRACT_DIR(int /*<<< orphan*/);
int IIO_EVENT_CODE_EXTRACT_MODIFIER(int /*<<< orphan*/);
int IIO_EVENT_CODE_EXTRACT_TYPE(int /*<<< orphan*/);
#define IIO_EV_DIR_EITHER 181
#define IIO_EV_DIR_FALLING 180
#define IIO_EV_DIR_NONE 179
#define IIO_EV_DIR_RISING 178
#define IIO_EV_TYPE_CHANGE 177
#define IIO_EV_TYPE_MAG 176
#define IIO_EV_TYPE_MAG_ADAPTIVE 175
#define IIO_EV_TYPE_ROC 174
#define IIO_EV_TYPE_THRESH 173
#define IIO_EV_TYPE_THRESH_ADAPTIVE 172
#define IIO_HUMIDITYRELATIVE 171
#define IIO_INCLI 170
#define IIO_INTENSITY 169
#define IIO_LIGHT 168
#define IIO_MAGN 167
#define IIO_MOD_JOGGING 166
#define IIO_MOD_LIGHT_BLUE 165
#define IIO_MOD_LIGHT_BOTH 164
#define IIO_MOD_LIGHT_CLEAR 163
#define IIO_MOD_LIGHT_GREEN 162
#define IIO_MOD_LIGHT_IR 161
#define IIO_MOD_LIGHT_RED 160
#define IIO_MOD_NORTH_MAGN 159
#define IIO_MOD_NORTH_MAGN_TILT_COMP 158
#define IIO_MOD_NORTH_TRUE 157
#define IIO_MOD_NORTH_TRUE_TILT_COMP 156
#define IIO_MOD_QUATERNION 155
#define IIO_MOD_ROOT_SUM_SQUARED_X_Y 154
#define IIO_MOD_RUNNING 153
#define IIO_MOD_STILL 152
#define IIO_MOD_SUM_SQUARED_X_Y_Z 151
#define IIO_MOD_TEMP_AMBIENT 150
#define IIO_MOD_TEMP_OBJECT 149
#define IIO_MOD_WALKING 148
#define IIO_MOD_X 147
#define IIO_MOD_X_AND_Y 146
#define IIO_MOD_X_AND_Y_AND_Z 145
#define IIO_MOD_X_AND_Z 144
#define IIO_MOD_X_OR_Y 143
#define IIO_MOD_X_OR_Y_OR_Z 142
#define IIO_MOD_X_OR_Z 141
#define IIO_MOD_Y 140
#define IIO_MOD_Y_AND_Z 139
#define IIO_MOD_Y_OR_Z 138
#define IIO_MOD_Z 137
#define IIO_NO_MOD 136
#define IIO_POWER 135
#define IIO_PRESSURE 134
#define IIO_PROXIMITY 133
#define IIO_ROT 132
#define IIO_STEPS 131
#define IIO_TEMP 130
#define IIO_TIMESTAMP 129
#define IIO_VOLTAGE 128
bool event_is_known(struct iio_event_data *event) {
  enum iio_chan_type type = IIO_EVENT_CODE_EXTRACT_CHAN_TYPE(event->id);
  enum iio_modifier mod = IIO_EVENT_CODE_EXTRACT_MODIFIER(event->id);
  enum iio_event_type ev_type = IIO_EVENT_CODE_EXTRACT_TYPE(event->id);
  enum iio_event_direction dir = IIO_EVENT_CODE_EXTRACT_DIR(event->id);
  switch (type) {
  case IIO_VOLTAGE:
  case IIO_CURRENT:
  case IIO_POWER:
  case IIO_ACCEL:
  case IIO_ANGL_VEL:
  case IIO_MAGN:
  case IIO_LIGHT:
  case IIO_INTENSITY:
  case IIO_PROXIMITY:
  case IIO_TEMP:
  case IIO_INCLI:
  case IIO_ROT:
  case IIO_ANGL:
  case IIO_TIMESTAMP:
  case IIO_CAPACITANCE:
  case IIO_ALTVOLTAGE:
  case IIO_CCT:
  case IIO_PRESSURE:
  case IIO_HUMIDITYRELATIVE:
  case IIO_ACTIVITY:
  case IIO_STEPS:
    break;
  default:
    return false;
  }
  switch (mod) {
  case IIO_NO_MOD:
  case IIO_MOD_X:
  case IIO_MOD_Y:
  case IIO_MOD_Z:
  case IIO_MOD_X_AND_Y:
  case IIO_MOD_X_AND_Z:
  case IIO_MOD_Y_AND_Z:
  case IIO_MOD_X_AND_Y_AND_Z:
  case IIO_MOD_X_OR_Y:
  case IIO_MOD_X_OR_Z:
  case IIO_MOD_Y_OR_Z:
  case IIO_MOD_X_OR_Y_OR_Z:
  case IIO_MOD_LIGHT_BOTH:
  case IIO_MOD_LIGHT_IR:
  case IIO_MOD_ROOT_SUM_SQUARED_X_Y:
  case IIO_MOD_SUM_SQUARED_X_Y_Z:
  case IIO_MOD_LIGHT_CLEAR:
  case IIO_MOD_LIGHT_RED:
  case IIO_MOD_LIGHT_GREEN:
  case IIO_MOD_LIGHT_BLUE:
  case IIO_MOD_QUATERNION:
  case IIO_MOD_TEMP_AMBIENT:
  case IIO_MOD_TEMP_OBJECT:
  case IIO_MOD_NORTH_MAGN:
  case IIO_MOD_NORTH_TRUE:
  case IIO_MOD_NORTH_MAGN_TILT_COMP:
  case IIO_MOD_NORTH_TRUE_TILT_COMP:
  case IIO_MOD_RUNNING:
  case IIO_MOD_JOGGING:
  case IIO_MOD_WALKING:
  case IIO_MOD_STILL:
    break;
  default:
    return false;
  }
  switch (ev_type) {
  case IIO_EV_TYPE_THRESH:
  case IIO_EV_TYPE_MAG:
  case IIO_EV_TYPE_ROC:
  case IIO_EV_TYPE_THRESH_ADAPTIVE:
  case IIO_EV_TYPE_MAG_ADAPTIVE:
  case IIO_EV_TYPE_CHANGE:
    break;
  default:
    return false;
  }
  switch (dir) {
  case IIO_EV_DIR_EITHER:
  case IIO_EV_DIR_RISING:
  case IIO_EV_DIR_FALLING:
  case IIO_EV_DIR_NONE:
    break;
  default:
    return false;
  }
  return true;
}


x86 assembly (clang, -O0):
<event_is_known>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <IIO_EVENT_CODE_EXTRACT_CHAN_TYPE@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1040 <IIO_EVENT_CODE_EXTRACT_MODIFIER@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1050 <IIO_EVENT_CODE_EXTRACT_TYPE@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1060 <IIO_EVENT_CODE_EXTRACT_DIR@plt>
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
add    $0xffffff80,%eax
sub    $0x8,%eax
jb     11c7 <event_is_known+0x87>
jmp    119b <event_is_known+0x5b>
mov    -0x24(%rbp),%eax
add    $0xffffff59,%eax
sub    $0x5,%eax
jb     11c7 <event_is_known+0x87>
jmp    11b1 <event_is_known+0x71>
mov    -0x24(%rbp),%eax
add    $0xffffff4a,%eax
sub    $0x7,%eax
ja     11cc <event_is_known+0x8c>
jmp    11c7 <event_is_known+0x87>
jmp    11d8 <event_is_known+0x98>
movl   $0x0,-0x4(%rbp)
jmp    1254 <event_is_known+0x114>
mov    -0x18(%rbp),%eax
add    $0xffffff78,%eax
sub    $0x1e,%eax
ja     11f3 <event_is_known+0xb3>
jmp    11ee <event_is_known+0xae>
jmp    11ff <event_is_known+0xbf>
movl   $0x0,-0x4(%rbp)
jmp    1254 <event_is_known+0x114>
mov    -0x1c(%rbp),%eax
add    $0xffffff54,%eax
sub    $0x5,%eax
ja     121a <event_is_known+0xda>
jmp    1215 <event_is_known+0xd5>
jmp    1226 <event_is_known+0xe6>
movl   $0x0,-0x4(%rbp)
jmp    1254 <event_is_known+0x114>
mov    -0x20(%rbp),%eax
add    $0xffffff4e,%eax
sub    $0x3,%eax
ja     1241 <event_is_known+0x101>
jmp    123c <event_is_known+0xfc>
jmp    124d <event_is_known+0x10d>
movl   $0x0,-0x4(%rbp)
jmp    1254 <event_is_known+0x114>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<event_is_known>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbp
mov    (%rdi),%edi
call   1030 <IIO_EVENT_CODE_EXTRACT_CHAN_TYPE@plt>
mov    %eax,%ebx
mov    0x0(%rbp),%edi
call   1040 <IIO_EVENT_CODE_EXTRACT_MODIFIER@plt>
mov    %eax,%r15d
mov    0x0(%rbp),%edi
call   1050 <IIO_EVENT_CODE_EXTRACT_TYPE@plt>
mov    %eax,%r14d
mov    0x0(%rbp),%edi
call   1060 <IIO_EVENT_CODE_EXTRACT_DIR@plt>
mov    %eax,%ecx
xor    %eax,%eax
add    $0xffffff80,%ebx
cmp    $0x3d,%ebx
ja     11b5 <event_is_known+0x75>
movabs $0x3fc00f80000000ff,%rdx
0f c0 3f
bt     %rbx,%rdx
jae    11b5 <event_is_known+0x75>
add    $0xffffff78,%r15d
cmp    $0x1e,%r15d
ja     11b5 <event_is_known+0x75>
add    $0xffffff54,%r14d
cmp    $0x5,%r14d
ja     11b5 <event_is_known+0x75>
add    $0xffffff4e,%ecx
xor    %eax,%eax
cmp    $0x4,%ecx
setb   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.iio_event_data = type { i32 }
define i32 @event_is_known(%struct.iio_event_data* %0) {
%2 = alloca i32
%3 = alloca %struct.iio_event_data*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store %struct.iio_event_data* %0, %struct.iio_event_data** %3
%8 = load %struct.iio_event_data*, %struct.iio_event_data** %3
%9 = getelementptr inbounds %struct.iio_event_data, %struct.iio_event_data* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i32 @IIO_EVENT_CODE_EXTRACT_CHAN_TYPE(i32 %10)
store i32 %11, i32* %4
%12 = load %struct.iio_event_data*, %struct.iio_event_data** %3
%13 = getelementptr inbounds %struct.iio_event_data, %struct.iio_event_data* %12, i32 0, i32 0
%14 = load i32, i32* %13
%15 = call i32 @IIO_EVENT_CODE_EXTRACT_MODIFIER(i32 %14)
store i32 %15, i32* %5
%16 = load %struct.iio_event_data*, %struct.iio_event_data** %3
%17 = getelementptr inbounds %struct.iio_event_data, %struct.iio_event_data* %16, i32 0, i32 0
%18 = load i32, i32* %17
%19 = call i32 @IIO_EVENT_CODE_EXTRACT_TYPE(i32 %18)
store i32 %19, i32* %6
%20 = load %struct.iio_event_data*, %struct.iio_event_data** %3
%21 = getelementptr inbounds %struct.iio_event_data, %struct.iio_event_data* %20, i32 0, i32 0
%22 = load i32, i32* %21
%23 = call i32 @IIO_EVENT_CODE_EXTRACT_DIR(i32 %22)
store i32 %23, i32* %7
%24 = load i32, i32* %4
switch i32 %24, label %26 [
i32 128, label %25
i32 182, label %25
i32 135, label %25
i32 189, label %25
i32 185, label %25
i32 167, label %25
i32 168, label %25
i32 169, label %25
i32 133, label %25
i32 130, label %25
i32 170, label %25
i32 132, label %25
i32 186, label %25
i32 129, label %25
i32 184, label %25
i32 187, label %25
i32 183, label %25
i32 134, label %25
i32 171, label %25
i32 188, label %25
i32 131, label %25
]
25: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
br label %27
26: ; preds = %1
store i32 0, i32* %2
br label %40
27: ; preds = %25
%28 = load i32, i32* %5
switch i32 %28, label %30 [
i32 136, label %29
i32 147, label %29
i32 140, label %29
i32 137, label %29
i32 146, label %29
i32 144, label %29
i32 139, label %29
i32 145, label %29
i32 143, label %29
i32 141, label %29
i32 138, label %29
i32 142, label %29
i32 164, label %29
i32 161, label %29
i32 154, label %29
i32 151, label %29
i32 163, label %29
i32 160, label %29
i32 162, label %29
i32 165, label %29
i32 155, label %29
i32 150, label %29
i32 149, label %29
i32 159, label %29
i32 157, label %29
i32 158, label %29
i32 156, label %29
i32 153, label %29
i32 166, label %29
i32 148, label %29
i32 152, label %29
]
29: ; preds = %27, %27, %27, %27, %27, %27, %27, %27, %27, %27, %27, %27, %27, %27, %27, %27, %27, %27, %27, %27, %27, %27, %27, %27, %27, %27, %27, %27, %27, %27, %27
br label %31
30: ; preds = %27
store i32 0, i32* %2
br label %40
31: ; preds = %29
%32 = load i32, i32* %6
switch i32 %32, label %34 [
i32 173, label %33
i32 176, label %33
i32 174, label %33
i32 172, label %33
i32 175, label %33
i32 177, label %33
]
33: ; preds = %31, %31, %31, %31, %31, %31
br label %35
34: ; preds = %31
store i32 0, i32* %2
br label %40
35: ; preds = %33
%36 = load i32, i32* %7
switch i32 %36, label %38 [
i32 181, label %37
i32 178, label %37
i32 180, label %37
i32 179, label %37
]
37: ; preds = %35, %35, %35, %35
br label %39
38: ; preds = %35
store i32 0, i32* %2
br label %40
39: ; preds = %37
store i32 1, i32* %2
br label %40
40: ; preds = %39, %38, %34, %30, %26
%41 = load i32, i32* %2
ret i32 %41
}

LLVM IR (-O2):
%struct.iio_event_data = type { i32 }
define i32 @event_is_known(%struct.iio_event_data* nocapture %0) {
%2 = getelementptr inbounds %struct.iio_event_data, %struct.iio_event_data* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @IIO_EVENT_CODE_EXTRACT_CHAN_TYPE(i32 %3)
%5 = load i32, i32* %2
%6 = tail call i32 @IIO_EVENT_CODE_EXTRACT_MODIFIER(i32 %5)
%7 = load i32, i32* %2
%8 = tail call i32 @IIO_EVENT_CODE_EXTRACT_TYPE(i32 %7)
%9 = load i32, i32* %2
%10 = tail call i32 @IIO_EVENT_CODE_EXTRACT_DIR(i32 %9)
switch i32 %4, label %21 [
i32 128, label %11
i32 182, label %11
i32 135, label %11
i32 189, label %11
i32 185, label %11
i32 167, label %11
i32 168, label %11
i32 169, label %11
i32 133, label %11
i32 130, label %11
i32 170, label %11
i32 132, label %11
i32 186, label %11
i32 129, label %11
i32 184, label %11
i32 187, label %11
i32 183, label %11
i32 134, label %11
i32 171, label %11
i32 188, label %11
i32 131, label %11
]
11: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
%12 = add i32 %6, -136
%13 = icmp ult i32 %12, 31
%14 = add i32 %8, -172
%15 = icmp ult i32 %14, 6
%16 = select i1 %13, i1 %15, i1 false
br i1 %16, label %17, label %21
17: ; preds = %11
%18 = add i32 %10, -178
%19 = icmp ult i32 %18, 4
%20 = zext i1 %19 to i32
br label %21
21: ; preds = %17, %11, %1
%22 = phi i32 [ 0, %1 ], [ 0, %11 ], [ %20, %17 ]
ret i32 %22
}