#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void usage(int mode) {
  switch (mode) {
  case (0):
    fprintf(stdout, "ERROR: USAGE: spacedesign mode outfile params\n"
                    "\n"
                    "MODE     stom, mtos, rotate\n"
                    "MTOS     spreads from mono image to stereo\n"
                    "MTOS     collapses stereo image to mono, gradually\n"
                    "ROTATE   rotates the source\n"
                    "\n"
                    "Outputs are various control files for enveloping or "
                    "mixing the source.\n"
                    "\n"
                    "This program is usually accessed through an interface on "
                    "the Sound Loom.\n");
    break;
  case (1):
    fprintf(stdout,
            "ERROR: USAGE: spacedesign stom generic_outfilename starttime "
            "endtime endpos\n"
            "\n"
            "STARTTIME    time at which convergence to mono begins.\n"
            "ENDTIME      time at which convergence to mono end.\n"
            "ENDPOS       final position of mono image in stereo field.\n");
    break;
  case (2):
    fprintf(stdout,
            "ERROR: USAGE: spacedesign mtos generic_outfilename starttime "
            "endtime startpos\n"
            "\n"
            "STARTTIME    time at which divergence to stereo begins.\n"
            "ENDTIME      time at which divergence to stereo is complete.\n"
            "ENDPOS       initial position of mono image in stereo field.\n");
    break;
  case (3):
    fprintf(stdout, "ERROR: USAGE: spacedesign rotate generic_outfilename "
                    "starttime endtime startpos endpos\n"
                    "edgetimes width clokwise(0/1) linger loudnessdepth "
                    "loudnesslead attenuation isfilt warp\n"
                    "\n"
                    "STARTTIME     time at which rotation begins.\n"
                    "ENDTIME       time at which rotation ends.\n"
                    "STARTPOS      position of mono image in stereo field when "
                    "rotation starts.\n"
                    "ENDPOS        position of mono image in stereo field when "
                    "rotation ends.\n"
                    "EDGETIMES     file of (increasing) times at which "
                    "rotation is at (alternate) edges of space.\n"
                    "WIDTH         width of rotating circle (0-1) (try 0.9).\n"
                    "CLOKWISE      rotate clockwise(1) or anticlockwise(0).\n"
                    "LINGER        linger at edges of space (0-1) (try 0.15).\n"
                    "LOUDNESSDEPTH difference in level between front and rear "
                    "of circle (>=1) (1 = no difference).\n"
                    "LOUDNESSLEAD  loudest moment precedes central point of "
                    "rotation by (secs).\n"
                    "ATTENUATION   overall attenuation.\n"
                    "ISFILT         (0 or 1) create a file to control balance "
                    "of src and a filtered version of it?\n"
                    "WARP          (1-20) greater warp increases proportion of "
                    "time \"behind\" plane of loudspeakers.\n");
    break;
  }
  fflush(stdout);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x3,%rax
