#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 __VERIFIER_nondet_int();
int /*<<< orphan*/ filt_sysmon_power_rdetach();
int /*<<< orphan*/ filt_sysmon_power_read();
int /*<<< orphan*/ sysmon_power_daemon_task();
int /*<<< orphan*/ sysmonclose_power();
int /*<<< orphan*/ sysmonioctl_power();
int /*<<< orphan*/ sysmonkqfilter_power();
int /*<<< orphan*/ sysmonopen_power();
int /*<<< orphan*/ sysmonpoll_power();
int /*<<< orphan*/ sysmonread_power();
void *thr1(void *arg) {
  while (1)
    switch (__VERIFIER_nondet_int()) {
    case 0:
      sysmon_power_daemon_task();
      break;
    case 1:
      sysmonopen_power();
      break;
    case 2:
      sysmonclose_power();
      break;
    case 3:
      sysmonread_power();
      break;
    case 4:
      sysmonpoll_power();
      break;
    case 5:
      filt_sysmon_power_rdetach();
      break;
    case 6:
      filt_sysmon_power_read();
      break;
    case 7:
      sysmonkqfilter_power();
      break;
    case 8:
      sysmonioctl_power();
      break;
    }
}


x86 assembly (clang, -O0):
<thr1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
call   1080 <__VERIFIER_nondet_int@plt>
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x8,%eax
ja     123d <thr1+0x9d>
mov    -0x10(%rbp),%rax
lea    0xe33(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   10c0 <sysmon_power_daemon_task@plt>
jmp    123d <thr1+0x9d>
mov    $0x0,%al
call   1070 <sysmonopen_power@plt>
jmp    123d <thr1+0x9d>
mov    $0x0,%al
call   1090 <sysmonclose_power@plt>
jmp    123d <thr1+0x9d>
mov    $0x0,%al
call   10b0 <sysmonread_power@plt>
jmp    123d <thr1+0x9d>
mov    $0x0,%al
call   1050 <sysmonpoll_power@plt>
jmp    123d <thr1+0x9d>
mov    $0x0,%al
call   1060 <filt_sysmon_power_rdetach@plt>
jmp    123d <thr1+0x9d>
mov    $0x0,%al
call   10a0 <filt_sysmon_power_read@plt>
jmp    123d <thr1+0x9d>
mov    $0x0,%al
call   1030 <sysmonkqfilter_power@plt>
jmp    123d <thr1+0x9d>
mov    $0x0,%al
call   1040 <sysmonioctl_power@plt>
jmp    11ac <thr1+0xc>

x86 assembly (clang, -O2):
<thr1>:
push   %rbx
lea    0xe58(%rip),%rbx
jmp    11c0 <thr1+0x20>
xor    %eax,%eax
call   1040 <sysmonioctl_power@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1080 <__VERIFIER_nondet_int@plt>
cmp    $0x8,%eax
ja     11c0 <thr1+0x20>
mov    %eax,%eax
movslq (%rbx,%rax,4),%rax
add    %rbx,%rax
jmp    *%rax
xor    %eax,%eax
call   10c0 <sysmon_power_daemon_task@plt>
jmp    11c0 <thr1+0x20>
xor    %eax,%eax
call   1070 <sysmonopen_power@plt>
jmp    11c0 <thr1+0x20>
xor    %eax,%eax
call   1090 <sysmonclose_power@plt>
jmp    11c0 <thr1+0x20>
xor    %eax,%eax
call   10b0 <sysmonread_power@plt>
jmp    11c0 <thr1+0x20>
xor    %eax,%eax
call   1050 <sysmonpoll_power@plt>
jmp    11c0 <thr1+0x20>
xor    %eax,%eax
call   1060 <filt_sysmon_power_rdetach@plt>
jmp    11c0 <thr1+0x20>
xor    %eax,%eax
call   10a0 <filt_sysmon_power_read@plt>
jmp    11c0 <thr1+0x20>
xor    %eax,%eax
call   1030 <sysmonkqfilter_power@plt>
jmp    11c0 <thr1+0x20>

LLVM IR (-O0):
define i8* @thr1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %23
%4 = call i32 (...) @__VERIFIER_nondet_int()
switch i32 %4, label %23 [
i32 0, label %5
i32 1, label %7
i32 2, label %9
i32 3, label %11
i32 4, label %13
i32 5, label %15
i32 6, label %17
i32 7, label %19
i32 8, label %21
]
5: ; preds = %3
%6 = call i32 (...) @sysmon_power_daemon_task()
br label %23
7: ; preds = %3
%8 = call i32 (...) @sysmonopen_power()
br label %23
9: ; preds = %3
%10 = call i32 (...) @sysmonclose_power()
br label %23
11: ; preds = %3
%12 = call i32 (...) @sysmonread_power()
br label %23
13: ; preds = %3
%14 = call i32 (...) @sysmonpoll_power()
br label %23
15: ; preds = %3
%16 = call i32 (...) @filt_sysmon_power_rdetach()
br label %23
17: ; preds = %3
%18 = call i32 (...) @filt_sysmon_power_read()
br label %23
19: ; preds = %3
%20 = call i32 (...) @sysmonkqfilter_power()
br label %23
21: ; preds = %3
%22 = call i32 (...) @sysmonioctl_power()
br label %23
23: ; preds = %3, %21, %19, %17, %15, %13, %11, %9, %7, %5
br label %3
}

LLVM IR (-O2):
define noalias i8* @thr1(i8* nocapture readnone %0) {
br label %2
2: ; preds = %4, %1
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
switch i32 %3, label %4 [
i32 0, label %5
i32 1, label %7
i32 2, label %9
i32 3, label %11
i32 4, label %13
i32 5, label %15
i32 6, label %17
i32 7, label %19
i32 8, label %21
]
4: ; preds = %2, %21, %19, %17, %15, %13, %11, %9, %7, %5
br label %2
5: ; preds = %2
%6 = tail call i32 (...) @sysmon_power_daemon_task()
br label %4
7: ; preds = %2
%8 = tail call i32 (...) @sysmonopen_power()
br label %4
9: ; preds = %2
%10 = tail call i32 (...) @sysmonclose_power()
br label %4
11: ; preds = %2
%12 = tail call i32 (...) @sysmonread_power()
br label %4
13: ; preds = %2
%14 = tail call i32 (...) @sysmonpoll_power()
br label %4
15: ; preds = %2
%16 = tail call i32 (...) @filt_sysmon_power_rdetach()
br label %4
17: ; preds = %2
%18 = tail call i32 (...) @filt_sysmon_power_read()
br label %4
19: ; preds = %2
%20 = tail call i32 (...) @sysmonkqfilter_power()
br label %4
21: ; preds = %2
%22 = tail call i32 (...) @sysmonioctl_power()
br label %4
}