#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 203
#define IIO_ACTIVITY 202
#define IIO_ALTVOLTAGE 201
#define IIO_ANGL 200
#define IIO_ANGL_VEL 199
#define IIO_CAPACITANCE 198
#define IIO_CCT 197
#define IIO_CONCENTRATION 196
#define IIO_CURRENT 195
#define IIO_DISTANCE 194
#define IIO_ENERGY 193
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 192
#define IIO_EV_DIR_FALLING 191
#define IIO_EV_DIR_NONE 190
#define IIO_EV_DIR_RISING 189
#define IIO_EV_TYPE_CHANGE 188
#define IIO_EV_TYPE_MAG 187
#define IIO_EV_TYPE_MAG_ADAPTIVE 186
#define IIO_EV_TYPE_ROC 185
#define IIO_EV_TYPE_THRESH 184
#define IIO_EV_TYPE_THRESH_ADAPTIVE 183
#define IIO_GRAVITY 182
#define IIO_HUMIDITYRELATIVE 181
#define IIO_INCLI 180
#define IIO_INTENSITY 179
#define IIO_LIGHT 178
#define IIO_MAGN 177
#define IIO_MOD_CO2 176
#define IIO_MOD_I 175
#define IIO_MOD_JOGGING 174
#define IIO_MOD_LIGHT_BLUE 173
#define IIO_MOD_LIGHT_BOTH 172
#define IIO_MOD_LIGHT_CLEAR 171
#define IIO_MOD_LIGHT_GREEN 170
#define IIO_MOD_LIGHT_IR 169
#define IIO_MOD_LIGHT_RED 168
#define IIO_MOD_LIGHT_UV 167
#define IIO_MOD_NORTH_MAGN 166
#define IIO_MOD_NORTH_MAGN_TILT_COMP 165
#define IIO_MOD_NORTH_TRUE 164
#define IIO_MOD_NORTH_TRUE_TILT_COMP 163
#define IIO_MOD_Q 162
#define IIO_MOD_QUATERNION 161
#define IIO_MOD_ROOT_SUM_SQUARED_X_Y 160
#define IIO_MOD_ROOT_SUM_SQUARED_X_Y_Z 159
#define IIO_MOD_RUNNING 158
#define IIO_MOD_STILL 157
#define IIO_MOD_SUM_SQUARED_X_Y_Z 156
#define IIO_MOD_TEMP_AMBIENT 155
#define IIO_MOD_TEMP_OBJECT 154
#define IIO_MOD_VOC 153
#define IIO_MOD_WALKING 152
#define IIO_MOD_X 151
#define IIO_MOD_X_AND_Y 150
#define IIO_MOD_X_AND_Y_AND_Z 149
#define IIO_MOD_X_AND_Z 148
#define IIO_MOD_X_OR_Y 147
#define IIO_MOD_X_OR_Y_OR_Z 146
#define IIO_MOD_X_OR_Z 145
#define IIO_MOD_Y 144
#define IIO_MOD_Y_AND_Z 143
#define IIO_MOD_Y_OR_Z 142
#define IIO_MOD_Z 141
#define IIO_NO_MOD 140
#define IIO_PH 139
#define IIO_POWER 138
#define IIO_PRESSURE 137
#define IIO_PROXIMITY 136
#define IIO_RESISTANCE 135
#define IIO_ROT 134
#define IIO_STEPS 133
#define IIO_TEMP 132
#define IIO_TIMESTAMP 131
#define IIO_UVINDEX 130
#define IIO_VELOCITY 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:
  case IIO_ENERGY:
  case IIO_DISTANCE:
  case IIO_VELOCITY:
  case IIO_CONCENTRATION:
  case IIO_RESISTANCE:
  case IIO_PH:
  case IIO_UVINDEX:
  case IIO_GRAVITY:
    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_LIGHT_UV:
  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:
  case IIO_MOD_ROOT_SUM_SQUARED_X_Y_Z:
  case IIO_MOD_I:
  case IIO_MOD_Q:
  case IIO_MOD_CO2:
  case IIO_MOD_VOC:
    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    $0xc,%eax