ja     11b3 <usage+0x93>
mov    -0x10(%rbp),%rax
lea    0xeb9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11b3 <usage+0x93>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
lea    0xfee(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11b3 <usage+0x93>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
lea    0x10c8(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11b3 <usage+0x93>
mov    0x2e3b(%rip),%rax
mov    (%rax),%edi
lea    0x11b0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e26(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
cmp    $0x3,%edi
ja     1145 <usage+0x25>
movslq %edi,%rax
lea    0x164c(%rip),%rcx
movslq (%rcx,%rax,4),%rsi
add    %rcx,%rsi
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1030 <fprintf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [344 x i8] c"ERROR: USAGE: spacedesign mode outfile params\0A\0AMODE stom, mtos, rotate\0AMTOS spreads from mono image to stereo\0AMTOS collapses stereo image to mono, gradually\0AROTATE rotates the source\0A\0AOutputs are various control files for enveloping or mixing the source.\0A\0AThis program is usually accessed through an interface on the Sound Loom.\0A\00"
@.str.1 = [244 x i8] c"ERROR: USAGE: spacedesign stom generic_outfilename starttime endtime endpos\0A\0ASTARTTIME time at which convergence to mono begins.\0AENDTIME time at which convergence to mono end.\0AENDPOS final position of mono image in stereo field.\0A\00"
@.str.2 = [258 x i8] c"ERROR: USAGE: spacedesign mtos generic_outfilename starttime endtime startpos\0A\0ASTARTTIME time at which divergence to stereo begins.\0AENDTIME time at which divergence to stereo is complete.\0AENDPOS initial position of mono image in stereo field.\0A\00"
@.str.3 = [1067 x i8] c"ERROR: USAGE: spacedesign rotate generic_outfilename starttime endtime startpos endpos\0Aedgetimes width clokwise(0/1) linger loudnessdepth loudnesslead attenuation isfilt warp\0A\0ASTARTTIME time at which rotation begins.\0AENDTIME time at which rotation ends.\0ASTARTPOS position of mono image in stereo field when rotation starts.\0AENDPOS position of mono image in stereo field when rotation ends.\0AEDGETIMES file of (increasing) times at which rotation is at (alternate) edges of space.\0AWIDTH width of rotating circle (0-1) (try 0.9).\0ACLOKWISE rotate clockwise(1) or anticlockwise(0).\0ALINGER linger at edges of space (0-1) (try 0.15).\0ALOUDNESSDEPTH difference in level between front and rear of circle (>=1) (1 = no difference).\0ALOUDNESSLEAD loudest moment precedes central point of rotation by (secs).\0AATTENUATION overall attenuation.\0AISFILT (0 or 1) create a file to control balance of src and a filtered version of it?\0AWARP (1-20) greater warp increases proportion of time \22behind\22 plane of loudspeakers.\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %16 [
i32 0, label %4
i32 1, label %7
i32 2, label %10
i32 3, label %13
]
4: ; preds = %1
%5 = load i32, i32* @stdout
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([344 x i8], [344 x i8]* @.str, i64 0, i64 0))
br label %16
7: ; preds = %1
%8 = load i32, i32* @stdout
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([244 x i8], [244 x i8]* @.str.1, i64 0, i64 0))
br label %16
10: ; preds = %1
%11 = load i32, i32* @stdout
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([258 x i8], [258 x i8]* @.str.2, i64 0, i64 0))
br label %16
13: ; preds = %1
%14 = load i32, i32* @stdout
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([1067 x i8], [1067 x i8]* @.str.3, i64 0, i64 0))
br label %16
16: ; preds = %1, %13, %10, %7, %4
%17 = load i32, i32* @stdout
%18 = call i32 @fflush(i32 %17)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [344 x i8] c"ERROR: USAGE: spacedesign mode outfile params\0A\0AMODE stom, mtos, rotate\0AMTOS spreads from mono image to stereo\0AMTOS collapses stereo image to mono, gradually\0AROTATE rotates the source\0A\0AOutputs are various control files for enveloping or mixing the source.\0A\0AThis program is usually accessed through an interface on the Sound Loom.\0A\00"
@.str.1 = [244 x i8] c"ERROR: USAGE: spacedesign stom generic_outfilename starttime endtime endpos\0A\0ASTARTTIME time at which convergence to mono begins.\0AENDTIME time at which convergence to mono end.\0AENDPOS final position of mono image in stereo field.\0A\00"
@.str.2 = [258 x i8] c"ERROR: USAGE: spacedesign mtos generic_outfilename starttime endtime startpos\0A\0ASTARTTIME time at which divergence to stereo begins.\0AENDTIME time at which divergence to stereo is complete.\0AENDPOS initial position of mono image in stereo field.\0A\00"
@.str.3 = [1067 x i8] c"ERROR: USAGE: spacedesign rotate generic_outfilename starttime endtime startpos endpos\0Aedgetimes width clokwise(0/1) linger loudnessdepth loudnesslead attenuation isfilt warp\0A\0ASTARTTIME time at which rotation begins.\0AENDTIME time at which rotation ends.\0ASTARTPOS position of mono image in stereo field when rotation starts.\0AENDPOS position of mono image in stereo field when rotation ends.\0AEDGETIMES file of (increasing) times at which rotation is at (alternate) edges of space.\0AWIDTH width of rotating circle (0-1) (try 0.9).\0ACLOKWISE rotate clockwise(1) or anticlockwise(0).\0ALINGER linger at edges of space (0-1) (try 0.15).\0ALOUDNESSDEPTH difference in level between front and rear of circle (>=1) (1 = no difference).\0ALOUDNESSLEAD loudest moment precedes central point of rotation by (secs).\0AATTENUATION overall attenuation.\0AISFILT (0 or 1) create a file to control balance of src and a filtered version of it?\0AWARP (1-20) greater warp increases proportion of time \22behind\22 plane of loudspeakers.\0A\00"
@reltable.usage = [4 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([344 x i8]* @.str to i64), i64 ptrtoint ([4 x i32]* @reltable.usage to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([244 x i8]* @.str.1 to i64), i64 ptrtoint ([4 x i32]* @reltable.usage to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([258 x i8]* @.str.2 to i64), i64 ptrtoint ([4 x i32]* @reltable.usage to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1067 x i8]* @.str.3 to i64), i64 ptrtoint ([4 x i32]* @reltable.usage to i64)) to i32)]
define void @usage(i32 %0) {
%2 = icmp ult i32 %0, 4
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([4 x i32]* @reltable.usage to i8*), i64 %5)
%7 = load i32, i32* @stdout
%8 = tail call i32 @fprintf(i32 %7, i8* %6)
br label %9
9: ; preds = %1, %3
%10 = load i32, i32* @stdout
%11 = tail call i32 @fflush(i32 %10)
ret void
}