#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 /*<<< orphan*/ alsa_setup(int);
int /*<<< orphan*/ dsp_setup(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout_setup(int);
void sound_setup(int rate, int outp) {
  switch (outp) {
  case 1:
    alsa_setup(rate);
    break;
  case 2:
    dsp_setup(rate);
    break;
  case 3:
    stdout_setup(rate);
    break;
  default:
    fprintf(stderr, "Unknown output method\n");
  }
}


x86 assembly (clang, -O0):
<sound_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     1184 <sound_setup+0x44>
jmp    1162 <sound_setup+0x22>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1191 <sound_setup+0x51>
jmp    1173 <sound_setup+0x33>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     119e <sound_setup+0x5e>
jmp    11ab <sound_setup+0x6b>
mov    -0x4(%rbp),%edi
call   1040 <alsa_setup@plt>
jmp    11c0 <sound_setup+0x80>
mov    -0x4(%rbp),%edi
call   1060 <dsp_setup@plt>
jmp    11c0 <sound_setup+0x80>
mov    -0x4(%rbp),%edi
call   1050 <stdout_setup@plt>
jmp    11c0 <sound_setup+0x80>
mov    0x2e2e(%rip),%rax
mov    (%rax),%edi
lea    0xe45(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sound_setup>:
cmp    $0x3,%esi
je     1154 <sound_setup+0x14>
cmp    $0x2,%esi
je     1159 <sound_setup+0x19>
cmp    $0x1,%esi
jne    115e <sound_setup+0x1e>
jmp    1040 <alsa_setup@plt>
jmp    1050 <stdout_setup@plt>
jmp    1060 <dsp_setup@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
lea    0xe92(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"Unknown output method\0A\00"
define void @sound_setup(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
switch i32 %5, label %15 [
i32 1, label %6
i32 2, label %9
i32 3, label %12
]
6: ; preds = %2
%7 = load i32, i32* %3
%8 = call i32 @alsa_setup(i32 %7)
br label %18
9: ; preds = %2
%10 = load i32, i32* %3
%11 = call i32 @dsp_setup(i32 %10)
br label %18
12: ; preds = %2
%13 = load i32, i32* %3
%14 = call i32 @stdout_setup(i32 %13)
br label %18
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %15, %12, %9, %6
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Unknown output method\0A\00"
define void @sound_setup(i32 %0, i32 %1) {
switch i32 %1, label %9 [
i32 1, label %3
i32 2, label %5
i32 3, label %7
]
3: ; preds = %2
%4 = tail call i32 @alsa_setup(i32 %0)
br label %12
5: ; preds = %2
%6 = tail call i32 @dsp_setup(i32 %0)
br label %12
7: ; preds = %2
%8 = tail call i32 @stdout_setup(i32 %0)
br label %12
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %7, %5, %3
ret void
}