#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 CdAudio435DeviceControl(int, int);
int CdAudio535DeviceControl(int, int);
int CdAudioAtapiDeviceControl(int, int);
int CdAudioHPCdrDeviceControl(int, int);
int CdAudioSendToNextDriver(int, int);
int __VERIFIER_nondet_int();
int CdAudioDeviceControl(int DeviceObject, int Irp) {
  int deviceExtension__Active = __VERIFIER_nondet_int();
  int status;
  {
    if (deviceExtension__Active == 2) {
      goto switch_2_2;
    } else {
      if (deviceExtension__Active == 3) {
        goto switch_2_3;
      } else {
        if (deviceExtension__Active == 1) {
          goto switch_2_1;
        } else {
          if (deviceExtension__Active == 7) {
            goto switch_2_7;
          } else {
            goto switch_2_default;
            if (0) {
            switch_2_2 : {
              status = CdAudio535DeviceControl(DeviceObject, Irp);
            }
              goto switch_2_break;
            switch_2_3 : {
              status = CdAudio435DeviceControl(DeviceObject, Irp);
            }
              goto switch_2_break;
            switch_2_1 : {
              status = CdAudioAtapiDeviceControl(DeviceObject, Irp);
            }
              goto switch_2_break;
            switch_2_7 : {
              status = CdAudioHPCdrDeviceControl(DeviceObject, Irp);
            }
              goto switch_2_break;
            switch_2_default : {
              deviceExtension__Active = 0;
              status = CdAudioSendToNextDriver(DeviceObject, Irp);
            }
            } else {
            switch_2_break:;
            }
          }
        }
      }
    }
    return (status);
  }
}


x86 assembly (clang, -O0):
<CdAudioDeviceControl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jne    1187 <CdAudioDeviceControl+0x27>
jmp    11b9 <CdAudioDeviceControl+0x59>
cmpl   $0x3,-0xc(%rbp)
jne    1196 <CdAudioDeviceControl+0x36>
jmp    11cc <CdAudioDeviceControl+0x6c>
cmpl   $0x1,-0xc(%rbp)
jne    11a5 <CdAudioDeviceControl+0x45>
jmp    11df <CdAudioDeviceControl+0x7f>
cmpl   $0x7,-0xc(%rbp)
jne    11b4 <CdAudioDeviceControl+0x54>
jmp    11f2 <CdAudioDeviceControl+0x92>
jmp    1205 <CdAudioDeviceControl+0xa5>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1060 <CdAudio535DeviceControl@plt>
mov    %eax,-0x10(%rbp)
jmp    121f <CdAudioDeviceControl+0xbf>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1070 <CdAudio435DeviceControl@plt>
mov    %eax,-0x10(%rbp)
jmp    121f <CdAudioDeviceControl+0xbf>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <CdAudioAtapiDeviceControl@plt>
mov    %eax,-0x10(%rbp)
jmp    121f <CdAudioDeviceControl+0xbf>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <CdAudioHPCdrDeviceControl@plt>
mov    %eax,-0x10(%rbp)
jmp    121f <CdAudioDeviceControl+0xbf>
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1080 <CdAudioSendToNextDriver@plt>
mov    %eax,-0x10(%rbp)
jmp    1224 <CdAudioDeviceControl+0xc4>
jmp    1224 <CdAudioDeviceControl+0xc4>
jmp    1229 <CdAudioDeviceControl+0xc9>
jmp    122e <CdAudioDeviceControl+0xce>
jmp    1233 <CdAudioDeviceControl+0xd3>
jmp    1238 <CdAudioDeviceControl+0xd8>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CdAudioDeviceControl>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <__VERIFIER_nondet_int@plt>
add    $0xffffffff,%eax
cmp    $0x6,%eax
ja     11b3 <CdAudioDeviceControl+0x53>
lea    0xe83(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <CdAudioAtapiDeviceControl@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <CdAudio535DeviceControl@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1070 <CdAudio435DeviceControl@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1080 <CdAudioSendToNextDriver@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <CdAudioHPCdrDeviceControl@plt>

LLVM IR (-O0):
define i32 @CdAudioDeviceControl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %2
br label %26
11: ; preds = %2
%12 = load i32, i32* %5
%13 = icmp eq i32 %12, 3
br i1 %13, label %14, label %15
14: ; preds = %11
br label %30
15: ; preds = %11
%16 = load i32, i32* %5
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %19
18: ; preds = %15
br label %34
19: ; preds = %15
%20 = load i32, i32* %5
%21 = icmp eq i32 %20, 7
br i1 %21, label %22, label %23
22: ; preds = %19
br label %38
23: ; preds = %19
br label %42
24: ; No predecessors!
br i1 false, label %25, label %46
25: ; preds = %24
br label %26
26: ; preds = %25, %10
%27 = load i32, i32* %3
%28 = load i32, i32* %4
%29 = call i32 @CdAudio535DeviceControl(i32 %27, i32 %28)
store i32 %29, i32* %6
br label %47
30: ; preds = %14
%31 = load i32, i32* %3
%32 = load i32, i32* %4
%33 = call i32 @CdAudio435DeviceControl(i32 %31, i32 %32)
store i32 %33, i32* %6
br label %47
34: ; preds = %18
%35 = load i32, i32* %3
%36 = load i32, i32* %4
%37 = call i32 @CdAudioAtapiDeviceControl(i32 %35, i32 %36)
store i32 %37, i32* %6
br label %47
38: ; preds = %22
%39 = load i32, i32* %3
%40 = load i32, i32* %4
%41 = call i32 @CdAudioHPCdrDeviceControl(i32 %39, i32 %40)
store i32 %41, i32* %6
br label %47
42: ; preds = %23
store i32 0, i32* %5
%43 = load i32, i32* %3
%44 = load i32, i32* %4
%45 = call i32 @CdAudioSendToNextDriver(i32 %43, i32 %44)
store i32 %45, i32* %6
br label %48
46: ; preds = %24
br label %47
47: ; preds = %46, %38, %34, %30, %26
br label %48
48: ; preds = %47, %42
br label %49
49: ; preds = %48
br label %50
50: ; preds = %49
br label %51
51: ; preds = %50
br label %52
52: ; preds = %51
%53 = load i32, i32* %6
ret i32 %53
}

LLVM IR (-O2):
define i32 @CdAudioDeviceControl(i32 %0, i32 %1) {
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
switch i32 %3, label %12 [
i32 2, label %4
i32 3, label %6
i32 1, label %8
i32 7, label %10
]
4: ; preds = %2
%5 = tail call i32 @CdAudio535DeviceControl(i32 %0, i32 %1)
br label %14
6: ; preds = %2
%7 = tail call i32 @CdAudio435DeviceControl(i32 %0, i32 %1)
br label %14
8: ; preds = %2
%9 = tail call i32 @CdAudioAtapiDeviceControl(i32 %0, i32 %1)
br label %14
10: ; preds = %2
%11 = tail call i32 @CdAudioHPCdrDeviceControl(i32 %0, i32 %1)
br label %14
12: ; preds = %2
%13 = tail call i32 @CdAudioSendToNextDriver(i32 %0, i32 %1)
br label %14
14: ; preds = %4, %6, %8, %10, %12
%15 = phi i32 [ %5, %4 ], [ %7, %6 ], [ %9, %8 ], [ %11, %10 ], [ %13, %12 ]
ret i32 %15
}