jb     11c7 <event_is_known+0x87>
jmp    119b <event_is_known+0x5b>
mov    -0x24(%rbp),%eax
add    $0xffffff4f,%eax
sub    $0x6,%eax
jb     11c7 <event_is_known+0x87>
jmp    11b1 <event_is_known+0x71>
mov    -0x24(%rbp),%eax
add    $0xffffff3f,%eax
sub    $0xa,%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    $0xffffff74,%eax
sub    $0x24,%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    $0xffffff49,%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    $0xffffff43,%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,%rbx
mov    (%rdi),%edi
call   1030 <IIO_EVENT_CODE_EXTRACT_CHAN_TYPE@plt>
mov    %eax,%r15d
mov    (%rbx),%edi
call   1040 <IIO_EVENT_CODE_EXTRACT_MODIFIER@plt>
mov    %eax,%ebp
mov    (%rbx),%edi
call   1050 <IIO_EVENT_CODE_EXTRACT_TYPE@plt>
mov    %eax,%r14d
mov    (%rbx),%edi
call   1060 <IIO_EVENT_CODE_EXTRACT_DIR@plt>
mov    %eax,%ecx
xor    %eax,%eax
lea    -0xb1(%r15),%edx
cmp    $0x1a,%edx
ja     1188 <event_is_known+0x48>
mov    $0x7ff003f,%esi
bt     %edx,%esi
jb     1192 <event_is_known+0x52>
add    $0xffffff80,%r15d
cmp    $0xc,%r15d
jae    11b8 <event_is_known+0x78>
add    $0xffffff74,%ebp
cmp    $0x24,%ebp
ja     11b8 <event_is_known+0x78>
add    $0xffffff49,%r14d
cmp    $0x5,%r14d
ja     11b8 <event_is_known+0x78>
add    $0xffffff43,%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 195, label %25
i32 138, label %25
i32 203, label %25
i32 199, label %25
i32 177, label %25
i32 178, label %25
i32 179, label %25
i32 136, label %25
i32 132, label %25
i32 180, label %25
i32 134, label %25
i32 200, label %25
i32 131, label %25
i32 198, label %25
i32 201, label %25
i32 197, label %25
i32 137, label %25
i32 181, label %25
i32 202, label %25
i32 133, label %25
i32 193, label %25
i32 194, label %25
i32 129, label %25
i32 196, label %25
i32 135, label %25
i32 139, label %25
i32 130, label %25
i32 182, 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, %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 140, label %29
i32 151, label %29
i32 144, label %29
i32 141, label %29
i32 150, label %29
i32 148, label %29
i32 143, label %29
i32 149, label %29
i32 147, label %29
i32 145, label %29
i32 142, label %29
i32 146, label %29
i32 172, label %29
i32 169, label %29
i32 160, label %29
i32 156, label %29
i32 171, label %29
i32 168, label %29
i32 170, label %29
i32 173, label %29
i32 167, label %29
i32 161, label %29
i32 155, label %29
i32 154, label %29
i32 166, label %29
i32 164, label %29
i32 165, label %29
i32 163, label %29
i32 158, label %29
i32 174, label %29
i32 152, label %29
i32 157, label %29
i32 159, label %29
i32 175, label %29
i32 162, label %29
i32 176, label %29
i32 153, 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, %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 184, label %33
i32 187, label %33
i32 185, label %33
i32 183, label %33
i32 186, label %33
i32 188, 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 192, label %37
i32 189, label %37
i32 191, label %37
i32 190, 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 195, label %11
i32 138, label %11
i32 203, label %11
i32 199, label %11
i32 177, label %11
i32 178, label %11
i32 179, label %11
i32 136, label %11
i32 132, label %11
i32 180, label %11
i32 134, label %11
i32 200, label %11
i32 131, label %11
i32 198, label %11
i32 201, label %11
i32 197, label %11
i32 137, label %11
i32 181, label %11
i32 202, label %11
i32 133, label %11
i32 193, label %11
i32 194, label %11
i32 129, label %11
i32 196, label %11
i32 135, label %11
i32 139, label %11
i32 130, label %11
i32 182, 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, %1, %1, %1, %1, %1, %1, %1, %1
%12 = add i32 %6, -140
%13 = icmp ult i32 %12, 37
%14 = add i32 %8, -183
%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, -189
%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
}