#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 */
#define EBUSY 132
#define ENODEV 131
#define ENOENT 130
#define ENOSPC 129
#define ENXIO 128
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void describe_error(int err) {
  switch (err) {
  case ENODEV:
    fprintf(stderr, "The device file was found in /dev but\n"
                    "OSS is not loaded. You need to load it by executing\n"
                    "the soundon command.\n");
    break;
  case ENXIO:
    fprintf(stderr, "There are no sound devices available.\n"
                    "The most likely reason is that the device you have\n"
                    "is malfunctioning or it's not supported by OSS.\n"
                    "It's also possible that you are trying to use the wrong "
                    "device file.\n"
                    "Please fill the problem report at\n"
                    "http://www.opensound.com/support.cgi\n");
    break;
  case ENOSPC:
    fprintf(stderr, "Your system cannot allocate memory for the device\n"
                    "buffers. Reboot your machine and try again.\n");
    break;
  case ENOENT:
    fprintf(
        stderr,
        "The device file is missing from /dev.\n"
        "Perhaps you have not installed and started Open Sound System yet\n");
    break;
  case EBUSY:
    fprintf(stderr, "The device is busy. There is some other application\n"
                    "using it.\n");
    break;
  default:;
  }
}


x86 assembly (clang, -O0):
<describe_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x4,%eax
ja     11c6 <describe_error+0xb6>
mov    -0x10(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11cb <describe_error+0xbb>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
lea    0xf16(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11cb <describe_error+0xbb>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
lea    0x1012(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11cb <describe_error+0xbb>
mov    0x2e47(%rip),%rax
mov    (%rax),%edi
lea    0x1057(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11cb <describe_error+0xbb>
mov    0x2e2d(%rip),%rax
mov    (%rax),%edi
lea    0x10a5(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11cb <describe_error+0xbb>
jmp    11cb <describe_error+0xbb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<describe_error>:
add    $0xffffff80,%edi
cmp    $0x4,%edi
ja     1137 <describe_error+0x27>
movslq %edi,%rax
lea    0x116a(%rip),%rcx
movslq (%rcx,%rax,4),%rsi
add    %rcx,%rsi
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fprintf@plt>
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [112 x i8] c"The device file was found in /dev but\0AOSS is not loaded. You need to load it by executing\0Athe soundon command.\0A\00"
@.str.1 = [278 x i8] c"There are no sound devices available.\0AThe most likely reason is that the device you have\0Ais malfunctioning or it's not supported by OSS.\0AIt's also possible that you are trying to use the wrong device file.\0APlease fill the problem report at\0Ahttp://www.opensound.com/support.cgi\0A\00"
@.str.2 = [95 x i8] c"Your system cannot allocate memory for the device\0Abuffers. Reboot your machine and try again.\0A\00"
@.str.3 = [104 x i8] c"The device file is missing from /dev.\0APerhaps you have not installed and started Open Sound System yet\0A\00"
@.str.4 = [63 x i8] c"The device is busy. There is some other application\0Ausing it.\0A\00"
define void @describe_error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %19 [
i32 131, label %4
i32 128, label %7
i32 129, label %10
i32 130, label %13
i32 132, label %16
]
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str, i64 0, i64 0))
br label %20
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([278 x i8], [278 x i8]* @.str.1, i64 0, i64 0))
br label %20
10: ; preds = %1
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str.2, i64 0, i64 0))
br label %20
13: ; preds = %1
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([104 x i8], [104 x i8]* @.str.3, i64 0, i64 0))
br label %20
16: ; preds = %1
%17 = load i32, i32* @stderr
%18 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.4, i64 0, i64 0))
br label %20
19: ; preds = %1
br label %20
20: ; preds = %19, %16, %13, %10, %7, %4
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [112 x i8] c"The device file was found in /dev but\0AOSS is not loaded. You need to load it by executing\0Athe soundon command.\0A\00"
@.str.1 = [278 x i8] c"There are no sound devices available.\0AThe most likely reason is that the device you have\0Ais malfunctioning or it's not supported by OSS.\0AIt's also possible that you are trying to use the wrong device file.\0APlease fill the problem report at\0Ahttp://www.opensound.com/support.cgi\0A\00"
@.str.2 = [95 x i8] c"Your system cannot allocate memory for the device\0Abuffers. Reboot your machine and try again.\0A\00"
@.str.3 = [104 x i8] c"The device file is missing from /dev.\0APerhaps you have not installed and started Open Sound System yet\0A\00"
@.str.4 = [63 x i8] c"The device is busy. There is some other application\0Ausing it.\0A\00"
@reltable.describe_error = [5 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([278 x i8]* @.str.1 to i64), i64 ptrtoint ([5 x i32]* @reltable.describe_error to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([95 x i8]* @.str.2 to i64), i64 ptrtoint ([5 x i32]* @reltable.describe_error to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([104 x i8]* @.str.3 to i64), i64 ptrtoint ([5 x i32]* @reltable.describe_error to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([112 x i8]* @.str to i64), i64 ptrtoint ([5 x i32]* @reltable.describe_error to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([63 x i8]* @.str.4 to i64), i64 ptrtoint ([5 x i32]* @reltable.describe_error to i64)) to i32)]
define void @describe_error(i32 %0) {
%2 = add i32 %0, -128
%3 = icmp ult i32 %2, 5
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([5 x i32]* @reltable.describe_error to i8*), i64 %6)
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* %7)
br label %10
10: ; preds = %1, %4
ret void
}